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