瀏覽代碼

Merge branch 'online1' of http://git.dayaedu.com/yonge/mec into teacher_income

zouxuan 4 年之前
父節點
當前提交
559464b984
共有 21 個文件被更改,包括 1146 次插入87 次删除
  1. 36 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java
  2. 18 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExportTeacherSalaryDto.java
  3. 184 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexErrorDataExportDto.java
  4. 74 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupStudentsDto.java
  5. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java
  6. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java
  7. 8 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  8. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  9. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  10. 296 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  11. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  12. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  13. 6 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  14. 321 8
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  15. 9 0
      mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml
  16. 12 9
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  17. 10 19
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  18. 35 0
      mec-util/src/main/java/com/ym/mec/util/collection/MapUtil.java
  19. 64 6
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  20. 20 0
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  21. 15 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

+ 36 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -7,10 +7,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.poi.ss.formula.functions.Index;
 
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData> {
 
@@ -145,17 +142,29 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                 @Param("courseStatus") CourseStatusEnum courseStatus);
 
     int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
+
+    List<Map<Integer, Integer>> countLessThenThreeClassOrganGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
+
     List<String> getLessThenThreeMusicGroup(@Param("organIds") Set<Integer> organIds);
 
     int queryErrInspection(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime);
 
+    List<Map<Integer, Integer>> queryOrganErrInspection(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime);
+
     IndexErrInfoDto getNoClassMusicGroupStudentInfo(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
 
+    List<Map<Integer, Integer>> getOrganNoClassMusicGroupStudentNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
+
     int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
+
+    List<Map<Integer, Integer>> countOrganNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
+
     List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
 
     List<Long> queryApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
 
+    List<Map<Integer, Integer>> queryOrganApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
+
     int queryStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
                                           @Param("type") String type, @Param("startTime") String startTime);
 
@@ -166,6 +175,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int getCourseTimeError(@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);
 
     /**
      * 获取考勤异常编号
@@ -173,6 +183,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int getAttendanceError(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds);
+    List<Map<Integer, Integer>> getOrganAttendanceError(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds);
 
     /**
      * 获取旷课考勤
@@ -180,6 +191,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int getNoAttendance(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds);
+    List<Map<Integer, Integer>> getOrganNoAttendance(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds);
 
     /**
      * 获取老师离职申请数
@@ -197,11 +209,20 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     int queryLowTeacherSalary(@Param("organIdsStr") String organIdsStr, @Param("monthStr") String monthStr);
 
     /**
+     * 获取预计课酬偏低的老师编号
+     * @param organIdsStr
+     * @param monthStr
+     * @return
+     */
+    List<Map<Integer, Integer>> queryOrganLowTeacherSalary(@Param("organIdsStr") String organIdsStr, @Param("monthStr") String monthStr);
+
+    /**
      * 乐团巡查任务未计划
      * @param organIdsStr
      * @return
      */
     int queryInspectionItem(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId);
+    List<Map<Integer, Integer>> queryOrganInspectionItem(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId);
 
     /**
      * 乐团巡查任务未提交
@@ -209,6 +230,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int queryInspectionItemPlan(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime);
+    List<Map<Integer, Integer>> queryOrganInspectionItemPlan(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime);
 
     /**
      * 未完成的回访任务
@@ -216,6 +238,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     int queryStudentVisit(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId);
+    List<Map<Integer, Integer>> queryOrganStudentVisit(@Param("organIdsStr") String organIdsStr, @Param("startTime") String startTime, @Param("userId") Integer userId);
 
     List<IndexBaseMonthData> getFinancePayData(@Param("dayStr") String dayStr);
 
@@ -223,8 +246,6 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
     List<IndexBaseMonthData> getFinanceActualData(@Param("dayStr") String dayStr);
 
-    List<IndexBaseMonthData> getTotalAmountData(@Param("dayStr") String dayStr);
-
     List<IndexBaseMonthData> getFinancePayDataWithTimely(@Param("startDate") String startDate,
                                                          @Param("endDate") String endDate,
                                                          @Param("organIds") List<Integer> organIds);
@@ -237,6 +258,15 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                             @Param("endDate") String endDate,
                                                             @Param("organIds") List<Integer> organIds);
 
+    /**
+     * @describe 各分部教师服务指标异常
+     * @author Joburgess
+     * @date 2021/4/15 0015
+     * @param params:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Integer>>
+     */
+    List<Map<Integer, Integer>> countOrganTeacherServeInfo(Map<String, Object> params);
+
     List<IndexBaseMonthData> getTotalAmountDataWithTimely(@Param("startDate") String startDate,
                                                             @Param("endDate") String endDate,
                                                             @Param("organIds") List<Integer> organIds);

+ 18 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExportTeacherSalaryDto.java

