瀏覽代碼

首页调整,导出调整

zouxuan 3 年之前
父節點
當前提交
c949d40146
共有 47 個文件被更改,包括 432 次插入771 次删除
  1. 43 13
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java
  2. 2 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ClassGroupQueryInfo.java
  3. 41 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/EducationBaseQueryInfo.java
  4. 1 24
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionQueryInfo.java
  5. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupPerformanceQueryInfo.java
  6. 1 13
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicMemberQueryInfo.java
  7. 1 13
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/NoClassMusicStudentQueryInfo.java
  8. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentErrorLeaveQueryInfo.java
  9. 0 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherServeQueryInfo.java
  10. 5 5
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java
  11. 0 10
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexErrDataRecordService.java
  12. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  13. 46 1
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java
  14. 1 9
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherCourseStatisticsService.java
  15. 2 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  16. 43 73
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  17. 1 62
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexErrDataRecordServiceImpl.java
  18. 2 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java
  19. 0 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  20. 0 24
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPerformanceServiceImpl.java
  21. 12 110
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  22. 106 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java
  23. 7 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java
  24. 0 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  25. 0 13
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  26. 2 2
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  27. 6 6
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  28. 4 4
      mec-biz/src/main/resources/config/mybatis/IndexErrDataRecordMapper.xml
  29. 4 4
      mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml
  30. 2 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  31. 2 5
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  32. 4 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupPerformanceMapper.xml
  33. 1 4
      mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml
  34. 2 5
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  35. 4 6
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  36. 7 69
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  37. 16 93
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  38. 3 15
      mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java
  39. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java
  40. 4 12
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java
  41. 3 5
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java
  42. 4 0
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPerformanceController.java
  43. 37 67
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java
  44. 1 11
      mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java
  45. 2 6
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  46. 2 6
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  47. 0 1
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherCourseStatisticsController.java

+ 43 - 13
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -171,17 +171,24 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
     int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
 
-    List<Map<Integer, Integer>> countLessThenThreeClassOrganGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
+
+    List<Map<Integer, Integer>> countLessThenThreeClassOrganGroupNum(@Param("organIds") Set<Integer> organIds,
+                                                                     @Param("educationUserId") Integer educationUserId,
+                                                                     @Param("tenantId") Integer tenantId);
 
     List<String> getLessThenThreeMusicGroup(@Param("organIds") Set<Integer> organIds,@Param("tenantId") Integer tenantId);
 
     int queryErrInspection(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime,@Param("tenantId") Integer tenantId);
 
-    List<Map<Integer, Integer>> queryOrganErrInspection(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> queryOrganErrInspection(@Param("organIds") Set<Integer> organIds,
+                                                        @Param("startTime") String startTime,
+                                                        @Param("tenantId") Integer tenantId);
 
     IndexErrInfoDto getNoClassMusicGroupStudentInfo(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
 
-    List<Map<Integer, Integer>> getOrganNoClassMusicGroupStudentNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> getOrganNoClassMusicGroupStudentNum(@Param("organIds") Set<Integer> organIds,
+                                                                    @Param("educationUserId") Integer educationUserId,
+                                                                    @Param("tenantId") Integer tenantId);
 
     int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds,
                                  @Param("educationUserId") Integer educationUserId,
@@ -189,13 +196,17 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
 
 
-    List<Map<Integer, Integer>> countOrganNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> countOrganNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds,
+                                                              @Param("educationUserId") Integer educationUserId,
+                                                              @Param("tenantId") Integer tenantId);
 
     List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
 
     List<Long> queryApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
 
-    List<Map<Integer, Integer>> queryOrganApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> queryOrganApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds,
+                                                               @Param("educationUserId") Integer educationUserId,
+                                                               @Param("tenantId") Integer tenantId);
 
     int queryStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
                                           @Param("type") String type, @Param("startTime") String startTime,@Param("tenantId") Integer tenantId);
@@ -211,7 +222,8 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                            @Param("courseStartTimeError") String courseStartTimeError,
                            @Param("courseEndTimeError") String courseEndTimeError,@Param("tenantId") Integer tenantId);
 
-    List<Map<Integer, Integer>> getOrganCourseTimeError(@Param("organIds") Set<Integer> organIds, @Param("classGroupIds") List<Long> classGroupIds);
+    List<Map<Integer, Integer>> getOrganCourseTimeError(@Param("organIds") Set<Integer> organIds,
+                                                        @Param("classGroupIds") List<Long> classGroupIds);
 
     /**
      * 获取考勤异常编号
@@ -219,7 +231,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int getAttendanceError(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds,@Param("tenantId") Integer tenantId);
-    List<Map<Integer, Integer>> getOrganAttendanceError(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> getOrganAttendanceError(@Param("organIds") Set<Integer> organIds,
+                                                        @Param("startTime") String startTime,
+                                                        @Param("classGroupIds") List<Long> classGroupIds,
+                                                        @Param("tenantId") Integer tenantId);
 
     /**
      * 获取旷课考勤
@@ -227,7 +242,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int getNoAttendance(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds,@Param("tenantId") Integer tenantId);
-    List<Map<Integer, Integer>> getOrganNoAttendance(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> getOrganNoAttendance(@Param("organIds") Set<Integer> organIds,
+                                                     @Param("startTime") String startTime,
+                                                     @Param("classGroupIds") List<Long> classGroupIds,
+                                                     @Param("tenantId") Integer tenantId);
 
     /**
      * 获取老师离职申请数
@@ -250,7 +268,9 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @param monthStr
      * @return
      */
