From de2a86f34f66c9b00a5ccdc912755729ccbcc362 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Thu, 8 Sep 2022 11:09:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RailCtcDisCmdOperateHandler.java | 5 ++-- .../cbtc/CTC/rail/cmd/DisCmdService.java | 23 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailCtcDisCmdOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailCtcDisCmdOperateHandler.java index d4d7fa94a..67101b98c 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailCtcDisCmdOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailCtcDisCmdOperateHandler.java @@ -58,11 +58,10 @@ public class RailCtcDisCmdOperateHandler { * 阅读调度命令 * @param disCmdCode 调度命令号 * @param rcId 对于该调度命令的受令单位记录id - * @param reader 实际签收人(仿真成员) */ @OperateHandlerMapping(type = Operation.Type.CTC_READ_DIS_COMMAND) - public void read(Simulation simulation, String disCmdCode, String rcId, SimulationMember reader) { - disCmdService.read(simulation, disCmdCode, rcId, reader); + public void read(Simulation simulation, String disCmdCode, String rcId) { + disCmdService.read(simulation, disCmdCode, rcId); } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/cmd/DisCmdService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/cmd/DisCmdService.java index 99891835d..28d6b032e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/cmd/DisCmdService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/rail/cmd/DisCmdService.java @@ -5,7 +5,6 @@ import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository; import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.convertor.DisCmdConvertor; import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.*; import club.joylink.rtss.simulation.cbtc.Simulation; -import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; @@ -189,15 +188,16 @@ public class DisCmdService { // rc.setState(DisCmdRcvCompany.Status.Signed); rc.setSignTime(this.getNow(simulation)); - rc.setSignByReal(signer.getUserId()); + if(null!=signer){ + rc.setSignByReal(signer.getUserId()); + } } /** * 阅读调度命令 * @param disCmdCode 调度命令号 * @param rcId 对于该调度命令的受令单位记录id - * @param reader 实际签收人(仿真成员) */ - public void read(Simulation simulation, String disCmdCode, String rcId, SimulationMember reader){ + public void read(Simulation simulation, String disCmdCode, String rcId){ DisCmd cmd = simulation.getCtcRepository().getDisCmdMap().get(disCmdCode); BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != cmd, String.format("仿真(%s),调度命令(%s)不存在", simulation.getId(), disCmdCode)); List rcs = cmd.getRcvCompanies().stream().filter(rc -> { return rcId.equals(rc.getId()); }).collect(Collectors.toList()); @@ -429,9 +429,8 @@ public class DisCmdService { }else if(DisCmdRcvCompany.Type.Dispatcher.equals(rc.getType())){ //todo: 调度台暂时没有 log.warn("==>>调度台不存在,不能推送通知!"); - }else if(DisCmdRcvCompany.Type.Tsr.equals(rc.getType())){ - //todo: 列控服务器暂时没有 - log.warn("==>>列控服务器不存在,不能推送通知!"); + }else if(DisCmdRcvCompany.Type.Tsr.equals(rc.getType())){//列控服务器自动阅读签收 + this.tsrHandleCmdNotify(simulation,rc); }else if(DisCmdRcvCompany.Type.Train.equals(rc.getType())){ //车次号 String trainNum = rc.getTrainNum(); @@ -448,7 +447,15 @@ public class DisCmdService { } } /** - * 判断机车是否在该车站内(todo:暂时不考虑上下行) + * 列控服务器自动阅读签收调度命令 + */ + private void tsrHandleCmdNotify(Simulation simulation,DisCmdRcvCompany rc){ + this.read(simulation,rc.getDisCmdCode(),rc.getId()); + this.sign(simulation,rc.getDisCmdCode(),rc.getId(),null); + //todo: 列控业务处理 + } + /** + * 判断机车是否在该车站内 * @param stationCode 车站code * @param trainNum 车次号 * @param trainCode 机车号