From a8df45e9a8911772c885ce0078fd538cdb82a4e0 Mon Sep 17 00:00:00 2001 From: laishajiang <12977614+laishajiang@user.noreply.gitee.com> Date: Wed, 17 Apr 2024 16:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=E8=8A=82=E5=81=87?= =?UTF-8?q?=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HolidayController.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) 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; + } }