|
|
@@ -148,9 +148,9 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
|
|
|
|
public DmEmpAttendancePo judgeAttendanceDescStatus(DmEmpAttendancePo po, LocalDateTime checkDateTime){ |
|
|
|
SysDeptExt ext = sysDeptExtMapper.selectWorkTimeByDeptId(po.getDeptId()); |
|
|
|
Date checkDate = MyDateUtils.localDateTimeToDate(checkDateTime); |
|
|
|
if (null == po) { |
|
|
|
DmEmpAttendancePo ea = new DmEmpAttendancePo(); |
|
|
|
Date checkDate = MyDateUtils.localDateTimeToDate(checkDateTime); |
|
|
|
ea.setCheckInTime(checkDate); |
|
|
|
logger.info("考勤打卡时间1:{}", JSON.toJSONString(checkDateTime)); |
|
|
|
DmHolidayPo holidayPo = holidayService.isHoliday(checkDateTime.toLocalDate()); |
|
|
@@ -167,6 +167,11 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
return ea; |
|
|
|
} |
|
|
|
logger.info("考勤打卡时间2:{}", JSON.toJSONString(checkDateTime)); |
|
|
|
if (po.getCheckInTime() == null){ |
|
|
|
po.setCheckInTime(checkDate); |
|
|
|
} else { |
|
|
|
po.setCheckOutTime(checkDate); |
|
|
|
} |
|
|
|
DmHolidayPo holidayPo = holidayService.isHoliday(checkDateTime.toLocalDate()); |
|
|
|
if (holidayPo.getHoliday() == 1) {//如果是节假日 |
|
|
|
po.setDescStatus(ATTENDANCE_STATUS_OVERTIME);//加班 |
|
|
@@ -174,10 +179,7 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
} |
|
|
|
logger.info("deptId:{}", po.getDeptId()); |
|
|
|
logger.info("ext:start-end:{} end-start:{}" ,ext.getOnDutyHourEnd(), ext.getOffDutyHourStart()); |
|
|
|
if (po.getCheckInTime() == null && po.getCheckOutTime()== null) {//正常不会走这个流程 |
|
|
|
po.setDescStatus(ATTENDANCE_STATUS_ABSENCE); |
|
|
|
return po; |
|
|
|
} else if (po.getCheckInTime() != null && po.getCheckOutTime()== null) {//第一次打卡 |
|
|
|
if (po.getCheckInTime() != null && po.getCheckOutTime()== null) {//第一次打卡 |
|
|
|
if (MyDateUtils.formatDate(po.getCheckInTime(), MyDateUtils.DEFAULT_TIME_PATTERN).compareTo(ext.getOnDutyHourEnd()) > 0) {//识别时间比考勤上班打卡最晚时间更晚 |
|
|
|
po.setDescStatus(ATTENDANCE_STATUS_LATER_AND_EARLY); |
|
|
|
} else { |
|
|
|