岔心强解bug修改

This commit is contained in:
joylink_zhangsai 2021-01-22 18:26:26 +08:00
parent 808d7c3ee9
commit 4e85d158e4

View File

@ -209,6 +209,14 @@ public class CiApiServiceImpl implements CiApiService {
@Override @Override
public void sectionFaultUnlock(Simulation simulation, String sectionCode) { public void sectionFaultUnlock(Simulation simulation, String sectionCode) {
Section section = simulation.getRepository().getByCode(sectionCode, Section.class); Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
if (section.isCross()) {
Optional<Section> crossLockedSectionOptional = section.getLogicList().stream().filter(Section::isLocked).findAny();
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(crossLockedSectionOptional.isPresent(),
section.debugStr() + "未锁闭,无需解锁");
section = crossLockedSectionOptional.get();
}
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section.isLocked(),
section.debugStr() + "未锁闭,无需解锁");
List<Route> lockedRouteList = simulation.getRepository().queryAllLockedRoute(); List<Route> lockedRouteList = simulation.getRepository().queryAllLockedRoute();
Route lockedRoute = null; Route lockedRoute = null;
for (Route route : lockedRouteList) { for (Route route : lockedRouteList) {