| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | * |
| | | * @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; |
| | | } |
| | | } |