Просмотр исходного кода

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

yanite 3 лет назад
Родитель
Сommit
6edc4f3f35
81 измененных файлов с 556 добавлено и 1209 удалено
  1. 1 1
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserDeviceMapper.xml
  2. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysEmployeePositionDao.java
  3. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SysUserRoleEnum.java
  4. 5 4
      mec-biz/src/main/java/com/ym/mec/biz/event/listener/SendSeoMessageListener.java
  5. 0 20
      mec-biz/src/main/java/com/ym/mec/biz/service/EmployeeService.java
  6. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java
  7. 14 30
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java
  8. 32 1
      mec-biz/src/main/java/com/ym/mec/biz/service/SysEmployeePositionService.java
  9. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  10. 1 11
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeServiceImpl.java
  11. 45 41
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  12. 7 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexErrDataRecordServiceImpl.java
  13. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  14. 22 19
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  15. 43 112
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java
  16. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformProductServiceImpl.java
  17. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  18. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  19. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentWithdrawServiceImpl.java
  20. 50 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysEmployeePositionServiceImpl.java
  21. 17 27
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherLeaveRecordServiceImpl.java
  22. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java
  23. 10 22
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantOrderRecordServiceImpl.java
  24. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  25. 1 1
      mec-biz/src/main/resources/config/mybatis/SysCouponIssueRecordMapper.xml
  26. 14 0
      mec-biz/src/main/resources/config/mybatis/SysEmployeePositionMapper.xml
  27. 30 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysEmployeePositionController.java
  28. 2 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java
  29. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/ActivityPlanController.java
  30. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/ChildrenReserveController.java
  31. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/CooperationOrganController.java
  32. 2 10
      mec-web/src/main/java/com/ym/mec/web/controller/CourseReviewController.java
  33. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  34. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java
  35. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java
  36. 18 22
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  37. 31 137
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  38. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/ExtracurricularExercisesController.java
  39. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/ExtracurricularExercisesReplyController.java
  40. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java
  41. 10 32
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  42. 5 25
      mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java
  43. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java
  44. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java
  45. 2 10
      mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java
  46. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java
  47. 2 10
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java
  48. 2 10
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java
  49. 24 71
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java
  50. 2 14
      mec-web/src/main/java/com/ym/mec/web/controller/OperatingReportController.java
  51. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCloudTeacherFeeController.java
  52. 1 5
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationController.java
  53. 3 18
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  54. 2 12
      mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentActivityController.java
  55. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentCooperationController.java
  56. 2 12
      mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java
  57. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/SellOrderController.java
  58. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java
  59. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java
  60. 2 11
      mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java
  61. 2 11
      mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java
  62. 7 46
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  63. 20 59
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java
  64. 2 14
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java
  65. 4 23
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRechargeController.java
  66. 2 14
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRepairController.java
  67. 6 25
      mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java
  68. 1 8
      mec-web/src/main/java/com/ym/mec/web/controller/SubjectChangeController.java
  69. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/SysEmployeePositionController.java
  70. 2 14
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreCategoriesController.java
  71. 1 16
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java
  72. 1 20
      mec-web/src/main/java/com/ym/mec/web/controller/SysUserCashAccountLogController.java
  73. 9 27
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java
  74. 4 34
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java
  75. 1 17
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseRewardController.java
  76. 1 16
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseStatisticsController.java
  77. 1 15
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherSalaryComplaintsController.java
  78. 1 6
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java
  79. 2 12
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java
  80. 1 12
      mec-web/src/main/java/com/ym/mec/web/controller/VisitController.java
  81. 1 8
      mec-web/src/main/java/com/ym/mec/web/controller/WebCourseHomeworkController.java

+ 1 - 1
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserDeviceMapper.xml

@@ -119,7 +119,7 @@
 	</select>
 	
 	<select id="queryByUserId" resultMap="SysUserDevice" parameterType="map">
-		SELECT * FROM sys_user_device WHERE user_id_ = #{userId} and del_flag_ = 0 and tenant_id_ = #{tenantId}
+		SELECT * FROM sys_user_device WHERE user_id_ = #{userId} and del_flag_ = 0
 		<if test="clientId != null">
 			and client_id_ = #{clientId}
 		</if>

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysEmployeePositionDao.java

@@ -2,11 +2,13 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.SysEmployeePosition;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public interface SysEmployeePositionDao extends BaseDAO<Integer, SysEmployeePosition> {
 
@@ -22,4 +24,24 @@ public interface SysEmployeePositionDao extends BaseDAO<Integer, SysEmployeePosi
     List<Map<Integer, String>> queryPositionNameMap(@Param("userIds") List<Integer> userIds, @Param("tenantId") Integer tenantId);
 
     List<SimpleUserDto> findOrganPosition(@Param("organIds") String organIds, @Param("tenantId") Integer tenantId);
+
+    /**
+    * @description: 查询用户拥有的角色
+     * @param userId
+     * @param tenantId
+    * @return java.util.List<com.ym.mec.biz.dal.enums.SysUserRoleEnum>
+    * @author zx
+    * @date 2022/1/8 14:25
+    */
+    List<SysUserRoleEnum> queryPositionList(@Param("userId") Integer userId, @Param("tenantId") Integer tenantId);
+
+    /**
+    * @description: 获取指定分部包含指定职位的员工列表
+     * @param roleArr
+     * @param organId
+    * @return java.util.Set<java.lang.Integer>
+    * @author zx
+    * @date 2022/1/8 16:28
+    */
+    Set<Integer> queryUserIdByRoleId(@Param("roleArr") SysUserRoleEnum[] roleArr, @Param("organId") Integer organId, @Param("tenantId") Integer tenantId);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SysUserRoleEnum.java

@@ -4,7 +4,7 @@ import com.ym.mec.common.enums.BaseEnum;
 
 //分部经理,乐团主管,维修技师
 public enum SysUserRoleEnum implements BaseEnum<String,SysUserRoleEnum> {
-    SECTION_MANAGER,EDUCATIONAL_TEACHER,REPAIR,JOIN_TEACHER;
+    ORGAN_MANAGER,EDUCATION,REPAIR,JOIN_TEACHER,HRBP;
 
     @Override
     public String getCode() {

+ 5 - 4
mec-biz/src/main/java/com/ym/mec/biz/event/listener/SendSeoMessageListener.java

@@ -2,7 +2,7 @@ package com.ym.mec.biz.event.listener;
 
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.event.SendSeoMessageChangeEvent;
-import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysEmployeePositionService;
 import com.ym.mec.biz.service.SysMessageService;
 import org.springframework.context.ApplicationListener;
 import org.springframework.scheduling.annotation.Async;
@@ -18,16 +18,17 @@ public class SendSeoMessageListener implements ApplicationListener<SendSeoMessag
     @Resource
     private SysMessageService sysMessageService;
     @Resource
-    private OrganizationService organizationService;
+    private SysEmployeePositionService employeePositionService;
 
     @Async
     @Override
     public void onApplicationEvent(SendSeoMessageChangeEvent event) {
-        Set<Integer> targetUserIdList = organizationService.queryUserIdByRoleId(event.getRoleArr(), event.getOrganId());
+        //获取当前分部,指定角色的用户列表
+        Set<Integer> targetUserIdList = employeePositionService.queryUserIdByRoleId(event.getRoleArr(), event.getOrganId());
         if(event.getTargetId() != null){
             targetUserIdList.add(event.getTargetId());
         }
-        if(targetUserIdList != null && targetUserIdList.size() > 0){
+        if(targetUserIdList.size() > 0){
             sysMessageService.batchSeoMessage(targetUserIdList,
                     event.getMsgTemplate(),
                     JSONObject.toJSONString(event.getMemo()),

+ 0 - 20
mec-biz/src/main/java/com/ym/mec/biz/service/EmployeeService.java

@@ -41,16 +41,6 @@ public interface EmployeeService extends BaseService<Integer, Employee> {
     void updateEmployee(Employee employee);
 
     /**
-     * @describe 根据角色和部门获取用户
-     * @author Joburgess
-     * @date 2020/3/12
-     * @param roleIds: 角色编号列表
-     * @param organIds: 用户编号列表
-     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
-     */
-    List<SimpleUserDto> findByRole(String roleIds,String organIds);
-
-    /**
      * 是否有课程组关联的教务老师
      * @param employeeId
      * @return
@@ -77,16 +67,6 @@ public interface EmployeeService extends BaseService<Integer, Employee> {
      */
     void level(List<EmployeeLevelDto> employeeLevelDtos);
 
-    /**
-     * @describe 根据角色和部门获取用户(包含冻结和离职的)
-     * @author Joburgess
-     * @date 2020/3/12
-     * @param roleIds: 角色编号列表
-     * @param organIds: 用户编号列表
-     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
-     */
-    List<SimpleUserDto> findAllByRole(String roleIds,String organIds);
-
     List<Integer> queryUserRole(Integer sysUserId);
 
     int batchInsertRoleMenu( Integer roleId, List<Integer> menuIds, Integer tenantId);

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java

@@ -23,7 +23,7 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
 
     void indexBaseDataTask(Integer tenantId, String month, Set<IndexDataType> dataTypes);
 
-    Map<String, Object> getIndexErrData(Integer organId, IndexErrorType errorType);
+    Map<String, Object> getIndexErrData(String organId, IndexErrorType errorType);
 
     List<IndexErrorDataExportDto> exportIndexErrData(String organIds, IndexErrorType errorType);
 
@@ -32,14 +32,14 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
      * @param organId
      * @return
      */
-    List<IndexErrInfoDto> getRemindMatterData(Integer organId);
+    List<IndexErrInfoDto> getRemindMatterData(String organId);
 
     /**
      * 是否有提醒事项
      * @param organId
      * @return
      */
-    Map<String,Boolean> hasIndexErrData(Integer organId);
+    Map<String,Boolean> hasIndexErrData(String organId);
 
     PageInfo<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds, OrganCloudStudyStudentDataQueryInfo queryInfo);
 }

+ 14 - 30
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java

@@ -3,10 +3,7 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.EducationBaseQueryInfo;
-import com.ym.mec.biz.dal.page.MusicMemberQueryInfo;
-import com.ym.mec.common.entity.Mapper;
 import com.ym.mec.common.service.BaseService;
-import org.apache.poi.ss.formula.functions.T;
 
 import java.util.*;
 
@@ -45,45 +42,32 @@ public interface OrganizationService extends BaseService<Integer, Organization>
     Map<String,Map<Integer,String>> getOrganRole(List<Integer> organIds);
 
     /**
-    * @description: 获取当前用户所在分部最高角色权限
-     * @param organId
-     * @param userId
-    * @return com.ym.mec.biz.dal.enums.SysUserRoleEnum
-    * @author zx
-    * @date 2022/1/6 11:29
-    */
-    SysUserRoleEnum getOrganRole(Integer organId,Integer userId);
-
-    /**
-    * @description: 获取当前用户所在分部所有权限
-     * @param organId
-     * @param userId
-    * @return com.ym.mec.biz.dal.enums.SysUserRoleEnum
+    * @description: 获取员工能访问的分部列表
+     * @param userId 当前用户
+     * @param organIds 用户选择的分部
+     * @param isSuper 是否超管
+    * @return java.lang.String
     * @author zx
-    * @date 2022/1/6 11:29
+    * @date 2022/1/5 12:44
     */
-    List<SysUserRoleEnum> queryOrganRole(Integer organId,Integer userId);
+    String getEmployeeOrgan(Integer userId,String organIds,Boolean isSuper);
 
     /**
-    * @description: 获取分部的管理人员
-     * @param roleArr
-     * @param organId
-    * @return java.util.Set<java.lang.Integer>
+    * @description: 获取员工能访问的分部列表
+     * @param organIds 用户选择的分部
+    * @return java.lang.String
     * @author zx
-    * @date 2022/1/4 11:36
+    * @date 2022/1/5 12:44
     */
-    Set<Integer> queryUserIdByRoleId(SysUserRoleEnum[] roleArr, Integer organId);
+    String getEmployeeOrgan(String organIds);
 
     /**
-    * @description: 获取员工能访问的分部列表
-     * @param userId 当前用户
-     * @param organIds 用户选择的分部
-     * @param isSuper 是否超管
+    * @description: 获取老师所在分部列表(包含流动分部)
     * @return java.lang.String
     * @author zx
     * @date 2022/1/5 12:44
     */
-    String getEmployeeOrgan(Integer userId,String organIds,Boolean isSuper);
+    String getTeacherOrgan();
 
     List<Organization> findAllOrgans(Integer tenantId);
 

+ 32 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/SysEmployeePositionService.java

@@ -2,10 +2,12 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.SysEmployeePosition;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public interface SysEmployeePositionService extends BaseService<Integer, SysEmployeePosition> {
 
@@ -14,11 +16,40 @@ public interface SysEmployeePositionService extends BaseService<Integer, SysEmpl
     void delPosition(Integer userId, Integer tenantId);
 
     /**
-    * @description: 获取机构所有职位,员工列表
+    * @description: 获取分部下所有职位,员工列表
      * @param
     * @return void
     * @author zx
     * @date 2022/1/8 11:29
     */
     Map<String, List<SimpleUserDto>> findOrganPosition(String organIds);
+
+    /**
+    * @description: 查询当前用户是否只有指定角色
+     * @param role
+     * @param userId
+    * @return java.lang.Boolean
+    * @author zx
+    * @date 2022/1/8 14:15
+    */
+    Boolean onlyForRole(SysUserRoleEnum role, Integer userId,Boolean isSuper);
+
+    /**
+    * @description: 获取用户所有角色
+     * @param
+    * @return java.util.List<com.ym.mec.biz.dal.enums.SysUserRoleEnum>
+    * @author zx
+    * @date 2022/1/8 16:06
+    */
+    List<SysUserRoleEnum> queryAllRole(Integer userId,Boolean isSuper);
+
+    /**
+     * @description: 获取分部的管理人员
+     * @param roleArr
+     * @param organId
+     * @return java.util.Set<java.lang.Integer>
+     * @author zx
+     * @date 2022/1/4 11:36
+     */
+    Set<Integer> queryUserIdByRoleId(SysUserRoleEnum[] roleArr, Integer organId);
 }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -4,7 +4,7 @@ import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
 import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
 import static com.ym.mec.biz.dal.enums.GroupType.VIP;
 import static com.ym.mec.biz.dal.enums.PracticeGroupType.*;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
@@ -4061,7 +4061,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		Map<String, Long> memo = new HashMap<>(1);
 		memo.put("courseScheduleComplaintsId", courseScheduleComplaints.getId());
-		sendSeoMessageSource.sendSeoMessage(user.getOrganId(),new SysUserRoleEnum[]{SECTION_MANAGER},
+		sendSeoMessageSource.sendSeoMessage(user.getOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER},
 				JSONObject.toJSONString(memo),targetUserId,MessageTypeEnum.BACKSTAGE_STUDENT_APPEAL,courseSchedule.getName(), user.getUsername());
     }
 

+ 1 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeServiceImpl.java

@@ -6,7 +6,6 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.EmployeeDto;
 import com.ym.mec.biz.dal.dto.EmployeeLevelDto;
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.SysUserCashAccount;
@@ -35,6 +34,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
+
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -259,11 +259,6 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  imp
 	}
 
 	@Override
-	public List<SimpleUserDto> findByRole(String roleIds, String organIds) {
-		return employeeDao.findByRole(roleIds,organIds);
-	}
-
-	@Override
 	public HashMap<String, Integer> hasCourseGroupRelation(Integer employeeId) {
 		Integer hasCourseGroupRelation = employeeDao.hasCourseGroupRelation(employeeId);
 		Integer hasCourseSchedule = employeeDao.hasCourseSchedule(employeeId);
@@ -415,11 +410,6 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  imp
 	}
 
 	@Override
-	public List<SimpleUserDto> findAllByRole(String roleIds, String organIds) {
-		return employeeDao.findAllByRole(roleIds,organIds);
-	}
-
-	@Override
 	public List<Integer> queryUserRole(Integer sysUserId) {
 		return employeeDao.queryUserRole(sysUserId);
 	}

+ 45 - 41
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.IndexDataType.*;
 import static com.ym.mec.biz.dal.enums.IndexErrorType.WAIT_CREATE_PAYMENT_CALENDER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATION;
 
 @Service
 public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBaseMonthData> implements IndexBaseMonthDataService {
@@ -72,6 +73,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	private MusicGroupPerformanceDao musicGroupPerformanceDao;
 	@Autowired
 	private StudentDao studentDao;
+	@Autowired
+	private SysEmployeePositionService employeePositionService;
 
 	private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
 		@Override
@@ -361,7 +364,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			saveData(indexBaseMonthDataDao.getMusicData(dayStr,tenantId), dayStr, IndexDataType.PROGRESS_MUSIC_GROUP_NUM, tenantId);
 		}
 		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(TRANSACTION_TEACHER_NUM)) {
-			List<SimpleUserDto> transactionTeachers = employeeService.findByRole("58", null);
+			Map<String, List<SimpleUserDto>> organPosition = employeePositionService.findOrganPosition(null);
+			List<SimpleUserDto> transactionTeachers = organPosition.get(SysUserRoleEnum.JOIN_TEACHER.name());
 			Map<Integer, Integer> organTeacherNumMap = new HashMap<>();
 			for (SimpleUserDto transactionTeacher : transactionTeachers) {
 				Set<Integer> organIds = Arrays.stream(transactionTeacher.getOrganIds().split(",")).map(s -> Integer.valueOf(s)).collect(Collectors.toSet());
@@ -608,25 +612,26 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
-	public Map<String, Object> getIndexErrData(Integer organId, IndexErrorType errorType) {
-		Integer tenantId = TenantContextHolder.getTenantId();
+	public Map<String, Object> getIndexErrData(String organIdsStr, IndexErrorType errorType) {
 		//只筛选指定时间之后的数据
 		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 
-		Set<Integer> organIds = new HashSet<>();
-		organIds.add(organId);
+		Set<Integer> organIds = null;
+		if(StringUtils.isNotBlank(organIdsStr)){
+			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
+		}
 		List<IndexErrInfoDto> all = new ArrayList<>();
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
 		List<Long> classGroupIds = null;
 		Integer educationUserId = null;
-		SysUserRoleEnum userRoleEnum = organizationService.getOrganRole(organId, sysUser.getId());
-		if (!sysUser.getIsSuperAdmin() && userRoleEnum == SysUserRoleEnum.EDUCATIONAL_TEACHER) {
+		Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION,sysUser.getId(),sysUser.getIsSuperAdmin());
+		if (onlyForRole) {
 			//获取教务老师关联的班级列表
 			classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
 			educationUserId = sysUser.getId();
 		}
-		
+		Integer tenantId = TenantContextHolder.getTenantId();
 		if(IndexErrorType.MUSIC_PATROL.equals(errorType)){
 			IndexErrInfoDto<IndexErrInfoDto> one = new IndexErrInfoDto<>();
 			one.setErrorType(IndexErrorType.MUSIC_PATROL);
@@ -674,7 +679,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 
 			//乐团学员会员到期首页提醒
-			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organId.toString());
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
 			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
 			Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
 			Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
@@ -683,11 +688,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			noClassMusicGroupStudentInfo.setNum2(userIds.size());
 			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
 			twoChild.add(noClassMusicGroupStudentInfo);
-
-//			int attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
-//			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo, null));
-//			int attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),startTime);
-//			twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1, null));
 			two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 			two.setResult(twoChild);
 			all.add(two);
@@ -701,20 +701,20 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 			//课程时间安排异常
 			Integer userId = null;
-			if (userRoleEnum != SysUserRoleEnum.SECTION_MANAGER && !sysUser.getIsSuperAdmin()) {
+			if (onlyForRole) {
 				userId = sysUser.getId();
 			}
 
 			//乐团巡查任务未计划
-			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organId.toString(),startTime,userId,tenantId);
+			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr,startTime,userId,tenantId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem, null));
 
 			//乐团巡查任务未提交
-			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organId.toString(),startTime,tenantId);
+			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr,startTime,tenantId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM_PLAN, IndexErrorType.INSPECTION_ITEM_PLAN.getMsg(),inspectionItemPlan, null));
 
 			//回访任务未完成
-			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organId.toString(),startTime,userId,tenantId);
+			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr,startTime,userId,tenantId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_VISIT, IndexErrorType.STUDENT_VISIT.getMsg(),studentVisit, null));
 
 			three.setNum(threeChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
@@ -791,11 +791,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		Date date = new Date();
 
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+		Boolean onlyForRole = employeePositionService.onlyForRole(EDUCATION, sysUser.getId(), sysUser.getIsSuperAdmin());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
 		List<Long> classGroupIds = null;
 		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+		if (onlyForRole) {
 			//获取教务老师关联的班级列表
 			classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
 			educationUserId = sysUser.getId();
@@ -1030,19 +1030,21 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
-	public List<IndexErrInfoDto> getRemindMatterData(Integer organId) {
+	public List<IndexErrInfoDto> getRemindMatterData(String organIds) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			throw new BizException("用户信息获取失败");
 		}
 		Integer tenantId = TenantContextHolder.getTenantId();
 
-		Set<Integer> organIdSet = new HashSet<>();
-		organIdSet.add(organId);
+		Set<Integer> organIdSet = null;
+		if(StringUtils.isNotBlank(organIds)){
+			organIdSet = Arrays.stream(organIds.split(",")).map(Integer::new).collect(Collectors.toSet());
+		}
 		//当前用户是否是分部经理
-		SysUserRoleEnum organRole = organizationService.getOrganRole(organId, sysUser.getId());
+		Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION,sysUser.getId(),sysUser.getIsSuperAdmin());
 		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && organRole != SysUserRoleEnum.SECTION_MANAGER) {
+		if (onlyForRole) {
 			//获取教务老师关联的班级列表
 			educationUserId = sysUser.getId();
 		}
@@ -1056,7 +1058,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
 		//全职未离职老师
 		//预计课酬较低
-		int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organId.toString(),monthStr, tenantId);
+		int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIds,monthStr, tenantId);
 		result.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
 
 		//乐团学员会员即将到期首页提醒
