Browse Source

1、服务指标

Joburgess 5 years ago
parent
commit
c04b819047

+ 12 - 27
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -56,34 +56,19 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			params.put("offset", pageInfo.getOffset());
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
 			long until = LocalDateTime.ofInstant(queryInfo.getMonday().toInstant(), DateUtil.zoneId).until(LocalDateTime.ofInstant(queryInfo.getSunday().toInstant(), DateUtil.zoneId), ChronoUnit.WEEKS);
-			if(Objects.isNull(queryInfo.getExistVipCourse())||Objects.isNull(queryInfo.getExistPracticeCourse())){
-				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-				Map<Integer, Long> studentVipCourseMap=new HashMap<>();
-				if(Objects.isNull(queryInfo.getExistVipCourse())){
-					List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.VIP);
-					studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
-				}
 
-				Map<Integer, Long> studentPracticeCourseMap=new HashMap<>();
-				if(Objects.isNull(queryInfo.getExistPracticeCourse())){
-					List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentPayPracticeCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
-					studentPracticeCourseMap = MapUtil.convertIntegerMap(studentPracticeCoursesMaps);
-				}
-				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
-					if(Objects.isNull(queryInfo.getExistVipCourse())){
-						Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
-						exercisesSituationDto.setExistVipCourse(Objects.isNull(vipCourses)?0:vipCourses.intValue());
-					}
-					if(Objects.isNull(queryInfo.getExistPracticeCourse())){
-						Long practiceCourses=studentPracticeCourseMap.get(exercisesSituationDto.getStudentId());
-						exercisesSituationDto.setExistPracticeCourse(Objects.isNull(practiceCourses)?0:practiceCourses.intValue());
-					}
-					exercisesSituationDto.setExpectExercisesNum((int) until+1);
-				}
-			}else{
-				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
-					exercisesSituationDto.setExpectExercisesNum((int) until+1);
-				}
+			List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
+			List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.VIP);
+			Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+
+			List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentPayPracticeCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+			Map<Integer, Long> studentPracticeCourseMap = MapUtil.convertIntegerMap(studentPracticeCoursesMaps);
+			for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
+				Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
+				exercisesSituationDto.setExistVipCourse(Objects.isNull(vipCourses)?0:vipCourses.intValue());
+				Long practiceCourses=studentPracticeCourseMap.get(exercisesSituationDto.getStudentId());
+				exercisesSituationDto.setExistPracticeCourse(Objects.isNull(practiceCourses)?0:practiceCourses.intValue());
+				exercisesSituationDto.setExpectExercisesNum((int) until+1);
 			}
 		}
 		if (count == 0) {

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

@@ -125,16 +125,13 @@
 			MAX(sees.id_) id_,
 			student_id_,
 			stu.username_ student_name_,
-			GROUP_CONCAT(tea.real_name_) teacher_name_,
+			GROUP_CONCAT(DISTINCT tea.real_name_) teacher_name_,
 			o.name_ organ_name_,
 			SUM( expect_exercises_num_ ) expect_exercises_num_,
 			SUM( actual_exercises_num_ ) actual_exercises_num_,
 			SUM( exercises_reply_num_ ) exercises_reply_num_,
 			SUM( exercises_message_num_ ) exercises_message_num_,
 			SUM( exercises_message_timely_num_ ) exercises_message_timely_num_
-			<if test="existVipCourse!=null">
-				,#{existVipCourse} exist_vip_course_
-			</if>
 		FROM
 			student_extracurricular_exercises_situation_ sees
 			LEFT JOIN sys_user stu ON stu.id_=sees.student_id_