From 029e536c816dc24858a74529ed3534b80d15f612 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 3 Feb 2023 16:08:30 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E3=80=90=E5=A4=A7=E9=93=81=E8=BF=9B?= =?UTF-8?q?=E8=B7=AF=E5=BC=80=E4=BF=A1=E5=8F=B7=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/CI/data/StationDirection.java | 11 +++++++ .../cbtc/CI/device/CiRouteService.java | 4 ++- .../simulation/cbtc/CI/device/CiService.java | 31 +++++++++++-------- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java index 7b25b1e0e..85919ab08 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java @@ -475,6 +475,17 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable { && this.assistTime.plusSeconds(DEFAULT_DURATION_TIME).isBefore(currentDateTime); } + /** + * 获取自动出入口电路方向 + */ + public boolean currentRight() { + if (this.changeDirectionStatus) { // 改方状态 + return !this.right; + } else { // 当前默认状态 + return this.right; + } + } + /** * 设置默认属性 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java index f1f24ac4f..6a95b4c27 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java @@ -376,7 +376,9 @@ public class CiRouteService { // 进路道岔解锁 route.getSwitchList().forEach(aSwitch -> aSwitch.getASwitch().routeUnlock(route)); // 进路侧防解锁 - route.getFlsList().forEach(RouteFls::unlock); + if (!CollectionUtils.isEmpty(route.getFlsList())) { + route.getFlsList().forEach(RouteFls::unlock); + } // // 进路区段取消锁闭 // List
sectionList = route.getSectionList(); // for (Section section : sectionList) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java index cfe5dd7b1..c5c5e1c22 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java @@ -10,6 +10,8 @@ import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.Optional; @Slf4j @Component @@ -177,19 +179,22 @@ public class CiService { return level; // 大铁情况下做判断 if (simulation.getRepository().getConfig().isRailway() && !route.isShutting()) { - // 如果当前进路在列表中不存在,则信号灯不开放 - boolean isCanHandle = simulation.getRepository().getStationList().stream() - .filter(station -> station.getCode().equals(route.getStart().getStation().getCode()) - || station.getCode().equals(route.getDestination().getStation().getCode())) - .anyMatch(station -> { - Map stationDirectionMap = station.getStationDirectionMap(); - if (CollectionUtils.isEmpty(stationDirectionMap)) { - return true; - } - return stationDirectionMap.values().stream() - .filter(stationDirection -> !CollectionUtils.isEmpty(stationDirection.getCurrentRouteList())) - .anyMatch(stationDirection -> stationDirection.getCurrentRouteList().contains(route)); - }); + Map stationDirectionMap = route.getStart().getStation().getStationDirectionMap(); + // 无出入口数据为空时,不做判断 + boolean isCanHandle = stationDirectionMap.isEmpty(); + if (!isCanHandle) { + Optional stationDirectionOptional = stationDirectionMap.values().stream() + .filter(stationDirection -> Objects.equals(stationDirection.getSignal(), route.getStart()) + || Objects.equals(stationDirection.getSignal(), route.getDestination())) + .findFirst(); + if (stationDirectionOptional.isPresent()) { + StationDirection stationDirection = stationDirectionOptional.get(); + // 如果当前进路在列表中不存在,则信号灯不开放 + isCanHandle = Objects.equals(stationDirection.currentRight(), route.isRight()) + && (stationDirection.getChangeDirectionTime() == null || route.getSettingStartTime().isAfter(stationDirection.getChangeDirectionTime())) + && stationDirection.getCurrentRouteList().contains(route); + } + } if (!isCanHandle) { return level; } From 64a3b33c6c7ee5a88dbf7fc011906faa56b1a931 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 6 Feb 2023 09:33:56 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E3=80=90=E5=A4=84=E7=90=86=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E7=8A=B6=E6=80=81=E4=BF=A1=E5=8F=B7=E6=9C=BA=E4=B8=8D?= =?UTF-8?q?=E5=BC=80=E7=81=AF=E7=8A=B6=E6=80=81=EF=BC=88=E5=A4=A7=E9=93=81?= =?UTF-8?q?=EF=BC=89=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/CI/data/StationDirection.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java index 85919ab08..896e4a473 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java @@ -479,10 +479,16 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable { * 获取自动出入口电路方向 */ public boolean currentRight() { - if (this.changeDirectionStatus) { // 改方状态 - return !this.right; - } else { // 当前默认状态 - return this.right; + if (DirectionRunModel.A.equals(this.runModel)) { + if (assistReadyStatus) { // 辅助模式 + return this.currentRouteList.stream().anyMatch(Route::isRight); + } else if (this.changeDirectionStatus) { // 改方状态 + return !this.right; + } else { // 当前默认状态 + return this.right; + } + } else { + return this.currentRouteList.stream().anyMatch(Route::isRight); } } From efb84016931e5b0e70972cd1768e7f4d0d0d546a Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 7 Feb 2023 14:07:58 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E3=80=90=E7=B0=BF=E5=86=8C=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E5=AE=9E=E8=AE=AD=E5=BA=8F=E5=88=97=E5=8C=96=E5=A4=84?= =?UTF-8?q?=E7=90=86=E3=80=91=E3=80=90=E5=8A=9E=E7=90=86=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E5=8D=8A=E9=97=AD=E5=A1=9E=E6=97=B6=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E6=8A=A5=E9=94=99=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/CI/data/StationDirection.java | 5 +- .../CTC/data/book/ControlFloodSignInfo.java | 9 ++++ .../data/book/EquipmentConstructionInfo.java | 6 +++ .../CTC/data/book/KeyLinkControlInfo.java | 10 +++- .../CTC/data/book/SupervisorHandOverInfo.java | 6 +++ .../StorageSimulationCtcDataRepository.java | 46 +++++++++++++++++++ 6 files changed, 80 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java index 896e4a473..fe982818b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java @@ -478,7 +478,10 @@ public class StationDirection extends MayOutOfOrderDevice implements Cloneable { /** * 获取自动出入口电路方向 */ - public boolean currentRight() { + public Boolean currentRight() { + if (CollectionUtils.isEmpty(this.currentRouteList)) { + return null; + } if (DirectionRunModel.A.equals(this.runModel)) { if (assistReadyStatus) { // 辅助模式 return this.currentRouteList.stream().anyMatch(Route::isRight); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/ControlFloodSignInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/ControlFloodSignInfo.java index caccb661e..1b2e243d1 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/ControlFloodSignInfo.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/ControlFloodSignInfo.java @@ -68,6 +68,15 @@ public class ControlFloodSignInfo { return stationDetailInfoMap.getOrDefault(stationCode, new LinkedList<>()); } + /** + * 获取所有信息 + */ + public List getAllDetailInfo() { + List allList = new LinkedList<>(); + stationDetailInfoMap.forEach((k, v) -> allList.addAll(v)); + return allList; + } + /** * 详情信息 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java index f123f5d56..222c92079 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java @@ -48,6 +48,12 @@ public class EquipmentConstructionInfo { return stationDetailInfoMap.getOrDefault(stationCode, new LinkedList<>()); } + public List getAllDetailInfo() { + List allList = new LinkedList<>(); + stationDetailInfoMap.forEach((k, v) -> allList.addAll(v)); + return allList; + } + /** * 施工登记信息 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java index 1a29e1303..dbe90e7e6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java @@ -5,7 +5,6 @@ import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import org.springframework.util.CollectionUtils; -import org.springframework.util.IdGenerator; import org.springframework.util.StringUtils; import java.util.*; @@ -70,6 +69,15 @@ public class KeyLinkControlInfo { return stationDetailInfoMap.getOrDefault(stationCode, new LinkedList<>()); } + /** + * 获取全量信息 + */ + public List getAllDetailInfo() { + List allDetailList = new LinkedList<>(); + stationDetailInfoMap.forEach((k, v) -> allDetailList.addAll(v)); + return allDetailList; + } + /** * 表详情 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java index 2c0d94694..e7dfd41c8 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java @@ -53,6 +53,12 @@ public class SupervisorHandOverInfo { return handOverDetailInfoMap.get(stationCode).stream().filter(d -> Objects.equals(clsType, d.getType())).collect(Collectors.toList()); } + public List getAllDetailInfo(){ + List allList = new LinkedList<>(); + handOverDetailInfoMap.forEach((k, v) -> allList.addAll(v)); + return allList; + } + /** * 一些公共属性 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/ctc/StorageSimulationCtcDataRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/ctc/StorageSimulationCtcDataRepository.java index 3ee0368a0..41d997194 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/ctc/StorageSimulationCtcDataRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/ctc/StorageSimulationCtcDataRepository.java @@ -2,12 +2,18 @@ package club.joylink.rtss.simulation.cbtc.data.storage.ctc; import club.joylink.rtss.simulation.cbtc.CTC.data.CtcRepository; import club.joylink.rtss.simulation.cbtc.CTC.data.Ticket; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.ControlFloodSignInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.EquipmentConstructionInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.SupervisorHandOverInfo; import club.joylink.rtss.simulation.cbtc.Simulation; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import org.springframework.util.CollectionUtils; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -71,6 +77,26 @@ public class StorageSimulationCtcDataRepository { */ private StorageDisCmdDb storageDisCmdDb; + /** + * 非正常情况接发列车关键环节控制表 + */ + private List keyLinkControlInfo; + + /** + * 行车设备施工登记簿 + */ + private List equipmentConstructionInfo; + + /** + * 交接班记录登记薄 + */ + private List supervisorHandOverInfo; + + /** + * 防洪安全上岗签到表 + */ + private List controlFloodSignInfo; + /** * 保存剧本数据 * @@ -113,6 +139,14 @@ public class StorageSimulationCtcDataRepository { } // 调度命令 this.storageDisCmdDb = StorageDisCmdDb.convert2Storage(repository.getDisCmdDb()); + // 非正常情况接发列车关键环节控制表 + this.keyLinkControlInfo = repository.getKeyLinkControlInfo().getAllDetailInfo(); + // 行车设备施工登记簿 + this.equipmentConstructionInfo = repository.getEquipmentConstructionInfo().getAllDetailInfo(); + // 交接班记录登记薄 + this.supervisorHandOverInfo = repository.getSupervisorHandOverInfo().getAllDetailInfo(); + // 防洪安全上岗签到表 + this.controlFloodSignInfo = repository.getControlFloodSignInfo().getAllDetailInfo(); } /** @@ -168,6 +202,18 @@ public class StorageSimulationCtcDataRepository { if (this.storageDisCmdDb != null) { this.storageDisCmdDb.convert(repository.getDisCmdDb()); } + if (!CollectionUtils.isEmpty(this.keyLinkControlInfo)) { + this.keyLinkControlInfo.forEach(detailInfo -> repository.getKeyLinkControlInfo().saveDetailInfo(detailInfo)); + } + if (!CollectionUtils.isEmpty(this.equipmentConstructionInfo)) { + this.equipmentConstructionInfo.forEach(detailInfo -> repository.getEquipmentConstructionInfo().saveDetailInfo(detailInfo)); + } + if (!CollectionUtils.isEmpty(this.supervisorHandOverInfo)) { + this.supervisorHandOverInfo.forEach(detailInfo -> repository.getSupervisorHandOverInfo().saveDetailInfo(detailInfo)); + } + if (!CollectionUtils.isEmpty(this.controlFloodSignInfo)) { + this.controlFloodSignInfo.forEach(detailInfo -> repository.getControlFloodSignInfo().saveDetailInfo(detailInfo)); + } } public boolean isNotEmpty() { From fb6b81c56f1be8969417a25bda17eb50f26201bc Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 7 Feb 2023 14:52:50 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E3=80=90=E7=94=9F=E6=88=90=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E5=88=9B=E5=BB=BA=E4=BB=BF=E7=9C=9F=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=9D=83=E9=99=90=E6=A3=80=E6=9F=A5=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/training2/Training2RuleService.java | 4 ++-- .../rtss/simulation/cbtc/SimulationService.java | 10 +++++++++- .../rtss/simulation/cbtc/SimulationServiceImpl.java | 6 ++++-- 3 files changed, 15 insertions(+), 5 deletions(-) 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 dd523955c..2480add4d 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java @@ -246,7 +246,7 @@ public class Training2RuleService { // 需要删除的列表 List delTrainingIdList = publishedTraining2DAO.selectTrainingIdByRuleNameAndMapId(ruleNameMapList, k); try { - Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO); + Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO, false); errorMsgList.addAll(generateTraining(simulation, ruleList, delTrainingIdList, delPublishTrainingByIds)); } catch (Exception e) { log.error("创建仿真失败", e); @@ -272,7 +272,7 @@ public class Training2RuleService { List entities = getRtsMapFunctions(mapInfo.getId()); if (!CollectionUtils.isEmpty(entities) && !CollectionUtils.isEmpty(lineCodeRuleMap.get(mapInfo.getLineCode()))) { try { - Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO); + Simulation simulation = simulationService.createSimulationPojo(entities.get(0).getId(), loginUserInfoVO, false); if (CollectionUtils.isEmpty(deleteTrainingIdMap)) { errorMsgList.addAll(generateTraining(simulation, lineCodeRuleMap.get(mapInfo.getLineCode()), null, delPublishTrainingByMapId)); } else { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationService.java index e2597389d..fdb8b6780 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationService.java @@ -61,7 +61,15 @@ public interface SimulationService { Simulation createSimulationPojo(long mapId, Long mapFunctionId, SimulationWorkParamVO workParamVO, @NonNull LoginUserInfoVO loginUserInfoVO); - Simulation createSimulationPojo(Long mapFunctionId, LoginUserInfoVO loginInfo); + /** + * 后台创建仿真 + * + * @param mapFunctionId mapFunctionId 功能ID + * @param loginInfo 登录信息 + * @param checkAuth 是否检查权限 + * @return 仿真对象 + */ + Simulation createSimulationPojo(Long mapFunctionId, LoginUserInfoVO loginInfo, boolean checkAuth); void loadDraftRunPlan(String simulationId, long draftRunPlanId); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java index de9f8e0f2..dbee49ac6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/SimulationServiceImpl.java @@ -261,10 +261,12 @@ public class SimulationServiceImpl implements SimulationService { } @Override - public Simulation createSimulationPojo(Long mapFunctionId, LoginUserInfoVO loginInfo) { + public Simulation createSimulationPojo(Long mapFunctionId, LoginUserInfoVO loginInfo, boolean checkAuth) { RtsMapFunctionVO rtsMapFunctionVO = rtsMapFunctionService.get(mapFunctionId); Long mapId = rtsMapFunctionVO.getMapId(); - this.checkUserPermission(rtsMapFunctionVO,loginInfo); + if (checkAuth) { + this.checkUserPermission(rtsMapFunctionVO,loginInfo); + } SimulationWorkParamVO workParamVO = rtsMapFunctionVO.getParamVO(); if (workParamVO.containsRealDeviceItem()) { From 296e1fb4f82fb6bccfe1f030f627ce16ef8ef961 Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Tue, 7 Feb 2023 16:49:05 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BB=BF=E7=9C=9F=E9=89=B4=E6=9D=83?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E9=87=8F=EF=BC=8C=E8=80=83=E8=AF=95?= =?UTF-8?q?=E5=AF=B9=E5=8D=95=E6=93=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20230206-zhou.sql | 12 ++ .../permission2/DistributeController.java | 2 +- .../simulation/SimulationV1Controller.java | 3 +- .../dao/permission/PermissionSubjectDAO.java | 2 +- .../RtsPermissionDistributeRefDAO.java | 13 +- .../rtss/entity/paper/PaperUserQuestion.java | 10 ++ .../paper/PaperUserQuestionExample.java | 120 ++++++++++++++++++ .../paper/PaperUserCreateService.java | 46 ++++--- .../rtss/services/paper/PaperUserService.java | 32 +++-- .../paper/PaperUserSubmitAnswerService.java | 79 ++++++++++-- .../permission/DistributeService.java | 7 +- .../permission/IDistributeService.java | 3 +- .../rtss/simulation/SimulationManager.java | 21 +++ .../rtss/simulation/cbtc/Simulation.java | 7 + .../simulation/cbtc/SimulationService.java | 5 +- .../cbtc/SimulationServiceImpl.java | 56 ++++++-- .../joylink/rtss/vo/paper/PaperQType.java | 1 + .../rtss/vo/paper/PaperQuestionState.java | 4 + .../rtss/vo/paper/PaperSubmitAnswerReqVo.java | 10 +- .../rtss/vo/paper/PaperTrainAnswerDetail.java | 36 ++++++ .../rtss/vo/paper/PaperUserQuestionVo.java | 6 + .../joylink/rtss/vo/paper/TrainAnswerVO.java | 15 +++ .../convertor/PaperUserQuestionConvertor.java | 3 + .../vo/permission/PermissionRefParamVO.java | 27 ++++ .../permission/PermissionSubjectTypeEnum.java | 2 + .../PermissionDistributeConvertor.java | 2 + .../mapper/paper/PaperUserQuestionDAO.xml | 54 +++++--- .../paper/PaperApiTestController.java | 8 +- 28 files changed, 501 insertions(+), 85 deletions(-) create mode 100644 sql/20230206-zhou.sql create mode 100644 src/main/java/club/joylink/rtss/vo/paper/PaperTrainAnswerDetail.java create mode 100644 src/main/java/club/joylink/rtss/vo/paper/TrainAnswerVO.java create mode 100644 src/main/java/club/joylink/rtss/vo/permission/PermissionRefParamVO.java diff --git a/sql/20230206-zhou.sql b/sql/20230206-zhou.sql new file mode 100644 index 000000000..41a5d78e4 --- /dev/null +++ b/sql/20230206-zhou.sql @@ -0,0 +1,12 @@ +-- 用户答题生成对应的规则id +ALTER TABLE `rts_paper_user_question` + ADD COLUMN `rule_id` bigint not NULL COMMENT '试卷规则rts_paper_rule的id' AFTER `pu_id`; + + +ALTER TABLE `rts_paper_user_question` + ADD COLUMN `sub_type` bigint not NULL COMMENT '规则类型:理论题(1-单选题,2-多选题,3-判断题);实训题(4-单操实训,5-场景实训)' AFTER `type`; + + +ALTER TABLE `rts_paper_user_question` MODIFY COLUMN tmp_answer VARCHAR(1000); + + diff --git a/src/main/java/club/joylink/rtss/controller/permission2/DistributeController.java b/src/main/java/club/joylink/rtss/controller/permission2/DistributeController.java index 8a2f3d597..93c329828 100644 --- a/src/main/java/club/joylink/rtss/controller/permission2/DistributeController.java +++ b/src/main/java/club/joylink/rtss/controller/permission2/DistributeController.java @@ -62,7 +62,7 @@ public class DistributeController { * 从权限分发,直接分发给指定主体 * * @param pdId 权限分发id - * @param subjectType 主体类型,其值为(user,org),user-一般用户,org-组织 + * @param subjectType 主体类型,其值为(user,org,project),user-一般用户,org-组织,project - 项目 * */ @PostMapping("/{pdId}/to/{subjectType}/{subjectId}") 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 7e9ca7d1c..4f69cff38 100644 --- a/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java +++ b/src/main/java/club/joylink/rtss/controller/simulation/SimulationV1Controller.java @@ -512,12 +512,13 @@ public class SimulationV1Controller { /** * 仿真创建接口(新) */ + /*@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创建仿真 diff --git a/src/main/java/club/joylink/rtss/dao/permission/PermissionSubjectDAO.java b/src/main/java/club/joylink/rtss/dao/permission/PermissionSubjectDAO.java index 6ca708e04..ebd90cf98 100644 --- a/src/main/java/club/joylink/rtss/dao/permission/PermissionSubjectDAO.java +++ b/src/main/java/club/joylink/rtss/dao/permission/PermissionSubjectDAO.java @@ -34,7 +34,7 @@ public interface PermissionSubjectDAO { " and (C.id = #{orgId} or B.id = #{userId} or E.code = #{projectCode}) " + " and A.status = #{status}" + "") - List findPermissionWithMapIdAndUserInfo(/*@Param("mapId") Long mapId,*/@Param("orgId") Long orgId,@Param("userId") Long userId,@Param("status") Integer status,@Param("projectCode") String projectCode); + List findPermissionWithMapIdAndUserInfo(/*@Param("mapId") Long mapId,*/@Param("orgId") Long orgId,@Param("userId") Long userId,@Param("status") Integer status,@Param("projectCode") String projectCode); @Select("") + List selectByDistributeIdAndPermissionId(@Param("list") List refList);*/ + @Select("