@@ -1064,7 +1066,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		if (StringUtils.isEmpty(configValue)) {
 			configValue = "15";
 		}
-		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organId.toString());
+		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIds);
 		Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
 		Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
 		IndexErrInfoDto infoDto = new IndexErrInfoDto();
@@ -1075,7 +1077,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		result.add(infoDto);
 
 		//乐团展演计划提醒
-		List<MusicGroupPerformance> musicGroupPerformances = musicGroupPerformanceDao.findNoStart(educationUserId,organId.toString());
+		List<MusicGroupPerformance> musicGroupPerformances = musicGroupPerformanceDao.findNoStart(educationUserId,organIds);
 		IndexErrInfoDto infoDto1 = new IndexErrInfoDto();
 		infoDto1.setErrorType(IndexErrorType.MUSIC_GROUP_PERFORMANCE);
 		infoDto1.setNum(musicGroupPerformances.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet()).size());
@@ -1086,19 +1088,21 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
-	public Map<String,Boolean> hasIndexErrData(Integer organId) {
+	public Map<String,Boolean> hasIndexErrData(String organIdsStr) {
 		Integer tenantId = TenantContextHolder.getTenantId();
 		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 
 		Map<String,Boolean> resultMap = new HashMap<>();
-		Set<Integer> organIds = new HashSet<>();
-		organIds.add(organId);
+		Set<Integer> organIds = null;
+		if(StringUtils.isNotBlank(organIdsStr)){
+			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
+		}
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		SysUserRoleEnum organRole = organizationService.getOrganRole(organId, sysUser.getId());
+		Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION,sysUser.getId(),sysUser.getIsSuperAdmin());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
 		List<Long> classGroupIds = null;
 		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && organRole == SysUserRoleEnum.EDUCATIONAL_TEACHER) {
+		if (onlyForRole) {
 			//获取教务老师关联的班级列表
 			classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
 			educationUserId = sysUser.getId();
@@ -1153,7 +1157,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			if (StringUtils.isEmpty(configValue)) {
 				configValue = "15";
 			}
-			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organId.toString());
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIdsStr);
 			if(studentRegistrations.size() > 0){
 				flag2 = true;
 			}
@@ -1163,24 +1167,24 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		boolean flag3 = false;
 
 		Integer userId = null;
-		if (organRole != SysUserRoleEnum.SECTION_MANAGER && !sysUser.getIsSuperAdmin()) {
+		if (onlyForRole) {
 			userId = sysUser.getId();
 		}
 
 		if(!flag3){
-			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organId.toString(),startTime,userId, tenantId);
+			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr,startTime,userId, tenantId);
 			if(inspectionItem > 0){
 				flag3 = true;
 			}
 		}
 		if(!flag3){
-			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organId.toString(),startTime, tenantId);
+			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr,startTime, tenantId);
 			if(inspectionItemPlan > 0){
 				flag3 = true;
 			}
 		}
 		if(!flag3){
-			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organId.toString(),startTime,userId, tenantId);
+			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr,startTime,userId, tenantId);
 			if(studentVisit > 0){
 				flag3 = true;
 			}
@@ -1241,7 +1245,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		boolean flag5 = false;
 		if(!flag5){
 			String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
-			int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organId.toString(),monthStr, tenantId);
+			int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr, tenantId);
 			if(lowTeacherSalary > 0){
 				flag5 = true;
 			}
@@ -1254,7 +1258,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		if(!flag5){
 			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organId.toString(),tenantId);
+			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIdsStr,tenantId);
 			if(musicGroupIds.size() > 0){
 				String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
 				date = new Date();
@@ -1267,7 +1271,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		if(!flag5){
 			if(!flag5){
-				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organId.toString());
+				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
 				if(studentRegistrations.size() > 0){
 					flag5 = true;
 				}

+ 7 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexErrDataRecordServiceImpl.java

@@ -11,10 +11,12 @@ import com.ym.mec.biz.dal.dto.TeacherVisitDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.IndexErrorType;
 import com.ym.mec.biz.dal.enums.InspectionItemEnum;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 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.SysEmployeePositionService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
@@ -66,6 +68,8 @@ public class IndexErrDataRecordServiceImpl extends BaseServiceImpl<Long, IndexEr
 	private PracticeGroupDao practiceGroupDao;
 	@Autowired
 	private OrganizationDao organizationDao;
+	@Autowired
+	private SysEmployeePositionService employeePositionService;
 
 	@Override
 	public BaseDAO<Long, IndexErrDataRecord> getDAO() {
@@ -400,14 +404,15 @@ public class IndexErrDataRecordServiceImpl extends BaseServiceImpl<Long, IndexEr
 	@Override
 	public PageInfo<CourseScheduleEndDto> queryHistoryErrCourseData(EndCourseScheduleQueryInfo queryInfo) {
 		PageInfo<CourseScheduleEndDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+
 		Map<String, Object> params = new HashMap<>(16);
 		MapUtil.populateMap(params, queryInfo);
 
 		List<CourseScheduleEndDto> results;
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+		Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION, sysUser.getId(), sysUser.getIsSuperAdmin());
+		if (onlyForRole) {
 			List<Long> classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
 			if(classGroupIds.size() == 0){
 				return pageInfo;

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -49,7 +49,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.ST
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.*;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.*;
 import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 
 @Service
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
@@ -498,7 +498,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (status == AUDITING) {
 			// 如果是审核中
 			Organization organization = organizationDao.get(musicGroup.getOrganId());
-			sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{SECTION_MANAGER},
+			sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER},
 					null,null,MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT,organization.getName(), musicGroup.getName());
 		}else {
 			imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
@@ -679,7 +679,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (status == AUDITING) {
 			// 如果是审核中
 			Organization organization = organizationDao.get(musicGroup.getOrganId());
-			sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{SECTION_MANAGER},
+			sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER},
 					null,null,MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT,organization.getName(), musicGroup.getName());
 		}
 		return batchNo;
@@ -1080,7 +1080,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (status == AUDITING) {
 			// 如果是审核中
 			Organization organization = organizationDao.get(musicGroup.getOrganId());
-			sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{SECTION_MANAGER},
+			sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER},
 					null,null,MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT,organization.getName(), musicGroup.getName());
 		}else {
 			if(paymentType == ADD_STUDENT){

+ 22 - 19
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -53,7 +53,7 @@ import static com.ym.mec.biz.dal.entity.ApprovalStatus.PROCESSING;
 import static com.ym.mec.biz.dal.enums.DealStatusEnum.SUCCESS;
 import static com.ym.mec.biz.dal.enums.OrderDetailTypeEnum.*;
 import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
@@ -186,6 +186,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private SysCouponCodeService sysCouponCodeService;
     @Autowired
     private SendSeoMessageSource sendSeoMessageSource;
+    @Autowired
+    private SysEmployeePositionService employeePositionService;
 
     private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
 
@@ -229,7 +231,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         String event = musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT ? "新建乐团,提交审核" : "保存乐团草稿";
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, event, sysUser.getId(), ""));
         if (musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT) {
-            sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+            sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                     null, null, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, sysUser.getRealName(), musicGroup.getName());
         }
         // 保存乐团付费主体列表
