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

修改 请假记录 每人考勤显示

parent aaba4a11
......@@ -87,8 +87,6 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
userEntity.setCreateTime(new Date());
context.setUser(userEntity);
AttendanceRecordHikQuery recordHikQuery = new AttendanceRecordHikQuery();
// Date todayStart = DateUtil.offsetHour(new Date(), -5).toJdkDate();
// recordHikQuery.setAttendanceDateStart(DateUtils.getCurrStrDate());
recordHikQuery.setAttendanceDateStart(DateUtil.today());
recordHikQuery.setAttendanceDateEnd(DateUtil.today());
try {
......
......@@ -78,7 +78,7 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
hikQuery.setAttendanceDateEnd(DateUtil.today());
if (!ObjectUtils.isEmpty(hikhost)) {
recordHikService.syncDoorEvents(hikQuery);
recordHikService.deletFakeRecord(hikQuery, null);
//recordHikService.deletFakeRecord(hikQuery, null);
} else {
log.info("同步设备上门禁事件!");
HikDoorEventReq hikDoorEventReq = new HikDoorEventReq();
......@@ -88,7 +88,7 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
for (DoorEntity doorEntity : doorEntities) {
doorService.syncDoorDeviceEvents(doorEntity, hikDoorEventReq);
}
recordHikService.deletFakeRecord(hikQuery, null);
// recordHikService.deletFakeRecord(hikQuery, null);
}
}
}
......
......@@ -635,7 +635,6 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
public void homeStat(Context context) throws AppException {
HomeStatInfo homeStatInfo = new HomeStatInfo();
StaffQuery staffQuery = new StaffQuery();
staffQuery.setStatusNotList(Arrays.asList(3));
......@@ -649,32 +648,16 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
homeStatInfo.setTotalDeptNum(totalDeptNum);
AttendanceRecordHikQuery hikQuery = new AttendanceRecordHikQuery();
/* hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.today()); */
hikQuery.setAttendanceDateStart(DateUtil.yesterday().toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.yesterday().toDateStr());
AttendanceRecordQuery attendanceRecordQuery = new AttendanceRecordQuery();
// attendanceRecordQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
//attendanceRecordQuery.setAttendanceDateEnd(DateUtil.today());
attendanceRecordQuery.setAttendanceDateStart(DateUtil.yesterday().toDateStr());
attendanceRecordQuery.setAttendanceDateEnd(DateUtil.yesterday().toDateStr());
List<AttendanceRecordEntity> attendanceRecordEntities = recordService.find(attendanceRecordQuery);
//获取当月打卡人数,如果存在
/* Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), Long.class);
if (ObjectUtils.isEmpty(totalCache)) {
totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache);
}*/
/* Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), Long.class);
if (ObjectUtils.isEmpty(totalCache)) {
totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), totalCache);
}*/
//迟到次数
......
......@@ -112,9 +112,7 @@ public class DoorServiceImpl extends AbstractCRUDServiceImpl<DoorDao, DoorEntity
recordHikEntity.setPositionName(staffCache.getPositionName());
recordHikEntity.setAttendanceDate(attendDate);
// recordHikEntity.setAttendanceAddress(item.getDoorName());
recordHikEntity.setEventSource("门禁点");
//recordHikEntity.setRemark(item.getEventId());
recordHikEntity.setCreateTime(new Date());
recordHikEntity.setCreateUserName("系统管理员");
recordHikEntity.setCreateUserId(1L);
......
......@@ -59,12 +59,9 @@ public class HikDoorServiceImpl extends AbstractHikService implements IHikDoorSe
@Override
public Rest<List<EventInfo>> searchDoorEventsList(HikDoorEventReq hikDoorEventReq, DoorEntity doorEntity) {
HCNetSDK hCNetSDK = createSDKInstance();
//initLoadSdk(hCNetSDK);
int userID = login(hCNetSDK, doorEntity);
log.info("userID==>{}",userID);
List<EventInfo> eventInfoList = new ArrayList<>();
int i = 0; //事件条数
......@@ -75,9 +72,6 @@ public class HikDoorServiceImpl extends AbstractHikService implements IHikDoorSe
struAcsEventCond.dwMajor = 5; // 主次事件类型设为0,代表查询所有事件
struAcsEventCond.dwMinor = 0; //
log.info("searchDoorEventsList req==>{}", JSON.toJSONString(hikDoorEventReq));
Date startTime = hikDoorEventReq.getStartTime();
Date endTime = hikDoorEventReq.getEndTime();
......@@ -111,6 +105,7 @@ public class HikDoorServiceImpl extends AbstractHikService implements IHikDoorSe
struAcsEventCfg.dwSize = struAcsEventCfg.size();
struAcsEventCfg.write();
Pointer ptrStruEventCfg = struAcsEventCfg.getPointer();
int recount=0;
while (true) {
int dwEventSearch = hCNetSDK.NET_DVR_GetNextRemoteConfig(m_lSearchEventHandle, ptrStruEventCfg, struAcsEventCfg.size());
if (dwEventSearch <= -1) {
......@@ -119,8 +114,10 @@ public class HikDoorServiceImpl extends AbstractHikService implements IHikDoorSe
}
if (dwEventSearch == HCNetSDK.NET_SDK_GET_NEXT_STATUS_NEED_WAIT) {
log.info("配置等待....");
recount++;
if(recount>5) break;
try {
Thread.sleep(10);
Thread.sleep(1000);
} catch (InterruptedException e) {
}
......
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