|
|
@@ -1,5 +1,7 @@ |
|
|
|
package com.xueyi.system.staff.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.xueyi.common.core.utils.core.ObjectUtil; |
|
|
@@ -25,6 +27,7 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
@@ -143,12 +146,14 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DmEmpAttendancePo judgeAttendanceDescStatus(DmEmpAttendancePo po, Date checkDate){ |
|
|
|
public DmEmpAttendancePo judgeAttendanceDescStatus(DmEmpAttendancePo po, LocalDateTime checkDateTime){ |
|
|
|
SysDeptExt ext = sysDeptExtMapper.selectWorkTimeByDeptId(po.getDeptId()); |
|
|
|
if (null == po) { |
|
|
|
DmEmpAttendancePo ea = new DmEmpAttendancePo(); |
|
|
|
Date checkDate = MyDateUtils.localDateTimeToDate(checkDateTime); |
|
|
|
ea.setCheckInTime(checkDate); |
|
|
|
DmHolidayPo holidayPo = holidayService.isHoliday(checkDate); |
|
|
|
logger.info("考勤打卡时间1:{}", JSON.toJSONString(checkDateTime)); |
|
|
|
DmHolidayPo holidayPo = holidayService.isHoliday(checkDateTime.toLocalDate()); |
|
|
|
if (MyDateUtils.formatDate(checkDate, MyDateUtils.DEFAULT_TIME_PATTERN).compareTo(ext.getOnDutyHourEnd()) > 0) {//识别时间比考勤上班打卡最晚时间更晚 |
|
|
|
ea.setDescStatus(ATTENDANCE_STATUS_BE_LATER); // 迟到 |
|
|
|
if (holidayPo.getHoliday() == 1) { |
|
|
@@ -161,7 +166,8 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
} |
|
|
|
return ea; |
|
|
|
} |
|
|
|
DmHolidayPo holidayPo = holidayService.isHoliday(po.getCheckInTime()); |
|
|
|
logger.info("考勤打卡时间2:{}", JSON.toJSONString(checkDateTime)); |
|
|
|
DmHolidayPo holidayPo = holidayService.isHoliday(checkDateTime.toLocalDate()); |
|
|
|
if (holidayPo.getHoliday() == 1) {//如果是节假日 |
|
|
|
po.setDescStatus(ATTENDANCE_STATUS_OVERTIME);//加班 |
|
|
|
return po; |
|
|
@@ -211,8 +217,8 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
return ; |
|
|
|
} |
|
|
|
|
|
|
|
Date checkTime = MyDateUtils.localDateTimeToDate(checkRecords.getRecognizedTime()); |
|
|
|
String checkTimeDateStr = MyDateUtils.formatDate(checkTime, MyDateUtils.DEFAULT_DATE_PATTERN); |
|
|
|
LocalDateTime checkTime = checkRecords.getRecognizedTime(); |
|
|
|
String checkTimeDateStr = LocalDateTimeUtil.format(checkTime, MyDateUtils.DEFAULT_DATE_PATTERN); |
|
|
|
if (StringUtils.isEmpty(checkTimeDateStr)) { |
|
|
|
return ; |
|
|
|
} |
|
|
|