调度命令

This commit is contained in:
xzb 2022-09-08 11:09:12 +08:00
parent 507459e233
commit de2a86f34f
2 changed files with 17 additions and 11 deletions

View File

@ -58,11 +58,10 @@ public class RailCtcDisCmdOperateHandler {
* 阅读调度命令 * 阅读调度命令
* @param disCmdCode 调度命令号 * @param disCmdCode 调度命令号
* @param rcId 对于该调度命令的受令单位记录id * @param rcId 对于该调度命令的受令单位记录id
* @param reader 实际签收人(仿真成员)
*/ */
@OperateHandlerMapping(type = Operation.Type.CTC_READ_DIS_COMMAND) @OperateHandlerMapping(type = Operation.Type.CTC_READ_DIS_COMMAND)
public void read(Simulation simulation, String disCmdCode, String rcId, SimulationMember reader) { public void read(Simulation simulation, String disCmdCode, String rcId) {
disCmdService.read(simulation, disCmdCode, rcId, reader); disCmdService.read(simulation, disCmdCode, rcId);
} }
/** /**

View File

@ -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.convertor.DisCmdConvertor;
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.*; import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.*;
import club.joylink.rtss.simulation.cbtc.Simulation; 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.Stand;
import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.map.Station;
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
@ -189,15 +188,16 @@ public class DisCmdService {
// //
rc.setState(DisCmdRcvCompany.Status.Signed); rc.setState(DisCmdRcvCompany.Status.Signed);
rc.setSignTime(this.getNow(simulation)); rc.setSignTime(this.getNow(simulation));
rc.setSignByReal(signer.getUserId()); if(null!=signer){
rc.setSignByReal(signer.getUserId());
}
} }
/** /**
* 阅读调度命令 * 阅读调度命令
* @param disCmdCode 调度命令号 * @param disCmdCode 调度命令号
* @param rcId 对于该调度命令的受令单位记录id * @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); DisCmd cmd = simulation.getCtcRepository().getDisCmdMap().get(disCmdCode);
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != cmd, String.format("仿真(%s),调度命令(%s)不存在", simulation.getId(), disCmdCode)); BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != cmd, String.format("仿真(%s),调度命令(%s)不存在", simulation.getId(), disCmdCode));
List<DisCmdRcvCompany> rcs = cmd.getRcvCompanies().stream().filter(rc -> { return rcId.equals(rc.getId()); }).collect(Collectors.toList()); List<DisCmdRcvCompany> 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())){ }else if(DisCmdRcvCompany.Type.Dispatcher.equals(rc.getType())){
//todo: 调度台暂时没有 //todo: 调度台暂时没有
log.warn("==>>调度台不存在,不能推送通知!"); log.warn("==>>调度台不存在,不能推送通知!");
}else if(DisCmdRcvCompany.Type.Tsr.equals(rc.getType())){ }else if(DisCmdRcvCompany.Type.Tsr.equals(rc.getType())){//列控服务器自动阅读签收
//todo: 列控服务器暂时没有 this.tsrHandleCmdNotify(simulation,rc);
log.warn("==>>列控服务器不存在,不能推送通知!");
}else if(DisCmdRcvCompany.Type.Train.equals(rc.getType())){ }else if(DisCmdRcvCompany.Type.Train.equals(rc.getType())){
//车次号 //车次号
String trainNum = rc.getTrainNum(); 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 stationCode 车站code
* @param trainNum 车次号 * @param trainNum 车次号
* @param trainCode 机车号 * @param trainCode 机车号