BAOLH
2026-07-15 511bf59bf1b6d2d1a3865ddabd3a973267147ce2
工资生成业务层函数位置迁移
1 files modified
53 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/NewSalaryServiceImpl.java 53 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/impl/NewSalaryServiceImpl.java
@@ -386,32 +386,6 @@
            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) {
@@ -892,5 +866,32 @@
        // 返回
        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)));
            }
        }
    }
    // ==================== 以上为定时生成工资记录主要逻辑 ====================
}