Bläddra i källkod

feat:服务指标明细

Joburgess 4 år sedan
förälder
incheckning
03e5727c6b

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.TeacherExercisesServiceDto;
 import com.ym.mec.biz.dal.dto.TeacherServeDto;
+import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -117,4 +118,8 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
     List<TeacherServeDto> queryTeacherServeInfo(Map<String, Object> params);
     int countTeacherServeInfo(Map<String, Object> params);
 
+    List<StudentExtracurricularExercisesSituation> findTeacherServeWithDate(@Param("monday") String monday,
+                                                                            @Param("sunday") String sunday,
+                                                                            @Param("teacherIds") List<Integer> teacherIds);
+
 }

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

@@ -197,6 +197,8 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			if(!CollectionUtils.isEmpty(teacherReminds)){
 				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);
+			Map<Integer, List<StudentExtracurricularExercisesSituation>> teacherServeMap = teacherServeWithDate.stream().filter(s -> "HOMEWORK".equals(s.getServeType())).collect(Collectors.groupingBy(StudentExtracurricularExercisesSituation::getTeacherId));
 			for (TeacherServeDto teacherServeDto : dataList) {
 				String mondayStr = DateUtil.dateToString(teacherServeDto.getMonday(), "yyyy-MM-dd");
 				if(!mondayTeacherRemindMap.containsKey(mondayStr)){
@@ -206,6 +208,18 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 				if(!teacherRemindMap.containsKey(teacherServeDto.getTeacherId())){
 					continue;
 				}
+				if(teacherServeMap.containsKey(teacherServeDto.getTeacherId())){
+					List<StudentExtracurricularExercisesSituation> tss = teacherServeMap.get(teacherServeDto.getTeacherId());
+					Set<Long> courseIds = new HashSet<>();
+					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);
+					}
+					teacherServeDto.setHomeworkNum(courseIds.size());
+				}
 				TeacherRemind lastTeacherRemind = teacherRemindMap.get(teacherServeDto.getTeacherId()).stream().max(Comparator.comparing(TeacherRemind::getCreateTime)).get();
 				teacherServeDto.setOperatorName(lastTeacherRemind.getOperatorName());
 				teacherServeDto.setRemindDate(lastTeacherRemind.getCreateTime());

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -546,4 +546,11 @@
 			GROUP BY sees.monday_,sees.sunday_,sees.teacher_id_ ORDER BY sees.monday_,sees.sunday_,sees.teacher_id_
 		) e
 	</select>
+
+	<select id="findTeacherServeWithDate" resultMap="StudentExtracurricularExercisesSituation">
+		SELECT * FROM student_extracurricular_exercises_situation_ WHERE monday_ BETWEEN #{monday} AND #{sunday} AND teacher_id_ IN
+		<foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
+			#{teacherId}
+		</foreach>
+	</select>
 </mapper>