浏览代码

Merge remote-tracking branch 'origin/saas' into saas

yanite 3 年之前
父节点
当前提交
a70942ae4d
共有 55 个文件被更改,包括 315 次插入1415 次删除
  1. 4 17
      mec-web/src/main/java/com/ym/mec/web/controller/ActivityPlanController.java
  2. 5 5
      mec-web/src/main/java/com/ym/mec/web/controller/AdapayController.java
  3. 3 16
      mec-web/src/main/java/com/ym/mec/web/controller/ChildrenReserveController.java
  4. 3 12
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  5. 3 16
      mec-web/src/main/java/com/ym/mec/web/controller/CooperationOrganController.java
  6. 4 40
      mec-web/src/main/java/com/ym/mec/web/controller/CourseReviewController.java
  7. 3 18
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  8. 7 18
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java
  9. 3 18
      mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java
  10. 5 14
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  11. 60 340
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  12. 3 12
      mec-web/src/main/java/com/ym/mec/web/controller/ExtracurricularExercisesController.java
  13. 3 17
      mec-web/src/main/java/com/ym/mec/web/controller/ExtracurricularExercisesReplyController.java
  14. 3 18
      mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java
  15. 3 10
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  16. 12 71
      mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java
  17. 3 16
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java
  18. 7 16
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java
  19. 3 12
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java
  20. 4 23
      mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java
  21. 2 24
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java
  22. 1 13
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java
  23. 4 26
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java
  24. 6 23
      mec-web/src/main/java/com/ym/mec/web/controller/OperatingReportController.java
  25. 3 12
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCloudTeacherFeeController.java
  26. 8 34
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  27. 5 23
      mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentActivityController.java
  28. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentCooperationController.java
  29. 6 23
      mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java
  30. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/SellOrderController.java
  31. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java
  32. 5 13
      mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java
  33. 3 12
      mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java
  34. 6 19
      mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java
  35. 17 75
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  36. 11 56
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java
  37. 5 23
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java
  38. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRechargeController.java
  39. 4 20
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  40. 6 23
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRepairController.java
  41. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java
  42. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/SubjectChangeController.java
  43. 6 23
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreCategoriesController.java
  44. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java
  45. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/SysUserCashAccountLogController.java
  46. 0 2
      mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java
  47. 6 23
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java
  48. 8 45
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java
  49. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseRewardController.java
  50. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseStatisticsController.java
  51. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherSalaryComplaintsController.java
  52. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java
  53. 6 26
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java
  54. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/VisitController.java
  55. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/WebCourseHomeworkController.java

+ 4 - 17
mec-web/src/main/java/com/ym/mec/web/controller/ActivityPlanController.java

@@ -2,22 +2,19 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.ActivityPlanAddDto;
 import com.ym.mec.biz.dal.entity.ActivityPlan;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.ActivityPlanQueryInfo;
 import com.ym.mec.biz.service.ActivityPlanService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
-import java.util.Arrays;
-import java.util.List;
+
 import java.util.Objects;
 
 @Api(tags = "活动方案")
@@ -30,7 +27,7 @@ public class ActivityPlanController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
     @ApiOperation(value = "新增活动方案")
     @PostMapping("/addVipGroupActivity")
@@ -66,17 +63,7 @@ public class ActivityPlanController extends BaseController {
         if(sysUser == null){
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(activityPlanService.queryPage(queryInfo));
     }
 

+ 5 - 5
mec-web/src/main/java/com/ym/mec/web/controller/AdapayController.java

@@ -1,16 +1,15 @@
 package com.ym.mec.web.controller;
 
 import com.alibaba.fastjson.JSONArray;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.entity.HfMember;
 import com.ym.mec.biz.dal.page.HfMemberQueryInfo;
 import com.ym.mec.biz.service.HfMemberService;
+import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.CorpMember;
-import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.thirdparty.adapay.Payment;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
@@ -29,7 +28,10 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 @RequestMapping("adapay")
 @Api(tags = "汇付服务")
@@ -38,8 +40,6 @@ public class AdapayController extends BaseController {
 
     @Autowired
     private HfMemberService hfMemberService;
-    @Autowired
-    private SysConfigDao sysConfigDao;
 
     @Value("${spring.profiles.active:dev}")
     private String profiles;

+ 3 - 16
mec-web/src/main/java/com/ym/mec/web/controller/ChildrenReserveController.java

@@ -2,24 +2,21 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.ChildrenDayMsgDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDetailDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.ChildrenReserveQueryInfo;
 import com.ym.mec.biz.service.ChildrenDayReserveService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.List;
 
 @RequestMapping("childrenReserve")
@@ -32,7 +29,7 @@ public class ChildrenReserveController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "21年暑期考级活动统计列表页面")
     @GetMapping("/queryStatisticsPage")
@@ -42,17 +39,7 @@ public class ChildrenReserveController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(childrenDayReserveService.queryStatisticsPage(queryInfo));
     }
 

+ 3 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -57,7 +58,7 @@ public class ClassGroupController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询班级列表")
     @GetMapping("/queryPage")
@@ -327,17 +328,7 @@ public class ClassGroupController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        }else if(org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         return succeed(classGroupService.queryClassGroupPage(queryInfo));
     }
 

+ 3 - 16
mec-web/src/main/java/com/ym/mec/web/controller/CooperationOrganController.java

@@ -2,23 +2,20 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.page.CooperationOrganQueryInfo;
 import com.ym.mec.biz.service.CooperationOrganService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
@@ -30,7 +27,7 @@ public class CooperationOrganController extends BaseController {
     @Autowired
     private CooperationOrganService cooperationOrganService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
 
@@ -74,17 +71,7 @@ public class CooperationOrganController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(cooperationOrganService.queryPage(queryInfo));
     }
 

+ 4 - 40
mec-web/src/main/java/com/ym/mec/web/controller/CourseReviewController.java

@@ -2,33 +2,19 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.dto.CourseReviewDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.CourseReviewQueryInfo;
-import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
 import com.ym.mec.biz.service.CourseReviewService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.util.date.DateUtil;
-import com.ym.mec.util.excel.POIUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletResponse;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
 @RequestMapping("courseReview")
 @Api(tags = "课程评价")
 @RestController
