车务管理终端功能代码调整及径路更新,提交功能

This commit is contained in:
tiger_zhou 2022-08-25 15:26:16 +08:00
parent 37a8451173
commit 9d1a8c2fa5
6 changed files with 44 additions and 7 deletions

3
sql/20220825-zhouyin.sql Normal file
View File

@ -0,0 +1,3 @@
-- 出入口方向添加方向属性,需要重新编辑地图中出入口方向的属性
ALTER TABLE `draft_map_station_direction_label`
ADD COLUMN `io_direction` varchar(20) NULL COMMENT '出入口方向';

View File

@ -1311,6 +1311,7 @@ public class Operation {
* 车辆固定经路修改
*/
REGULAR_TRAIN_LINE_EDIT(new Label[]{Label.CLIENT}),
REGULAR_TRAIN_LINE_SAVE(new Label[]{Label.CLIENT}),
/**
* 车辆固定经路删除
*/

View File

@ -0,0 +1,20 @@
package club.joylink.rtss.simulation.cbtc.CTC.data.vo;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class FZkVO<T> {
private int version;
private T data;
public static <T> FZkVO of(int version,T d){
FZkVO<T> vo = new FZkVO<>();
vo.setVersion(version);
vo.setData(d);
return vo;
}
}

View File

@ -3,6 +3,7 @@ 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.vo.FZkVO;
import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RegularTrainLineVO;
import club.joylink.rtss.simulation.cbtc.CTC.param.CtcRunPlanParam;
import club.joylink.rtss.simulation.cbtc.CTC.service.runplan.CtcManageService;
@ -110,7 +111,7 @@ public class CtcManageOperateHandler {
* @return
*/
@OperateHandlerMapping(type = Operation.Type.REGULAR_TRAIN_LINE_STATION_UPDATE_LIST)
public List<RegularTrainLineVO> loadUpdateTrainLineData(Simulation simulation, String stationCode){
public FZkVO<List<RegularTrainLineVO>> loadUpdateTrainLineData(Simulation simulation, String stationCode){
return this.ctcManageService.loadUpdateRegularTrainLineList(simulation,stationCode);
}

View File

@ -29,11 +29,14 @@ public class CtcManageRegularTrainLineOperateHandler {
* @param stationCode 车站编码
* @param runPlanParamList 运行计划
*/
@OperateHandlerMapping(type = Operation.Type.REGULAR_TRAIN_LINE_SAVE)
public void saveTrainLine(Simulation simulation, String stationCode, RegularTrainLineVO runPlanParamList) {
this.ctcManageService.editRegularTrain(simulation,stationCode,runPlanParamList,true);
}
@OperateHandlerMapping(type = Operation.Type.REGULAR_TRAIN_LINE_EDIT)
public void editTrainLine(Simulation simulation, String stationCode, RegularTrainLineVO runPlanParamList) {
this.ctcManageService.editRegularTrain(simulation,stationCode,runPlanParamList);
this.ctcManageService.editRegularTrain(simulation,stationCode,runPlanParamList,false);
}
/**
* 保存固定列车经路批量处理
* @param simulation

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.exception.BaseException;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.CI.data.StationDirection;
import club.joylink.rtss.simulation.cbtc.CTC.data.*;
import club.joylink.rtss.simulation.cbtc.CTC.data.vo.FZkVO;
import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RegularTrainLineVO;
import club.joylink.rtss.simulation.cbtc.CTC.param.CtcRunPlanParam;
import club.joylink.rtss.simulation.cbtc.Simulation;
@ -11,10 +12,12 @@ import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.simulation.cbtc.data.map.Station;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
@ -209,14 +212,18 @@ public class CtcManageService {
* @param stationCode
* @param rt
*/
public void editRegularTrain(Simulation simulation, String stationCode, RegularTrainLineVO rt){
public void editRegularTrain(Simulation simulation, String stationCode, RegularTrainLineVO rt,boolean isSave){
BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(Objects.isNull(stationCode), String.format("车站号不能为空"));
if(!isSave && Strings.isNullOrEmpty(rt.getCode())){
BusinessExceptionAssertEnum.DATA_ERROR.assertNotTrue(Objects.isNull(stationCode), String.format("固定列车径路code 不能为空"));
}
CtcManageRepository repository = simulation.getCtcRepository().getCtcManageRepository();
CtcEffectRepository.RegularTrainLineRepository tLRepository = repository.getRegularTrainLineMap().get(stationCode);
if(tLRepository == null){
tLRepository = new CtcEffectRepository.RegularTrainLineRepository();
repository.getRegularTrainLineMap().put(stationCode,tLRepository);
}
if(Strings.isNullOrEmpty(rt.getCode())){
rt.setCode(simulation.getCtcRepository().createCode(CtcRepository.CtcFZKType.REGULAR_TRAIN,simulation.getId()));
}else{
@ -273,7 +280,7 @@ public class CtcManageService {
RegularTrainLineVO newRt = rt.clone();
String tipNum = rt.getPrefixTrain().concat(start.toString());
newRt.setArriveTipNum(tipNum);
this.editRegularTrain(simulation,stationCode,newRt);
this.editRegularTrain(simulation,stationCode,newRt,true);
}
}
@ -423,11 +430,13 @@ public class CtcManageService {
* @param stationCode
* @return
*/
public List<RegularTrainLineVO> loadUpdateRegularTrainLineList(Simulation simulation, String stationCode){
public FZkVO<List<RegularTrainLineVO>> loadUpdateRegularTrainLineList(Simulation simulation, String stationCode){
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotTrue(Objects.isNull(stationCode), String.format("车站号不能为空"));
CtcEffectRepository repository = simulation.getCtcRepository().getCtcEffectRepository();
CtcEffectRepository.RegularTrainLineRepository tLRepository = repository.getUpdateReguarTrainLineMap().get(stationCode);
return this.loadRegularTrainLineData(tLRepository);
List<RegularTrainLineVO> list = this.loadRegularTrainLineData(tLRepository);
return FZkVO.of(CollectionUtils.isEmpty(list)?0:tLRepository.version(),list);
}
/**