瀏覽代碼

首页异常提醒调整

zouxuan 2 年之前
父節點
當前提交
ec7ff23144

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -475,7 +475,7 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     List<BaseMapDto<Integer, Integer>> getStudentClassGroupBishopTeacherMap(@Param("studentIds") List<Integer> studentIds,
                                                                             @Param("musicGroupId") String musicGroupId);
 
-    List<Long> getLessThenThreeClassGroupIds(@Param("organIds") String organIds);
+    List<Long> getLessThenThreeClassGroupIds(@Param("organIds") String organIds, @Param("hasDesc") Boolean hasDesc);
 
     /**
      * @describe 获取学员与老师所在班级

+ 17 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -169,7 +169,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                                           @Param("teachMode") TeachModeEnum teachMode,
                                                                           @Param("organIds") List<Integer> organIds,@Param("tenantId") Integer tenantId);
 
-    int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
+    int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds,
+                                        @Param("educationUserId") Integer educationUserId,
+                                        @Param("tenantId") Integer tenantId,
+                                        @Param("hasDesc") Boolean hasDesc);
 
 
     List<Map<Integer, Integer>> countLessThenThreeClassOrganGroupNum(@Param("organIds") Set<Integer> organIds,
@@ -230,7 +233,19 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @param organIds
      * @return
      */
