|
@@ -75,7 +75,7 @@ class AttendanceRecordTaskTest {
|
|
@Test
|
|
@Test
|
|
public void execute() {
|
|
public void execute() {
|
|
|
|
|
|
- LocalDateTime now = LocalDateTime.of(2024, 10, 20, 0, 0, 0);
|
|
|
|
|
|
+ LocalDateTime now = LocalDateTime.of(2024, 10, 12, 0, 0, 0);
|
|
for (int i = 0; i < 1; i ++){
|
|
for (int i = 0; i < 1; i ++){
|
|
LocalDateTime startDateTime = now.plusDays(i).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
|
LocalDateTime startDateTime = now.plusDays(i).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
|
LocalDateTime endDateTime = startDateTime.plusDays(i).withHour(23).withMinute(59).withSecond(59);
|
|
LocalDateTime endDateTime = startDateTime.plusDays(i).withHour(23).withMinute(59).withSecond(59);
|
|
@@ -112,6 +112,13 @@ class AttendanceRecordTaskTest {
|
|
LocalDate queryDate = startDateTime.toLocalDate();
|
|
LocalDate queryDate = startDateTime.toLocalDate();
|
|
List<TeacherAttendanceRecord> insertList = new ArrayList<>();
|
|
List<TeacherAttendanceRecord> insertList = new ArrayList<>();
|
|
List<String> weekList =Arrays.asList("SUNDAY", "SATURDAY");
|
|
List<String> weekList =Arrays.asList("SUNDAY", "SATURDAY");
|
|
|
|
+
|
|
|
|
+ List<HolidayDate> workHolidayDates = holidayDateService.list(
|
|
|
|
+ new QueryWrapper<HolidayDate>().lambda()
|
|
|
|
+ .eq(HolidayDate::getStatus, 2)
|
|
|
|
+ );
|
|
|
|
+ List<String> workHolidayDateListg = workHolidayDates.stream().map(HolidayDate::getDate).collect(Collectors.toList());
|
|
|
|
+
|
|
for (User user : teacherList) {
|
|
for (User user : teacherList) {
|
|
TeacherAttendanceRecord record = new TeacherAttendanceRecord();
|
|
TeacherAttendanceRecord record = new TeacherAttendanceRecord();
|
|
record.setCreateDate(LocalDateTime.now());
|
|
record.setCreateDate(LocalDateTime.now());
|
|
@@ -125,11 +132,9 @@ class AttendanceRecordTaskTest {
|
|
insertList.add(record);
|
|
insertList.add(record);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- if(14954799823302L == user.getId()){
|
|
|
|
- System.out.println(user.getName());
|
|
|
|
- }
|
|
|
|
AttendanceRuleDetails holidayRule = ruleCategoryService.getHolidayRuleByParam(user.getId());
|
|
AttendanceRuleDetails holidayRule = ruleCategoryService.getHolidayRuleByParam(user.getId());
|
|
- if((weekList.contains(queryDate.getDayOfWeek().name()) || holidayDateList.contains(queryDate.format(formatter))) && (holidayRule.getIsAttendance() == null || holidayRule.getIsAttendance() == 0)){
|
|
|
|
|
|
+ if(((!workHolidayDateListg.contains(queryDate.format(formatter)) && weekList.contains(queryDate.getDayOfWeek().name()))
|
|
|
|
+ || holidayDateList.contains(queryDate.format(formatter))) && (holidayRule.getIsAttendance() == null || holidayRule.getIsAttendance() == 0)){
|
|
record.setAttendanceStatus("不考勤");
|
|
record.setAttendanceStatus("不考勤");
|
|
insertList.add(record);
|
|
insertList.add(record);
|
|
continue;
|
|
continue;
|