diff --git a/src/main/java/club/joylink/rtss/controller/publish/ExamController.java b/src/main/java/club/joylink/rtss/controller/publish/ExamController.java index 10dee6757..7c60196a2 100644 --- a/src/main/java/club/joylink/rtss/controller/publish/ExamController.java +++ b/src/main/java/club/joylink/rtss/controller/publish/ExamController.java @@ -64,8 +64,8 @@ public class ExamController { *查询试题列表信息 */ @GetMapping(path = "/list") - public PageVO queryExamInfoList(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) { - return iExamService.queryExamInfoList(queryVO, loginInfo); + public PageVO queryExamInfoList(ExamDefinitionQueryVO queryVO) { + return iExamService.queryExamInfoList(queryVO); } /** diff --git a/src/main/java/club/joylink/rtss/controller/publish/LessonController.java b/src/main/java/club/joylink/rtss/controller/publish/LessonController.java index a15964501..2cfee9f12 100644 --- a/src/main/java/club/joylink/rtss/controller/publish/LessonController.java +++ b/src/main/java/club/joylink/rtss/controller/publish/LessonController.java @@ -56,8 +56,8 @@ public class LessonController { * 根据条件获取课程列表 */ @GetMapping(path = "") - public List queryLessons(LessonQueryVO lessonQueryVO, @RequestAttribute LoginUserInfoVO loginInfo) { - return this.iLessonService.queryValidLessons(lessonQueryVO, loginInfo); + public List queryLessons(LessonQueryVO lessonQueryVO) { + return this.iLessonService.queryValidLessons(lessonQueryVO); } /** diff --git a/src/main/java/club/joylink/rtss/services/ExamService.java b/src/main/java/club/joylink/rtss/services/ExamService.java index 7d23f94d1..be301bd28 100644 --- a/src/main/java/club/joylink/rtss/services/ExamService.java +++ b/src/main/java/club/joylink/rtss/services/ExamService.java @@ -238,16 +238,14 @@ public class ExamService implements IExamService { * 查询试题列表信息 */ @Override - public PageVO queryExamInfoList(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo) { + public PageVO queryExamInfoList(ExamDefinitionQueryVO queryVO) { //查询试题列表 ExamDefinitionExample examDefinitionExample = new ExamDefinitionExample(); - examDefinitionExample.setOrderByClause(" create_time DESC "); ExamDefinitionExample.Criteria criteria = examDefinitionExample.createCriteria(); - ExamDefinitionExample.Criteria orCriteria = examDefinitionExample.createCriteria(); + examDefinitionExample.setOrderByClause(" create_time DESC "); //根据课程ID查询考试 if (Objects.nonNull(queryVO.getLessonId())) { criteria.andLessonIdEqualTo(queryVO.getLessonId()); - orCriteria.andLessonIdEqualTo(queryVO.getLessonId()); } else if (Objects.nonNull(queryVO.getMapId())) { // 地图id查询 List lessonList = this.iLessonService.queryValidLessonsOfMap(queryVO.getMapId()); @@ -256,7 +254,6 @@ public class ExamService implements IExamService { .map(LessonVO::getId) .collect(Collectors.toList()); criteria.andLessonIdIn(lessonIdList); - orCriteria.andLessonIdIn(lessonIdList); } else { // 返回null return new PageVO<>(); @@ -264,12 +261,10 @@ public class ExamService implements IExamService { } if (StringUtils.hasText(queryVO.getStatus())) { criteria.andStatusEqualTo(queryVO.getStatus()); - orCriteria.andStatusEqualTo(queryVO.getStatus()); } //根据考试名称模糊匹配 if (StringUtils.hasText(queryVO.getName())) { criteria.andNameLike(String.format("%%%s%%", queryVO.getName())); - orCriteria.andNameLike(String.format("%%%s%%", queryVO.getName())); } //根据创建人名称模糊匹配 if (StringUtils.hasText(queryVO.getCreatorName())) { @@ -282,16 +277,7 @@ public class ExamService implements IExamService { creatorIdList.add(null); } criteria.andCreatorIdIn(creatorIdList); - orCriteria.andCreatorIdIn(creatorIdList); } - //公开数据和组织内数据 - criteria.andOrgIdIsNull(); - Org topOrg = iOrgService.findTopOrgOfUser(loginInfo.getAccountVO().getId()); - if (topOrg != null) { - orCriteria.andOrgIdEqualTo(topOrg.getId()); - examDefinitionExample.or(orCriteria); - } - PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); Page examDefinitionList = (Page) examDefinitionDAO.selectByExample(examDefinitionExample); diff --git a/src/main/java/club/joylink/rtss/services/IExamService.java b/src/main/java/club/joylink/rtss/services/IExamService.java index c6be274bb..8bf7b3f0a 100644 --- a/src/main/java/club/joylink/rtss/services/IExamService.java +++ b/src/main/java/club/joylink/rtss/services/IExamService.java @@ -41,7 +41,7 @@ public interface IExamService { /** * 查询试题列表信息 */ - PageVO queryExamInfoList(ExamDefinitionQueryVO queryVO, LoginUserInfoVO loginInfo); + PageVO queryExamInfoList(ExamDefinitionQueryVO queryVO); /** * 删除指定ID的考试信息 diff --git a/src/main/java/club/joylink/rtss/services/ILessonService.java b/src/main/java/club/joylink/rtss/services/ILessonService.java index 5e64f7ea4..b9a00d0b8 100644 --- a/src/main/java/club/joylink/rtss/services/ILessonService.java +++ b/src/main/java/club/joylink/rtss/services/ILessonService.java @@ -1,5 +1,6 @@ package club.joylink.rtss.services; +import club.joylink.rtss.constants.Project; import club.joylink.rtss.entity.LsLesson; import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.LoginUserInfoVO; @@ -49,7 +50,7 @@ public interface ILessonService { /** * 查询有效的课程列表 */ - List queryValidLessons(LessonQueryVO lessonQueryVO, LoginUserInfoVO loginInfo); + List queryValidLessons(LessonQueryVO lessonQueryVO); /** * 分页查询已发布的课程 diff --git a/src/main/java/club/joylink/rtss/services/LessonService.java b/src/main/java/club/joylink/rtss/services/LessonService.java index 6831367ff..8a7b15721 100644 --- a/src/main/java/club/joylink/rtss/services/LessonService.java +++ b/src/main/java/club/joylink/rtss/services/LessonService.java @@ -253,27 +253,15 @@ public class LessonService implements ILessonService { return new LessonVO(lessonList.get(0)); } - /** - * 查询有效的、公开的、属于自己组织的数据 - */ @Override - public List queryValidLessons(LessonQueryVO lessonQueryVO, LoginUserInfoVO loginInfo) { + public List queryValidLessons(LessonQueryVO lessonQueryVO) { LsLessonExample example = new LsLessonExample(); example.setOrderByClause("id desc"); Criteria criteria = example.createCriteria() - .andStatusEqualTo(MapStatus.Online.getCode()) - .andOrgIdIsNull(); + .andStatusEqualTo(MapStatus.Online.getCode()); if (Objects.nonNull(lessonQueryVO.getMapId())) { criteria.andMapIdEqualTo(lessonQueryVO.getMapId()); } - Org topOrg = iOrgService.findTopOrgOfUser(loginInfo.getAccountVO().getId()); - if (topOrg != null) { - Criteria orCriteria = example.or().andStatusEqualTo(MapStatus.Online.getCode()) - .andOrgIdEqualTo(topOrg.getId()); - if (Objects.nonNull(lessonQueryVO.getMapId())) { - orCriteria.andMapIdEqualTo(lessonQueryVO.getMapId()); - } - } List list = this.lessonDAO.selectByExample(example); return LessonVO.convert(list); }