|
@@ -447,8 +447,12 @@ public class StudentAttendanceController {
|
|
|
normalSet.add(attendance.getUserNumber()); // 使用学生学号进行去重
|
|
|
}
|
|
|
|
|
|
+ Set<String> errorSet = new HashSet<>();
|
|
|
attendanceReqVO.setClockInStatus("1");
|
|
|
List<StudentAttendanceDO> errorList = studentAttendanceService.getStudentAttendanceAllList(attendanceReqVO);
|
|
|
+ for (StudentAttendanceDO attendance : errorList) {
|
|
|
+ errorSet.add(attendance.getUserNumber()); // 使用学生学号进行去重
|
|
|
+ }
|
|
|
|
|
|
attendanceReqVO.setClockInStatus("2");
|
|
|
List<StudentAttendanceDO> excuseList = studentAttendanceService.getStudentAttendanceAllList(attendanceReqVO);
|
|
@@ -462,7 +466,7 @@ public class StudentAttendanceController {
|
|
|
if (errorList.isEmpty()) {
|
|
|
result.getDailyErrorList().add(0);
|
|
|
} else {
|
|
|
- result.getDailyErrorList().add(errorList.size());
|
|
|
+ result.getDailyErrorList().add(errorSet.size());
|
|
|
}
|
|
|
|
|
|
if (excuseList.isEmpty()) {
|
|
@@ -501,9 +505,13 @@ public class StudentAttendanceController {
|
|
|
.map(StudentAttendanceDO::getUserNumber) // 获取学生名字
|
|
|
.collect(Collectors.toSet()); // 转换为 Set 去重
|
|
|
|
|
|
+ Set<String> uniqueExcuseStudents = excuseList.stream()
|
|
|
+ .map(StudentAttendanceDO::getUserNumber) // 获取学生名字
|
|
|
+ .collect(Collectors.toSet()); // 转换为 Set 去重
|
|
|
+
|
|
|
Integer errorNum =uniqueErrorStudents.size();
|
|
|
Integer normalNum =uniqueNormalStudents.size();
|
|
|
- Integer excuseNum =excuseList.size();
|
|
|
+ Integer excuseNum =uniqueExcuseStudents.size();
|
|
|
weekendAttendanceResVO result = new weekendAttendanceResVO();
|
|
|
result.setErrorNum(errorNum);
|
|
|
result.setNormalNum(normalNum);
|