-    List<Map<Integer, Integer>> queryOrganLowTeacherSalary(@Param("organIdsStr") String organIdsStr, @Param("monthStr") String monthStr,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> queryOrganLowTeacherSalary(@Param("organIdsStr") String organIdsStr,
+                                                           @Param("monthStr") String monthStr,
+                                                           @Param("tenantId") Integer tenantId);
 
     /**
      * 乐团巡查任务未计划
@@ -258,7 +278,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int queryInspectionItem(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId,@Param("tenantId") Integer tenantId);
-    List<Map<Integer, Integer>> queryOrganInspectionItem(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> queryOrganInspectionItem(@Param("organIdsStr") String organIdsStr,
+                                                         @Param("startTime") String startTime,
+                                                         @Param("userId") Integer userId,
+                                                         @Param("tenantId") Integer tenantId);
 
     /**
      * 乐团巡查任务未提交
@@ -266,7 +289,9 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int queryInspectionItemPlan(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime,@Param("tenantId") Integer tenantId);
-    List<Map<Integer, Integer>> queryOrganInspectionItemPlan(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> queryOrganInspectionItemPlan(@Param("organIdsStr") String organIdsStr,
+                                                             @Param("startTime") String startTime,
+                                                             @Param("tenantId") Integer tenantId);
 
     /**
      * 未完成的回访任务
@@ -274,7 +299,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int queryStudentVisit(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId,@Param("tenantId") Integer tenantId);
-    List<Map<Integer, Integer>> queryOrganStudentVisit(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> queryOrganStudentVisit(@Param("organIdsStr") String organIdsStr,
+                                                       @Param("startTime") String startTime,
+                                                       @Param("userId") Integer userId,
+                                                       @Param("tenantId") Integer tenantId);
 
     List<IndexBaseMonthData> getFinancePayData(@Param("dayStr") String dayStr,@Param("tenantId") Integer tenantId);
 
@@ -326,7 +354,9 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                @Param("classGroupIds") List<Long> classGroupIds,
                                @Param("studentErrorLeaveNum") Integer studentErrorLeaveNum,@Param("tenantId") Integer tenantId);
 
-    List<Map<Integer, Integer>> countOrganStudentErrorLeave(@Param("organIds") Set<Integer> organIds, @Param("classGroupIds") List<Long> classGroupIds,@Param("tenantId") Integer tenantId);
+    List<Map<Integer, Integer>> countOrganStudentErrorLeave(@Param("organIds") Set<Integer> organIds,
+                                                            @Param("classGroupIds") List<Long> classGroupIds,
+                                                            @Param("tenantId") Integer tenantId);
 
     int countStudentErrorLeave1(Map<String, Object> params);
 

+ 2 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ClassGroupQueryInfo.java

@@ -1,12 +1,10 @@
 package com.ym.mec.biz.dal.page;
 
-import io.swagger.annotations.ApiModelProperty;
-
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
-public class ClassGroupQueryInfo extends QueryInfo {
+public class ClassGroupQueryInfo extends EducationBaseQueryInfo {
 	
 	@ApiModelProperty(value = "班级编号", required = false)
 	private Integer id;
@@ -23,9 +21,6 @@ public class ClassGroupQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "班级名称", required = false)
     private String name;
 
-    @ApiModelProperty(value = "分部", required = false)
-    private String organIdList;
-    
     private Integer delFlag;
 
     @ApiModelProperty(value = "少于3人的线上基础技能班,大于0")
@@ -39,14 +34,6 @@ public class ClassGroupQueryInfo extends QueryInfo {
 		this.lessThenThreeHighOnline = lessThenThreeHighOnline;
 	}
 
-	public String getOrganIdList() {
-		return organIdList;
-	}
-
-	public void setOrganIdList(String organIdList) {
-		this.organIdList = organIdList;
-	}
-
 	public Integer getId() {
 		return id;
 	}

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EducationBaseQueryInfo.java

@@ -0,0 +1,41 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+import java.util.List;
+
+//用于处理乐团主管特殊规则
+public class EducationBaseQueryInfo extends QueryInfo {
+    //分部
+    private String organIds;
+
+    //教务老师
+    private Integer educationUserId;
+
+    //班级列表
+    private List<Long> classGroupIds;
+
+    public List<Long> getClassGroupIds() {
+        return classGroupIds;
+    }
+
+    public void setClassGroupIds(List<Long> classGroupIds) {
+        this.classGroupIds = classGroupIds;
+    }
+
+    public String getOrganIds() {
+        return organIds;
+    }
+
+    public void setOrganIds(String organIds) {
+        this.organIds = organIds;
+    }
+
+    public Integer getEducationUserId() {
+        return educationUserId;
+    }
+
+    public void setEducationUserId(Integer educationUserId) {
+        this.educationUserId = educationUserId;
+    }
+}

+ 1 - 24
mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionQueryInfo.java

@@ -1,17 +1,10 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
 
-public class InspectionQueryInfo extends QueryInfo {
-
-    @ApiModelProperty(value = "分部ids",required = false)
-    private String organId;
-
-    @ApiModelProperty(value = "乐团主管id",required = false)
-    private Integer userId;
+public class InspectionQueryInfo extends EducationBaseQueryInfo {
 
     @ApiModelProperty(value = "月份",required = false)
     private Date month;
@@ -65,22 +58,6 @@ public class InspectionQueryInfo extends QueryInfo {
         this.searchType = searchType;
     }
 
-    public String getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(String organId) {
-		this.organId = organId;
-	}
-
-    public Integer getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Integer userId) {
-        this.userId = userId;
-    }
-
     public Date getMonth() {
         return month;
     }

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupPerformanceQueryInfo.java

@@ -1,11 +1,10 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.common.page.QueryInfo;
-
-public class MusicGroupPerformanceQueryInfo extends QueryInfo {
+public class MusicGroupPerformanceQueryInfo extends EducationBaseQueryInfo {
 
     private String musicGroupId;
 
+    //用父类的organIds,因为涉及到移动端,所以保留了该字段
     private String organId;
 
     public String getOrganId() {
@@ -13,6 +12,7 @@ public class MusicGroupPerformanceQueryInfo extends QueryInfo {
     }
 
     public void setOrganId(String organId) {
+        super.setOrganIds(organId);
         this.organId = organId;
     }
 

+ 1 - 13
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicMemberQueryInfo.java

@@ -1,11 +1,10 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
 
-public class MusicMemberQueryInfo extends QueryInfo {
+public class MusicMemberQueryInfo extends EducationBaseQueryInfo {
 
 	@ApiModelProperty(value = "0已过期,1即将过期,2待生效", required = false)
 	private Integer hasMember = 0;
@@ -16,9 +15,6 @@ public class MusicMemberQueryInfo extends QueryInfo {
 
 	private Date visitEndTime;
 
-    @ApiModelProperty(value = "分部", required = false)
-    private String organId;
-
 	public Date getVisitStartTime() {
 		return visitStartTime;
 	}
@@ -50,12 +46,4 @@ public class MusicMemberQueryInfo extends QueryInfo {
 	public void setHasMember(Integer hasMember) {
 		this.hasMember = hasMember;
 	}
-
-	public String getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(String organId) {
-		this.organId = organId;
-	}
 }

+ 1 - 13
mec-biz/src/main/java/com/ym/mec/biz/dal/page/NoClassMusicStudentQueryInfo.java

@@ -1,16 +1,12 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author Joburgess
  * @Date 2021/3/25 0025
  */
-public class NoClassMusicStudentQueryInfo extends QueryInfo {
-
-    @ApiModelProperty(value = "分部编号")
-    private String organIds;
+public class NoClassMusicStudentQueryInfo extends EducationBaseQueryInfo {
 
     @ApiModelProperty(value = "乐团名称/编号")
     private String musicGroupSearch;
@@ -18,14 +14,6 @@ public class NoClassMusicStudentQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "学员姓名/编号")
     private String studentSearch;
 
-    public String getOrganIds() {
-        return organIds;
-    }
-
-    public void setOrganIds(String organIds) {
-        this.organIds = organIds;
-    }
-
     public String getMusicGroupSearch() {
         return musicGroupSearch;
     }

+ 1 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentErrorLeaveQueryInfo.java

@@ -1,9 +1,8 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
-public class StudentErrorLeaveQueryInfo extends QueryInfo {
+public class StudentErrorLeaveQueryInfo extends EducationBaseQueryInfo {
     private Integer userId;
 
     private String organId;

+ 0 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherServeQueryInfo.java

@@ -15,8 +15,6 @@ public class TeacherServeQueryInfo extends QueryInfo {
 
     private String organId;
 
-    private List<Integer> organIds;
-
     private Integer teacherId;
 
     private Integer unDone;
@@ -71,14 +69,6 @@ public class TeacherServeQueryInfo extends QueryInfo {
         this.organId = organId;
     }
 
-    public List<Integer> getOrganIds() {
-        return organIds;
-    }
-
-    public void setOrganIds(List<Integer> organIds) {
-        this.organIds = organIds;
-    }
-
     public Integer getTeacherId() {
         return teacherId;
     }

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

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

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

@@ -28,16 +28,6 @@ public interface IndexErrDataRecordService extends BaseService<Long, IndexErrDat
     void indexErrDataRecordTask(String date);
 
     /**
-     * @describe 历史异常数据记录导出
-     * @author Joburgess
-     * @date 2021/5/28 0028
-     * @param startDate:
-     * @param endDate:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.IndexErrDataRecord>
-     */
-    List<IndexErrorDataExportDto> errRecordExport(String organIds, String startDate, String endDate);
-
-    /**
      * @describe 获取所有异常相关教务人员
      * @author Joburgess
      * @date 2021/6/2 0002

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 import com.ym.mec.biz.dal.page.MusicMemberQueryInfo;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -172,7 +173,7 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
      * @param operatorId
      * @return
      */
-    boolean applyQuitMusicGroup(List<Integer> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit, Integer operatorId);
+    boolean applyQuitMusicGroup(List<SysUserRoleEnum> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit, Integer operatorId);
 
 
     /**
@@ -192,7 +193,7 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
      * @param reqMusicGroupQuit
      * @return
      */
-    boolean approveQuitMusicGroup(List<Integer> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit);
+    boolean approveQuitMusicGroup(List<SysUserRoleEnum> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit);
 
     /**
      * 一键退团

+ 46 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java

@@ -2,8 +2,11 @@ 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.*;
 
@@ -39,7 +42,27 @@ public interface OrganizationService extends BaseService<Integer, Organization>
 
     Long add(Organization organization);
 
-    Map<String,List<Mapper>> getOrganRole(List<Integer> organIds);
+    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
+    * @author zx
+    * @date 2022/1/6 11:29
+    */
+    List<SysUserRoleEnum> queryOrganRole(Integer organId,Integer userId);
 
     /**
     * @description: 获取分部的管理人员
@@ -60,4 +83,26 @@ public interface OrganizationService extends BaseService<Integer, Organization>
     * @date 2022/1/5 12:44
     */
     String getEmployeeOrgan(Integer userId,String organIds,Boolean isSuper);
+
+    List<Organization> findAllOrgans(Integer tenantId);
+
+    List<Organization> findOrgans(List<Integer> organIds,Integer tenantId);
+
+    /**
+    * @description: 校验当前用户是否只有教务老师角色,并给教务老师角色赋值
+     * @param queryInfo
+    * @return T
+    * @author zx
+    * @date 2022/1/6 18:11
+    */
+    <T extends EducationBaseQueryInfo> T onlyEducation(T queryInfo);
+
+    /**
+    * @description: 校验当前用户是否只有教务老师角色,并给教务老师角色赋值
+     * @param queryInfo
+    * @return T
+    * @author zx
+    * @date 2022/1/6 18:11
+    */
+    <T extends EducationBaseQueryInfo> T onlyEducationInitClassId(T queryInfo);
 }

+ 1 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherCourseStatisticsService.java

@@ -1,17 +1,9 @@
 package com.ym.mec.biz.service;
 
-import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.entity.TeacherCourseStatistics;
-import com.ym.mec.biz.dal.page.*;
-import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.biz.dal.page.TeacherCourseStatisticsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
-import com.ym.mec.util.date.DateUtil;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
 
 
 public interface TeacherCourseStatisticsService extends BaseService<Long, TeacherCourseStatistics> {

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

@@ -160,7 +160,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private MusicGroupSchoolTermCourseDetailDao musicGroupSchoolTermCourseDetailDao;
     @Autowired
-    private CloudTeacherOrderService cloudTeacherOrderService;
+    private OrganizationService organizationService;
 
     @Override
     public BaseDAO<Integer, ClassGroup> getDAO() {
@@ -3603,13 +3603,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<ClassGroupTeachersDto> dataList = null;
         int count;
         if (Objects.nonNull(queryInfo.getLessThenThreeHighOnline())) {
-            List<Long> lessThenThreeClassGroupIds = classGroupStudentMapperDao.getLessThenThreeClassGroupIds(queryInfo.getOrganIdList());
-            SysUser sysUser = sysUserFeignService.queryUserInfo();
-            List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-            //如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
-            if (userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-                params.put("educationUserId", sysUser.getId());
-            }
+            List<Long> lessThenThreeClassGroupIds = classGroupStudentMapperDao.getLessThenThreeClassGroupIds(queryInfo.getOrganIds());
             params.put("classGroupIds", lessThenThreeClassGroupIds);
             if (CollectionUtils.isEmpty(lessThenThreeClassGroupIds)) {
                 count = 0;

+ 43 - 73
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -22,6 +22,7 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 
+import io.swagger.models.auth.In;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -46,7 +47,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	@Autowired
 	private IndexBaseMonthDataDao indexBaseMonthDataDao;
 	@Autowired
-	private OrganizationDao organizationDao;
+	private OrganizationService organizationService;
 	@Autowired
 	private EmployeeDao employeeDao;
 	@Autowired
@@ -89,7 +90,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexBaseDto> result = new ArrayList<>();
 
 		LocalDate nowDate = LocalDate.now();
-//		Date currentMonth = Date.from(nowDate.atStartOfDay(DateUtil.zoneId).toInstant());
 
 		LocalDate startDate = nowDate.plusDays(-30);
 		if(Objects.nonNull(queryInfo.getStartDate())){
@@ -329,7 +329,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	public void indexBaseDataTask(Integer tenantId, String dayStr, Set<IndexDataType> dataTypes) {
 		LocalDate nowDate = LocalDate.now();
 		
-		List<Organization> allOrgans = organizationDao.findAllOrgans(tenantId);
+		List<Organization> allOrgans = organizationService.findAllOrgans(tenantId);
 		if(CollectionUtils.isEmpty(this.organIds.get())){
 			this.organIds.get().clear();
 			this.organIds.get().addAll(allOrgans.stream().map(Organization::getId).collect(Collectors.toSet()));
@@ -608,22 +608,20 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
-	public Map<String, Object> getIndexErrData(String organIdsStr, IndexErrorType errorType) {
+	public Map<String, Object> getIndexErrData(Integer organId, IndexErrorType errorType) {
 		Integer tenantId = TenantContextHolder.getTenantId();
 		//只筛选指定时间之后的数据
 		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 
-		Set<Integer> organIds = null;
-		if(StringUtils.isNotBlank(organIdsStr)){
-			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
-		}
+		Set<Integer> organIds = new HashSet<>();
+		organIds.add(organId);
 		List<IndexErrInfoDto> all = new ArrayList<>();
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
 		List<Long> classGroupIds = null;
 		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+		SysUserRoleEnum userRoleEnum = organizationService.getOrganRole(organId, sysUser.getId());
+		if (!sysUser.getIsSuperAdmin() && userRoleEnum == SysUserRoleEnum.EDUCATIONAL_TEACHER) {
 			//获取教务老师关联的班级列表
 			classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
 			educationUserId = sysUser.getId();
@@ -676,7 +674,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,organIdsStr);
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organId.toString());
 			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());
@@ -703,20 +701,20 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 			//课程时间安排异常
 			Integer userId = null;
-			if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
+			if (userRoleEnum != SysUserRoleEnum.SECTION_MANAGER && !sysUser.getIsSuperAdmin()) {
 				userId = sysUser.getId();
 			}
 
 			//乐团巡查任务未计划
-			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr,startTime,userId,tenantId);
+			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organId.toString(),startTime,userId,tenantId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem, null));
 
 			//乐团巡查任务未提交
-			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr,startTime,tenantId);
+			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organId.toString(),startTime,tenantId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM_PLAN, IndexErrorType.INSPECTION_ITEM_PLAN.getMsg(),inspectionItemPlan, null));
 
 			//回访任务未完成
-			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr,startTime,userId,tenantId);
+			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organId.toString(),startTime,userId,tenantId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_VISIT, IndexErrorType.STUDENT_VISIT.getMsg(),studentVisit, null));
 
 			three.setNum(threeChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
@@ -789,7 +787,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		Date date = new Date();
 
-		List<IndexErrInfoDto> all = new ArrayList<>();
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
@@ -875,17 +872,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			teacherExpectSalaryBeLowMap = MapUtil.mapListToMap(teacherExpectSalaryBeLowMapList, Integer.class, Integer.class);
 
 			//课程时间安排异常
-			Integer userId = null;
-			if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
-				userId = sysUser.getId();
-			}
 			if(classGroupIds == null || classGroupIds.size() > 0){
 				List<Map<Integer, Integer>> courseTimeErrorMapList = indexBaseMonthDataDao.getOrganCourseTimeError(organIds, classGroupIds);
 				courseTimeErrorMap = MapUtil.mapListToMap(courseTimeErrorMapList, Integer.class, Integer.class);
 			}
 
 			//乐团巡查任务未计划
-			List<Map<Integer, Integer>> inspectionItemMapList = indexBaseMonthDataDao.queryOrganInspectionItem(organIdsStr, startTime, userId, tenantId);
+			List<Map<Integer, Integer>> inspectionItemMapList = indexBaseMonthDataDao.queryOrganInspectionItem(organIdsStr, startTime, null, tenantId);
 			inspectionItemMap = MapUtil.mapListToMap(inspectionItemMapList, Integer.class, Integer.class);
 
 			//乐团巡查任务未提交
@@ -893,7 +886,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			inspectionItemPlanMap = MapUtil.mapListToMap(inspectionItemPlanMapList, Integer.class, Integer.class);
 
 			//回访任务未完成
-			List<Map<Integer, Integer>> studentVisitMapList = indexBaseMonthDataDao.queryOrganStudentVisit(organIdsStr, startTime, userId, tenantId);
+			List<Map<Integer, Integer>> studentVisitMapList = indexBaseMonthDataDao.queryOrganStudentVisit(organIdsStr, startTime, null, tenantId);
 			studentVisitMap = MapUtil.mapListToMap(studentVisitMapList, Integer.class, Integer.class);
 		}
 
@@ -924,7 +917,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			teacherServeErrorMap = MapUtil.mapListToMap(teacherServeErrorMapList, Integer.class, Integer.class);
 		}
 
