【发预增加时间】

【取消到达、出发时,将实际时间修改为计划时间】
【取消闭塞】
This commit is contained in:
weizhihong 2022-07-04 16:47:04 +08:00
parent 4134522daf
commit 9d47efa2ee
5 changed files with 109 additions and 2 deletions

View File

@ -918,6 +918,20 @@ public class Operation {
*/ */
CTC_CANCEL_TWINKLE, CTC_CANCEL_TWINKLE,
/**
* 行车日志取消到达
*/
CTC_LOG_CANCEL_ARRIVE,
/**
* 行车日志取消出发
*/
CTC_LOG_CANCEL_DEPARTURE,
/**
* 行车日志取消闭塞
*/
CTC_LOG_CANCEL_BLOCK,
/**************调度台******************/ /**************调度台******************/
/** /**
* 调度台保存运行计划 * 调度台保存运行计划

View File

@ -162,4 +162,39 @@ public class CtcStationRunPlanOperateHandler {
ctcStationRunPlanLogService.cancelTwinkle(simulation, stationCode, runPlanCode); ctcStationRunPlanLogService.cancelTwinkle(simulation, stationCode, runPlanCode);
} }
/**
* 取消到达
*
* @param simulation 仿真
* @param stationCode 车站
* @param runPlanCode 运行计划
*/
@OperateHandlerMapping(type = Operation.Type.CTC_LOG_CANCEL_ARRIVE)
public void cancelArrive(Simulation simulation, String stationCode, String runPlanCode) {
ctcStationRunPlanLogService.cancelArrive(simulation, stationCode, runPlanCode);
}
/**
* 取消出发
*
* @param simulation 仿真
* @param stationCode 车站
* @param runPlanCode 运行计划
*/
@OperateHandlerMapping(type = Operation.Type.CTC_LOG_CANCEL_DEPARTURE)
public void cancelDepart(Simulation simulation, String stationCode, String runPlanCode) {
ctcStationRunPlanLogService.cancelDepart(simulation, stationCode, runPlanCode);
}
/**
* 取消闭塞
*
* @param simulation 仿真
* @param stationCode 车站
* @param runPlanCode 运行计划
*/
@OperateHandlerMapping(type = Operation.Type.CTC_LOG_CANCEL_BLOCK)
public void cancelBlock(Simulation simulation, String stationCode, String runPlanCode) {
ctcStationRunPlanLogService.cancelBlock(simulation, stationCode, runPlanCode);
}
} }

View File

@ -305,6 +305,44 @@ public class CtcStationRunPlanLogService {
runPlanLog.setTwinkle(false); runPlanLog.setTwinkle(false);
} }
/**
* 取消到达
*
* @param simulation 仿真
* @param stationCode 车站编码
* @param runPlanCode 运行计划编码
*/
public void cancelArrive(Simulation simulation, String stationCode, String runPlanCode) {
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
runPlanLog.cancelArrive();
}
/**
* 取消出发
*
* @param simulation 仿真
* @param stationCode 车站编码
* @param runPlanCode 运行计划编码
*/
public void cancelDepart(Simulation simulation, String stationCode, String runPlanCode) {
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
runPlanLog.cancelDeparture();
}
/**
* 取消闭塞
*
* @param simulation 仿真
* @param stationCode 车站编码
* @param runPlanCode 运行计划编码
*/
public void cancelBlock(Simulation simulation, String stationCode, String runPlanCode) {
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
CtcStationRunPlanLog nextPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(runPlanLog.getNextStation().getCode(), runPlanCode);
runPlanLog.cancelDepartBlock();
nextPlanLog.cancelArriveBlock();
}
/** /**
* 修改原始数据并返回修改属性的对象 * 修改原始数据并返回修改属性的对象
* *

View File

@ -184,7 +184,7 @@ public class CtcStationRunPlanLog {
public void cancelArrive() { public void cancelArrive() {
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(arriveRunPlan); BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(arriveRunPlan);
arriveRunPlan.setActualTime(""); arriveRunPlan.setActualTime(arriveRunPlan.getPlanTimeStr());
} }
public void finishDeparture(LocalTime time) { public void finishDeparture(LocalTime time) {
@ -194,7 +194,7 @@ public class CtcStationRunPlanLog {
public void cancelDeparture() { public void cancelDeparture() {
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(departRunPlan); BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(departRunPlan);
departRunPlan.setActualTime(""); departRunPlan.setActualTime(departRunPlan.getPlanTimeStr());
} }
/** /**
@ -233,6 +233,22 @@ public class CtcStationRunPlanLog {
arriveRunPlan.setAdjacentMessage(RunPlanItem.WAIT); arriveRunPlan.setAdjacentMessage(RunPlanItem.WAIT);
} }
/**
* 发车取消闭塞
*/
public void cancelDepartBlock() {
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(departRunPlan);
departRunPlan.setAdjacentMessage(RunPlanItem.NO);
}
/**
* 接车取消闭塞
*/
public void cancelArriveBlock() {
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(arriveRunPlan);
arriveRunPlan.setAdjacentMessage(RunPlanItem.NO);
}
@Setter @Setter
@Getter @Getter
public static class RunPlanItem { public static class RunPlanItem {

View File

@ -59,6 +59,8 @@ public class CTCService {
public void finishReceivingNotice(Simulation simulation, String stationCode, String tripNumber) { public void finishReceivingNotice(Simulation simulation, String stationCode, String tripNumber) {
CtcStationRunPlanLog plan = getCtcStationRunPlan(simulation, stationCode, tripNumber); CtcStationRunPlanLog plan = getCtcStationRunPlan(simulation, stationCode, tripNumber);
plan.finishReceivingNotice(); plan.finishReceivingNotice();
String systemTime = simulation.getCorrectSystemTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd"));
plan.getArriveRunPlan().setAdjacentMessageTime(systemTime);
} }
/** /**
@ -74,6 +76,8 @@ public class CTCService {
public void finishDepartureNotice(Simulation simulation, String stationCode, String tripNumber) { public void finishDepartureNotice(Simulation simulation, String stationCode, String tripNumber) {
CtcStationRunPlanLog plan = getCtcStationRunPlan(simulation, stationCode, tripNumber); CtcStationRunPlanLog plan = getCtcStationRunPlan(simulation, stationCode, tripNumber);
plan.finishDepartureNotice(); plan.finishDepartureNotice();
String systemTime = simulation.getCorrectSystemTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd"));
plan.getDepartRunPlan().setAdjacentMessageTime(systemTime);
} }
public void cancelDepartureNotice(Simulation simulation, String stationCode, String tripNumber) { public void cancelDepartureNotice(Simulation simulation, String stationCode, String tripNumber) {