BAOLH
2025-07-31 ade08ca12e523e2824b6afd83e7a047ce6c39d44
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
@@ -277,7 +277,7 @@
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getStartClockResults(), attendance.getActualWorkStartTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1)));
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1, null)));
                            } else {
                                attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -294,7 +294,7 @@
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getEndClockResults(), attendance.getActualWorkEndTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2)));
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2, LocalDate.parse(startAttendDate))));
                            } else {
                                attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -416,7 +416,7 @@
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getStartClockResults(), attendance.getActualWorkStartTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1)));
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1, null)));
                            } else {
                                attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -433,7 +433,7 @@
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getEndClockResults(), attendance.getActualWorkEndTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2)));
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2, LocalDate.parse(startAttendDate))));
                            } else {
                                attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -814,17 +814,20 @@
     *
     * @param sysRostering
     * @param timestamp
     * @param type
     * @param type / 1上班打卡。2下班打卡。
     * @param attendanceDate / 考勤日期当天(下班打卡使用)
     * @return
     */
    public String checkResult(SysRostering sysRostering, Timestamp timestamp, Integer type) {
    public String checkResult(SysRostering sysRostering, Timestamp timestamp, Integer type, LocalDate attendanceDate) {
        String result = ObjectUtil.isEmpty(timestamp) ? Constant.ATTENDANCE_STATE_NOTSIGNED : Constant.ATTENDANCE_STATE_NORMAL;
        if (type.equals(1)) {
            // 上班打卡
            if (timestamp.toLocalDateTime().toLocalTime().isAfter(sysRostering.getWorkStartTime())) {
                result = Constant.ATTENDANCE_START_LATE;
            }
        } else {
            if (timestamp.toLocalDateTime().toLocalTime().isBefore(sysRostering.getWorkEndTime())) {
            // 下班打卡
            if (timestamp.toLocalDateTime().toLocalTime().isBefore(sysRostering.getWorkEndTime()) && (attendanceDate != null ? !timestamp.toLocalDateTime().toLocalDate().isAfter(attendanceDate) : true)) {
                result = Constant.ATTENDANCE_START_EARLY;
            }
        }