上饶沙盘特殊改动

This commit is contained in:
thesai 2021-11-25 15:40:55 +08:00
parent f7cb5fca15
commit 10d2c3011e
7 changed files with 57 additions and 45 deletions

View File

@ -25,12 +25,12 @@ public class LicenseInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// if (SystemEnv.isLocalEnv(otherConfig.getEnv())) { if (SystemEnv.isLocalEnv(otherConfig.getEnv())) {
// log.debug(String.format("本地部署许可证验证")); log.debug(String.format("本地部署许可证验证"));
// LicenseVO license = this.licenseService.getLicense(); LicenseVO license = this.licenseService.getLicense();
// BusinessExceptionAssertEnum.LICENSE_EXPIRED.assertNotTrue(license.isExpire(), "本地license已过期"); BusinessExceptionAssertEnum.LICENSE_EXPIRED.assertNotTrue(license.isExpire(), "本地license已过期");
// log.debug("本地许可证有效"); log.debug("本地许可证有效");
// } }
return true; return true;
} }
} }

View File

@ -21,7 +21,8 @@ import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.runplan.*; import club.joylink.rtss.vo.client.runplan.*;
import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO; import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO;
import club.joylink.rtss.vo.client.runplan.user.RunPlanRunlevelVO; import club.joylink.rtss.vo.client.runplan.user.RunPlanRunlevelVO;
import club.joylink.rtss.vo.map.*; import club.joylink.rtss.vo.map.MapVO;
import club.joylink.rtss.vo.map.RealLineConfigVO;
import club.joylink.rtss.vo.map.graph.MapSectionNewVO; import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
import club.joylink.rtss.vo.map.graph.MapStationNewVO; import club.joylink.rtss.vo.map.graph.MapStationNewVO;
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO; import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
@ -793,7 +794,7 @@ public class RunPlanDraftService implements IRunPlanDraftService {
Map<String, List<RunPlanTripVO>> serviceMap = planVO.getTripList().stream().collect(Collectors.groupingBy(RunPlanTripVO::getServiceNumber)); Map<String, List<RunPlanTripVO>> serviceMap = planVO.getTripList().stream().collect(Collectors.groupingBy(RunPlanTripVO::getServiceNumber));
serviceMap.forEach((s, trips) -> { serviceMap.forEach((s, trips) -> {
trips.sort(Comparator.comparing(RunPlanTripVO::getStartTime)); trips.sort(Comparator.comparing(RunPlanTripVO::getStartTime));
if(Objects.isNull(trips.get(0).getIsOutbound()) || !trips.get(0).getIsOutbound()){ if (Objects.isNull(trips.get(0).getIsOutbound()) || !trips.get(0).getIsOutbound()) {
errorList.add(String.format("服务号[%s]首班车次[%s]不是出库", s, trips.get(0).getTripNumber())); errorList.add(String.format("服务号[%s]首班车次[%s]不是出库", s, trips.get(0).getTripNumber()));
} }
LocalTime departTime = trips.get(0).getStartTime().plusHours(OFFSET_TIME_HOURS); LocalTime departTime = trips.get(0).getStartTime().plusHours(OFFSET_TIME_HOURS);
@ -802,7 +803,7 @@ public class RunPlanDraftService implements IRunPlanDraftService {
errorList.add(String.format("服务号[%s]首班车次发车时间[%s]过早应不早于02:00", s, departTime)); errorList.add(String.format("服务号[%s]首班车次发车时间[%s]过早应不早于02:00", s, departTime));
} }
if(Objects.isNull(trips.get(trips.size() - 1).getIsInbound()) || !trips.get(trips.size() - 1).getIsInbound()){ if (Objects.isNull(trips.get(trips.size() - 1).getIsInbound()) || !trips.get(trips.size() - 1).getIsInbound()) {
errorList.add(String.format("服务号[%s]最后一班车次[%s]不是回库", s, trips.get(trips.size() - 1).getTripNumber())); errorList.add(String.format("服务号[%s]最后一班车次[%s]不是回库", s, trips.get(trips.size() - 1).getTripNumber()));
} }
LocalTime overTime = trips.get(trips.size() - 1).getEndTime().plusHours(OFFSET_TIME_HOURS); LocalTime overTime = trips.get(trips.size() - 1).getEndTime().plusHours(OFFSET_TIME_HOURS);
@ -889,13 +890,13 @@ public class RunPlanDraftService implements IRunPlanDraftService {
//车次里每个站间运行等级速度计5km/h()~100km/h() //车次里每个站间运行等级速度计5km/h()~100km/h()
long runTime = ChronoUnit.SECONDS.between(departureTime, nextArrivalTime); long runTime = ChronoUnit.SECONDS.between(departureTime, nextArrivalTime);
if (runTime <= 0) { // if (runTime <= 0) { 上饶沙盘注掉
errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]运行时间<=0,运行时间不合理", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName())); // errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]运行时间<=0,运行时间不合理", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName()));
continue; // continue;
} // }
Float distance = stationSpacingMap.get(tripTime.getSectionCode() + "-" + nextTripTime.getSectionCode()); Float distance = stationSpacingMap.get(tripTime.getSectionCode() + "-" + nextTripTime.getSectionCode());
MapSectionNewVO startSection = map.findSection(tripTime.getSectionCode()); MapSectionNewVO startSection = map.findSection(tripTime.getSectionCode());
if (startSection.isReentryTrack() && !startSection.isStandTrack()){ if (startSection.isReentryTrack() && !startSection.isStandTrack()) {
continue; continue;
} }
if (Objects.isNull(distance)) { if (Objects.isNull(distance)) {
@ -906,10 +907,10 @@ public class RunPlanDraftService implements IRunPlanDraftService {
errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]平均运行速度过慢,应不小于5km/h", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName())); errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]平均运行速度过慢,应不小于5km/h", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName()));
continue; continue;
} }
if (runTime * 100 * 1000 / 3600 < distance) { // if (runTime * 100 * 1000 / 3600 < distance) {
errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]平均运行速度过快,应不大于100km/h", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName())); // errorList.add(String.format("服务号[%s]车次号[%s]从车站[%s]至车站[%s]平均运行速度过快,应不大于100km/h", s, trip.getTripNumber(), map.findStation(tripTime.getStationCode()).getName(), map.findStation(nextTripTime.getStationCode()).getName()));
continue; // continue;
} // }
} }
RunPlanTripTimeVO tripLastStationEndTime = timeList.get(n); RunPlanTripTimeVO tripLastStationEndTime = timeList.get(n);
@ -973,10 +974,10 @@ public class RunPlanDraftService implements IRunPlanDraftService {
list.values().stream().forEach(l -> { list.values().stream().forEach(l -> {
if (!CollectionUtils.isEmpty(errorList)) return; if (!CollectionUtils.isEmpty(errorList)) return;
l.sort((o1, o2) -> { l.sort((o1, o2) -> {
if(Objects.nonNull(o1.getPreDepartTime()) && Objects.nonNull(o2.getPreDepartTime())){ if (Objects.nonNull(o1.getPreDepartTime()) && Objects.nonNull(o2.getPreDepartTime())) {
return o1.getPreDepartTime().compareTo(o2.getPreDepartTime()); return o1.getPreDepartTime().compareTo(o2.getPreDepartTime());
} }
return o1.getArrivalTime().compareTo(o2.getArrivalTime()) ; return o1.getArrivalTime().compareTo(o2.getArrivalTime());
}); });
RunPlanTripTimeInfo pre = l.get(0); RunPlanTripTimeInfo pre = l.get(0);
for (int i = 1; i < l.size(); i++) { for (int i = 1; i < l.size(); i++) {
@ -996,7 +997,7 @@ public class RunPlanDraftService implements IRunPlanDraftService {
if (ChronoUnit.SECONDS.between(pre.getDepartureTime(), cur.getArrivalTime()) < 10) { if (ChronoUnit.SECONDS.between(pre.getDepartureTime(), cur.getArrivalTime()) < 10) {
errorList.add(String.format("相邻车次[%s-%s] 与 车次[%s-%s]行车至车站[%s]时运行间隔太小不安全,应不小于10秒", errorList.add(String.format("相邻车次[%s-%s] 与 车次[%s-%s]行车至车站[%s]时运行间隔太小不安全,应不小于10秒",
pre.getServiceNumber(), pre.getTripNumber(), pre.getServiceNumber(), pre.getTripNumber(),
cur.getServiceNumber(), cur.getTripNumber(),map.findStation(cur.getStationCode()).getName())); cur.getServiceNumber(), cur.getTripNumber(), map.findStation(cur.getStationCode()).getName()));
return; return;
} }
pre = cur; pre = cur;
@ -1038,7 +1039,7 @@ public class RunPlanDraftService implements IRunPlanDraftService {
this.tripNumber = tripNumber; this.tripNumber = tripNumber;
} }
public RunPlanTripTimeInfo(String serviceNumber, String tripNumber,LocalTime preDepartTime, boolean right, RunPlanTripTimeVO tripTime) { public RunPlanTripTimeInfo(String serviceNumber, String tripNumber, LocalTime preDepartTime, boolean right, RunPlanTripTimeVO tripTime) {
super(tripTime.getStationCode(), tripTime.getSectionCode(), tripTime.getArrivalTime(), tripTime.getDepartureTime()); super(tripTime.getStationCode(), tripTime.getSectionCode(), tripTime.getArrivalTime(), tripTime.getDepartureTime());
this.serviceNumber = serviceNumber; this.serviceNumber = serviceNumber;
this.tripNumber = tripNumber; this.tripNumber = tripNumber;

View File

@ -318,7 +318,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
if (Objects.nonNull(autoSignal)) { if (Objects.nonNull(autoSignal)) {
autoSignalList.add(autoSignal); autoSignalList.add(autoSignal);
} }
} else if (signal.isProtectionSignal()) { } else if (signal.isProtectionSignal() || signal.isOutboundSignal()) { //为解决上饶沙盘列车从车辆段至49G后无进路问题
// 防护信号机生成进路 // 防护信号机生成进路
if (config.isLikeHa1()) { if (config.isLikeHa1()) {
generatedRouteList.addAll(this.generateRouteLikeHa1(signal, routeCodeGenerator, overlapMap, generatedRouteList.addAll(this.generateRouteLikeHa1(signal, routeCodeGenerator, overlapMap,

View File

@ -11,9 +11,9 @@ import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.MapDataVO; import club.joylink.rtss.vo.client.map.MapDataVO;
import club.joylink.rtss.vo.map.MapVO;
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO; import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO; import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
import club.joylink.rtss.vo.map.MapVO;
import club.joylink.rtss.vo.map.query.MapRunLevelQueryVO; import club.joylink.rtss.vo.map.query.MapRunLevelQueryVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -39,7 +39,14 @@ public class DraftMapRunLevelServiceImpl implements DraftMapRunLevelService {
@Override @Override
@Transactional @Transactional
public MapStationRunLevelVO generate(MapStationRunLevelVO runLevelVO) { public MapStationRunLevelVO generate(MapStationRunLevelVO runLevelVO) {
MapDataVO mapData = this.iDraftMapService.getMapData(runLevelVO.getMapId()); //因上饶沙盘项目生成车站6至车辆段的站间运行时间的接口参数中无mapId故加此逻辑
long mapId;
if (runLevelVO.getMapId() != null) {
mapId = runLevelVO.getMapId();
} else {
mapId = 1254;
}
MapDataVO mapData = this.iDraftMapService.getMapData(mapId);
MapVO map = new MapVO(); MapVO map = new MapVO();
map.setMapData(mapData); map.setMapData(mapData);
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map); SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildMapDeviceData(map);
@ -128,6 +135,10 @@ public class DraftMapRunLevelServiceImpl implements DraftMapRunLevelService {
@Override @Override
public void create(MapStationRunLevelVO runLevelVO) { public void create(MapStationRunLevelVO runLevelVO) {
//因上饶沙盘项目保存站间运行时间的接口参数中无mapId故加此逻辑
if (runLevelVO.getMapId() == null) {
runLevelVO.setMapId(1254L);
}
// 开始区段结束区段校验 // 开始区段结束区段校验
BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(isExisted(runLevelVO)); BusinessExceptionAssertEnum.DATA_ALREADY_EXIST.assertNotTrue(isExisted(runLevelVO));
// 保存运行等级数据 // 保存运行等级数据

View File

@ -29,8 +29,8 @@ public class MaService {
@Getter @Getter
public static class Ma { public static class Ma {
public static final int Safety_Margin = 1; // 安全余量单位m暂时没有计算紧急制动曲线暂时不用 public static final int Safety_Margin = 1; // 安全余量单位m暂时没有计算紧急制动曲线暂时不用
public static final int EB_Trigger = 20; // 紧急制动触发点偏移量单位m public static final int EB_Trigger = 2; // 紧急制动触发点偏移量单位m todo 临时修改上饶沙盘
public static final int Safety_Distance = 30; // 安全距离 单位m public static final int Safety_Distance = 3; // 安全距离 单位m
VirtualRealityTrain train; // 列车 VirtualRealityTrain train; // 列车
MapNamedElement device; // 终端设备 MapNamedElement device; // 终端设备

View File

@ -314,14 +314,14 @@ public class MapDeviceBuilder {
}); });
/* ZC和区段相互赋值 */ /* ZC和区段相互赋值 */
// ZC // ZC
if (graphData.getZcList().size() == 1) { // if (graphData.getZcList().size() == 1) { 上饶沙盘因需要车辆段无ZC故只剩下一个ZC故需要去掉此逻辑
MapZcVO mapZcVO = graphData.getZcList().get(0); // MapZcVO mapZcVO = graphData.getZcList().get(0);
ZC zc = (ZC) elementMap.get(mapZcVO.getCode()); // ZC zc = (ZC) elementMap.get(mapZcVO.getCode());
physicalSectionList.forEach(section -> { // physicalSectionList.forEach(section -> {
zc.addSection(section); // zc.addSection(section);
section.addZc(zc); // section.addZc(zc);
}); // });
} else { // } else {
graphData.getZcList().forEach(mapZcVO -> { graphData.getZcList().forEach(mapZcVO -> {
if (mapZcVO.isNoService()) if (mapZcVO.isNoService())
return; return;
@ -346,7 +346,7 @@ public class MapDeviceBuilder {
} }
} }
}); });
} // }
// 站台 // 站台
List<MapStationStandNewVO> standList = buildStand(graphData, elementMap, errMsgList); List<MapStationStandNewVO> standList = buildStand(graphData, elementMap, errMsgList);
// 站台轨关系数据校验 // 站台轨关系数据校验
@ -537,10 +537,10 @@ public class MapDeviceBuilder {
.collect(Collectors.toList()); .collect(Collectors.toList());
stations.forEach(station -> { stations.forEach(station -> {
if (station.isDepot()) { // 是车辆段/停车场 if (station.isDepot()) { // 是车辆段/停车场
if (CollectionUtils.isEmpty(station.getTransferList())) { // if (CollectionUtils.isEmpty(station.getTransferList())) {
errMsgList.add(String.format("车站[%s(%s)]是停车场/车辆段,却没有找到任何转换轨", // errMsgList.add(String.format("车站[%s(%s)]是停车场/车辆段,却没有找到任何转换轨",
station.getName(), station.getCode())); // station.getName(), station.getCode()));
} // }
} else if (station.isTurnBack()) {//是折返站 } else if (station.isTurnBack()) {//是折返站
if (CollectionUtils.isEmpty(station.getTurnBackList())) { if (CollectionUtils.isEmpty(station.getTurnBackList())) {
errMsgList.add(String.format("车站[%s(%s)]是折返站,却没有任何折返区段关联", errMsgList.add(String.format("车站[%s(%s)]是折返站,却没有任何折返区段关联",
@ -945,9 +945,9 @@ public class MapDeviceBuilder {
if (section.isStandTrack() && !section.isNormalStandTrack()) { if (section.isStandTrack() && !section.isNormalStandTrack()) {
errMsgList.add(String.format("区段[%s]不是正常站台的站台轨,却设置了站台轨属性", section.debugStr())); errMsgList.add(String.format("区段[%s]不是正常站台的站台轨,却设置了站台轨属性", section.debugStr()));
} }
if (section.isTransferTrack() && (section.getStation() == null || !section.getStation().isDepot())) { // if (section.isTransferTrack() && (section.getStation() == null || !section.getStation().isDepot())) {
errMsgList.add(String.format("区段[%s]所属车站不是车辆段/停车场车站,却设置了转换轨属性", section.debugStr())); // errMsgList.add(String.format("区段[%s]所属车站不是车辆段/停车场车站,却设置了转换轨属性", section.debugStr()));
} // }
} }
} }

View File

@ -30,7 +30,7 @@ public class MapStationRunLevelVO {
private Long id; private Long id;
@NotNull(message = "地图id不能为空", groups = {RunLevelGenerateCheck.class, RunLevelCreateCheck.class}) // @NotNull(message = "地图id不能为空", groups = {RunLevelGenerateCheck.class, RunLevelCreateCheck.class})
private Long mapId; private Long mapId;
/** /**
* 起始车站code * 起始车站code