dzx 2 månader sedan
förälder
incheckning
e69c257541

+ 20 - 4
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -233,10 +233,26 @@ public class StudentReportRecordController {
         statisticsVo.setArrivedMaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.MALE.getCode().equals(x.getGender())).count());
         statisticsVo.setArrivedFemaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())).count());
 
-        statisticsVo.setStayMaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender()) && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())).count());
-        statisticsVo.setStayFemaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender()) && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())).count());
-        statisticsVo.setNotStayMaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender()) && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())).count());
-        statisticsVo.setNotStayFemaleCount(dataList.stream().filter(x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender()) && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())).count());
+        statisticsVo.setStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatus())
+                        && x.getReportTime() != null
+        ).count());
         Map<String, List<StudentReportRecordStatisticsListVo>> graduatedUniversityMap = dataList.stream().collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getGraduatedUniversity));
         List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
         for (String graduatedUniversity : graduatedUniversityMap.keySet()) {

+ 3 - 2
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -89,7 +89,8 @@
         LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
         LEFT JOIN base_class t11 ON t10.class_id = t11.id
         LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
-        LEFT JOIN student_report_record t13 ON t9.id = t13.user_id and t13.base_semester_id = #{dto.baseSemesterId}
+        LEFT JOIN student_report_record t13 ON t9.id = t13.user_id
+        and t13.base_semester_id = #{dto.baseSemesterId} and t13.delete_mark = 0
         WHERE t1.delete_mark = 0 and (t1.delete_reason is null or t1.delete_reason = '')
         <if test="dto.name != null and dto.name != ''">
             and t1.name like concat('%', #{dto.name}, '%')
@@ -178,7 +179,7 @@
         LEFT JOIN base_student_school_roll t10 ON t9.id = t10.user_id AND t10.delete_mark = 0
         LEFT JOIN base_class t11 ON t10.class_id = t11.id
         LEFT JOIN xjr_user t12 ON t11.teacher_id = t12.id
-        LEFT JOIN student_report_record t13 ON t9.id = t13.user_id and t13.base_semester_id = #{dto.baseSemesterId}
+        LEFT JOIN student_report_record t13 ON t9.id = t13.user_id and t13.base_semester_id = #{dto.baseSemesterId} and t13.delete_mark = 0
         WHERE t1.delete_mark = 0
         <if test="dto.name != null and dto.name != ''">
             and t1.name like concat('%', #{dto.name}, '%')