Commit 22692cb7 authored by 赵啸非's avatar 赵啸非

取消前端时间间隔校验,由后端进行判断

parent 6e5aa6ba
......@@ -89,7 +89,6 @@ public class CalculateDayAttendTaskImpl implements ITaskExcuteService {
StaffEntity staffCache = staffService.getCache(staffId.toString());
if (!ObjectUtils.isEmpty(staffCache) && StaffSatusEnum.离职.getValue() != staffCache.getStatus()) {
//构建考勤记录 判断当前人是否离职,如果非离职 构建记录
AttendanceRecordHikEntity recordHikEntity = new AttendanceRecordHikEntity();
recordHikEntity.initAttrValue();
recordHikEntity.setStaffId(staffCache.getId());
......
......@@ -812,6 +812,31 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
@Override
public void buildSourceHikRecord(AttendanceRecordHikQuery recordHikQuery, Context context) {
syncDoorEvents(recordHikQuery);
deletFackRecord(recordHikQuery, context);
}
private void deletFackRecord(AttendanceRecordHikQuery recordHikQuery, Context context) {
//重新拉去的考勤记录,判断是否存在虚增的记录
log.info("开始删除虚增的记录!");
recordHikQuery.setEventSource("当日未有记录虚增考勤记录!");
List<AttendanceRecordHikEntity> fackAttendlist = this.find(recordHikQuery);
if(!ObjectUtils.isEmpty(fackAttendlist)){
log.info("虚增的记录:{}",fackAttendlist.size());
for (AttendanceRecordHikEntity recordHikEntity : fackAttendlist) {
//判断是否已经重新有新的当日数据,如果有 则删除当前虚增记录
AttendanceRecordHikQuery query = new AttendanceRecordHikQuery();
query.setStaffId(recordHikEntity.getStaffId());
query.setAttendanceDateStart(recordHikEntity.getAttendanceDateStart());
query.setAttendanceDateEnd(recordHikQuery.getAttendanceDateEnd());
query.setIdNotList(Arrays.asList(recordHikEntity.getId()));
int count = this.count(query, context);
if(count>0){
//删除当前虚增的记录
this.remove(recordHikEntity.getId(), context);
}
}
}
}
private void syncDoorEvents(AttendanceRecordHikQuery recordHikQuery) {
......
......@@ -72,8 +72,8 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"attendanceDateStart":"2024-02-01",
"attendanceDateEnd":"2024-03-01"
"attendanceDateStart":"2024-03-11",
"attendanceDateEnd":"2024-03-11"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment