Ver Fonte

Merge branch 'pre'

dzx há 1 ano atrás
pai
commit
05fba4e3f9

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

@@ -81,9 +81,9 @@ public class TeacherStatisticsController {
     public RT<PageOutput<TeacherStatisticsPageVo>> teacherDetails(@Valid TeacherDetailsDto dto){
         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         String today = LocalDate.now().format(dtf);
-        if(!today.equals(dto.getDate())){
-            Page<TeacherStatisticsPageVo> voIPage = attendanceRecordService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
-            PageOutput<TeacherStatisticsPageVo> pageOutput = ConventPage.getPageOutput(voIPage, TeacherStatisticsPageVo.class);
+        Page<TeacherStatisticsPageVo> voIPage2 = attendanceRecordService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        if(!today.equals(dto.getDate()) && voIPage2.getRecords().isEmpty()){
+            PageOutput<TeacherStatisticsPageVo> pageOutput = ConventPage.getPageOutput(voIPage2, TeacherStatisticsPageVo.class);
             return RT.ok(pageOutput);
         }else{
             MPJLambdaWrapper<User> queryUser = new MPJLambdaWrapper<>();

+ 21 - 21
src/main/java/com/xjrsoft/module/job/AttendanceRecordTask.java

@@ -83,27 +83,27 @@ public class AttendanceRecordTask {
         LocalDateTime startDateTime = now.withHour(0).withMinute(0).withSecond(0).withNano(0);
         LocalDateTime endDateTime = startDateTime.plusDays(1).plusSeconds(-1);
 
-//        if(now.isBefore(noon)){
-//            //计算上午考勤
-//            teacherAttendanceRecord(startDateTime, endDateTime, 1);
-//        }else if(now.isAfter(noon) && now.isBefore(evening)){
-//            //计算上午考勤
-//            teacherAttendanceRecord(startDateTime, endDateTime, 2);
-//        }
-//
-//        LocalDateTime beginTime = now.withHour(0).withMinute(58).withSecond(0);
-//        LocalDateTime endTime = now.withHour(1).withMinute(3).withSecond(0);
-//
-//        //凌晨1点计算前一天的数据
-//        if(now.isAfter(beginTime) && now.isBefore(endTime)){
-//            startDateTime = now.plusDays(-1).withHour(0).withMinute(0).withSecond(0).withNano(0);
-//            endDateTime = startDateTime.plusDays(1).plusSeconds(-1);
-//
-//            //计算上午考勤
-//            teacherAttendanceRecord(startDateTime, endDateTime, 1);
-//            //计算上午考勤
-//            teacherAttendanceRecord(startDateTime, endDateTime, 2);
-//        }
+        if(now.isBefore(noon)){
+            //计算上午考勤
+            teacherAttendanceRecord(startDateTime, endDateTime, 1);
+        }else if(now.isAfter(noon) && now.isBefore(evening)){
+            //计算上午考勤
+            teacherAttendanceRecord(startDateTime, endDateTime, 2);
+        }
+
+        LocalDateTime beginTime = now.withHour(0).withMinute(58).withSecond(0);
+        LocalDateTime endTime = now.withHour(1).withMinute(3).withSecond(0);
+
+        //凌晨1点计算前一天的数据
+        if(now.isAfter(beginTime) && now.isBefore(endTime)){
+            startDateTime = now.plusDays(-1).withHour(0).withMinute(0).withSecond(0).withNano(0);
+            endDateTime = startDateTime.plusDays(1).plusSeconds(-1);
+
+            //计算上午考勤
+            teacherAttendanceRecord(startDateTime, endDateTime, 1);
+            //计算上午考勤
+            teacherAttendanceRecord(startDateTime, endDateTime, 2);
+        }
     }
 
     /**