-    int getAttendanceError(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime, @Param("classGroupIds") List<Long> classGroupIds,@Param("tenantId") Integer tenantId);
+    int getTeacherAttendanceError(@Param("organIds") Set<Integer> organIds,
+                           @Param("startTime") String startTime,
+                           @Param("classGroupIds") List<Long> classGroupIds,
+                           @Param("tenantId") Integer tenantId);
+    /**
+     * 获取考勤异常编号
+     * @param organIds
+     * @return
+     */
+    int getStudentAttendanceError(@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,

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroup.java

@@ -96,11 +96,22 @@ public class ClassGroup extends BaseEntity {
 	
 	@ApiModelProperty(value = "备注",required = false)
 	private String memo;
+
+	@ApiModelProperty(value = "班级异常提醒备注",required = false)
+	private String desc;
 	
 	private List<ClassGroupTeacherMapper> teacherMapperList = new ArrayList<ClassGroupTeacherMapper>();
 	
 	private List<CourseSchedule> courseScheduleList = new ArrayList<CourseSchedule>();
 
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
 	public String getOrganName() {
 		return organName;
 	}

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

@@ -9,6 +9,7 @@ import com.ym.mec.common.enums.BaseEnum;
 public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
     MUSIC_PATROL("MUSIC_PATROL", "乐团巡查"),
     HIGH_CLASS_STUDENT_LESS_THAN_THREE("HIGH_CLASS_STUDENT_LESS_THAN_THREE", "基础技能班学员数量异常"),
+    HIGH_CLASS_STUDENT_LESS_THAN_THREE_INFO("HIGH_CLASS_STUDENT_LESS_THAN_THREE_INFO", "基础技能班学员数量异常提醒"),
     MUSIC_PATROL_ITEM("MUSIC_PATROL_ITEM", "乐团巡查事项异常"),
     NO_CLASS_MUSIC_GROUP_STUDENT_INFO("NO_CLASS_MUSIC_GROUP_STUDENT_INFO", "当前有{0}个乐团共{1}名学员未加入任何班级"),
 
@@ -38,7 +39,8 @@ public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
     STUDENT_VISIT("STUDENT_VISIT", "回访任务未完成"),
 
     ATTENDANCE_SERVE("ATTENDANCE_SERVE", "考勤及服务"),
-    TEACHER_EXCEPTION_ATTENDANCE("TEACHER_EXCEPTION_ATTENDANCE", "课程考勤异常"),
+    TEACHER_EXCEPTION_ATTENDANCE("TEACHER_EXCEPTION_ATTENDANCE", "老师课程考勤异常"),
+    STUDENT_EXCEPTION_ATTENDANCE("STUDENT_EXCEPTION_ATTENDANCE", "学员课程考勤异常"),
     TEACHER_NOT_A_CLASS("TEACHER_NOT_A_CLASS", "课程异常"),
     TEACHER_SERVE_ERROR("TEACHER_SERVE_ERROR", "服务指标异常"),
     HAS_FREE_COURSE_TIMES("HAS_FREE_COURSE_TIMES", "学员已排课时长未消耗完"),

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ClassGroupQueryInfo.java

@@ -26,6 +26,17 @@ public class ClassGroupQueryInfo extends EducationBaseQueryInfo {
     @ApiModelProperty(value = "少于3人的线上基础技能班,大于0")
     private Integer lessThenThreeHighOnline;
 
+    @ApiModelProperty(value = "是否有班级备注(用于线上基础技能班事项提醒),事项提醒传true,异常提醒传false")
+    private Boolean hasDesc = false;
+
+	public Boolean getHasDesc() {
+		return hasDesc;
+	}
+
+	public void setHasDesc(Boolean hasDesc) {
+		this.hasDesc = hasDesc;
+	}
+
 	public Integer getLessThenThreeHighOnline() {
 		return lessThenThreeHighOnline;
 	}

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

@@ -82,7 +82,7 @@ public class EndCourseScheduleQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "合并课程类型,MASTER 主课,ASSIST 副课,ALL 全部")
     private String mergeCourseType;
 
-    @ApiModelProperty(value = "ERR_ATTENDANCE 考勤异常,NO_ATTENDANCE 课程异常")
+    @ApiModelProperty(value = "TEACHER_ERR_ATTENDANCE 老师考勤异常,STUDENT_ERR_ATTENDANCE 学员考勤异常,NO_ATTENDANCE 课程异常")
     private String searchType;
 
     @ApiModelProperty(value = "课程编号搜索")

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

@@ -3638,7 +3638,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.getOrganIds());
+            List<Long> lessThenThreeClassGroupIds = classGroupStudentMapperDao.getLessThenThreeClassGroupIds(queryInfo.getOrganIds(),queryInfo.getHasDesc());
             params.put("classGroupIds", lessThenThreeClassGroupIds);
             if (CollectionUtils.isEmpty(lessThenThreeClassGroupIds)) {
                 count = 0;

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

@@ -1914,7 +1914,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 .map(CourseSchedule::getId)
                 .collect(Collectors.toList());
 
-        HashSet<Long> courseScheduleIdsSet = new HashSet<>(existCourseScheduleIds);
+//        HashSet<Long> courseScheduleIdsSet = new HashSet<>(existCourseScheduleIds);
 
         //合并新课程和已存在的课程
         List<CourseSchedule> allCourseSchedules;
@@ -1958,7 +1958,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Map<Long, IntegerAndIntegerListDto> classGroupTeachingTeacherMap = classGroupAndUserIdsMap.stream()
                 .collect(Collectors.toMap(IntegerAndIntegerListDto::getId, integerAndIntegerListDto -> integerAndIntegerListDto));
 
-        Set<Long> existCourseScheduleIdsSet=new HashSet<>(existCourseScheduleIds);
+//        Set<Long> existCourseScheduleIdsSet=new HashSet<>(existCourseScheduleIds);
 
         Map<String, List<CourseSchedule>> existClassDateCoursesMap = allCourseSchedules.stream().collect(Collectors.groupingBy(c -> DateUtil.dateToString(c.getClassDate(), "yyyy-MM-dd")));
         Map<String, List<CourseSchedule>> newClassDateCoursesMap = courseSchedules.stream().collect(Collectors.groupingBy(c -> DateUtil.dateToString(c.getClassDate(), "yyyy-MM-dd")));

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

@@ -664,7 +664,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	@Override
 	public Map<String, Object> getIndexErrData(String organIdsStr, IndexErrorType errorType) {
 		//只筛选指定时间之后的数据
-		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
+		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -1)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 
 		Set<Integer> organIds = null;
 		if(StringUtils.isNotBlank(organIdsStr)){
@@ -689,7 +689,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			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,tenantId), null));
+			oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId,tenantId,false), null));
 
 			//乐团巡查事项异常
 			int errInspection = indexBaseMonthDataDao.queryErrInspection(organIds,startTime,tenantId);
@@ -780,22 +780,25 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			List<IndexErrInfoDto> fourChild = new ArrayList<>();
 
 			//课程考勤异常
