| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户待结算调休假时长
|
| | | * 获取用户待结算(下月即将结算)调休假时长
|
| | | */
|
| | | @Override
|
| | | public Double getOverTimeCloseLength(Long userId) {
|
| | | LocalDateTime localDateTime = LocalDateTime.now();
|
| | | LocalDateTime startLocalDateTime = localDateTime.minusMonths(1L).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
| | | LocalDateTime endLocalDateTime = localDateTime.withDayOfMonth(1).minusDays(1).withHour(23).withMinute(59).withSecond(59);
|
| | | LocalDateTime startLocalDateTime = localDateTime.minusMonths(2L).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
| | | LocalDateTime endLocalDateTime = localDateTime.minusMonths(1L).withDayOfMonth(1).minusDays(1).withHour(23).withMinute(59).withSecond(59);
|
| | |
|
| | | // 查询可用调休申请
|
| | | AttendanceOvertimeQueryCriteria overtimeCriteria = new AttendanceOvertimeQueryCriteria();
|
| | | overtimeCriteria.setOvertimeStartTime(Arrays.asList(Timestamp.valueOf(startLocalDateTime), Timestamp.valueOf(endLocalDateTime)));
|
| | | overtimeCriteria.setApprovalStatus(Constant.OVERTIME_PASS);
|
| | | overtimeCriteria.setUserId(userId);
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, overtimeCriteria, criteriaBuilder), Sort.by(Sort.Direction.ASC, "overtimeStartTime"));
|
| | |
|
| | | return attendanceOvertimeList.stream().collect(Collectors.summingDouble(AttendanceOvertime::getRemainingDuration));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户当月结算调休假时长
|
| | | */
|
| | | @Override
|
| | | public Double getOverTimeCurrentCloseLength(Long userId) {
|
| | | LocalDateTime localDateTime = LocalDateTime.now();
|
| | | LocalDateTime startLocalDateTime = localDateTime.minusMonths(3L).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
| | | LocalDateTime endLocalDateTime = localDateTime.minusMonths(2L).withDayOfMonth(1).minusDays(1).withHour(23).withMinute(59).withSecond(59);
|
| | |
|
| | | // 查询可用调休申请
|
| | | AttendanceOvertimeQueryCriteria overtimeCriteria = new AttendanceOvertimeQueryCriteria();
|
| | |
| | | ValidationUtil.isNull( attendanceLeave.getId(),"AttendanceLeave","id",resources.getId());
|
| | | attendanceLeave.copy(resources);
|
| | | AttendanceLeave attendanceLeaveSaved = attendanceLeaveRepository.save(attendanceLeave);
|
| | | if (attendanceLeaveSaved.getLeaveType().equals(Constant.LEAVE_TYPE_REPLACE)) {
|
| | | this.overtimeDeduction(attendanceLeaveSaved, false);
|
| | | if (attendanceLeaveSaved.getLeaveType().equals(Constant.LEAVE_TYPE_REPLACE) && attendanceLeaveSaved.getApprovalStatus().equals(Constant.APPROVAL_STATUS_RETURNED)) {
|
| | | this.overtimeDeduction(attendanceLeaveSaved, true);
|
| | | }
|
| | | // 调用定时任务修改考勤记录
|
| | | List<User> userList = new ArrayList<>();
|