Commit 08e65041 authored by 赵啸非's avatar 赵啸非

添加定时删除七天前的人流数据

parent e1aa0d62
...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; ...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.springcloud.service.IApplicationStartedService; import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant; import com.mortals.xhx.common.key.Constant;
...@@ -18,11 +17,7 @@ import com.mortals.xhx.module.hik.event.model.req.sub.EventSubReq; ...@@ -18,11 +17,7 @@ import com.mortals.xhx.module.hik.event.model.req.sub.EventSubReq;
import com.mortals.xhx.module.hik.event.model.rsp.EventInfo; import com.mortals.xhx.module.hik.event.model.rsp.EventInfo;
import com.mortals.xhx.module.hik.event.service.IHikEventService; import com.mortals.xhx.module.hik.event.service.IHikEventService;
import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq; import com.mortals.xhx.module.hik.face.model.req.group.FaceGroupReq;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognListReq;
import com.mortals.xhx.module.hik.face.model.req.plan.PlanRecognReq;
import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo; import com.mortals.xhx.module.hik.face.model.rsp.group.FaceGroupDataInfo;
import com.mortals.xhx.module.hik.face.model.rsp.plan.PlanRecognInfo;
import com.mortals.xhx.module.hik.face.service.IHikFaceService; import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.hik.face.service.IHikPlanService; import com.mortals.xhx.module.hik.face.service.IHikPlanService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -33,10 +28,8 @@ import org.springframework.util.ObjectUtils; ...@@ -33,10 +28,8 @@ import org.springframework.util.ObjectUtils;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP; import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP;
import static com.mortals.xhx.common.key.ParamKey.PARAM_FACE_GROUP_REGISTER;
/** /**
* 初始化部分计划数据等 * 初始化部分计划数据等
......
...@@ -114,7 +114,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService { ...@@ -114,7 +114,7 @@ public class SyncAppointWaitAndFinTaskImpl implements ITaskExcuteService {
} }
cacheService.select(database);// cacheService.select(database);//
if (!ObjectUtils.isEmpty(waitPersonInfos)) { if (!ObjectUtils.isEmpty(waitPersonInfos)) {
log.info("waitPersonInfos:{}", JSON.toJSONString(waitPersonInfos)); // log.info("waitPersonInfos:{}", JSON.toJSONString(waitPersonInfos));
List<CareRecordsEntity> recordsEntityList = waitPersonInfos.stream().map(item -> { List<CareRecordsEntity> recordsEntityList = waitPersonInfos.stream().map(item -> {
CareRecordsEntity careRecordsEntity = new CareRecordsEntity(); CareRecordsEntity careRecordsEntity = new CareRecordsEntity();
careRecordsEntity.initAttrValue(); careRecordsEntity.initAttrValue();
......
...@@ -316,20 +316,21 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -316,20 +316,21 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
appointmentPersonQuery.setAppointmentStartTimeEnd(DateUtils.getCurrStrDate()); appointmentPersonQuery.setAppointmentStartTimeEnd(DateUtils.getCurrStrDate());
List<AppointmentPersonEntity> appointmentPersonEntities = appointmentPersonService.find(appointmentPersonQuery); List<AppointmentPersonEntity> appointmentPersonEntities = appointmentPersonService.find(appointmentPersonQuery);
if (!ObjectUtils.isEmpty(appointmentPersonEntities)) { if (!ObjectUtils.isEmpty(appointmentPersonEntities)) {
log.info("当天预约人数:{}", appointmentPersonEntities.size());
//将人脸同步添加到海康人脸库中,如果已经添加过的 则不添加 //将人脸同步添加到海康人脸库中,如果已经添加过的 则不添加
FaceGroupEntity faceGroup = faceGroupService.selectOne(new FaceGroupQuery().name(APPOINTMENT_GROUP)); FaceGroupEntity faceGroup = faceGroupService.selectOne(new FaceGroupQuery().name(APPOINTMENT_GROUP));
if (!ObjectUtils.isEmpty(faceGroup)) { if (!ObjectUtils.isEmpty(faceGroup)) {
//删除本地和远端人脸库,重新添加 todo //删除本地和远端人脸库,重新添加 todo
List<FaceGroupPersonEntity> delFacePerson = faceGroupPersonService.find(new FaceGroupPersonQuery().faceGroupId(faceGroup.getId())); List<FaceGroupPersonEntity> delFacePerson = faceGroupPersonService.find(new FaceGroupPersonQuery().faceGroupId(faceGroup.getId()));
if(!ObjectUtils.isEmpty(delFacePerson)){ if (!ObjectUtils.isEmpty(delFacePerson)) {
FaceReq faceRequest = new FaceReq(); FaceReq faceRequest = new FaceReq();
faceRequest.setFaceGroupIndexCode(faceGroup.getIndexCode()); faceRequest.setFaceGroupIndexCode(faceGroup.getIndexCode());
faceRequest.setIndexCodes(delFacePerson.stream().map(i -> i.getIndexCode()).collect(Collectors.toList())); faceRequest.setIndexCodes(delFacePerson.stream().map(i -> i.getIndexCode()).collect(Collectors.toList()));
Rest<Boolean> delRest = hikFaceService.faceSingleDel(faceRequest); Rest<Boolean> delRest = hikFaceService.faceSingleDel(faceRequest);
if (delRest.getCode()==YesNoEnum.YES.getValue()&&delRest.getData()) { if (delRest.getCode() == YesNoEnum.YES.getValue() && delRest.getData()) {
faceGroupPersonService.remove(delFacePerson.stream().map(i -> i.getId()).toArray(Long[]::new), null); faceGroupPersonService.remove(delFacePerson.stream().map(i -> i.getId()).toArray(Long[]::new), null);
}else{ } else {
log.info("人脸删除失败==》{}",JSON.toJSONString(delRest)); log.info("人脸删除失败==》{}", JSON.toJSONString(delRest));
return; return;
} }
} }
...@@ -364,6 +365,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -364,6 +365,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
FaceGroupPersonEntity faceGroupPersonEntity = new FaceGroupPersonEntity(); FaceGroupPersonEntity faceGroupPersonEntity = new FaceGroupPersonEntity();
faceGroupPersonEntity.initAttrValue(); faceGroupPersonEntity.initAttrValue();
faceGroupPersonEntity.setFaceGroupId(faceGroup.getId()); faceGroupPersonEntity.setFaceGroupId(faceGroup.getId());
faceGroupPersonEntity.setName(faceDataInfoRest.getData().getFaceInfo().getName());
faceGroupPersonEntity.setIndexCode(faceDataInfoRest.getData().getIndexCode()); faceGroupPersonEntity.setIndexCode(faceDataInfoRest.getData().getIndexCode());
faceGroupPersonEntity.setCreateTime(new Date()); faceGroupPersonEntity.setCreateTime(new Date());
faceGroupPersonEntity.setCreateUserId(1L); faceGroupPersonEntity.setCreateUserId(1L);
......
...@@ -57,7 +57,7 @@ public class StrangerRecoginze extends EventTypeAbstract { ...@@ -57,7 +57,7 @@ public class StrangerRecoginze extends EventTypeAbstract {
@Override @Override
public void saveEventData(EventsItem event) { public void saveEventData(EventsItem event) {
log.info("处理陌生人事件,event:{}", event.getEventId()); // log.info("处理陌生人事件,event:{}", event.getEventId());
EventData eventData = event.getData(); EventData eventData = event.getData();
//识别结果 //识别结果
FaceRecognitionResult faceRecognitionResult = eventData.getFaceRecognitionResult(); FaceRecognitionResult faceRecognitionResult = eventData.getFaceRecognitionResult();
......
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