Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-zhouyin

This commit is contained in:
tiger_zhou 2023-01-31 14:13:19 +08:00
commit 712da01cc3
5 changed files with 316 additions and 0 deletions

View File

@ -1399,6 +1399,22 @@ public class Operation {
REGULAR_TRAIN_LINE_STATION_UPDATE(new Label[]{Label.CLIENT},true),
REGULAR_TRAIN_LINE_STATION_UPDATE_LIST(new Label[]{Label.CLIENT},true),
REGULAR_TRAIN_LINE_STATION_UPDATE_LOAD(new Label[]{Label.CLIENT},true),
/**
* 非正常情况接发列车关键环节控制表信息保存
*/
KEY_LINK_CONTROL_INFO_SAVE(new Label[]{Label.CLIENT}, true),
/**
* 非正常情况接发列车关键环节控制表信息更新
*/
KEY_LINK_CONTROL_INFO_UPDATE(new Label[]{Label.CLIENT}, true),
/**
* 非正常情况接发列车关键环节控制表信息查询
*/
KEY_LINK_CONTROL_INFO_QUERY(new Label[]{Label.CLIENT}, true),
//----------------------------会话信息------------------------------
/**
* 电话创建电话消息

View File

@ -139,6 +139,11 @@ public class CtcRepository {
*/
private final CopyOnWriteArrayList<Ticket> tickets = new CopyOnWriteArrayList<>();
/**
* 非正常情况接发列车关键环节控制表
*/
private final KeyLinkControlInfo keyLinkControlInfo = new KeyLinkControlInfo();
public void reset(Simulation simulation) {
MapConfig config = simulation.getRepository().getConfig();
// 仿真运行数据直接清空

View File

@ -0,0 +1,232 @@
package club.joylink.rtss.simulation.cbtc.CTC.data;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import org.springframework.util.IdGenerator;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 非正常情况接发列车关键环节控制表
*/
@Data
public class KeyLinkControlInfo {
@JsonIgnore
private final AtomicInteger idGenerator = new AtomicInteger(0);
/**
* 各个车站的关键环节控制信息
*/
private Map<String, List<DetailInfo>> stationDetailInfoMap = new HashMap<>();
/**
* 保存关键环节控制信息
* @param detailInfo 详情信息
*/
public void saveDetailInfo(DetailInfo detailInfo) {
if (StringUtils.isEmpty(detailInfo.getStationCode())) {
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "车站信息为空");
}
List<DetailInfo> dataList = null;
if (stationDetailInfoMap.containsKey(detailInfo.getStationCode())) {
dataList = stationDetailInfoMap.get(detailInfo.getStationCode());
} else {
dataList = new LinkedList<>();
stationDetailInfoMap.put(detailInfo.getStationCode(), dataList);
}
detailInfo.setId(idGenerator.incrementAndGet());
dataList.add(detailInfo);
}
/**
* 更新信息
* @param detailInfo 详情信息
*/
public void updateDetailInfo(DetailInfo detailInfo) {
List<DetailInfo> dataList = stationDetailInfoMap.get(detailInfo.getStationCode());
if (CollectionUtils.isEmpty(dataList)) {
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "无效数据");
}
DetailInfo oldDetailInfo = dataList.stream().filter(d -> Objects.equals(d.getId(), detailInfo.getId()))
.findFirst().orElse(null);
if (oldDetailInfo == null) {
throw new SimulationException(SimulationExceptionType.Data_Not_Exist);
}
dataList.set(dataList.indexOf(oldDetailInfo), detailInfo);
}
/**
* 获取信息列表
* @param stationCode 车站
* @return 信息列表
*/
public List<DetailInfo> getDetailInfoList(String stationCode) {
return stationDetailInfoMap.getOrDefault(stationCode, new LinkedList<>());
}
/**
* 表详情
*/
@Data
public static class DetailInfo {
/**
* 主键
*/
private Integer id;
/**
* 车站编码
*/
private String stationCode;
/**
* 值班员
*/
private String supervisor;
/**
* 干部上岗是由
*/
private String cadresPost;
/**
* 监控干部
*/
private String monitorCadres;
/**
* 天气
*/
private String weather;
/**
* 日期
*/
private String registerDate;
/**
* 通知干部时间
*/
private TimeStructure noticeCadresTime;
/**
* 报告列车调度员时间
*/
private TimeStructure reportDispatcherTime;
/**
* 报告指挥中心时间
*/
private TimeStructure reportCommandCentreTime;
/**
* 监控干部到岗时间
*/
private TimeStructure monitorArriveTime;
/**
* 登记列表
*/
private List<RegisterInfo> registerInfoList;
/**
* 故障内容
*/
private String faultContent;
/**
* 区间闭塞封闭情况
*/
private String sectionContent;
/**
* 接车进路准备方式
*/
private String pickRoutePrepareContent;
/**
* 接车信号
*/
private String pickSignal;
/**
* 发车进路准备方式
*/
private String departRoutePrepareContent;
/**
* 其他关键环节
*/
private String otherKeyLinkContent;
}
/**
* 登记信息
*/
@Data
public static class RegisterInfo {
/**
* 登记单位
*/
private String departmentName;
/**
* 运统46登记(通知干部上岗)
*/
private String registration;
/**
* 运统46签认(报告列车调度员)
*/
private boolean reportSign;
/**
* 报告列车调度员(报告列车调度员)
*/
private boolean reportDispatcher;
/**
* 调度命令核对接收报告指挥中心
*/
private boolean centerDispatchCommandCheck;
/**
* 运统46到点签认(监控干部到岗)
*/
private boolean monitorArrive;
/**
* 运统46销记签认(安排工作人员)
*/
private boolean writeOff;
/**
* 调度命令核对接收安排工作人员
*/
private boolean workerDispatchCommandCheck;
}
/**
* 时分数据格式
*/
@Data
public static class TimeStructure {
/**
*
*/
private String hour;
/**
*
*/
private String minute;
}
}

