diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java index 47dd443..4bf3ba3 100644 --- a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java +++ b/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 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 holidays = HolidayUtil.getAllHolidayByYear(currentYear); + holidayService.saveBatch(holidays); + holidayRefresh.setMessage("success"); + holidayRefresh.setHolidayList(getlist()); + return holidayRefresh; + }else{ + System.out.println("222222222222222"); + List holidays = HolidayUtil.getAllHolidayByYear(getYear.getYear()); + holidayService.saveBatch(holidays); + holidayRefresh.setMessage("success"); + holidayRefresh.setHolidayList(getlist()); + return holidayRefresh; + } }