zouxuan há 3 anos atrás
pai
commit
7c6e088ef2

+ 15 - 17
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -668,6 +668,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds,educationUserId,tenantId);
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 
+			//学员已排课时长未消耗完
+			Map<String, Object> params = new HashMap<>();
+			params.put("organId", organIdsStr);
+			params.put("tenantId", tenantId);
+			twoChild.add(new IndexErrInfoDto(IndexErrorType.HAS_FREE_COURSE_TIMES, IndexErrorType.HAS_FREE_COURSE_TIMES.getMsg(), musicGroupDao.countHasFreeCourseTimes(params), null));
+
 			//乐团学员会员到期首页提醒
 //			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
 //			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
@@ -755,13 +761,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				int serveErrTeacherNum = studentExtracurricularExercisesSituationDao.countTeacherServeInfo(params);
 				fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_SERVE_ERROR, IndexErrorType.TEACHER_SERVE_ERROR.getMsg(), serveErrTeacherNum, null));
 			}
-
-			//学员已排课时长未消耗完
-			Map<String, Object> params = new HashMap<>();
-			params.put("organId", organIdsStr);
-			params.put("tenantId", tenantId);
-			fourChild.add(new IndexErrInfoDto(IndexErrorType.HAS_FREE_COURSE_TIMES, IndexErrorType.HAS_FREE_COURSE_TIMES.getMsg(), musicGroupDao.countHasFreeCourseTimes(params), null));
-
 			four.setNum(fourChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 			four.setResult(fourChild);
 			all.add(four);
@@ -1147,7 +1146,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				flag2 = true;
 			}
 		}
-
+		if(!flag2){
+			Map<String, Object> params = new HashMap<String, Object>(2);
+			params.put("organId",organIdsStr);
+			params.put("tenantId",tenantId);
+			Integer hasFreeCourseTimes = musicGroupDao.countHasFreeCourseTimes(params);
+			if(hasFreeCourseTimes != null && hasFreeCourseTimes > 0){
+				flag2 = true;
+			}
+		}
 		resultMap.put("studentInfo",flag2);
 		boolean flag3 = false;
 
@@ -1225,15 +1232,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				flag4 = true;
 			}
 		}
-		if(!flag4){
-			Map<String, Object> params = new HashMap<String, Object>(2);
-			params.put("organId",organIdsStr);
-			params.put("tenantId",tenantId);
-			Integer hasFreeCourseTimes = musicGroupDao.countHasFreeCourseTimes(params);
-			if(hasFreeCourseTimes != null && hasFreeCourseTimes > 0){
-				flag4 = true;
-			}
-		}
 		resultMap.put("attendanceServe",flag4);
 
 		boolean flag5 = false;

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

@@ -116,12 +116,12 @@ public class IndexController extends BaseController {
 		if (sysUser == null) {
 			throw new BizException("用户信息获取失败");
 		}
-		RBucket<Map<String, Boolean>> bucket = redissonClient.getBucket(sysUser.getId() + ":hasIndexErrData");
+		RBucket<Map<String, Boolean>> bucket = redissonClient.getBucket("index:hasIndexErrData " + sysUser.getId());
 		Map<String, Boolean> map = bucket.get();
 		if(map == null || map.size() == 0){
 			organId = organizationService.getEmployeeOrgan(sysUser.getId(),organId,sysUser.getIsSuperAdmin());
 			map = indexService.hasIndexErrData(organId);
-			bucket.set(map,10, TimeUnit.MINUTES);
+			bucket.set(map,30, TimeUnit.MINUTES);
 		}
 		return succeed(map);
 	}