@@ -36,10 +22,8 @@ public class CourseReviewController extends BaseController {
 
     @Autowired
     private SysUserFeignService sysUserFeignService;
-
     @Autowired
-    private EmployeeDao employeeDao;
-
+    private OrganizationService organizationService;
     @Autowired
     private CourseReviewService courseReviewService;
 
@@ -52,17 +36,7 @@ public class CourseReviewController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(courseReviewService.findPracticeGroupReviews(queryInfo));
     }
 
@@ -88,17 +62,7 @@ public class CourseReviewController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(courseReviewService.getVipCourseReviews(queryInfo));
     }
 

+ 3 - 18
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -13,10 +13,7 @@ import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
-import com.ym.mec.biz.service.CourseScheduleComplaintsService;
-import com.ym.mec.biz.service.CourseScheduleService;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.StudentAttendanceService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -58,12 +55,10 @@ public class CourseScheduleController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private MusicGroupService musicGroupService;
-    
     @Autowired
     private ClassGroupDao classGroupDao;
-    
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private VipGroupDao vipGroupDao;
 
@@ -82,17 +77,7 @@ public class CourseScheduleController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        }else if(org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         return succeed(courseScheduleService.endFindCourseSchedules(queryInfo));
     }
 

+ 7 - 18
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java

@@ -3,14 +3,12 @@ package com.ym.mec.web.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.TeacherAttendancesDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.TeacherSalaryConfirmStatus;
 import com.ym.mec.biz.dal.page.CourseSalaryQueryInfo4Web;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
-import com.ym.mec.biz.service.VipGroupService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -22,7 +20,10 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 @RequestMapping("courseScheduleTeacherSalary")
 @Api(tags = "教师薪酬服务")
@@ -34,11 +35,9 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
     @Autowired
     private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
     @Autowired
-    private VipGroupService vipGroupService;
-    @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询教师薪酬列表")
     @GetMapping("/queryPage")