-			int attendanceError = 0;
+			int teacherAttendanceError = 0;
+			int studentAttendanceError = 0;
 			int noAttendance = 0;
 			//课程时间安排异常
-			int courseTimeError = 0;
+//			int courseTimeError = 0;
 			if(classGroupIds == null || classGroupIds.size() > 0){
-				attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime,classGroupIds,tenantId);
+				teacherAttendanceError = indexBaseMonthDataDao.getTeacherAttendanceError(organIds,startTime,classGroupIds,tenantId);
+				studentAttendanceError = indexBaseMonthDataDao.getStudentAttendanceError(organIds,startTime,classGroupIds,tenantId);
 				noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime,classGroupIds,tenantId);
-				String courseStartTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_START_TIME_ERROR, tenantId);
-				String courseEndTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_END_TIME_ERROR, tenantId);
-				if(StringUtils.isNotEmpty(courseStartTimeError) && StringUtils.isNotEmpty(courseEndTimeError)){
-					courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds,courseStartTimeError,courseEndTimeError,tenantId);
-				}
+//				String courseStartTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_START_TIME_ERROR, tenantId);
+//				String courseEndTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_END_TIME_ERROR, tenantId);
+//				if(StringUtils.isNotEmpty(courseStartTimeError) && StringUtils.isNotEmpty(courseEndTimeError)){
+//					courseTimeError = indexBaseMonthDataDao.getCourseTimeError(organIds,classGroupIds,courseStartTimeError,courseEndTimeError,tenantId);
+//				}
 			}
-			fourChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TIME_ERROR, IndexErrorType.COURSE_TIME_ERROR.getMsg(), courseTimeError, null));
+//			fourChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TIME_ERROR, IndexErrorType.COURSE_TIME_ERROR.getMsg(), courseTimeError, null));
 
-			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
+			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), teacherAttendanceError, null));
+			fourChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_EXCEPTION_ATTENDANCE, IndexErrorType.STUDENT_EXCEPTION_ATTENDANCE.getMsg(), studentAttendanceError, null));
 
 			//课程异常
 			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance, null));
@@ -1125,6 +1128,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<String> musicGroupIds = musicGroupDao.queryHasSubCourseTimes(organIds,tenantId);
 		result.add(new IndexErrInfoDto(IndexErrorType.MUSIC_GROUP_HAS_COURSE_TIMES, IndexErrorType.MUSIC_GROUP_HAS_COURSE_TIMES.getMsg(),musicGroupIds.size(), null));
 
+		//基础技能班学员数量异常提醒
+		result.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE_INFO, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE_INFO.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIdSet,educationUserId,tenantId,true), null));
+
 		//合作单位回款提醒
 		Map<String, Object> params = new HashMap<>();
 		params.put("organId", organIds);
@@ -1137,7 +1143,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	@Override
 	public Map<String,Boolean> hasIndexErrData(String organIdsStr) {
 		Integer tenantId = TenantContextHolder.getTenantId();
-		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -2)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
+		String startTime = DateUtil.format(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(new Date(), -1)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 
 		Map<String,Boolean> resultMap = new HashMap<>();
 		Set<Integer> organIds = null;
@@ -1156,7 +1162,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 		Date date = new Date();
 		boolean flag1 = false;
-		int countLessThenThreeClassGroupNum = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId, tenantId);
+		int countLessThenThreeClassGroupNum = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId, tenantId,false);
 		if(countLessThenThreeClassGroupNum > 0){
 			flag1 = true;
 		}
@@ -1247,7 +1253,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		resultMap.put("teacherInfo",flag3);
 
 		boolean flag4 = false;