@@ -1,9 +1,13 @@
 package com.ym.mec.biz.dal.dto;
 
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
 public class ExportTeacherSalaryDto{
 
     //课时编号
-    private Integer courseScheduleId;
+    private Long courseScheduleId;
 
     //老师编号
     private  Integer teacherId;
@@ -109,6 +113,17 @@ public class ExportTeacherSalaryDto{
     //实际上课学员
     private int realStudentNum;
 
+    @ApiModelProperty(value = "课程收入")
+    private BigDecimal courseIncome;
+
+    public BigDecimal getCourseIncome() {
+        return courseIncome;
+    }
+
+    public void setCourseIncome(BigDecimal courseIncome) {
+        this.courseIncome = courseIncome;
+    }
+
     public String getDeductionReason() {
         return deductionReason;
     }
@@ -221,11 +236,11 @@ public class ExportTeacherSalaryDto{
         this.courseScheduleEndTime = courseScheduleEndTime;
     }
 
-    public Integer getCourseScheduleId() {
+    public Long getCourseScheduleId() {
         return courseScheduleId;
     }
 
-    public void setCourseScheduleId(Integer courseScheduleId) {
+    public void setCourseScheduleId(Long courseScheduleId) {
         this.courseScheduleId = courseScheduleId;
     }
 

+ 184 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexErrorDataExportDto.java

@@ -0,0 +1,184 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/4/15 0015
+ */
+public class IndexErrorDataExportDto {
+
+    private Integer organId;
+
+    private String organName;
+
+    @ApiModelProperty(value = "基础技能班学员数量异常")
+    private int highClassStudentLessThanThreeNum;
+
+    @ApiModelProperty(value = "乐团巡查事项异常")
+    private int musicPatrolItem;
+
+    @ApiModelProperty(value = "未加入任何班级学员")
+    private int noClassMusicGroupStudentInfo;
+
+    @ApiModelProperty(value = "未缴费学员数")
+    private int studentNotPayment;
+
+    @ApiModelProperty(value = "申请退团学员数")
+    private int studentApplyForQuitMusicGroup;
+
+    @ApiModelProperty(value = "预计课酬较低")
+    private int teacherExpectSalaryBeLow;
+
+    @ApiModelProperty(value = "课程时间安排异常")
+    private int courseTimeError;
+
+    @ApiModelProperty(value = "乐团巡查任务未计划")
+    private int inspectionItem;
+
+    @ApiModelProperty(value = "乐团巡查任务未提交")
+    private int inspectionItemPlan;
+
+    @ApiModelProperty(value = "回访任务未完成")
+    private int studentVisit;
+
+    @ApiModelProperty(value = "课程考勤异常")
+    private int teacherExceptionAttendance;
+
+    @ApiModelProperty(value = "课程异常")
+    private int teacherNotAClass;
+
+    @ApiModelProperty(value = "服务指标异常")
+    private int teacherServeError;
+
+    @ApiModelProperty(value = "总计")
+    private int total;
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public int getHighClassStudentLessThanThreeNum() {
+        return highClassStudentLessThanThreeNum;
+    }
+
+    public void setHighClassStudentLessThanThreeNum(int highClassStudentLessThanThreeNum) {
+        this.highClassStudentLessThanThreeNum = highClassStudentLessThanThreeNum;
+    }
+
+    public int getMusicPatrolItem() {
+        return musicPatrolItem;
+    }
+
+    public void setMusicPatrolItem(int musicPatrolItem) {
+        this.musicPatrolItem = musicPatrolItem;
+    }
+
+    public int getNoClassMusicGroupStudentInfo() {
+        return noClassMusicGroupStudentInfo;
+    }
+
+    public void setNoClassMusicGroupStudentInfo(int noClassMusicGroupStudentInfo) {
+        this.noClassMusicGroupStudentInfo = noClassMusicGroupStudentInfo;
+    }
+
+    public int getStudentNotPayment() {
+        return studentNotPayment;
+    }
+
+    public void setStudentNotPayment(int studentNotPayment) {
+        this.studentNotPayment = studentNotPayment;
+    }
+
+    public int getStudentApplyForQuitMusicGroup() {
+        return studentApplyForQuitMusicGroup;
+    }
+
+    public void setStudentApplyForQuitMusicGroup(int studentApplyForQuitMusicGroup) {
+        this.studentApplyForQuitMusicGroup = studentApplyForQuitMusicGroup;
+    }
+
+    public int getTeacherExpectSalaryBeLow() {
+        return teacherExpectSalaryBeLow;
+    }
+
+    public void setTeacherExpectSalaryBeLow(int teacherExpectSalaryBeLow) {
+        this.teacherExpectSalaryBeLow = teacherExpectSalaryBeLow;
+    }
+
+    public int getCourseTimeError() {
+        return courseTimeError;
+    }
+
+    public void setCourseTimeError(int courseTimeError) {
+        this.courseTimeError = courseTimeError;
+    }
+
+    public int getInspectionItem() {
+        return inspectionItem;
+    }
+
+    public void setInspectionItem(int inspectionItem) {
+        this.inspectionItem = inspectionItem;
+    }
+
+    public int getInspectionItemPlan() {
+        return inspectionItemPlan;
+    }
+
+    public void setInspectionItemPlan(int inspectionItemPlan) {
+        this.inspectionItemPlan = inspectionItemPlan;
+    }
+
+    public int getStudentVisit() {
+        return studentVisit;
+    }
+
+    public void setStudentVisit(int studentVisit) {
+        this.studentVisit = studentVisit;
+    }
+
+    public int getTeacherExceptionAttendance() {
+        return teacherExceptionAttendance;
+    }
+
+    public void setTeacherExceptionAttendance(int teacherExceptionAttendance) {
+        this.teacherExceptionAttendance = teacherExceptionAttendance;
+    }
+
+    public int getTeacherNotAClass() {
+        return teacherNotAClass;
+    }
+
+    public void setTeacherNotAClass(int teacherNotAClass) {
+        this.teacherNotAClass = teacherNotAClass;
+    }
+
+    public int getTeacherServeError() {
+        return teacherServeError;
+    }
+
+    public void setTeacherServeError(int teacherServeError) {
+        this.teacherServeError = teacherServeError;
+    }
+
+    public int getTotal() {
+        return total;
+    }
+
+    public void setTotal(int total) {
+        this.total = total;
+    }
+}

+ 74 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupStudentsDto.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.entity.SubjectChange;
 import com.ym.mec.biz.dal.enums.PaymentFlagEnum;
+import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
@@ -8,6 +10,9 @@ import java.util.Date;
 
 public class MusicGroupStudentsDto{
 
+    @ApiModelProperty(value = "学生乐团注册编号",required = false)
+    private Integer studentRegistrationId;
+
     @ApiModelProperty(value = "学生编号",required = false)
     private Integer userId;
 
@@ -29,9 +34,18 @@ public class MusicGroupStudentsDto{
     @ApiModelProperty(value = "班级",required = false)
     private String currentClass;
 
-    @ApiModelProperty(value = "专业",required = false)
+    @ApiModelProperty(value = "实际专业id",required = false)
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "实际专业",required = false)
     private String subjectName;
 
+    @ApiModelProperty(value = "报名专业id",required = false)
+    private Integer regSubjectId;
+
+    @ApiModelProperty(value = "报名专业",required = false)
+    private String regSubjectName;
+
     @ApiModelProperty(value = "下次缴费日期",required = false)
     private Date nextPaymentDate;
 
@@ -47,7 +61,7 @@ public class MusicGroupStudentsDto{
     @ApiModelProperty(value = "退团原因",required = false)
     private String quitReason;
 
-    private PaymentFlagEnum paymentStatus;
+    private PaymentStatusEnum paymentStatus;
 
     @ApiModelProperty(value = "是否新增学员(1是0否)",required = false)
     private Integer isNewStudent;
@@ -73,7 +87,7 @@ public class MusicGroupStudentsDto{
     private BigDecimal subTotalCourseTime;
 
     @ApiModelProperty(value = "欠费金额",required = false)
-    private BigDecimal noPaymentAmount;
+    private BigDecimal noPaymentAmount = BigDecimal.ZERO;
 
     @ApiModelProperty(value = "关心包:0:默认不可用;1:可用;2:已使用;")
     private Integer carePackage;
@@ -83,6 +97,21 @@ public class MusicGroupStudentsDto{
     private Integer comeOnPackage;
     private String comeOnPackageStr;
 
+    public Integer getStudentRegistrationId() {
+        return studentRegistrationId;
+    }
+
+    public void setStudentRegistrationId(Integer studentRegistrationId) {
+        this.studentRegistrationId = studentRegistrationId;
+    }
+
+    @ApiModelProperty(value = "备注信息",required = false)
+    private String remark;
+
+
+    @ApiModelProperty(value = "声部更换详情",required = false)
+    private SubjectChange subjectChange;
+
     public String getCarePackageStr() {
         return carePackageStr;
     }
@@ -251,11 +280,11 @@ public class MusicGroupStudentsDto{
         this.studentStatus = studentStatus;
     }
 
-    public PaymentFlagEnum getPaymentStatus() {
+    public PaymentStatusEnum getPaymentStatus() {
         return paymentStatus;
     }
 
-    public void setPaymentStatus(PaymentFlagEnum paymentStatus) {
+    public void setPaymentStatus(PaymentStatusEnum paymentStatus) {
         this.paymentStatus = paymentStatus;
     }
 
@@ -314,4 +343,44 @@ public class MusicGroupStudentsDto{
     public void setRegisterTime(Date registerTime) {
         this.registerTime = registerTime;
     }
+
+    public String getRegSubjectName() {
+        return regSubjectName;
+    }
+
+    public void setRegSubjectName(String regSubjectName) {
+        this.regSubjectName = regSubjectName;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getRegSubjectId() {
+        return regSubjectId;
+    }
+
+    public void setRegSubjectId(Integer regSubjectId) {
+        this.regSubjectId = regSubjectId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public SubjectChange getSubjectChange() {
+        return subjectChange;
+    }
+
+    public void setSubjectChange(SubjectChange subjectChange) {
+        this.subjectChange = subjectChange;
+    }
 }

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

@@ -99,6 +99,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     TEACHER_PUSH_LEAVE_RESULT("TEACHER_PUSH_LEAVE_RESULT", "请假结果"),
     TEACHER_PUSH_COURSE_SCHEDULE_CHANGE_RESULT("TEACHER_PUSH_COURSE_SCHEDULE_CHANGE_RESULT", "课时调整结果"),
     TEACHER_PUSH_STUDENT_LEAVE("TEACHER_PUSH_STUDENT_LEAVE", "学员请假"),
+    TEACHER_IM_STUDENT_LEAVE("TEACHER_IM_STUDENT_LEAVE", "学员请假"),
     TEACHER_PUSH_CLASS_MESSAGE("TEACHER_PUSH_CLASS_MESSAGE", "班级消息"),
     COURSE_SALARY_COMPLAINTS_RESULT("COURSE_SALARY_COMPLAINTS_RESULT", "课酬申述结果"),
     PUSH_TEACHER_EXCEPTION_ATTENDANCE("PUSH_TEACHER_EXCEPTION_ATTENDANCE", "异常考勤通知"),

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

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ym.mec.biz.dal.dto.IndexBaseDto;
+import com.ym.mec.biz.dal.dto.IndexErrorDataExportDto;
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
 import com.ym.mec.biz.dal.entity.IndexErrInfoDto;
 import com.ym.mec.biz.dal.enums.IndexErrorType;
@@ -18,6 +19,8 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
 
     Map<String, Object> getIndexErrData(String organIds, IndexErrorType errorType);
 
+    List<IndexErrorDataExportDto> exportIndexErrData(String organIds, IndexErrorType errorType);
+
     /**
      * 事项提醒
      * @param organIds

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

@@ -601,12 +601,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         PageInfo<TeacherMusicClassInfoDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
-        List<TeacherMusicClassInfoDto> dataList = null;
         int count = classGroupDao.countGroupCourses(params);
-        if (count > 0) {
-            pageInfo.setTotal(count);
-            params.put("offset", pageInfo.getOffset());
-            dataList = classGroupDao.queryGroupCourses(params);
+        pageInfo.setTotal(count);
+        params.put("offset", pageInfo.getOffset());
+        List<TeacherMusicClassInfoDto> dataList = classGroupDao.queryGroupCourses(params);
+        if (!CollectionUtils.isEmpty(dataList)) {
             HashMap<String, Object> param = new HashMap<>();
             param.put("teacherId", queryInfo.getSearch());
             param.put("attendanceStatus", YesOrNoEnum.YES);
@@ -633,10 +632,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         MapUtil.populateMap(params, queryInfo);
         List<TeacherVipClassInfoDto> dataList = null;
         int count = vipGroupDao.countTeacherVipClass(queryInfo.getTeacherId());
-        if (count > 0) {
-            pageInfo.setTotal(count);
-            params.put("offset", pageInfo.getOffset());
-            dataList = vipGroupDao.getTeacherVipClass(params);
+        pageInfo.setTotal(count);
+        params.put("offset", pageInfo.getOffset());
+        dataList = vipGroupDao.getTeacherVipClass(params);
+        if (!CollectionUtils.isEmpty(dataList)) {
 //            Set<Integer> activityIds = dataList.stream().map(e -> e.getActivityId()).collect(Collectors.toSet());
 //            List<Map<Integer, String>> names = vipGroupActivityDao.queryNamesById(StringUtils.join(activityIds, ","));
 //            Map<Integer, String> nameMap = MapUtil.convertMybatisMap(names);

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

@@ -4719,10 +4719,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         if(queryInfo.getIsExport() && count > 50000){
             throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
         }
-        if (count > 0) {
-            pageInfo.setTotal(count);
-			params.put("offset", pageInfo.getOffset());
-            results = courseScheduleDao.endFindCourseSchedules(params);
+		pageInfo.setTotal(count);
+		params.put("offset", pageInfo.getOffset());
+		results = courseScheduleDao.endFindCourseSchedules(params);
+        if (!CollectionUtils.isEmpty(results)) {
             List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
             List<Integer> teacherIds=results.stream().filter(t->Objects.nonNull(t.getActualTeacherId())).map(CourseSchedule::getActualTeacherId).collect(Collectors.toList());
 

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -977,6 +977,24 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         //vip课(梯度课酬)
         //陪练课
         exportTeacherSalaryDtos.addAll(courseScheduleTeacherSalaryDao.exportPracticeTeacherSalary(params));
+
+        Set<Long> allCourseIds = exportTeacherSalaryDtos.stream().map(ExportTeacherSalaryDto::getCourseScheduleId).collect(Collectors.toSet());
+        Map<Long, BigDecimal> courseIncomeMap = new HashMap<>();
+        if(!CollectionUtils.isEmpty(allCourseIds)){
+            List<CourseScheduleStudentPayment> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findByCourseScheduleIds(new ArrayList<>(allCourseIds));
+            if(!CollectionUtils.isEmpty(courseScheduleStudentPayments)){
+                courseIncomeMap = courseScheduleStudentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPayment::getCourseScheduleId, Collectors.mapping(CourseScheduleStudentPayment::getExpectPrice, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
+            }
+        }
+
+        for (ExportTeacherSalaryDto exportTeacherSalaryDto : exportTeacherSalaryDtos) {
+            if(!courseIncomeMap.containsKey(exportTeacherSalaryDto.getCourseScheduleId())){
+                exportTeacherSalaryDto.setCourseIncome(BigDecimal.ZERO);
+            }else{
+                exportTeacherSalaryDto.setCourseIncome(courseIncomeMap.get(exportTeacherSalaryDto.getCourseScheduleId()));
+            }
+        }
+
         exportTeacherSalaryDtos.sort(Comparator.comparing(ExportTeacherSalaryDto::getTeacherId));
         return exportTeacherSalaryDtos;
     }

+ 296 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -5,6 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.IndexBaseDto;
+import com.ym.mec.biz.dal.dto.IndexErrorDataExportDto;
 import com.ym.mec.biz.dal.entity.IndexErrInfoDto;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.enums.*;
@@ -14,6 +15,7 @@ import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,11 +34,12 @@ import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.ym.mec.biz.dal.enums.IndexDataType.FINANCE_AMOUNT;
 import static com.ym.mec.biz.dal.enums.IndexErrorType.WAIT_CREATE_PAYMENT_CALENDER;
 
 @Service
 public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBaseMonthData> implements IndexBaseMonthDataService {
-	
+
 	@Autowired
 	private IndexBaseMonthDataDao indexBaseMonthDataDao;
 	@Autowired
@@ -105,10 +108,43 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 
 		Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().filter(d->Objects.nonNull(d.getDataType())).collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
-		typeDateMap.put(IndexDataType.FINANCE_PAY,indexBaseMonthDataDao.getFinancePayDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds)));
+		List<IndexBaseMonthData> financePayDataWithTimely = indexBaseMonthDataDao.getFinancePayDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds));
+		typeDateMap.put(IndexDataType.FINANCE_PAY,financePayDataWithTimely);
 		typeDateMap.put(IndexDataType.FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getFinanceBalanceDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds)));
-		typeDateMap.put(IndexDataType.FINANCE_AMOUNT,indexBaseMonthDataDao.getFinanceActualDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds)));
-		typeDateMap.put(IndexDataType.TOTAL_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds)));
+		typeDateMap.put(FINANCE_AMOUNT,indexBaseMonthDataDao.getFinanceActualDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds)));
+		List<IndexBaseMonthData> totalAmountDataWithTimely = indexBaseMonthDataDao.getTotalAmountDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds));
+
+		/*if(financePayDataWithTimely.size() > 0){
+			for (IndexBaseMonthData indexBaseMonthData : financePayDataWithTimely) {
+				BigDecimal percent = indexBaseMonthData.getPercent();
+				if(percent != null && percent.doubleValue() != 0d){
+					List<IndexBaseMonthData> collect = totalAmountDataWithTimely.stream().filter(e -> DateUtil.format(e.getMonth(), DateUtil.ISO_EXPANDED_DATE_FORMAT).
+							equals(DateUtil.format(indexBaseMonthData.getMonth(), DateUtil.ISO_EXPANDED_DATE_FORMAT))).collect(Collectors.toList());
+					IndexBaseMonthData totalAmountDate = null;
+					if(collect != null && collect.size() > 0){
+						totalAmountDate = collect.get(0);
+					}
+					if(totalAmountDate == null){
+						totalAmountDate = new IndexBaseMonthData();
+						totalAmountDate.setTotalNum(percent.negate());
+						totalAmountDate.setDataType(FINANCE_AMOUNT);
+						totalAmountDate.setActivateNum(percent.negate());
+						totalAmountDate.setOrganId(indexBaseMonthData.getOrganId());
+						totalAmountDate.setMonth(indexBaseMonthData.getMonth());
+						totalAmountDate.setPercent(percent.negate());
+						totalAmountDataWithTimely.add(totalAmountDate);
+					}else {
+						BigDecimal totalAmount = totalAmountDate.getPercent();
+						totalAmountDate.setActivateNum(totalAmount.subtract(percent));
+						totalAmountDate.setTotalNum(totalAmount.subtract(percent));
+						totalAmountDate.setPercent(totalAmount.subtract(percent));
+					}
+				}
+			}
+			totalAmountDataWithTimely = totalAmountDataWithTimely.stream().sorted(Comparator.comparing(IndexBaseMonthData::getMonth)).collect(Collectors.toList());
+		}*/
+
+		typeDateMap.put(IndexDataType.TOTAL_AMOUNT,totalAmountDataWithTimely);
 
 
 		for (IndexDataType dataType : IndexDataType.values()) {
@@ -130,7 +166,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			typeDateMap.put(dataType, new ArrayList<>(Arrays.asList(indexBaseMonthData)));
 		}
 
-		BigDecimal totalAmount = BigDecimal.ZERO;
+
 		for (Map.Entry<IndexDataType, List<IndexBaseMonthData>> typeDateMapEntry : typeDateMap.entrySet()) {
 			Set<String> hasMonths = typeDateMapEntry.getValue().stream().map(d -> DateUtil.dateToString(d.getMonth(), "yyyy-MM-dd")).collect(Collectors.toSet());
 			LocalDate currentMonthDate = startDate;
@@ -167,7 +203,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 			indexBaseData.setIndexMonthData(typeDateMapEntry.getValue(), currentMonth);
-			if(IndexDataType.FINANCE_PAY.equals(typeDateMapEntry.getKey()) || IndexDataType.FINANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
+			if(IndexDataType.FINANCE_PAY.equals(typeDateMapEntry.getKey()) || FINANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 				IndexDataType.FINANCE_BALANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 					IndexDataType.TOTAL_AMOUNT.equals(typeDateMapEntry.getKey())){
 				indexBaseData.setPercent(typeDateMapEntry.getValue().stream().map(IndexBaseMonthData::getPercent).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -223,10 +259,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		saveData(indexBaseMonthDataDao.getGroupSurplusCourseData(dayStr, GroupType.PRACTICE, CourseStatusEnum.OVER), dayStr, IndexDataType.OVER_PRACTICE_COURSE_NUM);
 
 		//经营数据
-		saveData(indexBaseMonthDataDao.getFinancePayData(dayStr),dayStr,IndexDataType.FINANCE_PAY);
-		saveData(indexBaseMonthDataDao.getFinanceBalanceData(dayStr),dayStr,IndexDataType.FINANCE_BALANCE_AMOUNT);
-		saveData(indexBaseMonthDataDao.getFinanceActualData(dayStr),dayStr,IndexDataType.FINANCE_AMOUNT);
-		saveData(indexBaseMonthDataDao.getTotalAmountData(dayStr),dayStr,IndexDataType.TOTAL_AMOUNT);
+
+//		List<IndexBaseMonthData> financePayData = indexBaseMonthDataDao.getFinancePayData(dayStr);
+//		List<IndexBaseMonthData> financeBalanceData = indexBaseMonthDataDao.getFinanceBalanceData(dayStr);
+//		List<IndexBaseMonthData> financeActualData = indexBaseMonthDataDao.getFinanceActualData(dayStr);
+//
+//		saveData(financePayData,dayStr,IndexDataType.FINANCE_PAY);
+//		saveData(financeBalanceData,dayStr,IndexDataType.FINANCE_BALANCE_AMOUNT);
+//		saveData(financeActualData,dayStr,IndexDataType.FINANCE_AMOUNT);
+//		saveData(totalAmountData,dayStr,IndexDataType.TOTAL_AMOUNT);
 
 		//业务数据
 		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, null), monday.toString(), IndexDataType.HOMEWORK_CREATE_RATE);
@@ -315,10 +356,14 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			one.setDesc(IndexErrorType.MUSIC_PATROL.getMsg());
 			List<IndexErrInfoDto> oneChild = new ArrayList<>();
 
+			//基础技能班学员数量异常
 			oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId), null));
+
+			//乐团巡查事项异常
 			int errInspection = indexBaseMonthDataDao.queryErrInspection(organIds,startTime);
 			oneChild.add(new IndexErrInfoDto(IndexErrorType.MUSIC_PATROL_ITEM, IndexErrorType.MUSIC_PATROL_ITEM.getMsg(),errInspection, null));
 
+			//未加入任何班级学员
 			IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId);
 			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_CLASS_MUSIC_GROUP_STUDENT_INFO.getMsg());
 			oneChild.add(noClassMusicGroupStudentInfo);
@@ -335,7 +380,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			two.setDesc(IndexErrorType.STUDENT_INFO.getMsg());
 			List<IndexErrInfoDto> twoChild = new ArrayList<>();
 
+			//未缴费学员数
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId), Arrays.asList(educationUserId)));
+
+			//申请退团学员数
 			List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds,educationUserId);
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 //			int attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
@@ -357,10 +405,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 //			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_LEAVE, IndexErrorType.TEACHER_LEAVE.getMsg(),teacherLeave, null));
 
 			String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
+
 			//全职未离职老师
+			//预计课酬较低
 			int lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
 
+			//课程时间安排异常
 			Integer userId = null;
 			if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
 				userId = sysUser.getId();
@@ -371,12 +422,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TIME_ERROR, IndexErrorType.COURSE_TIME_ERROR.getMsg(), courseTimeError, null));
 
+			//乐团巡查任务未计划
 			int inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr,startTime,userId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem, null));
 
+			//乐团巡查任务未提交
 			int inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr,startTime);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM_PLAN, IndexErrorType.INSPECTION_ITEM_PLAN.getMsg(),inspectionItemPlan, null));
 
