| | |
| | | import me.zhengjie.modules.system.repository.SysConfigHolidayRepository;
|
| | | import me.zhengjie.modules.system.repository.SysRosteringRepository;
|
| | | import me.zhengjie.modules.system.repository.UserRepository;
|
| | | import me.zhengjie.utils.StringUtils;
|
| | | import org.apache.commons.lang3.ObjectUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | }
|
| | | // 早打卡
|
| | | if ("OnDuty".equals(oapiDingTalkRecordResult.getCheckType())) {
|
| | | // 补充上班补卡记录
|
| | | if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && !isHoliday && (attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
|
| | | cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
|
| | | }
|
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getStartClockResults(), attendance.getActualWorkStartTime());
|
| | | // 考勤记录
|
| | |
| | | }
|
| | | // 晚打卡
|
| | | if ("OffDuty".equals(oapiDingTalkRecordResult.getCheckType())) {
|
| | | // 补充下班补卡记录
|
| | | if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && !isHoliday && (attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
|
| | | cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
|
| | | }
|
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getEndClockResults(), attendance.getActualWorkEndTime());
|
| | | // 考勤记录
|
| | |
| | | }
|
| | | // 早打卡
|
| | | if ("OnDuty".equals(oapiDingTalkRecordResult.getCheckType())) {
|
| | | // 补充上班补卡记录
|
| | | if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && !isHoliday && (attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
|
| | | cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
|
| | | }
|
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getStartClockResults(),attendance.getActualWorkStartTime());
|
| | | // 考勤记录
|
| | |
| | | }
|
| | | // 晚打卡
|
| | | if ("OffDuty".equals(oapiDingTalkRecordResult.getCheckType())) {
|
| | | // 补充下班补卡记录
|
| | | if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && !isHoliday && (attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
|
| | | cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
|
| | | }
|
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getEndClockResults(),attendance.getActualWorkEndTime());
|
| | | // 考勤记录
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 补充补卡记录
|
| | | *
|
| | | * @param userId / 用户ID
|
| | | * @param checkTime / 补卡日期(yyyy-MM-dd)
|
| | | * @param type / 补卡区分
|
| | | * @param attendance / 考勤记录
|
| | | */
|
| | | public void cardDatetimeSupplement(Long userId, String checkTime, String type, Attendance attendance) {
|
| | | if (ObjectUtils.isNotEmpty(checkTime) && StringUtils.isNotBlank(type)) {
|
| | | // 查询补卡记录
|
| | | AttendanceCardreplacement attendanceCardreplacement = attendanceCardreplacementRepository.findByUserIdAndDateAndType(userId, checkTime, type);
|
| | | if (ObjectUtils.isNotEmpty(attendanceCardreplacement)) {
|
| | | if (Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON.equals(type)) {
|
| | | attendance.setActualWorkStartTime(attendanceCardreplacement.getCardReplacementTime());
|
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NORMAL);
|
| | | } else if (Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF.equals(type)) {
|
| | | attendance.setActualWorkEndTime(attendanceCardreplacement.getCardReplacementTime());
|
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NORMAL);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|