@@ -1309,7 +1311,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
             musicGroupSubjectGoodsGroupDao.batchInsert(subFeeSettingDto.getMusicGroupSubjectGoodsGroups(), musicGroupId);
         }
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, null, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, sysUser.getRealName(), musicGroup.getName());
     }
 
@@ -1383,7 +1385,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_MUSIC_GROUP_COURSE_ADD_PLAN,
                     map, null, 0, "1", "TEACHER", musicGroup.getName());
         }
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 "1", musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_ACTION_GROUP, musicGroup.getName());
 
         //统计变更学员数
@@ -1415,7 +1417,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交审核(草稿 -> 审核中)", sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
         musicGroupDao.update(musicGroup);
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, null, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, sysUser.getRealName(), musicGroup.getName());
     }
 
@@ -1686,7 +1688,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         //记录建团日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "取消乐团", sysUser.getId(), ""));
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 "1", musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_STOP, musicGroup.getName());
         return true;
     }
@@ -1826,7 +1828,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "延长缴费", sysUser.getId(), ""));
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_LENGTHEN_PAYMENT, musicGroup.getName());
         return true;
     }
@@ -1936,17 +1938,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupQuit.setIsVisit(reqMusicGroupQuit.getIsVisit());
         musicGroupQuit.setVisitTime(reqMusicGroupQuit.getVisitTime());
         musicGroupQuit.setStatus(PROCESSING);
-        musicGroupQuit.setCurrentApproveRole(SysUserRole.EDUCATIONAL_TEACHER + "");
+        musicGroupQuit.setCurrentApproveRole(SysUserRoleEnum.EDUCATION + "");
 
         if (currentOperatorRoleIds != null && currentOperatorRoleIds.size() > 0) {
-            if (!currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
+            if (!currentOperatorRoleIds.contains(SysUserRoleEnum.ORGAN_MANAGER) && currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATION)) {
 
                 if (musicGroupQuit.getStatus() == ApprovalStatus.APPROVED) {
                     throw new BizException("只能分部经理操作退团");
                 }
-                musicGroupQuit.setCurrentApproveRole(SysUserRoleEnum.SECTION_MANAGER.ordinal() + "");
+                musicGroupQuit.setCurrentApproveRole(SysUserRoleEnum.ORGAN_MANAGER.ordinal() + "");
             }
-            if (currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && !currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
+            if (currentOperatorRoleIds.contains(SysUserRoleEnum.ORGAN_MANAGER) && !currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATION)) {
 
                 throw new BizException("只能乐团主管操作退团申请");
             }
@@ -1994,7 +1996,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SYSTEM_PUSH_STUDENT_COMMIT_QUIT_MUSIC_APPLY, receivers, null, 0, null,
                     "SYSTEM", musicGroup.getName(), sysUser.getUsername());
 
-            sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+            sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                     JSONObject.toJSONString(memo), null, MessageTypeEnum.BACKSTAGE_STUDENT_APPLY_QUIT_GROUP, sysUser.getUsername());
         } else {
             musicGroupQuit.setStatus(reqMusicGroupQuit.getStatus());
@@ -2049,9 +2051,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         Date date = new Date();
 
         //如果发起退团申请的是乐团主管
-        if (!currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
+        if (!currentOperatorRoleIds.contains(SysUserRoleEnum.ORGAN_MANAGER) && currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATION)) {
 
-            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.EDUCATIONAL_TEACHER.ordinal() + "")) {
+            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.EDUCATION.ordinal() + "")) {
                 throw new BizException("只有分部经理才能审核");
             }
 
@@ -2060,8 +2062,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        if (currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && !currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
-            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.SECTION_MANAGER.ordinal() + "")) {
+        if (currentOperatorRoleIds.contains(SysUserRoleEnum.ORGAN_MANAGER) && !currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATION)) {
+            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.ORGAN_MANAGER.ordinal() + "")) {
                 throw new BizException("先需乐团主管审核");
             }
         }
@@ -3087,8 +3089,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         PageInfo<MusicGroup> musicGroupPageInfo;
         //待创建缴费项目提醒
         if ("WAIT_CREATE_PAYMENT_CALENDER".equals(queryInfo.getSearchType())) {
+            Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION, sysUser.getId(), sysUser.getIsSuperAdmin());
             Integer educationUserId = null;
-            if (!sysUser.getIsSuperAdmin() && roles.size() == 1 && roles.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+            if (onlyForRole) {
                 educationUserId = sysUser.getId();
             }
             //获取关联的乐团列表
@@ -3466,7 +3469,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                         map, null, 0, "", "", musicGroup.getName(), studentApplyUrl);
             }
         }
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER}, null,
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER}, null,
                 musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_ACTION_PAYMENT, musicGroup.getName());
         return musicGroup;
     }
@@ -3581,7 +3584,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 //                }
 //            }
 //        }
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_MARKING, musicGroup.getName());
     }
 

+ 43 - 112
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java

@@ -1,43 +1,35 @@
 package com.ym.mec.biz.service.impl;
 
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATIONAL_TEACHER;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.JOIN_TEACHER;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.REPAIR;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.StringJoiner;
-import java.util.stream.Collectors;
-
-import com.ym.mec.biz.dal.entity.TenantInfo;
-import com.ym.mec.biz.service.TenantInfoService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.OrganizationDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.entity.TenantInfo;
 import com.ym.mec.biz.dal.enums.FivePlusGradeEnum;
 import com.ym.mec.biz.dal.enums.GradeTypeEnum;
 import com.ym.mec.biz.dal.enums.SixPlusGradeEnum;
-import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.EducationBaseQueryInfo;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysEmployeePositionService;
+import com.ym.mec.biz.service.TenantInfoService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATION;
 
 @Service
 public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organization> implements OrganizationService {
@@ -54,6 +46,8 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	private ClassGroupDao classGroupDao;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private SysEmployeePositionService employeePositionService;
 
 	@Override
 	public BaseDAO<Integer, Organization> getDAO() {
@@ -160,92 +154,6 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	}
 
 	@Override
-	public List<SysUserRoleEnum> queryOrganRole(Integer organId, Integer userId) {
-		List<SysUserRoleEnum> roleEnums = new ArrayList<>();
-		Organization organization = organizationDao.get(organId);
-		if(organization == null){
-			throw new BizException("分部信息不存在");
-		}
-		if(StringUtils.isNotEmpty(organization.getOrganManager())){
-			if(organization.getOrganManager().contains(userId.toString())){
-				roleEnums.add(SECTION_MANAGER);
-			}
-		}
-		if(StringUtils.isNotEmpty(organization.getEducationId())){
-			if(organization.getEducationId().contains(userId.toString())){
-				roleEnums.add(EDUCATIONAL_TEACHER);
-			}
-		}
-		if(StringUtils.isNotEmpty(organization.getRepairId())){
-			if(organization.getRepairId().contains(userId.toString())){
-				roleEnums.add(REPAIR);
-			}
-		}
-		if(StringUtils.isNotEmpty(organization.getJoinTeacherId())){
-			if(organization.getJoinTeacherId().contains(userId.toString())){
-				roleEnums.add(JOIN_TEACHER);
-			}
-		}
-		return roleEnums;
-	}
-
-	@Override
-	public SysUserRoleEnum getOrganRole(Integer organId, Integer userId) {
-		Organization organization = organizationDao.get(organId);
-		if(organization == null){
-			throw new BizException("分部信息不存在");
-		}
-		if(StringUtils.isNotEmpty(organization.getOrganManager())){
-			if(organization.getOrganManager().contains(userId.toString())){
-				return SECTION_MANAGER;
-			}
-		}
-		if(StringUtils.isNotEmpty(organization.getEducationId())){
-			if(organization.getEducationId().contains(userId.toString())){
-				return EDUCATIONAL_TEACHER;
-			}
-		}
-		if(StringUtils.isNotEmpty(organization.getRepairId())){
-			if(organization.getRepairId().contains(userId.toString())){
-				return REPAIR;
-			}
-		}
-		if(StringUtils.isNotEmpty(organization.getJoinTeacherId())){
-			if(organization.getJoinTeacherId().contains(userId.toString())){
-				return JOIN_TEACHER;
-			}
-		}
-		return null;
-	}
-
-	@Override
-    public Set<Integer> queryUserIdByRoleId(SysUserRoleEnum[] roleArr, Integer organId) {
-		Organization organization = organizationDao.get(organId);
-		if(organization == null){
-			throw new BizException("分部信息不存在");
-		}
-		if(roleArr == null || roleArr.length == 0){
-			return new HashSet<>();
-		}
-		StringJoiner stringJoiner = new StringJoiner(",");
-		for (SysUserRoleEnum e : roleArr) {
-			if(SECTION_MANAGER.equals(e) && StringUtils.isNotEmpty(organization.getOrganManager())){
-				stringJoiner.add(organization.getOrganManager());
-			}else if (EDUCATIONAL_TEACHER.equals(e) && StringUtils.isNotEmpty(organization.getEducationId())){
-				stringJoiner.add(organization.getEducationId());
-			}else if(REPAIR.equals(e) && StringUtils.isNotEmpty(organization.getRepairId())){
-				stringJoiner.add(organization.getRepairId());
-			}else if(JOIN_TEACHER.equals(e) && StringUtils.isNotEmpty(organization.getJoinTeacherId())){
-				stringJoiner.add(organization.getJoinTeacherId());
-			}
-		}
-		if(stringJoiner.length() > 0) {
-			return Arrays.stream(stringJoiner.toString().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toSet());
-		}
-		return new HashSet<>();
-	}
-
-	@Override
 	public String getEmployeeOrgan(Integer userId, String organIds,Boolean isSuper) {
 		if(StringUtils.isEmpty(organIds)){
 			Integer tenantId = TenantContextHolder.getTenantId();
@@ -268,6 +176,29 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	}
 
 	@Override
+	public String getEmployeeOrgan(String organIds) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		return this.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
+	}
+
+	@Override
+	public String getTeacherOrgan() {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		Teacher teacher = teacherDao.get(sysUser.getId());
+		String organIds = teacher.getTeacherOrganId() + "";
+		if(StringUtils.isNotBlank(teacher.getFlowOrganRange())){
+			organIds = organIds + "," + teacher.getFlowOrganRange();
+		}
+		return organIds;
+	}
+
+	@Override
 	public List<Organization> findAllOrgans(Integer tenantId) {
 		return organizationDao.findAllOrgans(tenantId);
 	}
@@ -295,9 +226,9 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		if (sysUser == null) {
 			throw new BizException("用户信息获取失败");
 		}
-		SysUserRoleEnum organRole = this.getOrganRole(Integer.parseInt(queryInfo.getOrganIds()), sysUser.getId());
+		Boolean onlyForRole = employeePositionService.onlyForRole(EDUCATION, sysUser.getId(), sysUser.getIsSuperAdmin());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
-		if (organRole == SysUserRoleEnum.EDUCATIONAL_TEACHER && !sysUser.getIsSuperAdmin()) {
+		if (onlyForRole) {
 			queryInfo.setEducationUserId(sysUser.getId());
 		}
 		return queryInfo;

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformProductServiceImpl.java

@@ -86,15 +86,15 @@ public class PlatformProductServiceImpl extends ServiceImpl<PlatformProductDao,
     /**
      * 检查哪些机构用了这个产品,需要修改对应的权限
      *
-     * @param menuIds       修改后的的菜单id,用逗号隔开
+     * @param afterMenuIds       修改后的的菜单id,用逗号隔开
      * @param sourceMenuIds 修改之前的的菜单id,用逗号隔开
      * @param map           Map<机构id,机构的管理员id> queryProductInTenant
      */
-    public void checkUpdateRole(String menuIds, String sourceMenuIds, Map<Integer, Integer> map) {
+    public void checkUpdateRole(String afterMenuIds, String sourceMenuIds, Map<Integer, Integer> map) {
         //需要删除的菜单id
         List<Integer> deleteList = getList(sourceMenuIds);
         //需要添加的菜单id
-        List<Integer> addList = getList(menuIds);
+        List<Integer> addList = getList(afterMenuIds);
         //求新旧产品菜单的差异
         WrapperUtil.listDifference(deleteList, addList);
         //修改数据

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.*;
@@ -104,6 +105,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     private ActivityUserMapperDao activityUserMapperDao;
     @Autowired
     private SysTenantConfigService sysTenantConfigService;
+    @Autowired
+    private SysEmployeePositionService employeePositionService;
 
     @Override
     public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
@@ -925,6 +928,17 @@ public class StudentManageServiceImpl implements StudentManageService {
         String currentMonth = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
         params.put("totalMonth", totalMonth);
         params.put("currentMonth", currentMonth);
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        //当前用户是否是分部经理
+        Boolean onlyForRole = employeePositionService.onlyForRole(SysUserRoleEnum.EDUCATION,sysUser.getId(),sysUser.getIsSuperAdmin());
+        if (onlyForRole) {
+            //获取教务老师关联的班级列表
+            List<Long> classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
+            if(classGroupIds == null || classGroupIds.size() == 0){
+                return pageInfo;
+            }
+            params.put("classGroupIds", classGroupIds);
+        }
         params.put("studentErrorLeaveNum",studentErrorLeaveNum);
         int count = indexBaseMonthDataDao.countStudentErrorLeave1(params);
         List<StudentErrorLeaveDto> dataList = new ArrayList<>();

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -44,7 +44,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_P
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
 import static com.ym.mec.biz.dal.enums.OrderDetailTypeEnum.*;
 import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 
 @Service
 public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, StudentRegistration> implements StudentRegistrationService {
@@ -229,7 +229,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, subId, 1);
             MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 
-            sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+            sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                     null, musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_STUDENT_SUBJECT_CHANGE, musicGroup.getName());
         }
         return i;
@@ -921,7 +921,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         imFeignService.update(new ImUserModel(userId.toString(), sysUser.getUsername(), sysUser.getAvatar()));
 
         //学生报名表
-        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_ADD_STUDENT, musicGroup.getName(), studentRegistration.getName());
         return userId;
     }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentWithdrawServiceImpl.java

@@ -33,7 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.util.*;
 
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 
 @Service
 public class StudentWithdrawServiceImpl extends BaseServiceImpl<Integer, StudentWithdraw> implements StudentWithdrawService {
@@ -193,7 +193,7 @@ public class StudentWithdrawServiceImpl extends BaseServiceImpl<Integer, Student
 				cashAccountDetail.setStatus(DealStatusEnum.ING);
 				cashAccountDetail.setAttribute(withdraw.getId()+"");
 				cashAccountDetailService.insert(cashAccountDetail);
-				sendSeoMessageSource.sendSeoMessage(sysUser.getOrganId(),new SysUserRoleEnum[]{SECTION_MANAGER},
+				sendSeoMessageSource.sendSeoMessage(sysUser.getOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER},
 						null,null,MessageTypeEnum.BACKSTAGE_STUDENT_APPLY_WITHDRAW, sysUser.getUsername());
 			} else {
 				throw new BizException("账户余额不足");

+ 50 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysEmployeePositionServiceImpl.java

@@ -1,10 +1,12 @@
 package com.ym.mec.biz.service.impl;
 
-import com.mysql.cj.xdevapi.Collection;
 import com.ym.mec.biz.dal.dao.SysEmployeePositionDao;
 import com.ym.mec.biz.dal.dao.SysPositionDao;
+import com.ym.mec.biz.dal.dao.TenantInfoDao;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.SysEmployeePosition;
+import com.ym.mec.biz.dal.entity.TenantInfo;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.service.SysEmployeePositionService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
@@ -14,9 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -26,6 +26,8 @@ public class SysEmployeePositionServiceImpl extends BaseServiceImpl<Integer, Sys
 	private SysEmployeePositionDao sysEmployeePositionDao;
 	@Autowired
 	private SysPositionDao positionDao;
+	@Autowired
+	private TenantInfoDao tenantInfoDao;
 
 	@Override
 	public BaseDAO<Integer, SysEmployeePosition> getDAO() {
@@ -59,4 +61,48 @@ public class SysEmployeePositionServiceImpl extends BaseServiceImpl<Integer, Sys
 		}
 		return new HashMap<>();
     }
+
+    @Override
+    public Boolean onlyForRole(SysUserRoleEnum role, Integer userId,Boolean isSuper) {
+		//如果是超管
+		if(isSuper){
+			return false;
+		}
+		//如果是机构管理员
+		Integer tenantId = TenantContextHolder.getTenantId();
+		TenantInfo tenantInfo = tenantInfoDao.selectById(tenantId);
+		if(tenantInfo.getUserId() != null && tenantInfo.getUserId().equals(userId)){
+			return false;
+		}
+		//判断角色
+		List<SysUserRoleEnum> roleEnums = sysEmployeePositionDao.queryPositionList(userId,tenantId);
+		if(roleEnums != null && roleEnums.size() == 1 && roleEnums.contains(role)){
+			return true;
+		}
+		return false;
+    }
+
+	@Override
+	public List<SysUserRoleEnum> queryAllRole(Integer userId,Boolean isSuper) {
+		//如果是超管
+		if(isSuper){
+			return new ArrayList<>(Arrays.asList(SysUserRoleEnum.values()));
+		}
+		//如果是机构管理员
+		Integer tenantId = TenantContextHolder.getTenantId();
+		TenantInfo tenantInfo = tenantInfoDao.selectById(tenantId);
+		if(tenantInfo.getUserId() != null && tenantInfo.getUserId().equals(userId)){
+			return new ArrayList<>(Arrays.asList(SysUserRoleEnum.values()));
+		}
+		return sysEmployeePositionDao.queryPositionList(userId,tenantId);
+	}
+
+    @Override
+    public Set<Integer> queryUserIdByRoleId(SysUserRoleEnum[] roleArr, Integer organId) {
+		if(roleArr == null || roleArr.length == 0 || organId == null){
+			return new HashSet<>();
+		}
+		Integer tenantId = TenantContextHolder.getTenantId();
+		return sysEmployeePositionDao.queryUserIdByRoleId(roleArr,organId,tenantId);
+    }
 }