+			//回访任务未完成
 			int studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr,startTime,userId);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_VISIT, IndexErrorType.STUDENT_VISIT.getMsg(),studentVisit, null));
 
@@ -391,6 +445,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			four.setDesc(IndexErrorType.ATTENDANCE_SERVE.getMsg());
 			List<IndexErrInfoDto> fourChild = new ArrayList<>();
 
+			//课程考勤异常
 			int attendanceError = 0;
 			int noAttendance = 0;
 			if(classGroupIds == null || classGroupIds.size() > 0){
@@ -399,8 +454,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
 
+			//课程异常
 			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance, null));
 
+			//服务指标异常
 			Map<String, Object> params = new HashMap<>();
 			LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
@@ -425,6 +482,235 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	}
 
 	@Override
+	public List<IndexErrorDataExportDto> exportIndexErrData(String organIdsStr, IndexErrorType errorType) {
+		List<IndexErrorDataExportDto> results = new ArrayList<>();
+
+		//只筛选指定时间之后的数据
+		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());
+		}
+		Date date = new Date();
+
+		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)) {
+			//获取教务老师关联的班级列表
+			classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
+			educationUserId = sysUser.getId();
+		}
+
+		//基础技能班学员数量异常
+		Map<Integer, Integer> highClassStudentLessThanThreeMap = new HashMap<>();
+		//乐团巡查事项异常
+		Map<Integer, Integer> musicPatrolItemMap = new HashMap<>();
+		//未加入任何班级学员
+		Map<Integer, Integer> organNoClassMusicGroupStudentNumMap = new HashMap<>();
+		//未缴费学员数
+		Map<Integer, Integer> studentNotPaymentMap = new HashMap<>();
+		//申请退团学员数
+		Map<Integer, Integer> studentApplyForQuitMusicGroupMap = new HashMap<>();
+		//预计课酬较低
+		Map<Integer, Integer> teacherExpectSalaryBeLowMap = new HashMap<>();
+		//课程时间安排异常
+		Map<Integer, Integer> courseTimeErrorMap = new HashMap<>();
+		//乐团巡查任务未计划
+		Map<Integer, Integer> inspectionItemMap = new HashMap<>();
+		//乐团巡查任务未提交
+		Map<Integer, Integer> inspectionItemPlanMap = new HashMap<>();
+		//回访任务未完成
+		Map<Integer, Integer> studentVisitMap = new HashMap<>();
+		//课程考勤异常
+		Map<Integer, Integer> teacherExceptionAttendanceMap = new HashMap<>();
+		//课程异常
+		Map<Integer, Integer> teacherNotAClassMap = new HashMap<>();
+		//服务指标异常
+		Map<Integer, Integer> teacherServeErrorMap = new HashMap<>();
+
+		if(IndexErrorType.MUSIC_PATROL.equals(errorType)||Objects.isNull(errorType)){
+			//基础技能班学员数量异常
+			List<Map<Integer, Integer>> highClassStudentLessThanThreeMapList = indexBaseMonthDataDao.countLessThenThreeClassOrganGroupNum(organIds, educationUserId);
+			highClassStudentLessThanThreeMap = MapUtil.mapListToMap(highClassStudentLessThanThreeMapList, Integer.class, Integer.class);
+
+			//乐团巡查事项异常
+			List<Map<Integer, Integer>> musicPatrolItemMapList = indexBaseMonthDataDao.queryOrganErrInspection(organIds, startTime);
+			musicPatrolItemMap = MapUtil.mapListToMap(musicPatrolItemMapList, Integer.class, Integer.class);
+
+			//未加入任何班级学员
+			List<Map<Integer, Integer>> organNoClassMusicGroupStudentNumMapList = indexBaseMonthDataDao.getOrganNoClassMusicGroupStudentNum(organIds, educationUserId);
+			organNoClassMusicGroupStudentNumMap = MapUtil.mapListToMap(organNoClassMusicGroupStudentNumMapList, Integer.class, Integer.class);
+		}
+
+		if(IndexErrorType.STUDENT_INFO.equals(errorType)||Objects.isNull(errorType)){
+			//未缴费学员数
+			List<Map<Integer, Integer>> studentNotPaymentMapList = indexBaseMonthDataDao.countOrganNoPaymentStudentNum(organIds, educationUserId);
+			studentNotPaymentMap = MapUtil.mapListToMap(studentNotPaymentMapList, Integer.class, Integer.class);
+
+			//申请退团学员数
+			List<Map<Integer, Integer>> studentApplyForQuitMusicGroupMapList = indexBaseMonthDataDao.queryOrganApplyForQuitGroupNum(organIds, educationUserId);
+			studentApplyForQuitMusicGroupMap = MapUtil.mapListToMap(studentApplyForQuitMusicGroupMapList, Integer.class, Integer.class);
+		}
+
+		if(IndexErrorType.TEACHER_INFO.equals(errorType)||Objects.isNull(errorType)){
+			String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
+
+			//全职未离职老师
+			//预计课酬较低
+			List<Map<Integer, Integer>> teacherExpectSalaryBeLowMapList = indexBaseMonthDataDao.queryOrganLowTeacherSalary(organIdsStr, monthStr);
+			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);
+			inspectionItemMap = MapUtil.mapListToMap(inspectionItemMapList, Integer.class, Integer.class);
+
+			//乐团巡查任务未提交
+			List<Map<Integer, Integer>> inspectionItemPlanMapList = indexBaseMonthDataDao.queryOrganInspectionItemPlan(organIdsStr, startTime);
+			inspectionItemPlanMap = MapUtil.mapListToMap(inspectionItemPlanMapList, Integer.class, Integer.class);
+
+			//回访任务未完成
+			List<Map<Integer, Integer>> studentVisitMapList = indexBaseMonthDataDao.queryOrganStudentVisit(organIdsStr, startTime, userId);
+			studentVisitMap = MapUtil.mapListToMap(studentVisitMapList, Integer.class, Integer.class);
+		}
+
+		if(IndexErrorType.ATTENDANCE_SERVE.equals(errorType)||Objects.isNull(errorType)){
+			if(classGroupIds == null || classGroupIds.size() > 0){
+				//课程考勤异常
+				List<Map<Integer, Integer>> teacherExceptionAttendanceMapList = indexBaseMonthDataDao.getOrganAttendanceError(organIds, startTime, classGroupIds);
+				teacherExceptionAttendanceMap = MapUtil.mapListToMap(teacherExceptionAttendanceMapList, Integer.class, Integer.class);
+
+				//课程异常
+				List<Map<Integer, Integer>> teacherNotAClassMapList = indexBaseMonthDataDao.getOrganNoAttendance(organIds, startTime, classGroupIds);
+				teacherNotAClassMap = MapUtil.mapListToMap(teacherNotAClassMapList, Integer.class, Integer.class);
+			}
+
+			//服务指标异常
+			Map<String, Object> params = new HashMap<>();
+			LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
+			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
+			params.put("organIds", organIds);
+			params.put("monday",monDayDate.toString());
+			params.put("sunday",sunDayDate.toString());
+			params.put("jobNature", JobNatureEnum.FULL_TIME);
+			params.put("unDone",1);
+			List<Map<Integer, Integer>> teacherServeErrorMapList = indexBaseMonthDataDao.countOrganTeacherServeInfo(params);
+			teacherServeErrorMap = MapUtil.mapListToMap(teacherServeErrorMapList, Integer.class, Integer.class);
+		}
+
+		List<Organization> organs = organizationDao.findOrgans(new ArrayList<>(organIds));
+
+		IndexErrorDataExportDto totalData = new IndexErrorDataExportDto();
+		totalData.setOrganName("总计");
+		for (Organization organ : organs) {
+			IndexErrorDataExportDto indexErrorData = new IndexErrorDataExportDto();
+			indexErrorData.setOrganId(organ.getId());
+			indexErrorData.setOrganName(organ.getName());
+
+			int total = 0;
+			//基础技能班学员数量异常
+			if(highClassStudentLessThanThreeMap.containsKey(organ.getId())){
+				indexErrorData.setHighClassStudentLessThanThreeNum(highClassStudentLessThanThreeMap.get(organ.getId()));
+			}
+			total += indexErrorData.getHighClassStudentLessThanThreeNum();
+			totalData.setHighClassStudentLessThanThreeNum(totalData.getHighClassStudentLessThanThreeNum() + indexErrorData.getHighClassStudentLessThanThreeNum());
+			//乐团巡查事项异常
+			if(musicPatrolItemMap.containsKey(organ.getId())){
+				indexErrorData.setMusicPatrolItem(musicPatrolItemMap.get(organ.getId()));
+			}
+			total += indexErrorData.getMusicPatrolItem();
+			totalData.setMusicPatrolItem(totalData.getMusicPatrolItem() + indexErrorData.getMusicPatrolItem());
+			//未加入任何班级学员
+			if(organNoClassMusicGroupStudentNumMap.containsKey(organ.getId())){
+				indexErrorData.setNoClassMusicGroupStudentInfo(organNoClassMusicGroupStudentNumMap.get(organ.getId()));
+			}
+			total += indexErrorData.getNoClassMusicGroupStudentInfo();
+			totalData.setNoClassMusicGroupStudentInfo(totalData.getNoClassMusicGroupStudentInfo() + indexErrorData.getNoClassMusicGroupStudentInfo());
+			//未缴费学员数
+			if(studentNotPaymentMap.containsKey(organ.getId())){
+				indexErrorData.setStudentNotPayment(studentNotPaymentMap.get(organ.getId()));
+			}
+			total += indexErrorData.getStudentNotPayment();
+			totalData.setStudentNotPayment(totalData.getStudentNotPayment() + indexErrorData.getStudentNotPayment());
+			//申请退团学员数
+			if(studentApplyForQuitMusicGroupMap.containsKey(organ.getId())){
+				indexErrorData.setStudentApplyForQuitMusicGroup(studentApplyForQuitMusicGroupMap.get(organ.getId()));
+			}
+			total += indexErrorData.getStudentApplyForQuitMusicGroup();
+			totalData.setStudentApplyForQuitMusicGroup(totalData.getStudentApplyForQuitMusicGroup() + indexErrorData.getStudentApplyForQuitMusicGroup());
+			//预计课酬较低
+			if(teacherExpectSalaryBeLowMap.containsKey(organ.getId())){
+				indexErrorData.setTeacherExpectSalaryBeLow(teacherExpectSalaryBeLowMap.get(organ.getId()));
+			}
+			total += indexErrorData.getTeacherExpectSalaryBeLow();
+			totalData.setTeacherExpectSalaryBeLow(totalData.getTeacherExpectSalaryBeLow() + indexErrorData.getTeacherExpectSalaryBeLow());
+			//课程时间安排异常
+			if(courseTimeErrorMap.containsKey(organ.getId())){
+				indexErrorData.setCourseTimeError(courseTimeErrorMap.get(organ.getId()));
+			}
+			total += indexErrorData.getCourseTimeError();
+			totalData.setCourseTimeError(totalData.getCourseTimeError() + indexErrorData.getCourseTimeError());
+			//乐团巡查任务未计划
+			if(inspectionItemMap.containsKey(organ.getId())){
+				indexErrorData.setInspectionItem(inspectionItemMap.get(organ.getId()));
+			}
+			total += indexErrorData.getInspectionItem();
+			totalData.setInspectionItem(totalData.getInspectionItem() + indexErrorData.getInspectionItem());
+			//乐团巡查任务未提交
+			if(inspectionItemPlanMap.containsKey(organ.getId())){
+				indexErrorData.setInspectionItemPlan(inspectionItemPlanMap.get(organ.getId()));
+			}
+			total += indexErrorData.getInspectionItemPlan();
+			totalData.setInspectionItemPlan(totalData.getInspectionItemPlan() + indexErrorData.getInspectionItemPlan());
+			//回访任务未完成
+			if(studentVisitMap.containsKey(organ.getId())){
+				indexErrorData.setStudentVisit(studentVisitMap.get(organ.getId()));
+			}
+			total += indexErrorData.getStudentVisit();
+			totalData.setStudentVisit(totalData.getStudentVisit() + indexErrorData.getStudentVisit());
+			//课程考勤异常
+			if(teacherExceptionAttendanceMap.containsKey(organ.getId())){
+				indexErrorData.setTeacherExceptionAttendance(teacherExceptionAttendanceMap.get(organ.getId()));
+			}
+			total += indexErrorData.getTeacherExceptionAttendance();
+			totalData.setTeacherExceptionAttendance(totalData.getTeacherExceptionAttendance() + indexErrorData.getTeacherExceptionAttendance());
+			//课程异常
+			if(teacherNotAClassMap.containsKey(organ.getId())){
+				indexErrorData.setTeacherNotAClass(teacherNotAClassMap.get(organ.getId()));
+			}
+			total += indexErrorData.getTeacherNotAClass();
+			totalData.setTeacherNotAClass(totalData.getTeacherNotAClass() + indexErrorData.getTeacherNotAClass());
+			//服务指标异常
+			if(teacherServeErrorMap.containsKey(organ.getId())){
+				indexErrorData.setTeacherServeError(teacherServeErrorMap.get(organ.getId()));
+			}
+			total += indexErrorData.getTeacherServeError();
+			totalData.setTeacherServeError(totalData.getTeacherServeError() + indexErrorData.getTeacherServeError());
+			indexErrorData.setTotal(total);
+			totalData.setTotal(totalData.getTotal() + indexErrorData.getTotal());
+			results.add(indexErrorData);
+		}
+		results.add(totalData);
+
+		return results;
+	}
+
+	@Override
 	public List<IndexErrInfoDto> getRemindMatterData(String organIds) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {

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

@@ -2461,8 +2461,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //获取教学点编号
         Map<Integer, String> cooperationOrganNames = MapUtil.convertMybatisMap(cooperationOrganDao.queryNameByIds(StringUtils.join(musicGroupList.stream().map(MusicGroup::getCooperationOrganId).collect(Collectors.toSet()), ",")));
 
-//        Set<Integer> organIds = musicGroupList.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
-//        Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds,",")));
+        Set<Integer> organIds = musicGroupList.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
+        Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds,",")));
 
         List<MusicGroupPurchaseList> musicGroupPurchaseListCount = musicGroupPurchaseListDao.getCount(musicGroupIds);
         Map<String, Integer> purchaseListMap = musicGroupPurchaseListCount.stream().collect(Collectors.toMap(MusicGroupPurchaseList::getMusicGroupId, MusicGroupPurchaseList::getPurchaseNum));
