| | |
| | | import java.time.Duration;
|
| | | import java.time.LocalDate;
|
| | | import java.time.LocalDateTime;
|
| | | import java.time.ZoneId;
|
| | | import java.time.format.DateTimeFormatter;
|
| | | import java.time.temporal.ChronoUnit;
|
| | | import java.time.temporal.TemporalAdjusters;
|
| | |
| | | }).sum();
|
| | | returnData.put("leaveTimeHours", BigDecimal.valueOf(leaveTimeHours).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
| | |
|
| | | LocalDateTime targetDateTime = yearMonth.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().withDayOfMonth(1).atStartOfDay();
|
| | |
|
| | | // 换休剩余时长
|
| | | Double overTime = attendanceLeaveService.getOverTimeLength(userId);
|
| | | Double overTime = attendanceLeaveService.getOverTimeLength(userId, targetDateTime);
|
| | | returnData.put("overTime", overTime);
|
| | |
|
| | | // 待结算换休时长
|
| | | Double overTimeClose = attendanceLeaveService.getOverTimeCloseLength(userId);
|
| | | // 待结算(下月即将结算)换休时长
|
| | | Double overTimeClose = attendanceLeaveService.getOverTimeCloseLength(userId, targetDateTime);
|
| | | returnData.put("overTimeClose", overTimeClose);
|
| | |
|
| | | // 本月结算换休时长
|
| | | Double overTimeCurrentClose = attendanceLeaveService.getOverTimeCurrentCloseLength(userId, targetDateTime);
|
| | | returnData.put("overTimeCurrentClose", overTimeCurrentClose);
|
| | |
|
| | | // 出差天数
|
| | | returnData.put("businessDays", attendanceBusinessTravelList.stream().filter(attendanceBusinessTravel -> attendanceBusinessTravel.getCategory().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL) && attendanceBusinessTravel.getApprovalStatus().equals(Constant.BUSSINESS_APPROVE_STATUS_AGREE)).collect(Collectors.toList()).stream().map(AttendanceBusinessTravel::getTravelDuration).reduce(0.0, Double::sum));
|
| | | returnData.put("localDays", attendanceBusinessTravelList.stream().filter(attendanceBusinessTravel -> attendanceBusinessTravel.getCategory().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE) && attendanceBusinessTravel.getApprovalStatus().equals(Constant.BUSSINESS_APPROVE_STATUS_AGREE)).collect(Collectors.toList()).stream().map(AttendanceBusinessTravel::getTravelDuration).reduce(0.0, Double::sum));
|