-		if(!flag4){
+/*		if(!flag4){
 			int courseTimeError = 0;
 			if(classGroupIds == null || classGroupIds.size() > 0){
 				String courseStartTimeError = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_START_TIME_ERROR, tenantId);
@@ -1259,11 +1265,20 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			if(courseTimeError > 0){
 				flag4 = true;
 			}
+		}*/
+		if(!flag4){
+			int attendanceError = 0;
+			if(classGroupIds == null || classGroupIds.size() > 0){
+				attendanceError = indexBaseMonthDataDao.getTeacherAttendanceError(organIds,startTime,classGroupIds, tenantId);
+			}
+			if(attendanceError > 0){
+				flag4 = true;
+			}
 		}
 		if(!flag4){
 			int attendanceError = 0;
 			if(classGroupIds == null || classGroupIds.size() > 0){
-				attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime,classGroupIds, tenantId);
+				attendanceError = indexBaseMonthDataDao.getStudentAttendanceError(organIds,startTime,classGroupIds, tenantId);
 			}
 			if(attendanceError > 0){
 				flag4 = true;
@@ -1325,19 +1340,21 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 		}
 		if(!flag5){
-			if(!flag5){
-				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
-				if(studentRegistrations.size() > 0){
-					flag5 = true;
-				}
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
+			if(studentRegistrations.size() > 0){
+				flag5 = true;
 			}
 		}
 		if(!flag5){
-			if(!flag5){
-				List<String> strings = musicGroupDao.queryHasSubCourseTimes(organIdsStr, tenantId);
-				if(strings.size() > 0){
-					flag5 = true;
-				}
+			List<String> strings = musicGroupDao.queryHasSubCourseTimes(organIdsStr, tenantId);
+			if(strings.size() > 0){
+				flag5 = true;
+			}
+		}
+		if(!flag5){
+			int countLessThenThreeClassGroupNumInfo = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds,educationUserId, tenantId,true);
+			if(countLessThenThreeClassGroupNumInfo > 0){
+				flag5 = true;
 			}
 		}
 		resultMap.put("remindMatterData",flag5);

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

@@ -1,11 +1,13 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.dto.FeeStudentDto;
+import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;

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

@@ -23,6 +23,7 @@
         <result column="total_class_times_" property="totalClassTimes"/>
         <result column="img_" property="img"/>
         <result column="memo_" property="memo"/>
+        <result column="desc_" property="desc"/>
         <result column="current_class_times_" property="currentClassTimes"/>
 		<result column="tenant_id_" property="tenantId" />
     </resultMap>
@@ -121,9 +122,6 @@
             <if test="studentNum != null">
                 student_num_ = #{studentNum},
             </if>
-            <if test="updateTime != null">
-                update_time_ = NOW(),
-            </if>
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
@@ -154,6 +152,13 @@
             <if test="delFlag != null">
                 del_flag_ = #{delFlag},
             </if>
+            <if test="desc != null and desc != ''">
+                desc_=#{desc},
+            </if>
+            <if test="desc == null or desc == ''">
+                desc_ = NULL,
+            </if>
+            update_time_ = NOW()
         </set>
         WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>

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

@@ -657,6 +657,12 @@
         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="hasDesc != null and hasDesc == true">
+            AND cg.desc_ IS NOT NULL
+        </if>
+        <if test="hasDesc != null and hasDesc == false">
+            AND cg.desc_ IS NULL
+        </if>
         <if test="organIds!=null and organIds!=''">
             AND FIND_IN_SET(mg.organ_id_, #{organIds})
         </if>

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

@@ -2451,11 +2451,11 @@
         COUNT(DISTINCT cs.id_)
         FROM
         course_schedule cs
-        <if test="searchType == 'ERR_ATTENDANCE'">
+        <if test="searchType == 'TEACHER_ERR_ATTENDANCE' or searchType == 'STUDENT_ERR_ATTENDANCE'">
             LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
         </if>
         LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
-        <if test="searchType == 'ERR_ATTENDANCE'">
+        <if test="searchType == 'ERR_ATTENDANCE' or searchType == 'STUDENT_ERR_ATTENDANCE'">
             AND cssp.user_id_ = sa.user_id_
         </if>
         LEFT JOIN teacher_attendance ta on ta.course_schedule_id_ = cs.id_
@@ -2562,14 +2562,20 @@
         <if test="tenantId != null">
             AND cs.tenant_id_ = #{tenantId}
         </if>
-        <if test="searchType == 'ERR_ATTENDANCE'">
+        <if test="searchType == 'TEACHER_ERR_ATTENDANCE'">
             AND ta.teacher_id_ = cs.actual_teacher_id_
             AND cs.status_ = 'OVER'
-            AND (((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0)))
+            AND ((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL) AND ta.dispose_content_ IS NULL)
             AND ((ta.sign_in_status_ IS NULL AND ta.sign_out_status_ IS NOT NULL) OR (ta.sign_out_status_ IS NULL AND ta.sign_in_status_ IS NOT NULL) OR (ta.sign_out_status_ IS NOT NULL AND ta.sign_in_status_ IS NOT NULL))
             AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
         </if>
+        <if test="searchType == 'STUDENT_ERR_ATTENDANCE'">
+            AND cs.status_ = 'OVER'
+            AND (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0))
+            AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
+            AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
+        </if>
         <if test="searchType == 'NO_ATTENDANCE'">
             AND ta.teacher_id_ = cs.actual_teacher_id_
             AND cs.status_ = 'OVER' AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL

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

@@ -759,6 +759,12 @@
 		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="hasDesc != null and hasDesc == true">
+			AND cg.desc_ IS NOT NULL
+		</if>
+		<if test="hasDesc != null and hasDesc == false">
+			AND cg.desc_ IS NULL
+		</if>
 		<if test="educationUserId != null">
 			AND mg.educational_teacher_id_ = #{educationUserId}
 		</if>
@@ -999,14 +1005,13 @@
 		GROUP BY cs.organ_id_
 	</select>
 
-    <select id="getAttendanceError" resultType="int">
+    <select id="getTeacherAttendanceError" 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_
 		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.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
-		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_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0)))
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime}
+		AND ((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL) AND ta.dispose_content_ IS NULL)
 		AND ((ta.sign_in_status_ IS NULL AND ta.sign_out_status_ IS NOT NULL) OR (ta.sign_out_status_ IS NULL AND ta.sign_in_status_ IS NOT NULL) OR (ta.sign_out_status_ IS NOT NULL AND ta.sign_in_status_ IS NOT NULL))
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
 		AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