@@ -2471,7 +2471,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //获取分部名称map
         musicGroupList.forEach(e -> {
 //            e.setSchoolName(schoolNameMap.get(e.getSchoolId()));
-//            e.setOrganName(organNames.get(e.getOrganId()));
+            e.setOrganName(organNames.get(e.getOrganId()));
             e.setCooperationOrganName(cooperationOrganNames.get(e.getCooperationOrganId()));
             e.setEducationalTeacherName(educationalTeacherNameMap.get(e.getEducationalTeacherId()));
             e.setTeamTeacherName(teamTeacherNameMap.get(e.getTeamTeacherId()));

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

@@ -433,7 +433,15 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
                 MessageTypeEnum.TEACHER_PUSH_STUDENT_LEAVE,
                 sendArgs,
-                null, 0, "1", "TEACHER", DateUtil.getDate(courseSchedule.getClassDate()), DateUtil.getTime(courseSchedule.getStartClassTime()), courseSchedule.getName(), sysUser.getUsername());
+                null, 0, "1", "TEACHER",
+                DateUtil.dateToString(courseSchedule.getStartClassTime(), "yyyy年MM月dd日 HH点mm分"),
+                courseSchedule.getType().getMsg(), sysUser.getUsername(), remark);
+
+        sysMessageService.batchSendImMessage(MessageTypeEnum.TEACHER_IM_STUDENT_LEAVE,
+                userId.toString(), null,
+                new String[]{courseSchedule.getActualTeacherId().toString()},
+                null, DateUtil.dateToString(courseSchedule.getStartClassTime(), "yyyy年MM月dd日 HH点mm分"),
+                courseSchedule.getType().getMsg(), sysUser.getUsername(), remark);
         return true;
     }
 

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

