| | |
| | |
|
| | | UserLevelWage userLevelWage = null;
|
| | | // 如果传递进来的日期在转正日期之前
|
| | | if(date1.before(date2)) {
|
| | | // 查询没转正且年月最大的数据
|
| | | userLevelWage = userLevelWageRepository.findByUserIdAndNoWorker(criteria.getUserId(), confirmationTime);
|
| | | } else {
|
| | | // 查询第二条转正且日期最大的数据
|
| | | userLevelWage = userLevelWageRepository.findByUserIdAndYesWorker(criteria.getUserId(), confirmationTime);
|
| | | }
|
| | | // if(date1.before(date2)) {
|
| | | // // 查询没转正且年月最大的数据
|
| | | // userLevelWage = userLevelWageRepository.findByUserIdAndNoWorker(criteria.getUserId(), confirmationTime);
|
| | | // } else {
|
| | | // // 查询第二条转正且日期最大的数据
|
| | | // userLevelWage = userLevelWageRepository.findByUserIdAndYesWorker(criteria.getUserId(), confirmationTime);
|
| | | // }
|
| | |
|
| | | // 获取小于等于当前月份且日期最大的数据。
|
| | | userLevelWage = userLevelWageRepository.findByUserCurrentLevelWage(criteria.getUserId(), yearMonth);
|
| | |
|
| | | // UserLevelWage userLevelWage = userLevelWageRepository.findbyUserIdAndDate(criteria.getUserId(), yearMonth);
|
| | |
|
| | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
| | | LocalDateTime dateTime = LocalDateTime.parse(criteria.getTargetYearMonth(), formatter);
|
| | | // 获取月初日期
|
| | | LocalDateTime firstDayOfMonth = dateTime.withDayOfMonth(1);
|
| | | LocalDateTime firstDayOfMonth = dateTime.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
| | | // 获取下月初日期
|
| | | LocalDateTime firstDayOfNextMonth = firstDayOfMonth.plusMonths(1);
|
| | | LocalDateTime lastDayOfMonth = firstDayOfMonth.plusMonths(1).minusDays(1).withHour(23).withMinute(59).withSecond(59).withNano(0);
|
| | |
|
| | | // 查询指定员工的加班补助金额工资
|
| | | Double overTimeSalary = attendanceOvertimeRepository.findByUserIdAndYearMonth(criteria.getUserId(), firstDayOfMonth, firstDayOfNextMonth);
|
| | | Double overTimeSalary = attendanceOvertimeRepository.findByUserIdAndYearMonth(criteria.getUserId(), DateUtil.parseAttStartTime(firstDayOfMonth), DateUtil.parseAttEndTime(lastDayOfMonth));
|
| | |
|
| | | // 查询配置表
|
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("加班补助金额");
|
| | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
| | | LocalDateTime dateTime = LocalDateTime.parse(criteria.getTargetYearMonth(), formatter);
|
| | | // 获取月初日期
|
| | | LocalDateTime firstDayOfMonth = dateTime.withDayOfMonth(1);
|
| | | // 获取下月初日期
|
| | | LocalDateTime firstDayOfNextMonth = firstDayOfMonth.plusMonths(1);
|
| | | LocalDateTime firstDayOfMonth = dateTime.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
|
| | | // 获取月末最后一天日期
|
| | | LocalDateTime lastDayOfMonth = firstDayOfMonth.plusMonths(1).minusDays(1).withHour(23).withMinute(59).withSecond(59).withNano(0);
|
| | |
|
| | | // 查询出差表的记录
|
| | | List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.findByUserIdAndYearMonth(criteria.getUserId(), firstDayOfMonth, firstDayOfNextMonth);
|
| | | List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.findByUserAndSEDate(criteria.getUserId(), firstDayOfMonth, lastDayOfMonth);
|
| | | // TODO:因一天可填多条出差记录,每条最小的时长是0.5天,导致可能会有当天总时长超出1天的情况。(每天出差类型只会有一种,不考虑多种的情况)
|
| | | List<AttendanceBusinessTravel> calcAttendanceBusinessTravelList = attendanceBusinessTravelList.stream().collect(Collectors.groupingBy(
|
| | | (AttendanceBusinessTravel businessTravel) -> businessTravel.getTravelStartTime().toLocalDateTime().toLocalDate().toString(),
|