getWorkDay接口天数判断更新

This commit is contained in:
XaoLi717 2024-12-19 15:00:08 +08:00
parent 13d7f88734
commit 008b449b16

View File

@ -192,9 +192,9 @@ public class CalendarServiceImpl implements CalendarService {
// 判断开始天为工作日时才判断 // 判断开始天为工作日时才判断
if (sTotal > 0) { if (sTotal > 0) {
// 开始日期的时间判断 // 开始日期的时间判断
if (sHour >= 7 && sHour <= 17) { if (sHour > 8 && (sHour - 8) == 4) {
day += 0.5F; day += 0.5F;
} else if (sHour >= 17) { } else if (sHour > 8&&(sHour - 8) > 4) {
day += 1F; day += 1F;
} }
} }
@ -202,9 +202,9 @@ public class CalendarServiceImpl implements CalendarService {
// 判断结束天为工作日时才判断 // 判断结束天为工作日时才判断
if (eTotal > 0) { if (eTotal > 0) {
// 结束日期的时间判断 // 结束日期的时间判断
if (eHour <= 7) { if (sHour >= 0&&eHour<8) {
day += 1F; day += 1F;
} else if (eHour <= 17) { } else if (sHour > 8 && (eHour - 8) <= 4) {
day += 0.5F; day += 0.5F;
} }
} }