@@ -10,9 +10,7 @@ import java.util.stream.Collectors;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
-import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.SysConfigService;
 
@@ -48,7 +46,6 @@ import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.SubjectChange;
 import com.ym.mec.biz.dal.entity.SysUserCashAccount;
 import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -497,9 +494,14 @@ public class StudentManageServiceImpl implements StudentManageService {
             }
             List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
             List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(collect,"VIP,PRACTICE");
+            List<SubjectChange> waitPayChange = subjectChangeDao.getMusicGroupWaitPay(queryInfo.getMusicGroupId());
+            Map<Integer, List<SubjectChange>> studentWaitPayChange = waitPayChange.stream().collect(Collectors.groupingBy(SubjectChange::getStudentId));
             dataList.forEach(e->{
                 e.setHasCourse(hasCourseStudent.contains(e.getUserId()));
                 e.setNoPaymentAmount(totalAmountMap.get(e.getUserId()));
+                if (studentWaitPayChange.containsKey(e.getUserId())) {
+                    e.setSubjectChange(studentWaitPayChange.get(e.getUserId()).get(0));
+                }
             });
         }
         pageInfo.setRows(dataList);

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

@@ -650,6 +650,36 @@
 		) t
 	</select>
 
+	<select id="countLessThenThreeClassOrganGroupNum" resultType="map">
+		SELECT t.organ_id_ AS 'key',
+		       COUNT(t.id_) AS 'value'
+		FROM (
+		SELECT mg.organ_id_,cg.id_ FROM
+		class_group cg
+		LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
+		LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+		LEFT JOIN course_schedule cs ON cs.class_group_id_=cg.id_
+		WHERE
+		cg.type_ IN ('HIGH', 'HIGH_ONLINE')
+		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
+		AND cs.del_flag_=0
+		AND cs.status_='NOT_START'
+		AND ( cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_ )
+		<if test="educationUserId != null">
+			AND mg.educational_teacher_id_ = #{educationUserId}
+		</if>
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY cg.id_
+		HAVING
+		COUNT(DISTINCT CASE WHEN cgsm.status_ = 'NORMAL' THEN cgsm.user_id_ ELSE NULL END) &lt; 3
+		) t GROUP BY t.organ_id_
+	</select>
+
     <select id="getLessThenThreeMusicGroup" resultType="java.lang.String">
 		SELECT cg.music_group_id_ FROM
 		class_group cg
@@ -691,6 +721,30 @@
 		</if>
 	</select>
 
+	<select id="countOrganNoPaymentStudentNum" resultType="map">
+		SELECT
+		    mg.organ_id_ AS 'key',
+			COUNT(DISTINCT mgpc.music_group_id_,mgpcd.user_id_) AS 'value'
+		FROM
+		music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
+		LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
+		WHERE
+		mg.status_ = 'PROGRESS'
+		AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(mgpc.payment_valid_start_date_,'%Y-%m-%d')
+		AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpcd.expect_amount_ > 0 AND mgpc.batch_no_ IS NOT NULL AND mgpc.pay_user_type_ = 'STUDENT'
+		<if test="educationUserId != null">
+			AND mg.educational_teacher_id_ = #{educationUserId}
+		</if>
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY mg.organ_id_
+	</select>
+
 	<select id="getNoPaymentMusicGroup" resultType="java.lang.String">
 		SELECT
 			DISTINCT mg.id_
@@ -729,6 +783,26 @@
 		</if>
 	</select>
 
