diff --git a/src/main/java/club/joylink/rtss/constants/BusinessConsts.java b/src/main/java/club/joylink/rtss/constants/BusinessConsts.java index a9f35166b..594581f55 100644 --- a/src/main/java/club/joylink/rtss/constants/BusinessConsts.java +++ b/src/main/java/club/joylink/rtss/constants/BusinessConsts.java @@ -1,8 +1,5 @@ package club.joylink.rtss.constants; -import club.joylink.rtss.simulation.cbtc.data.map.Switch; -import lombok.Getter; - public interface BusinessConsts { String Default_NationCode = "86"; diff --git a/src/main/java/club/joylink/rtss/controller/OperateController.java b/src/main/java/club/joylink/rtss/controller/OperateController.java index 363e0393a..e59d4001f 100644 --- a/src/main/java/club/joylink/rtss/controller/OperateController.java +++ b/src/main/java/club/joylink/rtss/controller/OperateController.java @@ -1,7 +1,13 @@ package club.joylink.rtss.controller; import club.joylink.rtss.services.IOperateService; -import club.joylink.rtss.vo.client.*; +import club.joylink.rtss.vo.client.PageQueryVO; +import club.joylink.rtss.vo.client.PageVO; +import club.joylink.rtss.vo.client.TreeNode; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionQueryVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO; +import club.joylink.rtss.vo.client.training.definition.OperateStepVO; import club.joylink.rtss.vo.client.validGroup.OperateBatchCreateCheck; import club.joylink.rtss.vo.client.validGroup.OperateSignleCreateCheck; import club.joylink.rtss.vo.client.validGroup.ValidList; diff --git a/src/main/java/club/joylink/rtss/services/IOperateService.java b/src/main/java/club/joylink/rtss/services/IOperateService.java index dbeed5c10..dbc4c7571 100644 --- a/src/main/java/club/joylink/rtss/services/IOperateService.java +++ b/src/main/java/club/joylink/rtss/services/IOperateService.java @@ -1,6 +1,10 @@ package club.joylink.rtss.services; import club.joylink.rtss.vo.client.*; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionQueryVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO; +import club.joylink.rtss.vo.client.training.definition.OperateStepVO; import java.util.List; diff --git a/src/main/java/club/joylink/rtss/services/OperateService.java b/src/main/java/club/joylink/rtss/services/OperateService.java index 65c3dd3c7..b34ddc7e0 100644 --- a/src/main/java/club/joylink/rtss/services/OperateService.java +++ b/src/main/java/club/joylink/rtss/services/OperateService.java @@ -5,6 +5,10 @@ import club.joylink.rtss.dao.OperatePlaceholderDAO; import club.joylink.rtss.dao.OperateStepDAO; import club.joylink.rtss.entity.*; import club.joylink.rtss.vo.client.*; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionQueryVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO; +import club.joylink.rtss.vo.client.training.definition.OperateStepVO; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; @@ -50,7 +54,7 @@ public class OperateService implements IOperateService { if(StringUtils.hasText(queryVO.getTrainingName())) { criteria.andTrainingNameLike(String.format("%%%s%%", queryVO.getTrainingName())); } - Page page = (Page)this.operateDefinitionDAO.selectByExample(definitionExample); + Page page = (Page)this.operateDefinitionDAO.selectByExampleWithBLOBs(definitionExample); return PageVO.convert(page, OperateDefinitionVO.convert2VOList(page.getResult())); } @@ -133,7 +137,7 @@ public class OperateService implements IOperateService { OperateDefinitionExample definitionExample = new OperateDefinitionExample(); definitionExample.createCriteria().andMapIdEqualTo(mapId) .andProductTypesLike(String.format("%%%s%%", productType)); - List definitionList = this.operateDefinitionDAO.selectByExample(definitionExample); + List definitionList = this.operateDefinitionDAO.selectByExampleWithBLOBs(definitionExample); Map> trainingTypeMap = definitionList.stream().collect(Collectors.groupingBy(OperateDefinition::getTrainingType)); trainingTypeMap.forEach((trainingType, list) -> { TreeNode trainingTypeNode = TreeNode.buildTrainingTypeNode(trainingType, ""); @@ -171,7 +175,7 @@ public class OperateService implements IOperateService { public void saveAs(Long mapId, Long other) { OperateDefinitionExample example = new OperateDefinitionExample(); example.createCriteria().andMapIdEqualTo(mapId); - List definitionList = this.operateDefinitionDAO.selectByExample(example); + List definitionList = this.operateDefinitionDAO.selectByExampleWithBLOBs(example); if(!CollectionUtils.isEmpty(definitionList)) { // 删除旧的操作定义 this.deleteOperateDefinitionOfSkin(other); diff --git a/src/main/java/club/joylink/rtss/services/training/GenerateTask.java b/src/main/java/club/joylink/rtss/services/training/GenerateTask.java index e94ccc06a..6bcd89ac7 100644 --- a/src/main/java/club/joylink/rtss/services/training/GenerateTask.java +++ b/src/main/java/club/joylink/rtss/services/training/GenerateTask.java @@ -12,7 +12,7 @@ import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder; import club.joylink.rtss.vo.client.CommandDefinitionVO; import club.joylink.rtss.vo.client.LessonChapterTrainingRelVO; import club.joylink.rtss.vo.client.LessonVO; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.map.MapVO; import club.joylink.rtss.vo.client.runplan.RunPlanVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; diff --git a/src/main/java/club/joylink/rtss/services/training/constant/TrainingConsts.java b/src/main/java/club/joylink/rtss/services/training/constant/TrainingConsts.java index 9111c33fe..bdc610b24 100644 --- a/src/main/java/club/joylink/rtss/services/training/constant/TrainingConsts.java +++ b/src/main/java/club/joylink/rtss/services/training/constant/TrainingConsts.java @@ -44,7 +44,9 @@ public interface TrainingConsts { /** 终端信号机 */ END_SIGNAL, /** 终端按钮信号机 */ - END_BUTTON_SIGNAL + END_BUTTON_SIGNAL, + /** 终端按钮信号机 */ + BUTTON; } } diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/GeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/GeneratorNew.java index 595cfec8f..6ed81524f 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/GeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/GeneratorNew.java @@ -7,9 +7,9 @@ import club.joylink.rtss.simulation.cbtc.data.map.*; import club.joylink.rtss.simulation.cbtc.data.storage.StorageSimulation; import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.util.ReflectionUtils; -import club.joylink.rtss.vo.client.OperateDefinitionVO; -import club.joylink.rtss.vo.client.OperatePlaceholderVO; -import club.joylink.rtss.vo.client.OperateStepVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO; +import club.joylink.rtss.vo.client.training.definition.OperateStepVO; import club.joylink.rtss.vo.client.map.MapVO; import club.joylink.rtss.vo.client.map.newmap.MapAutomaticRouteButtonVO; import club.joylink.rtss.vo.client.map.newmap.MapCycleButtonVO; @@ -84,6 +84,16 @@ public interface GeneratorNew { case END_BUTTON_SIGNAL: s.setDeviceCode(((Route) mapDevice).getDestinationButtonSignal().getCode()); break; + case BUTTON: + if (Objects.nonNull(mapButton)) { + if (mapButton instanceof MapCycleButtonVO) { + s.setDeviceCode(((MapCycleButtonVO) mapButton).getCode()); + break; + } else if (mapButton instanceof MapAutomaticRouteButtonVO) { + s.setDeviceCode(((MapAutomaticRouteButtonVO) mapButton).getCode()); + break; + } + } default: s.setDeviceCode(mapDevice.getCode()); } @@ -102,22 +112,22 @@ public interface GeneratorNew { trainingVO.setLocateDeviceCode(((Route) mapDevice).getStart().getCode()); // } else { - if(Objects.isNull(mapButton)){ + if (Objects.isNull(mapButton)) { trainingVO.setLocateDeviceCode(mapDevice.getCode()); - }else{ - if(mapButton instanceof MapCycleButtonVO){ - trainingVO.setLocateDeviceCode(((MapCycleButtonVO)mapButton).getCode()); - }else if(mapButton instanceof MapAutomaticRouteButtonVO){ - trainingVO.setLocateDeviceCode(((MapAutomaticRouteButtonVO)mapButton).getCode()); + } else { + if (mapButton instanceof MapCycleButtonVO) { + trainingVO.setLocateDeviceCode(((MapCycleButtonVO) mapButton).getCode()); + } else if (mapButton instanceof MapAutomaticRouteButtonVO) { + trainingVO.setLocateDeviceCode(((MapAutomaticRouteButtonVO) mapButton).getCode()); } } } // 替换占位符 if (containPlaceholder(trainingVO.getName())) { - trainingVO.setName(replacePlaceholder(trainingVO.getName(), placeholderVOMap, mapDevice, mapButton,simulation.getBuildParams().getMap())); + trainingVO.setName(replacePlaceholder(trainingVO.getName(), placeholderVOMap, mapDevice, mapButton, simulation.getBuildParams().getMap())); } if (containPlaceholder(trainingVO.getRemarks())) { - trainingVO.setRemarks(replacePlaceholder(trainingVO.getRemarks(), placeholderVOMap, mapDevice,mapButton, simulation.getBuildParams().getMap())); + trainingVO.setRemarks(replacePlaceholder(trainingVO.getRemarks(), placeholderVOMap, mapDevice, mapButton, simulation.getBuildParams().getMap())); } // 添加步骤 List steps = new ArrayList<>(stepList.size()); @@ -136,13 +146,13 @@ public interface GeneratorNew { operSignal = ((Route) mapDevice).getStart(); } } - stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, Objects.isNull(operSignal) ? mapDevice : operSignal,null, simulation.getBuildParams().getMap())); + stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, Objects.isNull(operSignal) ? mapDevice : operSignal, mapButton, simulation.getBuildParams().getMap())); } else { - stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, mapButton,simulation.getBuildParams().getMap())); + stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, mapButton, simulation.getBuildParams().getMap())); } } if (containPlaceholder(stepVO.getVal())) { - stepVO.setVal(replacePlaceholder(stepVO.getVal(), placeholderVOMap,mapDevice,null, simulation.getBuildParams().getMap())); + stepVO.setVal(replacePlaceholder(stepVO.getVal(), placeholderVOMap, mapDevice, null, simulation.getBuildParams().getMap())); } steps.add(stepVO); }); @@ -173,7 +183,7 @@ public interface GeneratorNew { * @param mapDevice * @return */ - private String replacePlaceholder(String str, Map placeholderVOMap, MapElement mapDevice,Object mapButton, MapVO map) { + private String replacePlaceholder(String str, Map placeholderVOMap, MapElement mapDevice, Object mapButton, MapVO map) { Pattern pattern = Pattern.compile(".*?(\\{(\\d+)}).*?"); Matcher matcher = pattern.matcher(str); while (matcher.find()) { @@ -181,7 +191,7 @@ public interface GeneratorNew { OperatePlaceholderVO operatePlaceholderVO = placeholderVOMap.get(group); switch (operatePlaceholderVO.getType()) { case PlaceholderType.Type01: - String replace = ReflectionUtils.invokeGetter(Objects.isNull(mapButton)?mapDevice:mapButton, operatePlaceholderVO.getValNew()).toString(); + String replace = ReflectionUtils.invokeGetter(Objects.isNull(mapButton) ? mapDevice : mapButton, operatePlaceholderVO.getValNew()).toString(); str = str.replace(matcher.group(1), replace); break; case PlaceholderType.Type02: { @@ -248,8 +258,8 @@ public interface GeneratorNew { String name = ReflectionUtils.invokeGetter(mapDevice, split[0]).toString(); boolean flag = (boolean) ReflectionUtils.invokeMethodByName(mapDevice, split[1], null); str = str.replace(matcher.group(1), name); - if(flag){ - str +=split[2]; + if (flag) { + str += split[2]; } break; } diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/ControlGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/ControlGeneratorNew.java index 21b76e12e..d00028eb5 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/ControlGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/ControlGeneratorNew.java @@ -6,7 +6,7 @@ import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSele import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.Station; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import java.util.ArrayList; diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index 6cd0f399f..6e6bc33a5 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -1,14 +1,16 @@ package club.joylink.rtss.services.training.generatornew.base; +import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.services.training.data.GenerateConfig; import club.joylink.rtss.services.training.generatornew.GeneratorNew; import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.Section; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.ArrayList; import java.util.List; @@ -24,9 +26,33 @@ public class SectionGeneratorNew implements GeneratorNew { List trainingVOList = new ArrayList<>(); List
sectionList = simulation.getRepository().getSectionList(); for (Section section : sectionList) { - if (section.isSwitchTrack() || section.isSwitchAxleCounterSection() || section.isLogicSection()) { // 道岔区段不生成 + + if(StringUtils.isEmpty(section.getName())){ continue; } + if (CollectionUtils.isEmpty(operateDefinitionVO.getSectionTypes())) { + if (section.isSwitchTrack() || section.isSwitchAxleCounterSection() || section.isLogicSection()) { // 道岔区段不生成 + continue; + } + }else{ + List sectionTypes = operateDefinitionVO.getSectionTypes(); + if (section.isLogicSection() && !sectionTypes.contains(BusinessConsts.Section.SectionType.Type02)) { + continue; + } + if (section.isAxleCounterSection() && !sectionTypes.contains(BusinessConsts.Section.SectionType.Type01)) { + continue; + } + if (section.isSwitchTrack() && !sectionTypes.contains(BusinessConsts.Section.SectionType.Type03)) { + continue; + } + if (section.isSwitchAxleCounterSection() && !sectionTypes.contains(BusinessConsts.Section.SectionType.Type04)) { + continue; + } + if (section.isCross() && !sectionTypes.contains(BusinessConsts.Section.SectionType.Type05)) { + continue; + } + } + switch (Operation.Type.valueOf(operateDefinitionVO.getOperateType())) { case Section_Cut_Off: case Section_Block: diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java index f3b953fe3..90cbac67e 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java @@ -9,7 +9,7 @@ import club.joylink.rtss.simulation.cbtc.data.map.Cycle; import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SpeedLimitGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SpeedLimitGeneratorNew.java index 573b6fafa..e2e15ff99 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SpeedLimitGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SpeedLimitGeneratorNew.java @@ -5,7 +5,7 @@ import club.joylink.rtss.services.training.generatornew.GeneratorNew; import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.Simulation; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import java.util.ArrayList; diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StandGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StandGeneratorNew.java index 0a7519104..065de0c25 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StandGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StandGeneratorNew.java @@ -7,7 +7,7 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.constants.MapPrdTypeEnum; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import java.util.ArrayList; diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java index 4c51212e6..14be7ea5f 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java @@ -7,7 +7,7 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Station; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import java.util.ArrayList; diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java index d878d7524..9bd9d0ccd 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java @@ -8,7 +8,7 @@ import club.joylink.rtss.simulation.cbtc.ATS.service.AtsSectionService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.Switch; import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.TrainingNewVO; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/club/joylink/rtss/vo/client/training/TrainingNewVO.java b/src/main/java/club/joylink/rtss/vo/client/training/TrainingNewVO.java index d81a284a8..e3d271325 100644 --- a/src/main/java/club/joylink/rtss/vo/client/training/TrainingNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/TrainingNewVO.java @@ -5,7 +5,7 @@ import club.joylink.rtss.entity.TrainingWithBLOBs; import club.joylink.rtss.services.training.data.GenerateConfig; import club.joylink.rtss.simulation.cbtc.data.storage.StorageSimulation; import club.joylink.rtss.vo.UserVO; -import club.joylink.rtss.vo.client.OperateDefinitionVO; +import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO; import club.joylink.rtss.vo.client.validGroup.DraftTrainingCreateCheck; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.JsonSerialize; diff --git a/src/main/java/club/joylink/rtss/vo/client/training/TrainingStepVO.java b/src/main/java/club/joylink/rtss/vo/client/training/TrainingStepVO.java index 1bc7dc72a..ae5286c82 100644 --- a/src/main/java/club/joylink/rtss/vo/client/training/TrainingStepVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/TrainingStepVO.java @@ -1,6 +1,6 @@ package club.joylink.rtss.vo.client.training; -import club.joylink.rtss.vo.client.OperateStepVO; +import club.joylink.rtss.vo.client.training.definition.OperateStepVO; import club.joylink.rtss.vo.client.validGroup.DraftTrainingStepCheck; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/club/joylink/rtss/vo/client/generate/RouteSettingConfig.java b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionConfig.java similarity index 81% rename from src/main/java/club/joylink/rtss/vo/client/generate/RouteSettingConfig.java rename to src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionConfig.java index 79921fcba..ad3aa14ea 100644 --- a/src/main/java/club/joylink/rtss/vo/client/generate/RouteSettingConfig.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionConfig.java @@ -1,23 +1,26 @@ -package club.joylink.rtss.vo.client.generate; +package club.joylink.rtss.vo.client.training.definition; import lombok.Getter; import lombok.Setter; +import java.util.List; import java.util.Objects; @Getter @Setter -public class RouteSettingConfig { +public class OperateDefinitionConfig { private RouteType routeType; private Boolean onlySignalOP;//成都三现地 自动控人工控只一个始端信号机,实训生成名字走信号机策略 - //自动进路按钮 MapAutomaticRouteButtonVO Route MapRouteNewVO + //自动进路按钮 private Boolean autoRouteBT; - //自动折返按钮 MapCycleButtonVO Cycle MapAutoReentryVO + //自动折返按钮 private Boolean autoCycleBT; //引导总锁 + private List sectionTypes;//区段生成指定类型 + public boolean isAtp() { return RouteType.ATP.equals(this.routeType); } diff --git a/src/main/java/club/joylink/rtss/vo/client/OperateDefinitionQueryVO.java b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionQueryVO.java similarity index 84% rename from src/main/java/club/joylink/rtss/vo/client/OperateDefinitionQueryVO.java rename to src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionQueryVO.java index 917f006c7..d6c231a19 100644 --- a/src/main/java/club/joylink/rtss/vo/client/OperateDefinitionQueryVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionQueryVO.java @@ -1,5 +1,6 @@ -package club.joylink.rtss.vo.client; +package club.joylink.rtss.vo.client.training.definition; +import club.joylink.rtss.vo.client.PageQueryVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; diff --git a/src/main/java/club/joylink/rtss/vo/client/OperateDefinitionVO.java b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionVO.java similarity index 83% rename from src/main/java/club/joylink/rtss/vo/client/OperateDefinitionVO.java rename to src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionVO.java index 419a1c79b..26ca37364 100644 --- a/src/main/java/club/joylink/rtss/vo/client/OperateDefinitionVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateDefinitionVO.java @@ -1,12 +1,12 @@ -package club.joylink.rtss.vo.client; +package club.joylink.rtss.vo.client.training.definition; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import club.joylink.rtss.entity.OperateDefinition; import club.joylink.rtss.util.JsonUtils; -import club.joylink.rtss.vo.client.generate.RouteSettingConfig; import club.joylink.rtss.vo.client.validGroup.OperateBatchCreateCheck; import club.joylink.rtss.vo.client.validGroup.OperateSignleCreateCheck; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; @@ -89,8 +89,9 @@ public class OperateDefinitionVO { private List stepVOList; @ApiModelProperty(value = "操作配置") - private Map config; + private Map config; + @JsonIgnore private String configJson; private Map placeholderVOMap; @@ -106,6 +107,9 @@ public class OperateDefinitionVO { this.maxDuration = definition.getMaxDuration(); this.productTypes = Arrays.asList(definition.getProductTypes().split(",")); this.configJson = definition.getConfig(); + if(StringUtils.hasText(definition.getConfig())){ + this.config = JsonUtils.read(definition.getConfig(),HashMap.class); + } } public OperateDefinition convert2DB() { @@ -130,15 +134,15 @@ public class OperateDefinitionVO { return definitionVOList; } - public RouteSettingConfig getRouteSettingConfig() { + public OperateDefinitionConfig getRouteSettingConfig() { if (StringUtils.hasText(this.configJson)) { - return JsonUtils.read(this.configJson, RouteSettingConfig.class); + return JsonUtils.read(this.configJson, OperateDefinitionConfig.class); } return null; } public boolean isAtp() { - RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); + OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig(); if (Objects.nonNull(routeSettingConfig)) { return routeSettingConfig.isAtp(); } @@ -146,7 +150,7 @@ public class OperateDefinitionVO { } public boolean isGround() { - RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); + OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig(); if (Objects.nonNull(routeSettingConfig)) { return routeSettingConfig.isGround(); } @@ -154,7 +158,7 @@ public class OperateDefinitionVO { } public boolean onlyOperateSignal() { - RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); + OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig(); if (Objects.nonNull(routeSettingConfig)) { return routeSettingConfig.onlyOperateSignal(); } @@ -162,7 +166,7 @@ public class OperateDefinitionVO { } public boolean autoRouteButton() { - RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); + OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig(); if (Objects.nonNull(routeSettingConfig)) { return routeSettingConfig.autoRouteButton(); } @@ -170,10 +174,18 @@ public class OperateDefinitionVO { } public boolean autoCycleButton() { - RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); + OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig(); if (Objects.nonNull(routeSettingConfig)) { return routeSettingConfig.autoCycleButton(); } return false; } + + public List getSectionTypes() { + OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig(); + if (Objects.nonNull(routeSettingConfig)) { + return routeSettingConfig.getSectionTypes(); + } + return null; + } } diff --git a/src/main/java/club/joylink/rtss/vo/client/OperatePlaceholderVO.java b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperatePlaceholderVO.java similarity index 97% rename from src/main/java/club/joylink/rtss/vo/client/OperatePlaceholderVO.java rename to src/main/java/club/joylink/rtss/vo/client/training/definition/OperatePlaceholderVO.java index f690d1a03..784aa2be5 100644 --- a/src/main/java/club/joylink/rtss/vo/client/OperatePlaceholderVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperatePlaceholderVO.java @@ -1,4 +1,4 @@ -package club.joylink.rtss.vo.client; +package club.joylink.rtss.vo.client.training.definition; import club.joylink.rtss.entity.OperatePlaceholder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; diff --git a/src/main/java/club/joylink/rtss/vo/client/OperateStepVO.java b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateStepVO.java similarity index 98% rename from src/main/java/club/joylink/rtss/vo/client/OperateStepVO.java rename to src/main/java/club/joylink/rtss/vo/client/training/definition/OperateStepVO.java index 957b39c7f..8ea4a1e2c 100644 --- a/src/main/java/club/joylink/rtss/vo/client/OperateStepVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/training/definition/OperateStepVO.java @@ -1,4 +1,4 @@ -package club.joylink.rtss.vo.client; +package club.joylink.rtss.vo.client.training.definition; import club.joylink.rtss.entity.OperateStep; import club.joylink.rtss.vo.client.validGroup.OperateBatchCreateCheck;