Bladeren bron

教师考勤调整

dzx 1 jaar geleden
bovenliggende
commit
b36650ca32
1 gewijzigde bestanden met toevoegingen van 21 en 21 verwijderingen
  1. 21 21
      src/main/java/com/xjrsoft/module/job/AttendanceRecordTask.java

+ 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);
+        }
     }
 
     /**