|
@@ -184,7 +184,22 @@ public class WorkAttendanceServiceImpl implements WorkAttendanceService {
|
|
List<WorkAttendance> workAttendances = workAttendanceDAO.findByPeriod(personId,alarmConfig.getId(),recordTime.toDate());
|
|
List<WorkAttendance> workAttendances = workAttendanceDAO.findByPeriod(personId,alarmConfig.getId(),recordTime.toDate());
|
|
|
|
|
|
if (workAttendances.size()>0){
|
|
if (workAttendances.size()>0){
|
|
- continue;
|
|
|
|
|
|
+ //可能存在考勤机离线后没有实时传输回打卡记录,这时需要判断数据库中已有该时间段打卡时间<当前打卡时间的数量
|
|
|
|
+ long count = workAttendances.stream().filter(item->item.getRecordTime().compareTo(recordDate)<0).count();
|
|
|
|
+
|
|
|
|
+ if (count==0){
|
|
|
|
+ //说明当前打卡时间更早,故删除现有该时间段打卡记录
|
|
|
|
+ for (WorkAttendance workAttendance : workAttendances) {
|
|
|
|
+ workAttendance.setDelFlag(true);
|
|
|
|
+ workAttendance.setUpdateTime(new Date());
|
|
|
|
+
|
|
|
|
+ workAttendanceDAO.update(workAttendance);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ //数据库中已有该时间段打卡时间<当前打卡时间,则忽略当前考勤记录
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|