Pārlūkot izejas kodu

1,fix 考勤bug

tags/B.2.6.7_20240112_base
yk pirms 1 gada
vecāks
revīzija
0bde42e9f9
1 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. +7
    -5
      xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/staff/service/impl/DmStaffServiceImpl.java

+ 7
- 5
xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/staff/service/impl/DmStaffServiceImpl.java Parādīt failu

@@ -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 {


Notiek ielāde…
Atcelt
Saglabāt