|
|
@@ -104,15 +104,16 @@ public class CoreReminderScheduleServiceImpl extends ServiceImpl<CoreReminderSch
|
|
|
List<ReminderScheduleMsgDto> dtoList = new ArrayList<>();
|
|
|
|
|
|
List<CoreReminderSchedule> reallyScheduleList = new ArrayList<>();
|
|
|
- for (CoreReminderSchedule schedule : list) {
|
|
|
- String sendModule = schedule.getSendModule();
|
|
|
+ for (Map.Entry<String, List<CoreReminderSchedule>> entry : listMap.entrySet()) {
|
|
|
+ String sendModule = entry.getKey();
|
|
|
+ List<CoreReminderSchedule> scheduleList = entry.getValue();
|
|
|
+ if (ObjectUtil.isEmpty(scheduleList)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
BusinessPlanType type = BusinessPlanType.getBusinessPlanType(sendModule);
|
|
|
switch (type) {
|
|
|
case RESUMPTION:
|
|
|
- List<CoreReminderSchedule> scheduleList = listMap.get(type.getCode());
|
|
|
- if (ObjectUtil.isEmpty(scheduleList)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+
|
|
|
List<String> allResumptopnIdList = scheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
//TODO 考虑临期提醒配置为计划结束时间, 但是任务提前完成的情况
|
|
|
List<String> exitResumptionIdList = resumptionTaskBusiness.checkTaskExit(allResumptopnIdList);
|
|
|
@@ -120,45 +121,31 @@ public class CoreReminderScheduleServiceImpl extends ServiceImpl<CoreReminderSch
|
|
|
reallyScheduleList.addAll(scheduleList);
|
|
|
break;
|
|
|
case SAFETY_CHECK:
|
|
|
- List<CoreReminderSchedule> safetyScheduleList = listMap.get(type.getCode());
|
|
|
- if (ObjectUtil.isEmpty(safetyScheduleList)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<String> allSafetyCheckIdList = safetyScheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<String> allSafetyCheckIdList = scheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
List<String> exitSafetyCheckIdList = safetyTaskService.checkTaskExit(allSafetyCheckIdList);
|
|
|
- safetyScheduleList.removeIf(schedule1 -> !exitSafetyCheckIdList.contains(schedule1.getTaskId()));
|
|
|
- reallyScheduleList.addAll(safetyScheduleList);
|
|
|
+ scheduleList.removeIf(schedule1 -> !exitSafetyCheckIdList.contains(schedule1.getTaskId()));
|
|
|
+ reallyScheduleList.addAll(scheduleList);
|
|
|
|
|
|
break;
|
|
|
case EDU_TRAINING:
|
|
|
- List<CoreReminderSchedule> eduScheduleList = listMap.get(type.getCode());
|
|
|
- if (ObjectUtil.isEmpty(eduScheduleList)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<String> allEduTrainingIdList = eduScheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
+ List<String> allEduTrainingIdList = scheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
List<String> exitEduTrainingIdList = eduTrainingTaskService.checkTaskExit(allEduTrainingIdList);
|
|
|
- eduScheduleList.removeIf(schedule1 -> !exitEduTrainingIdList.contains(schedule1.getTaskId()));
|
|
|
- reallyScheduleList.addAll(eduScheduleList);
|
|
|
+ scheduleList.removeIf(schedule1 -> !exitEduTrainingIdList.contains(schedule1.getTaskId()));
|
|
|
+ reallyScheduleList.addAll(scheduleList);
|
|
|
break;
|
|
|
case DRILL:
|
|
|
- List<CoreReminderSchedule> drillScheduleList = listMap.get(type.getCode());
|
|
|
- if (ObjectUtil.isEmpty(drillScheduleList)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<String> allDrillIdList = drillScheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<String> allDrillIdList = scheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
List<String> exitDrillIdList = drillTaskService.checkTaskExit(allDrillIdList);
|
|
|
- drillScheduleList.removeIf(schedule1 -> !exitDrillIdList.contains(schedule1.getTaskId()));
|
|
|
- reallyScheduleList.addAll(drillScheduleList);
|
|
|
+ scheduleList.removeIf(schedule1 -> !exitDrillIdList.contains(schedule1.getTaskId()));
|
|
|
+ reallyScheduleList.addAll(scheduleList);
|
|
|
break;
|
|
|
case MONITORING_RETRIEVAL:
|
|
|
- List<CoreReminderSchedule> monitoringScheduleList = listMap.get(type.getCode());
|
|
|
- if (ObjectUtil.isEmpty(monitoringScheduleList)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<String> allMonitoringIdList = monitoringScheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
+ List<String> allMonitoringIdList = scheduleList.stream().map(CoreReminderSchedule::getTaskId).distinct().collect(Collectors.toList());
|
|
|
List<String> exitMonitoringIdList = iCoreMonitoringRetrievalTaskService.checkTaskExit(allMonitoringIdList);
|
|
|
- monitoringScheduleList.removeIf(schedule1 -> !exitMonitoringIdList.contains(schedule1.getTaskId()));
|
|
|
- reallyScheduleList.addAll(monitoringScheduleList);
|
|
|
+ scheduleList.removeIf(schedule1 -> !exitMonitoringIdList.contains(schedule1.getTaskId()));
|
|
|
+ reallyScheduleList.addAll(scheduleList);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|