| | |
| | | throw new RuntimeException(errorMessage);
|
| | | }
|
| | | }
|
| | | // 更新打卡状态为等待的用户考勤信息
|
| | | public void checkAttendanceStatus(List<Long> userList, String targetYearMonth) throws Exception {
|
| | | // 考勤查询类
|
| | | AttendanceQueryCriteria attendanceQueryCriteriaStart = new AttendanceQueryCriteria();
|
| | | attendanceQueryCriteriaStart.setUserIds(userList);
|
| | | attendanceQueryCriteriaStart.setAttendanceDateLike(targetYearMonth.substring(0, 7));
|
| | | attendanceQueryCriteriaStart.setStartClockResults(Constant.ATTENDANCE_STATE_WAITFOR);
|
| | | // 获取早打卡状态为等待的考勤记录
|
| | | List<AttendanceDto> attendanceListStart = attendanceService.queryAll(attendanceQueryCriteriaStart);
|
| | | AttendanceQueryCriteria attendanceQueryCriteriaEnd = new AttendanceQueryCriteria();
|
| | | attendanceQueryCriteriaEnd.setUserIds(userList);
|
| | | attendanceQueryCriteriaEnd.setAttendanceDateLike(targetYearMonth.substring(0, 7));
|
| | | attendanceQueryCriteriaEnd.setEndClockResults(Constant.ATTENDANCE_STATE_WAITFOR);
|
| | | // 获取晚打卡状态为等待的考勤记录
|
| | | List<AttendanceDto> attendanceListEnd = attendanceService.queryAll(attendanceQueryCriteriaEnd);
|
| | | // 合并考勤记录
|
| | | if (!attendanceListEnd.isEmpty() || !attendanceListStart.isEmpty()) {
|
| | | attendanceListStart.addAll(attendanceListEnd);
|
| | | // 去重
|
| | | attendanceListStart = attendanceListStart.stream().distinct().collect(Collectors.toList());
|
| | | // 拉取考勤信息
|
| | | for (AttendanceDto attendance : attendanceListStart) {
|
| | | weComService.getWeComAttendanceListOfNight(String.valueOf(attendance.getAttendanceDate()).substring(0, 10), Collections.singletonList(userRepository.findById(attendance.getUserId()).orElseGet(User::new)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Double getMeritWage(Double completedAchievementsHoursRate, Long level) {
|
| | |
| | | // 返回
|
| | | return newSalary;
|
| | | }
|
| | |
|
| | | // 更新打卡状态为等待的用户考勤信息
|
| | | private void checkAttendanceStatus(List<Long> userList, String targetYearMonth) throws Exception {
|
| | | // 考勤查询类
|
| | | AttendanceQueryCriteria attendanceQueryCriteriaStart = new AttendanceQueryCriteria();
|
| | | attendanceQueryCriteriaStart.setUserIds(userList);
|
| | | attendanceQueryCriteriaStart.setAttendanceDateLike(targetYearMonth.substring(0, 7));
|
| | | attendanceQueryCriteriaStart.setStartClockResults(Constant.ATTENDANCE_STATE_WAITFOR);
|
| | | // 获取早打卡状态为等待的考勤记录
|
| | | List<AttendanceDto> attendanceListStart = attendanceService.queryAll(attendanceQueryCriteriaStart);
|
| | | AttendanceQueryCriteria attendanceQueryCriteriaEnd = new AttendanceQueryCriteria();
|
| | | attendanceQueryCriteriaEnd.setUserIds(userList);
|
| | | attendanceQueryCriteriaEnd.setAttendanceDateLike(targetYearMonth.substring(0, 7));
|
| | | attendanceQueryCriteriaEnd.setEndClockResults(Constant.ATTENDANCE_STATE_WAITFOR);
|
| | | // 获取晚打卡状态为等待的考勤记录
|
| | | List<AttendanceDto> attendanceListEnd = attendanceService.queryAll(attendanceQueryCriteriaEnd);
|
| | | // 合并考勤记录
|
| | | if (!attendanceListEnd.isEmpty() || !attendanceListStart.isEmpty()) {
|
| | | attendanceListStart.addAll(attendanceListEnd);
|
| | | // 去重
|
| | | attendanceListStart = attendanceListStart.stream().distinct().collect(Collectors.toList());
|
| | | // 拉取考勤信息
|
| | | for (AttendanceDto attendance : attendanceListStart) {
|
| | | weComService.getWeComAttendanceListOfNight(String.valueOf(attendance.getAttendanceDate()).substring(0, 10), Collections.singletonList(userRepository.findById(attendance.getUserId()).orElseGet(User::new)));
|
| | | }
|
| | | }
|
| | | }
|
| | | // ==================== 以上为定时生成工资记录主要逻辑 ====================
|
| | | } |