This commit is contained in:
DU 2020-12-11 15:33:29 +08:00
commit f9fc629889
5 changed files with 22 additions and 2 deletions

View File

@ -136,7 +136,7 @@ public class LoadPlanService implements ILoadPlanService {
@Override
public PageVO<RunPlanLoadVO> queryPagedLoadPlan(RunPlanLoadQueryVO queryVO) {
RunPlanLoadExample runPlanLoadExample = new RunPlanLoadExample();
runPlanLoadExample.setOrderByClause(" load_time DESC");
runPlanLoadExample.setOrderByClause(" load_time DESC, id");
RunPlanLoadExample.Criteria loadExampleCriteria = runPlanLoadExample.createCriteria();
if (Objects.nonNull(queryVO.getUserId())) {
loadExampleCriteria.andUserIdEqualTo(queryVO.getUserId());

View File

@ -453,7 +453,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
clickEnd = this.queryNearlySignalOf(start, sectionPath);
}
// 构建进路
if (config.isRouteApartByOverlap() && overlapList.size() > 1) {
if (config.isRouteApartByOverlap() && overlapList != null && overlapList.size() > 1) {
int index = 1;
for (RouteOverlap routeOverlap : overlapList) {
String code = routeCodeGenerator.next();

View File

@ -20,6 +20,7 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Component
@ -35,6 +36,14 @@ public class AtsRouteSettingService {
//根据一定规则清除掉冲突进路
this.filterConflictTrainRouteByPlanTime(simulation, waitSetList);
//如果进路区段有占用时不排列进路筛选出没有区段占用的进路
if (simulation.getRepository().getConfig().isDoNotSetRouteWhenSectionOccupied()) {
waitSetList = waitSetList.stream().filter(trainRoute -> {
Route route = trainRoute.getRoute();
return route.getSectionList().stream().noneMatch(section -> section.isCtOccupied() || section.isNctOccupied());
}).collect(Collectors.toList());
}
// 执行进路排列
for (TrainRoute trainRoute : waitSetList) {
Route route = trainRoute.getRoute();

View File

@ -131,6 +131,11 @@ public class MapConfig {
*/
private float urmAtpSpeed;
/**
* 当进路的区段占用时不排列进路
*/
private boolean doNotSetRouteWhenSectionOccupied;
private Set<SimulationMember.Type> needConfirmConnectMembers =
Stream.of(DISPATCHER, STATION_SUPERVISOR, MAINTAINER, ELECTRIC_DISPATCHER).collect(Collectors.toSet());
@ -158,6 +163,7 @@ public class MapConfig {
setParkingSM(configVO.getParkingSM());
setRmAtpSpeed(configVO.getRmAtpSpeed() / 3.6f);
setUrmAtpSpeed(configVO.getUrmAtpSpeed() / 3.6f);
setDoNotSetRouteWhenSectionOccupied(configVO.isDoNotSetRouteWhenSectionOccupied());
}
}

View File

@ -70,6 +70,11 @@ public class RealLineConfigVO {
*/
private boolean initSingleLockSwitch = false;
/**
* 当进路的区段占用时不排列进路
*/
private boolean doNotSetRouteWhenSectionOccupied = false;
public static RealLineConfigVO parseJsonStr(String configData) {
if (StringUtils.hasText(configData)) {
return JsonUtils.read(configData, RealLineConfigVO.class);