|
@@ -588,8 +588,11 @@ public class CockpitStatsStatisticsTask { |
|
|
private Integer computeLagging(List<Project> projects) { |
|
|
private Integer computeLagging(List<Project> projects) { |
|
|
List<String> projectCodes = projects.stream().map(Project::getProjectCode).collect(Collectors.toList()); |
|
|
List<String> projectCodes = projects.stream().map(Project::getProjectCode).collect(Collectors.toList()); |
|
|
Map<String, Project> map = projects.stream().collect(Collectors.toMap(p -> p.getProjectCode(), p -> p)); |
|
|
Map<String, Project> map = projects.stream().collect(Collectors.toMap(p -> p.getProjectCode(), p -> p)); |
|
|
List<WflowEarlyWarningRecords> records = earlyWarningRecordsService.list(Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) |
|
|
|
|
|
.in(WflowEarlyWarningRecords::getProjectCode, projectCodes)); |
|
|
|
|
|
|
|
|
List<WflowEarlyWarningRecords> records = Lists.newArrayList(); |
|
|
|
|
|
if(CollUtil.isNotEmpty(projectCodes)){ |
|
|
|
|
|
records = earlyWarningRecordsService.list(Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) |
|
|
|
|
|
.in(WflowEarlyWarningRecords::getProjectCode, projectCodes)); |
|
|
|
|
|
} |
|
|
return records.stream().mapToInt(r -> { |
|
|
return records.stream().mapToInt(r -> { |
|
|
if(!map.containsKey(r.getProjectCode())){ |
|
|
if(!map.containsKey(r.getProjectCode())){ |
|
|
return 0; |
|
|
return 0; |
|
|