Browse Source

管理端节假日

master
laishajiang 2 years ago
parent
commit
a8df45e9a8
  1. 27
      mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java

27
mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java

@ -35,19 +35,24 @@ public class HolidayController {
HolidayYear getYear = JSON.parseObject(year, HolidayYear.class);
HolidayRefresh holidayRefresh = new HolidayRefresh();
LocalDateTime currentDate = LocalDateTime.now();
String currentYear = Integer.toString(currentDate.getYear());
// String currentYear = "2025";
if (getYear.getYear().equals(currentYear)) {
holidayRefresh.setMessage("success");
} else {
System.out.println(currentYear);
holidayMapper.delete(null);
List<Holiday> holidays = HolidayUtil.getAllHolidayByYear(getYear.getYear());
holidayService.saveBatch(holidays);
holidayRefresh.setMessage("success");
}
holidayRefresh.setHolidayList(getlist());
return holidayRefresh;
if (getYear.getYear()==null||getYear.getYear().equals("")){
System.out.println("1111111111111");
List<Holiday> holidays = HolidayUtil.getAllHolidayByYear(currentYear);
holidayService.saveBatch(holidays);
holidayRefresh.setMessage("success");
holidayRefresh.setHolidayList(getlist());
return holidayRefresh;
}else{
System.out.println("222222222222222");
List<Holiday> holidays = HolidayUtil.getAllHolidayByYear(getYear.getYear());
holidayService.saveBatch(holidays);
holidayRefresh.setMessage("success");
holidayRefresh.setHolidayList(getlist());
return holidayRefresh;
}
}

Loading…
Cancel
Save