This commit is contained in:
DU 2021-01-12 18:52:03 +08:00
commit 02078eb039
3 changed files with 12 additions and 5 deletions

View File

@ -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<UserPermissionVO> voList = userPermissionService.findTeachVOByMapIdAndUserId(lessonVO.getMapId(), userVO.getId());
List<UserPermissionVO> examPermissions = this.iUserPermissionService.getExamUserPermission(userVO,
lessonVO.getMapId(), lessonVO.getPrdType(), lessonId);
examsLessonVO.setPermissionList(examPermissions);
examsLessonVO.setAvailable(groupSimulationService.hasPermission(userVO, lessonVO.getMapId(), lessonVO.getPrdType()));
// List<UserPermissionVO> examPermissions = this.iUserPermissionService.getExamUserPermission(userVO,
// lessonVO.getMapId(), lessonVO.getPrdType(), lessonId);
// examsLessonVO.setPermissionList(examPermissions);
return examsLessonVO;
}

View File

@ -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);

View File

@ -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();