| | |
| | | // 企微打卡数据 |
| | | weComRecordResult.setCheckinTime(null); |
| | | } |
| | | Timestamp checkInTime = unixtimeToTimestamp(weComRecordResult.getCheckinTime()); |
| | | // 早打卡 |
| | | if ("上班打卡".equals(weComRecordResult.getCheckinType())) { |
| | | // 调用验证状态方法 |
| | | 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(), new Timestamp(weComRecordResult.getCheckinTime() * 1000), 1))); |
| | | attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1))); |
| | | } else { |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | } |
| | | attendance.setStartLocationResults(flag == true ? attendance.getStartLocationResults() : setLocationResults(weComRecordResult.getExceptionType())); |
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : new Timestamp(weComRecordResult.getCheckinTime() * 1000)); |
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : checkInTime); |
| | | } |
| | | // 晚打卡 |
| | | if ("下班打卡".equals(weComRecordResult.getCheckinType())) { |
| | |
| | | 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(), new Timestamp(weComRecordResult.getCheckinTime() * 1000), 2))); |
| | | attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2))); |
| | | } else { |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | } |
| | | attendance.setEndLocationResults(flag == true ? attendance.getEndLocationResults() : setLocationResults(weComRecordResult.getExceptionType())); |
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : new Timestamp(weComRecordResult.getCheckinTime() * 1000)); |
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : checkInTime); |
| | | } |
| | | } |
| | | // 修改考勤打卡状态 |
| | |
| | | // 企微打卡数据 |
| | | weComRecordResult.setCheckinTime(null); |
| | | } |
| | | Timestamp checkInTime = unixtimeToTimestamp(weComRecordResult.getCheckinTime()); |
| | | // 早打卡 |
| | | if ("上班打卡".equals(weComRecordResult.getCheckinType())) { |
| | | // 调用验证状态方法 |
| | | 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(), new Timestamp(weComRecordResult.getCheckinTime() * 1000), 1))); |
| | | attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1))); |
| | | } else { |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | } |
| | | attendance.setStartLocationResults(flag == true ? attendance.getStartLocationResults() : setLocationResults(weComRecordResult.getExceptionType())); |
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : new Timestamp(weComRecordResult.getCheckinTime() * 1000)); |
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : checkInTime); |
| | | } |
| | | // 晚打卡 |
| | | if ("下班打卡".equals(weComRecordResult.getCheckinType())) { |
| | |
| | | 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(), new Timestamp(weComRecordResult.getCheckinTime() * 1000), 2))); |
| | | attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2))); |
| | | } else { |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | } |
| | | attendance.setEndLocationResults(flag == true ? attendance.getEndLocationResults() : setLocationResults(weComRecordResult.getExceptionType())); |
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : new Timestamp(weComRecordResult.getCheckinTime() * 1000)); |
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : checkInTime); |
| | | } |
| | | } |
| | | // 修改考勤打卡状态 |
| | |
| | | } |
| | | return duration; |
| | | } |
| | | |
| | | private Timestamp unixtimeToTimestamp(Long unixtime) { |
| | | if (ObjectUtils.isNotEmpty(unixtime)) { |
| | | return new Timestamp(unixtime * 1000); |
| | | } |
| | | return null; |
| | | } |
| | | } |