+	<select id="queryOrganApplyForQuitGroupNum" resultType="map">
+		SELECT
+			mg.organ_id_ AS 'key',
+		    COUNT(mgq.id_) AS 'value'
+		FROM music_group_quit mgq
+		LEFT JOIN music_group mg ON mgq.music_group_id_=mg.id_
+		WHERE mg.status_='PROGRESS'
+		AND mgq.status_='PROCESSING'
+		<if test="educationUserId != null">
+			AND mg.educational_teacher_id_ = #{educationUserId}
+		</if>
+		<if test="organIds!=null and organIds.size() > 0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY mg.organ_id_
+	</select>
+
 	<select id="queryStudentAttendanceInfo" resultType="int">
 		SELECT
 			COUNT(DISTINCT cssp.id_)
@@ -770,6 +844,29 @@
 			</foreach>
 		</if>
 	</select>
+
+	<select id="getOrganCourseTimeError" resultType="map">
+		SELECT
+		       cs.organ_id_ AS 'key',
+		       COUNT(cs.id_) AS 'value'
+		FROM course_schedule cs
+		WHERE cs.status_ = 'NOT_START' AND cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.start_class_time_ &lt; '06:00:00'
+		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
+		<if test="classGroupIds != null and classGroupIds.size() > 0">
+			AND cs.class_group_id_ IN
+			<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+				#{classGroupId}
+			</foreach>
+		</if>
+		<if test="organIds != null and organIds.size()>0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY cs.organ_id_
+	</select>
+
     <select id="getAttendanceError" resultType="int">
 		SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
@@ -794,6 +891,35 @@
 		</if>
 		GROUP BY cs.id_) c
 	</select>
