diff --git a/src/main/java/club/joylink/rtss/services/ExamService.java b/src/main/java/club/joylink/rtss/services/ExamService.java index c7af4c61a..82e84471c 100644 --- a/src/main/java/club/joylink/rtss/services/ExamService.java +++ b/src/main/java/club/joylink/rtss/services/ExamService.java @@ -4,6 +4,7 @@ import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.dao.*; import club.joylink.rtss.entity.*; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +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.company.DepartmentVO; @@ -60,6 +61,9 @@ public class ExamService implements IExamService{ @Autowired private IMapService iMapService; + @Autowired + private GroupSimulationService groupSimulationService; + /** * 创建考试定义 */ @@ -330,10 +334,10 @@ public class ExamService implements IExamService{ }); examsLessonVO.setExamDefinitionList(examDefinitionVOList); // 设置权限 -// List voList = userPermissionService.findTeachVOByMapIdAndUserId(lessonVO.getMapId(), userVO.getId()); - List examPermissions = this.iUserPermissionService.getExamUserPermission(userVO, - lessonVO.getMapId(), lessonVO.getPrdType(), lessonId); - examsLessonVO.setPermissionList(examPermissions); + examsLessonVO.setAvailable(groupSimulationService.hasPermission(userVO, lessonVO.getMapId(), lessonVO.getPrdType())); +// List examPermissions = this.iUserPermissionService.getExamUserPermission(userVO, +// lessonVO.getMapId(), lessonVO.getPrdType(), lessonId); +// examsLessonVO.setPermissionList(examPermissions); return examsLessonVO; } diff --git a/src/main/java/club/joylink/rtss/services/LessonService.java b/src/main/java/club/joylink/rtss/services/LessonService.java index c1a1b7b16..fd04e5252 100644 --- a/src/main/java/club/joylink/rtss/services/LessonService.java +++ b/src/main/java/club/joylink/rtss/services/LessonService.java @@ -110,7 +110,7 @@ public class LessonService implements ILessonService { trainingVOList = iTrainingV1Service.queryByIds(trainingIds); } // 查询权限 - boolean valid = groupSimulationService.hasPermission(userVO, lessonVO.getMapId(), null); + boolean valid = groupSimulationService.hasPermission(userVO, lessonVO.getMapId(), lessonVO.getPrdType()); // 生成tree lessonTreeVO.setTree(TreeNode.buildValidLessonTrainingTree(lessonVO, chapterVOList, trainingVOList, relVOList, valid)); // lessonTreeVO.setPermissionList(permissionVOList); diff --git a/src/main/java/club/joylink/rtss/vo/client/ExamsLessonVO.java b/src/main/java/club/joylink/rtss/vo/client/ExamsLessonVO.java index 4647baf08..9d82d9fe6 100644 --- a/src/main/java/club/joylink/rtss/vo/client/ExamsLessonVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/ExamsLessonVO.java @@ -75,6 +75,9 @@ public class ExamsLessonVO { private boolean systemFault; + /** 用户是否有权使用改考试 */ + private boolean available; + public ExamsLessonVO(LessonVO lessonVO) { this.id = lessonVO.getId(); this.name = lessonVO.getName();