Преглед на файлове

驾驶舱 统计逻辑接口

tags/24080901
PoffyZhang преди 1 година
родител
ревизия
61caa3ab3f
променени са 1 файла, в които са добавени 36 реда и са изтрити 17 реда
  1. +36
    -17
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java

+ 36
- 17
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java Целия файл

@@ -183,12 +183,16 @@ public class CockpitStatsStatisticsTask {
Double totalSafytyAmount = projects.stream().mapToDouble(p -> {
if(Objects.nonNull(p.getSafetyInputDescribe())){
final Double[] total = {0.0};
JSONArray array = JSON.parseArray(p.getSafetyInputDescribe());
array.forEach(j -> {
JSONObject json = JSON.parseObject(JSON.toJSONString(j));
Double safetyInputAmount = json.getDouble(DashboardConstant.Protrait.FEILD_SAFETYMONEY);
total[0] += safetyInputAmount;
});
try{
JSONArray array = JSON.parseArray(p.getSafetyInputDescribe());
array.forEach(j -> {
JSONObject json = JSON.parseObject(JSON.toJSONString(j));
Double safetyInputAmount = json.getDouble(DashboardConstant.Protrait.FEILD_SAFETYMONEY);
total[0] += safetyInputAmount;
});
}catch (Exception e){

}
return total[0];
}
return 0.0;
@@ -373,7 +377,7 @@ public class CockpitStatsStatisticsTask {

//9.绩效
List<String> projectCodes = projects.stream().map(Project::getProjectCode).collect(Collectors.toList());
Map<String, String> projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode, Project::getProjectName));
Map<String, String> projectMap = projects.stream().filter(p -> Objects.nonNull(p.getProjectCode())).collect(Collectors.toMap(Project::getProjectCode, Project::getProjectName));
List<PerformanceAppraisalProject> performanceAll = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getProjectCode, projectCodes));
List<PerformanceAppraisalProject> verified = performanceAll.stream().filter(p -> {
@@ -387,16 +391,31 @@ public class CockpitStatsStatisticsTask {
cockpitStats.setPerformanceReviewedTotal(verified.size());
cockpitStats.setPerformanceTobeReviewTotal(performanceAll.size() - verified.size());

cockpitStats.setPerformanceTop1Name(projectMap.get(verified.get(0).getProjectCode()));
cockpitStats.setPerformanceTop1Score(verified.get(0).getVerifyTotalScore());
cockpitStats.setPerformanceTop2Name(verified.get(1).getProjectCode());
cockpitStats.setPerformanceTop2Score(verified.get(1).getVerifyTotalScore());
cockpitStats.setPerformanceTop3Name(verified.get(2).getProjectCode());
cockpitStats.setPerformanceTop3Score(verified.get(2).getVerifyTotalScore());
cockpitStats.setPerformanceTop4Name(verified.get(3).getProjectCode());
cockpitStats.setPerformanceTop4Score(verified.get(3).getVerifyTotalScore());
cockpitStats.setPerformanceTop5Name(verified.get(4).getProjectCode());
cockpitStats.setPerformanceTop5Score(verified.get(4).getVerifyTotalScore());
if(verified.size() > 0){
cockpitStats.setPerformanceTop1Name(projectMap.get(verified.get(0).getProjectCode()));
cockpitStats.setPerformanceTop1Score(verified.get(0).getVerifyTotalScore());
}

if(verified.size() > 1){
cockpitStats.setPerformanceTop2Name(verified.get(1).getProjectCode());
cockpitStats.setPerformanceTop2Score(verified.get(1).getVerifyTotalScore());
}

if(verified.size() > 2){
cockpitStats.setPerformanceTop3Name(verified.get(2).getProjectCode());
cockpitStats.setPerformanceTop3Score(verified.get(2).getVerifyTotalScore());
}

if(verified.size() > 3){
cockpitStats.setPerformanceTop4Name(verified.get(3).getProjectCode());
cockpitStats.setPerformanceTop4Score(verified.get(3).getVerifyTotalScore());
}

if(verified.size() > 4){
cockpitStats.setPerformanceTop5Name(verified.get(4).getProjectCode());
cockpitStats.setPerformanceTop5Score(verified.get(4).getVerifyTotalScore());
}


return cockpitStats;
}


Loading…
Отказ
Запис