@@ -55,17 +54,7 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-                throw new BizException("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    throw new BizException("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
 
         Map<String, Object> result=new HashMap<>();
         result.put("pageInfo", courseScheduleTeacherSalaryService.findIsSettlementCourseSalarys(queryInfo));

+ 3 - 18
mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java

@@ -3,24 +3,19 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.DegreeQueryInfo;
 import com.ym.mec.biz.service.DegreeRegistrationService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
-import java.util.List;
-
 @RequestMapping("degree")
 @Api(tags = "考级报名服务")
 @RestController
@@ -29,7 +24,7 @@ public class DegreeController extends BaseController { ;
     @Autowired
     private DegreeRegistrationService degreeRegistrationService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
 
@@ -42,17 +37,7 @@ public class DegreeController extends BaseController { ;
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setSort("create_time_");
         queryInfo.setOrder("DESC");
         return succeed(degreeRegistrationService.getPageList(queryInfo));

+ 5 - 14
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -14,17 +14,18 @@ import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * @Author Joburgess
@@ -54,17 +55,7 @@ public class EmployeeController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(employeeService.queryEmployByOrganId(queryInfo));
     }
 

+ 60 - 340
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -58,7 +58,7 @@ public class ExportController extends BaseController {
     @Autowired
     private EmployeeService employeeService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private VipGroupDao vipGroupDao;
     @Autowired
@@ -144,8 +144,6 @@ public class ExportController extends BaseController {
     @Autowired
     private StudentService studentService;
     @Autowired
-    private OrganizationService organizationService;
-    @Autowired
     private MusicEnlightenmentQuestionnaireService musicEnlightenmentQuestionnaireService;
     @Autowired
     private MusicGroupService musicGroupService;
@@ -160,17 +158,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<SysUserCashAccountLog> rows = sysUserCashAccountLogService.queryPage(queryInfo).getRows();
@@ -211,17 +199,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<MusicGroup> rows = musicGroupService.queryMusicGroupPage(queryInfo).getRows();
@@ -263,17 +241,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<ChildrenStatisticsDetailDto> rows = childrenDayReserveService.exportStatisticsDetail(queryInfo);
@@ -386,18 +354,8 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
-       List<SysUserCashAccountDetail> cashAccountDetails = sysUserCashAccountDetailDao.exportDetail(queryInfo);
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        List<SysUserCashAccountDetail> cashAccountDetails = sysUserCashAccountDetailDao.exportDetail(queryInfo);
        if(cashAccountDetails.size() < 1){
            throw new BizException("没有可导出数据");
        }
@@ -438,17 +396,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<SysUserCoursesAccountDetail> coursesAccountDetails = sysUserCoursesAccountDetailDao.exportDetail(queryInfo);
         if(coursesAccountDetails.size() < 1){
             throw new BizException("没有可导出数据");
@@ -492,17 +440,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         List<ClassGroupTeachersDto> rows = classGroupService.queryClassGroupPage(queryInfo).getRows();
         for (ClassGroupTeachersDto row : rows) {
             List<ClassGroupTeacherMapper> classGroupTeacherMapperList = row.getClassGroupTeacherMapperList();
@@ -590,17 +528,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<ExportVipGroupActivityDto> rows = vipGroupActivityService.exportVipGroupActivity(queryInfo);
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -639,17 +567,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<ExportStudentAttendanceDto> rows = studentAttendanceService.exportStudentAttendancesQueryPage(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -719,17 +637,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<MusicGroupPaymentCalenderAuditDto> rows = musicGroupPaymentCalenderService.auditList(queryInfo).getRows();
@@ -768,17 +676,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List rows = teacherAttendanceService.queryTeacherAttendances(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -814,17 +712,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<TeacherSalaryComplaints> rows = teacherSalaryComplaintsService.queryPage(queryInfo).getRows();
@@ -863,17 +751,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<StudentBuyPracticeDto> rows = practiceGroupService.studentBuys(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -988,17 +866,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         Date endTime = queryInfo.getEndTime();
         if (endTime != null) {
             queryInfo.setEndTime(DateUtil.addDays(endTime, 1));
@@ -1039,17 +907,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setIsExport(true);
         List<StudentManageListDto> rows = studentManageService.findStudentsByOrganId(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
@@ -1093,17 +951,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<PracticeGroupDto> rows = practiceGroupService.findPracticeGroups(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         if (rows != null && rows.size() > 0) {
@@ -1156,17 +1004,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<VipGroup> rows = vipGroupService.findVipGroups(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         if (rows != null && rows.size() > 0) {
@@ -1210,17 +1048,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
         int count = scheduleService.endCountCourseSchedules(params);
@@ -1260,17 +1088,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         List<SporadicChargeInfo> rows = sporadicChargeInfoService.queryDetailPage(queryInfo).getRows();
         for (SporadicChargeInfo row : rows) {
             row.setOpenFlagStr(row.getOpenFlag().equals(0) ? "开启" : "关闭");
@@ -1460,12 +1278,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/orderList')")
     public HttpResponseResult orderList(StudentPaymentOrderQueryInfo queryInfo) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getRoutingOrganId()) && "3".equals(queryInfo.getOrderType())) {
-            queryInfo.setRoutingOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
@@ -1613,8 +1426,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/courseReviews')")
     public void courseReviews(CourseReviewQueryInfo queryInfo, HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        Employee employee = employeeDao.get(sysUser.getId());
-        queryInfo.setOrganId(employee.getOrganIdList());
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin()));
         queryInfo.setIsExport(1);
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
@@ -1699,9 +1511,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/practiceGroup')")
     public void practiceGroup(HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = null;
-        Employee employee = employeeDao.get(sysUser.getId());
-        organIds = employee.getOrganIdList();
+        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
 
         List<CourseGroupExportDto> practiceGroupExports = practiceGroupDao.getPracticeGroupExport(organIds, TenantContextHolder.getTenantId());
         if (practiceGroupExports == null || practiceGroupExports.size() == 0) {
@@ -1769,11 +1579,8 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/vipGroup')")
     public void vipGroup(HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = null;
-        Employee employee = employeeDao.get(sysUser.getId());
-        organIds = employee.getOrganIdList();
 
-        List<CourseGroupExportDto> vipGroupExports = courseScheduleDao.getVipGroupExport(organIds);
+        List<CourseGroupExportDto> vipGroupExports = courseScheduleDao.getVipGroupExport(organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin()));
         if (vipGroupExports == null || vipGroupExports.size() == 0) {
             response.setStatus(500);
             response.setContentType("Content-Type: application/json;charset=UTF-8");
@@ -1854,17 +1661,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         List<ExtraExerciseStudentsDto> rows = extracurricularExercisesReplyService.findExtraExercises(queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(500);
@@ -1913,17 +1710,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         List<StudentExercisesSituationDto> rows = studentExtracurricularExercisesSituationService.findStudentExtracurricularExercisesSituations(queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(500);
@@ -1966,17 +1753,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         List<TeacherCourseSalaryDetail4WebDto> rows = courseScheduleTeacherSalaryService.findIsSettlementCourseSalarys(queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(500);
@@ -2049,17 +1826,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         PageInfo<Student4operating> PageOperatingStudents = studentManageService.getOperatingStudents(queryInfo);
 
         if (PageOperatingStudents.getTotal() <= 0) {
@@ -2122,8 +1889,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/vipCourseReviews')")
     public void vipCourseReviews(CourseReviewQueryInfo queryInfo, HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        Employee employee = employeeDao.get(sysUser.getId());
-        queryInfo.setOrganId(employee.getOrganIdList());
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setIsExport(1);
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
@@ -2264,17 +2030,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new IOException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new IOException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new IOException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setRows(65000);
         PageInfo<CooperationOrgan> pageList = cooperationOrganService.queryPage(queryInfo);
         if (pageList.getTotal() <= 0) {
@@ -2314,10 +2070,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/musicGroupRegister')")
     public void musicGroupRegister(String organIds, HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isBlank(organIds)) {
-            organIds = employee.getOrganIdList();
-        }
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
         List<MusicGroupStatusEnum> musicGroupStatusList = new ArrayList<>();
         musicGroupStatusList.add(MusicGroupStatusEnum.APPLY);
         musicGroupStatusList.add(MusicGroupStatusEnum.PAY);
@@ -2442,13 +2195,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getRoutingOrganId()) && queryInfo.getOrderType().equals("3")) {
-            queryInfo.setRoutingOrganId(employee.getOrganIdList());
-            queryInfo.setOldOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
@@ -2550,10 +2297,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/musicGroupNormalStudentNum')")
     public void musicGroupNormalStudentNum(String organIds, HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isBlank(organIds)) {
-            organIds = employee.getOrganIdList();
-        }
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
 
         List<MusicGroupStatusEnum> musicGroupStatusList = new ArrayList<>();
         musicGroupStatusList.add(MusicGroupStatusEnum.PAY);
@@ -2644,10 +2388,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/studentOrder')")
     public void studentOrder(String organIds, Date date, HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isBlank(organIds)) {
-            organIds = employee.getOrganIdList();
-        }
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
         Date startTime = DateUtil.getFirstDayOfMonth(date);
         Date EndTime = DateUtil.getLastSecondWithDay(DateUtil.getLastDayOfMonth(date));
 
@@ -2740,17 +2481,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         if (queryInfo.getEndTime() != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
         }
@@ -3156,17 +2887,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<Teacher> rows = teacherService.queryPageDetail(queryInfo).getRows();
@@ -3296,18 +3017,17 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
+        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-
-        List<Integer> organIds = new ArrayList<>();
-        if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
-            organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-        }else if(StringUtils.isNotBlank(employee.getOrganIdList())){
-            organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
+        if(StringUtils.isEmpty(organIds)){
+            throw new BizException("没有可导出的记录");
+        }
+        List<Integer> collect = Arrays.stream(organIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
+        List<Integer> ids = collect.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
+        if(ids == null || ids.size() == 0){
+            throw new BizException("没有可导出的记录");
         }
-        List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
-
         List<EduOrganStudentDataDto> rows = studentService.queryOrganStudentOverView(ids, queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(200);
@@ -3349,18 +3069,17 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
+        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-
-        List<Integer> organIds = new ArrayList<>();
-        if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
-            organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-        }else if(StringUtils.isNotBlank(employee.getOrganIdList())){
-            organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
+        if(StringUtils.isEmpty(organIds)){
+            throw new BizException("没有可导出的记录");
+        }
+        List<Integer> collect = Arrays.stream(organIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
+        List<Integer> ids = collect.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
+        if(ids == null || ids.size() == 0){
+            throw new BizException("没有可导出的记录");
         }
-        List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
-
         List<EduOrganStudentDataDto> rows = indexService.organStudentOverView(ids, queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(200);
@@ -3455,16 +3174,17 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
+        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        List<Integer> organIds = new ArrayList<>();
-        if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
-            organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-        }else if(StringUtils.isNotBlank(employee.getOrganIdList())){
-            organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
+        if(StringUtils.isEmpty(organIds)){
+            throw new BizException("没有可导出的记录");
+        }
+        List<Integer> collect = Arrays.stream(organIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
+        List<Integer> ids = collect.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
+        if(ids == null || ids.size() == 0){
+            throw new BizException("没有可导出的记录");
         }
-        List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
         Object object = studentService.countCloudTeacherActive(ids, queryInfo).get("resultList");
         if(object == null){
             throw new BizException("没有可导出的记录");

+ 3 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ExtracurricularExercisesController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
 import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
 import com.ym.mec.biz.service.ExtracurricularExercisesService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -33,7 +34,7 @@ public class ExtracurricularExercisesController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "获取课外训练列表")
     @GetMapping("/queryPageList")
@@ -42,17 +43,7 @@ public class ExtracurricularExercisesController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-                throw new BizException("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    throw new BizException("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         return succeed(extracurricularExercisesService.queryPage(queryInfo));
     }
 

+ 3 - 17
mec-web/src/main/java/com/ym/mec/web/controller/ExtracurricularExercisesReplyController.java

@@ -2,10 +2,9 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.ExtraExercilseReplyQueryInfo;
 import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -17,9 +16,6 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
-import java.util.List;
-
 @Api(tags = "课外训练学生作业服务")
 @RequestMapping("extracurricularExercisesReply")
 @RestController
@@ -30,7 +26,7 @@ public class ExtracurricularExercisesReplyController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "获取课外训练作业列表")
     @GetMapping("/queryPageList")
@@ -39,17 +35,7 @@ public class ExtracurricularExercisesReplyController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-                throw new BizException("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    throw new BizException("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         return succeed(extracurricularExercisesReplyService.findExtraExercises(queryInfo));
     }
 

+ 3 - 18
mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java

@@ -2,14 +2,12 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
 import com.ym.mec.biz.service.FinancialExpenditureService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -17,9 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
-import java.util.List;
-
 @RequestMapping("financialExpenditure")
 @Api(tags = "财务支出服务")
 @RestController
@@ -30,7 +25,7 @@ public class FinancialExpenditureController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "删除财务支出")
     @PostMapping("/batchDel")
@@ -48,17 +43,7 @@ public class FinancialExpenditureController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(financialExpenditureService.queryFinancialExpenditurePage(queryInfo));
     }
 

+ 3 - 10
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -56,7 +56,7 @@ public class IndexController extends BaseController {
 	private SysUserFeignService sysUserFeignService;
 
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
 	@Autowired
 	private EmployeeService employeeService;
@@ -78,15 +78,8 @@ public class IndexController extends BaseController {
 		if (sysUser == null || sysUser.getId() == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-		Integer userId = sysUser.getId();
-		Employee employee = employeeDao.get(userId);
-		String organId = employee.getOrganIdList();
-		if (sysUser.getIsSuperAdmin()) {
-			organId = null;
-		}else if(StringUtils.isEmpty(organId)){
-			return failed(HttpStatus.INTERNAL_SERVER_ERROR, "分部信息错误");
-		}
-		
+		String organId = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+
 		Integer tenantId = TenantContextHolder.getTenantId();
 
 		Map<String, Integer> musicDatas = musicGroupDao.queryOrganMusicGroupNum(organId, TenantContextHolder.getTenantId());

+ 12 - 71
mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java

@@ -15,6 +15,7 @@ import com.ym.mec.biz.dal.page.IndexErrRecordQueryInfo;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
 import com.ym.mec.biz.service.IndexErrDataRecordService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -44,7 +45,7 @@ public class IndexErrDataRecordController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private IndexErrDataRecordService indexErrDataRecordService;
 
@@ -56,17 +57,7 @@ public class IndexErrDataRecordController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganIds())) {
-            queryInfo.setOrganIds(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         return succeed(indexErrDataRecordService.queryRecord(queryInfo));
     }
 
@@ -78,17 +69,7 @@ public class IndexErrDataRecordController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganIds())) {
-            queryInfo.setOrganIds(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         return succeed(indexErrDataRecordService.errDataSummarizing(queryInfo));
     }
 
@@ -100,17 +81,7 @@ public class IndexErrDataRecordController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(organIds)) {
-            organIds = employee.getOrganIdList();
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(organIds.split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
         return succeed(indexErrDataRecordService.getAllEducationUsers(organIds));
     }
 
@@ -122,17 +93,7 @@ public class IndexErrDataRecordController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (queryInfo.getStartTime() != null) {
             queryInfo.setStartTime(DateUtil.trunc(queryInfo.getStartTime()));
         }
@@ -153,21 +114,11 @@ public class IndexErrDataRecordController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
-        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
-            queryInfo.setUserId(sysUser.getId());
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+//        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+//        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
+//            queryInfo.setUserId(sysUser.getId());
+//        }
         String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
         queryInfo.setSearchStartTime(startTime);
         return succeed(indexErrDataRecordService.queryErrStudentVisit(queryInfo));
@@ -181,17 +132,7 @@ public class IndexErrDataRecordController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        }else if(org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
         return succeed(indexErrDataRecordService.queryHistoryErrCourseData(queryInfo));
     }
 }

+ 3 - 16
mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java

@@ -2,24 +2,21 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
 import com.ym.mec.biz.service.InspectionService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.Arrays;
 import java.util.List;
 
 @Api(tags = "巡查任务")
@@ -29,7 +26,7 @@ public class InspectionController extends BaseController {
     @Autowired
     private InspectionService inspectionService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Resource
     private SysUserFeignService sysUserFeignService;
     @Autowired
@@ -72,17 +69,7 @@ public class InspectionController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(inspectionService.getPageList(queryInfo));
     }
 

+ 7 - 16
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.InspectionItem;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
 import com.ym.mec.biz.service.InspectionItemService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -31,7 +32,7 @@ public class InspectionItemController extends BaseController {
     @Autowired
     private InspectionItemService inspectionItemService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Resource
     private SysUserFeignService sysUserFeignService;
 
@@ -56,21 +57,11 @@ public class InspectionItemController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
-        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
-            queryInfo.setUserId(sysUser.getId());
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+//        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+//        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
+//            queryInfo.setUserId(sysUser.getId());
+//        }
         String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
         queryInfo.setSearchStartTime(startTime);
         return succeed(inspectionItemService.getPageList(queryInfo));

+ 3 - 12
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.service.InspectionItemPlanService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -35,7 +36,7 @@ public class InspectionItemPlanController extends BaseController {
     @Resource
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private MusicGroupDao musicGroupDao;
 
@@ -72,17 +73,7 @@ public class InspectionItemPlanController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (queryInfo.getStartTime() != null) {
             queryInfo.setStartTime(DateUtil.trunc(queryInfo.getStartTime()));
         }

+ 4 - 23
mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MemberRankOrganizationFeeMapper;
 import com.ym.mec.biz.dal.page.MemberRankFeeQueryInfo;
 import com.ym.mec.biz.service.MemberRankOrganizationFeeMapperService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.collection.MapUtil;
@@ -33,7 +34,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "新增")
     @PostMapping("/add")
@@ -77,17 +78,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
         return succeed(memberRankOrganizationFeeMapperService.findAll(params));
@@ -101,17 +92,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(memberRankOrganizationFeeMapperService.queryPage(queryInfo));
     }
 }

+ 2 - 24
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java

@@ -45,8 +45,6 @@ public class MusicGroupController extends BaseController {
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private EmployeeDao employeeDao;
-	@Autowired
 	private OrganizationService organizationService;
 
 	@ApiOperation(value = "修改乐团基本信息")
@@ -112,17 +110,7 @@ public class MusicGroupController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeDao.get(sysUser.getId());
-		if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-			queryInfo.setOrganId(employee.getOrganIdList());
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-				return failed("非法请求");
-			}
-		}
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
 		return succeed(musicGroupService.queryMusicGroupPage(queryInfo));
 	}
 
@@ -349,17 +337,7 @@ public class MusicGroupController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeDao.get(sysUser.getId());
-		if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-			queryInfo.setOrganId(employee.getOrganIdList());
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-				return failed("非法请求");
-			}
-		}
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
 		return succeed(musicGroupService.queryMusicMemberList(queryInfo));
 	}
 

+ 1 - 13
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -41,8 +41,6 @@ public class MusicGroupPaymentCalenderController extends BaseController {
 	@Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
@@ -146,17 +144,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(musicGroupPaymentCalenderService.auditList(queryInfo));
     }
 

+ 4 - 26
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -4,12 +4,11 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAddStudentDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
-import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -21,7 +20,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
@@ -37,7 +35,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     private SysUserFeignService sysUserFeignService;
 
     @Autowired
-    private EmployeeService employeeService;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询乐团缴费明细列表")
     @GetMapping("/queryPage")
@@ -109,17 +107,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganIds())) {
-            queryInfo.setOrganIds(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         return succeed(musicGroupPaymentCalenderDetailService.queryArrearageStudents(queryInfo));
     }
 
@@ -131,17 +119,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeService.get(sysUser.getId());
-            if (StringUtils.isBlank(organIds)) {
-                organIds = employee.getOrganIdList();
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(organIds.split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
         return succeed(musicGroupPaymentCalenderDetailService.getNoPaymentStudentMusicGroups(organIds));
     }
 }

+ 6 - 23
mec-web/src/main/java/com/ym/mec/web/controller/OperatingReportController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.OperatingReport;
 import com.ym.mec.biz.dal.page.OperatingReportQueryInfo;
 import com.ym.mec.biz.service.OperatingReportService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -39,7 +40,7 @@ public class OperatingReportController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation("报表列表")
     @GetMapping(value = "/queryPage")
@@ -49,17 +50,8 @@ public class OperatingReportController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         if (queryInfo.getMonth() != null) {
             queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
             queryInfo.setEndTime(DateUtil.getLastDayOfMonth(queryInfo.getMonth()));
@@ -76,17 +68,8 @@ public class OperatingReportController extends BaseController {
         if (sysUser == null) {
             throw new IOException("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                throw new IOException("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    throw new IOException("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         if (queryInfo.getMonth() != null) {
             queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
             queryInfo.setEndTime(DateUtil.getLastDayOfMonth(queryInfo.getMonth()));

+ 3 - 12
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCloudTeacherFeeController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
 import com.ym.mec.biz.dal.page.OrganizationCloudTeacherFeeQueryInfo;
 import com.ym.mec.biz.service.OrganizationCloudTeacherFeeService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -34,7 +35,7 @@ public class OrganizationCloudTeacherFeeController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询分部列表")
     @GetMapping("/queryPage")
@@ -44,17 +45,7 @@ public class OrganizationCloudTeacherFeeController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(organizationCloudTeacherFeeService.queryPage(queryInfo));
     }
 

+ 8 - 34
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -14,6 +14,7 @@ import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
 import com.ym.mec.biz.dal.page.StudentBuyPracticeQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleEvaluateService;
 import com.ym.mec.biz.service.GroupClassService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.PracticeGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -46,7 +47,7 @@ public class PracticeGroupManageController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private GroupClassService groupService;
     @Autowired
@@ -64,17 +65,8 @@ public class PracticeGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(practiceGroupService.findPracticeGroups(queryInfo));
     }
 
@@ -122,17 +114,8 @@ public class PracticeGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
 
@@ -158,17 +141,8 @@ public class PracticeGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(practiceGroupService.studentBuys(queryInfo));
     }
 

+ 5 - 23
mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentActivityController.java

@@ -42,7 +42,7 @@ public class ReplacementInstrumentActivityController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private ReplacementInstrumentActivityDao replacementInstrumentActivityDao;
     @Autowired
@@ -62,17 +62,8 @@ public class ReplacementInstrumentActivityController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(replacementInstrumentActivityService.getPageList(queryInfo));
     }
 
@@ -166,17 +157,8 @@ public class ReplacementInstrumentActivityController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         queryInfo.setRows(99999);
         PageInfo<ReplacementInstrumentActivityStatDto> pageList = replacementInstrumentActivityService.getPageList(queryInfo);
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentCooperationController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.ReplacementInstrumentCooperation;
 import com.ym.mec.biz.dal.page.ReplacementInstrumentCooperationQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.ReplacementInstrumentCooperationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -33,7 +34,7 @@ public class ReplacementInstrumentCooperationController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询列表")
     @GetMapping("/queryPage")
@@ -43,17 +44,8 @@ public class ReplacementInstrumentCooperationController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(replacementInstrumentCooperationService.getPageList(queryInfo));
     }
 

+ 6 - 23
mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.School;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.page.SchoolQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.SchoolService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -31,7 +32,7 @@ public class SchoolController extends BaseController {
     @Autowired
     private SchoolService schoolService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     
     @Autowired
     private TeacherDao teacherDao;
@@ -79,17 +80,8 @@ public class SchoolController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(schoolService.queryPageDetail(queryInfo));
     }
 
@@ -101,17 +93,8 @@ public class SchoolController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(organId)) {
-                organId = employee.getOrganIdList();
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(organId.split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
+
         return succeed(schoolService.queryByOrganId(organId));
     }
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SellOrderController.java

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.enums.SellStatus;
 import com.ym.mec.biz.dal.enums.SellTypeEnum;
 import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
 import com.ym.mec.biz.dal.page.SellOrderQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.SellOrderService;
 import com.ym.mec.biz.service.StudentRepairService;
 import com.ym.mec.common.controller.BaseController;
@@ -45,7 +46,7 @@ public class SellOrderController extends BaseController {
     @Autowired
     private SellOrderService sellOrderService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation("销售列表")
     @GetMapping(value = "/queryPage")
@@ -55,17 +56,8 @@ public class SellOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         if (queryInfo.getEndTime() != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
         }

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.SporadicChargeInfoService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -33,7 +34,7 @@ public class SporadicChargeInfoController extends BaseController {
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
 	@ApiOperation(value = "查询零星收费列表")
 	@GetMapping("/queryPage")
@@ -43,17 +44,8 @@ public class SporadicChargeInfoController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeDao.get(sysUser.getId());
-		if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-			queryInfo.setOrganId(employee.getOrganIdList());
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-				return failed("非法请求");
-			}
-		}
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
 		queryInfo.setSort("id_");
 		return succeed(sporadicChargeInfoService.queryDetailPage(queryInfo));
 	}

+ 5 - 13
mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -33,7 +34,7 @@ public class StudentApplyRefundsController extends BaseController {
 	private SysUserFeignService sysUserFeignService;
 
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
 	@ApiOperation(value = "查询退费列表")
     @GetMapping("/queryPage")
@@ -43,17 +44,8 @@ public class StudentApplyRefundsController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeDao.get(sysUser.getId());
-		if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-			queryInfo.setOrganId(employee.getOrganIdList());
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-				return failed("非法请求");
-			}
-		}
-        return succeed(studentApplyRefundsService.queryPage(queryInfo));
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
+		return succeed(studentApplyRefundsService.queryPage(queryInfo));
     }
 }

+ 3 - 12
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -50,7 +50,7 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
     private StudentServeService studentServeService;
 
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @Autowired
     private EmployeeService employeeService;
@@ -63,17 +63,8 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentExtracurricularExercisesSituationService.findStudentExtracurricularExercisesSituations(queryInfo));
     }
 

+ 6 - 19
mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.entity.StudentInstrument;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.StudentRepair;
 import com.ym.mec.biz.dal.page.StudentInstrumentQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentInstrumentService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -57,7 +58,7 @@ public class StudentInstrumentController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private StudentInstrumentDao studentInstrumentDao;
 
@@ -70,17 +71,8 @@ public class StudentInstrumentController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         studentInstrumentDao.batchUpdate();
         return succeed(studentInstrumentService.queryPage(queryInfo));
     }
@@ -206,13 +198,8 @@ public class StudentInstrumentController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        String organId = null;
-        if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            organId = employee.getOrganIdList();
-        }
+        String organId = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+
         if (startTime != null) {
             startTime = DateUtil.trunc(startTime);
         }

+ 17 - 75
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -45,11 +45,9 @@ public class StudentManageController extends BaseController {
     @Autowired
     private StudentCourseHomeworkService studentCourseHomeworkService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private StudentService studentService;
-    @Autowired
-    private OrganizationService organizationService;
 
     private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
 
@@ -61,17 +59,8 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentManageService.queryStudentErrorLeaveList(queryInfo));
     }
 
@@ -90,17 +79,8 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         queryInfo.setIsExport(false);
         return succeed(studentManageService.findStudentsByOrganId(queryInfo));
     }
@@ -113,17 +93,8 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentManageService.queryStudent(queryInfo));
     }
 
@@ -135,17 +106,8 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentService.queryPage(queryInfo));
     }
 
@@ -392,17 +354,8 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentManageService.getOperatingStudents(queryInfo));
     }
 
