From 1753c0dd123c502b9bfb6ec34b454d99c3a5d075 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Wed, 30 Nov 2022 16:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=9E=E8=AE=AD=E8=A7=84=E5=88=99?= =?UTF-8?q?=E5=9C=B0=E5=9B=BEID=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=BB=BF?= =?UTF-8?q?=E7=9C=9F=E7=B1=BB=E5=9E=8B=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/training2/RtsTraining2Rule.java | 2 +- .../training2/RtsTraining2RuleExample.java | 48 +++++++++---------- .../training2/Training2RuleService.java | 2 +- .../vo/training2/rule/BgSceneStatusRule.java | 6 +-- .../rtss/vo/training2/rule/MapDeviceRule.java | 14 ++---- .../vo/training2/rule/PropertyValueRule.java | 33 +++++++++++-- .../rtss/vo/training2/rule/Training2Rule.java | 5 +- .../training2/RtsTraining2RuleMapper.xml | 32 ++++++------- .../services/training/Training2RuleTest.java | 6 +-- 9 files changed, 82 insertions(+), 66 deletions(-) diff --git a/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2Rule.java b/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2Rule.java index bc198a96d..754e457ff 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2Rule.java +++ b/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2Rule.java @@ -8,7 +8,7 @@ import java.util.Date; public class RtsTraining2Rule { private Long id; - private Long mapId; + private String simType; private String locationRule; diff --git a/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2RuleExample.java b/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2RuleExample.java index cee90d3fb..1823181f3 100644 --- a/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2RuleExample.java +++ b/src/main/java/club/joylink/rtss/entity/training2/RtsTraining2RuleExample.java @@ -165,63 +165,63 @@ public class RtsTraining2RuleExample { return (Criteria) this; } - public Criteria andMapIdIsNull() { - addCriterion("map_id is null"); + public Criteria andSimTypeIsNull() { + addCriterion("sim_type is null"); return (Criteria) this; } - public Criteria andMapIdIsNotNull() { - addCriterion("map_id is not null"); + public Criteria andSimTypeIsNotNull() { + addCriterion("sim_type is not null"); return (Criteria) this; } - public Criteria andMapIdEqualTo(Long value) { - addCriterion("map_id =", value, "mapId"); + public Criteria andSimTypeEqualTo(String value) { + addCriterion("sim_type =", value, "simType"); return (Criteria) this; } - public Criteria andMapIdNotEqualTo(Long value) { - addCriterion("map_id <>", value, "mapId"); + public Criteria andSimTypeNotEqualTo(String value) { + addCriterion("sim_type <>", value, "simType"); return (Criteria) this; } - public Criteria andMapIdGreaterThan(Long value) { - addCriterion("map_id >", value, "mapId"); + public Criteria andSimTypeGreaterThan(String value) { + addCriterion("sim_type >", value, "simType"); return (Criteria) this; } - public Criteria andMapIdGreaterThanOrEqualTo(Long value) { - addCriterion("map_id >=", value, "mapId"); + public Criteria andSimTypeGreaterThanOrEqualTo(String value) { + addCriterion("sim_type >=", value, "simType"); return (Criteria) this; } - public Criteria andMapIdLessThan(Long value) { - addCriterion("map_id <", value, "mapId"); + public Criteria andSimTypeLessThan(String value) { + addCriterion("sim_type <", value, "simType"); return (Criteria) this; } - public Criteria andMapIdLessThanOrEqualTo(Long value) { - addCriterion("map_id <=", value, "mapId"); + public Criteria andSimTypeLessThanOrEqualTo(String value) { + addCriterion("sim_type <=", value, "simType"); return (Criteria) this; } - public Criteria andMapIdIn(List values) { - addCriterion("map_id in", values, "mapId"); + public Criteria andSimTypeIn(List values) { + addCriterion("sim_type in", values, "simType"); return (Criteria) this; } - public Criteria andMapIdNotIn(List values) { - addCriterion("map_id not in", values, "mapId"); + public Criteria andSimTypeNotIn(List values) { + addCriterion("sim_type not in", values, "simType"); return (Criteria) this; } - public Criteria andMapIdBetween(Long value1, Long value2) { - addCriterion("map_id between", value1, value2, "mapId"); + public Criteria andSimTypeBetween(String value1, String value2) { + addCriterion("sim_type between", value1, value2, "simType"); return (Criteria) this; } - public Criteria andMapIdNotBetween(Long value1, Long value2) { - addCriterion("map_id not between", value1, value2, "mapId"); + public Criteria andSimTypeNotBetween(String value1, String value2) { + addCriterion("sim_type not between", value1, value2, "simType"); return (Criteria) this; } diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java b/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java index 90f7ea5f8..ee1bfffcf 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java @@ -60,7 +60,7 @@ public class Training2RuleService { runningMapIdSet.add(mapId); // 规则列表 RtsTraining2RuleExample example = new RtsTraining2RuleExample(); - example.createCriteria().andMapIdEqualTo(mapId); + example.createCriteria().andSimTypeEqualTo(simulation.getBuildParams().getWorkParamVO().getType().name()); List ruleList = rtsTraining2RuleMapper.selectByExampleWithBLOBs(example); if (!CollectionUtils.isEmpty(ruleList)) { // 清除数据库原有数据 diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java index e4782e850..5898c8194 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java @@ -19,9 +19,9 @@ import java.util.Objects; public enum BgSceneStatusRule { /** - * 设置进路背景 + * 设置进路背景blockade */ - ROUTE_BG_SCENE("进路背景") { + ROUTE_CANCEL_BG_SCENE("取消进路背景") { @Override public String doHandle(Simulation simulation, MapElement mapElement) { openRouteDirect(simulation, (Route) mapElement); @@ -31,7 +31,7 @@ public enum BgSceneStatusRule { /** * 解封按钮背景 */ - BUTTON_BG_SCENE("解封按钮背景") { + BUTTON_BLOCK_BG_SCENE("解封按钮背景") { @Override public String doHandle(Simulation simulation, MapElement mapElement) { Signal signal = (Signal) mapElement; diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java index 2ed668069..da87a4803 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java @@ -13,25 +13,19 @@ import java.util.stream.Collectors; @Getter public enum MapDeviceRule { - ROUTE_LIST("进路列表") { + RAILWAY_PICK_ROUTE_LIST("大铁接车进路列表") { @Override public List filterMapDeviceList(Simulation simulation) { + boolean isRailWay = Simulation.Type.RAILWAY.equals(simulation.getBuildParams().getWorkParamVO().getType()); // 只获取一个车站的 List stationList = simulation.getRepository().getStationList(); - if (CollectionUtils.isEmpty(stationList)) { + if (CollectionUtils.isEmpty(stationList) || !isRailWay) { return List.of(); } Station station = stationList.get(0); - Predicate predicate = (type) -> { - if (Simulation.Type.RAILWAY.equals(simulation.getBuildParams().getWorkParamVO().getType())) { - return Objects.equals(type, Route.Type.DEPARTURE) || Objects.equals(type, Route.Type.RECEIVING) - || Objects.equals(type, Route.Type.PASS); - } - return true; - }; // 获取本站的2个进路信息 return simulation.getRepository().getRouteList().stream() - .filter(r -> predicate.test(r.getType()) && station.equals(r.getStart().getStation())) + .filter(r -> Objects.equals(r.getType(), Route.Type.RECEIVING) && station.equals(r.getStart().getStation())) .limit(2).collect(Collectors.toList()); } }, diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/PropertyValueRule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/PropertyValueRule.java index bdb1a8559..68da1006d 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/PropertyValueRule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/PropertyValueRule.java @@ -55,18 +55,37 @@ public enum PropertyValueRule { return null; } }, - ROUTE_START_NAME("进路起始名称") { + ROUTE_START_SIGNAL_NAME("进路起始名称") { @Override public String resolve(Simulation simulation, Object mapElement) { return ((Route) mapElement).getStart().getShowName(); } }, - BUTTON_START_CODE("进路起始按钮编码") { + ROUTE_START_SIGNAL_CODE("进路始端信号机编码") { + @Override + public String resolve(Simulation simulation, Object mapElement) { + return ((Route) mapElement).getStart().getCode(); + } + }, + ROUTE_START_PICK_BUTTON_CODE("进路始端接车按钮编码") { @Override public String resolve(Simulation simulation, Object mapElement) { Route route = (Route) mapElement; List signalButtonList = simulation.getBuildParams().getMap().getGraphDataNew().getSignalButtonList(); MapSignalButtonVO buttonVO = signalButtonList.stream().filter(button -> MapSignalButtonVO.Type.PICK.equals(button.getType()) + && Objects.equals(button.getSignalCode(), route.getStart().getCode())).findFirst().orElse(null); + if (buttonVO == null) { + throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "错误数据"); + } + return buttonVO.getCode(); + } + }, + ROUTE_START_PASS_BUTTON_CODE("进路始端通过按钮编码") { + @Override + public String resolve(Simulation simulation, Object mapElement) { + Route route = (Route) mapElement; + List signalButtonList = simulation.getBuildParams().getMap().getGraphDataNew().getSignalButtonList(); + MapSignalButtonVO buttonVO = signalButtonList.stream().filter(button -> MapSignalButtonVO.Type.PASS.equals(button.getType()) && Objects.equals(button.getSignalCode(), route.getStart().getCode())).findFirst().orElse(null); if (buttonVO == null) { throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "错误数据"); @@ -74,13 +93,19 @@ public enum PropertyValueRule { return buttonVO.getCode(); } }, - ROUTE_END_NAME("进路终端名称") { + ROUTE_END_SIGNAL_NAME("进路末端名称") { @Override public String resolve(Simulation simulation, Object mapElement) { return ((Route) mapElement).getDestination().getShowName(); } }, - BUTTON_END_CODE("进路终端按钮编码") { + ROUTE_END_SIGNAL_CODE("进路末端信号机编码") { + @Override + public String resolve(Simulation simulation, Object mapElement) { + return ((Route) mapElement).getDestination().getCode(); + } + }, + ROUTE_END_BUTTON_CODE("进路末端按钮编码") { @Override public String resolve(Simulation simulation, Object mapElement) { Route route = (Route) mapElement; diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/Training2Rule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/Training2Rule.java index 021f92a05..2e2f29456 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/Training2Rule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/Training2Rule.java @@ -28,8 +28,6 @@ import java.util.stream.Collectors; public class Training2Rule { private Long id; - private Long mapId; - /** * 地图定位规则 */ @@ -82,7 +80,6 @@ public class Training2Rule { public Training2Rule(RtsTraining2RuleWithBLOBs rule) { this.id = rule.getId(); - this.mapId = rule.getMapId(); this.deviceRule = MapDeviceRule.valueOf(rule.getDeviceRule()); this.client = rule.getClient(); this.name = rule.getName(); @@ -108,7 +105,7 @@ public class Training2Rule { public PublishedTraining2WithBLOBs convert2BO(Simulation simulation, MapNamedElement mapElement) { PublishedTraining2WithBLOBs copyTraining2 = new PublishedTraining2WithBLOBs(); // 地图ID - copyTraining2.setMapId(mapId); + copyTraining2.setMapId(simulation.getBuildParams().getMap().getId()); // 名称 if (name != null) { copyTraining2.setName(PropertyValueRule.resolveContentFormat(name, simulation, mapElement)); diff --git a/src/main/resources/mybatis/mapper/training2/RtsTraining2RuleMapper.xml b/src/main/resources/mybatis/mapper/training2/RtsTraining2RuleMapper.xml index faae79ae9..04b701a66 100644 --- a/src/main/resources/mybatis/mapper/training2/RtsTraining2RuleMapper.xml +++ b/src/main/resources/mybatis/mapper/training2/RtsTraining2RuleMapper.xml @@ -3,7 +3,7 @@ - + @@ -82,7 +82,7 @@ - id, map_id, device_rule, client, name, description, type, labels, scene_rule, creator_id, create_time, location_rule + id, sim_type, device_rule, client, name, description, type, labels, scene_rule, creator_id, create_time, location_rule @@ -138,11 +138,11 @@ insert into rts_training2_rule ( - id, map_id, device_rule, client, name, description, type, labels, + id, sim_type, device_rule, client, name, description, type, labels, scene_rule, creator_id, create_time, steps, failure_rule, location_rule ) values ( - #{id,jdbcType=BIGINT}, #{mapId,jdbcType=BIGINT}, #{deviceRule,jdbcType=VARCHAR}, #{client,jdbcType=VARCHAR}, + #{id,jdbcType=BIGINT}, #{simType,jdbcType=VARCHAR}, #{deviceRule,jdbcType=VARCHAR}, #{client,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{labels,jdbcType=VARCHAR}, #{sceneRule,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{steps,jdbcType=LONGVARCHAR}, #{failureRule,jdbcType=LONGVARCHAR}, #{locationRule,jdbcType=VARCHAR} @@ -155,8 +155,8 @@ id, - - map_id, + + sim_type, device_rule, @@ -199,8 +199,8 @@ #{id,jdbcType=BIGINT}, - - #{mapId,jdbcType=BIGINT}, + + #{simType,jdbcType=VARCHAR}, #{deviceRule,jdbcType=VARCHAR}, @@ -247,8 +247,8 @@ id = #{record.id,jdbcType=BIGINT}, - - map_id = #{record.mapId,jdbcType=BIGINT}, + + sim_type = #{record.simType,jdbcType=VARCHAR}, device_rule = #{record.deviceRule,jdbcType=VARCHAR}, @@ -295,7 +295,7 @@ update rts_training2_rule set id = #{record.id,jdbcType=BIGINT}, - map_id = #{record.mapId,jdbcType=BIGINT}, + sim_type = #{record.simType,jdbcType=VARCHAR}, device_rule = #{record.deviceRule,jdbcType=VARCHAR}, client = #{record.client,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -316,7 +316,7 @@ update rts_training2_rule set id = #{record.id,jdbcType=BIGINT}, - map_id = #{record.mapId,jdbcType=BIGINT}, + sim_type = #{record.simType,jdbcType=VARCHAR}, device_rule = #{record.deviceRule,jdbcType=VARCHAR}, client = #{record.client,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR}, @@ -335,8 +335,8 @@ update rts_training2_rule - - map_id = #{mapId,jdbcType=BIGINT}, + + sim_type = #{simType,jdbcType=VARCHAR}, device_rule = #{deviceRule,jdbcType=VARCHAR}, @@ -380,7 +380,7 @@ update rts_training2_rule - set map_id = #{mapId,jdbcType=BIGINT}, + set sim_type = #{simType,jdbcType=VARCHAR}, device_rule = #{deviceRule,jdbcType=VARCHAR}, client = #{client,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, @@ -398,7 +398,7 @@ update rts_training2_rule - set map_id = #{mapId,jdbcType=BIGINT}, + set sim_type = #{simType,jdbcType=VARCHAR}, device_rule = #{deviceRule,jdbcType=VARCHAR}, client = #{client,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR}, diff --git a/src/test/java/club/joylink/rtss/services/training/Training2RuleTest.java b/src/test/java/club/joylink/rtss/services/training/Training2RuleTest.java index d19b8a576..6bac2bd7d 100644 --- a/src/test/java/club/joylink/rtss/services/training/Training2RuleTest.java +++ b/src/test/java/club/joylink/rtss/services/training/Training2RuleTest.java @@ -50,8 +50,8 @@ public class Training2RuleTest { @Transactional @Test public void entityTest() { - String trainingRuleStr = "{\"id\":1,\"mapId\":154,\"deviceRule\":\"ROUTE_LIST\",\"name\":\"取消{NAME}进路\",\"description\":\"取消{NAME}进路\",\"type\":\"SINGLE\",\"labels\":null,\"sceneRule\":\"ROUTE_BG_SCENE\",\"steps\":[{\"id\":1,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击总取消\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"userOperationType\":\"leftClick\",\"domId\":\"2994\",\"operationType\":\"\",\"params\":{}}],\"triggerRule\":null,\"completionRule\":null,\"failureRule\":null,\"tipPosition\":{\"domId\":\"2994\",\"operateIndex\":0}},{\"id\":2,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击信号机【{ROUTE_START_NAME}】\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"deviceCode\":\"BUTTON_START_CODE\",\"userOperationType\":\"leftClick\",\"domId\":\"2994\",\"operationType\":\"Signal_Cancel_Route\",\"params\":{}}],\"tipPosition\":{\"domId\":\"2994\",\"deviceCode\":\"BUTTON_START_CODE\",\"operateIndex\":0}}],\"failureRule\":null,\"creatorId\":5710}"; - String trainingRuleStr2 = "{\"id\":1,\"mapId\":154,\"deviceRule\":\"ROUTE_LIST\",\"name\":\"【{NAME}】办理\",\"description\":\"【{NAME}】办理\",\"type\":\"SINGLE\",\"labels\":null,\"sceneRule\":null,\"steps\":[{\"id\":1,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击信号机【{ROUTE_START_NAME}】按钮\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"deviceCode\":\"BUTTON_START_CODE\",\"userOperationType\":\"leftClick\",\"domId\":\"3010\",\"operationType\":\"\",\"params\":{}}],\"triggerRule\":null,\"completionRule\":null,\"failureRule\":null,\"tipPosition\":{\"domId\":\"3010\",\"deviceCode\":\"BUTTON_START_CODE\",\"operateIndex\":0}},{\"id\":2,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击信号机【{ROUTE_END_NAME}】按钮\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"deviceCode\":\"BUTTON_END_CODE\",\"userOperationType\":\"leftClick\",\"domId\":\"3010\",\"operationType\":\"Signal_Set_Route\",\"params\":{}}],\"tipPosition\":{\"domId\":\"3010\",\"deviceCode\":\"BUTTON_END_CODE\",\"operateIndex\":0}}],\"failureRule\":null,\"creatorId\":5710}"; + String trainingRuleStr = "{\"id\":1,\"deviceRule\":\"RAILWAY_PICK_ROUTE_LIST\",\"name\":\"取消{NAME}进路\",\"description\":\"取消{NAME}进路\",\"type\":\"SINGLE\",\"labels\":null,\"sceneRule\":\"ROUTE_CANCEL_BG_SCENE\",\"steps\":[{\"id\":1,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击总取消\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"userOperationType\":\"leftClick\",\"domId\":\"2994\",\"operationType\":\"\",\"params\":{}}],\"triggerRule\":null,\"completionRule\":null,\"failureRule\":null,\"tipPosition\":{\"domId\":\"2994\",\"operateIndex\":0}},{\"id\":2,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击信号机【{ROUTE_START_NAME}】\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"deviceCode\":\"BUTTON_START_CODE\",\"userOperationType\":\"leftClick\",\"domId\":\"2994\",\"operationType\":\"Signal_Cancel_Route\",\"params\":{}}],\"tipPosition\":{\"domId\":\"2994\",\"deviceCode\":\"BUTTON_START_CODE\",\"operateIndex\":0}}],\"failureRule\":null,\"creatorId\":5710}"; + String trainingRuleStr2 = "{\"id\":1,\"deviceRule\":\"RAILWAY_PICK_ROUTE_LIST\",\"name\":\"【{NAME}】办理\",\"description\":\"【{NAME}】办理\",\"type\":\"SINGLE\",\"labels\":null,\"sceneRule\":null,\"steps\":[{\"id\":1,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击信号机【{ROUTE_START_NAME}】按钮\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"deviceCode\":\"BUTTON_START_CODE\",\"userOperationType\":\"leftClick\",\"domId\":\"3010\",\"operationType\":\"\",\"params\":{}}],\"triggerRule\":null,\"completionRule\":null,\"failureRule\":null,\"tipPosition\":{\"domId\":\"3010\",\"deviceCode\":\"BUTTON_START_CODE\",\"operateIndex\":0}},{\"id\":2,\"memberRule\":{\"type\":\"STATION_SUPERVISOR\",\"deviceCodeRule\":\"STATION_CODE\"},\"description\":\"点击信号机【{ROUTE_END_NAME}】按钮\",\"operationRules\":[{\"t\":\"C\",\"id\":0,\"deviceCode\":\"BUTTON_END_CODE\",\"userOperationType\":\"leftClick\",\"domId\":\"3010\",\"operationType\":\"Signal_Set_Route\",\"params\":{}}],\"tipPosition\":{\"domId\":\"3010\",\"deviceCode\":\"BUTTON_END_CODE\",\"operateIndex\":0}}],\"failureRule\":null,\"creatorId\":5710}"; Training2Rule training2Rule = JsonUtils.read(trainingRuleStr, Training2Rule.class); Training2Rule training2Rule2 = JsonUtils.read(trainingRuleStr2, Training2Rule.class); // 生成实训 @@ -61,7 +61,7 @@ public class Training2RuleTest { accountVO.setId(5710L); loginUserInfoVO.setAccountVO(accountVO); SimulationWorkService initService = simulationWorkServiceManager.getWorkService(workParamVO.getType()); - Simulation simulation = initService.create(training2Rule.getMapId(), workParamVO, loginUserInfoVO); + Simulation simulation = initService.create(154, workParamVO, loginUserInfoVO); // 删除旧仿真,保存新仿真 club.joylink.rtss.simulation.Simulation oldSimulation = simulationManager.queryByCreatorId(simulation.getCreatorId()); if (oldSimulation != null) {