Pārlūkot izejas kodu

feat:服务指标未完成提醒

Joburgess 4 gadi atpakaļ
vecāks
revīzija
01f648c687

+ 14 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -206,25 +206,23 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 				mondayTeacherRemindMap = teacherReminds.stream().collect(Collectors.groupingBy(e -> DateUtil.dateToString(e.getMonday(), "yyyy-MM-dd"), Collectors.groupingBy(TeacherRemind::getTeacherId)));
 			}
 			List<StudentExtracurricularExercisesSituation> teacherServeWithDate = studentExtracurricularExercisesSituationDao.findTeacherServeWithDate(queryInfo.getMonday(), queryInfo.getSunday(), teacherIds, null);
-			Map<Integer, List<StudentExtracurricularExercisesSituation>> teacherServeMap = teacherServeWithDate.stream().filter(s -> "HOMEWORK".equals(s.getServeType())).collect(Collectors.groupingBy(StudentExtracurricularExercisesSituation::getTeacherId));
+			Map<Integer, List<StudentExtracurricularExercisesSituation>> teacherServeMap = teacherServeWithDate.stream().collect(Collectors.groupingBy(StudentExtracurricularExercisesSituation::getTeacherId));
 			for (TeacherServeDto teacherServeDto : dataList) {
-				if(teacherServeMap.containsKey(teacherServeDto.getTeacherId())){
-					List<StudentExtracurricularExercisesSituation> tss = teacherServeMap.get(teacherServeDto.getTeacherId());
-					Set<Long> courseIds = new HashSet<>();
-					boolean done = true;
-					for (StudentExtracurricularExercisesSituation ts : tss) {
-						if(StringUtils.isBlank(ts.getCourseIds())){
-							continue;
-						}
-						Set<Long> ids = Arrays.stream(ts.getCourseIds().split(",")).map(s -> Long.valueOf(s)).collect(Collectors.toSet());
-						courseIds.addAll(ids);
-						if(!rightServeIds.contains(ts.getId())){
-							done = false;
-						}
+				List<StudentExtracurricularExercisesSituation> tss = teacherServeMap.get(teacherServeDto.getTeacherId());
+				Set<Long> courseIds = new HashSet<>();
+				int done = 0;
+				for (StudentExtracurricularExercisesSituation ts : tss) {
+					if(!rightServeIds.contains(ts.getId())){
+						done = 1;
+					}
+					if(StringUtils.isBlank(ts.getCourseIds())){
+						continue;
 					}
-					teacherServeDto.setHomeworkNum(courseIds.size());
+					Set<Long> ids = Arrays.stream(ts.getCourseIds().split(",")).map(s -> Long.valueOf(s)).collect(Collectors.toSet());
+					courseIds.addAll(ids);
 				}
-				teacherServeDto.setUnDone(1);
+				teacherServeDto.setHomeworkNum(courseIds.size());
+				teacherServeDto.setUnDone(done);
 				String mondayStr = DateUtil.dateToString(teacherServeDto.getMonday(), "yyyy-MM-dd");
 				if(!mondayTeacherRemindMap.containsKey(mondayStr)){
 					continue;