Jelajahi Sumber

学生考勤查询报错

dzx 1 tahun lalu
induk
melakukan
6280000fc6

+ 5 - 1
src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java

@@ -101,7 +101,11 @@ public class StudentStatisticsController {
             Map<Long, Integer> classLeaveCount = studentLeaveService.getClassLeaveCount(startTime, endTime);
 
             for (ClassStatisticsVo record: attendancePage.getRecords()) {
-                record.setLeaveCount(classLeaveCount.get(record.getId()));
+                Integer leaveCount = 0;
+                if(classLeaveCount.get(record.getId()) != null){
+                    leaveCount = classLeaveCount.get(record.getId());
+                }
+                record.setLeaveCount(leaveCount);
                 record.setActualCount(notStayMap.get(record.getId()).size() + stayMap.get(record.getId()).size());
 
                 Integer lateCount = 0;