@@ -476,14 +429,9 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        List<Organization> organizations = organizationService.queryEmployeeOrgan(sysUser.getId(),null);
-        List<Integer> organIds = new ArrayList<>();
-        if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
-            organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-        }else if(!CollectionUtils.isEmpty(organizations)){
-            organIds = organizations.stream().map(Organization::getId).collect(Collectors.toList());
-        }
-        List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
+        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+        List<Integer> collect = Arrays.stream(organIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
+        List<Integer> ids = collect.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
         return succeed(studentService.queryOrganStudentOverView(ids, queryInfo));
     }
 
@@ -502,17 +450,11 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
+        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-
-        List<Integer> organIds = new ArrayList<>();
-        if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
-            organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-        }else if(StringUtils.isNotBlank(employee.getOrganIdList())){
-            organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-        }
-        List<Integer> ids = organIds.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
+        List<Integer> collect = Arrays.stream(organIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
+        List<Integer> ids = collect.stream().filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
         return succeed(studentService.countCloudTeacherActive(ids, queryInfo));
     }
 

+ 11 - 56
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -1,6 +1,8 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -47,7 +49,7 @@ public class StudentPaymentOrderController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private SysConfigDao sysConfigDao;
     @Autowired
@@ -61,17 +63,7 @@ public class StudentPaymentOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
@@ -105,17 +97,8 @@ public class StudentPaymentOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentPaymentOrderService.sporadicQueryPage(queryInfo));
     }
 
