调度命令-代签
This commit is contained in:
parent
bf821d9ff8
commit
5d83ababdc
@ -1265,9 +1265,13 @@ public class Operation {
|
||||
*/
|
||||
CTC_READ_DIS_COMMAND(new Label[]{Label.OTHER}),
|
||||
/**
|
||||
* 签收调度命令
|
||||
* 正常签收调度命令
|
||||
*/
|
||||
CTC_SIGN_DIS_COMMAND(new Label[]{Label.OTHER}),
|
||||
/**
|
||||
* 发令单位代签调度命令
|
||||
*/
|
||||
CTC_SIGN_PROXY_DIS_COMMAND(new Label[]{Label.OTHER}),
|
||||
/**
|
||||
* 拒签调度命令
|
||||
*/
|
||||
|
@ -7,10 +7,7 @@ import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.service.DisCmdFindService;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.service.DisCmdReceiptService;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.service.DisCmdService;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.service.DisCmdSignService;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.DisCmdHolderEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.DisCmdSrcVo;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.FindAllDisCmdForHolderRspVo;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.ReceiptVo;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.*;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -54,7 +51,7 @@ public class RailCtcDisCmdOperateHandler {
|
||||
disCmdService.send(simulation, disCmdCode);
|
||||
}
|
||||
/**
|
||||
* 处理前端发送来的签收指令
|
||||
* 处理前端发送来的正常签收指令
|
||||
* @param disCmdCode 调度命令号
|
||||
* @param rcId 对于该调度命令的受令单位id
|
||||
* @param signer 实际签收人(仿真成员)
|
||||
@ -63,6 +60,15 @@ public class RailCtcDisCmdOperateHandler {
|
||||
public void sign(Simulation simulation, String disCmdCode, String rcId, SimulationMember signer) {
|
||||
disCmdSignService.sign(simulation, disCmdCode, rcId, signer);
|
||||
}
|
||||
/**
|
||||
* 处理前端发送来的代签签收指令
|
||||
* @param proxySignReqVo 代签信息
|
||||
* @param signer 实际签收人(仿真成员)
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.CTC_SIGN_PROXY_DIS_COMMAND)
|
||||
public void signProxy(Simulation simulation, DisCmdProxySignReqVo proxySignReqVo, SimulationMember signer){
|
||||
disCmdSignService.signProxy(simulation,proxySignReqVo,signer);
|
||||
}
|
||||
/**
|
||||
* 处理前端发送来的拒签指令
|
||||
* @param disCmdCode 调度命令号
|
||||
|
@ -114,7 +114,7 @@ public class DisCmdApiController {
|
||||
@Data
|
||||
public static class FindReqVo{
|
||||
/**
|
||||
* 持有者类型
|
||||
* 持有者类型[Dispatcher(调度台) Station(车站) Train(无线机车) Tsr(列控服务器)]
|
||||
* @see DisCmdHolderEnum
|
||||
*/
|
||||
private String holderType;
|
||||
|
@ -76,6 +76,12 @@ public class DisCmdRcvCompany {
|
||||
* @see SimulationMember#getUserId()
|
||||
*/
|
||||
private String signBy;
|
||||
/**
|
||||
* 被代签收人姓名即实际期望的签收者
|
||||
* <p>
|
||||
* 当受令单位由于某种原因无法正常签收时,发令方通过电话与受令单位的“这个被代签收人即接电话者”确认后代签
|
||||
*/
|
||||
private String nameOfExpectedSigner;
|
||||
/**
|
||||
* 最终受令端对于调度命令的拒签时间
|
||||
*/
|
||||
|
@ -68,8 +68,7 @@ public class DisCmdReceiptService {
|
||||
if(null!=rc.getSignTime()){
|
||||
ReceiptVo rtv = new ReceiptVo();
|
||||
rtv.setDisCmdCode(cmd.getCode());
|
||||
rtv.setState(ReceiptVo.Status.Signed.name());
|
||||
rtv.setTime(rc.getReceiveTime());
|
||||
rtv.setTime(rc.getSignTime());
|
||||
rtv.setSignedBy(rc.getSignBy());//todo:暂时
|
||||
switch (rc.getType()){
|
||||
case Train:{
|
||||
@ -84,6 +83,12 @@ public class DisCmdReceiptService {
|
||||
}break;
|
||||
case Tsr:rtv.setTsr(rc.getTsrCode());//todo:暂时
|
||||
}
|
||||
if(null!=rc.getNameOfExpectedSigner()&&rc.getNameOfExpectedSigner().length()>0){//代签
|
||||
rtv.setState(ReceiptVo.Status.ProxySigned.name());
|
||||
rtv.setNameOfExpectedSigner(rc.getNameOfExpectedSigner());
|
||||
}else{
|
||||
rtv.setState(ReceiptVo.Status.Signed.name());
|
||||
}
|
||||
rsp.add(rtv);
|
||||
}
|
||||
if(null!=rc.getReadTime()){
|
||||
|
@ -3,6 +3,7 @@ package club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.service;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.DisCmd;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.DisCmdRcvCompany;
|
||||
import club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo.DisCmdProxySignReqVo;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -17,7 +18,7 @@ public class DisCmdSignService {
|
||||
@Autowired
|
||||
private DisCmdService disCmdService;
|
||||
/**
|
||||
* 处理前端发送来的签收指令
|
||||
* 处理前端发送来的正常签收指令
|
||||
* @param disCmdCode 调度命令号
|
||||
* @param rcId 对于该调度命令的受令单位id
|
||||
* @param signer 实际签收人(仿真成员)
|
||||
@ -36,6 +37,33 @@ public class DisCmdSignService {
|
||||
rc.setSignBy(signer.getUserId());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 处理前端发送来的代签签收指令
|
||||
* @param proxySignReqVo 代签信息
|
||||
* @param signer 实际签收人(仿真成员)
|
||||
*/
|
||||
public void signProxy(Simulation simulation, DisCmdProxySignReqVo proxySignReqVo, SimulationMember signer){
|
||||
final String disCmdCode = proxySignReqVo.getDisCmdCode();
|
||||
final String rcId = proxySignReqVo.getRcId();
|
||||
final String nameOfExpectedSigner = proxySignReqVo.getNameOfExpectedSigner();
|
||||
//
|
||||
DisCmd cmd = simulation.getCtcRepository().getDisCmdMap().get(disCmdCode);
|
||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != cmd, String.format("仿真(%s),调度命令(%s)不存在", simulation.getId(), disCmdCode));
|
||||
List<DisCmdRcvCompany> rcs = cmd.getRcvCompanies().values().stream().filter(rc -> { return rcId.equals(rc.getId()); }).collect(Collectors.toList());
|
||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != rcs && !rcs.isEmpty(), String.format("仿真(%s),调度命令(%s)的受令单位(%s)不存在", simulation.getId(), disCmdCode, rcId));
|
||||
DisCmdRcvCompany rc = rcs.get(0);
|
||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(DisCmdRcvCompany.Status.Received.equals(rc.getState()),String.format("仿真(%s),调度命令(%s)的受令单位(%s)非接收状态,不能签收", simulation.getId(), disCmdCode, rcId));
|
||||
//
|
||||
rc.setState(DisCmdRcvCompany.Status.Signed);
|
||||
rc.setSignTime(disCmdService.getNow(simulation));
|
||||
rc.setNameOfExpectedSigner(nameOfExpectedSigner);
|
||||
if(null!=signer){
|
||||
rc.setSignBy(signer.getUserId());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 处理前端发送来的 代 签收指令
|
||||
*/
|
||||
/**
|
||||
* 处理前端发送来的拒签指令
|
||||
* @param disCmdCode 调度命令号
|
||||
|
@ -0,0 +1,22 @@
|
||||
package club.joylink.rtss.simulation.cbtc.CTC.rail.cmd.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 调度命令代签请求
|
||||
*/
|
||||
@Data
|
||||
public class DisCmdProxySignReqVo {
|
||||
/**
|
||||
* 调度命令唯一id
|
||||
*/
|
||||
private String disCmdCode;
|
||||
/**
|
||||
* 受令单位记录唯一id
|
||||
*/
|
||||
private String rcId;
|
||||
/**
|
||||
* 被代签收人姓名即实际期望的签收者
|
||||
*/
|
||||
private String nameOfExpectedSigner;
|
||||
}
|
@ -34,6 +34,12 @@ public class ReceiptVo {
|
||||
* 签收人
|
||||
*/
|
||||
private String signedBy;
|
||||
/**
|
||||
* 被代签收人姓名即实际期望的签收者
|
||||
* <p>
|
||||
* 当受令单位由于某种原因无法正常签收时,发令方通过电话与受令单位的“这个被代签收人即接电话者”确认后代签
|
||||
*/
|
||||
private String nameOfExpectedSigner;
|
||||
/**
|
||||
* 车站受令者
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user