+
+	<select id="getOrganAttendanceError" resultType="map">
+		SELECT
+			c.organ_id_ AS 'key',
+		    COUNT(DISTINCT c.id_) AS 'value'
+		FROM (SELECT cs.organ_id_,cs.id_ FROM course_schedule cs
+		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
+		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
+		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
+		WHERE ta.teacher_id_ = cs.actual_teacher_id_
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
+		AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
+		AND ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL
+		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
+		<if test="classGroupIds != null and classGroupIds.size() > 0">
+			AND cs.class_group_id_ IN
+			<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+				#{classGroupId}
+			</foreach>
+		</if>
+		<if test="organIds != null and organIds.size()>0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY cs.id_) c GROUP BY c.organ_id_
+	</select>
+
 	<select id="getNoAttendance" resultType="int">
 		SELECT COUNT(DISTINCT cs.id_) FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
@@ -814,6 +940,32 @@
 			</foreach>
 		</if>
 	</select>
+
+	<select id="getOrganNoAttendance" resultType="map">
+		SELECT
+		    cs.organ_id_ AS 'key',
+		    COUNT(DISTINCT cs.id_) AS 'value'
+		FROM course_schedule cs
+		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
+		WHERE ta.teacher_id_ = cs.actual_teacher_id_
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>='2021-02-01'
+		AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
+		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
+		<if test="classGroupIds != null and classGroupIds.size() > 0">
+			AND cs.class_group_id_ IN
+			<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+				#{classGroupId}
+			</foreach>
+		</if>
+		<if test="organIds!=null and organIds.size() > 0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY cs.organ_id_
+	</select>
+
 	<select id="queryTeacherLeave" resultType="int">
 		SELECT COUNT(DISTINCT tlr.id_) FROM teacher_leave_record tlr
 		LEFT JOIN teacher t ON t.id_ = tlr.user_id_
@@ -832,6 +984,22 @@
 			AND FIND_IN_SET(tcs.organ_id_,#{organIdsStr})
 		</if>
 	</select>
+
+	<select id="queryOrganLowTeacherSalary" resultType="map">
+		SELECT
+			tcs.organ_id_ AS 'key',
+			COUNT(DISTINCT tcs.user_id_) AS 'value'
+		FROM teacher_course_statistics tcs
+		LEFT JOIN teacher t ON t.id_ = tcs.user_id_
+		LEFT JOIN sys_user su ON su.id_ = tcs.user_id_
+		WHERE su.lock_flag_ = 0 AND su.del_flag_ = 0 AND t.job_nature_ = 'FULL_TIME' AND t.demission_date_ IS NULL
+		AND DATE_FORMAT(tcs.month_,'%Y-%m') = #{monthStr} AND tcs.low_salary = 1
+		<if test="organIdsStr != null and organIdsStr != ''">
+			AND FIND_IN_SET(tcs.organ_id_,#{organIdsStr})
+		</if>
+		GROUP BY tcs.organ_id_
+	</select>
+
 	<select id="queryInspectionItem" resultType="int">
 		SELECT COUNT(DISTINCT ii.id_) FROM inspection_item ii
 		LEFT JOIN inspection i ON ii.inspection_id_ = i.id_
@@ -844,6 +1012,24 @@
 			AND ii.user_id_ = #{userId}
 		</if>
 	</select>
+
+	<select id="queryOrganInspectionItem" resultType="map">
+		SELECT
+		       ii.organ_id_ AS 'key',
+		       COUNT(DISTINCT ii.id_) AS 'value'
+		FROM inspection_item ii
+		LEFT JOIN inspection i ON ii.inspection_id_ = i.id_
+		WHERE ii.times_ > planned_times_ AND ii.item_ = 'INSPECT' AND ii.memo_ =''
+		AND DATE_FORMAT(i.month_,'%Y-%m-%d') >= #{startTime}
+		<if test="organIdsStr != null and organIdsStr != ''">
+			AND FIND_IN_SET(ii.organ_id_,#{organIdsStr})
+		</if>
+		<if test="userId != null">
+			AND ii.user_id_ = #{userId}
+		</if>
+		GROUP BY ii.organ_id_
+	</select>
+
 	<select id="queryInspectionItemPlan" resultType="int">
 		SELECT COUNT(DISTINCT iip.id_) FROM inspection_item_plan iip
 		WHERE iip.status_ = 0 AND iip.memo_ = '' AND DATE_FORMAT(iip.plan_start_,'%Y-%m-%d') &lt; DATE_FORMAT(NOW(),'%Y-%m-%d')
@@ -852,6 +1038,20 @@
 			AND FIND_IN_SET(iip.organ_id_,#{organIdsStr})
 		</if>
 	</select>
+
+	<select id="queryOrganInspectionItemPlan" resultType="map">
+		SELECT
+			iip.organ_id_ AS 'key',
+		    COUNT(DISTINCT iip.id_) AS 'value'
+		FROM inspection_item_plan iip
+		WHERE iip.status_ = 0 AND iip.memo_ = '' AND DATE_FORMAT(iip.plan_start_,'%Y-%m-%d') &lt; DATE_FORMAT(NOW(),'%Y-%m-%d')
+		AND DATE_FORMAT(iip.plan_start_,'%Y-%m-%d') >= #{startTime} AND DATE_FORMAT(iip.plan_start_,'%Y-%m-%d') &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d')
+		<if test="organIdsStr != null and organIdsStr != ''">
+			AND FIND_IN_SET(iip.organ_id_,#{organIdsStr})
+		</if>
+		GROUP BY iip.organ_id_
+	</select>
+
 	<select id="queryStudentVisit" resultType="int">
 		SELECT COUNT(DISTINCT ii.id_) FROM inspection_item ii
 		LEFT JOIN inspection i ON ii.inspection_id_ = i.id_
@@ -867,6 +1067,25 @@
 		</if>
 	</select>
 
+	<select id="queryOrganStudentVisit" resultType="map">
+		SELECT
+			ii.organ_id_ AS 'key',
+		    COUNT(DISTINCT ii.id_) AS 'value'
+		FROM inspection_item ii
+		LEFT JOIN inspection i ON ii.inspection_id_ = i.id_
+		WHERE ii.item_ = 'VISIT' AND ii.memo_ =''
+		AND ii.times_ > (SELECT COUNT(DISTINCT sv.id_) FROM student_visit sv
+		WHERE sv.teacher_id_ = ii.user_id_ AND DATE_FORMAT(i.month_,'%Y-%m') = DATE_FORMAT(sv.visit_time_,'%Y-%m'))
+		AND i.month_ >= #{startTime} AND i.month_ &lt;= DATE_FORMAT(NOW(),'%Y-%m-%d')
+		<if test="organIdsStr != null and organIdsStr != ''">
+			AND FIND_IN_SET(ii.organ_id_,#{organIdsStr})
+		</if>
+		<if test="userId != null">
+			AND ii.user_id_ = #{userId}
+		</if>
+		GROUP BY ii.organ_id_
+	</select>
+
     <select id="queryErrInspection" resultType="int">
 		SELECT
 			COUNT(id_)
@@ -882,6 +1101,23 @@
 		</if>
 	</select>
 
+	<select id="queryOrganErrInspection" resultType="map">
+		SELECT
+			organ_id_ AS 'key',
+		    COUNT(id_) AS 'value'
+		FROM
+		inspection_item_plan
+		WHERE
+		conclusion_status_ = 1 AND memo_ = '' AND DATE_FORMAT(plan_start_,'%Y-%m-%d') >= #{startTime}
+		<if test="organIds!=null and organIds.size()>0">
+			AND organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY organ_id_
+	</select>
+
 	<select id="getNoClassMusicGroupStudentInfo" resultType="com.ym.mec.biz.dal.entity.IndexErrInfoDto">
 		SELECT
 			'NO_CLASS_MUSIC_GROUP_STUDENT_INFO' errorType,
@@ -906,6 +1142,30 @@
 			</if>
 	</select>
 
+	<select id="getOrganNoClassMusicGroupStudentNum" resultType="map">
+		SELECT
+		mg.organ_id_ AS 'key',
+		COUNT( sr.user_id_ ) AS 'value'
+		FROM
+		student_registration sr
+		LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
+		LEFT JOIN class_group_student_mapper cgsm ON cgsm.group_type_='MUSIC' AND cgsm.music_group_id_=sr.music_group_id_ AND cgsm.user_id_=sr.user_id_ AND cgsm.status_='NORMAL'
+		WHERE
+		sr.music_group_status_ = 'NORMAL'
+		AND mg.status_ = 'PROGRESS'
+		AND cgsm.id_ IS NULL
+		<if test="educationUserId != null">
+			AND mg.educational_teacher_id_ = #{educationUserId}
+		</if>
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY mg.organ_id_
+	</select>
+
 	<select id="getFinancePayData"  resultMap="IndexBaseMonthData">
 		SELECT SUM(fe.amount_) total_num_,SUM(fe.amount_) activate_num_,SUM(fe.amount_) percent_,fe.organ_id_,#{dayStr} month_ FROM financial_expenditure fe
 		WHERE DATE_FORMAT(fe.create_time_,'%Y-%m-%d') = #{dayStr}
@@ -927,14 +1187,6 @@
 		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = #{dayStr}
 		GROUP BY spo.organ_id_
 	</select>
-	<select id="getTotalAmountData" resultMap="IndexBaseMonthData">
-		SELECT spo.organ_id_,SUM(spo.actual_amount_ + spo.balance_payment_amount_) total_num_,
-			   SUM(spo.actual_amount_ + spo.balance_payment_amount_) activate_num_,
-			   SUM(spo.actual_amount_ + spo.balance_payment_amount_) percent_,#{dayStr} month_
-		FROM student_payment_order spo
-		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') = #{dayStr}
-		GROUP BY spo.organ_id_
-	</select>
 
 	<select id="getFinancePayDataWithTimely"  resultMap="IndexBaseMonthData">
 		SELECT SUM(fe.amount_) total_num_,SUM(fe.amount_) activate_num_,SUM(fe.amount_) percent_,fe.organ_id_,DATE_FORMAT(fe.create_time_,'%Y-%m-%d') month_
@@ -991,4 +1243,65 @@
 		</if>
 		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
 	</select>
+
+	<sql id="queryTeacherServeInfoCondition">
+		<where>
+			<if test="organIds!=null and organIds.size()>0">
+				AND tea.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="monday!=null and monday!='' and sunday!=null and sunday!=''">
+				AND sees.monday_ BETWEEN #{monday} AND #{sunday}
+			</if>
+			<if test="teacherId!=null">
+				AND sees.teacher_id_ = #{teacherId}
+			</if>
+			<if test="unDone!=null and unDone==1">
+				AND tm.teacher_id_ IS NULL
+			</if>
+			<if test="reminded!=null and reminded==0">
+				AND NOT EXISTS (SELECT id_ FROM teacher_remind WHERE teacher_id_=sees.teacher_id_ AND monday_ = sees.monday_ AND type_='SERVICE')
+			</if>
+			<if test="reminded!=null and reminded==1">
+				AND EXISTS (SELECT id_ FROM teacher_remind WHERE teacher_id_=sees.teacher_id_ AND monday_ = sees.monday_ AND type_='SERVICE')
+			</if>
+			<if test="operatorId!=null">
+				AND EXISTS (SELECT id_ FROM teacher_remind WHERE operator_id_=#{operatorId} AND teacher_id_=sees.teacher_id_ AND monday_ = sees.monday_ AND type_='SERVICE')
+			</if>
+			<if test="jobNature!=null">
+				AND tea.job_nature_=#{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+		</where>
+	</sql>
+
+	<select id="countOrganTeacherServeInfo" resultType="map">
+		SELECT
+		    e.organ_id_ AS 'key',
+		    COUNT(1) AS 'value'
+		FROM (
+		SELECT
+			tea.organ_id_,
+			sees.id_
+		FROM
+		student_extracurricular_exercises_situation_ sees
+		LEFT JOIN teacher tea ON tea.id_=sees.teacher_id_
+		<if test="unDone!=null and unDone==1">
+			LEFT JOIN teacher_remind tm ON sees.monday_=tm.monday_ AND sees.teacher_id_=tm.teacher_id_
+		</if>
+		<include refid="queryTeacherServeInfoCondition" />
+		GROUP BY sees.monday_,sees.sunday_,sees.teacher_id_
+		<if test="unDone!=null">
+			HAVING
+			<if test="unDone==1">
+				SUM( sees.expect_exercises_num_-sees.not_over_course_num_ ) &gt; SUM( sees.actual_exercises_num_ )
+			</if>
+			<if test="unDone==0">
+				SUM( sees.expect_exercises_num_-sees.not_over_course_num_ ) &lt;= SUM( sees.actual_exercises_num_ )
+			</if>
+		</if>
+		ORDER BY sees.monday_,sees.sunday_,sees.teacher_id_
+		) e GROUP BY e.organ_id_
+	</select>
 </mapper>

+ 9 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -509,6 +509,9 @@
 			<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>
@@ -541,6 +544,9 @@
 		FROM
 			student_extracurricular_exercises_situation_ sees
 			LEFT JOIN teacher tea ON tea.id_=sees.teacher_id_
+			<if test="unDone!=null and unDone==1">
+				LEFT JOIN teacher_remind tm ON sees.monday_=tm.monday_ AND sees.teacher_id_=tm.teacher_id_
+			</if>
 			LEFT JOIN organization organ ON organ.id_=tea.organ_id_
 			LEFT JOIN sys_user su ON tea.id_=su.id_
 		<include refid="queryTeacherServeInfoCondition" />
@@ -565,6 +571,9 @@
 			FROM
 				student_extracurricular_exercises_situation_ sees
 				LEFT JOIN teacher tea ON tea.id_=sees.teacher_id_
+				<if test="unDone!=null and unDone==1">
+					LEFT JOIN teacher_remind tm ON sees.monday_=tm.monday_ AND sees.teacher_id_=tm.teacher_id_
+				</if>
 			<include refid="queryTeacherServeInfoCondition" />
 			GROUP BY sees.monday_,sees.sunday_,sees.teacher_id_
 			<if test="unDone!=null">

+ 12 - 9
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -451,11 +451,8 @@
             <if test="studentStatus != null and studentStatus != ''">
                 AND sr.music_group_status_ = #{studentStatus}
             </if>
-            <if test="paymentStatus != null and paymentStatus == 1">
-                AND sr.payment_status_ = 2
-            </if>
-            <if test="paymentStatus != null and paymentStatus == 0">
-                AND sr.payment_status_ IN (0,1)
+            <if test="paymentStatus != null">
+                AND sr.payment_status_ = #{paymentStatus}
             </if>
             <if test="musicGroupId != null and musicGroupId != ''">
                 AND sr.music_group_id_ = #{musicGroupId}
@@ -487,6 +484,7 @@
         </where>
     </sql>
     <resultMap id="MusicGroupStudentsDto" type="com.ym.mec.biz.dal.dto.MusicGroupStudentsDto">
+        <result property="studentRegistrationId" column="student_registration_id_"/>
         <result property="userId" column="user_id_"/>
         <result property="realName" column="real_name_"/>
         <result property="phone" column="parents_phone_"/>
@@ -494,7 +492,10 @@
         <result property="currentGrade" column="current_grade_"/>
         <result property="currentGradeDate" column="current_grade_date_"/>
         <result property="currentClass" column="current_class_"/>
+        <result property="subjectId" column="subject_id_"/>
         <result property="subjectName" column="subject_name_"/>
+        <result property="regSubjectId" column="reg_subject_id_"/>
+        <result property="regSubjectName" column="regSubjectName"/>
         <result property="studentStatus" column="student_status_"/>
         <result property="paymentStatus" column="payment_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result property="musicGroupId" column="music_group_id_"/>
@@ -507,16 +508,18 @@
         <result column="care_package_" property="carePackage"/>
         <result column="come_on_package_" property="comeOnPackage"/>
         <result column="registerTime" property="registerTime"/>
+        <result column="remark_" property="remark"/>
     </resultMap>
     <select id="queryMusicGroupStudent" resultMap="MusicGroupStudentsDto">
-        SELECT sr.user_id_,su.username_ real_name_,su.gender_,su.phone_ parents_phone_,sr.current_grade_,sr.current_grade_date_,
-        sr.current_class_,sr.music_group_status_ student_status_,CASE WHEN sr.payment_status_ = 2 THEN 1 ELSE 0 END payment_status_,
-        s.name_ subject_name_,sr.music_group_id_,CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END isActive_,
+        SELECT sr.id_ student_registration_id_,sr.user_id_,su.username_ real_name_,su.gender_,su.phone_ parents_phone_,sr.current_grade_,sr.current_grade_date_,
+        sr.current_class_,sr.music_group_status_ student_status_,sr.payment_status_,sr.subject_id_ reg_subject_id_,rs.name_ regSubjectName,sr.remark_,
+        sr.actual_subject_id_ subject_id_,s.name_ subject_name_,sr.music_group_id_,CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END isActive_,
         IF(DATE_FORMAT(sr.create_time_,'%Y-%m-%d') > DATE_FORMAT(mg.payment_expire_date_,'%Y-%m-%d'),1,0) is_new_student_,
         stu.care_package_,stu.come_on_package_,sr.create_time_ registerTime
         FROM student_registration sr
         LEFT JOIN sys_user su ON sr.user_id_ = su.id_
-        LEFT JOIN `subject` s ON s.id_ = sr.actual_subject_id_
+        LEFT JOIN subject s ON s.id_ = sr.actual_subject_id_
+        LEFT JOIN subject rs ON rs.id_ = sr.subject_id_
         LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
         LEFT JOIN student stu ON sr.user_id_ = stu.user_id_
         <if test="classGroupId != null">

+ 10 - 19
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -372,27 +372,18 @@ public class StudentOrderController extends BaseController {
     }
 
     @GetMapping("/getOrderStatus")
-    private HttpResponseResult getOrderStatus(String orderNo) throws Exception {
+    private HttpResponseResult getOrderStatus(String transNo) throws Exception {
 
-        if (orderNo == null || orderNo.isEmpty()) {
-            return failed("订单号必须填");
-        }
-
-        String notifyUrl = ""; //回调地址
-        Map<String, Object> resultMap = new LinkedHashMap<>();
-        resultMap.put("merOrderNoList", orderNo);
-        Map<String, Object> requestMap = YqPayUtil.getRequestMap(notifyUrl, resultMap);
-
-        RsqMsg rsqMsg = new RsqMsg(requestMap);
-
-        Msg queryRs = yqPayFeignService.orderQuery(rsqMsg);
+//        if (orderId == null) {
+//            return failed("订单号必须填");
+//        }
+//        StudentPaymentOrder order = studentPaymentOrderService.get(orderId);
+//        if(order == null){
+//            return failed("订单不存在");
+//        }
 
-        if (queryRs.getCode().equals("88")) {
-            String responseParameters = queryRs.getResponseParameters();
-            List<Map<String, Object>> responseList = JSON.parseObject(responseParameters, List.class);
-            return succeed(responseList);
-        }
-        return succeed("订单不存在");
+        Map<String, Object> payment = Payment.queryPayment(transNo);
+        return succeed(payment);
     }
 
 

+ 35 - 0
mec-util/src/main/java/com/ym/mec/util/collection/MapUtil.java

@@ -2,6 +2,7 @@ package com.ym.mec.util.collection;
 
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.CollectionUtils;
 
 import java.beans.BeanInfo;
 import java.beans.IntrospectionException;
@@ -9,6 +10,10 @@ import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -153,6 +158,36 @@ public class MapUtil {
 		return result;
 	}
 
+
+	public static <Y, Z> Map<Y,Z> mapListToMap(List<Map<Y, Z>> maps, Class<Y> keyType, Class<Z> valueType){
+		Map<Y,Z> result = new HashMap();
+		try {
+			for (Map map : maps) {
+				Y key;
+				Z value;
+				if(keyType.isAssignableFrom(BigDecimal.class)){
+					key = (Y) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(map.get("key"));
+				}else if(keyType.isAssignableFrom(String.class)){
+					key = (Y) String.valueOf(map.get("key"));
+				}else{
+					key = (Y) keyType.getMethod("valueOf", String.class).invoke(null, String.valueOf(map.get("key")));
+				}
+				if(valueType.isAssignableFrom(BigDecimal.class)){
+					value = (Z) BigDecimal.class.getDeclaredConstructor(String.class).newInstance(map.get("value"));
+				}else if(valueType.isAssignableFrom(String.class)){
+					value = (Z) String.valueOf(map.get("value"));
+				}else{
+					value = (Z) valueType.getMethod("valueOf", String.class).invoke(null, String.valueOf(map.get("value")));
+				}
+				result.put(key, value);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		return result;
+	}
+
 	/**
 	 * 经纬度转化成弧度
 	 * @param d

+ 64 - 6
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -139,6 +139,8 @@ public class ExportController extends BaseController {
     private IdGeneratorService idGeneratorService;
     @Autowired
     private MusicGroupQuitService musicGroupQuitService;
+    @Autowired
+    private IndexBaseMonthDataService indexService;
 
     @Autowired
     private TeacherCourseStatisticsService teacherCourseStatisticsService;
@@ -614,12 +616,12 @@ public class ExportController extends BaseController {
                     "课程分部", "课程组编号", "课程班名称", "乐团模式", "vip活动名称", "Vip课程类型", "阶梯奖励名称", "线上课/线下课", "线上课单价", "线下课单价",
                     "课程类别", "课时时长", "实际上课时长", "上课日期",
                     "上课时间", "教师签到状态", "教师签退状态", "教师签到时间", "教师签退时间", "考勤申诉处理状态", "处理意见",
-                    "主辅", "上课地点", "应到学员", "学员签到时间", "学员签退时间", "课时课酬", "阶梯奖励", "扣款原因"}, new String[]{
+                    "主辅", "上课地点", "应到学员", "学员签到时间", "学员签退时间", "课时课酬", "阶梯奖励", "扣款原因", "收入"}, new String[]{
                     "courseScheduleId", "teacherId", "teacherName", "teacherOrganName", "jobType",
                     "courseScheduleOrganName", "groupId", "groupName", "changeType", "vipActiveName", "vipCategoryName", "activeName", "teachMode", "onlineClassesUnitPrice", "offlineClassesUnitPrice",
                     "courseScheduleType", "signCourseScheduleTime", "currentTime", "classDate", "courseScheduleStartTime", "signInStatus",
                     "signOutStatus", "signInTime", "signOutTime", "complaintsStatus", "disposeContent", "teacherRole", "address", "studentNum",
-                    "studentSignInTime", "studentSignOutTime", "price", "rewards", "deductionReason"}, rows);
+                    "studentSignInTime", "studentSignOutTime", "price", "rewards", "deductionReason", "courseIncome"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
@@ -1145,7 +1147,7 @@ public class ExportController extends BaseController {
         managerDownload.setUpdateTime(nowDate);
         managerDownloadDao.insert(managerDownload);
         exportService.orderList(params, managerDownload);
-        return succeed(fileName+"导出申请已提交,请到【报中心-下载列表查看】");
+        return succeed(fileName+"导出申请已提交,请到【报中心-下载列表查看】");
     }
 
 
@@ -1186,9 +1188,9 @@ public class ExportController extends BaseController {
                     row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
                 }
             }
-            String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级", "班级", "专业", "学员状态", "缴费金额",
-                    "下次缴费日期", "是否报名缴费", "是否激活", "是否有剩余VIP", "是否有剩余网管课", "欠费总额"};
-            String[] body = {"userId", "realName", "gender", "phone", "currentGrade", "currentClass", "subjectName", "studentStatus",
+            String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级", "班级", "专业", "学员状态", "新增学员", "缴费金额",
+                    "下次缴费日期", "报名缴费状态", "是否激活", "是否有剩余VIP", "是否有剩余网管课", "欠费总额"};
+            String[] body = {"userId", "realName", "gender", "phone", "currentGrade", "currentClass", "subjectName", "studentStatus", "isNewStudentStr",
                     "courseFee", "nextPaymentDateStr", "paymentStatus.desc", "activeName", "hasVip ? '是' : '否'", "hasPractice ? '是' : '否'", "noPaymentAmount"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
             response.setContentType("application/octet-stream");
@@ -2563,6 +2565,62 @@ public class ExportController extends BaseController {
         }
     }
 
+    @ApiOperation(value = "首页异常统计导出")
+    @RequestMapping("export/exportIndexErrData")
+    @PreAuthorize("@pcs.hasPermissions('export/exportIndexErrData')")
+    public void exportIndexErrData(String organId, IndexErrorType errorType, HttpServletResponse response) throws IOException {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        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("非法请求");
+            }
+        }
+        List<IndexErrorDataExportDto> result = indexService.exportIndexErrData(organId, errorType);
+        if (CollectionUtils.isEmpty(result)) {
+            response.setStatus(200);
+            response.setContentType("Content-Type: application/json;charset=UTF-8");
+            response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
+            response.flushBuffer();
+            return;
+        }
+        OutputStream outputStream = response.getOutputStream();
+
+        try {
+            String[] header = {"分部", "基础技能班学员数量异常", "乐团巡查事项异常", "未在班级学员数", "未缴费学员数",
+                    "申请退团学员数", "预计课酬较低", "课程时间安排异常", "乐团巡查未计划", "乐团巡查任务未提交",
+                    "回访任务未完成", "课程考勤异常", "课程异常", "服务指标异常", "总计",};
+            String[] body = {"organName", "highClassStudentLessThanThreeNum", "musicPatrolItem", "noClassMusicGroupStudentInfo", "studentNotPayment",
+                    "studentApplyForQuitMusicGroup", "teacherExpectSalaryBeLow", "courseTimeError", "inspectionItem", "inspectionItemPlan",
+                    "studentVisit", "teacherExceptionAttendance", "teacherNotAClass", "teacherServeError", "total",};
+            HSSFWorkbook workbook = POIUtil.exportExcel(header, body, result);
+            response.setContentType("application/octet-stream");
+            response.setHeader("Content-Disposition", "attachment;filename=teacherDefaultSalary-" + DateUtil.getDate(new Date()) + ".xls");
+            response.flushBuffer();
+            outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (outputStream != null) {
+                try {
+                    outputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
     @ApiOperation(value = "运营预警导出")
     @RequestMapping("export/teacherCourseStatistics")
     @PreAuthorize("@pcs.hasPermissions('export/teacherCourseStatistics')")

+ 20 - 0
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -177,6 +177,26 @@ public class IndexController extends BaseController {
 		return succeed(indexService.getIndexErrData(organId, errorType));
 	}
 
+	@GetMapping("/exportIndexErrData")
+	public HttpResponseResult exportIndexErrData(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("非法请求");
+			}
+		}
+		return succeed(indexService.exportIndexErrData(organId, errorType));
+	}
+
 	@GetMapping("/getRemindMatterData")
 	public HttpResponseResult getRemindMatterData(String organId){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();

+ 15 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -6,8 +6,10 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -351,4 +353,17 @@ public class StudentManageController extends BaseController {
         studentService.batchUpdateAdviser(teacherId,studentIds);
         return succeed();
     }
+
+    @ApiOperation(value = "检查乐团是否能补招")
+    @GetMapping("/checkCanReg")
+    @PreAuthorize("@pcs.hasPermissions('studentManage/checkCanReg')")
+    public HttpResponseResult<Boolean> checkCanReg(String musicGroupId) {
+        List<String> musicGroupIds = new ArrayList<>();
+        musicGroupIds.add(musicGroupId);
+        Map<String, Boolean> viewMap = studentRegistrationService.checkMusicGroupsRegOrPayStatus(new ArrayList<>(musicGroupIds));
+        if (viewMap.size() > 0) {
+            return succeed(true);
+        }
+        return succeed(false);
+    }
 }