@@ -127,17 +110,8 @@ public class StudentPaymentOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         queryInfo.setOrderType("1");
 
         PageInfo<StudentPaymentOrderDto> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
@@ -161,17 +135,8 @@ public class StudentPaymentOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         queryInfo.setOrderType("2");
 
         PageInfo<StudentPaymentOrderDto> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
@@ -211,17 +176,7 @@ public class StudentPaymentOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getRoutingOrganId())) {
-                queryInfo.setRoutingOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getRoutingOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
 
         PageInfo<StudentPaymentOrderDto> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
         return succeed(studentPaymentOrderPageInfo);

+ 5 - 23
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -49,7 +50,7 @@ public class StudentPaymentRouteOrderController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
     @Autowired
@@ -65,17 +66,8 @@ public class StudentPaymentRouteOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getRoutingOrganId())) {
-            queryInfo.setRoutingOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getRoutingOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
@@ -97,17 +89,7 @@ public class StudentPaymentRouteOrderController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
 
         return succeed(studentPaymentRouteOrderService.queryAuditList(queryInfo));
     }

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/StudentRechargeController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -34,7 +35,7 @@ public class StudentRechargeController extends BaseController {
 	private SysUserFeignService sysUserFeignService;
 
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
 	@ApiOperation(value = "列表分页查询")
 	@GetMapping(value = "/queryPage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@@ -44,17 +45,8 @@ public class StudentRechargeController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-			Employee employee = employeeDao.get(sysUser.getId());
-			if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-				queryInfo.setOrganId(employee.getOrganIdList());
-			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-				return failed("用户所在分部异常");
-			}else {
-				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-				if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-					return failed("非法请求");
-				}
-			}
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
 		return succeed(studentRechargeService.queryPage(queryInfo));
 	}
 

