信号机添加<所属车站>绘图属性;交出控制权添加<控制权所属校验>

This commit is contained in:
joylink_zhangsai 2021-01-18 16:22:19 +08:00
parent 35409a3901
commit ad529992af
3 changed files with 11 additions and 1 deletions

View File

@ -77,7 +77,8 @@ public class AtsRouteService {
String.format("信号机[%s(%s)]没有已锁闭进路,不能设置联锁自动进路", signal.getName(), signal.getCode())); String.format("信号机[%s(%s)]没有已锁闭进路,不能设置联锁自动进路", signal.getName(), signal.getCode()));
} }
if (!lockedRoute.isFlt()) { if (!lockedRoute.isFlt()) {
throw new SimulationException(SimulationExceptionType.Unsupported_Operation); throw new SimulationException(SimulationExceptionType.Unsupported_Operation,
String.format("进路[%s]不能设置车队进路", lockedRoute.getCode()));
} }
if (lockedRoute.isCiControl()) { if (lockedRoute.isCiControl()) {
throw new SimulationException(SimulationExceptionType.Operation_Conflict, throw new SimulationException(SimulationExceptionType.Operation_Conflict,

View File

@ -1,5 +1,6 @@
package club.joylink.rtss.simulation.cbtc.ATS.service; package club.joylink.rtss.simulation.cbtc.ATS.service;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.ATS.ATSMessageCollectAndDispatcher; import club.joylink.rtss.simulation.cbtc.ATS.ATSMessageCollectAndDispatcher;
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.Simulation;
@ -285,6 +286,11 @@ public class AtsStationService {
} else { } else {
deviceStation = station.getDeviceStation(); deviceStation = station.getDeviceStation();
} }
//确认控制权现在属于该成员
BusinessExceptionAssertEnum.INVALID_OPERATION.assertTrue((member.isDispatcher() && station.isCenterControl())
|| (member.isStationSupervisor() && station.isStandControl()),
String.format("车站[%s]所属设备集中站[%s]当前控制权不在成员[%s]手中", station.getCode(), deviceStation.getCode(), member.getId()));
SimulationDataRepository repository = simulation.getRepository(); SimulationDataRepository repository = simulation.getRepository();
Set<Station> stations = repository.getStationsByDeviceStations(deviceStation); Set<Station> stations = repository.getStationsByDeviceStations(deviceStation);
stations.forEach(Station::surrenderControl); stations.forEach(Station::surrenderControl);

View File

@ -52,6 +52,9 @@ public class MapSignalNewVO {
@NotBlank(message = "所属区段编码不能为空") @NotBlank(message = "所属区段编码不能为空")
private String sectionCode; private String sectionCode;
@ApiModelProperty(value = "所属车站编码")
private String belongStationCode;
/** /**
* 所属车站 编号 * 所属车站 编号
*/ */