Browse Source

管理端节假日

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

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

@ -35,20 +35,25 @@ 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)) { holidayMapper.delete(null);
if (getYear.getYear()==null||getYear.getYear().equals("")){
System.out.println("1111111111111");
List<Holiday> holidays = HolidayUtil.getAllHolidayByYear(currentYear);
holidayService.saveBatch(holidays);
holidayRefresh.setMessage("success"); holidayRefresh.setMessage("success");
holidayRefresh.setHolidayList(getlist());
return holidayRefresh;
}else{ }else{
holidayMapper.delete(null); System.out.println("222222222222222");
List<Holiday> holidays = HolidayUtil.getAllHolidayByYear(getYear.getYear()); List<Holiday> holidays = HolidayUtil.getAllHolidayByYear(getYear.getYear());
holidayService.saveBatch(holidays); holidayService.saveBatch(holidays);
holidayRefresh.setMessage("success"); holidayRefresh.setMessage("success");
}
holidayRefresh.setHolidayList(getlist()); holidayRefresh.setHolidayList(getlist());
return holidayRefresh; return holidayRefresh;
} }
}
@RequestMapping("/show-holiday") @RequestMapping("/show-holiday")

Loading…
Cancel
Save