From e349fb0debacf3c7b3feb1ff96b43d107d08684a Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:32:41 +0800 Subject: [PATCH] =?UTF-8?q?getWorkDay=E6=8E=A5=E5=8F=A3=E5=A4=A9=E6=95=B0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/calendar/CalendarServiceImpl.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/yudao-module-home/yudao-module-home-biz/src/main/java/cn/iocoder/yudao/module/home/service/calendar/CalendarServiceImpl.java b/yudao-module-home/yudao-module-home-biz/src/main/java/cn/iocoder/yudao/module/home/service/calendar/CalendarServiceImpl.java index 426c39c..4d2ce11 100644 --- a/yudao-module-home/yudao-module-home-biz/src/main/java/cn/iocoder/yudao/module/home/service/calendar/CalendarServiceImpl.java +++ b/yudao-module-home/yudao-module-home-biz/src/main/java/cn/iocoder/yudao/module/home/service/calendar/CalendarServiceImpl.java @@ -158,39 +158,31 @@ public class CalendarServiceImpl implements CalendarService { int eWorkHour = 0; // 储存返回天数 BigDecimal result = null; - // 获取开始结束时间 Integer sHour = workDayVO.getSHour(); Integer eHour = workDayVO.getEHour(); - // 判断开始结束时间 if (sHour == null || eHour == null) { return null; } - // 获取开始日期结束日期传递的isWorkDay参数 String sDay = workDayVO.getDate()[0]; String eDay = workDayVO.getDate()[1]; Integer isWork = workDayVO.getIsWorkday(); - // 设置开始时间vo判断开始天数是否为工作日 CalendarPageReqVO sWorkDayVO = new CalendarPageReqVO(); sWorkDayVO.setDate(new String[]{sDay, sDay}); sWorkDayVO.setIsWorkday(isWork); - // 设置结束时间vo判断结束天数是否为工作日 CalendarPageReqVO eWorkDayVO = new CalendarPageReqVO(); eWorkDayVO.setDate(new String[]{eDay, eDay}); eWorkDayVO.setIsWorkday(isWork); - // 获取开始结束工作日天数,获取时间段内工作日天数 Long sTotal = calendarMapper.selectPage(sWorkDayVO).getTotal(); Long eTotal = calendarMapper.selectPage(eWorkDayVO).getTotal(); Long total = calendarMapper.selectPage(workDayVO).getTotal(); - // 判断总过天数不为0时才判断否则直接返回 if (total >= 1) { - // 判断开始天为工作日时才判断 if (sTotal > 0) { // 开始日期的时间判断 @@ -204,7 +196,6 @@ public class CalendarServiceImpl implements CalendarService { day += 1f; } } - // 判断结束天为工作日时才判断 if (eTotal > 0) { // 结束日期的时间判断 @@ -218,7 +209,6 @@ public class CalendarServiceImpl implements CalendarService { day += 0f; } } - // 计算开始时间 if (sWorkHour == 1) { day += 1F; @@ -227,7 +217,6 @@ public class CalendarServiceImpl implements CalendarService { } else if (sWorkHour > 4) { day += 0F; } - // 计算结束时间 if (eWorkHour != 0 && eWorkHour <= 5) { day += 0.5F; @@ -238,18 +227,11 @@ public class CalendarServiceImpl implements CalendarService { if (sHour.equals(eHour)) { day = 1; } - -// System.out.println("sWorkHour: " + workHour); -// System.out.println("eWorkHour: " + workHour2); -// System.out.println("day: " + day); - } - // 计算总工作日期,需要减去的对应天数 result = BigDecimal.valueOf(total) .subtract(BigDecimal.valueOf(day)) .setScale(1, RoundingMode.HALF_UP); - return result; }