+ 4 - 20
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -50,10 +51,6 @@ import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
 import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPreRegistrationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
-import com.ym.mec.biz.service.EmployeeService;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
-import com.ym.mec.biz.service.StudentPreRegistrationService;
-import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -71,17 +68,13 @@ public class StudentRegistrationController extends BaseController {
     @Autowired
     private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
     @Autowired
-    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
-    @Autowired
-    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
-    @Autowired
     private StudentPreRegistrationService studentPreRegistrationService;
     @Autowired
     private MusicGroupDao musicGroupDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeService employeeService;
+    private OrganizationService organizationService;
     @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
 
@@ -358,17 +351,8 @@ public class StudentRegistrationController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganIds())) {
-            queryInfo.setOrganIds(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentRegistrationService.queryNoClassMusicStudentInfo(queryInfo));
     }
 

+ 6 - 23
mec-web/src/main/java/com/ym/mec/web/controller/StudentRepairController.java

@@ -11,6 +11,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentRepair;
 import com.ym.mec.biz.dal.page.CooperationOrganQueryInfo;
 import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentRepairService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -50,7 +51,7 @@ public class StudentRepairController extends BaseController {
     @Autowired
     private StudentRepairService studentRepairService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation("获取维修列表")
     @GetMapping(value = "/queryPage")
@@ -60,17 +61,8 @@ public class StudentRepairController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         Date endTime = queryInfo.getEndTime();
         if (endTime != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(endTime));
@@ -96,17 +88,8 @@ public class StudentRepairController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-            queryInfo.setOrganIdList(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            throw new BizException("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         Date endTime = queryInfo.getEndTime();
         if (endTime != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(endTime));

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -36,7 +37,7 @@ public class StudentWithdrawController extends BaseController {
 	private SysUserFeignService sysUserFeignService;
 
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
 	@PostMapping("confirm")
 	@ApiOperation(value = "确认提现")
@@ -54,17 +55,8 @@ public class StudentWithdrawController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-			Employee employee = employeeDao.get(sysUser.getId());
-			if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-				queryInfo.setOrganId(employee.getOrganIdList());
-			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-				return failed("用户所在分部异常");
-			}else {
-				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-				if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-					return failed("非法请求");
-				}
-			}
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
 		return succeed(studentWithdrawService.queryPage(queryInfo));
 	}
 }

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SubjectChangeController.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.enums.SubjectChangeStatusEnum;
 import com.ym.mec.biz.dal.page.SellOrderQueryInfo;
 import com.ym.mec.biz.dal.page.SubjectChangeQueryInfo;
 import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.biz.service.SubjectChangeService;
 import com.ym.mec.common.controller.BaseController;