+ 17 - 27
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherLeaveRecordServiceImpl.java

@@ -1,32 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
-import com.ym.mec.biz.event.source.SendSeoMessageSource;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.entity.HttpResponseResult;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.TeacherLeaveRecordDao;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
@@ -36,18 +12,32 @@ import com.ym.mec.biz.dal.entity.TeacherLeaveRecord;
 import com.ym.mec.biz.dal.entity.TeacherLeaveRecord.CoursesScheduleHistory;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
+import com.ym.mec.biz.event.source.SendSeoMessageSource;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.biz.service.TeacherLeaveRecordService;
+import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.json.JsonUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.stream.Collectors;
 
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATIONAL_TEACHER;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATION;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 
 @Service
 public class TeacherLeaveRecordServiceImpl extends BaseServiceImpl<Long, TeacherLeaveRecord> implements TeacherLeaveRecordService {
@@ -114,7 +104,7 @@ public class TeacherLeaveRecordServiceImpl extends BaseServiceImpl<Long, Teacher
 		Teacher teacher = teacherDao.get(sysUser.getId());
 		Map<String,Object> memo = new HashMap<>(1);
 		memo.put("leaveRecordId",teacherLeaveRecord.getId());
-		sendSeoMessageSource.sendSeoMessage(teacher.getTeacherOrganId(),new SysUserRoleEnum[]{SECTION_MANAGER,EDUCATIONAL_TEACHER},
+		sendSeoMessageSource.sendSeoMessage(teacher.getTeacherOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER,EDUCATION},
 				JSONObject.toJSONString(memo),null,MessageTypeEnum.EDUCATION_PUSH_TEACHER_LEAVE_APPLY, sysUser.getRealName());
 		return true;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -538,6 +538,16 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         productInfo.setPayAmount(productInfo.getPayAmount().add(amount));
         productInfo.setExpiryCount(productInfo.getExpiryCount() + val);
         tenantProductInfoService.updateById(productInfo);
+
+        TenantInfo tenantInfo = this.getById(productInfo.getTenantId());
+
+        //发送邮件提醒
+        Map<Integer, String> receivers = new HashMap<>();
+        receivers.put(tenantInfo.getUserId(), tenantInfo.getEmail());
+        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.EMAIL,
+                MessageTypeEnum.EMAIL_TENANT_RENEWAL_SUCCESSFUL, receivers, null, 0, null,
+                "SYSTEM", tenantInfo.getName());
+
     }
 
     private TenantProductInfo getProductInfo(Integer tenantId) {

+ 10 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantOrderRecordServiceImpl.java

@@ -145,7 +145,7 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
     private void open(TenantOrderRecord record) {
         //机构产品信息
         TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
-                .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_",0));
+                .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_", 0));
         //修改机构信息
         TenantInfo tenantInfo = new TenantInfo();
         tenantInfo.setId(record.getTenantId());
@@ -157,14 +157,14 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
         tenantProductInfoService.updateById(productInfo);
     }
 
-    private void renew(TenantOrderRecord record){
+    private void renew(TenantOrderRecord record) {
         //机构产品信息
         TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
-                .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_",0));
+                .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_", 0));
         //获取机构续费时长
         Integer val = (Integer) tenantInfoService.opsRenewInfo(record.getTenantId()).get();
         //修改产品信息
-        tenantInfoService.renewSuccess(val,productInfo,record.getActualAmount());
+        tenantInfoService.renewSuccess(val, productInfo, record.getActualAmount());
     }
 
     //主动去第三方查询订单状态
@@ -208,9 +208,10 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
         //订单状态/0待支付、1已支付、2支付失败
         switch (orderRecord.getOrderState()) {
             case 1:
-                if (TenantOrderRecordEnum.TENANT_OPEN.getCode().equals(orderRecord.getOrderType())) {
-                    tenantOrderSuccess(orderRecord, detail);
-                }
+                tenantOrderSuccess(orderRecord, detail);
+
+                checkOrder.get(orderRecord.getOrderType()).accept(orderRecord);
+
                 code = DealStatusEnum.SUCCESS.getCode();
                 LocalDateTime now = LocalDateTime.now();
                 orderRecord.setPayDate(now.toLocalDate().toDate());
@@ -232,7 +233,7 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
     private void tenantOrderSuccess(TenantOrderRecord orderRecord, Map<String, Object> detail) {
         //机构产品信息
         TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
-                .hasEq("tenant_id_", orderRecord.getTenantId()).queryWrapper().eq("using_",0));
+                .hasEq("tenant_id_", orderRecord.getTenantId()).queryWrapper().eq("using_", 0));
         //获取服务信息
         PlatformServe platformServe = platformServeService.getOne(new WrapperUtil<PlatformServe>()
                 .hasEq("id_", productInfo.getServeId()).queryWrapper());
@@ -242,19 +243,6 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
         detail.put("platformServeName", platformServe.getName());
         detail.put("mode", serveDetail.getMode());
         detail.put("num", productInfo.getExpiryCount());
-
-        orderSuccessOps(orderRecord, productInfo);
-    }
-
-    private void orderSuccessOps(TenantOrderRecord orderRecord, TenantProductInfo productInfo) {
-        TenantInfo tenantInfo = new TenantInfo();
-        tenantInfo.setId(orderRecord.getTenantId());
-        tenantInfo.setPayState(1);
-        tenantInfoService.updateById(tenantInfo);
-
-        productInfo.setPayDate(new Date());
-        productInfo.setTenantId(orderRecord.getTenantId());
-        tenantProductInfoService.updateById(productInfo);
     }
 
     private void rechargeSuccess(TenantOrderRecord record) throws Exception {
@@ -268,7 +256,7 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
 
     @Override
     public Boolean rechargeCheck(TenantOrderRecord record, int i) {
-        RBucket<Object> bucket = redissonClient.getBucket("tenant_check_order");
+        RBucket<Object> bucket = redissonClient.getBucket("tenant_check_recharge");
         if (!bucket.trySet(1, 3L, TimeUnit.SECONDS)) {
             return false;
         }

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -48,7 +48,7 @@ import java.util.function.Function;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.GroupType.VIP;
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.SECTION_MANAGER;
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
 import static java.math.BigDecimal.ROUND_DOWN;
 import static java.math.BigDecimal.ZERO;
 
@@ -733,7 +733,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
         Map<String, Long> memo = new HashMap<>(1);
         memo.put("vipGroupId", vipGroupApplyBaseInfoDto.getId());
-        sendSeoMessageSource.sendSeoMessage(teacher.getTeacherOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(teacher.getTeacherOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 JSONObject.toJSONString(memo), vipGroupApplyBaseInfoDto.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_TEACHER_APPLY_VIP, teacher.getRealName());
         return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
     }
@@ -3018,7 +3018,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         Map<String, Object> memo = new HashMap<>(2);
         memo.put("Id", studentApplyRefunds.getId());
         memo.put("type", "VIPGROUP");
-        sendSeoMessageSource.sendSeoMessage(sysUser.getOrganId(), new SysUserRoleEnum[]{SECTION_MANAGER},
+        sendSeoMessageSource.sendSeoMessage(sysUser.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 JSONObject.toJSONString(memo), vipGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_STUDENT_APPLY_QUIT_COURSE, sysUser.getUsername());
     }
 

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/SysCouponIssueRecordMapper.xml

@@ -168,7 +168,7 @@
           AND status_ = 1
           AND tenant_id_ = #{tenantId}
           AND a.`limit_exchange_num_` > IFNULL(b.couponNum, 0)
-          AND NOW() >= end_date_
+          AND NOW() BETWEEN start_date_ AND end_date_
           AND (
                     stock_count_ > consume_num_
                 OR stock_count_ = - 1

+ 14 - 0
mec-biz/src/main/resources/config/mybatis/SysEmployeePositionMapper.xml

@@ -95,4 +95,18 @@
 			AND INTE_ARRAY(e.organ_id_list_,#{organIds})
 		</if>
 	</select>
+	<select id="queryPositionList" resultType="com.ym.mec.biz.dal.enums.SysUserRoleEnum">
+		SELECT sp.role_code_ FROM sys_employee_position sep
+		LEFT JOIN sys_position sp ON sp.id_ = sep.role_id_
+		WHERE sep.user_id_ = #{userId} AND sep.tenant_id_ = #{tenantId}
+	</select>
+	<select id="queryUserIdByRoleId" resultType="java.lang.Integer">
+		SELECT DISTINCT sep.user_id_ FROM sys_employee_position sep
+		LEFT JOIN sys_position sp ON sp.id_ = sep.role_id_
+		LEFT JOIN employee e ON e.user_id_ = sep.user_id_
+		WHERE sep.tenant_id_ = #{tenantId} AND FIND_IN_SET(#{organId},e.organ_id_list_) AND sp.role_code_ IN
+		<foreach collection="roleArr" item="role" open="(" close=")">
+			#{role}
+		</foreach>
+	</select>
 </mapper>

+ 30 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysEmployeePositionController.java

@@ -0,0 +1,30 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysEmployeePositionService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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;
+
+@RequestMapping("employeePosition")
+@Api(tags = "员工职位管理")
+@RestController
+public class SysEmployeePositionController extends BaseController {
+
+    @Autowired
+    private SysEmployeePositionService employeePositionService;
+    @Autowired
+    private OrganizationService organizationService;
+
+    @ApiOperation(value = "获取分部下员工职位列表")
+    @GetMapping("/findOrganPosition")
+    @PreAuthorize("@pcs.hasPermissions('employeePosition/findOrganPosition')")
+    public Object findAll() throws Exception {
+        return succeed(employeePositionService.findOrganPosition(organizationService.getTeacherOrgan()));
+    }
+}

+ 2 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java

@@ -189,7 +189,7 @@ public class TeacherController extends BaseController {
 		return succeed();
 	}
 
-    @ApiOperation(value = "获取教务人员")
+    /*@ApiOperation(value = "获取教务人员")
     @GetMapping("/findEducationUsers")
     public HttpResponseResult findEducationUsers(){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -205,7 +205,7 @@ public class TeacherController extends BaseController {
             organIds = organIds + "," + teacher.getFlowOrganRange();
         }
         return succeed(employeeService.findByRole("4,5",organIds));
-    }
+    }*/
 
 
     @ApiOperation(value = "获取报名/预报名列表")

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

@@ -59,11 +59,7 @@ public class ActivityPlanController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('activityPlan/queryPage')")
     public Object queryPage(ActivityPlanQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(activityPlanService.queryPage(queryInfo));
     }
 

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

@@ -35,11 +35,7 @@ public class ChildrenReserveController extends BaseController {
     @GetMapping("/queryStatisticsPage")
     @PreAuthorize("@pcs.hasPermissions('childrenReserve/queryStatisticsPage')")
     public HttpResponseResult<PageInfo<ChildrenStatisticsDto>> queryStatisticsPage(ChildrenReserveQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(childrenDayReserveService.queryStatisticsPage(queryInfo));
     }
 

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

@@ -67,11 +67,7 @@ public class CooperationOrganController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('cooperationOrgan/queryPage')")
     public Object queryPage(CooperationOrganQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(cooperationOrganService.queryPage(queryInfo));
     }
 

+ 2 - 10
mec-web/src/main/java/com/ym/mec/web/controller/CourseReviewController.java

@@ -32,11 +32,7 @@ public class CourseReviewController extends BaseController {
     @GetMapping("getPracticeGroup")
     @PreAuthorize("@pcs.hasPermissions('courseReview/getPracticeGroup')")
     public Object getPracticeGroup(CourseReviewQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(courseReviewService.findPracticeGroupReviews(queryInfo));
     }
 
@@ -58,11 +54,7 @@ public class CourseReviewController extends BaseController {
     @GetMapping("getVipGroup")
     @PreAuthorize("@pcs.hasPermissions('courseReview/getVipGroup')")
     public Object getVipGroup(CourseReviewQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(courseReviewService.getVipCourseReviews(queryInfo));
     }
 

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

@@ -73,11 +73,7 @@ public class CourseScheduleController extends BaseController {
     @GetMapping("/superFindCourseSchedules")
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/superFindCourseSchedules')")
     public Object superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         return succeed(courseScheduleService.endFindCourseSchedules(queryInfo));
     }
 

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

@@ -50,11 +50,7 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
     @GetMapping("/findIsSettlementCourseSalarys")
     @PreAuthorize("@pcs.hasPermissions('courseScheduleTeacherSalary/findIsSettlementCourseSalarys')")
     public HttpResponseResult findIsSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
 
         Map<String, Object> result=new HashMap<>();
         result.put("pageInfo", courseScheduleTeacherSalaryService.findIsSettlementCourseSalarys(queryInfo));

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

@@ -33,11 +33,7 @@ public class DegreeController extends BaseController { ;
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('degree/queryPage')")
     public HttpResponseResult queryPage(DegreeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setSort("create_time_");
         queryInfo.setOrder("DESC");
         return succeed(degreeRegistrationService.getPageList(queryInfo));

+ 18 - 22
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -51,11 +51,7 @@ public class EmployeeController extends BaseController {
     @GetMapping("/queryEmployByOrganId")
     @PreAuthorize("@pcs.hasPermissions('employee/queryEmployByOrganId')")
     public Object queryEmployByOrganId(EmployeeQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(employeeService.queryEmployByOrganId(queryInfo));
     }
 
@@ -154,7 +150,7 @@ public class EmployeeController extends BaseController {
         return failed("获取用户信息失败");
     }
 
-    @ApiOperation(value = "获取教务人员")
+    /*@ApiOperation(value = "获取教务人员")
     @GetMapping("/findEducationUsers")
     public HttpResponseResult findEducationUsers(Integer userId, Integer organId){
         SysUser sysUser;
@@ -270,6 +266,22 @@ public class EmployeeController extends BaseController {
         return succeed(employeeService.findByRole("37",organIds));
     }
 
+    @ApiOperation(value = "获取所有维修技师(包含离职和冻结的)")
+    @GetMapping("/findAllTechnician")
+    @PreAuthorize("@pcs.hasPermissions('employee/findAllTechnician')")
+    public HttpResponseResult<List<SimpleUserDto>> findAllTechnician(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        String organIds = new String();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        Employee employee = employeeService.get(sysUser.getId());
+        if (StringUtils.isEmpty(organIds)) {
+            organIds=employee.getOrganIdList();
+        }
+        return succeed(employeeService.findAllByRole("37",organIds));
+    }*/
+
     @ApiOperation(value = "获取所选用户离职所需交接信息")
     @GetMapping("/levelDetail")
     @PreAuthorize("@pcs.hasPermissions('employee/levelDetail')")
@@ -288,20 +300,4 @@ public class EmployeeController extends BaseController {
         employeeService.level(employeeLevelDtos);
         return succeed();
     }
-
-    @ApiOperation(value = "获取所有维修技师(包含离职和冻结的)")
-    @GetMapping("/findAllTechnician")
-    @PreAuthorize("@pcs.hasPermissions('employee/findAllTechnician')")
-    public HttpResponseResult<List<SimpleUserDto>> findAllTechnician(){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = new String();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isEmpty(organIds)) {
-            organIds=employee.getOrganIdList();
-        }
-        return succeed(employeeService.findAllByRole("37",organIds));
-    }
 }

+ 31 - 137
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -153,11 +153,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/userCashAccountLog")
     @PreAuthorize("@pcs.hasPermissions('export/userCashAccountLog')")
     public void exportUserCashAccountLog(HttpServletResponse response, AccountLogQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<SysUserCashAccountLog> rows = sysUserCashAccountLogService.queryPage(queryInfo).getRows();
@@ -194,11 +190,7 @@ public class ExportController extends BaseController {
     @PostMapping("export/musicGroup")
     @PreAuthorize("@pcs.hasPermissions('export/musicGroup')")
     public void exportMusicGroup(HttpServletResponse response, MusicGroupQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<MusicGroup> rows = musicGroupService.queryMusicGroupPage(queryInfo).getRows();
@@ -236,11 +228,7 @@ public class ExportController extends BaseController {
     @PostMapping("export/statisticsDetail")
     @PreAuthorize("@pcs.hasPermissions('export/statisticsDetail')")
     public void statisticsDetail(HttpServletResponse response, ChildrenReserveQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<ChildrenStatisticsDetailDto> rows = childrenDayReserveService.exportStatisticsDetail(queryInfo);
@@ -349,11 +337,7 @@ public class ExportController extends BaseController {
     @PostMapping("export/userCashAccountDetail")
     @PreAuthorize("@pcs.hasPermissions('export/userCashAccountDetail')")
     public void userCashAccountDetail(HttpServletResponse response, ExportUserAccountQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<SysUserCashAccountDetail> cashAccountDetails = sysUserCashAccountDetailDao.exportDetail(queryInfo);
        if(cashAccountDetails.size() < 1){
            throw new BizException("没有可导出数据");
@@ -391,11 +375,7 @@ public class ExportController extends BaseController {
     @PostMapping("export/userCoursesAccount")
     @PreAuthorize("@pcs.hasPermissions('export/userCoursesAccount')")
     public void userCoursesAccount(HttpServletResponse response,ExportUserAccountQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<SysUserCoursesAccountDetail> coursesAccountDetails = sysUserCoursesAccountDetailDao.exportDetail(queryInfo);
         if(coursesAccountDetails.size() < 1){
             throw new BizException("没有可导出数据");
@@ -435,11 +415,7 @@ public class ExportController extends BaseController {
     public void exportClassGroup(HttpServletResponse response, ClassGroupQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<ClassGroupTeachersDto> rows = classGroupService.queryClassGroupPage(queryInfo).getRows();
         for (ClassGroupTeachersDto row : rows) {
             List<ClassGroupTeacherMapper> classGroupTeacherMapperList = row.getClassGroupTeacherMapperList();
@@ -523,11 +499,7 @@ public class ExportController extends BaseController {
     public void exportVipGroupActivity(HttpServletResponse response, VipGroupActivityQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<ExportVipGroupActivityDto> rows = vipGroupActivityService.exportVipGroupActivity(queryInfo);
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -562,11 +534,7 @@ public class ExportController extends BaseController {
     public void exportStudentAttendances(HttpServletResponse response, ExportStudentAttendanceQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<ExportStudentAttendanceDto> rows = studentAttendanceService.exportStudentAttendancesQueryPage(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -632,11 +600,7 @@ public class ExportController extends BaseController {
     @PostMapping("export/exportPaymentCalenderAuditList")
     @PreAuthorize("@pcs.hasPermissions('export/exportPaymentCalenderAuditList')")
     public void exportPaymentCalenderAuditList(HttpServletResponse response, MusicGroupPaymentCalenderQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<MusicGroupPaymentCalenderAuditDto> rows = musicGroupPaymentCalenderService.auditList(queryInfo).getRows();
@@ -671,11 +635,7 @@ public class ExportController extends BaseController {
     public void exportTeacherAttendances(HttpServletResponse response, TeacherCloseQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List rows = teacherAttendanceService.queryTeacherAttendances(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -707,11 +667,7 @@ public class ExportController extends BaseController {
     @PostMapping("export/teacherSalaryComplaints")
     @PreAuthorize("@pcs.hasPermissions('export/teacherSalaryComplaints')")
     public void exportTeacherSalaryComplaints(HttpServletResponse response, TeacherSalaryModifyQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<TeacherSalaryComplaints> rows = teacherSalaryComplaintsService.queryPage(queryInfo).getRows();
@@ -746,11 +702,7 @@ public class ExportController extends BaseController {
     public void studentBuyPractice(HttpServletResponse response, StudentBuyPracticeQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<StudentBuyPracticeDto> rows = practiceGroupService.studentBuys(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
@@ -861,11 +813,7 @@ public class ExportController extends BaseController {
     public void teacherCourseReward(HttpServletResponse response, TeacherCourseRewardQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         Date endTime = queryInfo.getEndTime();
         if (endTime != null) {
             queryInfo.setEndTime(DateUtil.addDays(endTime, 1));
@@ -902,11 +850,7 @@ public class ExportController extends BaseController {
     public void studentHasCourse(HttpServletResponse response, StudentManageQueryInfo queryInfo) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setIsExport(true);
         List<StudentManageListDto> rows = studentManageService.findStudentsByOrganId(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
@@ -946,11 +890,7 @@ public class ExportController extends BaseController {
         queryInfo.setIsExport(true);
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<PracticeGroupDto> rows = practiceGroupService.findPracticeGroups(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         if (rows != null && rows.size() > 0) {
@@ -999,11 +939,7 @@ public class ExportController extends BaseController {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         queryInfo.setIsExport(true);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<VipGroup> rows = vipGroupService.findVipGroups(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         if (rows != null && rows.size() > 0) {
@@ -1083,11 +1019,7 @@ public class ExportController extends BaseController {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         queryInfo.setIsExport(true);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<SporadicChargeInfo> rows = sporadicChargeInfoService.queryDetailPage(queryInfo).getRows();
         for (SporadicChargeInfo row : rows) {
             row.setOpenFlagStr(row.getOpenFlag().equals(0) ? "开启" : "关闭");
@@ -1277,11 +1209,9 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/orderList')")
     public HttpResponseResult orderList(StudentPaymentOrderQueryInfo queryInfo) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        
         if(sysUser == null || sysUser.getId() == null){
         	return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        
         queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
@@ -1429,8 +1359,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/courseReviews")
     @PreAuthorize("@pcs.hasPermissions('export/courseReviews')")
     public void courseReviews(CourseReviewQueryInfo queryInfo, HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setIsExport(1);
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
@@ -1514,8 +1443,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/practiceGroup")
     @PreAuthorize("@pcs.hasPermissions('export/practiceGroup')")
     public void practiceGroup(HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+        String organIds = organizationService.getEmployeeOrgan("");
 
         List<CourseGroupExportDto> practiceGroupExports = practiceGroupDao.getPracticeGroupExport(organIds, TenantContextHolder.getTenantId());
         if (practiceGroupExports == null || practiceGroupExports.size() == 0) {
@@ -1582,9 +1510,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/vipGroup")
     @PreAuthorize("@pcs.hasPermissions('export/vipGroup')")
     public void vipGroup(HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-
-        List<CourseGroupExportDto> vipGroupExports = courseScheduleDao.getVipGroupExport(organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin()));
+        List<CourseGroupExportDto> vipGroupExports = courseScheduleDao.getVipGroupExport(organizationService.getEmployeeOrgan(""));
         if (vipGroupExports == null || vipGroupExports.size() == 0) {
             response.setStatus(500);
             response.setContentType("Content-Type: application/json;charset=UTF-8");
@@ -1661,11 +1587,7 @@ public class ExportController extends BaseController {
     public void extraExercisesReplys(ExtraExercilseReplyQueryInfo queryInfo, HttpServletResponse response) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         List<ExtraExerciseStudentsDto> rows = extracurricularExercisesReplyService.findExtraExercises(queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(500);
@@ -1710,11 +1632,7 @@ public class ExportController extends BaseController {
     public void exercisesSituations(StudentExercisesSituationQueryInfo queryInfo, HttpServletResponse response) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         List<StudentExercisesSituationDto> rows = studentExtracurricularExercisesSituationService.findStudentExtracurricularExercisesSituations(queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(500);
@@ -1753,11 +1671,7 @@ public class ExportController extends BaseController {
     public void isSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo, HttpServletResponse response) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         List<TeacherCourseSalaryDetail4WebDto> rows = courseScheduleTeacherSalaryService.findIsSettlementCourseSalarys(queryInfo).getRows();
         if (CollectionUtils.isEmpty(rows)) {
             response.setStatus(500);
@@ -1826,11 +1740,7 @@ public class ExportController extends BaseController {
     public void operatingStudents(StudentOperatingQueryInfo queryInfo, HttpServletResponse response) {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         PageInfo<Student4operating> PageOperatingStudents = studentManageService.getOperatingStudents(queryInfo);
 
         if (PageOperatingStudents.getTotal() <= 0) {
@@ -1893,7 +1803,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/vipCourseReviews')")
     public void vipCourseReviews(CourseReviewQueryInfo queryInfo, HttpServletResponse response) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setIsExport(1);
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
@@ -2030,11 +1940,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/cooperationOrgan")
     @PreAuthorize("@pcs.hasPermissions('export/cooperationOrgan')")
     public void cooperationOrgan(CooperationOrganQueryInfo queryInfo, HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new IOException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setRows(65000);
         PageInfo<CooperationOrgan> pageList = cooperationOrganService.queryPage(queryInfo);
         if (pageList.getTotal() <= 0) {
@@ -2247,10 +2153,6 @@ public class ExportController extends BaseController {
     @RequestMapping("export/teacherDefaultSalary")
     @PreAuthorize("@pcs.hasPermissions('export/teacherDefaultSalary')")
     public void exportTeacherDefaultSalary(String organIdList, HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new IOException("用户信息获取失败");
-        }
         List<TeacherDefaultSalaryDto> pageList = teacherService.queryTeacherDefaultSalary(organIdList);
         if (pageList.size() <= 0) {
             response.setStatus(200);
@@ -2481,11 +2383,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/exportSellOrders")
     @PreAuthorize("@pcs.hasPermissions('export/exportSellOrders')")
     public void exportSellOrders(HttpServletResponse response, SellOrderQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         if (queryInfo.getEndTime() != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
         }
@@ -2585,11 +2483,7 @@ public class ExportController extends BaseController {
     @RequestMapping("export/musicGroupQuit")
     @PreAuthorize("@pcs.hasPermissions('export/musicGroupQuit')")
     public void musicGroupQuit(MusicGroupQuitQueryInfo queryInfo, HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<MusicGroupQuit> result = musicGroupQuitService.queryPage(queryInfo);
@@ -2632,7 +2526,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<TeacherServeDto> result = studentExtracurricularExercisesSituationService.queryTeacherServeInfo(queryInfo);
@@ -2739,7 +2633,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<TeacherCourseStatistics> result = teacherCourseStatisticsService.queryPageDetail(queryInfo);
@@ -2831,7 +2725,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<Teacher> rows = teacherService.queryPageDetail(queryInfo).getRows();

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

@@ -39,11 +39,7 @@ public class ExtracurricularExercisesController extends BaseController {
     @ApiOperation(value = "获取课外训练列表")
     @GetMapping("/queryPageList")
     private HttpResponseResult findExtraExercilses(ExtraExercilseQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         return succeed(extracurricularExercisesService.queryPage(queryInfo));
     }
 

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

@@ -31,11 +31,7 @@ public class ExtracurricularExercisesReplyController extends BaseController {
     @ApiOperation(value = "获取课外训练作业列表")
     @GetMapping("/queryPageList")
     private HttpResponseResult findExtraExercilses(ExtraExercilseReplyQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         return succeed(extracurricularExercisesReplyService.findExtraExercises(queryInfo));
     }
 

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

@@ -39,11 +39,7 @@ public class FinancialExpenditureController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('financialExpenditure/queryPage')")
     public Object queryPage(FinancialExpenditureQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(financialExpenditureService.queryFinancialExpenditurePage(queryInfo));
     }
 

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

@@ -60,7 +60,7 @@ public class IndexController extends BaseController {
 		if (sysUser == null || sysUser.getId() == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-		String organId = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+		String organId = organizationService.getEmployeeOrgan("");
 
 		Integer tenantId = TenantContextHolder.getTenantId();
 
@@ -100,56 +100,34 @@ public class IndexController extends BaseController {
 
 	@GetMapping("/newIndex")
 	public HttpResponseResult newIndex(IndexDataQueryInfo queryInfo){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		return succeed(indexService.getIndexBaseData(queryInfo));
 	}
 
 	@GetMapping("/hasIndexErrData")
-	public HttpResponseResult hasIndexErrData(Integer organId){
-		if (organId == null) {
-			return failed("请选择分部");
-		}
-		return succeed(indexService.hasIndexErrData(organId));
+	public HttpResponseResult hasIndexErrData(String organId){
+		return succeed(indexService.hasIndexErrData(organizationService.getEmployeeOrgan(organId)));
 	}
 
 	@GetMapping("/getIndexErrData")
-	public HttpResponseResult getIndexErrData(Integer organId, IndexErrorType errorType){
-		if (organId == null) {
-			return failed("请选择分部");
-		}
-		return succeed(indexService.getIndexErrData(organId, errorType));
+	public HttpResponseResult getIndexErrData(String organId, IndexErrorType errorType){
+		return succeed(indexService.getIndexErrData(organizationService.getEmployeeOrgan(organId), errorType));
 	}
 
 	@GetMapping("/exportIndexErrData")
 	public HttpResponseResult exportIndexErrData(String organId, IndexErrorType errorType){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
-		return succeed(indexService.exportIndexErrData(organId, errorType));
+		return succeed(indexService.exportIndexErrData(organizationService.getEmployeeOrgan(organId), errorType));
 	}
 
 	@GetMapping("/getRemindMatterData")
-	public HttpResponseResult getRemindMatterData(Integer organId){
-		if (organId == null) {
-			return failed("请选择分部");
-		}
-		return succeed(indexService.getRemindMatterData(organId));
+	public HttpResponseResult getRemindMatterData(String organId){
+		return succeed(indexService.getRemindMatterData(organizationService.getEmployeeOrgan(organId)));
 	}
 
 	@ApiOperation("查询分部云教练学员汇总数据")
 	@GetMapping("/organStudentOverView")
 	public HttpResponseResult<PageInfo<EduOrganStudentDataDto>> organStudentOverView(OrganCloudStudyStudentDataQueryInfo queryInfo){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		String organId = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+		String organId = organizationService.getEmployeeOrgan("");
 		List<Integer> organIds = Arrays.stream(organId.split(",")).map(id -> Integer.valueOf(id)).filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
 		return succeed(indexService.organStudentOverView(organIds, queryInfo));
 	}

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

@@ -49,11 +49,7 @@ public class IndexErrDataRecordController extends BaseController {
     @GetMapping("/queryRecord")
     @PreAuthorize("@pcs.hasPermissions('indexErrDataRecord/queryRecord')")
     public HttpResponseResult<PageInfo<IndexErrorDataExportDto>> queryRecord(IndexErrRecordQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(queryInfo.getOrganIds()));
         return succeed(indexErrDataRecordService.queryRecord(queryInfo));
     }
 
@@ -61,11 +57,7 @@ public class IndexErrDataRecordController extends BaseController {
     @GetMapping("/errDataSummarizing")
     @PreAuthorize("@pcs.hasPermissions('indexErrDataRecord/errDataSummarizing')")
     public HttpResponseResult errDataSummarizing(IndexErrRecordQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(queryInfo.getOrganIds()));
         return succeed(indexErrDataRecordService.errDataSummarizing(queryInfo));
     }
 
@@ -73,11 +65,7 @@ public class IndexErrDataRecordController extends BaseController {
     @GetMapping("/getAllEducationUsers")
     @PreAuthorize("@pcs.hasPermissions('indexErrDataRecord/getAllEducationUsers')")
     public HttpResponseResult getAllEducationUsers(String organIds){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+        organIds = organizationService.getEmployeeOrgan(organIds);
         return succeed(indexErrDataRecordService.getAllEducationUsers(organIds));
     }
 
@@ -85,11 +73,7 @@ public class IndexErrDataRecordController extends BaseController {
     @GetMapping("/queryErrInspectionData")
     @PreAuthorize("@pcs.hasPermissions('indexErrDataRecord/queryErrInspectionData')")
     public HttpResponseResult<PageInfo<InspectionItemPlan>> queryErrInspectionData(InspectionItemPlanQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         if (queryInfo.getStartTime() != null) {
             queryInfo.setStartTime(DateUtil.trunc(queryInfo.getStartTime()));
         }
@@ -116,11 +100,7 @@ public class IndexErrDataRecordController extends BaseController {
     @GetMapping("/queryHistoryErrCourseData")
     @PreAuthorize("@pcs.hasPermissions('indexErrDataRecord/queryHistoryErrCourseData')")
     public HttpResponseResult<PageInfo<CourseScheduleEndDto>> queryHistoryErrCourseData(EndCourseScheduleQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         return succeed(indexErrDataRecordService.queryHistoryErrCourseData(queryInfo));
     }
 }

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

@@ -65,11 +65,7 @@ public class InspectionController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('inspection/queryPage')")
     public HttpResponseResult<PageInfo<Inspection>> queryPage(InspectionQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(inspectionService.getPageList(queryInfo));
     }
 

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

@@ -69,11 +69,7 @@ public class InspectionItemPlanController extends BaseController {
     @RequestMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/queryPage')")
     public HttpResponseResult<PageInfo<InspectionItemPlan>> queryPage(InspectionItemPlanQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         if (queryInfo.getStartTime() != null) {
             queryInfo.setStartTime(DateUtil.trunc(queryInfo.getStartTime()));
         }

+ 2 - 10
mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java

@@ -74,11 +74,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
     @GetMapping("/findAll")
     @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/findAll')")
     public Object getMemberDefaultFee(MemberRankFeeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
         return succeed(memberRankOrganizationFeeMapperService.findAll(params));
@@ -88,11 +84,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/queryPage')")
     public Object queryPage(MemberRankFeeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(memberRankOrganizationFeeMapperService.queryPage(queryInfo));
     }
 }

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

@@ -106,11 +106,7 @@ public class MusicGroupController extends BaseController {
 	@RequestMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('musicGroup/queryPage')")
 	public Object queryPage(MusicGroupQueryInfo queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		return succeed(musicGroupService.queryMusicGroupPage(queryInfo));
 	}
 

+ 2 - 10
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -49,11 +49,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @GetMapping(value = "/queryPage")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/queryPage')")
     public Object queryPage(MusicGroupPaymentCalenderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(musicGroupPaymentCalenderService.queryCalenderPage(queryInfo));
     }
 
@@ -140,11 +136,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @GetMapping("/auditList")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditList')")
     public Object auditList(MusicGroupPaymentCalenderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(musicGroupPaymentCalenderService.auditList(queryInfo));
     }
 

+ 2 - 10
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -103,11 +103,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     @GetMapping("/queryArrearageStudents")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/queryArrearageStudents')")
     public HttpResponseResult<PageInfo<MusicArrearageStudentDto>> queryArrearageStudents(ArrearageStudentsQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(queryInfo.getOrganIds()));
         return succeed(musicGroupPaymentCalenderDetailService.queryArrearageStudents(queryInfo));
     }
 
@@ -115,11 +111,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     @GetMapping("/getNoPaymentStudentMusicGroups")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/getNoPaymentStudentMusicGroups')")
     public HttpResponseResult<List<MusicGroup>> getNoPaymentStudentMusicGroups(String organIds){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
+        organIds = organizationService.getEmployeeOrgan(organIds);
         return succeed(musicGroupPaymentCalenderDetailService.getNoPaymentStudentMusicGroups(organIds));
     }
 }

+ 24 - 71
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java

@@ -1,42 +1,15 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
-import com.ym.mec.biz.service.*;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
-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.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.CloudTeacherOrderDao;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.StudentInstrumentDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
-import com.ym.mec.biz.dal.entity.ApprovalStatus;
-import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupQuit;
-import com.ym.mec.biz.dal.entity.MusicGroupReturnFeeDto;
-import com.ym.mec.biz.dal.entity.StudentInstrument;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.MusicGroupQuitQueryInfo;
+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;
@@ -44,6 +17,19 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.json.JsonUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+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.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @RequestMapping("musicGroupQuit")
 @Api(tags = "退团服务")
@@ -66,16 +52,14 @@ public class MusicGroupQuitController extends BaseController {
     private TeacherDao teacherDao;
     @Autowired
     private OrganizationService organizationService;
+    @Autowired
+    private SysEmployeePositionService employeePositionService;
 
     @ApiOperation(value = "分页查询")
     @RequestMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('musicGroupQuit/queryPage')")
     public HttpResponseResult queryPage(MusicGroupQuitQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         PageInfo<MusicGroupQuit> musicGroupQuitPageInfo = musicGroupQuitService.queryPage(queryInfo);
         List<MusicGroupQuit> rows = musicGroupQuitPageInfo.getRows();
         if (rows != null && rows.size() > 0) {
@@ -188,15 +172,7 @@ public class MusicGroupQuitController extends BaseController {
 		if (sysUser == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-        List<SysUserRoleEnum> roleIds;
-		if(sysUser.getIsSuperAdmin() == true) {
-            roleIds = new ArrayList<>();
-			roleIds.add(SysUserRoleEnum.SECTION_MANAGER);
-			roleIds.add(SysUserRoleEnum.EDUCATIONAL_TEACHER);
-		} else {
-            MusicGroup musicGroup = musicGroupService.get(musicGroupQuit.getMusicGroupId());
-            roleIds = organizationService.queryOrganRole(musicGroup.getOrganId(), sysUser.getId());
-		}
+        List<SysUserRoleEnum> roleIds = employeePositionService.queryAllRole(sysUser.getId(),sysUser.getIsSuperAdmin());
         return succeed(musicGroupService.applyQuitMusicGroup(roleIds, musicGroupQuit, sysUser.getId()));
     }
 
@@ -208,19 +184,8 @@ public class MusicGroupQuitController extends BaseController {
 		if (sysUser == null || sysUser.getId() == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-        List<SysUserRoleEnum> roleIds;
-        if(sysUser.getIsSuperAdmin() == true) {
-            roleIds = new ArrayList<>();
-            roleIds.add(SysUserRoleEnum.SECTION_MANAGER);
-            roleIds.add(SysUserRoleEnum.EDUCATIONAL_TEACHER);
-        } else {
-            MusicGroup musicGroup = musicGroupService.get(musicGroupQuit.getMusicGroupId());
-            if(musicGroup == null){
-            	return failed("乐团信息查询失败");
-            }
-            roleIds = organizationService.queryOrganRole(musicGroup.getOrganId(), sysUser.getId());
-        }
-		if (!(roleIds.contains(SysUserRoleEnum.SECTION_MANAGER) || roleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER))) {
+        List<SysUserRoleEnum> roleIds = employeePositionService.queryAllRole(sysUser.getId(),sysUser.getIsSuperAdmin());
+		if (!(roleIds.contains(SysUserRoleEnum.ORGAN_MANAGER) || roleIds.contains(SysUserRoleEnum.EDUCATION))) {
 			return failed("未经授权,不能操作");
 		}
         return succeed(musicGroupService.approveQuitMusicGroup(roleIds, musicGroupQuit));
@@ -234,20 +199,8 @@ public class MusicGroupQuitController extends BaseController {
 		if (sysUser == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-        List<SysUserRoleEnum> roleIds;
-        if(sysUser.getIsSuperAdmin() == true) {
-            roleIds = new ArrayList<>();
-            roleIds.add(SysUserRoleEnum.SECTION_MANAGER);
-            roleIds.add(SysUserRoleEnum.EDUCATIONAL_TEACHER);
-        } else {
-            Set<String> collect = musicGroupQuits.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
-            Set<Integer> collect1 = musicGroupService.queryListByIds(collect).stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
-            if(collect1.size() > 1){
-                throw new BizException("请选择同一个分部的乐团");
-            }
-            roleIds = organizationService.queryOrganRole(collect1.iterator().next(), sysUser.getId());
-        }
-		if (!(roleIds.contains(SysUserRoleEnum.SECTION_MANAGER) || roleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER))) {
+        List<SysUserRoleEnum> roleIds = employeePositionService.queryAllRole(sysUser.getId(),sysUser.getIsSuperAdmin());
+		if (!(roleIds.contains(SysUserRoleEnum.ORGAN_MANAGER) || roleIds.contains(SysUserRoleEnum.EDUCATION))) {
 			throw new BizException("未经授权,不能操作");
 		}
         for (MusicGroupQuit musicGroupQuit : musicGroupQuits) {

+ 2 - 14
mec-web/src/main/java/com/ym/mec/web/controller/OperatingReportController.java

@@ -38,20 +38,13 @@ public class OperatingReportController extends BaseController {
     @Autowired
     private OperatingReportService operatingReportService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation("报表列表")
     @GetMapping(value = "/queryPage")
     @PreAuthorize("@pcs.hasPermissions('operatingReport/queryPage')")
     public HttpResponseResult<PageInfo<OperatingReport>> queryPage(OperatingReportQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         if (queryInfo.getMonth() != null) {
             queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
             queryInfo.setEndTime(DateUtil.getLastDayOfMonth(queryInfo.getMonth()));
@@ -64,12 +57,7 @@ public class OperatingReportController extends BaseController {
     @GetMapping("/export")
     @PreAuthorize("@pcs.hasPermissions('operatingReport/export')")
     public void operatingReport(OperatingReportQueryInfo queryInfo, HttpServletResponse response) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new IOException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         if (queryInfo.getMonth() != null) {
             queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
             queryInfo.setEndTime(DateUtil.getLastDayOfMonth(queryInfo.getMonth()));

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

@@ -41,11 +41,7 @@ public class OrganizationCloudTeacherFeeController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('organizationCloudTeacherFee/queryPage')")
     public HttpResponseResult<PageInfo<OrganizationCloudTeacherFee>> queryPage(OrganizationCloudTeacherFeeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(organizationCloudTeacherFeeService.queryPage(queryInfo));
     }
 

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

@@ -98,11 +98,7 @@ public class OrganizationController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('organization/getOrganRole')")
     @ApiParam(value = "分部编号", required = true)
     public Object getOrganRole(String organIds){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
+        organIds = organizationService.getEmployeeOrgan(organIds);
         if(StringUtils.isEmpty(organIds)){
             return failed("分部信息异常");
         }

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

@@ -61,12 +61,7 @@ public class PracticeGroupManageController extends BaseController {
     @GetMapping("/queryAll")
     @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/queryAll')")
     public Object queryAll(PracticeGroupQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(practiceGroupService.findPracticeGroups(queryInfo));
     }
 
@@ -110,12 +105,7 @@ public class PracticeGroupManageController extends BaseController {
     @GetMapping("getReviews")
     @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getReviews')")
     public Object getReviews(PracticeGroupQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
 
@@ -137,12 +127,7 @@ public class PracticeGroupManageController extends BaseController {
     @GetMapping("studentBuys")
     @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/studentBuys')")
     public Object studentBuys(StudentBuyPracticeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(practiceGroupService.studentBuys(queryInfo));
     }
 

+ 2 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentActivityController.java

@@ -58,12 +58,7 @@ public class ReplacementInstrumentActivityController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('replacementInstrumentActivity/queryPage')")
     public HttpResponseResult<PageInfo<ReplacementInstrumentActivityStatDto>> queryPage(ReplacementInstrumentActivityQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(replacementInstrumentActivityService.getPageList(queryInfo));
     }
 
@@ -153,12 +148,7 @@ public class ReplacementInstrumentActivityController extends BaseController {
     @RequestMapping("/export")
     @PreAuthorize("@pcs.hasPermissions('replacementInstrumentActivity/export')")
     public void export(ReplacementInstrumentActivityQueryInfo queryInfo, HttpServletResponse response) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setRows(99999);
         PageInfo<ReplacementInstrumentActivityStatDto> pageList = replacementInstrumentActivityService.getPageList(queryInfo);
 

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/ReplacementInstrumentCooperationController.java

@@ -40,12 +40,7 @@ public class ReplacementInstrumentCooperationController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('replacementInstrumentCooperation/queryPage')")
     public HttpResponseResult<PageInfo<ReplacementInstrumentCooperation>> queryPage(ReplacementInstrumentCooperationQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(replacementInstrumentCooperationService.getPageList(queryInfo));
     }
 

+ 2 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java

@@ -76,12 +76,7 @@ public class SchoolController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('school/queryPage')")
     public Object queryPage(SchoolQueryInfo queryInfo){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(schoolService.queryPageDetail(queryInfo));
     }
 
@@ -89,12 +84,7 @@ public class SchoolController extends BaseController {
     @GetMapping("/queryByOrganId")
     @PreAuthorize("@pcs.hasPermissions('school/queryByOrganId')")
     public Object queryByOrganId(String organId){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
-
+        organId = organizationService.getEmployeeOrgan(organId);
         return succeed(schoolService.queryByOrganId(organId));
     }
 

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/SellOrderController.java

@@ -52,12 +52,7 @@ public class SellOrderController extends BaseController {
     @GetMapping(value = "/queryPage")
     @PreAuthorize("@pcs.hasPermissions('sellOrder/queryPage')")
     public HttpResponseResult<PageInfo<SellOrder>> queryPage(SellOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         if (queryInfo.getEndTime() != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
         }

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java

@@ -40,12 +40,7 @@ public class SporadicChargeInfoController extends BaseController {
 	@GetMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('sporadicChargeInfo/queryPage')")
 	public Object queryPage(SporadicChargeInfoQueryInfo queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		queryInfo.setSort("id_");
 		return succeed(sporadicChargeInfoService.queryDetailPage(queryInfo));
 	}

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java

@@ -40,12 +40,7 @@ public class StudentApplyRefundsController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('studentRefunds/queryPage')")
     public Object queryPage(StudentApplyrefundsQueryInfo queryInfo){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		return succeed(studentApplyRefundsService.queryPage(queryInfo));
     }
 }

+ 2 - 11
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -59,12 +59,7 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
     @GetMapping("/findStudentExtracurricularExercisesSituations")
     @PreAuthorize("@pcs.hasPermissions('exercisesSituation/findStudentExtracurricularExercisesSituations')")
     public HttpResponseResult findStudentExtracurricularExercisesSituations(StudentExercisesSituationQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         return succeed(studentExtracurricularExercisesSituationService.findStudentExtracurricularExercisesSituations(queryInfo));
     }
 
@@ -79,11 +74,7 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
     @GetMapping("/queryTeacherServeInfo")
     @PreAuthorize("@pcs.hasPermissions('exercisesSituation/queryTeacherServeInfo')")
     public HttpResponseResult queryTeacherServeInfo(TeacherServeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentExtracurricularExercisesSituationService.queryTeacherServeInfo(queryInfo));
     }
 

+ 2 - 11
mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java

@@ -67,12 +67,7 @@ public class StudentInstrumentController extends BaseController {
     @GetMapping("/getList")
     @PreAuthorize("@pcs.hasPermissions('studentInstrument/getList')")
     public HttpResponseResult<PageInfo<StudentInstrument>> getList(StudentInstrumentQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         studentInstrumentDao.batchUpdate();
         return succeed(studentInstrumentService.queryPage(queryInfo));
     }
@@ -194,11 +189,7 @@ public class StudentInstrumentController extends BaseController {
     @GetMapping("/export")
     @PreAuthorize("@pcs.hasPermissions('studentInstrument/export')")
     public void export(Date startTime, Date endTime, HttpServletResponse response) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        String organId = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+        String organId = organizationService.getEmployeeOrgan("");
 
         if (startTime != null) {
             startTime = DateUtil.trunc(startTime);

+ 7 - 46
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -2,12 +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.dto.*;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
@@ -56,7 +53,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/queryStudentErrorLeaveList")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentErrorLeaveList')")
     public Object queryStudentErrorLeaveList(StudentErrorLeaveQueryInfo queryInfo){
-        queryInfo = organizationService.onlyEducationInitClassId(queryInfo);
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(queryInfo.getOrganIds()));
         return succeed(studentManageService.queryStudentErrorLeaveList(queryInfo));
     }
 
@@ -71,12 +68,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/queryStudentList")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentList')")
     public Object queryStudentList(StudentManageQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setIsExport(false);
         return succeed(studentManageService.findStudentsByOrganId(queryInfo));
     }
@@ -85,12 +77,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/queryStudent")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudent')")
     public Object queryStudent(StudentActivityQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentManageService.queryStudent(queryInfo));
     }
 
@@ -98,12 +85,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/queryChildrenDayStudentList")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryChildrenDayStudentList')")
     public Object queryChildrenDayStudentList(StudentManageQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentService.queryPage(queryInfo));
     }
 
@@ -346,12 +328,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/getOperatingStudents")
     @PreAuthorize("@pcs.hasPermissions('studentManage/getOperatingStudents')")
     public Object getOperatingStudents(StudentOperatingQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentManageService.getOperatingStudents(queryInfo));
     }
 
@@ -367,10 +344,6 @@ public class StudentManageController extends BaseController {
     @GetMapping("/initTeacherId")
     @PreAuthorize("@pcs.hasPermissions('studentManage/initTeacherId')")
     public HttpResponseResult initTeacherId(){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         studentService.initTeacherId();
         return succeed();
     }
@@ -421,11 +394,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/organStudentOverView")
     @PreAuthorize("@pcs.hasPermissions('studentManage/organStudentOverView')")
     public HttpResponseResult<PageInfo<EduOrganStudentDataDto>> organStudentOverView(OrganCloudStudyStudentDataQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+        String organIds = organizationService.getEmployeeOrgan("");
         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));
@@ -442,11 +411,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/countCloudTeacherActive")
     @PreAuthorize("@pcs.hasPermissions('studentManage/countCloudTeacherActive')")
     public Object countCloudTeacherActive(CloudTeacherActiveQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        String organIds = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+        String organIds = organizationService.getEmployeeOrgan("");
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<Integer> collect = Arrays.stream(organIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
@@ -458,10 +423,6 @@ public class StudentManageController extends BaseController {
     @GetMapping("/countCloudTeacherActiveDetail")
     @PreAuthorize("@pcs.hasPermissions('studentManage/countCloudTeacherActiveDetail')")
     public Object countCloudTeacherActiveDetail(CloudTeacherActiveQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         return succeed(studentService.countCloudTeacherActiveDetail(queryInfo));
     }
 }

+ 20 - 59
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -1,41 +1,32 @@
 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;
-import io.swagger.annotations.ApiOperation;
-
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
-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 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.StudentPaymentOrderDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 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.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+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.math.BigDecimal;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @RequestMapping("order")
 @Api(tags = "订单服务")
@@ -47,8 +38,6 @@ public class StudentPaymentOrderController extends BaseController {
     @Autowired
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private SysConfigDao sysConfigDao;
@@ -59,11 +48,7 @@ public class StudentPaymentOrderController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('order/queryPage')")
     public Object queryOrderPage(StudentPaymentOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
@@ -93,12 +78,7 @@ public class StudentPaymentOrderController extends BaseController {
     @GetMapping("/sporadicQueryPage")
     @PreAuthorize("@pcs.hasPermissions('order/sporadicQueryPage')")
     public Object sporadicQueryPage(SporadicOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentPaymentOrderService.sporadicQueryPage(queryInfo));
     }
 
@@ -106,14 +86,8 @@ public class StudentPaymentOrderController extends BaseController {
     @GetMapping("/queryPage1")
     @PreAuthorize("@pcs.hasPermissions('order/queryPage1')")
     public Object queryOrderPage1(StudentPaymentOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setOrderType("1");
-
         PageInfo<StudentPaymentOrderDto> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
 
         for (StudentPaymentOrder row : studentPaymentOrderPageInfo.getRows()) {
@@ -131,14 +105,8 @@ public class StudentPaymentOrderController extends BaseController {
     @GetMapping("/queryPage2")
     @PreAuthorize("@pcs.hasPermissions('order/queryPage2')")
     public Object queryOrderPage2(StudentPaymentOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setOrderType("2");
-
         PageInfo<StudentPaymentOrderDto> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
 
         for (StudentPaymentOrder row : studentPaymentOrderPageInfo.getRows()) {
@@ -172,12 +140,7 @@ public class StudentPaymentOrderController extends BaseController {
     @GetMapping("/finance")
     @PreAuthorize("@pcs.hasPermissions('order/finance')")
     public Object financeOrder(StudentPaymentOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         PageInfo<StudentPaymentOrderDto> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
         return succeed(studentPaymentOrderPageInfo);
     }
@@ -197,6 +160,4 @@ public class StudentPaymentOrderController extends BaseController {
     public Object queryOrderDetail(Long orderId){
         return studentPaymentOrderDetailService.queryOrderDetail(orderId);
     }
-
-
 }

+ 2 - 14
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java

@@ -62,12 +62,7 @@ public class StudentPaymentRouteOrderController extends BaseController {
     @GetMapping("/finance")
     @PreAuthorize("@pcs.hasPermissions('routeOrder/finance')")
     public HttpResponseResult<PageInfo<StudentPaymentRouteOrderDto>> queryOrderPage(StudentPaymentOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
             List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
@@ -76,7 +71,6 @@ public class StudentPaymentRouteOrderController extends BaseController {
             }
             queryInfo.setUserIds(userIds);
         }
-
         PageInfo<StudentPaymentRouteOrderDto> studentPaymentRouteOrderPageInfo = studentPaymentRouteOrderService.OrderQueryPage(queryInfo);
         return succeed(studentPaymentRouteOrderPageInfo);
     }
@@ -85,12 +79,7 @@ public class StudentPaymentRouteOrderController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('routeOrder/queryPage')")
     public HttpResponseResult<PageInfo<StudentPaymentRouteOrder>> queryPage(StudentPaymentRouteOrderQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentPaymentRouteOrderService.queryAuditList(queryInfo));
     }
 
@@ -99,7 +88,6 @@ public class StudentPaymentRouteOrderController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('routeOrder/query')")
     public HttpResponseResult<StudentPaymentRouteOrder> query(Long id) {
     	StudentPaymentRouteOrder studentPaymentRouteOrder = studentPaymentRouteOrderService.get(id);
-    	
         return succeed(studentPaymentRouteOrder);
     }
 

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

@@ -1,10 +1,11 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.page.StudentRechargeQueryInfo;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.StudentRechargeService;
+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.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -12,17 +13,6 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-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.StudentRechargeQueryInfo;
-import com.ym.mec.biz.service.StudentRechargeService;
-import com.ym.mec.common.controller.BaseController;
-
-import java.util.Arrays;
-import java.util.List;
-
 @RequestMapping("studentRecharge")
 @Api(tags = "充值服务")
 @RestController
@@ -30,10 +20,6 @@ public class StudentRechargeController extends BaseController {
 
 	@Autowired
 	private StudentRechargeService studentRechargeService;
-
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
-
 	@Autowired
 	private OrganizationService organizationService;
 
@@ -41,12 +27,7 @@ public class StudentRechargeController extends BaseController {
 	@GetMapping(value = "/queryPage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @PreAuthorize("@pcs.hasPermissions('studentRecharge/queryPage')")
 	public Object queryPage(StudentRechargeQueryInfo queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		return succeed(studentRechargeService.queryPage(queryInfo));
 	}
 

+ 2 - 14
mec-web/src/main/java/com/ym/mec/web/controller/StudentRepairController.java

@@ -47,8 +47,6 @@ import java.util.stream.Collectors;
 public class StudentRepairController extends BaseController {
 
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private StudentRepairService studentRepairService;
     @Autowired
     private OrganizationService organizationService;
@@ -57,12 +55,7 @@ public class StudentRepairController extends BaseController {
     @GetMapping(value = "/queryPage")
     @PreAuthorize("@pcs.hasPermissions('studentRepair/queryPage')")
     public HttpResponseResult queryPage(RepairStudentQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         Date endTime = queryInfo.getEndTime();
         if (endTime != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(endTime));
@@ -84,12 +77,7 @@ public class StudentRepairController extends BaseController {
     @RequestMapping("/export")
     @PreAuthorize("@pcs.hasPermissions('studentRepair/export')")
     public void export(RepairStudentQueryInfo queryInfo, HttpServletResponse response) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         Date endTime = queryInfo.getEndTime();
         if (endTime != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(endTime));

+ 6 - 25
mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java

@@ -1,10 +1,13 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.TransTypeEnum;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.StudentWithdrawService;
+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;
@@ -12,19 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-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.WithdrawDto;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.TransTypeEnum;
-import com.ym.mec.biz.service.StudentWithdrawService;
-import com.ym.mec.common.controller.BaseController;
-
-import java.util.Arrays;
-import java.util.List;
-
 @RequestMapping("studentWithdraw")
 @Api(tags = "提现服务")
 @RestController
@@ -32,10 +22,6 @@ public class StudentWithdrawController extends BaseController {
 
 	@Autowired
 	private StudentWithdrawService studentWithdrawService;
-
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
-
 	@Autowired
 	private OrganizationService organizationService;
 
@@ -51,12 +37,7 @@ public class StudentWithdrawController extends BaseController {
 	@GetMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('studentWithdraw/queryPage')")
 	public Object queryPage(WithdrawDto queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		return succeed(studentWithdrawService.queryPage(queryInfo));
 	}
 }

+ 1 - 8
mec-web/src/main/java/com/ym/mec/web/controller/SubjectChangeController.java

@@ -43,20 +43,13 @@ public class SubjectChangeController extends BaseController {
     @Autowired
     private SubjectChangeService subjectChangeService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation("声部更换服务列表")
     @GetMapping(value = "/queryPage")
     @PreAuthorize("@pcs.hasPermissions('subjectChange/queryPage')")
     public HttpResponseResult<PageInfo<SubjectChange>> queryPage(SubjectChangeQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(queryInfo.getOrganIdList()));
         if (queryInfo.getEndTime() != null) {
             queryInfo.setEndTime(DateUtil.getLastTimeWithDay(queryInfo.getEndTime()));
         }

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/SysEmployeePositionController.java

@@ -1,7 +1,5 @@
 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.service.OrganizationService;
 import com.ym.mec.biz.service.SysEmployeePositionService;
 import com.ym.mec.common.controller.BaseController;
@@ -22,15 +20,12 @@ public class SysEmployeePositionController extends BaseController {
     private SysEmployeePositionService employeePositionService;
     @Autowired
     private OrganizationService organizationService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "获取分部下员工职位列表")
     @GetMapping("/findOrganPosition")
     @PreAuthorize("@pcs.hasPermissions('employeePosition/findOrganPosition')")
     public Object findAll(String organIds) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        organIds = organizationService.getEmployeeOrgan(sysUser.getId(),organIds,sysUser.getIsSuperAdmin());
+        organIds = organizationService.getEmployeeOrgan(organIds);
         return succeed(employeePositionService.findOrganPosition(organIds));
     }
 }

+ 2 - 14
mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreCategoriesController.java

@@ -29,8 +29,6 @@ public class SysMusicScoreCategoriesController extends BaseController {
     @Autowired
     private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询")
@@ -38,12 +36,7 @@ public class SysMusicScoreCategoriesController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('sysMusicScoreCategories/queryPage')")
     public Object queryPage(SysExamSongQueryInfo queryInfo) {
         queryInfo.setParentId(0);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(sysMusicScoreCategoriesService.queryPage(queryInfo));
     }
 
@@ -83,12 +76,7 @@ public class SysMusicScoreCategoriesController extends BaseController {
     @GetMapping("/queryTree")
     @PreAuthorize("@pcs.hasPermissions('sysMusicScoreCategories/queryTree')")
     public Object queryTree(MusicScoreQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(sysMusicScoreCategoriesService.queryTree(queryInfo));
     }
 

+ 1 - 16
mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java

@@ -1,11 +1,7 @@
 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.SysMusicScoreCategoriesDao;
 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;
@@ -14,14 +10,10 @@ 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;
-
 @RequestMapping("sysMusicScore")
 @Api(tags = "曲库")
 @RestController
@@ -32,8 +24,6 @@ public class SysMusicScoreController extends BaseController {
     @Autowired
     private SysMusicScoreCategoriesDao sysMusicScoreCategoriesDao;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation(value = "修改")
@@ -77,12 +67,7 @@ public class SysMusicScoreController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('sysMusicScore/queryPage')")
     public Object queryPage(SysExamSongQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         if(queryInfo.getCategoriesId() != null){
             String byCategoriesIds = sysMusicScoreCategoriesDao.findByCategoriesIds(queryInfo.getCategoriesId());
             byCategoriesIds = sysMusicScoreCategoriesDao.findByCategoriesIds(byCategoriesIds);

+ 1 - 20
mec-web/src/main/java/com/ym/mec/web/controller/SysUserCashAccountLogController.java

@@ -1,9 +1,5 @@
 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.entity.SysUserCashAccountLog;
 import com.ym.mec.biz.dal.page.AccountLogQueryInfo;
 import com.ym.mec.biz.service.OrganizationService;
@@ -11,16 +7,12 @@ import com.ym.mec.biz.service.SysUserCashAccountLogService;
 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;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
-import java.util.List;
-
 @RequestMapping("userCashAccountLog")
 @Api(tags = "用户账户退费记录")
 @RestController
@@ -29,18 +21,12 @@ public class SysUserCashAccountLogController extends BaseController {
 	@Autowired
 	private SysUserCashAccountLogService sysUserCashAccountLogService;
 	@Autowired
-	private SysUserFeignService sysUserFeignService;
-	@Autowired
 	private OrganizationService organizationService;
 
 	@ApiOperation(value = "获取退费详情")
 	@GetMapping("/get")
 	@PreAuthorize("@pcs.hasPermissions('userCashAccountLog/get')")
 	public Object get(Long id) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("请重新登录");
-		}
 		return succeed(sysUserCashAccountLogService.get(id));
 	}
 
@@ -55,12 +41,7 @@ public class SysUserCashAccountLogController extends BaseController {
 	@GetMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('userCashAccountLog/queryPage')")
 	public Object queryPage(AccountLogQueryInfo queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
 		return succeed(sysUserCashAccountLogService.queryPage(queryInfo));
 	}
 }

+ 9 - 27
mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java

@@ -1,14 +1,16 @@
 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.entity.TeacherAttendance;
 import com.ym.mec.biz.dal.enums.UpdateAttendanceEnum;
+import com.ym.mec.biz.dal.page.TeacherAttendanceComplaintsQueryInfo;
+import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.TeacherAttendanceService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.Arrays;
-import java.util.List;
-
-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;
@@ -16,16 +18,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-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.entity.TeacherAttendance;
-import com.ym.mec.biz.dal.page.TeacherAttendanceComplaintsQueryInfo;
-import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
-import com.ym.mec.biz.service.TeacherAttendanceService;
-import com.ym.mec.common.controller.BaseController;
-
 @RequestMapping("teacherAttendance")
 @Api(tags = "教师签到服务")
 @RestController
@@ -49,12 +41,7 @@ public class TeacherAttendanceController extends BaseController {
     @RequestMapping("/queryTeacherAttendances")
     @PreAuthorize("@pcs.hasPermissions('teacherAttendance/queryTeacherAttendances')")
     public Object queryTeacherAttendances(TeacherCloseQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(teacherAttendanceService.queryTeacherAttendances(queryInfo));
     }
 
@@ -94,12 +81,7 @@ public class TeacherAttendanceController extends BaseController {
     @PostMapping("/queryTeacherAttendanceComplaints")
     @PreAuthorize("@pcs.hasPermissions('teacherAttendance/queryTeacherAttendanceComplaints')")
     public Object queryTeacherAttendanceComplaints(TeacherAttendanceComplaintsQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(teacherAttendanceService.queryTeacherAttendanceComplaints(queryInfo));
     }
 

+ 4 - 34
mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

@@ -1,10 +1,6 @@
 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.TeacherStudentDataDto;
-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;
@@ -16,19 +12,13 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.*;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
 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.Date;
-import java.util.List;
-
 @RequestMapping("teacher")
 @Api(tags = "教师服务")
 @RestController
@@ -37,8 +27,6 @@ public class TeacherController extends BaseController {
     @Autowired
     private TeacherService teacherService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private ClassGroupService classGroupService;
@@ -54,12 +42,7 @@ public class TeacherController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('teacher/queryPage')")
     public Object queryPage(TeacherQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(teacherService.queryPageDetail(queryInfo));
     }
 
@@ -94,12 +77,7 @@ public class TeacherController extends BaseController {
     @GetMapping("/findTeachers")
     @PreAuthorize("@pcs.hasPermissions('teacher/findTeachers','system')")
     public HttpResponseResult findTeachers(String organId) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
-
+        organId = organizationService.getEmployeeOrgan(organId);
         return succeed(teacherService.findTeachers(organId));
     }
 
@@ -114,11 +92,7 @@ public class TeacherController extends BaseController {
     @GetMapping("/findTeacherByOrganId")
     @PreAuthorize("@pcs.hasPermissions('teacher/findTeacherByOrganId')")
     public HttpResponseResult findTeacherByOrganId(String organId,String subjectIds,String jobNature) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
+        organId = organizationService.getEmployeeOrgan(organId);
         return succeed(teacherService.findTeacherByOrganId(organId,subjectIds,jobNature));
     }
 
@@ -126,11 +100,7 @@ public class TeacherController extends BaseController {
     @GetMapping("/queryNameList")
     @PreAuthorize("@pcs.hasPermissions('teacher/queryNameList', 'system', 'education')")
     public HttpResponseResult queryPageName(TeacherNameQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(teacherService.queryPageName(queryInfo));
     }
 

+ 1 - 17
mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseRewardController.java

@@ -1,28 +1,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.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;
 import com.ym.mec.util.date.DateUtil;
 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.Date;
-import java.util.List;
 
 @RequestMapping("teacherCourseReward")
 @Api(tags = "结转奖励服务")
@@ -30,8 +21,6 @@ import java.util.List;
 public class TeacherCourseRewardController extends BaseController {
 
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private TeacherCourseRewardService teacherCourseRewardService;
@@ -41,12 +30,7 @@ public class TeacherCourseRewardController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('teacherCourseReward/queryPage')")
     public Object queryPage(TeacherCourseRewardQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         Date endTime = queryInfo.getEndTime();
         if(endTime != null){
             queryInfo.setEndTime(DateUtil.addDays(endTime, 1));

+ 1 - 16
mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseStatisticsController.java

@@ -1,25 +1,17 @@
 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.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;
 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("teacherCourseStatistics")
 @Api(tags = "教师排课统计服务")
@@ -27,10 +19,7 @@ import java.util.List;
 public class TeacherCourseStatisticsController extends BaseController {
 
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
-
     @Autowired
     private TeacherCourseStatisticsService teacherCourseStatisticsService;
 
@@ -38,11 +27,7 @@ public class TeacherCourseStatisticsController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('teacherCourseStatistics/queryPage')")
     public Object queryPage(TeacherCourseStatisticsQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(teacherCourseStatisticsService.queryPageDetail(queryInfo));
     }
 }

+ 1 - 15
mec-web/src/main/java/com/ym/mec/web/controller/TeacherSalaryComplaintsController.java

@@ -1,9 +1,6 @@
 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.entity.TeacherSalaryComplaints;
 import com.ym.mec.biz.dal.page.TeacherSalaryModifyQueryInfo;
 import com.ym.mec.biz.service.OrganizationService;
@@ -11,15 +8,11 @@ import com.ym.mec.biz.service.TeacherSalaryComplaintsService;
 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.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
-import java.util.List;
-
 @RequestMapping("teacherSalaryComplaints")
 @Api(tags = "老师课酬申诉")
 @RestController
@@ -28,20 +21,13 @@ public class TeacherSalaryComplaintsController extends BaseController {
     @Autowired
     private TeacherSalaryComplaintsService teacherSalaryComplaintsService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation(value = "分页获取")
     @RequestMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('teacherSalaryComplaints/queryPage')")
     public Object queryPage(TeacherSalaryModifyQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(teacherSalaryComplaintsService.queryPage(queryInfo));
     }
 

+ 1 - 6
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java

@@ -87,12 +87,7 @@ public class VipGroupActivityController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('vipGroupActivity/queryPage')")
     public Object queryPage(VipGroupActivityQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         Integer applyToStudentType = queryInfo.getApplyToStudentType();
         if(applyToStudentType != null){
             if(applyToStudentType == 0 || applyToStudentType == 1){

+ 2 - 12
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -180,12 +180,7 @@ public class VipGroupManageController extends BaseController {
     @GetMapping("/queryAll")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/queryAll')")
     public Object queryAll(VipGroupQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(vipGroupService.findVipGroups(queryInfo));
     }
 
@@ -208,12 +203,7 @@ public class VipGroupManageController extends BaseController {
     @GetMapping(value = "/findHaveCourseBalanceStudents")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/findHaveCourseBalanceStudents')")
     public Object findHaveCourseBalanceStudents(VipGroupQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(vipGroupService.findHaveCourseBalanceStudents(queryInfo));
     }
 

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

@@ -2,9 +2,7 @@ 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.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;
@@ -14,7 +12,6 @@ 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.validation.annotation.Validated;
@@ -23,9 +20,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;
-
 @Api(tags = "回访服务")
 @RequestMapping("visit")
 @RestController
@@ -42,12 +36,7 @@ public class VisitController extends BaseController {
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('visit/queryPage')")
     public HttpResponseResult<PageInfo<StudentVisitDto>> queryPage(StudentVisitQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(studentVisitService.getPageList(queryInfo));
     }
 

+ 1 - 8
mec-web/src/main/java/com/ym/mec/web/controller/WebCourseHomeworkController.java

@@ -30,8 +30,6 @@ public class WebCourseHomeworkController extends BaseController {
     @Autowired
     private CourseHomeworkService courseHomeworkService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private StudentCourseHomeworkService studentCourseHomeworkService;
@@ -39,12 +37,7 @@ public class WebCourseHomeworkController extends BaseController {
     @ApiOperation(value = "分页查询作业列表")
     @GetMapping(value = "/queryHomePage")
     public Object queryPage(CourseHomeWorkTemplateQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         return succeed(courseHomeworkService.queryHomePage(queryInfo));
     }