浏览代码

feat:1、服务指标

Joburgess 4 年之前
父节点
当前提交
7aa3e072a0

+ 11 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -427,7 +427,7 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
 
         if(!CollectionUtils.isEmpty(results)){
-//            studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
+
             studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString(), studentIds);
             BigDecimal currentPage1=BigDecimal.ONE,
                     pageSize1=new BigDecimal(10000),
@@ -437,10 +437,10 @@ public class StudentServeServiceImpl implements StudentServeService {
             while (currentPage1.compareTo(totalPage1)<=0){
                 List<StudentExtracurricularExercisesSituation> rows=results.stream().skip(pageSize1.multiply(currentPage1.subtract(BigDecimal.ONE)).longValue()).limit(pageSize1.longValue()).collect(Collectors.toList());
 //                List<Integer> updateStudentIds = rows.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-
+//
 //                List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), null, updateStudentIds);
 //                Map<String, StudentExtracurricularExercisesSituation> codeServeMap = weekServiceWithStudents.stream().collect(Collectors.toMap(StudentExtracurricularExercisesSituation::getStuAndTeaCode, s -> s, (s1, s2) -> s1));
-
+//
 //                Set<String> newCodes = rows.stream().map(StudentExtracurricularExercisesSituation::getStuAndTeaCode).collect(Collectors.toSet());
 //                for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
 //                    if(weekServiceWithStudent.getActualExercisesNum()>0||newCodes.contains(weekServiceWithStudent.getStuAndTeaCode())){
@@ -448,7 +448,7 @@ public class StudentServeServiceImpl implements StudentServeService {
 //                    }
 //                    studentExtracurricularExercisesSituationDao.delete(weekServiceWithStudent.getId());
 //                }
-
+//
 //                List<StudentExtracurricularExercisesSituation> newService = new ArrayList<>();
 //                List<StudentExtracurricularExercisesSituation> updateService = new ArrayList<>();
 //                for (StudentExtracurricularExercisesSituation result : rows) {
@@ -482,8 +482,6 @@ public class StudentServeServiceImpl implements StudentServeService {
 //                if(!CollectionUtils.isEmpty(newService))
 //                    studentExtracurricularExercisesSituationDao.batchInsert(newService);
 
-                studentExtracurricularExercisesSituationDao.batchInsert(rows);
-
                 currentPage1=currentPage1.add(BigDecimal.ONE);
             }
             return;
@@ -543,9 +541,11 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
 
         for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
-            List<StudentServeCourseHomeworkDto> studentHomeworks = studentHomeworkMap.get(weekServiceWithStudent.getStudentId());
+            List<StudentServeCourseHomeworkDto> studentAllHomeworks = studentHomeworkMap.get(weekServiceWithStudent.getStudentId());
             weekServiceWithStudent.setActualExercisesNum(0);
-            if(!CollectionUtils.isEmpty(studentHomeworks)&&weekServiceWithStudent.getServeType().equals("HOMEWORK")){
+            if(!CollectionUtils.isEmpty(studentAllHomeworks)&&weekServiceWithStudent.getServeType().equals("HOMEWORK")){
+                Set<String> courseIds = Arrays.stream(weekServiceWithStudent.getCourseIds().split(",")).collect(Collectors.toSet());
+                List<StudentServeCourseHomeworkDto> studentHomeworks = studentAllHomeworks.stream().filter(s -> courseIds.contains(s.getCourseScheduleId())).collect(Collectors.toList());
                 weekServiceWithStudent.setActualExercisesNum(1);
                 long replyNum = studentHomeworks.stream().filter(e -> YesOrNoEnum.YES.equals(e.getStatus())).count();
                 weekServiceWithStudent.setExercisesReplyNum(replyNum>0?1:0);
@@ -572,8 +572,9 @@ public class StudentServeServiceImpl implements StudentServeService {
                 weekServiceWithStudent.setExercisesMessageTimelyNum(exercisesMessageTimelyNum>0?1:0);
             }
 
-            List<ExtracurricularExercisesReply> studentExercises = studentExercisesMap.get(weekServiceWithStudent.getStudentId());
-            if(!CollectionUtils.isEmpty(studentExercises)&&weekServiceWithStudent.getServeType().equals("EXERCISE")){
+            List<ExtracurricularExercisesReply> studentAllExercises = studentExercisesMap.get(weekServiceWithStudent.getStudentId());
+            if(!CollectionUtils.isEmpty(studentAllExercises)&&weekServiceWithStudent.getServeType().equals("EXERCISE")){
+                List<ExtracurricularExercisesReply> studentExercises = studentAllExercises.stream().filter(s -> weekServiceWithStudent.getTeacherId().equals(s.getExtracurricularExercises().getTeacherId())).collect(Collectors.toList());
                 weekServiceWithStudent.setActualExercisesNum(1);
                 long replyNum = studentExercises.stream().filter(e -> e.getStatus()==1).count();
                 if(weekServiceWithStudent.getExercisesReplyNum()<=0){

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

@@ -22,6 +22,7 @@
 		<result column="is_view_" property="isView" />
 		<result column="organ_name_" property="organName" />
 		<result column="submit_time_" property="submitTime" />
+		<association property="extracurricularExercises" columnPrefix="ee_" resultMap="com.ym.mec.biz.dal.dao.ExtracurricularExercisesDao.ExtracurricularExercises"/>
 	</resultMap>
 
 	<resultMap id="ExtraExerciseStudentsDto" type="com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto" extends="ExtracurricularExercisesReply">
@@ -485,9 +486,11 @@
 			eer.status_,
 			eer.submit_time_,
 			eer.is_replied_,
-			eer.is_replied_timely_
+			eer.is_replied_timely_,
+			ee.teacher_id_ ee_teacher_id_
 		FROM
 			extracurricular_exercises_reply eer
+			LEFT JOIN extracurricular_exercises ee ON eer.extracurricular_exercises_id_=ee.id_
 		WHERE
 			DATE_FORMAT( eer.create_time_, '%Y-%m-%d' ) BETWEEN #{startDate} AND #{endDate}
 	</select>