| | |
| | | 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 |
| | |
| | | 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()) { |
| | |
| | | .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(); |
| | | } |