From 447b0e861a7605f80e43c8d7b33dc0b56df85377 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 27 Jan 2021 19:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=90=8E=E5=88=A0=E9=99=A4=E6=97=A7=E7=9A=84=E6=B4=BE=E7=8F=AD?= =?UTF-8?q?=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/RunPlanTemplateService.java | 7 ++++++- .../simulation/SchedulingService.java | 5 +++++ .../simulation/SchedulingServiceImpl.java | 19 +++++++++++++------ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/RunPlanTemplateService.java b/src/main/java/club/joylink/rtss/services/RunPlanTemplateService.java index 5181c4c92..f9d670e57 100644 --- a/src/main/java/club/joylink/rtss/services/RunPlanTemplateService.java +++ b/src/main/java/club/joylink/rtss/services/RunPlanTemplateService.java @@ -9,6 +9,7 @@ import club.joylink.rtss.dao.SchedulingPlanDAO; import club.joylink.rtss.entity.*; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.services.cache.ICacheService; +import club.joylink.rtss.services.simulation.SchedulingService; import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.util.VersionUtil; import club.joylink.rtss.vo.UserVO; @@ -59,6 +60,9 @@ public class RunPlanTemplateService implements IRunPlanTemplateService { @Autowired private ICacheService iCacheService; + @Autowired + private SchedulingService schedulingService; + /** * 运行图草稿发布 * @@ -105,7 +109,8 @@ public class RunPlanTemplateService implements IRunPlanTemplateService { version.setVersion(VersionUtil.generateNext(findVersion(oldPlan.getId()))); runPlanTemplateVersionDAO.insert(version); } - iCacheService.remove(BusinessConsts.CachePrefix.Plan + templatePlan.getId()); + iCacheService.remove(BusinessConsts.CachePrefix.Plan + templatePlan.getId()); //删除运行图缓存 + schedulingService.deleteByRunPlanId(templatePlan.getId()); } @Override diff --git a/src/main/java/club/joylink/rtss/services/simulation/SchedulingService.java b/src/main/java/club/joylink/rtss/services/simulation/SchedulingService.java index 544039edc..b0fd59991 100644 --- a/src/main/java/club/joylink/rtss/services/simulation/SchedulingService.java +++ b/src/main/java/club/joylink/rtss/services/simulation/SchedulingService.java @@ -70,4 +70,9 @@ public interface SchedulingService { * @return */ SchedulingPlanNewVO queryCommonSchedulingPlanOfDay(Long mapId, LocalDate day); + + /** + * 根据运行图id删除派班计划 + */ + void deleteByRunPlanId(Long runPlanId); } diff --git a/src/main/java/club/joylink/rtss/services/simulation/SchedulingServiceImpl.java b/src/main/java/club/joylink/rtss/services/simulation/SchedulingServiceImpl.java index 9dd6066ff..bbeb16e41 100644 --- a/src/main/java/club/joylink/rtss/services/simulation/SchedulingServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/simulation/SchedulingServiceImpl.java @@ -1,5 +1,11 @@ package club.joylink.rtss.services.simulation; +import club.joylink.rtss.dao.SchedulingPlanDAO; +import club.joylink.rtss.entity.SchedulingPlan; +import club.joylink.rtss.entity.SchedulingPlanExample; +import club.joylink.rtss.services.ILoadPlanService; +import club.joylink.rtss.services.IMapService; +import club.joylink.rtss.services.IRunPlanTemplateService; import club.joylink.rtss.simulation.cbtc.GroupSimulationService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService; @@ -9,12 +15,6 @@ import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder; import club.joylink.rtss.simulation.cbtc.data.plan.SchedulingTrainPlan; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; -import club.joylink.rtss.dao.SchedulingPlanDAO; -import club.joylink.rtss.entity.SchedulingPlan; -import club.joylink.rtss.entity.SchedulingPlanExample; -import club.joylink.rtss.services.ILoadPlanService; -import club.joylink.rtss.services.IMapService; -import club.joylink.rtss.services.IRunPlanTemplateService; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.client.map.MapVO; @@ -269,6 +269,13 @@ public class SchedulingServiceImpl implements SchedulingService { return null; } + @Override + public void deleteByRunPlanId(Long runPlanId) { + SchedulingPlanExample example = new SchedulingPlanExample(); + example.createCriteria().andRunPlanIdEqualTo(runPlanId); + schedulingPlanDAO.deleteByExample(example); + } + @Override public SchedulingPlanNewVO queryUserSchedulingPlanDateFirst(Long userId, Long templateId, LocalDate date) { SchedulingPlanExample example = new SchedulingPlanExample();