|
|
@@ -114,16 +114,10 @@ public class DelayWarningTest extends AppTests { |
|
|
|
StopWatch stopWatch = new StopWatch(); |
|
|
|
stopWatch.start(); |
|
|
|
// 获取项目库所有建设单位不为空的项目 |
|
|
|
LambdaQueryWrapper<Project> queryWrapper = Wrappers.lambdaQuery(Project.class).isNotNull(Project::getBuildOrgCode); |
|
|
|
LambdaQueryWrapper<Project> queryWrapper = Wrappers.lambdaQuery(Project.class) |
|
|
|
.isNotNull(Project::getBuildOrgCode) |
|
|
|
.eq(Project::getNewest, Boolean.TRUE); |
|
|
|
List<Project> projects = projectService.list(queryWrapper); |
|
|
|
// 根据项目code分组 获取最新的一条数据 |
|
|
|
Map<String, Project> projectMap = projects.stream().collect(Collectors.groupingBy(Project::getProjectCode, Collectors.collectingAndThen( |
|
|
|
// 根据创建日期找到最新的记录 |
|
|
|
Collectors.maxBy(Comparator.comparing(Project::getCreateOn)), |
|
|
|
// 如果没有记录则返回null |
|
|
|
optional -> optional.orElse(null) |
|
|
|
))); |
|
|
|
List<Project> projectList = new ArrayList<>(projectMap.values()); |
|
|
|
List<ProjectEarlyWarning> projectEarlyWarnings = Lists.newArrayList(); |
|
|
|
List<WflowEarlyWarningRecords> earlyWarningRecords = Lists.newArrayList(); |
|
|
|
List<ProjectEarlyWarning> needRemoved = Lists.newArrayList(); |
|
|
@@ -133,7 +127,7 @@ public class DelayWarningTest extends AppTests { |
|
|
|
List<ProjectEarlyWarning> earlyWarnings = projectEarlyWarningService.list(warningQuery); |
|
|
|
Map<String, ProjectEarlyWarning> projectEarlyWarningMap = CollUtils.listToMap(earlyWarnings, c -> c.getProjectCode() + StrPool.DASH + c.getStepName()); |
|
|
|
// 遍历项目 获取对应申报单位的滞后预警规则 |
|
|
|
for (Project project : projectList) { |
|
|
|
for (Project project : projects) { |
|
|
|
String buildOrgCode = project.getBuildOrgCode(); |
|
|
|
String projectCode = project.getProjectCode(); |
|
|
|
Long mhUnitId = Long.valueOf(buildOrgCode); |
|
|
|