【车务终端发送计划】
【修改运行方向、股道】
This commit is contained in:
parent
0261d606d7
commit
ef20e5201e
@ -999,6 +999,11 @@ public class Operation {
|
|||||||
*/
|
*/
|
||||||
CTC_STATION_SIGN_RUN_PLAN,
|
CTC_STATION_SIGN_RUN_PLAN,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车站发送计划
|
||||||
|
*/
|
||||||
|
CTC_STATION_SEND_OUT_RUN_PLAN,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车站向中心发送申请
|
* 车站向中心发送申请
|
||||||
*/
|
*/
|
||||||
@ -1014,6 +1019,11 @@ public class Operation {
|
|||||||
*/
|
*/
|
||||||
CTC_MODIFY_SECTION,
|
CTC_MODIFY_SECTION,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改方向
|
||||||
|
*/
|
||||||
|
CTC_MODIFY_DIRECTION,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改实际到达时间
|
* 修改实际到达时间
|
||||||
*/
|
*/
|
||||||
|
@ -44,12 +44,30 @@ public class CtcStationRunPlanOperateHandler {
|
|||||||
* @param runPlanCode 运行计划
|
* @param runPlanCode 运行计划
|
||||||
* @param arriveSection 到达股道
|
* @param arriveSection 到达股道
|
||||||
* @param departSection 出发股道
|
* @param departSection 出发股道
|
||||||
|
* @param force 是否强制
|
||||||
*/
|
*/
|
||||||
@OperateHandlerMapping(type = Operation.Type.CTC_MODIFY_SECTION)
|
@OperateHandlerMapping(type = Operation.Type.CTC_MODIFY_SECTION)
|
||||||
public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode, String arriveSection, String departSection, int force) {
|
public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode
|
||||||
|
, String arriveSection, String departSection, int force) {
|
||||||
ctcStationRunPlanLogService.modifyRunPlanSection(simulation, stationCode, runPlanCode, arriveSection, departSection, force);
|
ctcStationRunPlanLogService.modifyRunPlanSection(simulation, stationCode, runPlanCode, arriveSection, departSection, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改方向口
|
||||||
|
*
|
||||||
|
* @param simulation 仿真对象
|
||||||
|
* @param stationCode 车站编码
|
||||||
|
* @param runPlanCode 运行计划
|
||||||
|
* @param arriveDirection 到达方向
|
||||||
|
* @param departDirection 出发方向
|
||||||
|
* @param force 是否强制
|
||||||
|
*/
|
||||||
|
@OperateHandlerMapping(type = Operation.Type.CTC_MODIFY_DIRECTION)
|
||||||
|
public void modifyRunPlanDirection(Simulation simulation, String stationCode, String runPlanCode
|
||||||
|
, String arriveDirection, String departDirection, int force) {
|
||||||
|
ctcStationRunPlanLogService.modifyRunPlanDirection(simulation, stationCode, runPlanCode, arriveDirection, departDirection, force);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人工上报行车日志的到点时间
|
* 人工上报行车日志的到点时间
|
||||||
*
|
*
|
||||||
@ -123,7 +141,6 @@ public class CtcStationRunPlanOperateHandler {
|
|||||||
ctcService.agreeDepartureNotice(simulation, stationCode, runPlanCode);
|
ctcService.agreeDepartureNotice(simulation, stationCode, runPlanCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签收阶段计划
|
* 签收阶段计划
|
||||||
*
|
*
|
||||||
@ -150,6 +167,17 @@ public class CtcStationRunPlanOperateHandler {
|
|||||||
ctcStationRunPlanLogService.applySection(simulation, stationCode, runPlanCode, sectionCode, model);
|
ctcStationRunPlanLogService.applySection(simulation, stationCode, runPlanCode, sectionCode, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送计划
|
||||||
|
*
|
||||||
|
* @param simulation 仿真
|
||||||
|
* @param stationCode 车站
|
||||||
|
*/
|
||||||
|
@OperateHandlerMapping(type = Operation.Type.CTC_STATION_SEND_OUT_RUN_PLAN)
|
||||||
|
public void doSendOutRunPlan(Simulation simulation, String stationCode) {
|
||||||
|
ctcStationRunPlanLogService.doSendOutRunPlan(simulation, stationCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消行车日志红闪
|
* 取消行车日志红闪
|
||||||
*
|
*
|
||||||
|
@ -583,10 +583,8 @@ public class CtcRunPlanParam implements Cloneable {
|
|||||||
* @return 是否存在
|
* @return 是否存在
|
||||||
*/
|
*/
|
||||||
public boolean arriveIsExist() {
|
public boolean arriveIsExist() {
|
||||||
return this.arrivePlanTime != null || !StringUtils.isEmpty(this.arriveTripNumber)
|
return this.arrivePlanTime != null && !StringUtils.isEmpty(this.arriveTripNumber)
|
||||||
|| !StringUtils.isEmpty(this.arriveSectionCode)
|
&& !StringUtils.isEmpty(this.arriveDirectionCode);
|
||||||
|| !StringUtils.isEmpty(this.arriveDirectionCode)
|
|
||||||
|| !StringUtils.isEmpty(this.arriveStationCode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -595,10 +593,8 @@ public class CtcRunPlanParam implements Cloneable {
|
|||||||
* @return 是否存在
|
* @return 是否存在
|
||||||
*/
|
*/
|
||||||
public boolean departIsExist() {
|
public boolean departIsExist() {
|
||||||
return this.departPlanTime != null || !StringUtils.isEmpty(this.departTripNumber)
|
return this.departPlanTime != null && !StringUtils.isEmpty(this.departTripNumber)
|
||||||
|| !StringUtils.isEmpty(this.departSectionCode)
|
&& !StringUtils.isEmpty(this.departDirectionCode);
|
||||||
|| !StringUtils.isEmpty(this.departDirectionCode)
|
|
||||||
|| !StringUtils.isEmpty(this.departStationCode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,8 +154,8 @@ public class CtcRunPlanErrorMsgService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 接车是否存在
|
// 接车是否存在
|
||||||
if (runPlanParam.arriveIsExist() && !StringUtils.isEmpty(runPlanParam.getArriveStationCode())) {
|
if (runPlanParam.arriveIsExist() && !StringUtils.isEmpty(runPlanParam.getArriveSectionCode())) {
|
||||||
TrackSection trackSection = effectRepository.queryTrackSection(stationCode, runPlanParam.getArriveStationCode());
|
TrackSection trackSection = effectRepository.queryTrackSection(stationCode, runPlanParam.getArriveSectionCode());
|
||||||
if (doTransfiniteCheck.apply(transfinite, trackSection)) {
|
if (doTransfiniteCheck.apply(transfinite, trackSection)) {
|
||||||
BusinessExceptionAssertEnum.OPERATION_FAIL.exception(String.format("运行计划超限不符合【接车股道:%s】超限"
|
BusinessExceptionAssertEnum.OPERATION_FAIL.exception(String.format("运行计划超限不符合【接车股道:%s】超限"
|
||||||
, runPlanParam.getArriveStationCode()));
|
, runPlanParam.getArriveStationCode()));
|
||||||
|
@ -21,6 +21,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -132,19 +133,70 @@ public class CtcStationRunPlanLogService {
|
|||||||
* @param arriveSection 到达股道
|
* @param arriveSection 到达股道
|
||||||
* @param departSection 出发股道
|
* @param departSection 出发股道
|
||||||
*/
|
*/
|
||||||
public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode, String arriveSection, String departSection, int force) {
|
public void modifyRunPlanSection(Simulation simulation, String stationCode, String runPlanCode
|
||||||
|
, String arriveSection, String departSection, int force) {
|
||||||
|
if (force == 0) {
|
||||||
|
CtcRunPlanParam p = new CtcRunPlanParam();
|
||||||
|
p.setRunPlanCode(runPlanCode);
|
||||||
|
p.setStationCode(stationCode);
|
||||||
|
p.setArriveSectionCode(arriveSection);
|
||||||
|
p.setDepartSectionCode(departSection);
|
||||||
|
// 股道与计划不一致检查
|
||||||
|
ctcRunPlanErrorMsgService.sectionInconsistentCheck.valid(simulation, stationCode, p);
|
||||||
|
}
|
||||||
CtcStationRunPlanLog ctcStationRunPlanLog =
|
CtcStationRunPlanLog ctcStationRunPlanLog =
|
||||||
simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
||||||
if (ctcStationRunPlanLog.getArriveRunPlan() != null && !StringUtils.isEmpty(arriveSection)) {
|
if (ctcStationRunPlanLog.getArriveRunPlan() != null && !StringUtils.isEmpty(arriveSection)) {
|
||||||
Section section = simulation.getRepository().getByCode(arriveSection, Section.class);
|
Section section = simulation.getRepository().getByCode(arriveSection, Section.class);
|
||||||
if (!Objects.equals(section, ctcStationRunPlanLog.getArriveRunPlan().getTrackSection())) {
|
if (!Objects.equals(section, ctcStationRunPlanLog.getArriveRunPlan().getTrackSection())) {
|
||||||
ctcStationRunPlanLog.getArriveRunPlan().setTrackSection(section);
|
ctcStationRunPlanLog.getArriveRunPlan().setTrackSection(section);
|
||||||
|
ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ctcStationRunPlanLog.getDepartRunPlan() != null && !StringUtils.isEmpty(departSection)) {
|
if (ctcStationRunPlanLog.getDepartRunPlan() != null && !StringUtils.isEmpty(departSection)) {
|
||||||
Section section = simulation.getRepository().getByCode(departSection, Section.class);
|
Section section = simulation.getRepository().getByCode(departSection, Section.class);
|
||||||
if (!Objects.equals(section, ctcStationRunPlanLog.getDepartRunPlan().getTrackSection())) {
|
if (!Objects.equals(section, ctcStationRunPlanLog.getDepartRunPlan().getTrackSection())) {
|
||||||
ctcStationRunPlanLog.getDepartRunPlan().setTrackSection(section);
|
ctcStationRunPlanLog.getDepartRunPlan().setTrackSection(section);
|
||||||
|
ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改方向口
|
||||||
|
*
|
||||||
|
* @param simulation 仿真对象
|
||||||
|
* @param stationCode 车站编码
|
||||||
|
* @param runPlanCode 运行计划
|
||||||
|
* @param arriveDirection 到达方向
|
||||||
|
* @param departDirection 出发方向
|
||||||
|
* @param force 是否强制
|
||||||
|
*/
|
||||||
|
public void modifyRunPlanDirection(Simulation simulation, String stationCode, String runPlanCode
|
||||||
|
, String arriveDirection, String departDirection, int force) {
|
||||||
|
if (force == 0) {
|
||||||
|
CtcRunPlanParam p = new CtcRunPlanParam();
|
||||||
|
p.setRunPlanCode(runPlanCode);
|
||||||
|
p.setStationCode(stationCode);
|
||||||
|
p.setArriveDirectionCode(arriveDirection);
|
||||||
|
p.setDepartDirectionCode(departDirection);
|
||||||
|
// 股道与计划不一致检查
|
||||||
|
ctcRunPlanErrorMsgService.directionInconsistentCheck.valid(simulation, stationCode, p);
|
||||||
|
}
|
||||||
|
CtcStationRunPlanLog ctcStationRunPlanLog =
|
||||||
|
simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
||||||
|
if (ctcStationRunPlanLog.getArriveRunPlan() != null && !StringUtils.isEmpty(arriveDirection)) {
|
||||||
|
StationDirection stationDirection = simulation.getRepository().getByCode(arriveDirection, StationDirection.class);
|
||||||
|
if (!Objects.equals(stationDirection, ctcStationRunPlanLog.getArriveRunPlan().getStationDirection())) {
|
||||||
|
ctcStationRunPlanLog.getArriveRunPlan().setStationDirection(stationDirection);
|
||||||
|
ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ctcStationRunPlanLog.getDepartRunPlan() != null && !StringUtils.isEmpty(departDirection)) {
|
||||||
|
StationDirection stationDirection = simulation.getRepository().getByCode(departDirection, StationDirection.class);
|
||||||
|
if (!Objects.equals(stationDirection, ctcStationRunPlanLog.getDepartRunPlan().getStationDirection())) {
|
||||||
|
ctcStationRunPlanLog.getDepartRunPlan().setStationDirection(stationDirection);
|
||||||
|
ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,6 +239,7 @@ public class CtcStationRunPlanLogService {
|
|||||||
CtcStationRunPlanLog ctcStationRunPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
CtcStationRunPlanLog ctcStationRunPlanLog = simulation.getCtcRepository().getRunPlanByRunPlanCode(stationCode, runPlanCode);
|
||||||
if (!Objects.equals(ctcStationRunPlanLog.getDelete(), Boolean.TRUE)) {
|
if (!Objects.equals(ctcStationRunPlanLog.getDelete(), Boolean.TRUE)) {
|
||||||
ctcStationRunPlanLog.setDelete(Boolean.TRUE);
|
ctcStationRunPlanLog.setDelete(Boolean.TRUE);
|
||||||
|
ctcStationRunPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_DELETE_CHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,39 +274,43 @@ public class CtcStationRunPlanLogService {
|
|||||||
if (CollectionUtils.isEmpty(ctcRunPlanVOList)) {
|
if (CollectionUtils.isEmpty(ctcRunPlanVOList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<CtcStationRunPlanLog> changeList = new LinkedList<>();
|
|
||||||
List<CtcStationRunPlanLog> createList = new LinkedList<>();
|
|
||||||
ctcRunPlanVOList.forEach(ctcRunPlanVO -> {
|
ctcRunPlanVOList.forEach(ctcRunPlanVO -> {
|
||||||
|
CtcRunPlanParam modifyParam = ctcRunPlanVO.getRunPlan();
|
||||||
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository()
|
CtcStationRunPlanLog runPlanLog = simulation.getCtcRepository()
|
||||||
.getRunPlanByRunPlanCodeAndStationCode(stationCode, ctcRunPlanVO.getRunPlanCode());
|
.getRunPlanByRunPlanCodeAndStationCode(stationCode, ctcRunPlanVO.getRunPlanCode());
|
||||||
boolean change = false;
|
boolean change = false;
|
||||||
if (runPlanLog != null) {
|
if (runPlanLog != null) {
|
||||||
runPlanLog.setBaseAttribute(ctcRunPlanVO.getRunPlan());
|
boolean isFinish = runPlanLog.arrivePlanTimeCheck(modifyParam.getArrivePlanTime())
|
||||||
|
&& runPlanLog.departPlanTimeCheck(modifyParam.getDepartPlanTime());
|
||||||
|
if (!isFinish) { // 已完成该车次的接发车作业,又收到该接发车时间范围内的阶段计划,不取消红闪
|
||||||
|
runPlanLog.setTwinkle(true);
|
||||||
|
} else { // 行车计划未完成
|
||||||
|
runPlanLog.setBaseAttribute(modifyParam);
|
||||||
// 到达
|
// 到达
|
||||||
if (ctcRunPlanVO.getRunPlan().arriveIsExist()) { // 不存在到达信息则直接浮空
|
if (modifyParam.arriveIsExist()) { // 不存在到达信息则直接浮空
|
||||||
change = modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), ctcRunPlanVO.getRunPlan(), true);
|
change = modifyRunPlanItemInfo(simulation, runPlanLog.getArriveRunPlan(), modifyParam, true);
|
||||||
} else {
|
} else {
|
||||||
change = runPlanLog.getArriveRunPlan() != null;
|
change = runPlanLog.getArriveRunPlan() != null;
|
||||||
runPlanLog.setArriveRunPlan(null);
|
runPlanLog.setArriveRunPlan(null);
|
||||||
}
|
}
|
||||||
// 出发
|
// 出发
|
||||||
if (ctcRunPlanVO.getRunPlan().departIsExist()) {
|
if (modifyParam.departIsExist()) {
|
||||||
change = change || modifyRunPlanItemInfo(simulation, runPlanLog.getDepartRunPlan(), ctcRunPlanVO.getRunPlan(), false);
|
change = change || modifyRunPlanItemInfo(simulation, runPlanLog.getDepartRunPlan(), modifyParam, false);
|
||||||
} else {
|
} else {
|
||||||
change = change || runPlanLog.getDepartRunPlan() != null;
|
change = change || runPlanLog.getDepartRunPlan() != null;
|
||||||
runPlanLog.setDepartRunPlan(null);
|
runPlanLog.setDepartRunPlan(null);
|
||||||
}
|
}
|
||||||
if (change) {
|
if (change) {
|
||||||
changeList.add(runPlanLog);
|
runPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE);
|
||||||
}
|
}
|
||||||
runPlanLog.setTwinkle(false); // 签收后,红闪消失
|
runPlanLog.setTwinkle(false); // 签收后,红闪消失
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
runPlanLog = CtcStationRunPlanLog.createRunPlanLog(simulation, stationCode, ctcRunPlanVO.getRunPlan());
|
runPlanLog = CtcStationRunPlanLog.createRunPlanLog(simulation, stationCode, modifyParam);
|
||||||
|
runPlanLog.setChange(CtcStationRunPlanLog.ChangeType.STATUS_ADD_CHANGE);
|
||||||
simulation.getCtcRepository().addRunPlanToSimulationMap(runPlanLog);
|
simulation.getCtcRepository().addRunPlanToSimulationMap(runPlanLog);
|
||||||
createList.add(runPlanLog);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
runPlanChange(simulation, changeList, createList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -282,6 +339,24 @@ public class CtcStationRunPlanLogService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【发送计划】至【占线板】
|
||||||
|
*
|
||||||
|
* @param simulation 仿真
|
||||||
|
* @param stationCode 车站编码
|
||||||
|
*/
|
||||||
|
public void doSendOutRunPlan(Simulation simulation, String stationCode) {
|
||||||
|
Map<String, CtcStationRunPlanLog> ctcRunPlanMap = simulation.getCtcRepository().getSimulationRunPlanMap().get(stationCode);
|
||||||
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(ctcRunPlanMap);
|
||||||
|
List<CtcStationRunPlanLog> changeList = ctcRunPlanMap.values().stream()
|
||||||
|
.filter(r -> CtcStationRunPlanLog.ChangeType.STATUS_MODIFY_CHANGE.equals(r.getChangeType()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
List<CtcStationRunPlanLog> createList = ctcRunPlanMap.values().stream()
|
||||||
|
.filter(r -> CtcStationRunPlanLog.ChangeType.STATUS_ADD_CHANGE.equals(r.getChangeType()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
runPlanChange(simulation, changeList, createList);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拉取车站最新运行计划
|
* 拉取车站最新运行计划
|
||||||
*
|
*
|
||||||
@ -450,6 +525,7 @@ public class CtcStationRunPlanLogService {
|
|||||||
StationDirection stationDirection = simulation.getRepository().getByCode(directionCode, StationDirection.class);
|
StationDirection stationDirection = simulation.getRepository().getByCode(directionCode, StationDirection.class);
|
||||||
if (!Objects.equals(stationDirection, runPlanItem.getStationDirection())) {
|
if (!Objects.equals(stationDirection, runPlanItem.getStationDirection())) {
|
||||||
runPlanItem.setStationDirection(stationDirection);
|
runPlanItem.setStationDirection(stationDirection);
|
||||||
|
change = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -464,7 +540,6 @@ public class CtcStationRunPlanLogService {
|
|||||||
*/
|
*/
|
||||||
private void runPlanChange(Simulation simulation, List<CtcStationRunPlanLog> changeList, List<CtcStationRunPlanLog> createList) {
|
private void runPlanChange(Simulation simulation, List<CtcStationRunPlanLog> changeList, List<CtcStationRunPlanLog> createList) {
|
||||||
if (!CollectionUtils.isEmpty(changeList)) { // 编辑过轨道的行车记录
|
if (!CollectionUtils.isEmpty(changeList)) { // 编辑过轨道的行车记录
|
||||||
|
|
||||||
changeList.stream().filter(r -> r.getArriveRunPlan() != null || r.getDepartRunPlan() != null)
|
changeList.stream().filter(r -> r.getArriveRunPlan() != null || r.getDepartRunPlan() != null)
|
||||||
.forEach(r -> {
|
.forEach(r -> {
|
||||||
if (r.getArriveRunPlan() != null && r.getArriveRunPlan().getTrackSection() != null) {
|
if (r.getArriveRunPlan() != null && r.getArriveRunPlan().getTrackSection() != null) {
|
||||||
@ -473,6 +548,7 @@ public class CtcStationRunPlanLogService {
|
|||||||
if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) {
|
if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) {
|
||||||
ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getDepartRunPlan(), true);
|
ctcService.runPlanItemUpdate(simulation, r.getStation(), r.getDepartRunPlan(), true);
|
||||||
}
|
}
|
||||||
|
r.clearChange(); // 签收完,清除变化类型
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,6 +561,7 @@ public class CtcStationRunPlanLogService {
|
|||||||
if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) {
|
if (r.getDepartRunPlan() != null && r.getDepartRunPlan().getTrackSection() != null) {
|
||||||
ctcService.runPlanItemCreate(simulation, r.getStation(), r.getDepartRunPlan(), true);
|
ctcService.runPlanItemCreate(simulation, r.getStation(), r.getDepartRunPlan(), true);
|
||||||
}
|
}
|
||||||
|
r.clearChange(); // 签收完,清除变化类型
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,9 @@ public class CtcZoneService {
|
|||||||
public CtcRunPlanParam saveRunPlan(Simulation simulation, CtcRunPlanParam planParam) {
|
public CtcRunPlanParam saveRunPlan(Simulation simulation, CtcRunPlanParam planParam) {
|
||||||
CtcZoneRepository railwayRepository = simulation.getCtcRepository().getCtcZoneRepository();
|
CtcZoneRepository railwayRepository = simulation.getCtcRepository().getCtcZoneRepository();
|
||||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(railwayRepository);
|
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(railwayRepository);
|
||||||
|
// 参数信息是否正确
|
||||||
|
boolean isNotEmpty = planParam.arriveIsExist() || planParam.departIsExist();
|
||||||
|
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue(!isNotEmpty, "缺少必填项");
|
||||||
if (StringUtils.isEmpty(planParam.getRunPlanCode())) { // 初始化运行计划编码、车次信息
|
if (StringUtils.isEmpty(planParam.getRunPlanCode())) { // 初始化运行计划编码、车次信息
|
||||||
// 确定车次信息
|
// 确定车次信息
|
||||||
String tripNumber = planParam.generateTripNumber();
|
String tripNumber = planParam.generateTripNumber();
|
||||||
|
@ -7,7 +7,10 @@ import club.joylink.rtss.simulation.cbtc.CTC.data.vo.TrackViewVO;
|
|||||||
import club.joylink.rtss.simulation.cbtc.CTC.service.CTCService;
|
import club.joylink.rtss.simulation.cbtc.CTC.service.CTCService;
|
||||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
import club.joylink.rtss.simulation.cbtc.data.map.Route;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||||
|
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;
|
||||||
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||||
@ -51,13 +54,13 @@ public class CTCLogicLoop {
|
|||||||
sendRunPlanRemoveMessage(simulation);
|
sendRunPlanRemoveMessage(simulation);
|
||||||
// 下发计划
|
// 下发计划
|
||||||
sendZoneRunPlanSend(simulation);
|
sendZoneRunPlanSend(simulation);
|
||||||
|
// 发送计划按钮是否闪烁
|
||||||
|
sendRunPlanConfirmActiveMessage(simulation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendAllMessage(Simulation simulation, String userId) {
|
public void sendAllMessage(Simulation simulation, String userId) {
|
||||||
sendAllTrackViewMessage(simulation, userId);
|
sendAllTrackViewMessage(simulation, userId);
|
||||||
sendAllRouteSequenceMessage(simulation, userId);
|
sendAllRouteSequenceMessage(simulation, userId);
|
||||||
// 下发计划,用户初登陆时需要接收消息
|
|
||||||
//sendZoneRunPlanSend(simulation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackViewUpdate(Simulation simulation) {
|
private void trackViewUpdate(Simulation simulation) {
|
||||||
@ -359,6 +362,23 @@ public class CTCLogicLoop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行计划发送计划
|
||||||
|
*/
|
||||||
|
public void sendRunPlanConfirmActiveMessage(Simulation simulation) {
|
||||||
|
Map<String, Boolean> changeMap = new HashMap<>();
|
||||||
|
simulation.getCtcRepository().getSimulationRunPlanMap().forEach((k, v) -> {
|
||||||
|
boolean isChange = v.values().stream().anyMatch(CtcStationRunPlanLog::isChange);
|
||||||
|
if (isChange) {
|
||||||
|
changeMap.put(k, Boolean.TRUE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!changeMap.isEmpty()) {
|
||||||
|
sendCtcMessage(simulation.getId(), changeMap, WebSocketMessageType.SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND
|
||||||
|
, simulation.getSimulationUserIds());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送CTC运行计划消息
|
* 发送CTC运行计划消息
|
||||||
*
|
*
|
||||||
|
@ -91,7 +91,6 @@ public class CtcRepository {
|
|||||||
* 运行日志消息状态
|
* 运行日志消息状态
|
||||||
*/
|
*/
|
||||||
private final Map<String, CtcStationRunPlanLogVO> runPlanStatusVOMap = new ConcurrentHashMap<>();
|
private final Map<String, CtcStationRunPlanLogVO> runPlanStatusVOMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
/******************************************* 以上为车站终端数据:车站为单位 *******************************************/
|
/******************************************* 以上为车站终端数据:车站为单位 *******************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,6 +130,11 @@ public class CtcStationRunPlanLog {
|
|||||||
*/
|
*/
|
||||||
private boolean twinkle;
|
private boolean twinkle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变化类型
|
||||||
|
*/
|
||||||
|
private ChangeType changeType;
|
||||||
|
|
||||||
public CtcStationRunPlanLog(CtcRunPlanParam paramInfo) {
|
public CtcStationRunPlanLog(CtcRunPlanParam paramInfo) {
|
||||||
this.planParam = paramInfo;
|
this.planParam = paramInfo;
|
||||||
this.code = paramInfo.getRunPlanCode();
|
this.code = paramInfo.getRunPlanCode();
|
||||||
@ -251,6 +256,71 @@ public class CtcStationRunPlanLog {
|
|||||||
arriveRunPlan.setAdjacentMessageTime("");
|
arriveRunPlan.setAdjacentMessageTime("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置变化类型
|
||||||
|
*
|
||||||
|
* @param type 变化类型
|
||||||
|
*/
|
||||||
|
public void setChange(ChangeType type) {
|
||||||
|
this.changeType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否存在变化
|
||||||
|
*
|
||||||
|
* @return 是否存在变化
|
||||||
|
*/
|
||||||
|
public boolean isChange() {
|
||||||
|
return this.changeType != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空变化状态
|
||||||
|
*/
|
||||||
|
public void clearChange() {
|
||||||
|
this.changeType = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接车完成
|
||||||
|
*
|
||||||
|
* @return 接车是否完成
|
||||||
|
*/
|
||||||
|
public boolean arriveFinish() {
|
||||||
|
return this.arriveRunPlan != null && !StringUtils.isEmpty(this.arriveRunPlan.getActualTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean arrivePlanTimeCheck(LocalDateTime planTime) {
|
||||||
|
if (this.arriveFinish() && planTime != null) { // 列车已到达
|
||||||
|
// 在原计划之后,不合理
|
||||||
|
return this.arriveRunPlan.getPlanTime().isBefore(planTime);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发车完成
|
||||||
|
*
|
||||||
|
* @return 发车是否完成
|
||||||
|
*/
|
||||||
|
public boolean departFinish() {
|
||||||
|
return this.departRunPlan != null && !StringUtils.isEmpty(this.departRunPlan.getActualTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean departPlanTimeCheck(LocalDateTime planTime) {
|
||||||
|
if (this.departFinish() && planTime != null) { // 列车已发车
|
||||||
|
return this.departRunPlan.getPlanTime().isAfter(planTime);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程是否完成
|
||||||
|
*/
|
||||||
|
public boolean isFinish() {
|
||||||
|
return this.arriveFinish() && this.departFinish();
|
||||||
|
}
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public static class RunPlanItem {
|
public static class RunPlanItem {
|
||||||
@ -348,6 +418,7 @@ public class CtcStationRunPlanLog {
|
|||||||
*/
|
*/
|
||||||
private String adjacentMessageTime;
|
private String adjacentMessageTime;
|
||||||
|
|
||||||
|
|
||||||
public RunPlanItem(CtcRunPlanParam paramInfo) {
|
public RunPlanItem(CtcRunPlanParam paramInfo) {
|
||||||
this.paramInfo = paramInfo;
|
this.paramInfo = paramInfo;
|
||||||
this.actualTime = "";
|
this.actualTime = "";
|
||||||
@ -596,4 +667,22 @@ public class CtcStationRunPlanLog {
|
|||||||
this.optionName = optionName;
|
this.optionName = optionName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行车日志变化类型
|
||||||
|
*/
|
||||||
|
public enum ChangeType {
|
||||||
|
/**
|
||||||
|
* 状态变化,增加
|
||||||
|
*/
|
||||||
|
STATUS_ADD_CHANGE,
|
||||||
|
/**
|
||||||
|
* 状态变化,删除
|
||||||
|
*/
|
||||||
|
STATUS_DELETE_CHANGE,
|
||||||
|
/**
|
||||||
|
* 状态变化,变更
|
||||||
|
*/
|
||||||
|
STATUS_MODIFY_CHANGE,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,10 +369,15 @@ public enum WebSocketMessageType {
|
|||||||
SIMULATION_CTC_RUN_PLAN_CHANGE,
|
SIMULATION_CTC_RUN_PLAN_CHANGE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仿真
|
* 仿真CTC运行计划发生删除
|
||||||
*/
|
*/
|
||||||
SIMULATION_CTC_RUN_PLAN_REMOVE,
|
SIMULATION_CTC_RUN_PLAN_REMOVE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仿真CTC运行计划【发送计划】按钮闪烁标识
|
||||||
|
*/
|
||||||
|
SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调度命令
|
* 调度命令
|
||||||
*/
|
*/
|
||||||
|
@ -111,6 +111,7 @@ public class SocketMessageFactory {
|
|||||||
case SIMULATION_CTC_RUN_PLAN_INIT:
|
case SIMULATION_CTC_RUN_PLAN_INIT:
|
||||||
case SIMULATION_CTC_RUN_PLAN_CHANGE:
|
case SIMULATION_CTC_RUN_PLAN_CHANGE:
|
||||||
case SIMULATION_CTC_RUN_PLAN_REMOVE:
|
case SIMULATION_CTC_RUN_PLAN_REMOVE:
|
||||||
|
case SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND:
|
||||||
case SIMULATION_RAIL_CTC_DISPATCH_COMMAND:
|
case SIMULATION_RAIL_CTC_DISPATCH_COMMAND:
|
||||||
case Simulation_RailCtcStatus: {
|
case Simulation_RailCtcStatus: {
|
||||||
topicList.add(SimulationSubscribeTopic.Ctc.buildDestination(group));
|
topicList.add(SimulationSubscribeTopic.Ctc.buildDestination(group));
|
||||||
|
Loading…
Reference in New Issue
Block a user