-		List<Organization> organs = organizationDao.findOrgans(new ArrayList<>(organIds));
+		List<Organization> organs = organizationService.findOrgans(new ArrayList<>(organIds),tenantId);
 
 		IndexErrorDataExportDto totalData = new IndexErrorDataExportDto();
 		totalData.setOrganName("总计");
@@ -1034,21 +1027,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
-	public List<IndexErrInfoDto> getRemindMatterData(String organIds,Integer tenantId) {
+	public List<IndexErrInfoDto> getRemindMatterData(Integer organId) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			throw new BizException("用户信息获取失败");
 		}
+		Integer tenantId = TenantContextHolder.getTenantId();
 
-		Set<Integer> organIdSet = null;
-		if(StringUtils.isNotBlank(organIds)){
-			organIdSet = Arrays.stream(organIds.split(",")).map(Integer::new).collect(Collectors.toSet());
-		}
-
+		Set<Integer> organIdSet = new HashSet<>();
+		organIdSet.add(organId);
 		//当前用户是否是分部经理
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+		SysUserRoleEnum organRole = organizationService.getOrganRole(organId, sysUser.getId());
 		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+		if (!sysUser.getIsSuperAdmin() && organRole != SysUserRoleEnum.SECTION_MANAGER) {
 			//获取教务老师关联的班级列表
 			educationUserId = sysUser.getId();
 		}
@@ -1056,40 +1047,21 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		List<IndexErrInfoDto> result = new ArrayList<>();
 
-		IndexErrInfoDto indexErrInfoDto = new IndexErrInfoDto();
-		indexErrInfoDto.setErrorType(WAIT_CREATE_PAYMENT_CALENDER);
-		indexErrInfoDto.setDesc(WAIT_CREATE_PAYMENT_CALENDER.getMsg());
-		String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_CREATE_PAYMENT_CALENDER, tenantId);
-		if(StringUtils.isNotEmpty(configValue1)){
-			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIds,tenantId);
-			String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
-			if(musicGroupIds.size() > 0){
-				List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
-				if(calenderIds.size() > 0){
-					List<String> musicGroupIdList = musicGroupPaymentCalenderDao.queryMusicGroupIds(calenderIds);
-					indexErrInfoDto.setResult(musicGroupIdList);
-					indexErrInfoDto.setNum(musicGroupIdList.size());
-				}
-			}
-		}
-		result.add(indexErrInfoDto);
-
 		//未缴费学员数
 		result.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIdSet,educationUserId, 1, tenantId), Arrays.asList(educationUserId)));
 
 		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
 		//全职未离职老师
 		//预计课酬较低
-		int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIds,monthStr, tenantId);
+		int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organId.toString(),monthStr, tenantId);
 		result.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
 
 		//乐团学员会员即将到期首页提醒
-		String configValue = sysConfigDao.findConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT);
-		if(StringUtils.isEmpty(configValue)){
+		String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,tenantId);
+		if (StringUtils.isEmpty(configValue)) {
 			configValue = "15";
 		}
-		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIds);
+		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organId.toString());
 		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();
@@ -1100,7 +1072,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		result.add(infoDto);
 
 		//乐团展演计划提醒
-		List<MusicGroupPerformance> musicGroupPerformances = musicGroupPerformanceDao.findNoStart(educationUserId,organIds);
+		List<MusicGroupPerformance> musicGroupPerformances = musicGroupPerformanceDao.findNoStart(educationUserId,organId.toString());
 		IndexErrInfoDto infoDto1 = new IndexErrInfoDto();
 		infoDto1.setErrorType(IndexErrorType.MUSIC_GROUP_PERFORMANCE);
 		infoDto1.setNum(musicGroupPerformances.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet()).size());
@@ -1111,21 +1083,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
-	public Map<String,Boolean> hasIndexErrData(String organIdsStr) {
+	public Map<String,Boolean> hasIndexErrData(Integer organId) {
 		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 = null;
-		if(StringUtils.isNotBlank(organIdsStr)){
-			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
-		}
+		Set<Integer> organIds = new HashSet<>();
+		organIds.add(organId);
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+		SysUserRoleEnum organRole = organizationService.getOrganRole(organId, sysUser.getId());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
 		List<Long> classGroupIds = null;
 		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+		if (!sysUser.getIsSuperAdmin() && organRole == SysUserRoleEnum.EDUCATIONAL_TEACHER) {
 			//获取教务老师关联的班级列表
 			classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
 			educationUserId = sysUser.getId();
@@ -1176,11 +1146,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 		}
 		if(!flag2){
-			String configValue = sysConfigDao.findConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT);
-			if(StringUtils.isEmpty(configValue)){
+			String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,tenantId);
+			if (StringUtils.isEmpty(configValue)) {
 				configValue = "15";
 			}
-			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIdsStr);
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organId.toString());
 			if(studentRegistrations.size() > 0){
 				flag2 = true;
 			}
@@ -1190,24 +1160,24 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		boolean flag3 = false;
 
 		Integer userId = null;
-		if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
+		if (organRole != SysUserRoleEnum.SECTION_MANAGER && !sysUser.getIsSuperAdmin()) {
 			userId = sysUser.getId();
 		}
 
 		if(!flag3){
-			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr,startTime,userId, tenantId);
+			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organId.toString(),startTime,userId, tenantId);
 			if(inspectionItem > 0){
 				flag3 = true;
 			}
 		}
 		if(!flag3){
-			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr,startTime, tenantId);
+			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organId.toString(),startTime, tenantId);
 			if(inspectionItemPlan > 0){
 				flag3 = true;
 			}
 		}
 		if(!flag3){
-			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr,startTime,userId, tenantId);
+			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organId.toString(),startTime,userId, tenantId);
 			if(studentVisit > 0){
 				flag3 = true;
 			}
@@ -1267,7 +1237,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(organIdsStr,monthStr, tenantId);
+			int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organId.toString(),monthStr, tenantId);
 			if(lowTeacherSalary > 0){
 				flag5 = true;
 			}
