Browse Source

首页异常处理

zouxuan 2 years ago
parent
commit
7ab57d6b06

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

@@ -187,7 +187,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                         @Param("startTime") String startTime,
                                                         @Param("tenantId") Integer tenantId);
 
-    IndexErrInfoDto getNoClassMusicGroupStudentInfo(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId,@Param("tenantId") Integer tenantId);
+    IndexErrInfoDto getNoClassMusicGroupStudentInfo(@Param("organIds") Set<Integer> organIds,
+                                                    @Param("educationUserId") Integer educationUserId,
+                                                    @Param("tenantId") Integer tenantId,
+                                                    @Param("hasCourse") Boolean hasCourse);
 
     List<Map<Integer, Integer>> getOrganNoClassMusicGroupStudentNum(@Param("organIds") Set<Integer> organIds,
                                                                     @Param("educationUserId") Integer educationUserId,

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

@@ -696,7 +696,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			oneChild.add(new IndexErrInfoDto(IndexErrorType.MUSIC_PATROL_ITEM, IndexErrorType.MUSIC_PATROL_ITEM.getMsg(),errInspection, null));
 
 			//未加入任何班级学员
-			IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId,tenantId);
+			IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId,tenantId,true);
 			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_CLASS_MUSIC_GROUP_STUDENT_INFO.getMsg());
 			oneChild.add(noClassMusicGroupStudentInfo);
 
@@ -1133,6 +1133,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		//基础技能班学员数量异常提醒
 		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));
 
+		//未加入任何班级学员
+		IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIdSet,educationUserId,tenantId,false);
+		noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_CLASS_MUSIC_GROUP_STUDENT_INFO.getMsg());
+		result.add(noClassMusicGroupStudentInfo);
+
 		//合作单位回款提醒
 		Map<String, Object> params = new HashMap<>();
 		params.put("organId", organIds);
@@ -1175,7 +1180,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 		}
 		if(!flag1){
-			IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId, tenantId);
+			IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId, tenantId,true);
 			if(Objects.nonNull(noClassMusicGroupStudentInfo) && noClassMusicGroupStudentInfo.getNum() > 0){
 				flag1 = true;
 			}
@@ -1359,6 +1364,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				flag5 = true;
 			}
 		}
+		if(!flag5){
+			IndexErrInfoDto noClassMusicGroupStudentInfo = indexBaseMonthDataDao.getNoClassMusicGroupStudentInfo(organIds,educationUserId, tenantId,false);
+			if(Objects.nonNull(noClassMusicGroupStudentInfo) && noClassMusicGroupStudentInfo.getNum() > 0){
+				flag5 = true;
+			}
+		}
 		resultMap.put("remindMatterData",flag5);
 
 		return resultMap;

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

@@ -1298,7 +1298,13 @@
 			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 mg.first_course_start_time_ >= NOW()
+			AND sub.parent_subject_id_ != 24
+			<if test="hasCourse != null and hasCourse == true">
+				AND mg.first_course_start_time_ >= NOW()
+			</if>
+			<if test="hasCourse != null and hasCourse == false">
+				AND (mg.first_course_start_time_ &lt; NOW() OR mg.first_course_start_time_ IS NULL)
+			</if>
 			<if test="educationUserId != null">
 				AND mg.educational_teacher_id_ = #{educationUserId}
 			</if>