Переглянути джерело

1、学生历史考勤,不统计节假日相关数据
2、学生考勤消息通知调整

dzx 5 місяців тому
батько
коміт
46b25a1562

+ 12 - 3
src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java

@@ -77,7 +77,6 @@ public class StudentStatisticsController {
     private final IStudentLeaveService studentLeaveService;
     private final IBaseClassService classService;
     private final IHolidayDateService holidayDateService;
-    private final IAttendanceRuleCategoryService ruleCategoryService;
     private final IBaseClassService baseClassService;
     @GetMapping(value = "/class-statistics")
     @ApiOperation(value="班级考勤统计")
@@ -293,6 +292,16 @@ public class StudentStatisticsController {
             DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
             LocalDateTime startTime = LocalDate.parse(dto.getStartTime(), formatter).atTime(0, 0, 0);
             LocalDateTime endTime = LocalDate.parse(dto.getEndTime(), formatter).atTime(23, 59, 59);
+            //如果查询天数只有一天
+            if(startTime.toLocalDate().isEqual(endTime.toLocalDate())){
+                HolidayDate holidayDate = holidayDateService.getOne(
+                        new QueryWrapper<HolidayDate>().lambda()
+                                .eq(HolidayDate::getDate, endTime.toLocalDate())
+                );
+                if(holidayDate != null && holidayDate.getWay() != null && holidayDate.getWay() != 0){
+                    return RT.ok(ConventPage.getPageOutput(attendancePage, ClassStatisticsVo.class));
+                }
+            }
 
 
             //查询每个班的走读生实到人数
@@ -393,7 +402,7 @@ public class StudentStatisticsController {
 
                 Integer lateCount = 0;
                 for (StudentOutInRecordVo outInRecord : notStayMap.get(record.getId())) {
-                    if(outInRecord.getStatus() == 1){
+                    if(outInRecord.getStatus() == OutInStatusEnum.enter.getCode()){
                         continue;
                     }
                     if("迟到".equals(outInRecord.getAttendanceStatus())){
@@ -401,7 +410,7 @@ public class StudentStatisticsController {
                     }
                 }
                 for (StudentOutInRecordVo outInRecord : stayMap.get(record.getId())) {
-                    if(outInRecord.getStatus() == 1){
+                    if(outInRecord.getStatus() == OutInStatusEnum.enter.getCode()){
                         continue;
                     }
                     if("迟到".equals(outInRecord.getAttendanceStatus())){

+ 2 - 2
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -255,7 +255,7 @@ public class AttendanceMessageTask {
                 JSONObject paramJson = new JSONObject();
 
                 JSONObject thing6 = new JSONObject();
-                thing6.put("value", "教职工");
+                thing6.put("value", "学生");
                 paramJson.put("thing6", thing6);
 
                 JSONObject time11 = new JSONObject();
@@ -268,7 +268,7 @@ public class AttendanceMessageTask {
 
                 JSONObject character_string18 = new JSONObject();
                 character_string18.put("value", teacherCout - outInRecords);
-                paramJson.put("character_string18", character_string18);
+                paramJson.put(characterKey, character_string18);
 
                 JSONObject character_string16 = new JSONObject();
                 character_string16.put("value", teacherCout);

+ 8 - 0
src/main/resources/mapper/outin/StudentOutInRecordMapper.xml

@@ -26,6 +26,10 @@
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
         AND t2.stduy_status = 'FB3002'
         AND t1.record_time BETWEEN #{startTime} AND #{endTime}
+        and DATE_FORMAT(t1.record_time, '%Y-%m-%d') not in (
+            SELECT holiday_date.date FROM holiday_date WHERE STATUS IN (0, 2) AND delete_status = 0
+            AND holiday_date.date BETWEEN DATE_FORMAT(#{startTime}, '%Y-%m-%d') AND DATE_FORMAT(#{endTime}, '%Y-%m-%d')
+        )
     </select>
     <select id="getStayList" resultType="com.xjrsoft.module.outint.vo.StudentOutInRecordVo">
         SELECT t1.* FROM student_out_in_record t1
@@ -33,6 +37,10 @@
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
         AND t2.stduy_status = 'FB3001'
         AND t1.record_time BETWEEN #{startTime} AND #{endTime}
+        and DATE_FORMAT(t1.record_time, '%Y-%m-%d') not in (
+            SELECT holiday_date.date FROM holiday_date WHERE STATUS IN (0, 2) AND delete_status = 0
+            AND holiday_date.date BETWEEN DATE_FORMAT(#{startTime}, '%Y-%m-%d') AND DATE_FORMAT(#{endTime}, '%Y-%m-%d')
+        )
     </select>
     <select id="getList" resultType="com.xjrsoft.module.outint.vo.StudentOutInRecordVo">
         SELECT t1.* FROM student_out_in_record t1