@@ -44,7 +45,7 @@ public class SubjectChangeController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation("声部更换服务列表")
     @GetMapping(value = "/queryPage")
@@ -54,17 +55,8 @@ public class SubjectChangeController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
-                queryInfo.setOrganIdList(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+
         if (queryInfo.getEndTime() != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
         }

+ 6 - 23
mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreCategoriesController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
@@ -30,7 +31,7 @@ public class SysMusicScoreCategoriesController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
@@ -41,17 +42,8 @@ public class SysMusicScoreCategoriesController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(sysMusicScoreCategoriesService.queryPage(queryInfo));
     }
 
@@ -95,17 +87,8 @@ public class SysMusicScoreCategoriesController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(sysMusicScoreCategoriesService.queryTree(queryInfo));
     }
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.dto.MusicScoreDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
@@ -33,7 +34,7 @@ public class SysMusicScoreController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "修改")
     @PostMapping("/update")
@@ -80,17 +81,8 @@ public class SysMusicScoreController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         if(queryInfo.getCategoriesId() != null){
             String byCategoriesIds = sysMusicScoreCategoriesDao.findByCategoriesIds(queryInfo.getCategoriesId());
             byCategoriesIds = sysMusicScoreCategoriesDao.findByCategoriesIds(byCategoriesIds);

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SysUserCashAccountLogController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.SysUserCashAccountLog;
 import com.ym.mec.biz.dal.page.AccountLogQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.SysUserCashAccountLogService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -30,7 +31,7 @@ public class SysUserCashAccountLogController extends BaseController {
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 
 	@ApiOperation(value = "获取退费详情")
 	@GetMapping("/get")
@@ -58,17 +59,8 @@ public class SysUserCashAccountLogController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeDao.get(sysUser.getId());
-		if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-			queryInfo.setOrganId(employee.getOrganIdList());
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-				return failed("非法请求");
-			}
-		}
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
 		return succeed(sysUserCashAccountLogService.queryPage(queryInfo));
 	}
 }

