Commit e757c596 authored by 赵啸非's avatar 赵啸非

修改考勤汇总

parent 53a4b33d
...@@ -130,7 +130,6 @@ public class TestController { ...@@ -130,7 +130,6 @@ public class TestController {
} }
private void getDoorEvents(Rest<DoorEventDataInfo> doorEventsRest) { private void getDoorEvents(Rest<DoorEventDataInfo> doorEventsRest) {
//同步当前考勤数据 //同步当前考勤数据
List<AttendanceRecordHikEntity> attRecords = doorEventsRest.getData().getList().stream().map(item -> { List<AttendanceRecordHikEntity> attRecords = doorEventsRest.getData().getList().stream().map(item -> {
...@@ -138,7 +137,7 @@ public class TestController { ...@@ -138,7 +137,7 @@ public class TestController {
recordHikEntity.initAttrValue(); recordHikEntity.initAttrValue();
StaffEntity staffCache = staffService.getExtCache(StrUtil.padPre(item.getJobNo(), 8, "0")); StaffEntity staffCache = staffService.getExtCache(StrUtil.padPre(item.getJobNo(), 8, "0"));
if (ObjectUtils.isEmpty(staffCache)) { if (ObjectUtils.isEmpty(staffCache)) {
log.info("staff is null !staffCode:{}",item.getJobNo()); log.info("staff is null !staffCode:{}", item.getJobNo());
return null; return null;
} }
...@@ -158,12 +157,15 @@ public class TestController { ...@@ -158,12 +157,15 @@ public class TestController {
recordHikEntity.setCreateUserName("system"); recordHikEntity.setCreateUserName("system");
recordHikEntity.setCreateUserId(1L); recordHikEntity.setCreateUserId(1L);
return recordHikEntity; return recordHikEntity;
}).filter(f->f!=null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
log.info("attRecords size:{}", attRecords.size()); log.info("attRecords size:{}", attRecords.size());
if (!ObjectUtils.isEmpty(attRecords)) { if (!ObjectUtils.isEmpty(attRecords)) {
recordHikService.save(attRecords); for (AttendanceRecordHikEntity attRecord : attRecords) {
recordHikService.save(attRecord);
}
} }
/* /*
......
...@@ -8,7 +8,7 @@ import java.util.Map; ...@@ -8,7 +8,7 @@ import java.util.Map;
public abstract class AbstractHikService { public abstract class AbstractHikService {
@Value("${hik.host:''}") @Value("${hik.host:}")
protected String host; protected String host;
@Value("${hik.appKey:''}") @Value("${hik.appKey:''}")
......
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