Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
637908fd94
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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<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()));
|
||||
}
|
||||
|
||||
@ -133,7 +137,7 @@ public class OperateService implements IOperateService {
|
||||
OperateDefinitionExample definitionExample = new OperateDefinitionExample();
|
||||
definitionExample.createCriteria().andMapIdEqualTo(mapId)
|
||||
.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));
|
||||
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<OperateDefinition> definitionList = this.operateDefinitionDAO.selectByExample(example);
|
||||
List<OperateDefinition> definitionList = this.operateDefinitionDAO.selectByExampleWithBLOBs(example);
|
||||
if(!CollectionUtils.isEmpty(definitionList)) {
|
||||
// 删除旧的操作定义
|
||||
this.deleteOperateDefinitionOfSkin(other);
|
||||
|
@ -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;
|
||||
|
@ -44,7 +44,9 @@ public interface TrainingConsts {
|
||||
/** 终端信号机 */
|
||||
END_SIGNAL,
|
||||
/** 终端按钮信号机 */
|
||||
END_BUTTON_SIGNAL
|
||||
END_BUTTON_SIGNAL,
|
||||
/** 终端按钮信号机 */
|
||||
BUTTON;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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<TrainingStepVO> 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<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+)}).*?");
|
||||
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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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<TrainingNewVO> trainingVOList = new ArrayList<>();
|
||||
List<Section> 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<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())) {
|
||||
case Section_Cut_Off:
|
||||
case Section_Block:
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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<String> sectionTypes;//区段生成指定类型
|
||||
|
||||
public boolean isAtp() {
|
||||
return RouteType.ATP.equals(this.routeType);
|
||||
}
|
@ -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;
|
@ -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<OperateStepVO> stepVOList;
|
||||
|
||||
@ApiModelProperty(value = "操作配置")
|
||||
private Map<String, String> config;
|
||||
private Map<String, Object> config;
|
||||
|
||||
@JsonIgnore
|
||||
private String configJson;
|
||||
|
||||
private Map<String, OperatePlaceholderVO> 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<String> getSectionTypes() {
|
||||
OperateDefinitionConfig routeSettingConfig = this.getRouteSettingConfig();
|
||||
if (Objects.nonNull(routeSettingConfig)) {
|
||||
return routeSettingConfig.getSectionTypes();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -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;
|
@ -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;
|
Loading…
Reference in New Issue
Block a user