@@ -1280,7 +1250,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		if(!flag5){
 			//获取关联的乐团列表
-			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organIdsStr,tenantId);
+			List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,organId.toString(),tenantId);
 			if(musicGroupIds.size() > 0){
 				String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
 				date = new Date();
@@ -1293,7 +1263,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		if(!flag5){
 			if(!flag5){
-				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
+				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organId.toString());
 				if(studentRegistrations.size() > 0){
 					flag5 = true;
 				}
@@ -1307,7 +1277,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	@Override
 	public PageInfo<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds, OrganCloudStudyStudentDataQueryInfo queryInfo) {
 		PageInfo<EduOrganStudentDataDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		List<Organization> organs = organizationDao.getOrgans(organIds, queryInfo.getTenantId());
+		List<Organization> organs = organizationService.findOrgans(organIds, queryInfo.getTenantId());
 		pageInfo.setTotal(organs.size());
 
 		if(CollectionUtils.isEmpty(organs)){

+ 1 - 62
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexErrDataRecordServiceImpl.java

@@ -198,67 +198,6 @@ public class IndexErrDataRecordServiceImpl extends BaseServiceImpl<Long, IndexEr
 	}
 
 	@Override
-	public List<IndexErrorDataExportDto> errRecordExport(String organIdsStr, String startDate, String endDate) {
-		List<IndexErrorDataExportDto> result = new ArrayList<>();
-		Set<Integer> queryOrganIds = null;
-		if(StringUtils.isNotBlank(organIdsStr)){
-			queryOrganIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
-		}
-		List<IndexErrDataRecord> errRecords = indexErrDataRecordDao.getWithGenerateTime(queryOrganIds, startDate, endDate, TenantContextHolder.getTenantId());
-		if(CollectionUtils.isEmpty(errRecords)){
-			return result;
-		}
-		List<Integer> organIds = errRecords.stream().map(IndexErrDataRecord::getOrganId).collect(Collectors.toList());
-		List<Organization> organs = organizationDao.findOrgans(organIds);
-		Map<Integer, String> idOrganNameMap = organs.stream().collect(Collectors.toMap(Organization::getId, o -> o.getName()));
-
-		List<Integer> userIds = errRecords.stream().map(IndexErrDataRecord::getDealUserId).collect(Collectors.toList());
-		Map<Integer, SimpleUserDto> idUserMap = new HashMap<>();
-		if(!CollectionUtils.isEmpty(userIds)){
-			List<SimpleUserDto> users = teacherDao.getUsersSimpleInfo(userIds);
-			idUserMap = users.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, u->u, (u1, u2)->u1));
-		}
-		Map<Integer, List<IndexErrDataRecord>> organDataMap = errRecords.stream().collect(Collectors.groupingBy(IndexErrDataRecord::getOrganId));
-		for (Map.Entry<Integer, List<IndexErrDataRecord>> organDataMapEntry : organDataMap.entrySet()) {
-			Map<Date, Map<Integer, List<IndexErrDataRecord>>> dateUserRecordMap = organDataMapEntry.getValue().stream().collect(Collectors.groupingBy(IndexErrDataRecord::getGenerateTime, Collectors.groupingBy(IndexErrDataRecord::getDealUserId)));
-			for (Map.Entry<Date, Map<Integer, List<IndexErrDataRecord>>> dateUserRecordMapEntry : dateUserRecordMap.entrySet()) {
-				String generateTimeStr = DateUtil.dateToString(dateUserRecordMapEntry.getKey(), DateUtil.DATE_FORMAT_MIN);
-				for (Map.Entry<Integer, List<IndexErrDataRecord>> userRecordMapEntry : dateUserRecordMapEntry.getValue().entrySet()) {
-					IndexErrorDataExportDto record = new IndexErrorDataExportDto();
-					record.setGenerateTime(generateTimeStr);
-					record.setOrganName(idOrganNameMap.get(organDataMapEntry.getKey()));
-					if(idUserMap.containsKey(userRecordMapEntry.getKey())){
-						record.setDealUserName(idUserMap.get(userRecordMapEntry.getKey()).getUserName());
-					}
-					Map<IndexErrorType, Long> typeDataNumMap = userRecordMapEntry.getValue().stream().collect(Collectors.groupingBy(IndexErrDataRecord::getDataType, Collectors.counting()));
-					for (Map.Entry<IndexErrorType, Long> typeDataNumMapEntry : typeDataNumMap.entrySet()) {
-						switch (typeDataNumMapEntry.getKey()){
-							case MUSIC_PATROL_ITEM:
-								record.setMusicPatrolItem(typeDataNumMapEntry.getValue().intValue());
-								break;
-							case INSPECTION_ITEM_PLAN:
-								record.setInspectionItemPlan(typeDataNumMapEntry.getValue().intValue());
-								break;
-							case STUDENT_VISIT:
-								record.setStudentVisit(typeDataNumMapEntry.getValue().intValue());
-								break;
-							case TEACHER_EXCEPTION_ATTENDANCE:
-								record.setTeacherExceptionAttendance(typeDataNumMapEntry.getValue().intValue());
-								break;
-							case TEACHER_NOT_A_CLASS:
-								record.setTeacherNotAClass(typeDataNumMapEntry.getValue().intValue());
-								break;
-						}
-					}
-					result.add(record);
-				}
-			}
-		}
-
-		return result;
-	}
-
-	@Override
 	public PageInfo<IndexErrorDataExportDto> queryRecord(IndexErrRecordQueryInfo queryInfo) {
 		PageInfo<IndexErrorDataExportDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
@@ -277,7 +216,7 @@ public class IndexErrDataRecordServiceImpl extends BaseServiceImpl<Long, IndexEr
 		if (!CollectionUtils.isEmpty(strings)) {
 			List<IndexErrDataRecord> errRecords = indexErrDataRecordDao.getWithOrganMonthUserStr(strings);
 			List<Integer> organIds = errRecords.stream().map(IndexErrDataRecord::getOrganId).collect(Collectors.toList());
-			List<Organization> organs = organizationDao.findOrgans(organIds);
+			List<Organization> organs = organizationDao.getOrgans(organIds,queryInfo.getTenantId());
 			Map<Integer, String> idOrganNameMap = organs.stream().collect(Collectors.toMap(Organization::getId, o -> o.getName()));
 
 			List<Integer> userIds = errRecords.stream().map(IndexErrDataRecord::getDealUserId).collect(Collectors.toList());

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

@@ -3,20 +3,19 @@ package com.ym.mec.biz.service.impl;
 import com.ym.mec.biz.dal.dao.InspectionItemDao;
 import com.ym.mec.biz.dal.dao.StudentVisitDao;
 import com.ym.mec.biz.dal.dto.TeacherVisitDto;
+import com.ym.mec.biz.dal.entity.InspectionItem;
 import com.ym.mec.biz.dal.enums.InspectionItemEnum;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
+import com.ym.mec.biz.service.InspectionItemService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ym.mec.biz.dal.entity.InspectionItem;
-import com.ym.mec.biz.service.InspectionItemService;
 
 import java.util.Date;
 import java.util.List;
-import java.util.Optional;
 import java.util.stream.Collectors;
 
 @Service

+ 0 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -638,12 +638,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		Map<String, Object> params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
 
-		Set<Integer> organIds = null;
-		if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
-			organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(Integer::new).collect(Collectors.toSet());
-		}
-		params.put("organIds", organIds);
-
 		List<MusicArrearageStudentDto> dataList = null;
 		int count = musicGroupPaymentCalenderDetailDao.countArrearageStudents(params);
 		if (count > 0) {

+ 0 - 24
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPerformanceServiceImpl.java

@@ -38,33 +38,9 @@ public class MusicGroupPerformanceServiceImpl extends BaseServiceImpl<Integer, M
 
     @Override
     public Object queryNoStartPage(MusicGroupPerformanceQueryInfo queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			throw new BizException("用户信息获取失败");
-		}
-		Employee employee = employeeDao.get(sysUser.getId());
-		if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganId())) {
-			queryInfo.setOrganId(employee.getOrganIdList());
-		} else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
-			throw new BizException("用户所在分部异常");
-		} else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-				throw new BizException("非法请求");
-			}
-		}
-		//当前用户是否是分部经理
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-		Integer educationUserId = null;
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-			//获取教务老师关联的班级列表
-			educationUserId = sysUser.getId();
-		}
 		PageInfo<MusicGroupPerformance> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
