Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
walker-sheng 2021-01-29 16:44:51 +08:00
commit 637908fd94
21 changed files with 121 additions and 56 deletions

View File

@ -1,8 +1,5 @@
package club.joylink.rtss.constants; package club.joylink.rtss.constants;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import lombok.Getter;
public interface BusinessConsts { public interface BusinessConsts {
String Default_NationCode = "86"; String Default_NationCode = "86";

View File

@ -1,7 +1,13 @@
package club.joylink.rtss.controller; package club.joylink.rtss.controller;
import club.joylink.rtss.services.IOperateService; 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.OperateBatchCreateCheck;
import club.joylink.rtss.vo.client.validGroup.OperateSignleCreateCheck; import club.joylink.rtss.vo.client.validGroup.OperateSignleCreateCheck;
import club.joylink.rtss.vo.client.validGroup.ValidList; import club.joylink.rtss.vo.client.validGroup.ValidList;

View File

@ -1,6 +1,10 @@
package club.joylink.rtss.services; package club.joylink.rtss.services;
import club.joylink.rtss.vo.client.*; 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; import java.util.List;

View File

@ -5,6 +5,10 @@ import club.joylink.rtss.dao.OperatePlaceholderDAO;
import club.joylink.rtss.dao.OperateStepDAO; import club.joylink.rtss.dao.OperateStepDAO;
import club.joylink.rtss.entity.*; import club.joylink.rtss.entity.*;
import club.joylink.rtss.vo.client.*; 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.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -50,7 +54,7 @@ public class OperateService implements IOperateService {
if(StringUtils.hasText(queryVO.getTrainingName())) { if(StringUtils.hasText(queryVO.getTrainingName())) {
criteria.andTrainingNameLike(String.format("%%%s%%", queryVO.getTrainingName())); criteria.andTrainingNameLike(String.format("%%%s%%", queryVO.getTrainingName()));
} }
Page<OperateDefinition> page = (Page<OperateDefinition>)this.operateDefinitionDAO.selectByExample(definitionExample); Page<OperateDefinition> page = (Page<OperateDefinition>)this.operateDefinitionDAO.selectByExampleWithBLOBs(definitionExample);
return PageVO.convert(page, OperateDefinitionVO.convert2VOList(page.getResult())); return PageVO.convert(page, OperateDefinitionVO.convert2VOList(page.getResult()));
} }
@ -133,7 +137,7 @@ public class OperateService implements IOperateService {
OperateDefinitionExample definitionExample = new OperateDefinitionExample(); OperateDefinitionExample definitionExample = new OperateDefinitionExample();
definitionExample.createCriteria().andMapIdEqualTo(mapId) definitionExample.createCriteria().andMapIdEqualTo(mapId)
.andProductTypesLike(String.format("%%%s%%", productType)); .andProductTypesLike(String.format("%%%s%%", productType));
List<OperateDefinition> definitionList = this.operateDefinitionDAO.selectByExample(definitionExample); List<OperateDefinition> definitionList = this.operateDefinitionDAO.selectByExampleWithBLOBs(definitionExample);
Map<String, List<OperateDefinition>> trainingTypeMap = definitionList.stream().collect(Collectors.groupingBy(OperateDefinition::getTrainingType)); Map<String, List<OperateDefinition>> trainingTypeMap = definitionList.stream().collect(Collectors.groupingBy(OperateDefinition::getTrainingType));
trainingTypeMap.forEach((trainingType, list) -> { trainingTypeMap.forEach((trainingType, list) -> {
TreeNode trainingTypeNode = TreeNode.buildTrainingTypeNode(trainingType, ""); TreeNode trainingTypeNode = TreeNode.buildTrainingTypeNode(trainingType, "");
@ -171,7 +175,7 @@ public class OperateService implements IOperateService {
public void saveAs(Long mapId, Long other) { public void saveAs(Long mapId, Long other) {
OperateDefinitionExample example = new OperateDefinitionExample(); OperateDefinitionExample example = new OperateDefinitionExample();
example.createCriteria().andMapIdEqualTo(mapId); example.createCriteria().andMapIdEqualTo(mapId);
List<OperateDefinition> definitionList = this.operateDefinitionDAO.selectByExample(example); List<OperateDefinition> definitionList = this.operateDefinitionDAO.selectByExampleWithBLOBs(example);
if(!CollectionUtils.isEmpty(definitionList)) { if(!CollectionUtils.isEmpty(definitionList)) {
// 删除旧的操作定义 // 删除旧的操作定义
this.deleteOperateDefinitionOfSkin(other); this.deleteOperateDefinitionOfSkin(other);

View File

@ -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.CommandDefinitionVO;
import club.joylink.rtss.vo.client.LessonChapterTrainingRelVO; import club.joylink.rtss.vo.client.LessonChapterTrainingRelVO;
import club.joylink.rtss.vo.client.LessonVO; 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.map.MapVO;
import club.joylink.rtss.vo.client.runplan.RunPlanVO; import club.joylink.rtss.vo.client.runplan.RunPlanVO;
import club.joylink.rtss.vo.client.training.TrainingNewVO; import club.joylink.rtss.vo.client.training.TrainingNewVO;

View File

@ -44,7 +44,9 @@ public interface TrainingConsts {
/** 终端信号机 */ /** 终端信号机 */
END_SIGNAL, END_SIGNAL,
/** 终端按钮信号机 */ /** 终端按钮信号机 */
END_BUTTON_SIGNAL END_BUTTON_SIGNAL,
/** 终端按钮信号机 */
BUTTON;
} }
} }

View File

@ -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.simulation.cbtc.data.storage.StorageSimulation;
import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.util.ReflectionUtils; import club.joylink.rtss.util.ReflectionUtils;
import club.joylink.rtss.vo.client.OperateDefinitionVO; import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
import club.joylink.rtss.vo.client.OperatePlaceholderVO; import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO;
import club.joylink.rtss.vo.client.OperateStepVO; import club.joylink.rtss.vo.client.training.definition.OperateStepVO;
import club.joylink.rtss.vo.client.map.MapVO; 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.MapAutomaticRouteButtonVO;
import club.joylink.rtss.vo.client.map.newmap.MapCycleButtonVO; import club.joylink.rtss.vo.client.map.newmap.MapCycleButtonVO;
@ -84,6 +84,16 @@ public interface GeneratorNew {
case END_BUTTON_SIGNAL: case END_BUTTON_SIGNAL:
s.setDeviceCode(((Route) mapDevice).getDestinationButtonSignal().getCode()); s.setDeviceCode(((Route) mapDevice).getDestinationButtonSignal().getCode());
break; 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: default:
s.setDeviceCode(mapDevice.getCode()); s.setDeviceCode(mapDevice.getCode());
} }
@ -102,22 +112,22 @@ public interface GeneratorNew {
trainingVO.setLocateDeviceCode(((Route) mapDevice).getStart().getCode()); trainingVO.setLocateDeviceCode(((Route) mapDevice).getStart().getCode());
// //
} else { } else {
if(Objects.isNull(mapButton)){ if (Objects.isNull(mapButton)) {
trainingVO.setLocateDeviceCode(mapDevice.getCode()); trainingVO.setLocateDeviceCode(mapDevice.getCode());
}else{ } else {
if(mapButton instanceof MapCycleButtonVO){ if (mapButton instanceof MapCycleButtonVO) {
trainingVO.setLocateDeviceCode(((MapCycleButtonVO)mapButton).getCode()); trainingVO.setLocateDeviceCode(((MapCycleButtonVO) mapButton).getCode());
}else if(mapButton instanceof MapAutomaticRouteButtonVO){ } else if (mapButton instanceof MapAutomaticRouteButtonVO) {
trainingVO.setLocateDeviceCode(((MapAutomaticRouteButtonVO)mapButton).getCode()); trainingVO.setLocateDeviceCode(((MapAutomaticRouteButtonVO) mapButton).getCode());
} }
} }
} }
// 替换占位符 // 替换占位符
if (containPlaceholder(trainingVO.getName())) { 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())) { 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<TrainingStepVO> steps = new ArrayList<>(stepList.size()); List<TrainingStepVO> steps = new ArrayList<>(stepList.size());
@ -136,13 +146,13 @@ public interface GeneratorNew {
operSignal = ((Route) mapDevice).getStart(); 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 { } 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())) { 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); steps.add(stepVO);
}); });
@ -173,7 +183,7 @@ public interface GeneratorNew {
* @param mapDevice * @param mapDevice
* @return * @return
*/ */
private String replacePlaceholder(String str, Map<String, OperatePlaceholderVO> placeholderVOMap, MapElement mapDevice,Object mapButton, MapVO map) { private String replacePlaceholder(String str, Map<String, OperatePlaceholderVO> placeholderVOMap, MapElement mapDevice, Object mapButton, MapVO map) {
Pattern pattern = Pattern.compile(".*?(\\{(\\d+)}).*?"); Pattern pattern = Pattern.compile(".*?(\\{(\\d+)}).*?");
Matcher matcher = pattern.matcher(str); Matcher matcher = pattern.matcher(str);
while (matcher.find()) { while (matcher.find()) {
@ -181,7 +191,7 @@ public interface GeneratorNew {
OperatePlaceholderVO operatePlaceholderVO = placeholderVOMap.get(group); OperatePlaceholderVO operatePlaceholderVO = placeholderVOMap.get(group);
switch (operatePlaceholderVO.getType()) { switch (operatePlaceholderVO.getType()) {
case PlaceholderType.Type01: 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); str = str.replace(matcher.group(1), replace);
break; break;
case PlaceholderType.Type02: { case PlaceholderType.Type02: {
@ -248,8 +258,8 @@ public interface GeneratorNew {
String name = ReflectionUtils.invokeGetter(mapDevice, split[0]).toString(); String name = ReflectionUtils.invokeGetter(mapDevice, split[0]).toString();
boolean flag = (boolean) ReflectionUtils.invokeMethodByName(mapDevice, split[1], null); boolean flag = (boolean) ReflectionUtils.invokeMethodByName(mapDevice, split[1], null);
str = str.replace(matcher.group(1), name); str = str.replace(matcher.group(1), name);
if(flag){ if (flag) {
str +=split[2]; str += split[2];
} }
break; break;
} }

View File

@ -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.ATS.operation.Operation;
import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Station; 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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,14 +1,16 @@
package club.joylink.rtss.services.training.generatornew.base; 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.data.GenerateConfig;
import club.joylink.rtss.services.training.generatornew.GeneratorNew; import club.joylink.rtss.services.training.generatornew.GeneratorNew;
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew; import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
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;
import club.joylink.rtss.simulation.cbtc.data.map.Section; 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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -24,9 +26,33 @@ public class SectionGeneratorNew implements GeneratorNew {
List<TrainingNewVO> trainingVOList = new ArrayList<>(); List<TrainingNewVO> trainingVOList = new ArrayList<>();
List<Section> sectionList = simulation.getRepository().getSectionList(); List<Section> sectionList = simulation.getRepository().getSectionList();
for (Section section : sectionList) { for (Section section : sectionList) {
if (section.isSwitchTrack() || section.isSwitchAxleCounterSection() || section.isLogicSection()) { // 道岔区段不生成
if(StringUtils.isEmpty(section.getName())){
continue; continue;
} }
if (CollectionUtils.isEmpty(operateDefinitionVO.getSectionTypes())) {
if (section.isSwitchTrack() || section.isSwitchAxleCounterSection() || section.isLogicSection()) { // 道岔区段不生成
continue;
}
}else{
List<String> 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())) { switch (Operation.Type.valueOf(operateDefinitionVO.getOperateType())) {
case Section_Cut_Off: case Section_Cut_Off:
case Section_Block: case Section_Block:

View File

@ -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.Route;
import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; 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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;

View File

@ -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.services.training.generatornew.annotation.GeneratorSelectorNew;
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;
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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -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.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.map.Stand;
import club.joylink.rtss.constants.MapPrdTypeEnum; 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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -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.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Route;
import club.joylink.rtss.simulation.cbtc.data.map.Station; 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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -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.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Switch; import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; 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 club.joylink.rtss.vo.client.training.TrainingNewVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -5,7 +5,7 @@ import club.joylink.rtss.entity.TrainingWithBLOBs;
import club.joylink.rtss.services.training.data.GenerateConfig; import club.joylink.rtss.services.training.data.GenerateConfig;
import club.joylink.rtss.simulation.cbtc.data.storage.StorageSimulation; import club.joylink.rtss.simulation.cbtc.data.storage.StorageSimulation;
import club.joylink.rtss.vo.UserVO; 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 club.joylink.rtss.vo.client.validGroup.DraftTrainingCreateCheck;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;

View File

@ -1,6 +1,6 @@
package club.joylink.rtss.vo.client.training; 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 club.joylink.rtss.vo.client.validGroup.DraftTrainingStepCheck;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@ -1,23 +1,26 @@
package club.joylink.rtss.vo.client.generate; package club.joylink.rtss.vo.client.training.definition;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@Getter @Getter
@Setter @Setter
public class RouteSettingConfig { public class OperateDefinitionConfig {
private RouteType routeType; private RouteType routeType;
private Boolean onlySignalOP;//成都三现地 自动控人工控只一个始端信号机,实训生成名字走信号机策略 private Boolean onlySignalOP;//成都三现地 自动控人工控只一个始端信号机,实训生成名字走信号机策略
//自动进路按钮 MapAutomaticRouteButtonVO Route MapRouteNewVO //自动进路按钮
private Boolean autoRouteBT; private Boolean autoRouteBT;
//自动折返按钮 MapCycleButtonVO Cycle MapAutoReentryVO //自动折返按钮
private Boolean autoCycleBT; private Boolean autoCycleBT;
//引导总锁 //引导总锁
private List<String> sectionTypes;//区段生成指定类型
public boolean isAtp() { public boolean isAtp() {
return RouteType.ATP.equals(this.routeType); return RouteType.ATP.equals(this.routeType);
} }

View File

@ -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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;

View File

@ -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.entity.OperateDefinition;
import club.joylink.rtss.util.JsonUtils; 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.OperateBatchCreateCheck;
import club.joylink.rtss.vo.client.validGroup.OperateSignleCreateCheck; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
@ -89,8 +89,9 @@ public class OperateDefinitionVO {
private List<OperateStepVO> stepVOList; private List<OperateStepVO> stepVOList;
@ApiModelProperty(value = "操作配置") @ApiModelProperty(value = "操作配置")
private Map<String, String> config; private Map<String, Object> config;
@JsonIgnore
private String configJson; private String configJson;
private Map<String, OperatePlaceholderVO> placeholderVOMap; private Map<String, OperatePlaceholderVO> placeholderVOMap;
@ -106,6 +107,9 @@ public class OperateDefinitionVO {
this.maxDuration = definition.getMaxDuration(); this.maxDuration = definition.getMaxDuration();
this.productTypes = Arrays.asList(definition.getProductTypes().split(",")); this.productTypes = Arrays.asList(definition.getProductTypes().split(","));
this.configJson = definition.getConfig(); this.configJson = definition.getConfig();
if(StringUtils.hasText(definition.getConfig())){
this.config = JsonUtils.read(definition.getConfig(),HashMap.class);
}
} }
public OperateDefinition convert2DB() { public OperateDefinition convert2DB() {
@ -130,15 +134,15 @@ public class OperateDefinitionVO {
return definitionVOList; return definitionVOList;
} }
public RouteSettingConfig getRouteSettingConfig() { public OperateDefinitionConfig getRouteSettingConfig() {
if (StringUtils.hasText(this.configJson)) { if (StringUtils.hasText(this.configJson)) {
return JsonUtils.read(this.configJson, RouteSettingConfig.class); return JsonUtils.read(this.configJson, OperateDefinitionConfig.class);
} }
return null; return null;
} }
public boolean isAtp() { public boolean isAtp() {
RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
if (Objects.nonNull(routeSettingConfig)) { if (Objects.nonNull(routeSettingConfig)) {
return routeSettingConfig.isAtp(); return routeSettingConfig.isAtp();
} }
@ -146,7 +150,7 @@ public class OperateDefinitionVO {
} }
public boolean isGround() { public boolean isGround() {
RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
if (Objects.nonNull(routeSettingConfig)) { if (Objects.nonNull(routeSettingConfig)) {
return routeSettingConfig.isGround(); return routeSettingConfig.isGround();
} }
@ -154,7 +158,7 @@ public class OperateDefinitionVO {
} }
public boolean onlyOperateSignal() { public boolean onlyOperateSignal() {
RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
if (Objects.nonNull(routeSettingConfig)) { if (Objects.nonNull(routeSettingConfig)) {
return routeSettingConfig.onlyOperateSignal(); return routeSettingConfig.onlyOperateSignal();
} }
@ -162,7 +166,7 @@ public class OperateDefinitionVO {
} }
public boolean autoRouteButton() { public boolean autoRouteButton() {
RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
if (Objects.nonNull(routeSettingConfig)) { if (Objects.nonNull(routeSettingConfig)) {
return routeSettingConfig.autoRouteButton(); return routeSettingConfig.autoRouteButton();
} }
@ -170,10 +174,18 @@ public class OperateDefinitionVO {
} }
public boolean autoCycleButton() { public boolean autoCycleButton() {
RouteSettingConfig routeSettingConfig = this.getRouteSettingConfig(); OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
if (Objects.nonNull(routeSettingConfig)) { if (Objects.nonNull(routeSettingConfig)) {
return routeSettingConfig.autoCycleButton(); return routeSettingConfig.autoCycleButton();
} }
return false; return false;
} }
public List<String> getSectionTypes() {
OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
if (Objects.nonNull(routeSettingConfig)) {
return routeSettingConfig.getSectionTypes();
}
return null;
}
} }

View File

@ -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 club.joylink.rtss.entity.OperatePlaceholder;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;

View File

@ -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.entity.OperateStep;
import club.joylink.rtss.vo.client.validGroup.OperateBatchCreateCheck; import club.joylink.rtss.vo.client.validGroup.OperateBatchCreateCheck;