feat: 完善更新计划状态定时任务
This commit is contained in:
+9
-1
@@ -50,6 +50,8 @@ public class ESPlanProjectStatusJob implements Job {
|
||||
}
|
||||
|
||||
public void updatePlanProjectStatus(List<EnterpriseStandardPlan> list) {
|
||||
List<String> idList = list.stream().map(EnterpriseStandardPlan::getId).collect(Collectors.toList());
|
||||
list = espService.listByIds(idList);
|
||||
// 将list中的时间的时分秒都去掉
|
||||
list.forEach(esp -> {
|
||||
if (null != esp.getApprovalDate()) {
|
||||
@@ -99,7 +101,13 @@ public class ESPlanProjectStatusJob implements Job {
|
||||
if (processAlls.isEmpty()) {
|
||||
p.setProjectStatus(ESPProjectStatus.NOT_STARTED.getValue());
|
||||
} else {
|
||||
p.setProjectStatus(ESPProjectStatus.IN_PROGRESS.getValue());
|
||||
// 判断是否都是进行中或者都是已完成
|
||||
boolean inProgress = processAlls.stream().anyMatch(processAll -> ProcessStatusEnum.INCOMPLETE.getValue().equals(processAll.getPrcStatus()));
|
||||
if (inProgress) {
|
||||
p.setProjectStatus(ESPProjectStatus.IN_PROGRESS.getValue());
|
||||
} else {
|
||||
p.setProjectStatus(ESPProjectStatus.COMPLETED.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user