|
@@ -125,7 +125,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
userVO.setTaskCount(rankCountInfos.get(i).getCount());
|
|
userVO.setTaskCount(rankCountInfos.get(i).getCount());
|
|
userVOS.add(userVO);
|
|
userVOS.add(userVO);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
return userVOS;
|
|
return userVOS;
|
|
}
|
|
}
|
|
@@ -214,10 +213,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
//获取机构排名
|
|
//获取机构排名
|
|
String agencyName = agencyDao.findById(Long.parseLong(agencyId)).get().getEvaluationAgencyName();
|
|
String agencyName = agencyDao.findById(Long.parseLong(agencyId)).get().getEvaluationAgencyName();
|
|
- List<EvolutionAgencyVO> agencyRank = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
|
|
|
+ List<EvaluationAgencyVO> agencyRank = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
if (agency != null && !agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
if (agency != null && !agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
- EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
|
|
|
+ EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
agencyVO.setTaskCount(rankInfo.getCount());
|
|
agencyVO.setTaskCount(rankInfo.getCount());
|
|
@@ -227,7 +226,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
- List<EvolutionAgencyVO> agencyRanks = new ArrayList<>();
|
|
|
|
|
|
+ List<EvaluationAgencyVO> agencyRanks = new ArrayList<>();
|
|
if (agencyRank.size() > top) {
|
|
if (agencyRank.size() > top) {
|
|
for (int i = 0; i < top; i++) {
|
|
for (int i = 0; i < top; i++) {
|
|
agencyRanks.add(agencyRank.get(i));
|
|
agencyRanks.add(agencyRank.get(i));
|
|
@@ -315,10 +314,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
// 获取合作机构
|
|
// 获取合作机构
|
|
List<ResidentAgency> allResidentAgency = commonRepo.getAllResidentAgency();
|
|
List<ResidentAgency> allResidentAgency = commonRepo.getAllResidentAgency();
|
|
- List<EvolutionAgencyVO> agencyVOS = allResidentAgency.stream().map(residentAgency -> {
|
|
|
|
|
|
+ List<EvaluationAgencyVO> agencyVOS = allResidentAgency.stream().map(residentAgency -> {
|
|
EvaluationAgency agency = evaluationAgencyRepo.findAgencyById(residentAgency.getAgencyId());
|
|
EvaluationAgency agency = evaluationAgencyRepo.findAgencyById(residentAgency.getAgencyId());
|
|
- EvolutionAgencyVO evolutionAgencyVO = new EvolutionAgencyVO(agency);
|
|
|
|
- return evolutionAgencyVO;
|
|
|
|
|
|
+ EvaluationAgencyVO evalutionAgencyVO = new EvaluationAgencyVO(agency);
|
|
|
|
+ return evalutionAgencyVO;
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
indexInfoDTO.setApplicationTypeRank(applicationTypeRanks);
|
|
indexInfoDTO.setApplicationTypeRank(applicationTypeRanks);
|
|
@@ -336,7 +335,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public IndexDTO renderIndex() {
|
|
public IndexDTO renderIndex() {
|
|
-
|
|
|
|
Pageable pageable = PageRequest.of(0, 10);
|
|
Pageable pageable = PageRequest.of(0, 10);
|
|
//获取用户排名
|
|
//获取用户排名
|
|
List<UserVO> userRanks = projectDao.findTotalPriceOfUser(pageable).stream().map(rankInfo -> {
|
|
List<UserVO> userRanks = projectDao.findTotalPriceOfUser(pageable).stream().map(rankInfo -> {
|
|
@@ -351,10 +349,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
return null;
|
|
return null;
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
//获取机构排名
|
|
//获取机构排名
|
|
- List<EvolutionAgencyVO> agencyRanks = taskToUserDao.findTotalPriceOfAgency(pageable).stream().map(rankInfo -> {
|
|
|
|
|
|
+ List<EvaluationAgencyVO> agencyRanks = taskToUserDao.findTotalPriceOfAgency(pageable).stream().map(rankInfo -> {
|
|
EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
if (agency != null) {
|
|
if (agency != null) {
|
|
- EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
|
|
|
+ EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
agencyVO.setAllTaskPrice(rankInfo.getTotalPrice());
|
|
agencyVO.setAllTaskPrice(rankInfo.getTotalPrice());
|
|
@@ -642,15 +640,24 @@ public class WebMediatorImpl implements ViewMediator {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ReportDetailsDTO renderProjectReportDetails(String projectCode, String reportCode, Long userId) {
|
|
|
|
|
|
+ public ReportDetailsDTO renderProjectReportDetails(String projectCode, String reportCode, Long userId){
|
|
CrowdTestProject project = projectRepo.getByProjectCode(projectCode);
|
|
CrowdTestProject project = projectRepo.getByProjectCode(projectCode);
|
|
CrowdTestReport report = project.getCrowdTestReportForProject();
|
|
CrowdTestReport report = project.getCrowdTestReportForProject();
|
|
if (report == null)
|
|
if (report == null)
|
|
throw new CrowdTestReportNotExistException();
|
|
throw new CrowdTestReportNotExistException();
|
|
ReportDetailsDTO reportDetailsDTO = new ReportDetailsDTO();
|
|
ReportDetailsDTO reportDetailsDTO = new ReportDetailsDTO();
|
|
|
|
+ /*
|
|
|
|
+ 如果该项目是已经完成的那么报告是不能修改的这边我在Vo上面加了一个属性Updated
|
|
|
|
+ */
|
|
|
|
+ if (project.getStatus() == CrowdTestProjectStatus.HAS_FINISHED){
|
|
|
|
+ report.setUpdated(false);
|
|
|
|
+ }
|
|
reportDetailsDTO.setCrowdReportVO(new CrowdReportVO(report));
|
|
reportDetailsDTO.setCrowdReportVO(new CrowdReportVO(report));
|
|
- if (project.getStatus() < CrowdTestProjectStatus.HAS_FINISHED && project.getRegionalManagerId().equals(userId))
|
|
|
|
|
|
+
|
|
|
|
+ if (project.getStatus() < CrowdTestProjectStatus.HAS_FINISHED && project.getRegionalManagerId().equals(userId)) {
|
|
reportDetailsDTO.setOperational(true);
|
|
reportDetailsDTO.setOperational(true);
|
|
|
|
+
|
|
|
|
+ }
|
|
return reportDetailsDTO;
|
|
return reportDetailsDTO;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -775,11 +782,11 @@ public class WebMediatorImpl implements ViewMediator {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<EvolutionAgencyVO> renderAgencyList() {
|
|
|
|
- List<EvolutionAgencyVO> agencyList = new ArrayList<>();
|
|
|
|
|
|
+ public List<EvaluationAgencyVO> renderAgencyList() {
|
|
|
|
+ List<EvaluationAgencyVO> agencyList = new ArrayList<>();
|
|
EvaluationAgency agencyTemplate = evaluationAgencyRepo.findAgencyById(Long.parseLong(agencyId));
|
|
EvaluationAgency agencyTemplate = evaluationAgencyRepo.findAgencyById(Long.parseLong(agencyId));
|
|
agencyDao.findAll().forEach(evaluationAgencyPO -> {
|
|
agencyDao.findAll().forEach(evaluationAgencyPO -> {
|
|
- EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
|
|
|
+ EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
agencyVO.setId(evaluationAgencyPO.getUserId());
|
|
agencyVO.setId(evaluationAgencyPO.getUserId());
|
|
agencyVO.setEvaluationAgencyName(evaluationAgencyPO.getEvaluationAgencyName());
|
|
agencyVO.setEvaluationAgencyName(evaluationAgencyPO.getEvaluationAgencyName());
|
|
agencyList.add(agencyVO);
|
|
agencyList.add(agencyVO);
|