+ 0 - 2
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -89,8 +89,6 @@ public class TaskController extends BaseController {
 	@Autowired
 	private StudentInstrumentService studentInstrumentService;
 	@Autowired
-	private CloudTeacherOrderService cloudTeacherOrderService;
-	@Autowired
 	private HistoryMessageService historyMessageService;
 	@Autowired
 	private ImFeignService imFeignService;

+ 6 - 23
mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.enums.UpdateAttendanceEnum;
+import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -35,7 +36,7 @@ public class TeacherAttendanceController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "查询教师签到(上课)记录")
     @GetMapping("/getTeacherPersonalAttendances")
@@ -52,17 +53,8 @@ public class TeacherAttendanceController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(teacherAttendanceService.queryTeacherAttendances(queryInfo));
     }
 
@@ -106,17 +98,8 @@ public class TeacherAttendanceController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(teacherAttendanceService.queryTeacherAttendanceComplaints(queryInfo));
     }
 

+ 8 - 45
mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.ClassGroupService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -38,7 +39,7 @@ public class TeacherController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private ClassGroupService classGroupService;
 
@@ -57,17 +58,8 @@ public class TeacherController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(teacherService.queryPageDetail(queryInfo));
     }
 
@@ -106,17 +98,8 @@ public class TeacherController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(organId)) {
-            organId = employee.getOrganIdList();
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(organId.split(",")))){
-                return failed("非法请求");
-            }
-        }
+        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
+
         return succeed(teacherService.findTeachers(organId));
     }
 
@@ -135,17 +118,7 @@ public class TeacherController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(organId)) {
-                organId = employee.getOrganIdList();
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(organId.split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
         return succeed(teacherService.findTeacherByOrganId(organId,subjectIds,jobNature));
     }
 
@@ -157,17 +130,7 @@ public class TeacherController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(teacherService.queryPageName(queryInfo));
     }
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseRewardController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.CourseSalaryQueryInfo4Web;
 import com.ym.mec.biz.dal.page.TeacherCourseRewardQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.TeacherCourseRewardService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -31,7 +32,7 @@ public class TeacherCourseRewardController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private TeacherCourseRewardService teacherCourseRewardService;
 
@@ -44,17 +45,8 @@ public class TeacherCourseRewardController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         Date endTime = queryInfo.getEndTime();
         if(endTime != null){
             queryInfo.setEndTime(DateUtil.addDays(endTime, 1));

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseStatisticsController.java

@@ -5,6 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.TeacherCourseStatisticsQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.TeacherCourseStatisticsService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -28,7 +29,7 @@ public class TeacherCourseStatisticsController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @Autowired
     private TeacherCourseStatisticsService teacherCourseStatisticsService;
@@ -41,17 +42,8 @@ public class TeacherCourseStatisticsController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(teacherCourseStatisticsService.queryPageDetail(queryInfo));
     }
 }

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/TeacherSalaryComplaintsController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.TeacherSalaryComplaints;
 import com.ym.mec.biz.dal.page.TeacherSalaryModifyQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.TeacherSalaryComplaintsService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -29,7 +30,7 @@ public class TeacherSalaryComplaintsController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页获取")
     @RequestMapping("/queryPage")
@@ -39,17 +40,8 @@ public class TeacherSalaryComplaintsController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(teacherSalaryComplaintsService.queryPage(queryInfo));
     }
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java

@@ -12,6 +12,7 @@ import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.VipGroupActivity;
 import com.ym.mec.biz.dal.page.DoubleEleven2021QueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -44,7 +45,7 @@ public class VipGroupActivityController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
 	@Autowired
-	private EmployeeDao employeeDao;
+	private OrganizationService organizationService;
 	@Autowired
     private TeacherDao teacherDao;
 	@Autowired
@@ -93,17 +94,8 @@ public class VipGroupActivityController extends BaseController {
         if(sysUser == null){
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         Integer applyToStudentType = queryInfo.getApplyToStudentType();
         if(applyToStudentType != null){
             if(applyToStudentType == 0 || applyToStudentType == 1){

+ 6 - 26
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -54,8 +54,6 @@ public class VipGroupManageController extends BaseController {
     @Autowired
     private TeacherDao teacherDao;
     @Autowired
-    private EmployeeDao employeeDao;
-    @Autowired
     private ClassGroupDao classGroupDao;
     @Autowired
     private ImGroupMemberService imGroupMemberService;
@@ -68,13 +66,13 @@ public class VipGroupManageController extends BaseController {
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
-    private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
-    @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
     @Autowired
     private CourseScheduleDao courseScheduleDao;
     @Autowired
     private VipGroupCategoryDao vipGroupCategoryDao;
+    @Autowired
+    private OrganizationService organizationService;
 
     @GetMapping("/teacherSalarySettlement")
     public Object teacherSalarySettlement(){
@@ -186,17 +184,8 @@ public class VipGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(vipGroupService.findVipGroups(queryInfo));
     }
 
@@ -223,17 +212,8 @@ public class VipGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(vipGroupService.findHaveCourseBalanceStudents(queryInfo));
     }
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/VisitController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.StudentVisitDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentVisit;
 import com.ym.mec.biz.dal.page.StudentVisitQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentVisitService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -35,7 +36,7 @@ public class VisitController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "回访列表")
     @GetMapping("/queryPage")
@@ -45,17 +46,8 @@ public class VisitController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
-            }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(studentVisitService.getPageList(queryInfo));
     }
 

+ 4 - 12
mec-web/src/main/java/com/ym/mec/web/controller/WebCourseHomeworkController.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.page.CourseHomeWorkTemplateQueryInfo;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseHomeWorkQueryInfo;
 import com.ym.mec.biz.service.CourseHomeworkService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentCourseHomeworkService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -40,7 +41,7 @@ public class WebCourseHomeworkController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
     @Autowired
     private StudentCourseHomeworkService studentCourseHomeworkService;
 
@@ -51,17 +52,8 @@ public class WebCourseHomeworkController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+
         return succeed(courseHomeworkService.queryHomePage(queryInfo));
     }