-		params.put("educationUserId",educationUserId);
-
 		List<MusicGroupPerformance> dataList = null;
 		int count = musicGroupPerformanceDao.countNoStart(params);
 		if (count > 0) {

+ 12 - 110
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2018,7 +2018,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public boolean applyQuitMusicGroup(List<Integer> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit, Integer operatorId) {
+    public boolean applyQuitMusicGroup(List<SysUserRoleEnum> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit, Integer operatorId) {
 
         Integer userId = reqMusicGroupQuit.getUserId();
         String musicGroupId = reqMusicGroupQuit.getMusicGroupId();
@@ -2064,15 +2064,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupQuit.setStatus(PROCESSING);
         musicGroupQuit.setCurrentApproveRole(SysUserRole.EDUCATIONAL_TEACHER + "");
 
-        if (currentOperatorRoleIds != null) {
-            if (!currentOperatorRoleIds.contains(SysUserRole.SECTION_MANAGER) && currentOperatorRoleIds.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+        if (currentOperatorRoleIds != null && currentOperatorRoleIds.size() > 0) {
+            if (!currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
 
                 if (musicGroupQuit.getStatus() == ApprovalStatus.APPROVED) {
                     throw new BizException("只能分部经理操作退团");
                 }
-                musicGroupQuit.setCurrentApproveRole(SysUserRole.SECTION_MANAGER + "");
+                musicGroupQuit.setCurrentApproveRole(SysUserRoleEnum.SECTION_MANAGER.ordinal()+"");
             }
-            if (currentOperatorRoleIds.contains(SysUserRole.SECTION_MANAGER) && !currentOperatorRoleIds.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+            if (currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && !currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
 
                 throw new BizException("只能乐团主管操作退团申请");
             }
@@ -2160,8 +2160,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public boolean approveQuitMusicGroup(List<Integer> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit) {
-
+    public boolean approveQuitMusicGroup(List<SysUserRoleEnum> currentOperatorRoleIds, MusicGroupQuit reqMusicGroupQuit) {
         Long id = reqMusicGroupQuit.getId();
         ApprovalStatus status = reqMusicGroupQuit.getStatus();
         String reason = reqMusicGroupQuit.getReason();
@@ -2175,9 +2174,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         Date date = new Date();
 
-        if (!currentOperatorRoleIds.contains(SysUserRole.SECTION_MANAGER) && currentOperatorRoleIds.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+        //如果发起退团申请的是乐团主管
+        if (!currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
 
-            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRole.EDUCATIONAL_TEACHER + "")) {
+            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.EDUCATIONAL_TEACHER.ordinal() + "")) {
                 throw new BizException("只有分部经理才能审核");
             }
 
@@ -2186,8 +2186,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        if (currentOperatorRoleIds.contains(SysUserRole.SECTION_MANAGER) && !currentOperatorRoleIds.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRole.SECTION_MANAGER + "")) {
+        if (currentOperatorRoleIds.contains(SysUserRoleEnum.SECTION_MANAGER) && !currentOperatorRoleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER)) {
+            if (!StringUtils.equals(musicGroupQuit.getCurrentApproveRole(), SysUserRoleEnum.SECTION_MANAGER.ordinal() + "")) {
                 throw new BizException("先需乐团主管审核");
             }
         }
@@ -2375,62 +2375,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
 
             }
-            /*if (returnFeeDto.getIsReturnMemberFee()){
-                if(musicGroup.getCourseViewType() != CourseViewTypeEnum.MEMBER_FEE){
-                    throw new BizException("非会员乐团不允许退云教练");
-                }
-                //删除乐团会员时长
-                studentRegistrationDao.cleanMusicMember(userId,musicGroupId);
-                //退云教练费用
-                if (returnFeeDto.getMemberFee() != null) {
-                    Date nowDate = new Date();
-                    List<CloudTeacherOrder> cloudTeacherOrders = cloudTeacherOrderService.getStudentCloudTeacherOrder(userId,musicGroupId);
-                    BigDecimal orderAmount = BigDecimal.ZERO;
-                    Student student = studentDao.get(userId);
-                    if(cloudTeacherOrders.size() > 0){
-                        Integer subMemberDay = 0;
-                        List<CloudTeacherOrder> quitCloudTeacherOrders = new ArrayList<>();
-                        for (CloudTeacherOrder cloudTeacherOrder : cloudTeacherOrders) {
-                            if (cloudTeacherOrder.getEndTime() == null || DateUtil.stringToDate(DateUtil.format(cloudTeacherOrder.getEndTime(),DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT).compareTo(
-                                    DateUtil.stringToDate(DateUtil.format(nowDate,DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT)) >= 0) {
-                                quitCloudTeacherOrders.add(cloudTeacherOrder);
-                                orderAmount = orderAmount.add(cloudTeacherOrder.getAmount());
-                                subMemberDay =  subMemberDay + DateUtil.daysBetween(cloudTeacherOrder.getStartTime(), cloudTeacherOrder.getEndTime());
-                            }
-                        }
-                        cloudTeacherOrderService.quitCloudTeacherOrders(quitCloudTeacherOrders, returnFeeDto.getMemberFee());
-                        Date memberEndTime = DateUtil.addDays(studentRegistration.getMembershipEndTime(), subMemberDay);
-                        if(memberEndTime.compareTo(nowDate) < 0){
-                            //清除学员云教练
-                            studentService.cleanMember(userId);
-                            //如果有试用会员,不清除
-                            if(student.getExperienceMemberRankSettingId() != null){
-                                student.setMemberRankSettingId(student.getExperienceMemberRankSettingId());
-                                student.setMembershipStartTime(student.getExperienceMembershipStartTime());
-                                student.setMembershipEndTime(student.getExperienceMembershipEndTime());
-                                studentDao.update(student);
-                            }
-                        }else {
-                            if(student.getExperienceMemberRankSettingId() != null){
-                                if(memberEndTime.compareTo(student.getExperienceMembershipEndTime()) > 0){
-                                    student.setMembershipEndTime(memberEndTime);
-                                }else {
-                                    student.setMembershipEndTime(student.getExperienceMembershipEndTime());
-                                }
-                                studentDao.update(student);
-                            }
-                        }
-                    }
-                    if (returnFeeDto.getMemberFee().compareTo(orderAmount) > 0) {
-                        throw new BizException("云教练退费金额不能大于原始订单金额");
-                    }
-                    amount = amount.add(returnFeeDto.getMemberFee());
-                }
-            } else {
-                //删除乐团会员时长
-                studentRegistrationDao.cleanMusicMember(userId,musicGroupId);
-            }*/
-
             if (returnFeeDto.getIsReturnCourseFee()) {
                 // 退课程费用
                 amount = amount.add(surplusCourseFee);
@@ -2509,10 +2453,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                         }
                     }
 
-					/*if (updateStudentInstrumentList.size() == 0) {
-						throw new BizException("学生没有有效期内的乐保,不能退乐保费用");
-					}*/
-
                     amount = amount.add(returnFeeDto.getMaintenanceFee());
 
                     if (updateStudentInstrumentList.size() > 0) {
@@ -3962,15 +3902,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     public PageInfo<MusicMemberDto> queryMusicMemberList(MusicMemberQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        //当前用户是否是分部经理
-        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-        Integer educationUserId = null;
-        if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-            //获取教务老师关联的班级列表
-            educationUserId = sysUser.getId();
-        }
-        String configValue = sysConfigDao.findConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT);
+        String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,queryInfo.getTenantId());
         if (StringUtils.isEmpty(configValue)) {
             configValue = "15";
         }
@@ -3978,42 +3910,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         PageInfo<MusicMemberDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
-        params.put("educationUserId", educationUserId);
         List<MusicMemberDto> dataList = null;
         int count = musicGroupDao.countMusicMemberList(params);
         if (count > 0) {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = musicGroupDao.queryMusicMemberList(params);
-//            List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
-//            String musicGroupId = dataList.get(0).getMusicGroupId();
-            //查询云教练订单
-//            List<CloudTeacherOrder> studentCloudTeacherOrders = cloudTeacherOrderService.getStudentCloudTeacherOrders(collect,musicGroupId);
-//            Map<Integer, List<CloudTeacherOrder>> studentCloudTeacherMap = studentCloudTeacherOrders.stream().collect(Collectors.groupingBy(CloudTeacherOrder::getStudentId));
-//            Date date = new Date();
-//            Map<Long,String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(new HashSet<>(collect),true));
-            /*dataList.forEach(e->{
-                //如果会员已过期、是否有未生效的会员
-                if(e.getMembershipEndTime() == null || date.after(e.getMembershipEndTime())){
-                    String s = cloudMap.get(e.getUserId().longValue());
-                    if(StringUtils.isNotEmpty(s)){
-                        e.setHasNoStartCloudTeacher(true);
-                    }
-                }
-                if (studentCloudTeacherMap.containsKey(e.getUserId())) {
-                    List<CloudTeacherOrder> cloudTeacherOrders = studentCloudTeacherMap.get(e.getUserId());
-                    if(cloudTeacherOrders != null && cloudTeacherOrders.size() > 0){
-                        BigDecimal cloudAmount = BigDecimal.ZERO;
-                        for (CloudTeacherOrder cloudTeacherOrder : cloudTeacherOrders) {
-                            if (cloudTeacherOrder.getEndTime() == null || DateUtil.stringToDate(DateUtil.format(cloudTeacherOrder.getEndTime(),DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT).compareTo(
-                                    DateUtil.stringToDate(DateUtil.format(date,DateUtil.ISO_EXPANDED_DATE_FORMAT),DateUtil.ISO_EXPANDED_DATE_FORMAT)) >= 0) {
-                                cloudAmount = cloudAmount.add(cloudTeacherOrder.getAmount());
-                            }
-                        }
-                        e.setCloudTeacherAmount(cloudAmount);
-                    }
-                }
-            });*/
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 106 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+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;
@@ -11,6 +12,7 @@ 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.common.dal.BaseDAO;
 import com.ym.mec.common.entity.Mapper;
@@ -37,6 +39,8 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	@Autowired
 	private EmployeeDao employeeDao;
 	@Autowired
+	private ClassGroupDao classGroupDao;
+	@Autowired
 	private SysUserFeignService sysUserFeignService;
 
 	@Override
@@ -120,7 +124,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	}
 
 	@Override
-	public Map<String,List<Mapper>> getOrganRole(List<Integer> organIds) {
+	public Map<String,Map<Integer,String>> getOrganRole(List<Integer> organIds) {
 		List<Organization> organizationList = organizationDao.findOrgans(organIds);
 		if(organizationList == null || organizationList.size() == 0){
 			throw new BizException("分部信息不存在");
@@ -148,7 +152,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 				userId.add(organization.getJoinTeacherId());
 			}
 		}
-		Map<String,List<Mapper>> resultMap = new HashMap<>(4);
+		Map<String,Map<Integer,String>> resultMap = new HashMap<>(4);
 		if(userId.length() > 0){
 			Map<Integer, String> educationalTeacherNameMap = MapUtil.convertMybatisMap(teacherDao.queryNameByIds(userId.toString()));
 			resultMap.put("organManager",getOrganManagerName(educationalTeacherNameMap,organManager.toString()));
@@ -159,7 +163,66 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		return resultMap;
 	}
 
-    @Override
+	@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){
@@ -204,15 +267,51 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		return organIds;
 	}
 
-	private List<Mapper> getOrganManagerName(Map<Integer, String> nameMap, String organManager){
-		List<Mapper> mapperList = new ArrayList<>();
+	@Override
+	public List<Organization> findAllOrgans(Integer tenantId) {
+		return organizationDao.findAllOrgans(tenantId);
+	}
+
+	@Override
+	public List<Organization> findOrgans(List<Integer> organIds,Integer tenantId) {
+		return organizationDao.getOrgans(organIds,tenantId);
+	}
+
+    @Override
+    public <T extends EducationBaseQueryInfo> T onlyEducationInitClassId(T queryInfo) {
+		queryInfo = onlyEducation(queryInfo);
+		if(queryInfo.getEducationUserId() != null){
+			queryInfo.setClassGroupIds(classGroupDao.queryGroupClassGroupIds(queryInfo.getEducationUserId()));
+		}
+		return queryInfo;
+	}
+
+    @Override
+    public <T extends EducationBaseQueryInfo> T onlyEducation(T queryInfo) {
+		if(StringUtils.isEmpty(queryInfo.getOrganIds())){
+			throw new BizException("请选择分部");
+		}
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		SysUserRoleEnum organRole = this.getOrganRole(Integer.parseInt(queryInfo.getOrganIds()), sysUser.getId());
+		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
+		if (organRole == SysUserRoleEnum.EDUCATIONAL_TEACHER && !sysUser.getIsSuperAdmin()) {
+			queryInfo.setEducationUserId(sysUser.getId());
+		}
+		return queryInfo;
+    }
+
+    private Map<Integer,String> getOrganManagerName(Map<Integer, String> nameMap, String organManager){
+		Map<Integer,String> map = new HashMap<>();
 		if(StringUtils.isNotEmpty(organManager)){
 			List<Integer> organIds = Arrays.stream(organManager.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
 			for (Integer organId : organIds) {
-				mapperList.add(new Mapper(organId,nameMap.get(organId)));
+				map.put(organId,nameMap.get(organId));
 			}
 		}
-		return mapperList;
+		return map;
 	}
 
 	private String concatOrganManager(String... userIds){

+ 7 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -187,14 +187,13 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 
 	@Override
 	public PageInfo<TeacherServeDto> queryTeacherServeInfo(TeacherServeQueryInfo queryInfo) {
-		if(StringUtils.isNotBlank(queryInfo.getOrganId())){
-			List<Integer> organIds = Arrays.stream(queryInfo.getOrganId().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
-			queryInfo.setOrganIds(organIds);
-		}
 		PageInfo<TeacherServeDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
-
+		if(StringUtils.isNotBlank(queryInfo.getOrganId())){
+			List<Integer> organIds = Arrays.stream(queryInfo.getOrganId().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+			params.put("organIds",organIds);
+		}
 		List<TeacherServeDto> dataList = null;
 		int count = studentExtracurricularExercisesSituationDao.countTeacherServeInfo(params);
 		if (count > 0) {
@@ -550,13 +549,12 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 
 	@Override
 	public List<TeacherServeDto> queryTeacherPerformanceIndicator(TeacherServeQueryInfo queryInfo) {
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
 		if(StringUtils.isNotBlank(queryInfo.getOrganId())){
 			List<Integer> organIds = Arrays.stream(queryInfo.getOrganId().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
-			queryInfo.setOrganIds(organIds);
+			params.put("organIds",organIds);
 		}
-		Map<String, Object> params = new HashMap<>();
-		MapUtil.populateMap(params, queryInfo);
-
 		List<TeacherServeDto> dataList = null;
 		dataList = studentExtracurricularExercisesSituationDao.queryTeacherPerformanceIndicator(params);
 		List<Integer> teacherIds = dataList.stream().map(TeacherServeDto::getTeacherId).collect(Collectors.toList());

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

@@ -925,14 +925,6 @@ 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();
-        //当前用户是否是分部经理
-        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-        if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-            //获取教务老师关联的班级列表
-            List<Long> classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
-            params.put("classGroupIds", classGroupIds);
-        }
         params.put("studentErrorLeaveNum",studentErrorLeaveNum);
         int count = indexBaseMonthDataDao.countStudentErrorLeave1(params);
         List<StudentErrorLeaveDto> dataList = new ArrayList<>();

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

@@ -1656,18 +1656,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         PageInfo<NoClassMusicStudentDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
-
-        if (StringUtils.isNotBlank(queryInfo.getOrganIds())) {
-            List<Integer> organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
-            params.put("organIds", organIds);
-        }
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-        //如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
-        if (userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-            params.put("educationUserId", sysUser.getId());
-        }
-
         List<NoClassMusicStudentDto> dataList = new ArrayList<>();
         int count = studentRegistrationDao.countNoClassMusicStudents(params);
         if (count > 0) {
@@ -1675,7 +1663,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             params.put("offset", pageInfo.getOffset());
             dataList = studentRegistrationDao.queryNoClassMusicStudents(params);
         }
-
         pageInfo.setRows(dataList);
         return pageInfo;
     }

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -1505,8 +1505,8 @@
             <if test="type != null">
                 AND type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
-            <if test="organIdList != null and organIdList != ''">
-                AND FIND_IN_SET(mg.organ_id_,#{organIdList})
+            <if test="organIds != null and organIds != ''">
+                AND FIND_IN_SET(mg.organ_id_,#{organIds})
             </if>
             <if test="educationUserId != null">
                 AND mg.educational_teacher_id_ = #{educationUserId}

+ 6 - 6
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -1580,8 +1580,8 @@
 		LEFT JOIN course_schedule cs ON cs.id_ = sa.course_schedule_id_
 		LEFT JOIN sys_user su ON su.id_ = sa.user_id_
 		WHERE DATE_FORMAT(cs.class_date_,'%Y-%m') >= #{currentMonth} AND sa.status_ = 'LEAVE' AND cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
-		<if test="organId != null">
-			AND FIND_IN_SET(cs.organ_id_,#{organId})
+		<if test="organIds != null">
+			AND FIND_IN_SET(cs.organ_id_,#{organIds})
 		</if>
 		<if test="classGroupIds != null and classGroupIds.size() > 0">
 			AND cs.class_group_id_ IN
@@ -1613,8 +1613,8 @@
 		LEFT JOIN organization o ON o.id_ = cs.organ_id_
 		LEFT JOIN sys_user su ON su.id_ = sa.user_id_
 		WHERE DATE_FORMAT(cs.class_date_,'%Y-%m') >= #{currentMonth} AND sa.status_ = 'LEAVE' AND cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
-		<if test="organId != null">
-			AND FIND_IN_SET(cs.organ_id_,#{organId})
+		<if test="organIds != null">
+			AND FIND_IN_SET(cs.organ_id_,#{organIds})
 		</if>
 		<if test="classGroupIds != null and classGroupIds.size() > 0">
 			AND cs.class_group_id_ IN
@@ -1681,8 +1681,8 @@
 		LEFT JOIN course_schedule cs ON cs.id_ = sa.course_schedule_id_
 		LEFT JOIN sys_user su ON su.id_ = sa.user_id_
 		WHERE DATE_FORMAT(cs.class_date_,'%Y-%m') >= #{totalMonth} AND sa.status_ = 'LEAVE' AND cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
-		<if test="organId != null">
-			AND FIND_IN_SET(cs.organ_id_,#{organId})
+		<if test="organIds != null">
+			AND FIND_IN_SET(cs.organ_id_,#{organIds})
 		</if>
 		<if test="classGroupIds != null and classGroupIds.size() > 0">
 			AND cs.class_group_id_ IN

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/IndexErrDataRecordMapper.xml

@@ -440,11 +440,11 @@
 			<if test="hasDealTime!=null and !hasDealTime">
 				AND irdr.deal_time_ IS NULL
 			</if>
-			<if test="organId != null">
-				AND FIND_IN_SET(ii.organ_id_,#{organId})
+			<if test="organIds != null and organIds != ''">
+				AND FIND_IN_SET(ii.organ_id_,#{organIds})
 			</if>
-			<if test="userId != null">
-				AND ii.user_id_ = #{userId}
+			<if test="educationUserId != null">
+				AND ii.user_id_ = #{educationUserId}
 			</if>
 			<if test="operation != null">
 				AND ii.operation_ = #{operation}

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml

@@ -178,11 +178,11 @@
                     WHERE sv.teacher_id_ = ii.user_id_ AND DATE_FORMAT(i.month_,'%Y-%m') = DATE_FORMAT(sv.visit_time_,'%Y-%m'))
                 </if>
             </if>
-            <if test="organId != null">
-                AND FIND_IN_SET(ii.organ_id_,#{organId})
+            <if test="organIds != null and organIds != ''">
+                AND FIND_IN_SET(ii.organ_id_,#{organIds})
             </if>
-            <if test="userId != null">
-                AND ii.user_id_ = #{userId}
+            <if test="educationUserId != null">
+                AND ii.user_id_ = #{educationUserId}
             </if>
             <if test="operation != null">
                 AND ii.operation_ = #{operation}

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -934,8 +934,8 @@
                 AND (mg.name_ LIKE CONCAT('%',#{search},'%') OR mg.id_ LIKE CONCAT('%',#{search},'%')
                 OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_ = #{search})
             </if>
-            <if test="organId != null and organId != ''">
-                AND FIND_IN_SET(mg.organ_id_,#{organId})
+            <if test="organIds != null and organIds != ''">
+                AND FIND_IN_SET(mg.organ_id_,#{organIds})
             </if>
             <if test="educationUserId != null">
                 AND mg.educational_teacher_id_ = #{educationUserId}

+ 2 - 5
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -447,11 +447,8 @@
 			</if>
 			AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.batch_no_ IS NOT NULL AND mgpc.pay_user_type_ = 'STUDENT'
 			AND (mgpcd.expect_amount_ + mgpcd.expect_member_amount_) > 0
-			<if test="organIds!=null and organIds.size()>0">
-				AND mg.organ_id_ IN
-				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-					#{organId}
-				</foreach>
+			<if test="organIds != null and organIds.size() != ''">
+				AND mg.organ_id_ IN FIND_IN_SET(mg.organ_id_,#{organIds})
 			</if>
 			<if test="musicGroupId!=null and musicGroupId!=''">
 				AND mgpc.music_group_id_ = #{musicGroupId}

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/MusicGroupPerformanceMapper.xml

@@ -114,8 +114,8 @@
 		<if test="search != null and search != ''">
 			AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%'))
 		</if>
-		<if test="organId != null and organId != ''">
-			AND FIND_IN_SET(mg.organ_id_,#{organId})
+		<if test="organIds != null and organIds != ''">
+			AND FIND_IN_SET(mg.organ_id_,#{organIds})
 		</if>
 		<include refid="global.limit"/>
 	</select>
@@ -129,8 +129,8 @@
 		<if test="search != null and search != ''">
 			AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%'))
 		</if>
-		<if test="organId != null and organId != ''">
-			AND FIND_IN_SET(mg.organ_id_,#{organId})
+		<if test="organIds != null and organIds != ''">
+			AND FIND_IN_SET(mg.organ_id_,#{organIds})
 		</if>
 	</select>
 </mapper>

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

@@ -537,7 +537,7 @@
 	<sql id="queryTeacherServeInfoCondition">
 		<where>
 			sees.tenant_id_ = #{tenantId}
-			<if test="organIds!=null and organIds.size()>0">
+			<if test="organIds != null and organIds.size()>0">
 				AND tea.organ_id_ IN
 				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
 					#{organId}
@@ -546,9 +546,6 @@
 			<if test="monday!=null and monday!='' and sunday!=null and sunday!=''">
 				AND sees.monday_ BETWEEN #{monday} AND #{sunday}
 			</if>
-<!--			<if test="unDone!=null and unDone==1">-->
-<!--				AND tm.teacher_id_ IS NULL-->
-<!--			</if>-->
 			<if test="teacherId!=null">
 				AND sees.teacher_id_ = #{teacherId}
 			</if>

+ 2 - 5
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1234,11 +1234,8 @@
             sr.music_group_status_ = 'NORMAL' and sr.tenant_id_ = #{tenantId}
             AND mg.status_ = 'PROGRESS'
             AND cgsm.id_ IS NULL
-            <if test="organIds != null and organIds.size() > 0">
-                AND mg.organ_id_ IN
-                <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-                    #{organId}
-                </foreach>
+            <if test="organIds != null and organIds != ''">
+                AND FIND_IN_SET(mg.organ_id_,#{organIds})
             </if>
             <if test="educationUserId != null">
                 AND mg.educational_teacher_id_ = #{educationUserId}

+ 4 - 6
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -1,10 +1,12 @@
 package com.ym.mec.web.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -323,12 +325,8 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "获取所有班级列表")
     @GetMapping("/queryClassGroupPage")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryClassGroupPage')")
-    public HttpResponseResult queryClassGroupPage(ClassGroupQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+    public HttpResponseResult queryClassGroupPage(ClassGroupQueryInfo queryInfo){
+        queryInfo = organizationService.onlyEducation(queryInfo);
         return succeed(classGroupService.queryClassGroupPage(queryInfo));
     }
 

+ 7 - 69
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -53,8 +53,6 @@ public class ExportController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeService employeeService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private VipGroupDao vipGroupDao;
@@ -437,7 +435,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        queryInfo.setOrganIdList(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIdList(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         List<ClassGroupTeachersDto> rows = classGroupService.queryClassGroupPage(queryInfo).getRows();
         for (ClassGroupTeachersDto row : rows) {
             List<ClassGroupTeacherMapper> classGroupTeacherMapperList = row.getClassGroupTeacherMapperList();
@@ -2539,17 +2537,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganIds())) {
-            queryInfo.setOrganIds(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<MusicArrearageStudentDto> result = musicGroupPaymentCalenderDetailService.queryArrearageStudents(queryInfo);
@@ -2592,17 +2580,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<MusicGroupQuit> result = musicGroupQuitService.queryPage(queryInfo);
@@ -2645,17 +2623,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<TeacherServeDto> result = studentExtracurricularExercisesSituationService.queryTeacherServeInfo(queryInfo);
@@ -2716,17 +2684,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(organId)) {
-            organId = employee.getOrganIdList();
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(organId.split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
         List<IndexErrorDataExportDto> result = indexService.exportIndexErrData(organId, errorType);
         if (CollectionUtils.isEmpty(result)) {
             response.setStatus(200);
@@ -2772,17 +2730,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         PageInfo<TeacherCourseStatistics> result = teacherCourseStatisticsService.queryPageDetail(queryInfo);
@@ -2828,17 +2776,7 @@ public class ExportController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganIds())) {
-            queryInfo.setOrganIds(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganIds().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
         List<IndexErrorDataExportDto> result = indexErrDataRecordService.queryRecord(queryInfo).getRows();

+ 16 - 93
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -4,22 +4,17 @@ 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.dto.EduOrganStudentDataDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.IndexErrorType;
 import com.ym.mec.biz.dal.page.IndexDataQueryInfo;
 import com.ym.mec.biz.dal.page.OrganCloudStudyStudentDataQueryInfo;
-import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.IndexBaseMonthDataService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.tenant.TenantContextHolder;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
@@ -36,37 +31,24 @@ import java.util.stream.Collectors;
 @RequestMapping()
 @RestController
 public class IndexController extends BaseController {
-
 	@Autowired
 	private MusicGroupDao musicGroupDao;
-	
 	@Autowired
 	private TeacherDao teacherDao;
-	
 	@Autowired
 	private StudentRegistrationDao studentRegistrationDao;
-	
 	@Autowired
 	private VipGroupDao vipGroupDao;
-	
 	@Autowired
 	private DemoGroupDao demoGroupDao;
-
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
-
 	@Autowired
 	private OrganizationService organizationService;
-
-	@Autowired
-	private EmployeeService employeeService;
-	
 	@Autowired
 	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
-	
 	@Autowired
 	private StudentPaymentOrderDao studentPaymentOrderDao;
-
 	@Autowired
 	private IndexBaseMonthDataService indexService;
 
@@ -117,61 +99,27 @@ public class IndexController extends BaseController {
 	}
 
 	@GetMapping("/newIndex")
-	public HttpResponseResult newIndex(IndexDataQueryInfo indexDataQueryInfo){
+	public HttpResponseResult newIndex(IndexDataQueryInfo queryInfo){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeService.get(sysUser.getId());
-		if (StringUtils.isBlank(indexDataQueryInfo.getOrganId())) {
-			indexDataQueryInfo.setOrganId(employee.getOrganIdList());
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(indexDataQueryInfo.getOrganId().split(",")))){
-				return failed("非法请求");
-			}
-		}
-		return succeed(indexService.getIndexBaseData(indexDataQueryInfo));
+		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+		return succeed(indexService.getIndexBaseData(queryInfo));
 	}
 
 	@GetMapping("/hasIndexErrData")
-	public HttpResponseResult hasIndexErrData(String organId){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		Employee employee = employeeService.get(sysUser.getId());
-		if (StringUtils.isBlank(organId)) {
-			organId = employee.getOrganIdList();
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(organId.split(",")))){
-				return failed("非法请求");
-			}
+	public HttpResponseResult hasIndexErrData(Integer organId){
+		if (organId == null) {
+			return failed("请选择分部");
 		}
 		return succeed(indexService.hasIndexErrData(organId));
 	}
 
 	@GetMapping("/getIndexErrData")
-	public HttpResponseResult getIndexErrData(String organId, IndexErrorType errorType){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		Employee employee = employeeService.get(sysUser.getId());
-		if (StringUtils.isBlank(organId)) {
-			organId = employee.getOrganIdList();
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(organId.split(",")))){
-				return failed("非法请求");
-			}
+	public HttpResponseResult getIndexErrData(Integer organId, IndexErrorType errorType){
+		if (organId == null) {
+			return failed("请选择分部");
 		}
 		return succeed(indexService.getIndexErrData(organId, errorType));
 	}
@@ -182,41 +130,16 @@ public class IndexController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeService.get(sysUser.getId());
-		if (StringUtils.isBlank(organId)) {
-			organId = employee.getOrganIdList();
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(organId.split(",")))){
-				return failed("非法请求");
-			}
-		}
+		organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
 		return succeed(indexService.exportIndexErrData(organId, errorType));
 	}
 
 	@GetMapping("/getRemindMatterData")
-	public HttpResponseResult getRemindMatterData(String organId){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
+	public HttpResponseResult getRemindMatterData(Integer organId){
+		if (organId == null) {
+			return failed("请选择分部");
 		}
-		if (sysUser.getTenantId() == null) {
-			return failed("用户机构信息异常,请联系管理员");
-		}
-		Employee employee = employeeService.get(sysUser.getId());
-		if (StringUtils.isBlank(organId)) {
-			organId = employee.getOrganIdList();
-		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-			return failed("用户所在分部异常");
-		}else {
-			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-			if(!list.containsAll(Arrays.asList(organId.split(",")))){
-				return failed("非法请求");
-			}
-		}
-		return succeed(indexService.getRemindMatterData(organId,sysUser.getTenantId()));
+		return succeed(indexService.getRemindMatterData(organId));
 	}
 
 	@ApiOperation("查询分部云教练学员汇总数据")
@@ -226,8 +149,8 @@ public class IndexController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-		Employee employee = employeeService.get(sysUser.getId());
-		List<Integer> organIds = Arrays.stream(employee.getOrganIdList().split(",")).map(id -> Integer.valueOf(id)).filter(id -> !OrganizationService.EXCLUDE_ORGAN_IDS.contains(id)).collect(Collectors.toList());
+		String organId = organizationService.getEmployeeOrgan(sysUser.getId(),"",sysUser.getIsSuperAdmin());
+		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));
 	}
 }

+ 3 - 15
mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java

@@ -1,13 +1,9 @@
 package com.ym.mec.web.controller;
 
-import com.netflix.discovery.converters.Auto;
 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.EmployeeDao;
 import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
 import com.ym.mec.biz.dal.dto.IndexErrorDataExportDto;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.InspectionItem;
 import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
@@ -29,9 +25,9 @@ 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.ArrayList;
 import java.util.Date;
-import java.util.List;
+import java.util.Map;
 
 /**
  * @Author Joburgess
@@ -110,15 +106,7 @@ public class IndexErrDataRecordController extends BaseController {
     @GetMapping("/queryErrStudentVisit")
     @PreAuthorize("@pcs.hasPermissions('indexErrDataRecord/queryErrStudentVisit')")
     public HttpResponseResult<PageInfo<InspectionItem>> queryErrStudentVisit(InspectionQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-//        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-//        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
-//            queryInfo.setUserId(sysUser.getId());
-//        }
+        queryInfo = organizationService.onlyEducation(queryInfo);
         String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
         queryInfo.setSearchStartTime(startTime);
         return succeed(indexErrDataRecordService.queryErrStudentVisit(queryInfo));

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

@@ -69,7 +69,7 @@ public class InspectionController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
         return succeed(inspectionService.getPageList(queryInfo));
     }
 

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

@@ -6,11 +6,13 @@ import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
 import com.ym.mec.biz.service.InspectionItemService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.entity.Mapper;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
@@ -21,9 +23,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 @Api(tags = "巡查任务事项")
 @RequestMapping("inspectionItem")
@@ -53,15 +53,7 @@ public class InspectionItemController extends BaseController {
     @RequestMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('inspectionItem/queryPage')")
     public HttpResponseResult<PageInfo<InspectionItem>> queryPage(InspectionQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-//        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
-//        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
-//            queryInfo.setUserId(sysUser.getId());
-//        }
+        queryInfo = organizationService.onlyEducation(queryInfo);
         String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
         queryInfo.setSearchStartTime(startTime);
         return succeed(inspectionItemService.getPageList(queryInfo));

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

@@ -9,6 +9,8 @@ import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicMemberDto;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
+import com.ym.mec.biz.dal.page.EducationBaseQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 import com.ym.mec.biz.dal.page.MusicMemberQueryInfo;
 import com.ym.mec.biz.service.MusicGroupService;
@@ -331,11 +333,7 @@ public class MusicGroupController extends BaseController {
 	@GetMapping("/queryMusicMemberList")
 	@PreAuthorize("@pcs.hasPermissions('musicGroup/queryMusicMemberList')")
 	public HttpResponseResult<PageInfo<MusicMemberDto>> queryMusicMemberList(MusicMemberQueryInfo queryInfo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("用户信息获取失败");
-		}
-		queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+		queryInfo = organizationService.onlyEducation(queryInfo);
 		return succeed(musicGroupService.queryMusicMemberList(queryInfo));
 	}
 

+ 4 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPerformanceController.java

@@ -5,6 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.MusicGroupPerformance;
 import com.ym.mec.biz.dal.page.MusicGroupPerformanceQueryInfo;
 import com.ym.mec.biz.service.MusicGroupPerformanceService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
@@ -28,6 +29,8 @@ public class MusicGroupPerformanceController extends BaseController {
 	private MusicGroupPerformanceService musicGroupPerformanceService;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private OrganizationService organizationService;
 
 	@ApiOperation("新增")
 	@PostMapping(value = "add")
@@ -84,6 +87,7 @@ public class MusicGroupPerformanceController extends BaseController {
 	@PostMapping(value = "queryNoStartPage")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupPerformance/queryNoStartPage')")
 	public Object queryNoStartPage(MusicGroupPerformanceQueryInfo queryInfo) {
+		queryInfo = organizationService.onlyEducation(queryInfo);
 		return succeed(musicGroupPerformanceService.queryNoStartPage(queryInfo));
 	}
 }

+ 37 - 67
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java

@@ -1,18 +1,14 @@
 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.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.StringUtils;
@@ -41,10 +37,6 @@ import com.ym.mec.biz.dal.entity.MusicGroupReturnFeeDto;
 import com.ym.mec.biz.dal.entity.StudentInstrument;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.page.MusicGroupQuitQueryInfo;
-import com.ym.mec.biz.service.EmployeeService;
-import com.ym.mec.biz.service.MusicGroupQuitService;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -60,25 +52,20 @@ public class MusicGroupQuitController extends BaseController {
 
     @Autowired
     private MusicGroupService musicGroupService;
-
     @Autowired
     private MusicGroupQuitService musicGroupQuitService;
-    
     @Autowired
     private StudentRegistrationService studentRegistrationService;
-
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeService employeeService;
-    @Autowired
     private StudentInstrumentDao studentInstrumentDao;
     @Autowired
     private CloudTeacherOrderDao cloudTeacherOrderDao;
     @Autowired
     private TeacherDao teacherDao;
     @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询")
     @RequestMapping("/queryPage")
@@ -88,24 +75,7 @@ public class MusicGroupQuitController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-            return failed("用户所在分部异常");
-        } else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                return failed("非法请求");
-            }
-        }
-		/*if (sysUser.getIsSuperAdmin() == false) {
-			List<Integer> userRole = employeeService.queryUserRole(sysUser.getId());
-			// 如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
-			if (userRole.contains(SysUserRole.EDUCATIONAL_TEACHER) && !userRole.contains(SysUserRole.SECTION_MANAGER)) {
-				queryInfo.setEducationUserId(sysUser.getId());
-			}
-		}*/
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         PageInfo<MusicGroupQuit> musicGroupQuitPageInfo = musicGroupQuitService.queryPage(queryInfo);
         List<MusicGroupQuit> rows = musicGroupQuitPageInfo.getRows();
         if (rows != null && rows.size() > 0) {
@@ -213,49 +183,43 @@ public class MusicGroupQuitController extends BaseController {
     @ApiOperation(value = "申请退团")
     @PostMapping("/apply")
     @PreAuthorize("@pcs.hasPermissions('musicGroupQuit/apply')")
-    public HttpResponseResult applyQuitMusicGroup(@RequestBody MusicGroupQuit musicGroupQuit) throws Exception {
-    	
+    public HttpResponseResult applyQuitMusicGroup(@RequestBody MusicGroupQuit musicGroupQuit){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-
-		List<Integer> roleIds = new ArrayList<Integer>();
-		
+        List<SysUserRoleEnum> roleIds;
 		if(sysUser.getIsSuperAdmin() == true) {
-			roleIds.add(SysUserRole.SECTION_MANAGER);
-			roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
+            roleIds = new ArrayList<>();
+			roleIds.add(SysUserRoleEnum.SECTION_MANAGER);
+			roleIds.add(SysUserRoleEnum.EDUCATIONAL_TEACHER);
 		} else {
-			roleIds = employeeDao.queryUserRole(sysUser.getId());
+            MusicGroup musicGroup = musicGroupService.get(musicGroupQuit.getMusicGroupId());
+            roleIds = organizationService.queryOrganRole(musicGroup.getOrganId(), sysUser.getId());
 		}
-		
         return succeed(musicGroupService.applyQuitMusicGroup(roleIds, musicGroupQuit, sysUser.getId()));
     }
 
     @ApiOperation(value = "退团")
     @PostMapping("/quitMusicGroup")
     @PreAuthorize("@pcs.hasPermissions('musicGroupQuit/quitMusicGroup')")
-    public HttpResponseResult quitMusicGroup(@RequestBody MusicGroupQuit musicGroupQuit) throws Exception {
-    	
+    public HttpResponseResult quitMusicGroup(@RequestBody MusicGroupQuit musicGroupQuit){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-
-		List<Integer> roleIds = new ArrayList<Integer>();
-		
-		if(sysUser.getIsSuperAdmin() == true) {
-			roleIds.add(SysUserRole.SECTION_MANAGER);
-			roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
-		} else {
-			roleIds = employeeDao.queryUserRole(sysUser.getId());
-		}
-
-
-		if (!(roleIds.contains(SysUserRole.SECTION_MANAGER) || roleIds.contains(SysUserRole.EDUCATIONAL_TEACHER))) {
+        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());
+        }
+		if (!(roleIds.contains(SysUserRoleEnum.SECTION_MANAGER) || roleIds.contains(SysUserRoleEnum.EDUCATIONAL_TEACHER))) {
 			throw new BizException("未经授权,不能操作");
 		}
-    	
         return succeed(musicGroupService.approveQuitMusicGroup(roleIds, musicGroupQuit));
     }
 
@@ -267,14 +231,20 @@ public class MusicGroupQuitController extends BaseController {
 		if (sysUser == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-		List<Integer> roleIds = new ArrayList<Integer>();
-		if(sysUser.getIsSuperAdmin() == true) {
-			roleIds.add(SysUserRole.SECTION_MANAGER);
-			roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
-		} else {
-			roleIds = employeeDao.queryUserRole(sysUser.getId());
-		}
-		if (!(roleIds.contains(SysUserRole.SECTION_MANAGER) || roleIds.contains(SysUserRole.EDUCATIONAL_TEACHER))) {
+        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))) {
 			throw new BizException("未经授权,不能操作");
 		}
         for (MusicGroupQuit musicGroupQuit : musicGroupQuits) {

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

@@ -83,17 +83,7 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        Employee employee = employeeService.get(sysUser.getId());
-        if (StringUtils.isBlank(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            return failed("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                return failed("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         return succeed(studentExtracurricularExercisesSituationService.queryTeacherServeInfo(queryInfo));
     }
 

+ 2 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -7,6 +7,7 @@ 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;
@@ -55,12 +56,7 @@ public class StudentManageController extends BaseController {
     @GetMapping("/queryStudentErrorLeaveList")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentErrorLeaveList')")
     public Object queryStudentErrorLeaveList(StudentErrorLeaveQueryInfo queryInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
+        queryInfo = organizationService.onlyEducationInitClassId(queryInfo);
         return succeed(studentManageService.queryStudentErrorLeaveList(queryInfo));
     }
 

+ 2 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.service.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -347,12 +348,7 @@ public class StudentRegistrationController extends BaseController {
     @GetMapping("/queryNoClassMusicStudentInfo")
     @PreAuthorize("@pcs.hasPermissions('studentRegistration/queryNoClassMusicStudentInfo')")
     public HttpResponseResult queryNoClassMusicStudentInfo(NoClassMusicStudentQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setOrganIds(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganIds(),sysUser.getIsSuperAdmin()));
-
+        queryInfo = organizationService.onlyEducation(queryInfo);
         return succeed(studentRegistrationService.queryNoClassMusicStudentInfo(queryInfo));
     }
 

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

@@ -43,7 +43,6 @@ public class TeacherCourseStatisticsController extends BaseController {
             return failed("用户信息获取失败");
         }
         queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
-
         return succeed(teacherCourseStatisticsService.queryPageDetail(queryInfo));
     }
 }