Commit 56ba9ac9 by huluobin

update

parent 4431087c
...@@ -994,13 +994,26 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -994,13 +994,26 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
.stream() .stream()
.filter(scheduleServeCommand -> scheduleServeCommand.getMainServeId() == null) .filter(scheduleServeCommand -> scheduleServeCommand.getMainServeId() == null)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Integer> mainScheduleServeIdList = mainScheduleServeCommandList.stream().map(ScheduleServeCommand::getServeId).collect(Collectors.toList());
//辅助服务 //辅助服务
List<ScheduleServeCommand> subScheduleServeCommandList = cmd.getScheduleServeDTOList() List<ScheduleServeCommand> subScheduleServeCommandList = cmd.getScheduleServeDTOList()
.stream() .stream()
.filter(scheduleServeCommand -> scheduleServeCommand.getMainServeId() != null) .filter(scheduleServeCommand -> scheduleServeCommand.getMainServeId() != null)
.filter(scheduleServeCommand -> mainScheduleServeIdList.contains(scheduleServeCommand.getMainServeId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
//辅助服务
List<ScheduleServeCommand> shouldBeMainServe = cmd.getScheduleServeDTOList()
.stream()
.filter(scheduleServeCommand -> scheduleServeCommand.getMainServeId() != null)
.filter(scheduleServeCommand -> !mainScheduleServeIdList.contains(scheduleServeCommand.getMainServeId()))
.collect(Collectors.toList());
shouldBeMainServe.forEach(scheduleServeCommand -> scheduleServeCommand.setMainServeId(null));
mainScheduleServeCommandList.addAll(shouldBeMainServe);
//设置从服务的时间为主服务时间 因为主服务的时间已经包括的从服务的时间 //设置从服务的时间为主服务时间 因为主服务的时间已经包括的从服务的时间
subScheduleServeCommandList.forEach(scheduleServeCommand -> { subScheduleServeCommandList.forEach(scheduleServeCommand -> {
ScheduleServeCommand mainScheduleServeCommand = mainScheduleServeCommandList.stream() ScheduleServeCommand mainScheduleServeCommand = mainScheduleServeCommandList.stream()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment