From e5af0bf524c56b85d1d7370e918857b748421dad Mon Sep 17 00:00:00 2001
From: yao-zengchun <yao-zengchun@smhc.co.jp>
Date: Fri, 31 Oct 2025 03:50:35 +0000
Subject: [PATCH] Merge branch 'wcd' of http://192.168.1.110:5678/r/pms-upgrade into wcd
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java | 62 +++++++++++++++++--------------
1 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
index 1fd5415..12e7584 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
@@ -74,13 +74,9 @@
public class AttendanceGoOutServiceImpl implements AttendanceGoOutService {
private final AttendanceGoOutRepository attendanceGoOutRepository;
- private final AttendanceOvertimeService attendanceOvertimeService;
private final AttendanceGoOutMapper attendanceGoOutMapper;
private final UserRepository userRepository;
- private final AttendanceService attendanceService;
private final SysConfigHolidayRepository sysConfigHolidayRepository;
- private final AttendanceLeaveServiceImpl attendanceLeaveService;
- private final AttendanceRepository attendanceRepository;
private final AttendanceLeaveRepository attendanceLeaveRepository;
private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository;
private final ApproveEventRepository approveEventRepository;
@@ -526,31 +522,41 @@
LocalTime endTime = calculate.getEnd().toLocalTime();
long distance = ChronoUnit.DAYS.between(startDate, endDate);
return Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).map(localDate -> {
- SysConfigHolidayDto sysConfigHolidayDto = sysConfigHolidayService.queryByHolidayDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
- Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY;
- if ((sysConfigHolidayDto == null && !isWeekend) ||
- sysConfigHolidayDto != null && Constant.DATE_TYPE_WEEKDAY.equals(sysConfigHolidayDto.getDateType())) {
+// SysConfigHolidayDto sysConfigHolidayDto = sysConfigHolidayService.queryByHolidayDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+// Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY;
+// if ((sysConfigHolidayDto == null && !isWeekend) ||
+// sysConfigHolidayDto != null && Constant.DATE_TYPE_WEEKDAY.equals(sysConfigHolidayDto.getDateType())) {
+//
+// LocalDateTime goOutStartTime = localDate.atTime(startTime);
+// LocalDateTime goOutEndTime = localDate.atTime(endTime);
+// LocalDateTime lunchStartTime = localDate.atTime(sysRostering.getLunchStartTime());
+// LocalDateTime lunchEndTime = localDate.atTime(sysRostering.getLunchEndTime());
+//
+//
+// if (goOutEndTime.isBefore(lunchStartTime) || goOutStartTime.isAfter(lunchEndTime)) {
+// return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
+// } else if (!goOutEndTime.isBefore(lunchStartTime) && !goOutEndTime.isAfter(lunchEndTime)) {
+// return ChronoUnit.SECONDS.between(goOutStartTime, lunchStartTime);
+// } else if (!goOutStartTime.isBefore(lunchStartTime) && !goOutStartTime.isAfter(lunchEndTime)) {
+// return ChronoUnit.SECONDS.between(lunchEndTime, goOutEndTime);
+// } else {
+// return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime) - 3600;
+// }
+// } else {
+// LocalDateTime goOutStartTime = localDate.atTime(startTime);
+// LocalDateTime goOutEndTime = localDate.atTime(endTime);
+// return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
+// }
- LocalDateTime goOutStartTime = localDate.atTime(startTime);
- LocalDateTime goOutEndTime = localDate.atTime(endTime);
- LocalDateTime lunchStartTime = localDate.atTime(sysRostering.getLunchStartTime());
- LocalDateTime lunchEndTime = localDate.atTime(sysRostering.getLunchEndTime());
-
-
- if (goOutEndTime.isBefore(lunchStartTime) || goOutStartTime.isAfter(lunchEndTime)) {
- return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
- } else if (!goOutEndTime.isBefore(lunchStartTime) && !goOutEndTime.isAfter(lunchEndTime)) {
- return ChronoUnit.SECONDS.between(goOutStartTime, lunchStartTime);
- } else if (!goOutStartTime.isBefore(lunchStartTime) && !goOutStartTime.isAfter(lunchEndTime)) {
- return ChronoUnit.SECONDS.between(lunchEndTime, goOutEndTime);
- } else {
- return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime) - 3600;
- }
- } else {
- LocalDateTime goOutStartTime = localDate.atTime(startTime);
- LocalDateTime goOutEndTime = localDate.atTime(endTime);
- return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
- }
+ // TODO:20250806修改 减去下班后休息时段
+ LocalDateTime goOutStartTime = localDate.atTime(startTime);
+ LocalDateTime goOutEndTime = localDate.atTime(endTime);
+ LocalDateTime lunchStartTime = localDate.atTime(sysRostering.getLunchStartTime());
+ LocalDateTime lunchEndTime = localDate.atTime(sysRostering.getLunchEndTime());
+ LocalDateTime offStartTime = localDate.atTime(sysRostering.getWorkEndTime());
+ LocalDateTime offEndTime = offStartTime.plusMinutes(30L);
+ Duration duration = Calculate.calculateRemainingDuration(new Calculate(goOutStartTime, goOutEndTime), new Calculate(lunchStartTime, lunchEndTime), new Calculate(offStartTime, offEndTime));
+ return duration.get(ChronoUnit.SECONDS);
}).reduce(0L, (result, current) -> result + current);
}
--
Gitblit v1.9.3