From 86b0362eaf4c320dc6a54fc12ce80b0bf7890a85 Mon Sep 17 00:00:00 2001
From: yaozc <yaozc@yhzhg.cn>
Date: Thu, 30 May 2024 02:06:17 +0000
Subject: [PATCH] 11111
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
index ec1dfe6..47e7a6a 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
@@ -71,7 +71,7 @@
private final AttendanceLeaveRepository attendanceLeaveRepository;
private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository;
private final AttendanceGoOutRepository attendanceGoOutRepository;
-// private final AttendanceOvertimeRepository attendanceOvertimeRepository;
+ private final AttendanceOvertimeRepository attendanceOvertimeRepository;
private final DingTalkServiceImpl dingTalkService;
@Override
@@ -367,6 +367,13 @@
new Calculate(attendanceGoOut.getOutStartTime().toLocalDateTime(), attendanceGoOut.getOutEndTime().toLocalDateTime())
).collect(Collectors.toList())
);
+ // 周末加班
+ List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndDate(userId, startOfDate, endOfDate);
+ attendanceParts.addAll(
+ attendanceOvertimeList.stream().map(attendanceOvertime ->
+ new Calculate(attendanceOvertime.getOvertimeStartTime().toLocalDateTime(), attendanceOvertime.getOvertimeEndTime().toLocalDateTime())
+ ).collect(Collectors.toList())
+ );
attendanceParts.stream().sorted().reduce(new Stack<Calculate>(), (result, current) -> {
// 删除重复时间,合并相连的时间段
if (result.empty()) {
@@ -415,7 +422,7 @@
.filter(attendanceLeave -> Constant.LEAVE_TYPE_ANNUAL_LEAVE.equals(attendanceLeave.getLeaveType())
|| Constant.LEAVE_TYPE_MARRIAGE_HOLIDAY.equals(attendanceLeave.getLeaveType())
|| Constant.LEAVE_TYPE_BEREAVEMENT_LEAVE.equals(attendanceLeave.getLeaveType())
- || Constant.LEAVE_TYPE_REPLACE.equals(attendanceLeave.getLeaveType())
+// || Constant.LEAVE_TYPE_REPLACE.equals(attendanceLeave.getLeaveType())
).map(attendanceLeave -> BigDecimal.valueOf(attendanceLeave.getLeaveDuration())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
return result.add(annualLeaveHours).doubleValue();
}
--
Gitblit v1.9.3