From 7acaa6acbcdbbe016a20619902d1550c55edfc6f Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 29 Oct 2021 18:55:39 +0800 Subject: [PATCH] 测试版本 --- src/main/java/com/subsidy/controller/CourseDictController.java | 2 +- src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java | 2 +- src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 6 ++++++ src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java | 5 +++++ src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java | 11 +++++++++++ src/main/resources/mapper/CourseDictMapper.xml | 7 +------ 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/subsidy/controller/CourseDictController.java b/src/main/java/com/subsidy/controller/CourseDictController.java index 93b2728..e74f371 100644 --- a/src/main/java/com/subsidy/controller/CourseDictController.java +++ b/src/main/java/com/subsidy/controller/CourseDictController.java @@ -45,7 +45,7 @@ public class CourseDictController { } @PostMapping("queryCourses") - @ApiOperation("平台运营者--查询课程 pageSize pageNum companyId courseName categoryId courseType courseSource") + @ApiOperation("平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); diff --git a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java index 74a7907..4e424a0 100644 --- a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java +++ b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java @@ -19,7 +19,7 @@ public class QueryCoursesDTO { private String courseSource; - //private Long administerId; + private Long administerId; private Long companyId; diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 8f9bc16..a848866 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -164,6 +164,12 @@ public class AdministerServiceImpl extends ServiceImpl() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,queryCoursesDTO.getAdministerId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count > 0){ + queryCoursesDTO.setCompanyId(null); + } + return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); } diff --git a/src/main/resources/mapper/CourseDictMapper.xml b/src/main/resources/mapper/CourseDictMapper.xml index b3fe11d..00e3e7c 100644 --- a/src/main/resources/mapper/CourseDictMapper.xml +++ b/src/main/resources/mapper/CourseDictMapper.xml @@ -24,12 +24,7 @@ left join category t2 on t.category_id = t2.id WHERE t.delete_date IS NULL - - and t.company_id is null - - - and t.company_id = #{companyId} - + and t.company_id is null AND t.category_id = #{categoryId} -- libgit2 0.25.0