车务管理终端功能代码调整

This commit is contained in:
tiger_zhou 2022-08-22 16:36:23 +08:00
parent bd45e46e80
commit 6e862173b8
10 changed files with 198 additions and 27 deletions

View File

@ -90,6 +90,11 @@ public class DraftMapStationDirection implements Serializable {
* 相对方向 * 相对方向
*/ */
private String relativeLabelEnum; private String relativeLabelEnum;
/**
* 出入口方向
*/
private StationDirection.IODirection ioDirection;
public void generateSectionList() { public void generateSectionList() {
if (StringUtils.isEmpty(sectionsCode)) { if (StringUtils.isEmpty(sectionsCode)) {

View File

@ -1276,7 +1276,57 @@ public class Operation {
/** /**
* 给出票据 * 给出票据
*/ */
RAIL_GIVE_TICKET_TO(new Label[]{Label.OTHER}); RAIL_GIVE_TICKET_TO(new Label[]{Label.OTHER}),
/**
* 股道列表
*/
STATION_DETAIL_LIST(new Label[]{Label.CLIENT}),
/**
* 股道编辑
*/
STATION_DETAIL_EDIT(new Label[]{Label.CLIENT}),
/**
* 编辑区发布生效
*/
STATION_DETAIL_PUBLISH(new Label[]{Label.CLIENT}),
/**
* 车站出入口列表
*/
STATION_IO_GATE_LIST(new Label[]{Label.CLIENT}),
/**
* 车站出入口编辑
*/
STATION_IO_GATE_EDIT(new Label[]{Label.CLIENT}),
/**
* 编辑区发布生效
*/
STATION_IO_GATE_PUBLISH(new Label[]{Label.CLIENT}),
/**
* 车辆固定经路列表
*/
REGULAR_TRAIN_LINE_LIST(new Label[]{Label.CLIENT}),
/**
* 车辆固定经路修改
*/
REGULAR_TRAIN_LINE_EDIT(new Label[]{Label.CLIENT}),
/**
* 车辆固定经路删除
*/
REGULAR_TRAIN_LINE_DELETE(new Label[]{Label.CLIENT}),
/**
* 车辆固定经路清除
*/
REGULAR_TRAIN_LINE_CLEAR(new Label[]{Label.CLIENT}),
/**
* 车辆固定经路批量添加
*/
REGULAR_TRAIN_LINE_BATCH(new Label[]{Label.CLIENT}),
/**
* 编辑区发布生效
*/
REGULAR_TRAIN_LINE_PUBLISH(new Label[]{Label.CLIENT});
final Label[] labels; final Label[] labels;

View File

@ -70,6 +70,8 @@ public class StationDirection extends MayOutOfOrderDevice {
* 相对运行方向 * 相对运行方向
*/ */
private StationDirection relativeStationDirection; private StationDirection relativeStationDirection;
private Station relativeStation;
/**************************************** 初始数据配置信息 **********************************************/ /**************************************** 初始数据配置信息 **********************************************/
/***************************************** 联锁指示灯状态 ***********************************************/ /***************************************** 联锁指示灯状态 ***********************************************/
@ -170,6 +172,7 @@ public class StationDirection extends MayOutOfOrderDevice {
/***************************************** 半自动闭塞按钮状态 ******************************************/ /***************************************** 半自动闭塞按钮状态 ******************************************/
/***************************************** 关联进路信息 ***********************************************/ /***************************************** 关联进路信息 ***********************************************/
/** /**
* 当前进路列表 * 当前进路列表
*/ */
@ -201,7 +204,32 @@ public class StationDirection extends MayOutOfOrderDevice {
* 默认方向 * 默认方向
*/ */
private Boolean right; private Boolean right;
/***************************************** 车务终端管理出入口方向相关属性begin **********************************************/
private IODirection ioDirection;
/**
* 允许超限列车
* 选择/
* 1.普速铁路一般选择有明确不允许超限列
* 车的选择
* 2.高速铁路一般选择200km/h 客货共线铁路
* 根据文件确定
*/
private boolean allowOverrun;
/**
* 允许旅客列车
* 选择/两线多线区间根据行规
* 车运行分工选择
*/
private boolean travelTrain;
/**
* 允许货物列车
* 选择/两线多线区间根据行规
* 车运行分工选择
*/
private boolean goodsTrain;
/***************************************** 车务终端管理出入口方向相关属性begin **********************************************/
// TODO: 待数据统一之后这个构造函数代码可删除 20220714 // TODO: 待数据统一之后这个构造函数代码可删除 20220714
public StationDirection(String code, String name, DirectionLabelEnum labelEnum) { public StationDirection(String code, String name, DirectionLabelEnum labelEnum) {
this(code, name); this(code, name);
@ -211,7 +239,17 @@ public class StationDirection extends MayOutOfOrderDevice {
this.defaultRunStatus = this.getDefaultReceiveAndDeliver(); this.defaultRunStatus = this.getDefaultReceiveAndDeliver();
this.currentRouteList = getNowRouteList(); this.currentRouteList = getNowRouteList();
} }
public StationDirection(String code, String name, DirectionLabelEnum labelEnum,IODirection ioDirection) {
this(code, name);
this.labelEnum = labelEnum;
this.runModel = getDefaultDirectionRunModel();
this.runStatus = this.getDefaultReceiveAndDeliver();
this.defaultRunStatus = this.getDefaultReceiveAndDeliver();
this.currentRouteList = getNowRouteList();
this.ioDirection = ioDirection;
}
public StationDirection(DraftMapStationDirection draftMapStationDirection) { public StationDirection(DraftMapStationDirection draftMapStationDirection) {
this(draftMapStationDirection.getCode(), draftMapStationDirection.getName()); this(draftMapStationDirection.getCode(), draftMapStationDirection.getName());
this.labelEnum = draftMapStationDirection.getLabelEnum(); this.labelEnum = draftMapStationDirection.getLabelEnum();
@ -220,6 +258,8 @@ public class StationDirection extends MayOutOfOrderDevice {
this.defaultRunStatus = draftMapStationDirection.getRunStatus(); this.defaultRunStatus = draftMapStationDirection.getRunStatus();
this.currentRouteList = getNowRouteList(); this.currentRouteList = getNowRouteList();
this.isDataConfig = true; this.isDataConfig = true;
this.ioDirection = draftMapStationDirection.getIoDirection();
} }
public StationDirection(String code, String name) { public StationDirection(String code, String name) {
@ -663,4 +703,16 @@ public class StationDirection extends MayOutOfOrderDevice {
// 非自动 // 非自动
N N
} }
/**
* 出入口方向
*/
public enum IODirection{
DOWN_IN_STATION,
UP_IN_STATION,
DOWN_OUT_STATION,
UP_OUT_STATION,
BOTH_WAY_STATION;
}
} }

View File

@ -459,15 +459,15 @@ public class CtcEffectRepository {
* 车站出入口 * 车站出入口
*/ */
@Data @Data
public static class StationDoorRepository extends AbstractWorkspaceRepository<StationIOGate> { public static class StationDoorRepository extends AbstractWorkspaceRepository<StationDirection> {
@Override @Override
public void save(StationIOGate o) { public void save(StationDirection o) {
this.dataMap.put(o.getCode(),o); this.dataMap.put(o.getCode(),o);
} }
@Override @Override
public StationIOGate query(String code) { public StationDirection query(String code) {
return this.dataMap.get(code); return this.dataMap.get(code);
} }
} }

View File

@ -1,24 +1,45 @@
package club.joylink.rtss.simulation.cbtc.CTC.data; package club.joylink.rtss.simulation.cbtc.CTC.data;
import club.joylink.rtss.constants.DirectionLabelEnum; import club.joylink.rtss.simulation.cbtc.CI.data.StationDirection;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* 车站出入口 * 车站出入口
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class StationIOGate { public class StationIOGate {
public StationIOGate(StationDirection sd){
this.code = sd.getCode();
this.ioName = sd.getName();
this.allowOverrun = sd.isAllowOverrun();
this.travelTrain = sd.isTravelTrain();
this.goodsTrain = sd.isGoodsTrain();
this.ioDirection = sd.getIoDirection();
// this.defaultRunStatus = sd.getRunStatus();
// if(Objects.nonNull(sd.getRelativeStation())){
// this.relativeStationCode = sd.getRelativeStation().getCode();
// this.relativeStationName = sd.getRelativeStation().getName();
// }
}
private String code; private String code;
private String ioName; private String ioName;
private String relativeStationName;
private String relativeStationCode;
/**
* 接发车类型
*/
private StationDirection.ReceiveAndDeliverModel defaultRunStatus;
/** /**
* 出入口方向 * 出入口方向
* 1.双线自动闭塞区段按进站信号机的行别属性 * 1.双线自动闭塞区段按进站信号机的行别属性
* 选择下行进站/上行出站/下行出站/上行进站 * 选择下行进站/上行出站/下行出站/上行进站
* 2.单线自动闭塞半自动闭塞区段选择双向 * 2.单线自动闭塞半自动闭塞区段选择双向
*/ */
private DirectionLabelEnum direction; private StationDirection.IODirection ioDirection;
/** /**
* 允许超限列车 * 允许超限列车

View File

@ -80,6 +80,15 @@ public class TrackSection {
this.code = section.getCode(); this.code = section.getCode();
this.name = section.getName(); this.name = section.getName();
this.sectionCode = section.getCode(); this.sectionCode = section.getCode();
this.initDefault();
}
private void initDefault(){
this.trackNature =TrackNature.RIGHT_TRACK;
this.direction =DirectionType.D;
this.trainType = TrainType.VAN;
this.transfinite = CtcStationRunPlanLog.TransfiniteType.NO;
this.standType = StandType.NO;
} }
/** /**

View File

@ -169,10 +169,13 @@ public class CtcManageService {
.assertNotTrue(Strings.isNullOrEmpty(ts.getCode()), String.format("未找到对应的站细")); .assertNotTrue(Strings.isNullOrEmpty(ts.getCode()), String.format("未找到对应的站细"));
CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository(); CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository();
CtcEffectRepository.StationDoorRepository trackSectionRepository = repository.getDoorRepository().get(stationCode); CtcEffectRepository.StationDoorRepository trackSectionRepository = repository.getDoorRepository().get(stationCode);
Object obj = trackSectionRepository.query(ts.getCode()); StationDirection obj = trackSectionRepository.query(ts.getCode());
BusinessExceptionAssertEnum.DATA_NOT_EXIST BusinessExceptionAssertEnum.DATA_NOT_EXIST
.assertNotTrue(Objects.isNull(obj), String.format("未找到对应的站细")); .assertNotTrue(Objects.isNull(obj), String.format("未找到对应的站细"));
trackSectionRepository.save(ts); obj.setAllowOverrun(ts.isAllowOverrun());
obj.setTravelTrain(ts.isTravelTrain());
obj.setGoodsTrain(ts.isGoodsTrain());
trackSectionRepository.save(obj);
} }
/** /**
@ -184,7 +187,11 @@ public class CtcManageService {
public List<StationIOGate> listIOGate(Simulation simulation,String stationCode){ public List<StationIOGate> listIOGate(Simulation simulation,String stationCode){
CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository(); CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository();
CtcEffectRepository.StationDoorRepository doorRepository = repository.getDoorRepository().get(stationCode); CtcEffectRepository.StationDoorRepository doorRepository = repository.getDoorRepository().get(stationCode);
return Lists.newArrayList(doorRepository.getDataMap().values()); List<StationIOGate> gateList = new ArrayList<>();
for (StationDirection value : doorRepository.getDataMap().values()) {
gateList.add(new StationIOGate(value));
}
return gateList;
} }
@ -219,12 +226,17 @@ public class CtcManageService {
RegularTrainLine rt = new RegularTrainLine(rtvo); RegularTrainLine rt = new RegularTrainLine(rtvo);
Station station = dataRepository.getByCode(stationCode, Station.class); Station station = dataRepository.getByCode(stationCode, Station.class);
Section stand = dataRepository.getByCode(rtvo.getMasterCode(), Section.class); Section stand = dataRepository.getByCode(rtvo.getMasterCode(), Section.class);
Station backStation = dataRepository.getByCode(rtvo.getBackStationCode(),Station.class);
Station fontStation = dataRepository.getByCode(rtvo.getFontStationCode(),Station.class);
rt.setStation(station); rt.setStation(station);
rt.setMasterStand(stand); rt.setMasterStand(stand);
rt.setBackStation(backStation); if(Objects.nonNull(rtvo.getBackStationCode())){
rt.setFontStation(fontStation); Station backStation = dataRepository.getByCode(rtvo.getBackStationCode(),Station.class);
rt.setBackStation(backStation);
}
if(Objects.nonNull(rtvo.getFontStationCode())){
Station fontStation = dataRepository.getByCode(rtvo.getFontStationCode(),Station.class);
rt.setFontStation(fontStation);
}
for (StationDirection value : station.getStationDirectionMap().values()) { for (StationDirection value : station.getStationDirectionMap().values()) {
if(Objects.equals(value.getCode(),rtvo.getEnterDirCode())){ if(Objects.equals(value.getCode(),rtvo.getEnterDirCode())){
rt.setEnter(value); rt.setEnter(value);
@ -265,6 +277,9 @@ public class CtcManageService {
public List<RegularTrainLineVO> regularTrainLineList(Simulation simulation, String stationCode){ public List<RegularTrainLineVO> regularTrainLineList(Simulation simulation, String stationCode){
CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository(); CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository();
CtcEffectRepository.RegularTrainLineRepository tLRepository = repository.getRegularTrainLineMap().get(stationCode); CtcEffectRepository.RegularTrainLineRepository tLRepository = repository.getRegularTrainLineMap().get(stationCode);
if(Objects.isNull(tLRepository) || tLRepository.getDataMap().isEmpty()){
return Collections.emptyList();
}
List<RegularTrainLineVO> voList = new ArrayList<>(tLRepository.getDataMap().values().size()); List<RegularTrainLineVO> voList = new ArrayList<>(tLRepository.getDataMap().values().size());
for (RegularTrainLine value : tLRepository.getDataMap().values()) { for (RegularTrainLine value : tLRepository.getDataMap().values()) {
voList.add(new RegularTrainLineVO(value)); voList.add(new RegularTrainLineVO(value));

View File

@ -1672,7 +1672,8 @@ public class InterlockBuilder2 {
model = new StationDirection(stationDirection); model = new StationDirection(stationDirection);
} else { } else {
// TODO: 待数据统一之后下方构建代码可删除 20220714 // TODO: 待数据统一之后下方构建代码可删除 20220714
model = new StationDirection(stationDirection.getCode(), stationDirection.getName(), stationDirection.getLabelEnum()); // model = new StationDirection(stationDirection.getCode(), stationDirection.getName(), stationDirection.getLabelEnum());
model = new StationDirection(stationDirection.getCode(), stationDirection.getName(), stationDirection.getLabelEnum(),stationDirection.getIoDirection());
} }
// 注入信号灯数据 // 注入信号灯数据
if (!StringUtils.isEmpty(stationDirection.getSignalCode())) { if (!StringUtils.isEmpty(stationDirection.getSignalCode())) {
@ -1700,6 +1701,12 @@ public class InterlockBuilder2 {
} }
Station station = (Station) elementMap.get(stationDirection.getStationCode()); Station station = (Station) elementMap.get(stationDirection.getStationCode());
model.setStation(station); model.setStation(station);
if(Objects.nonNull(stationDirection.getRelativeStationCode())){
MapElement relativeStation = elementMap.get(stationDirection.getRelativeStationCode());
if(Objects.nonNull(relativeStation)){
model.setRelativeStation((Station) relativeStation);
}
}
station.getStationDirectionMap().put(model.getLabelEnum(), model); station.getStationDirectionMap().put(model.getLabelEnum(), model);
elementMap.put(model.getCode(), model); elementMap.put(model.getCode(), model);
} }

View File

@ -362,14 +362,15 @@ public class SimulationBuilder {
doorRepository.put(stationCode,doorRep); doorRepository.put(stationCode,doorRep);
} }
for (StationDirection sd : station.getStationDirectionMap().values()) { for (StationDirection sd : station.getStationDirectionMap().values()) {
StationIOGate ioGate = new StationIOGate(); // StationIOGate ioGate = new StationIOGate();
ioGate.setCode(sd.getCode()); // ioGate.setCode(sd.getCode());
ioGate.setIoName(sd.getName()); // ioGate.setIoName(sd.getName());
ioGate.setDirection(sd.getLabelEnum()); // ioGate.setDirection(sd.getLabelEnum());
doorRep.save(ioGate); doorRep.save(sd);
} }
for (Stand stand : station.getAllStandList()) { for (Stand stand : station.getAllStandList()) {
TrackSection ts = new TrackSection(stand.getSection()); TrackSection ts = new TrackSection(stand.getSection());
rep.save(ts); rep.save(ts);
} }
} }

View File

@ -14,6 +14,8 @@
<result column="run_status" jdbcType="VARCHAR" property="runStatus"/> <result column="run_status" jdbcType="VARCHAR" property="runStatus"/>
<result column="relative_station_code" jdbcType="VARCHAR" property="relativeStationCode"/> <result column="relative_station_code" jdbcType="VARCHAR" property="relativeStationCode"/>
<result column="relative_label_enum" jdbcType="VARCHAR" property="relativeLabelEnum"/> <result column="relative_label_enum" jdbcType="VARCHAR" property="relativeLabelEnum"/>
<result column="io_direction" jdbcType="VARCHAR" property="ioDirection"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
@ -80,7 +82,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, map_id, code, name, station_code, sections_code, label_enum, id, map_id, code, name, station_code, sections_code, label_enum,
signal_code, run_model, run_status, relative_station_code, signal_code, run_model, run_status, relative_station_code,io_direction,
relative_label_enum relative_label_enum
</sql> </sql>
@ -131,20 +133,20 @@
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into draft_map_station_direction_label ( insert into draft_map_station_direction_label (
map_id, code, name, station_code, sections_code, label_enum map_id, code, name, station_code, sections_code, label_enum
,signal_code, run_model, run_status, relative_station_code, relative_label_enum ,signal_code, run_model, run_status, relative_station_code, relative_label_enum,io_direction
) )
values ( values (
#{mapId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{name, jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR} #{mapId,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{name, jdbcType=VARCHAR}, #{stationCode,jdbcType=VARCHAR}
,#{sectionsCode,jdbcType=VARCHAR}, #{labelEnum,jdbcType=VARCHAR}, #{signalCode,jdbcType=VARCHAR} ,#{sectionsCode,jdbcType=VARCHAR}, #{labelEnum,jdbcType=VARCHAR}, #{signalCode,jdbcType=VARCHAR}
,#{runModel,jdbcType=VARCHAR},#{runStatus,jdbcType=VARCHAR},#{relativeStationCode,jdbcType=VARCHAR} ,#{runModel,jdbcType=VARCHAR},#{runStatus,jdbcType=VARCHAR},#{relativeStationCode,jdbcType=VARCHAR}
,#{relativeLabelEnum, jdbcType=VARCHAR} ,#{relativeLabelEnum, jdbcType=VARCHAR},#{ioDirection, jdbcType=VARCHAR}
) )
</insert> </insert>
<insert id="insertList"> <insert id="insertList">
insert into draft_map_station_direction_label ( insert into draft_map_station_direction_label (
map_id, code, name, station_code, sections_code, label_enum map_id, code, name, station_code, sections_code, label_enum
,signal_code, run_model, run_status, relative_station_code, relative_label_enum ,signal_code, run_model, run_status, relative_station_code, relative_label_enum,io_direction
) )
values values
<foreach collection="list" item="record" separator=","> <foreach collection="list" item="record" separator=",">
@ -153,7 +155,7 @@
#{record.stationCode,jdbcType=VARCHAR}, #{record.sectionsCode,jdbcType=VARCHAR}, #{record.stationCode,jdbcType=VARCHAR}, #{record.sectionsCode,jdbcType=VARCHAR},
#{record.labelEnum,jdbcType=VARCHAR}, #{record.signalCode,jdbcType=VARCHAR} , #{record.labelEnum,jdbcType=VARCHAR}, #{record.signalCode,jdbcType=VARCHAR} ,
#{record.runModel,jdbcType=VARCHAR}, #{record.runStatus,jdbcType=VARCHAR}, #{record.runModel,jdbcType=VARCHAR}, #{record.runStatus,jdbcType=VARCHAR},
#{record.relativeStationCode,jdbcType=VARCHAR} ,#{record.relativeLabelEnum,jdbcType=VARCHAR} #{record.relativeStationCode,jdbcType=VARCHAR} ,#{record.relativeLabelEnum,jdbcType=VARCHAR},#{record.ioDirection, jdbcType=VARCHAR}
) )
</foreach> </foreach>
@ -235,6 +237,9 @@
<if test="record.relativeLabelEnum != null"> <if test="record.relativeLabelEnum != null">
relative_label_enum= #{record.relativeLabelEnum,jdbcType=VARCHAR}, relative_label_enum= #{record.relativeLabelEnum,jdbcType=VARCHAR},
</if> </if>
<if test="record.ioDirection != null">
io_direction= #{record.ioDirection,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
@ -254,7 +259,9 @@
run_model = #{record.runModel,jdbcType=VARCHAR}, run_model = #{record.runModel,jdbcType=VARCHAR},
run_status = #{record.runStatus,jdbcType=VARCHAR}, run_status = #{record.runStatus,jdbcType=VARCHAR},
relative_station_code= #{record.relativeStationCode,jdbcType=VARCHAR}, relative_station_code= #{record.relativeStationCode,jdbcType=VARCHAR},
relative_label_enum= #{record.relativeLabelEnum,jdbcType=VARCHAR} relative_label_enum= #{record.relativeLabelEnum,jdbcType=VARCHAR},
io_direction= #{record.ioDirection,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
@ -297,6 +304,9 @@
<if test="relativeLabelEnum != null"> <if test="relativeLabelEnum != null">
relative_label_enum= #{relativeLabelEnum,jdbcType=VARCHAR}, relative_label_enum= #{relativeLabelEnum,jdbcType=VARCHAR},
</if> </if>
<if test="record.ioDirection != null">
io_direction= #{record.ioDirection,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -314,7 +324,8 @@
run_model = #{runModel,jdbcType=VARCHAR}, run_model = #{runModel,jdbcType=VARCHAR},
run_status = #{runStatus,jdbcType=VARCHAR}, run_status = #{runStatus,jdbcType=VARCHAR},
relative_station_code= #{relativeStationCode,jdbcType=VARCHAR}, relative_station_code= #{relativeStationCode,jdbcType=VARCHAR},
relative_label_enum= #{relativeLabelEnum,jdbcType=VARCHAR} relative_label_enum= #{relativeLabelEnum,jdbcType=VARCHAR},
io_direction= #{record.ioDirection,jdbcType=VARCHAR},
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>