diff --git a/src/main/java/club/joylink/rtss/services/UserExamService.java b/src/main/java/club/joylink/rtss/services/UserExamService.java index 68d4f2e6a..923bb7f7e 100644 --- a/src/main/java/club/joylink/rtss/services/UserExamService.java +++ b/src/main/java/club/joylink/rtss/services/UserExamService.java @@ -5,6 +5,7 @@ import club.joylink.rtss.dao.*; import club.joylink.rtss.entity.*; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.services.training.ITrainingV1Service; +import club.joylink.rtss.simulation.cbtc.GroupSimulationService; import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.client.*; import club.joylink.rtss.vo.client.training.TrainingResultVO; @@ -50,6 +51,9 @@ public class UserExamService implements IUserExamService { @Autowired private LsLessonDAO lessonDAO; + @Autowired + private GroupSimulationService groupSimulationService; + @Override @Transactional public UserExamVO generateExamInstance(long examId, UserVO userVO) { @@ -63,8 +67,9 @@ public class UserExamService implements IUserExamService { calendar.setTime(new Date()); calendar.add(Calendar.SECOND, examDef.getDuration()); LsLesson lesson = this.lessonDAO.selectByPrimaryKey(examDef.getLessonId()); - List examPermission = iUserPermissionService.getExamUserPermission(userVO, lesson.getMapId(), lesson.getPrdType(), lesson.getId()); - BusinessExceptionAssertEnum.SIMULATION_PERMISSION_NOT_AVAILABLE.assertCollectionNotEmpty(examPermission); + groupSimulationService.confirmHasPermission(userVO, lesson.getMapId(), lesson.getPrdType()); +// List examPermission = iUserPermissionService.getExamUserPermission(userVO, lesson.getMapId(), lesson.getPrdType(), lesson.getId()); +// BusinessExceptionAssertEnum.SIMULATION_PERMISSION_NOT_AVAILABLE.assertCollectionNotEmpty(examPermission); } // 判断是否在考试时间之内 if (examDef.getStartTime() != null) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationService.java index 51ea8b27e..1c34e46df 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationService.java @@ -276,5 +276,7 @@ public interface GroupSimulationService { void changePassengerFlow(String group, Long passengerFlowId); + void confirmHasPermission(UserVO userVO, Long mapId, String prdType); + boolean hasPermission(UserVO userVO, Long mapId, String prdType); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java index a2ecb8c12..79093c288 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/GroupSimulationServiceImpl.java @@ -952,7 +952,8 @@ public class GroupSimulationServiceImpl implements GroupSimulationService { /** * 确认该用户有权限进入该仿真 */ - private void confirmHasPermission(UserVO userVO, Long mapId, String prdType) { + @Override + public void confirmHasPermission(UserVO userVO, Long mapId, String prdType) { BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(hasPermission(userVO, mapId, prdType)); }