diff --git a/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java b/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java
new file mode 100644
index 000000000..52927a2a3
--- /dev/null
+++ b/src/main/java/club/joylink/rtss/controller/racetr/RaceApplicationController.java
@@ -0,0 +1,66 @@
+package club.joylink.rtss.controller.racetr;
+
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 赛题训练接口
+ */
+@RestController
+@RequestMapping("/api/race")
+public class RaceApplicationController {
+ /**
+ * 开始训练
+ *
+ * @param paperId 赛题ID
+ * @return 训练的信息
+ */
+ @PostMapping("/{paperId}")
+ public Object start(@PathVariable long paperId) {
+ //暂时就用用户id作为竞赛上下文的id,也就是说一个用户同时只能开一个竞赛
+ return null;
+ }
+
+ /**
+ * 加载场景
+ *
+ * @param simulationId 场景依托的仿真
+ * @param sceneId 场景的ID
+ */
+ @PutMapping("/{simulationId}/{sceneId}/load")
+ public void loadScene(@PathVariable String simulationId, @PathVariable String sceneId) {
+
+ }
+
+ /**
+ * 完成任务
+ *
+ * @param taskId 任务ID
+ * @param record 任务记录(需要前端进行判定的操作的记录)
+ */
+ @PutMapping("/{taskId}/finish")
+ public void finishTask(@PathVariable long taskId, @RequestBody Object record) {
+
+ }
+
+ /**
+ * 完成训练
+ *
+ * @return 评分结果
+ */
+ public Object finish() {
+ return null;
+ }
+
+ /**
+ * 获取用户正在进行的竞赛信息
+ *
+ * 目前想到的使用场景就是页面刷新后
+ *
+ * @return 竞赛信息
+ */
+ @GetMapping("")
+ public Object getRaceInfo() {
+ return null;
+ }
+
+}
diff --git a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java
index b46376e2f..9b379d8b0 100644
--- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java
+++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java
@@ -18,6 +18,7 @@ import club.joylink.rtss.simulation.cbtc.data.vo.SimulationVO;
import club.joylink.rtss.simulation.cbtc.member.MemberManager;
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
import club.joylink.rtss.simulation.cbtc.script.ScriptBO;
+import club.joylink.rtss.simulation.cbtc.vo.SimulationWorkParamVO;
import club.joylink.rtss.simulation.vo.SimulationInfoVO;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.LoginUserInfoVO;
@@ -31,37 +32,22 @@ import club.joylink.rtss.vo.client.operation.DriveParamVO;
import club.joylink.rtss.vo.client.psl.PslStatus;
import club.joylink.rtss.vo.client.runplan.PlanTripNumberVO;
import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO;
-import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
-import club.joylink.rtss.vo.client.simulationv1.SimulationInfoQueryVO;
-import club.joylink.rtss.vo.client.simulationv1.SimulationLogPagedQueryVO;
-import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO;
-import club.joylink.rtss.vo.client.simulationv1.SimulationUserVO;
+import club.joylink.rtss.vo.client.simulationv1.*;
import club.joylink.rtss.vo.map.MapVO;
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestAttribute;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
/**
* 新仿真接口
@@ -70,319 +56,319 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/simulation")
public class SimulationV1Controller {
- @Autowired
- private GroupSimulationService groupSimulationService;
+ @Autowired
+ private GroupSimulationService groupSimulationService;
- @Autowired
- private IVirtualRealityIbpService iVirtualRealityIBPService;
+ @Autowired
+ private IVirtualRealityIbpService iVirtualRealityIBPService;
- @Autowired
- private SimulationSupportService simulationSupportService;
+ @Autowired
+ private SimulationSupportService simulationSupportService;
- @Autowired
- private IVirtualRealityPslService iVirtualRealityPslService;
- @Autowired
- private SimulationService simulationService;
- @Autowired
- private SimulationManager simulationManager;
- @Autowired
- private MemberManager memberManager;
+ @Autowired
+ private IVirtualRealityPslService iVirtualRealityPslService;
+ @Autowired
+ private SimulationService simulationService;
+ @Autowired
+ private SimulationManager simulationManager;
+ @Autowired
+ private MemberManager memberManager;
- /**
- * 根据产品类型创建仿真
- */
- @GetMapping("")
- public String simulation(Long mapId, String prdType,
- @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
- LoginUserInfoVO loginUserInfoVO) {
- String simulation = this.groupSimulationService.simulation(mapId, prdType, loginUserInfoVO);
- return simulation;
- }
-
- /**
- * 创建实训仿真
- */
- @GetMapping(path = "/training/{trainingId}")
- public String trainingSimulation(@PathVariable Long trainingId,
- @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
- LoginUserInfoVO loginUserInfoVO) {
- return this.groupSimulationService.trainingSimulation(trainingId, loginUserInfoVO);
- }
-
- /**
- * 创建考试仿真
- */
- @GetMapping(path = "/exam/{examId}")
- public String examSimulate(@PathVariable Long examId,
- @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
- LoginUserInfoVO loginUserInfoVO) {
- return this.groupSimulationService.examSimulation(examId, loginUserInfoVO);
- }
-
- /**
- * 获取客户端已经进入仿真的用户仿真所在group
- */
- @GetMapping(path = "/running")
- public List getRunningSimulationBySubscribeUser(@RequestAttribute AccountVO user) {
- return this.groupSimulationService.getUserRunningSimulationGroups(user);
- }
-
- /**
- * 根据仿真group获取仿真基础信息
- */
- @GetMapping("/{group}")
- public SimulationVO getSimulationBasicInfo(@PathVariable String group) {
- return this.groupSimulationService.getSimulationBasicInfo(group);
- }
-
- /**
- * 获取用户在仿真中的用户信息
- */
- @GetMapping("/{group}/simulationUser")
- public SimulationUserVO getSimulationUserInfo(@PathVariable String group,
- @RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
- AccountVO accountVO) {
- return this.groupSimulationService.getSimulationUserInfo(group, accountVO);
- }
-
- /**
- * 获取所有仿真用户
- */
- @GetMapping("/{group}/simulationUsers")
- public List queryAllSimulationUsers(@PathVariable String group) {
- return this.groupSimulationService.queryAllSimulationUsers(group);
- }
-
- /**
- * 根据仿真group获取仿真地图数据
- */
- @GetMapping("/{group}/mapData")
- public MapVO getSimulationMapData(@PathVariable String group) {
- return this.groupSimulationService.getSimulationMapData(group);
- }
-
- /**
- * 根据group获取排序的车站列表(包含车辆段/停车场)
- */
- @GetMapping("/{group}/stationWithDepot")
- public List getSortedStationListWithDepot(@PathVariable String group) {
- return this.groupSimulationService.getSortedStationListWithDepot(group);
- }
-
- /**
- * 加载指定运行计划到仿真中
- */
- @PutMapping("/{group}/load/runPlan/{templateId}")
- public void loadRunPlan(@PathVariable String group, @PathVariable Long templateId) {
- this.groupSimulationService.loadRunPlan(group, templateId);
- }
-
- /**
- * 加载草稿运行图
- */
- @PutMapping("/{simulationId}/load/draftRunPlan/{draftRunPlanId}")
- public void loadDraftRunPlan(@PathVariable String simulationId,
- @PathVariable long draftRunPlanId) {
- this.simulationService.loadDraftRunPlan(simulationId, draftRunPlanId);
- }
-
- /**
- * 根据仿真group获取仿真运行图
- */
- @GetMapping("/{group}/runPlan")
- public RunPlanEChartsDataVO getSimulationRunPlan(@PathVariable String group) {
- return this.groupSimulationService.getSimulationRunPlan(group);
- }
-
- /**
- * 获取仿真运行图车次号列表
- */
- @GetMapping("/{group}/tripNumbers")
- public List getSimulationRunPlanTripNumbers(@PathVariable String group) {
- return this.groupSimulationService.getSimulationRunPlanTripNumbers(group);
- }
-
- /**
- * 根据车次号获取服务号
- */
- @GetMapping("/{group}/serviceNumber")
- public List getServiceNumberByTripNumber(@PathVariable String group, String tripNumber) {
- return this.groupSimulationService.getServiceNumberByTripNumber(group, tripNumber);
- }
-
- /**
- * 根据车次号获取计划车次信息
- */
- @GetMapping("/{group}/planTripInfo")
- public PlanTripNumberVO getPlanTripByTripNumber(@PathVariable String group, String tripNumber) {
- return this.groupSimulationService.getPlanTripByTripNumber(group, tripNumber);
- }
-
- /**
- * 根据服务号和车次号获取计划车次信息
- */
- @GetMapping("/{group}/planTripInfoBySt")
- public PlanTripNumberVO planTripInfoBySt(@PathVariable String group, String serviceNumber,
- String tripNumber) {
- return this.groupSimulationService.planTripInfoByServiceAndTripNumber(group, serviceNumber,
- tripNumber);
- }
-
- /**
- * 仿真操作
- */
- @PostMapping("/{group}/operate/{type}")
- public Object operate(@PathVariable @NotBlank String group, @PathVariable @NotNull String type,
- @RequestBody(required = false) Map param, @RequestAttribute AccountVO user) {
- if (null == param) {
- param = new HashMap<>();
+ /**
+ * 根据产品类型创建仿真
+ */
+ @GetMapping("")
+ public String simulation(Long mapId, String prdType,
+ @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
+ LoginUserInfoVO loginUserInfoVO) {
+ String simulation = this.groupSimulationService.simulation(mapId, prdType, loginUserInfoVO);
+ return simulation;
}
- return this.groupSimulationService.operate(group, type, param, user);
- }
- /**
- * 仿真指令
- */
- @PostMapping("/{group}/command")
- public void command(@PathVariable String group,
- @RequestBody @Validated CommandInitiateVO initiateVO, @RequestAttribute AccountVO user) {
- Simulation simulation = this.groupSimulationService.getSimulationByGroup(group);
- SimulationMember member = simulation.getSimulationMemberByUserId(user.getId());
- this.groupSimulationService.command(simulation, initiateVO, member);
- }
-
- /**
- * 根据计划时间获取此时间点可以加载的最大列车数量
- */
- @GetMapping("/{group}/loadTrainNumber")
- public int getLoadTrainNumber(@PathVariable String group,
- @DateTimeFormat(pattern = "HH:mm:ss") LocalTime time) {
- BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(time, "时间不能为空");
- return this.groupSimulationService.getGivenTimeCouldLoadedTrainNumber(group, time);
- }
-
- /**
- * 按计划行车
- */
- @PostMapping("/{group}/ranAsPlan")
- public void runAsPlan(@PathVariable String group, @RequestBody @Validated RunAsPlanParam param) {
- this.groupSimulationService.runAsPlan(group, param);
- }
-
- /**
- * 修改仿真系统时间
- */
- @PutMapping("/{group}/modifySystemTime")
- public void modifySystemTime(@PathVariable String group, @RequestBody RunAsPlanParam param) {
- this.groupSimulationService.modifySystemTime(group, param.getTime());
- }
-
- /**
- * 退出计划
- */
- @PostMapping("/{group}/planOver")
- public void planOver(@PathVariable String group) {
- this.groupSimulationService.planOver(group);
- }
-
- /**
- * 退出仿真(主要是非房主用户退出综合演练用)
- */
- @PutMapping("/{simulationId}/exit")
- public void exitSimulation(@PathVariable String simulationId, @RequestAttribute AccountVO user) {
- this.groupSimulationService.exitSimulation(simulationId, user);
- }
-
- /**
- * 销毁仿真。 由系统管理员或老师在仿真监管功能中使用
- */
- @DeleteMapping("/{simulationId}/destroy")
- public void destroySimulation(@PathVariable String simulationId) {
- this.groupSimulationService.clearSimulation(simulationId);
- }
-
- /**
- * 加载剧本并扮演成员(已发布的剧本)
- */
- @PutMapping(path = "/{group}/script/{scriptId}")
- public void loadScriptAndPlayMember(@PathVariable String group,
- @PathVariable Long scriptId,
- String memberId,
- ScriptBO.Mode mode,
- @RequestAttribute AccountVO user) {
- this.groupSimulationService.loadScriptAndPlayMember(group, scriptId, memberId, mode, user);
- }
-
- /**
- * 退出剧本
- */
- @PutMapping(path = "/{group}/exitScript")
- public void exitScript(@PathVariable @NotBlank String group, @RequestAttribute AccountVO user) {
- this.groupSimulationService.exitScript(group, user);
- }
-
- /**
- * 获取所有仿真成员列表
- */
- @GetMapping(path = "/{group}/members")
- public List getSimulationMembers(@PathVariable @NotBlank String group) {
- return this.groupSimulationService.getSimulationMembers(group);
- }
-
- /**
- * 获取仿真设备故障列表
- */
- @GetMapping(path = "/{group}/deviceFaultInfos")
- public List getSimulationDeviceFaultInfoList(
- @PathVariable @NotBlank String group) {
- return this.groupSimulationService.getSimulationDeviceFaultInfoList(group);
- }
-
- /**
- * 取消自动故障
- */
- @PutMapping(path = "/{group}/faultMode/{id}")
- public void setFaultMode(@PathVariable @NotBlank String group,
- @PathVariable(required = false) Integer id) {
- if (Objects.isNull(id)) {
- this.groupSimulationService.clearAllAutoFault(group);
- return;
+ /**
+ * 创建实训仿真
+ */
+ @GetMapping(path = "/training/{trainingId}")
+ public String trainingSimulation(@PathVariable Long trainingId,
+ @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
+ LoginUserInfoVO loginUserInfoVO) {
+ return this.groupSimulationService.trainingSimulation(trainingId, loginUserInfoVO);
}
- this.groupSimulationService.cancelAutoFault(group, id);
- }
- /**
- * 设置自动故障
- */
- @PostMapping(path = "/{group}/faultMode")
- public Integer setFaultMode(@PathVariable @NotBlank String group,
- @RequestBody FaultRuleVO ruleVO) {
- return this.groupSimulationService.setFaultMode(group, ruleVO);
- }
+ /**
+ * 创建考试仿真
+ */
+ @GetMapping(path = "/exam/{examId}")
+ public String examSimulate(@PathVariable Long examId,
+ @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
+ LoginUserInfoVO loginUserInfoVO) {
+ return this.groupSimulationService.examSimulation(examId, loginUserInfoVO);
+ }
- /**
- * 查询已设置所有的自动触发故障
- */
- @GetMapping(path = "/{group}/faultMode/faultRule")
- public Set getNotTriggerAutoFault(@PathVariable @NotBlank String group) {
- return this.groupSimulationService.getTriggerAutoFaults(group);
- }
+ /**
+ * 获取客户端已经进入仿真的用户仿真所在group
+ */
+ @GetMapping(path = "/running")
+ public List getRunningSimulationBySubscribeUser(@RequestAttribute AccountVO user) {
+ return this.groupSimulationService.getUserRunningSimulationGroups(user);
+ }
- /**
- * 查询所有目的地码
- */
- @GetMapping("/{group}/destinationCode/list")
- public List getAllDestinationCode(@PathVariable String group) {
- return this.groupSimulationService.getAllDestinationCode(group);
- }
+ /**
+ * 根据仿真group获取仿真基础信息
+ */
+ @GetMapping("/{group}")
+ public SimulationVO getSimulationBasicInfo(@PathVariable String group) {
+ return this.groupSimulationService.getSimulationBasicInfo(group);
+ }
- /**
- * 获取IBP盘状态
- */
- @GetMapping("/{group}/{stationCode}/ibp/status")
- public IbpStatus getIbpStatus(@PathVariable String group, @PathVariable String stationCode) {
- return iVirtualRealityIBPService.getIbpStatus(group, stationCode);
- }
+ /**
+ * 获取用户在仿真中的用户信息
+ */
+ @GetMapping("/{group}/simulationUser")
+ public SimulationUserVO getSimulationUserInfo(@PathVariable String group,
+ @RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
+ AccountVO accountVO) {
+ return this.groupSimulationService.getSimulationUserInfo(group, accountVO);
+ }
+
+ /**
+ * 获取所有仿真用户
+ */
+ @GetMapping("/{group}/simulationUsers")
+ public List queryAllSimulationUsers(@PathVariable String group) {
+ return this.groupSimulationService.queryAllSimulationUsers(group);
+ }
+
+ /**
+ * 根据仿真group获取仿真地图数据
+ */
+ @GetMapping("/{group}/mapData")
+ public MapVO getSimulationMapData(@PathVariable String group) {
+ return this.groupSimulationService.getSimulationMapData(group);
+ }
+
+ /**
+ * 根据group获取排序的车站列表(包含车辆段/停车场)
+ */
+ @GetMapping("/{group}/stationWithDepot")
+ public List getSortedStationListWithDepot(@PathVariable String group) {
+ return this.groupSimulationService.getSortedStationListWithDepot(group);
+ }
+
+ /**
+ * 加载指定运行计划到仿真中
+ */
+ @PutMapping("/{group}/load/runPlan/{templateId}")
+ public void loadRunPlan(@PathVariable String group, @PathVariable Long templateId) {
+ this.groupSimulationService.loadRunPlan(group, templateId);
+ }
+
+ /**
+ * 加载草稿运行图
+ */
+ @PutMapping("/{simulationId}/load/draftRunPlan/{draftRunPlanId}")
+ public void loadDraftRunPlan(@PathVariable String simulationId,
+ @PathVariable long draftRunPlanId) {
+ this.simulationService.loadDraftRunPlan(simulationId, draftRunPlanId);
+ }
+
+ /**
+ * 根据仿真group获取仿真运行图
+ */
+ @GetMapping("/{group}/runPlan")
+ public RunPlanEChartsDataVO getSimulationRunPlan(@PathVariable String group) {
+ return this.groupSimulationService.getSimulationRunPlan(group);
+ }
+
+ /**
+ * 获取仿真运行图车次号列表
+ */
+ @GetMapping("/{group}/tripNumbers")
+ public List getSimulationRunPlanTripNumbers(@PathVariable String group) {
+ return this.groupSimulationService.getSimulationRunPlanTripNumbers(group);
+ }
+
+ /**
+ * 根据车次号获取服务号
+ */
+ @GetMapping("/{group}/serviceNumber")
+ public List getServiceNumberByTripNumber(@PathVariable String group, String tripNumber) {
+ return this.groupSimulationService.getServiceNumberByTripNumber(group, tripNumber);
+ }
+
+ /**
+ * 根据车次号获取计划车次信息
+ */
+ @GetMapping("/{group}/planTripInfo")
+ public PlanTripNumberVO getPlanTripByTripNumber(@PathVariable String group, String tripNumber) {
+ return this.groupSimulationService.getPlanTripByTripNumber(group, tripNumber);
+ }
+
+ /**
+ * 根据服务号和车次号获取计划车次信息
+ */
+ @GetMapping("/{group}/planTripInfoBySt")
+ public PlanTripNumberVO planTripInfoBySt(@PathVariable String group, String serviceNumber,
+ String tripNumber) {
+ return this.groupSimulationService.planTripInfoByServiceAndTripNumber(group, serviceNumber,
+ tripNumber);
+ }
+
+ /**
+ * 仿真操作
+ */
+ @PostMapping("/{group}/operate/{type}")
+ public Object operate(@PathVariable @NotBlank String group, @PathVariable @NotNull String type,
+ @RequestBody(required = false) Map param, @RequestAttribute AccountVO user) {
+ if (null == param) {
+ param = new HashMap<>();
+ }
+ return this.groupSimulationService.operate(group, type, param, user);
+ }
+
+ /**
+ * 仿真指令
+ */
+ @PostMapping("/{group}/command")
+ public void command(@PathVariable String group,
+ @RequestBody @Validated CommandInitiateVO initiateVO, @RequestAttribute AccountVO user) {
+ Simulation simulation = this.groupSimulationService.getSimulationByGroup(group);
+ SimulationMember member = simulation.getSimulationMemberByUserId(user.getId());
+ this.groupSimulationService.command(simulation, initiateVO, member);
+ }
+
+ /**
+ * 根据计划时间获取此时间点可以加载的最大列车数量
+ */
+ @GetMapping("/{group}/loadTrainNumber")
+ public int getLoadTrainNumber(@PathVariable String group,
+ @DateTimeFormat(pattern = "HH:mm:ss") LocalTime time) {
+ BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(time, "时间不能为空");
+ return this.groupSimulationService.getGivenTimeCouldLoadedTrainNumber(group, time);
+ }
+
+ /**
+ * 按计划行车
+ */
+ @PostMapping("/{group}/ranAsPlan")
+ public void runAsPlan(@PathVariable String group, @RequestBody @Validated RunAsPlanParam param) {
+ this.groupSimulationService.runAsPlan(group, param);
+ }
+
+ /**
+ * 修改仿真系统时间
+ */
+ @PutMapping("/{group}/modifySystemTime")
+ public void modifySystemTime(@PathVariable String group, @RequestBody RunAsPlanParam param) {
+ this.groupSimulationService.modifySystemTime(group, param.getTime());
+ }
+
+ /**
+ * 退出计划
+ */
+ @PostMapping("/{group}/planOver")
+ public void planOver(@PathVariable String group) {
+ this.groupSimulationService.planOver(group);
+ }
+
+ /**
+ * 退出仿真(主要是非房主用户退出综合演练用)
+ */
+ @PutMapping("/{simulationId}/exit")
+ public void exitSimulation(@PathVariable String simulationId, @RequestAttribute AccountVO user) {
+ this.groupSimulationService.exitSimulation(simulationId, user);
+ }
+
+ /**
+ * 销毁仿真。 由系统管理员或老师在仿真监管功能中使用
+ */
+ @DeleteMapping("/{simulationId}/destroy")
+ public void destroySimulation(@PathVariable String simulationId) {
+ this.groupSimulationService.clearSimulation(simulationId);
+ }
+
+ /**
+ * 加载剧本并扮演成员(已发布的剧本)
+ */
+ @PutMapping(path = "/{group}/script/{scriptId}")
+ public void loadScriptAndPlayMember(@PathVariable String group,
+ @PathVariable Long scriptId,
+ String memberId,
+ ScriptBO.Mode mode,
+ @RequestAttribute AccountVO user) {
+ this.groupSimulationService.loadScriptAndPlayMember(group, scriptId, memberId, mode, user);
+ }
+
+ /**
+ * 退出剧本
+ */
+ @PutMapping(path = "/{group}/exitScript")
+ public void exitScript(@PathVariable @NotBlank String group, @RequestAttribute AccountVO user) {
+ this.groupSimulationService.exitScript(group, user);
+ }
+
+ /**
+ * 获取所有仿真成员列表
+ */
+ @GetMapping(path = "/{group}/members")
+ public List getSimulationMembers(@PathVariable @NotBlank String group) {
+ return this.groupSimulationService.getSimulationMembers(group);
+ }
+
+ /**
+ * 获取仿真设备故障列表
+ */
+ @GetMapping(path = "/{group}/deviceFaultInfos")
+ public List getSimulationDeviceFaultInfoList(
+ @PathVariable @NotBlank String group) {
+ return this.groupSimulationService.getSimulationDeviceFaultInfoList(group);
+ }
+
+ /**
+ * 取消自动故障
+ */
+ @PutMapping(path = "/{group}/faultMode/{id}")
+ public void setFaultMode(@PathVariable @NotBlank String group,
+ @PathVariable(required = false) Integer id) {
+ if (Objects.isNull(id)) {
+ this.groupSimulationService.clearAllAutoFault(group);
+ return;
+ }
+ this.groupSimulationService.cancelAutoFault(group, id);
+ }
+
+ /**
+ * 设置自动故障
+ */
+ @PostMapping(path = "/{group}/faultMode")
+ public Integer setFaultMode(@PathVariable @NotBlank String group,
+ @RequestBody FaultRuleVO ruleVO) {
+ return this.groupSimulationService.setFaultMode(group, ruleVO);
+ }
+
+ /**
+ * 查询已设置所有的自动触发故障
+ */
+ @GetMapping(path = "/{group}/faultMode/faultRule")
+ public Set getNotTriggerAutoFault(@PathVariable @NotBlank String group) {
+ return this.groupSimulationService.getTriggerAutoFaults(group);
+ }
+
+ /**
+ * 查询所有目的地码
+ */
+ @GetMapping("/{group}/destinationCode/list")
+ public List getAllDestinationCode(@PathVariable String group) {
+ return this.groupSimulationService.getAllDestinationCode(group);
+ }
+
+ /**
+ * 获取IBP盘状态
+ */
+ @GetMapping("/{group}/{stationCode}/ibp/status")
+ public IbpStatus getIbpStatus(@PathVariable String group, @PathVariable String stationCode) {
+ return iVirtualRealityIBPService.getIbpStatus(group, stationCode);
+ }
// /**
// * 按下IBP盘按钮
@@ -400,90 +386,90 @@ public class SimulationV1Controller {
// iVirtualRealityIBPService.releaseTheElement(group, stationCode, buttonCode);
// }
- /**
- * 查询报警列表
- */
- @GetMapping(path = "/{group}/alarm")
- public List listAlarm(@PathVariable String group, String level,
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime,
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
- return groupSimulationService.listAlarm(group, level, startTime, endTime);
- }
+ /**
+ * 查询报警列表
+ */
+ @GetMapping(path = "/{group}/alarm")
+ public List listAlarm(@PathVariable String group, String level,
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime,
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
+ return groupSimulationService.listAlarm(group, level, startTime, endTime);
+ }
- /**
- * 仿真报警确认
- */
- @PutMapping(path = "/{group}/alarm/confirm")
- public void AlarmConfirm(@PathVariable String group, @RequestBody List codes,
- @RequestAttribute AccountVO user) {
- groupSimulationService.alarmConfirm(group, codes, user);
- }
+ /**
+ * 仿真报警确认
+ */
+ @PutMapping(path = "/{group}/alarm/confirm")
+ public void AlarmConfirm(@PathVariable String group, @RequestBody List codes,
+ @RequestAttribute AccountVO user) {
+ groupSimulationService.alarmConfirm(group, codes, user);
+ }
- /**
- * 仿真客流数据切换
- */
- @PutMapping(path = "/{group}/passengerFlow/{passengerFlowId}")
- public void AlarmConfirm(@PathVariable String group, @PathVariable Long passengerFlowId) {
- groupSimulationService.changePassengerFlow(group, passengerFlowId);
- }
+ /**
+ * 仿真客流数据切换
+ */
+ @PutMapping(path = "/{group}/passengerFlow/{passengerFlowId}")
+ public void AlarmConfirm(@PathVariable String group, @PathVariable Long passengerFlowId) {
+ groupSimulationService.changePassengerFlow(group, passengerFlowId);
+ }
- /**
- * 获取仿真日志
- */
- @GetMapping("/{group}/log")
- public PageVO getLog(@PathVariable String group,
- SimulationLogPagedQueryVO queryVO) {
- return groupSimulationService.getLog(group, queryVO);
- }
+ /**
+ * 获取仿真日志
+ */
+ @GetMapping("/{group}/log")
+ public PageVO getLog(@PathVariable String group,
+ SimulationLogPagedQueryVO queryVO) {
+ return groupSimulationService.getLog(group, queryVO);
+ }
- /**
- * 获取机器人驾驶参数
- */
- @GetMapping("/{simulationId}/driveParam/{groupNumber}")
- public DriveParamVO getDriveParam(@PathVariable String simulationId,
- @PathVariable String groupNumber) {
- return groupSimulationService.getDriveParam(simulationId, groupNumber);
- }
+ /**
+ * 获取机器人驾驶参数
+ */
+ @GetMapping("/{simulationId}/driveParam/{groupNumber}")
+ public DriveParamVO getDriveParam(@PathVariable String simulationId,
+ @PathVariable String groupNumber) {
+ return groupSimulationService.getDriveParam(simulationId, groupNumber);
+ }
- /* ----------------------- 泰雷兹操作辅助接口 ----------------------- */
+ /* ----------------------- 泰雷兹操作辅助接口 ----------------------- */
- /**
- * 查询进路路径
- */
- @GetMapping("/{group}/querySectionPaths")
- public List> querySectionPaths(@PathVariable String group, String groupNumber,
- String standCode, String signalCode) {
- return simulationSupportService.queryRoutePaths(group, groupNumber, standCode, signalCode);
- }
+ /**
+ * 查询进路路径
+ */
+ @GetMapping("/{group}/querySectionPaths")
+ public List> querySectionPaths(@PathVariable String group, String groupNumber,
+ String standCode, String signalCode) {
+ return simulationSupportService.queryRoutePaths(group, groupNumber, standCode, signalCode);
+ }
- /**
- * 查询列车或运行线经过的站台
- */
- @GetMapping("/{group}/queryStands/trainOrDestination")
- public List queryStandsThatTrainGoingThrough(@PathVariable String group,
- String groupNumber, String destinationCode) {
- return simulationSupportService.queryStandsThatTrainGoingThrough(group, groupNumber,
- destinationCode);
- }
+ /**
+ * 查询列车或运行线经过的站台
+ */
+ @GetMapping("/{group}/queryStands/trainOrDestination")
+ public List queryStandsThatTrainGoingThrough(@PathVariable String group,
+ String groupNumber, String destinationCode) {
+ return simulationSupportService.queryStandsThatTrainGoingThrough(group, groupNumber,
+ destinationCode);
+ }
- /**
- * 查询为该列车已建立的进路
- */
- @GetMapping("/{group}/queryEstablishedRoutes/{groupNumber}")
- public List queryEstablishedRoutes(@PathVariable String group,
- @PathVariable String groupNumber) {
- return simulationSupportService.queryEstablishedRoutes(group, groupNumber);
- }
+ /**
+ * 查询为该列车已建立的进路
+ */
+ @GetMapping("/{group}/queryEstablishedRoutes/{groupNumber}")
+ public List queryEstablishedRoutes(@PathVariable String group,
+ @PathVariable String groupNumber) {
+ return simulationSupportService.queryEstablishedRoutes(group, groupNumber);
+ }
- /* ----------------------- PSL盘接口 ----------------------- */
+ /* ----------------------- PSL盘接口 ----------------------- */
- /**
- * 获取PSL盘状态
- */
- @GetMapping("/{group}/{standCode}/psl/status")
- public PslStatus getPslStatus(@PathVariable String group, @PathVariable String standCode) {
- return iVirtualRealityPslService.getStatus(group, standCode);
- }
+ /**
+ * 获取PSL盘状态
+ */
+ @GetMapping("/{group}/{standCode}/psl/status")
+ public PslStatus getPslStatus(@PathVariable String group, @PathVariable String standCode) {
+ return iVirtualRealityPslService.getStatus(group, standCode);
+ }
// /**
// * 按下PSL盘按钮
@@ -493,169 +479,169 @@ public class SimulationV1Controller {
// iVirtualRealityPslService.pressTheButton(group, standCode, button);
// }
- /* ----------------------- ISCS接口 ----------------------- */
+ /* ----------------------- ISCS接口 ----------------------- */
- /**
- * 条件查询仿真中的ISCS系统资源
- */
- @GetMapping("/{group}/iscs/systemResources")
- public List getAllIscsSystemResources(@PathVariable String group,
- IscsSystemResourcesQueryVO queryVO) {
- return groupSimulationService.getAllIscsSystemResources(group, queryVO);
- }
+ /**
+ * 条件查询仿真中的ISCS系统资源
+ */
+ @GetMapping("/{group}/iscs/systemResources")
+ public List getAllIscsSystemResources(@PathVariable String group,
+ IscsSystemResourcesQueryVO queryVO) {
+ return groupSimulationService.getAllIscsSystemResources(group, queryVO);
+ }
- /**
- * 查询所有pa系统的定时播放任务
- */
- @GetMapping("/{group}/iscs/paTimedPlay")
- public List getPaTimedPlay(@PathVariable String group, String stationCode) {
- return groupSimulationService.getAllPaTimedPlayInfo(group, stationCode);
- }
+ /**
+ * 查询所有pa系统的定时播放任务
+ */
+ @GetMapping("/{group}/iscs/paTimedPlay")
+ public List getPaTimedPlay(@PathVariable String group, String stationCode) {
+ return groupSimulationService.getAllPaTimedPlayInfo(group, stationCode);
+ }
- /* ----------------------- 仿真新接口 ----------------------- */
+ /* ----------------------- 仿真新接口 ----------------------- */
- /**
- * 仿真创建接口(新)
- */
- /*@Deprecated
+ /**
+ * 根据功能配置创建仿真
+ */
+ @Deprecated
@PostMapping("/new/{mapId}")
public String createSimulation(@PathVariable long mapId, @RequestBody @Validated SimulationWorkParamVO paramVO,
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
- LoginUserInfoVO loginUserInfoVO) {
- return simulationService.createSimulation(mapId, null, paramVO, loginUserInfoVO);
- }*/
-
- /**
- * 根据地图功能id创建仿真
- */
- @PostMapping("/new/mapFunction/{mapFunctionId}")
- public String createSimulationByMapFunction(@PathVariable long mapFunctionId,
- @RequestAttribute LoginUserInfoVO loginInfo) {
- return simulationService.createSimulation(mapFunctionId, loginInfo);
- }
-
- /**
- * 按计划行车(新)
- */
- @PostMapping("/new/{simulationId}/runAsPlan")
- public void runAsPlanNew(@PathVariable String simulationId,
- @RequestBody @Validated RunAsPlanParam param) {
- simulationService.runAsPlan(simulationId, param);
- }
-
- /**
- * 重置仿真(新)
- */
- @PutMapping("/new/{simulationId}/reset")
- public void reset(@PathVariable String simulationId) {
- simulationService.reset(simulationId);
- Simulation simulation = simulationManager.getById(simulationId, Simulation.class);
- // 写在这里为了不与加载实训时冲突,如果写入reset方法,实训加载会多次处理,会有问题
- memberManager.loadExtraMembers(simulation, null);
- }
-
- /**
- * 根据地图和功能ID获取仿真GroupId
- *
- * @return 仿真GroupId
- */
- @GetMapping("/new/map/{mapId}/function/{functionId}")
- public String querySimulationByMapIdAndMapFunction(@PathVariable("mapId") long mapId
- , @PathVariable("functionId") long mapFunctionId) {
- return simulationService.querySimulationByMapIdAndMapFunction(mapId, mapFunctionId);
- }
-
- /**
- * 按组织查询存在的仿真(监管仿真)
- */
- @GetMapping("/supervise")
- public List listSimulationByOrg(
- @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO,
- SimulationInfoQueryVO queryVO) {
- return simulationService.listSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO);
- }
-
- /**
- * 分页,按组织查询存在的仿真(监管仿真)
- */
- @GetMapping("/paged/supervise")
- public PageVO pagedSuperviseSimulation(
- @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO,
- SimulationInfoQueryVO queryVO) {
- return simulationService.pagedSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO);
- }
-
- /**
- * 获取所有存在的仿真
- */
- @GetMapping("/list")
- public List queryInfo(SimulationInfoQueryVO queryVO) {
- List simulationList = this.simulationManager.getSimulationList();
- Stream stream = simulationList.stream();
- if (StringUtils.hasText(queryVO.getGroup())) {
- stream = stream.filter(simulation -> simulation.getId().contains(queryVO.getGroup()));
+ LoginUserInfoVO loginUserInfoVO) {
+ return simulationService.createSimulation(mapId, paramVO, loginUserInfoVO);
}
- if (StringUtils.hasText(queryVO.getUserName())) {
- stream = stream.filter(simulation -> simulation.getSimulationUsers().stream()
- .anyMatch(user -> user.getName().contains(queryVO.getUserName())));
+
+ /**
+ * 根据地图功能id创建仿真
+ */
+ @PostMapping("/new/mapFunction/{mapFunctionId}")
+ public String createSimulationByMapFunction(@PathVariable long mapFunctionId,
+ @RequestAttribute LoginUserInfoVO loginInfo) {
+ return simulationService.createSimulation(mapFunctionId, loginInfo, true).getId();
}
- return stream.map(Simulation::convertToVO).collect(Collectors.toList());
- }
- /**
- * 暂停
- */
- @PutMapping("/{id}/pause")
- public void pause(@PathVariable String id) {
- this.simulationManager.pause(id);
- }
+ /**
+ * 按计划行车(新)
+ */
+ @PostMapping("/new/{simulationId}/runAsPlan")
+ public void runAsPlanNew(@PathVariable String simulationId,
+ @RequestBody @Validated RunAsPlanParam param) {
+ simulationService.runAsPlan(simulationId, param);
+ }
- /**
- * 开始
- */
- @PutMapping("/{id}/start")
- public void start(@PathVariable String id) {
- this.simulationManager.start(id);
- }
+ /**
+ * 重置仿真(新)
+ */
+ @PutMapping("/new/{simulationId}/reset")
+ public void reset(@PathVariable String simulationId) {
+ simulationService.reset(simulationId);
+ Simulation simulation = simulationManager.getById(simulationId, Simulation.class);
+ // 写在这里为了不与加载实训时冲突,如果写入reset方法,实训加载会多次处理,会有问题
+ memberManager.loadExtraMembers(simulation, null);
+ }
- /**
- * 调整倍速
- */
- @PutMapping("/{id}/updateSpeed/{speed}")
- public void updateSpeed(@PathVariable String id, @PathVariable int speed) {
- this.simulationManager.updateSpeed(id, speed);
- }
+ /**
+ * 根据地图和功能ID获取仿真GroupId
+ *
+ * @return 仿真GroupId
+ */
+ @GetMapping("/new/map/{mapId}/function/{functionId}")
+ public String querySimulationByMapIdAndMapFunction(@PathVariable("mapId") long mapId
+ , @PathVariable("functionId") long mapFunctionId) {
+ return simulationService.querySimulationByMapIdAndMapFunction(mapId, mapFunctionId);
+ }
- /**
- * 获取仿真中所有仿真用户
- */
- @GetMapping("/{id}/users")
- public List getSimulationUsers(
- @PathVariable String id) {
- return this.simulationManager.getSimulationUsers(id).stream()
- .map(club.joylink.rtss.simulation.SimulationUser::convertToVO)
- .collect(Collectors.toList());
- }
+ /**
+ * 按组织查询存在的仿真(监管仿真)
+ */
+ @GetMapping("/supervise")
+ public List listSimulationByOrg(
+ @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO,
+ SimulationInfoQueryVO queryVO) {
+ return simulationService.listSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO);
+ }
- /**
- * 监控仿真
- */
- @PostMapping("/{simulationId}/monitor")
- public void monitor(@PathVariable String simulationId, @RequestAttribute AccountVO user) {
- simulationService.monitor(simulationId, user);
- }
+ /**
+ * 分页,按组织查询存在的仿真(监管仿真)
+ */
+ @GetMapping("/paged/supervise")
+ public PageVO pagedSuperviseSimulation(
+ @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO,
+ SimulationInfoQueryVO queryVO) {
+ return simulationService.pagedSimulationByOrg(loginUserInfoVO.getTopOrgId(), queryVO);
+ }
- /**
- * 查询"我"已加入的仿真
- */
- @GetMapping("/joined/by/me")
- public SimulationVO querySimulationJoinedByMe(@RequestAttribute LoginUserInfoVO loginInfo) {
- return simulationService.querySimulationJoinedByUser(loginInfo.getAccountVO().getId());
- }
+ /**
+ * 获取所有存在的仿真
+ */
+ @GetMapping("/list")
+ public List queryInfo(SimulationInfoQueryVO queryVO) {
+ List simulationList = this.simulationManager.getSimulationList();
+ Stream stream = simulationList.stream();
+ if (StringUtils.hasText(queryVO.getGroup())) {
+ stream = stream.filter(simulation -> simulation.getId().contains(queryVO.getGroup()));
+ }
+ if (StringUtils.hasText(queryVO.getUserName())) {
+ stream = stream.filter(simulation -> simulation.getSimulationUsers().stream()
+ .anyMatch(user -> user.getName().contains(queryVO.getUserName())));
+ }
+ return stream.map(Simulation::convertToVO).collect(Collectors.toList());
+ }
- @GetMapping("/{simulationId}/{memberId}/unreceivedMessages")
- public void sendUnreceivedMessages(@PathVariable String simulationId,
- @PathVariable String memberId) {
- simulationService.sendUnreceivedMessages(simulationId, memberId);
- }
+ /**
+ * 暂停
+ */
+ @PutMapping("/{id}/pause")
+ public void pause(@PathVariable String id) {
+ this.simulationManager.pause(id);
+ }
+
+ /**
+ * 开始
+ */
+ @PutMapping("/{id}/start")
+ public void start(@PathVariable String id) {
+ this.simulationManager.start(id);
+ }
+
+ /**
+ * 调整倍速
+ */
+ @PutMapping("/{id}/updateSpeed/{speed}")
+ public void updateSpeed(@PathVariable String id, @PathVariable int speed) {
+ this.simulationManager.updateSpeed(id, speed);
+ }
+
+ /**
+ * 获取仿真中所有仿真用户
+ */
+ @GetMapping("/{id}/users")
+ public List getSimulationUsers(
+ @PathVariable String id) {
+ return this.simulationManager.getSimulationUsers(id).stream()
+ .map(club.joylink.rtss.simulation.SimulationUser::convertToVO)
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * 监控仿真
+ */
+ @PostMapping("/{simulationId}/monitor")
+ public void monitor(@PathVariable String simulationId, @RequestAttribute AccountVO user) {
+ simulationService.monitor(simulationId, user);
+ }
+
+ /**
+ * 查询"我"已加入的仿真
+ */
+ @GetMapping("/joined/by/me")
+ public SimulationVO querySimulationJoinedByMe(@RequestAttribute LoginUserInfoVO loginInfo) {
+ return simulationService.querySimulationJoinedByUser(loginInfo.getAccountVO().getId());
+ }
+
+ @GetMapping("/{simulationId}/{memberId}/unreceivedMessages")
+ public void sendUnreceivedMessages(@PathVariable String simulationId,
+ @PathVariable String memberId) {
+ simulationService.sendUnreceivedMessages(simulationId, memberId);
+ }
}
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 5b4a29d8b..83d357341 100644
--- a/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java
+++ b/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java
@@ -1,8 +1,6 @@
package club.joylink.rtss.services.training2;
import club.joylink.rtss.constants.MapStatus;
-import club.joylink.rtss.constants.Project;
-import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.dao.MapInfoDAO;
import club.joylink.rtss.dao.PublishedTraining2DAO;
import club.joylink.rtss.dao.RtsMapFunctionDAO;
@@ -11,36 +9,29 @@ import club.joylink.rtss.entity.MapInfo;
import club.joylink.rtss.entity.MapInfoExample;
import club.joylink.rtss.entity.RtsMapFunction;
import club.joylink.rtss.entity.RtsMapFunctionExample;
-import club.joylink.rtss.entity.training2.*;
+import club.joylink.rtss.entity.training2.PublishedTraining2Example;
+import club.joylink.rtss.entity.training2.PublishedTraining2WithBLOBs;
+import club.joylink.rtss.entity.training2.RtsTraining2RuleExample;
+import club.joylink.rtss.entity.training2.RtsTraining2RuleWithBLOBs;
import club.joylink.rtss.services.mapFunction.RtsMapFunctionService;
import club.joylink.rtss.services.project.ProjectService;
import club.joylink.rtss.simulation.SimulationManager;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.SimulationService;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
-import club.joylink.rtss.simulation.cbtc.data.map.Route;
-import club.joylink.rtss.simulation.cbtc.data.map.Stand;
-import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.training2.ScoringRuleVO;
-import club.joylink.rtss.vo.project.ProjectVO;
-import club.joylink.rtss.vo.training2.rule.BgSceneStatusRule;
-import club.joylink.rtss.vo.training2.rule.MapLocationRule;
import club.joylink.rtss.vo.training2.rule.StepRule;
import club.joylink.rtss.vo.training2.rule.Training2Rule;
-import com.fasterxml.jackson.core.JsonParseException;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.BiConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.RequestAttribute;
-import org.springframework.web.bind.annotation.RequestBody;
import java.util.*;
-import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
@@ -85,7 +76,7 @@ public class Training2RuleService {
* @return 生成结果
*/
public List generateTrainingByRule(String groupId) {
- Simulation simulation = simulationManager.getById(groupId , Simulation.class);
+ Simulation simulation = simulationManager.getById(groupId, Simulation.class);
Long mapId = simulation.getBuildParams().getMap().getId();
if (runningMapIdSet.contains(mapId)) {
return Arrays.asList("该地图正在生成实训!");
@@ -131,7 +122,6 @@ public class Training2RuleService {
}
/**
- *
* @param mapId
* @param functionId
* @return
@@ -144,7 +134,7 @@ public class Training2RuleService {
/**
* 根据地图ID生成实训
*/
- public List generateTrainingByMapId(List mapIdList, LoginUserInfoVO loginUserInfoVO){
+ public List generateTrainingByMapId(List mapIdList, LoginUserInfoVO loginUserInfoVO) {
// 地图列表
MapInfoExample example = new MapInfoExample();
MapInfoExample.Criteria criteria = example.createCriteria().andStatusEqualTo(MapStatus.Online.getCode());
@@ -223,7 +213,7 @@ public class Training2RuleService {
List