View File

@ -3,7 +3,9 @@ package club.joylink.rtss.simulation.cbtc.CTC.operation;
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler;
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping;
import club.joylink.rtss.simulation.cbtc.CTC.data.KeyLinkControlInfo;
import club.joylink.rtss.simulation.cbtc.CTC.data.Ticket;
import club.joylink.rtss.simulation.cbtc.CTC.service.KeyLinkControlService;
import club.joylink.rtss.simulation.cbtc.CTC.service.RailRegisterService;
import club.joylink.rtss.simulation.cbtc.CTC.data.Register;
import club.joylink.rtss.simulation.cbtc.CTC.service.RailTicketService;
@ -23,6 +25,8 @@ public class RailOperateHandler {
private RailRegisterService railRegisterService;
@Autowired
private RailTicketService railTicketService;
@Autowired
private KeyLinkControlService keyLinkControlService;
/**
* 填写行车簿册
@ -63,4 +67,28 @@ public class RailOperateHandler {
public void giveTicketTo(Simulation simulation, SimulationMember member, String ticketId, String memberId) {
railTicketService.giveTicketTo(simulation, member, ticketId, memberId);
}
/**
* 保存非正常情况接发列车关键环节控制表
*/
@OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_SAVE)
public void saveKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) {
keyLinkControlService.save(simulation, detailInfo);
}
/**
* 更新非正常情况接发列车关键环节控制表
*/
@OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_UPDATE)
public void updateKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) {
keyLinkControlService.update(simulation, detailInfo);
}
/**
* 查询非正常情况接发列车关键环节控制表
*/
@OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_QUERY)
public List<KeyLinkControlInfo.DetailInfo> queryKeyLinkControlInfo(Simulation simulation, String stationCode) {
return keyLinkControlService.query(simulation, stationCode);
}
}

View File

@ -0,0 +1,35 @@
package club.joylink.rtss.simulation.cbtc.CTC.service;
import club.joylink.rtss.simulation.cbtc.CTC.data.KeyLinkControlInfo;
import club.joylink.rtss.simulation.cbtc.Simulation;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 非正常情况接发列车关键环节控制表
*/
@Service
public class KeyLinkControlService {
/**
* 保存非正常情况接发列车关键环节控制表
*/
public void save(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) {
simulation.getCtcRepository().getKeyLinkControlInfo().saveDetailInfo(detailInfo);
}
/**
* 更新非正常情况接发列车关键环节控制表
*/
public void update(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) {
simulation.getCtcRepository().getKeyLinkControlInfo().updateDetailInfo(detailInfo);
}
/**
* 查询非正常情况接发列车关键环节控制表
*/
public List<KeyLinkControlInfo.DetailInfo> query(Simulation simulation, String stationCode) {
return simulation.getCtcRepository().getKeyLinkControlInfo().getDetailInfoList(stationCode);
}
}