From 4c23708d1463e5b90a067b0426589d105179a624 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Tue, 12 Jan 2021 18:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=80=83=E8=AF=95=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/club/joylink/rtss/services/ExamService.java | 12 ++++++++---- .../club/joylink/rtss/services/LessonService.java | 2 +- .../club/joylink/rtss/vo/client/ExamsLessonVO.java | 3 +++ 3 files changed, 12 insertions(+), 5 deletions(-) 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();