|
@@ -148,14 +148,15 @@ public class CommonServiceImpl implements CommonService {
|
|
|
|
|
|
@Override
|
|
|
public List<CrowdProjectVO> getProjectList(Pageable pageable, String code,String keyword) {
|
|
|
+
|
|
|
+ Map<String, String> applicationMap = commonRepo.getApplicationCodeNameMap();
|
|
|
List<CrowdProjectVO> crowdProjectVOS = commonRepo.getProjectList(pageable, code, keyword).stream().map(project -> {
|
|
|
// 判断项目是否截止
|
|
|
if (project.getDeadTime().getTime() <= System.currentTimeMillis() && project.getStatus() < CrowdTestProjectStatus.HAS_FINISHED) {
|
|
|
project.setStatus(CrowdTestProjectStatus.HAS_TIME_OUT);
|
|
|
}
|
|
|
CrowdProjectVO crowdProjectVO = new CrowdProjectVO(project);
|
|
|
- String applicationName = commonRepo.getApplicationNameByCode(crowdProjectVO.getPlatform());
|
|
|
- crowdProjectVO.setPlatform(applicationName);
|
|
|
+ crowdProjectVO.setPlatform(applicationMap.get(crowdProjectVO.getPlatform()));
|
|
|
return crowdProjectVO;
|
|
|
}).collect(Collectors.toList());
|
|
|
return crowdProjectVOS;
|
|
@@ -231,6 +232,10 @@ public class CommonServiceImpl implements CommonService {
|
|
|
|
|
|
@Override
|
|
|
public List<HashMap<String, Long>> getStatisticsCount() {
|
|
|
+ Map<String, String> applicationsMap = commonRepo.getApplicationCodeNameMap();
|
|
|
+ Map<String, String> typeMap = commonRepo.getTypeCodeNameMap();
|
|
|
+ Map<String, String> fieldsMap = commonRepo.getFieldCodeNameMap();
|
|
|
+
|
|
|
List<HashMap<String, Long>> statisticsList = new ArrayList<>();
|
|
|
HashMap<String, Long> fieldMap = new HashMap<>();
|
|
|
HashMap<String, Long> applicationMap = new HashMap<>();
|
|
@@ -267,18 +272,15 @@ public class CommonServiceImpl implements CommonService {
|
|
|
Iterator<String> fieldIterator = fieldMap.keySet().iterator();
|
|
|
while(fieldIterator.hasNext()){
|
|
|
String fieldCode = fieldIterator.next();
|
|
|
- String fieldName = commonRepo.getFieldNameByFieldCode(fieldCode);
|
|
|
- fieldResultMap.put(fieldName, fieldMap.get(fieldCode));
|
|
|
+ fieldResultMap.put(fieldsMap.get(fieldCode), fieldMap.get(fieldCode));
|
|
|
}
|
|
|
|
|
|
for(Map.Entry<String, Long> entry : applicationMap.entrySet()){
|
|
|
- String applicationName = commonRepo.getApplicationNameByCode(entry.getKey());
|
|
|
- applicationResultMap.put(applicationName, entry.getValue());
|
|
|
+ applicationResultMap.put(applicationsMap.get(entry.getKey()), entry.getValue());
|
|
|
}
|
|
|
|
|
|
for(Map.Entry<String, Long> entry : testTypeMap.entrySet()){
|
|
|
- String typeName = commonRepo.getTypeNameByCode(entry.getKey());
|
|
|
- testTypeResultMap.put(typeName, entry.getValue());
|
|
|
+ testTypeResultMap.put(typeMap.get(entry.getKey()), entry.getValue());
|
|
|
}
|
|
|
|
|
|
statisticsList.add(fieldResultMap);
|