@@ -1025,6 +1030,28 @@
 		GROUP BY cs.id_) c
 	</select>
 
+    <select id="getStudentAttendanceError" resultType="int">
+		SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
+		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 cs.pre_course_flag_ = 0 AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= #{startTime}
+		AND (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0)) AND cssp.id_ IS NOT NULL
+		AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
+		<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
+	</select>
+
 	<select id="getOrganAttendanceError" resultType="map">
 		SELECT
 			c.organ_id_ AS 'key',
@@ -1270,7 +1297,7 @@
 			sr.music_group_status_ = 'NORMAL' and sr.tenant_id_ = #{tenantId}
 			AND mg.status_ = 'PROGRESS'
 			AND cgsm.id_ IS NULL
-			AND sub.parent_subject_id_!=24
+			AND sub.parent_subject_id_ != 24 AND mg.first_course_start_time_ >= NOW()
 			<if test="educationUserId != null">
 				AND mg.educational_teacher_id_ = #{educationUserId}
 			</if>

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

@@ -440,7 +440,7 @@
 
 	<sql id="queryArrearageStudentsCondition">
 		<where>
-			mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
+			mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId} AND mgpsc.used_course_minutes_ > 0
 			AND ((mgpc.member_rank_setting_id_ IS NOT NULL AND (sr.membership_end_time_ &lt; NOW() OR sr.membership_end_time_ IS NULL)) OR mgpc.member_rank_setting_id_ IS NULL)
 			<if test="noPaymentType==null or noPaymentType==0">
 				AND DATE_FORMAT(NOW(),'%Y-%m-%d') > DATE_FORMAT(mgpc.deadline_payment_date_,'%Y-%m-%d')
@@ -487,6 +487,7 @@
 			su.phone_ phone_
 		FROM
 			music_group_payment_calender_detail mgpcd
+			LEFT JOIN music_group_payment_student_course_detail mgpsc ON mgpsc.music_group_payment_calender_id_ = mgpcd.music_group_payment_calender_id_
 			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_
 			LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_ AND mgpcd.user_id_ = sr.user_id_

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

@@ -1240,7 +1240,7 @@
         <where>
             sr.music_group_status_ = 'NORMAL' and sr.tenant_id_ = #{tenantId}
             AND mg.status_ = 'PROGRESS'
-            AND cgsm.id_ IS NULL
+            AND cgsm.id_ IS NULL AND mg.first_course_start_time_ >= NOW()
             <if test="organIds != null and organIds != ''">
                 AND FIND_IN_SET(mg.organ_id_,#{organIds})
             </if>