diff --git a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateAppointPersonToHikBlackPlanByDayTaskImpl.java b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateAppointPersonToHikBlackPlanByDayTaskImpl.java index d594c0ba8ceefc871bfe9a70abbd1512f62eb83c..0ac96df7692d48a426780f0562dab0f3571b4d75 100644 --- a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateAppointPersonToHikBlackPlanByDayTaskImpl.java +++ b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateAppointPersonToHikBlackPlanByDayTaskImpl.java @@ -26,31 +26,12 @@ import org.springframework.stereotype.Service; * @date: 2023/5/9 13:44 */ @Slf4j -//@Service("CreateAppointPersonToHikBlackPlanByDay") +@Service("CreateAppointPersonToHikBlackPlanByDay") public class CreateAppointPersonToHikBlackPlanByDayTaskImpl implements ITaskExcuteService { - @Autowired - private PersonService personService; - @Autowired - private IHikFaceService hikFaceService; - @Autowired - private IHikPlanService hikPlanService; - @Autowired - private DeviceService deviceService; @Autowired private FacePlanService facePlanService; - @Autowired - private UploadService uploadService; - @Autowired - private FaceGroupService faceGroupService; - @Autowired - private FaceGroupPersonService faceGroupPersonService; - @Autowired - private AppointmentPersonService appointmentPersonService; - @Autowired - private AppointmentConfigService appointmentConfigService; - @Autowired - private AppointmentConfigTimesService appointmentConfigTimesService; + @Override public void excuteTask(ITask task) throws AppException { @@ -60,160 +41,6 @@ public class CreateAppointPersonToHikBlackPlanByDayTaskImpl implements ITaskExcu log.info("鍒涘缓姣忔棩棰勭害浜虹兢瀹屾垚"); } - - private void createAppointmentPersonByDay() { - - facePlanService.createAppointmentPersonByDay(); - - /* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq(); - Rest<List<PlanRecognInfo>> planRecognBlackRest = hikPlanService.findPlanRecognBlackList(planRecognBlackListReq); - if (planRecognBlackRest.getCode() == YesNoEnum.YES.getValue()) { - List<PlanRecognInfo> delPlanList = planRecognBlackRest.getData().stream().map(i -> { - if (StrUtil.startWith(i.getName(), Constant.APPOINTMENT_PLAN_PREFIX) && !i.getName().equals(Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate())) { - return i; - } - return null; - }).filter(f -> f != null).collect(Collectors.toList()); - if (!ObjectUtils.isEmpty(delPlanList)) { - //鍒犻櫎璁″垝 - PlanRecognReq planRecognBlackReq = new PlanRecognReq(); - planRecognBlackReq.setRecognitionResourceIndexCodes(delPlanList.stream().map(i -> i.getIndexCode()).collect(Collectors.toList())); - Rest<Boolean> delRest = hikPlanService.planRecognBlackDel(planRecognBlackReq); - if (delRest.getCode() == YesNoEnum.YES.getValue() && delRest.getData()) { - log.info("棰勭害璁″垝鍒犻櫎鎴愬姛锛�"); - } - } - } - log.info("姣忔棩鍒涘缓棰勭害浜哄憳鐩戞帶璁″垝"); - //鑾峰彇褰撳ぉ棰勭害 - AppointmentPersonQuery appointmentPersonQuery = new AppointmentPersonQuery(); - appointmentPersonQuery.setAppointmentStartTimeStart(DateUtils.getCurrStrDate()); - appointmentPersonQuery.setAppointmentStartTimeEnd(DateUtils.getCurrStrDate()); - List<AppointmentPersonEntity> appointmentPersonEntities = appointmentPersonService.find(appointmentPersonQuery); - if (!ObjectUtils.isEmpty(appointmentPersonEntities)) { - //鍒涘缓浜鸿劯鍒嗙粍 - String group = Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate(); - FaceGroupEntity faceGroup = faceGroupService.selectOne(new FaceGroupQuery().name(group)); - if (ObjectUtils.isEmpty(faceGroup)) { - //鍒涘缓鍒嗙粍 - log.info("鍒涘缓浜鸿劯鍒嗙粍..."); - FaceGroupReq faceGroupReq = new FaceGroupReq(); - faceGroupReq.setName(group); - faceGroupReq.setDescription(group); - Rest<FaceGroupEntity> rest = faceGroupService.saveFaceGroupToHik(faceGroupReq); - if (rest.getCode() == YesNoEnum.YES.getValue()) { - FaceGroupEntity newFaceGroupEntity = rest.getData(); - //鍒涘缓浜鸿劯tohik - for (AppointmentPersonEntity appointmentPersonEntity : appointmentPersonEntities) { - PersonEntity personEntity = personService.getCache(appointmentPersonEntity.getPersonId().toString()); - if (ObjectUtils.isEmpty(personEntity)) { - log.info("娉ㄥ唽浜哄憳鏈┖锛宲ersionId:{}", appointmentPersonEntity.getPersonId()); - continue; - } - //鏌ヨ鍥剧墖骞惰浆鎴恇ase64 - if (!ObjectUtils.isEmpty(personEntity.getPhoto())) { - String filePath = uploadService.getFilePath(personEntity.getPhoto()); - byte[] bytes = FileUtil.readBytes(filePath); - if (bytes.length > 0) { - String picBase64Data = Base64.encode(bytes); - FaceReq faceReq = new FaceReq(); - FaceInfo faceInfo = new FaceInfo(); - faceInfo.setName(personEntity.getName()); - faceInfo.setSex(personEntity.getGender() == GenderEnum.鐢�.getValue() ? "1" : "2"); - faceInfo.setCertificateType("111"); - faceInfo.setCertificateNum(personEntity.getIdCard()); - faceReq.setFaceInfo(faceInfo); - FacePic facePic = new FacePic(); - facePic.setFaceBinaryData(picBase64Data); - faceReq.setFacePic(facePic); - faceReq.setFaceGroupIndexCode(faceGroup.getIndexCode()); - Rest<FaceDataInfo> faceDataInfoRest = hikFaceService.faceSingleAdd(faceReq); - if (faceDataInfoRest.getCode() == YesNoEnum.YES.getValue()) { - //浜鸿劯娣诲姞鎴愬姛锛屼繚瀛樹汉鑴哥粍 - FaceGroupPersonEntity faceGroupPersonEntity = new FaceGroupPersonEntity(); - faceGroupPersonEntity.initAttrValue(); - faceGroupPersonEntity.setFaceGroupId(newFaceGroupEntity.getId()); - faceGroupPersonEntity.setIndexCode(faceDataInfoRest.getData().getIndexCode()); - faceGroupPersonEntity.setCreateTime(new Date()); - faceGroupPersonEntity.setCreateUserId(1L); - faceGroupPersonService.save(faceGroupPersonEntity); - } else { - log.info("娣诲姞浜鸿劯寮傚父=>{}", faceDataInfoRest.getMsg()); - } - } else { - log.info("鍥剧墖鏁版嵁涓虹┖锛宖ilePath=>{}", filePath); - } - } else { - log.info("浜哄憳鍥剧墖photo涓虹┖锛宲erson=>{}", personEntity.getName()); - } - } - - log.info("娣诲姞褰撳ぉ棰勭害鐩戞帶璁″垝"); - String appointPlanName = Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate(); - int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80); - //鍒濆鍖栨柊澧炲彇鍙风洃鎺ц瘑鍒鍒� - PlanRecognReq planRecognBlackReq = new PlanRecognReq(); - planRecognBlackReq.setName(appointPlanName); - planRecognBlackReq.setDescription(appointPlanName); - planRecognBlackReq.setThreshold(threshold); - //璁剧疆浜鸿劯鍒嗙粍 - List<String> faceGroupIndexCodes = new ArrayList<>(); - faceGroupIndexCodes.add(newFaceGroupEntity.getIndexCode()); - planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes); - //璁剧疆鐩戞帶鐐� - List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().map(DeviceEntity::getDeviceCode).collect(Collectors.toList()); - planRecognBlackReq.setCameraIndexCodes(cameraIndexCodes); - //璁剧疆璇嗗埆鏂瑰紡 - planRecognBlackReq.setRecognitionResourceType(RecognitionResourceEnum.FACE_RECOGNITION_SERVER.getValue()); - //璁剧疆鏃堕棿娈� 榛樿鍏ㄥぉ鍊� - AppointmentConfigEntity appointmentConfigEntity = appointmentConfigService.selectOne(new AppointmentConfigQuery()); - if (!ObjectUtils.isEmpty(appointmentConfigEntity)) { - List<AppointmentConfigTimesEntity> timesEntities = appointmentConfigTimesService.find(new AppointmentConfigTimesQuery().aotoCheckCfgId(appointmentConfigEntity.getId())); - if (!ObjectUtils.isEmpty(timesEntities)) { - List<TimeBlockListItem> timeBlockList = new ArrayList<>(); - - TimeBlockListItem timeBlockListItem = new TimeBlockListItem(); - //鍛ㄤ竴鑷冲懆鏃� - timeBlockListItem.setDayOfWeek("1-7"); - List<TimeRangeItem> timeRange = new ArrayList<>(); - for (AppointmentConfigTimesEntity timesEntity : timesEntities) { - TimeRangeItem timeRangeItem = new TimeRangeItem(); - String startTimeStr = DateUtils.convertTime2Str(timesEntity.getServiceTimeStart().getTime(), "HH:ss"); - String endTimeStr = DateUtils.convertTime2Str(timesEntity.getServiceTimeEnd().getTime(), "HH:ss"); - timeRangeItem.setStartTime(startTimeStr); - timeRangeItem.setEndTime(endTimeStr); - timeRange.add(timeRangeItem); - } - timeBlockListItem.setTimeRange(timeRange); - timeBlockList.add(timeBlockListItem); - planRecognBlackReq.setTimeBlockList(timeBlockList); - } - } - - Rest<String> planRecognBlackAddRest = hikPlanService.planRecognBlackAdd(planRecognBlackReq); - if (planRecognBlackAddRest.getCode() == YesNoEnum.YES.getValue()) { - FacePlanEntity planEntity = new FacePlanEntity(); - planEntity.initAttrValue(); - planEntity.setIndexCode(planRecognBlackAddRest.getData()); - planEntity.setName(appointPlanName); - planEntity.setDescription(appointPlanName); - planEntity.setCreateTime(new Date()); - planEntity.setCreateUserId(1L); - planEntity.setCreateUserName("admin"); - facePlanService.save(planEntity); - } - } else { - log.info("浜哄憳鍒嗙粍鍒涘缓澶辫触=>{}", rest.getMsg()); - } - } else { - log.info("褰撳ぉ浜哄憳鍒嗙粍浠ュ瓨鍦紝浜哄憳鍒嗙粍鍚嶇О=>{}", group); - } - } else { - log.info("褰撳ぉ鏃犻绾︿汉鍛橈紝涓嶅垱寤虹洃鎺ц鍒�=>{}", DateUtils.getCurrStrDate()); - }*/ - } - - @Override public void stopTask(ITask task) throws AppException { diff --git a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateBlackPlanToHikByDayTaskImpl.java b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateBlackPlanToHikByDayTaskImpl.java deleted file mode 100644 index 179ae1d24a616644825bf1af1b751477fbf4fb79..0000000000000000000000000000000000000000 --- a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/CreateBlackPlanToHikByDayTaskImpl.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.mortals.xhx.daemon.task; - -import com.mortals.framework.exception.AppException; -import com.mortals.framework.service.ITask; -import com.mortals.framework.service.ITaskExcuteService; -import com.mortals.framework.util.DateUtils; -import com.mortals.xhx.base.system.upload.service.UploadService; -import com.mortals.xhx.module.appointment.service.AppointmentConfigService; -import com.mortals.xhx.module.appointment.service.AppointmentConfigTimesService; -import com.mortals.xhx.module.appointment.service.AppointmentPersonService; -import com.mortals.xhx.module.device.service.DeviceService; -import com.mortals.xhx.module.face.service.FaceGroupPersonService; -import com.mortals.xhx.module.face.service.FaceGroupService; -import com.mortals.xhx.module.face.service.FacePlanService; -import com.mortals.xhx.module.hik.face.service.IHikFaceService; -import com.mortals.xhx.module.hik.face.service.IHikPlanService; -import com.mortals.xhx.module.person.service.PersonService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * 姣忔棩鍒涘缓棰勭害浜哄憳鐩戞帶璁″垝 - * 鍒涘缓璁″垝鍓嶅垹闄や箣鍓嶈鍒� - * <p> - * 姣忔棩鏇存柊闄岀敓浜哄憳鐩戞帶璁″垝 - * - * @author: - * @date: 2023/4/17 17:52 - */ -@Slf4j -//@Service("CreateBlackPlanToHikByDayTask") -public class CreateBlackPlanToHikByDayTaskImpl implements ITaskExcuteService { - - @Autowired - private PersonService personService; - @Autowired - private IHikFaceService hikFaceService; - @Autowired - private IHikPlanService hikPlanService; - @Autowired - private DeviceService deviceService; - @Autowired - private FacePlanService facePlanService; - @Autowired - private UploadService uploadService; - @Autowired - private FaceGroupService faceGroupService; - @Autowired - private FaceGroupPersonService faceGroupPersonService; - @Autowired - private AppointmentPersonService appointmentPersonService; - @Autowired - private AppointmentConfigService appointmentConfigService; - @Autowired - private AppointmentConfigTimesService appointmentConfigTimesService; - - @Override - public void excuteTask(ITask task) throws AppException { - - log.info("{}=>鍒涘缓闄岀敓浜鸿鍒掍换鍔�", DateUtils.getCurrStrDate()); - //createStrangerPlanByDay(); - facePlanService.createStrangerPlanByDay(); - - log.info("{}=>鍒涘缓闄岀敓浜鸿鍒掍换鍔″畬鎴�", DateUtils.getCurrStrDate()); - - log.info("{}=>鍒涘缓棰勭害璁″垝浠诲姟", DateUtils.getCurrStrDate()); - facePlanService.createAppointmentPersonByDay(); - //createAppointmentPlanByDay(); - log.info("{}=>鍒涘缓棰勭害璁″垝浠诲姟瀹屾垚", DateUtils.getCurrStrDate()); - } - - private void createStrangerPlanByDay() { - - - facePlanService.createStrangerPlanByDay(); - /* - int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80); - //鍒涘缓鎴栬€呮洿鏂� - PlanRecognListReq planRecognListReq = new PlanRecognListReq(); - Rest<List<PlanRecognInfo>> planRecognWhiteListRest = hikPlanService.findPlanRecognWhiteList(planRecognListReq); - if (planRecognWhiteListRest.getCode() == YesNoEnum.YES.getValue()) { - PlanRecognInfo planRecognWhiteInfo = planRecognWhiteListRest.getData().stream().map(i -> { - i.getName(); - if (i.getName().equals(Constant.STRANGER_PLAN)) { - return i; - } - return null; - }).filter(f -> f != null).findFirst().orElseGet(() -> null); - // todo 鍒涘缓闄岀敓浜鸿鍒� - //鍒濆鍖栨柊澧炲彇鍙风洃鎺ц瘑鍒鍒� - PlanRecognReq planRecognBlackReq = new PlanRecognReq(); - planRecognBlackReq.setName(Constant.STRANGER_PLAN); - planRecognBlackReq.setDescription(Constant.STRANGER_PLAN); - planRecognBlackReq.setThreshold(threshold); - //璁剧疆浜鸿劯鍒嗙粍 - FaceGroupEntity faceGroupEntity = faceGroupService.selectOne(new FaceGroupQuery().name(PARAM_FACE_GROUP_REGISTER)); - if (ObjectUtils.isEmpty(faceGroupEntity)) { - log.info("浜鸿劯缁勪笉瀛樺湪锛�"); - return; - } - List<String> faceGroupIndexCodes = new ArrayList<>(); - faceGroupIndexCodes.add(faceGroupEntity.getIndexCode()); - planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes); - //璁剧疆鐩戞帶鐐� - List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().distinct().map(DeviceEntity::getDeviceCode).collect(Collectors.toList()); - - ArrayList<String> temp = new ArrayList<>(); - temp.add(cameraIndexCodes.get(0)); - - planRecognBlackReq.setCameraIndexCodes(temp); - //璁剧疆璇嗗埆鏂瑰紡 - planRecognBlackReq.setRecognitionResourceType(RecognitionResourceEnum.COMPARISON.getValue()); - - // List<String> faceGroupIndexCodes = new ArrayList<>(); - - List<String> recognitionResourceIndexCodes = faceGroupPersonService.find(new FaceGroupPersonQuery().faceGroupId(faceGroupEntity.getId())).stream().map(i -> i.getIndexCode()).filter(f->!ObjectUtils.isEmpty(f)).collect(Collectors.toList()); - ArrayList<String> temp1 = new ArrayList<>(); - // temp1.add(recognitionResourceIndexCodes.get(0)); - // temp1.add(recognitionResourceIndexCodes.get(1)); - temp1.add(recognitionResourceIndexCodes.get(3)); - //temp1.add(recognitionResourceIndexCodes.get(4)); - - // planRecognBlackReq.setRecognitionResourceIndexCodes(temp1); - - //璁剧疆鏃堕棿娈� 榛樿鍏ㄥぉ鍊� - if (ObjectUtils.isEmpty(planRecognWhiteInfo)) { - Rest<String> planRecognWhiteAddRest = hikPlanService.planRecognWhiteAdd(planRecognBlackReq); - if (planRecognWhiteAddRest.getCode() == YesNoEnum.YES.getValue()) { - FacePlanEntity planEntity = new FacePlanEntity(); - planEntity.initAttrValue(); - planEntity.setIndexCode(planRecognWhiteAddRest.getData()); - planEntity.setName(Constant.STRANGER_PLAN); - planEntity.setDescription(Constant.STRANGER_PLAN); - planEntity.setCreateTime(new Date()); - planEntity.setCreateUserId(1L); - planEntity.setCreateUserName("admin"); - facePlanService.save(planEntity); - } - } else { - //鏇存柊璁″垝 - planRecognBlackReq.setIndexCode(planRecognWhiteInfo.getIndexCode()); - Rest<Boolean> planRecognWhiteUpdateRest = hikPlanService.planRecognWhiteUpdate(planRecognBlackReq); - if (planRecognWhiteUpdateRest.getCode() == YesNoEnum.YES.getValue() && planRecognWhiteUpdateRest.getData()) { - - FacePlanEntity whitePlan = facePlanService.selectOne(new FacePlanQuery().indexCode(planRecognWhiteInfo.getIndexCode())); - - if(!ObjectUtils.isEmpty(whitePlan)){ - whitePlan.setUpdateTime(new Date()); - whitePlan.setUpdateUserId(1L); - whitePlan.setUpdateUserName("system"); - facePlanService.update(whitePlan); - } - - - } - - } - - - }*/ - - } - - - private void createAppointmentPlanByDay() { - - facePlanService.createAppointmentPersonByDay(); - - /* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq(); - Rest<List<PlanRecognInfo>> planRecognBlackRest = hikPlanService.findPlanRecognBlackList(planRecognBlackListReq); - if (planRecognBlackRest.getCode() == YesNoEnum.YES.getValue()) { - List<PlanRecognInfo> delPlanList = planRecognBlackRest.getData().stream().map(i -> { - if (StrUtil.startWith(i.getName(), Constant.APPOINTMENT_PLAN_PREFIX) && !i.getName().equals(Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate())) { - return i; - } - return null; - }).filter(f -> f != null).collect(Collectors.toList()); - if (!ObjectUtils.isEmpty(delPlanList)) { - //鍒犻櫎璁″垝 - PlanRecognReq planRecognBlackReq = new PlanRecognReq(); - planRecognBlackReq.setRecognitionResourceIndexCodes(delPlanList.stream().map(i -> i.getIndexCode()).collect(Collectors.toList())); - Rest<Boolean> delRest = hikPlanService.planRecognBlackDel(planRecognBlackReq); - if (delRest.getCode() == YesNoEnum.YES.getValue() && delRest.getData()) { - log.info("棰勭害璁″垝鍒犻櫎鎴愬姛锛�"); - } - } - } - log.info("姣忔棩鍒涘缓棰勭害浜哄憳鐩戞帶璁″垝"); - //鑾峰彇褰撳ぉ棰勭害 - AppointmentPersonQuery appointmentPersonQuery = new AppointmentPersonQuery(); - appointmentPersonQuery.setAppointmentStartTimeStart(DateUtils.getCurrStrDate()); - appointmentPersonQuery.setAppointmentStartTimeEnd(DateUtils.getCurrStrDate()); - List<AppointmentPersonEntity> appointmentPersonEntities = appointmentPersonService.find(appointmentPersonQuery); - if (!ObjectUtils.isEmpty(appointmentPersonEntities)) { - //鍒涘缓浜鸿劯鍒嗙粍 - String group = Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate(); - FaceGroupEntity faceGroup = faceGroupService.selectOne(new FaceGroupQuery().name(group)); - if (ObjectUtils.isEmpty(faceGroup)) { - //鍒涘缓鍒嗙粍 - log.info("鍒涘缓浜鸿劯鍒嗙粍..."); - FaceGroupReq faceGroupReq = new FaceGroupReq(); - faceGroupReq.setName(group); - faceGroupReq.setDescription(group); - Rest<FaceGroupEntity> rest = faceGroupService.saveFaceGroupToHik(faceGroupReq); - if (rest.getCode() == YesNoEnum.YES.getValue()) { - FaceGroupEntity newFaceGroupEntity = rest.getData(); - //鍒涘缓浜鸿劯tohik - for (AppointmentPersonEntity appointmentPersonEntity : appointmentPersonEntities) { - PersonEntity personEntity = personService.getCache(appointmentPersonEntity.getPersonId().toString()); - if (ObjectUtils.isEmpty(personEntity)) { - log.info("娉ㄥ唽浜哄憳鏈┖锛宲ersionId:{}", appointmentPersonEntity.getPersonId()); - continue; - } - //鏌ヨ鍥剧墖骞惰浆鎴恇ase64 - if (!ObjectUtils.isEmpty(personEntity.getPhoto())) { - String filePath = uploadService.getFilePath(personEntity.getPhoto()); - byte[] bytes = FileUtil.readBytes(filePath); - if (bytes.length > 0) { - String picBase64Data = Base64.encode(bytes); - FaceReq faceReq = new FaceReq(); - FaceInfo faceInfo = new FaceInfo(); - faceInfo.setName(personEntity.getName()); - faceInfo.setSex(personEntity.getGender() == GenderEnum.鐢�.getValue() ? "1" : "2"); - faceInfo.setCertificateType("111"); - faceInfo.setCertificateNum(personEntity.getIdCard()); - faceReq.setFaceInfo(faceInfo); - FacePic facePic = new FacePic(); - facePic.setFaceBinaryData(picBase64Data); - faceReq.setFacePic(facePic); - faceReq.setFaceGroupIndexCode(faceGroup.getIndexCode()); - Rest<FaceDataInfo> faceDataInfoRest = hikFaceService.faceSingleAdd(faceReq); - if (faceDataInfoRest.getCode() == YesNoEnum.YES.getValue()) { - //浜鸿劯娣诲姞鎴愬姛锛屼繚瀛樹汉鑴哥粍 - FaceGroupPersonEntity faceGroupPersonEntity = new FaceGroupPersonEntity(); - faceGroupPersonEntity.initAttrValue(); - faceGroupPersonEntity.setFaceGroupId(newFaceGroupEntity.getId()); - faceGroupPersonEntity.setIndexCode(faceDataInfoRest.getData().getIndexCode()); - faceGroupPersonEntity.setCreateTime(new Date()); - faceGroupPersonEntity.setCreateUserId(1L); - faceGroupPersonService.save(faceGroupPersonEntity); - } else { - log.info("娣诲姞浜鸿劯寮傚父=>{}", faceDataInfoRest.getMsg()); - } - } else { - log.info("鍥剧墖鏁版嵁涓虹┖锛宖ilePath=>{}", filePath); - } - } else { - log.info("浜哄憳鍥剧墖photo涓虹┖锛宲erson=>{}", personEntity.getName()); - } - } - - log.info("娣诲姞褰撳ぉ棰勭害鐩戞帶璁″垝"); - String appointPlanName = Constant.APPOINTMENT_GROUP_PREFIX + DateUtils.getCurrStrDate(); - int threshold = GlobalSysInfo.getParamIntValue(ParamKey.PARAM_FACE_THRESHOLD, 80); - //鍒濆鍖栨柊澧炲彇鍙风洃鎺ц瘑鍒鍒� - PlanRecognReq planRecognBlackReq = new PlanRecognReq(); - planRecognBlackReq.setName(appointPlanName); - planRecognBlackReq.setDescription(appointPlanName); - planRecognBlackReq.setThreshold(threshold); - //璁剧疆浜鸿劯鍒嗙粍 - List<String> faceGroupIndexCodes = new ArrayList<>(); - faceGroupIndexCodes.add(newFaceGroupEntity.getIndexCode()); - planRecognBlackReq.setFaceGroupIndexCodes(faceGroupIndexCodes); - //璁剧疆鐩戞帶鐐� - List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().map(DeviceEntity::getDeviceCode).collect(Collectors.toList()); - planRecognBlackReq.setCameraIndexCodes(cameraIndexCodes); - //璁剧疆璇嗗埆鏂瑰紡 - planRecognBlackReq.setRecognitionResourceType(RecognitionResourceEnum.FACE_RECOGNITION_SERVER.getValue()); - //璁剧疆鏃堕棿娈� 榛樿鍏ㄥぉ鍊� - AppointmentConfigEntity appointmentConfigEntity = appointmentConfigService.selectOne(new AppointmentConfigQuery()); - if (!ObjectUtils.isEmpty(appointmentConfigEntity)) { - List<AppointmentConfigTimesEntity> timesEntities = appointmentConfigTimesService.find(new AppointmentConfigTimesQuery().aotoCheckCfgId(appointmentConfigEntity.getId())); - if (!ObjectUtils.isEmpty(timesEntities)) { - List<TimeBlockListItem> timeBlockList = new ArrayList<>(); - - TimeBlockListItem timeBlockListItem = new TimeBlockListItem(); - //鍛ㄤ竴鑷冲懆鏃� - timeBlockListItem.setDayOfWeek("1-7"); - List<TimeRangeItem> timeRange = new ArrayList<>(); - for (AppointmentConfigTimesEntity timesEntity : timesEntities) { - TimeRangeItem timeRangeItem = new TimeRangeItem(); - String startTimeStr = DateUtils.convertTime2Str(timesEntity.getServiceTimeStart().getTime(), "HH:ss"); - String endTimeStr = DateUtils.convertTime2Str(timesEntity.getServiceTimeEnd().getTime(), "HH:ss"); - timeRangeItem.setStartTime(startTimeStr); - timeRangeItem.setEndTime(endTimeStr); - timeRange.add(timeRangeItem); - } - timeBlockListItem.setTimeRange(timeRange); - timeBlockList.add(timeBlockListItem); - planRecognBlackReq.setTimeBlockList(timeBlockList); - } - } - - Rest<String> planRecognBlackAddRest = hikPlanService.planRecognBlackAdd(planRecognBlackReq); - if (planRecognBlackAddRest.getCode() == YesNoEnum.YES.getValue()) { - FacePlanEntity planEntity = new FacePlanEntity(); - planEntity.initAttrValue(); - planEntity.setIndexCode(planRecognBlackAddRest.getData()); - planEntity.setName(appointPlanName); - planEntity.setDescription(appointPlanName); - planEntity.setCreateTime(new Date()); - planEntity.setCreateUserId(1L); - planEntity.setCreateUserName("admin"); - facePlanService.save(planEntity); - } - } else { - log.info("浜哄憳鍒嗙粍鍒涘缓澶辫触=>{}", rest.getMsg()); - } - } else { - log.info("褰撳ぉ浜哄憳鍒嗙粍浠ュ瓨鍦紝浜哄憳鍒嗙粍鍚嶇О=>{}", group); - } - } else { - log.info("褰撳ぉ鏃犻绾︿汉鍛橈紝涓嶅垱寤虹洃鎺ц鍒�=>{}", DateUtils.getCurrStrDate()); - }*/ - } - - - @Override - public void stopTask(ITask task) throws AppException { - - } - - -} diff --git a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/RealTimePeopleStatTaskImpl.java b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/RealTimePeopleStatTaskImpl.java index a3cc22cdb53cb5ab1948fdb62fcbdf955b3fbbb0..1fac5df61cabb97d1667272087dd5f488c7b1a49 100644 --- a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/RealTimePeopleStatTaskImpl.java +++ b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/RealTimePeopleStatTaskImpl.java @@ -50,7 +50,6 @@ public class RealTimePeopleStatTaskImpl implements ITaskExcuteService { @Override public void excuteTask(ITask task) throws AppException { statPeople(); - donwnloadSnap(); } diff --git a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java index 126fe519bb1ab916d1ffbef791c732855768896d..8d7b36ba40da371d7a72565d384fff8fb8b75974 100644 --- a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java +++ b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncAppointmentPersonTaskImpl.java @@ -58,7 +58,6 @@ public class SyncAppointmentPersonTaskImpl implements ITaskExcuteService { @Autowired private FacePlanService facePlanService; - @Value("${php.host:''}") private String host; diff --git a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java index 5c69de0789ca36fd90d72d3e795046b8b2c305e6..b3439aabe78b498a5d00539ebf946ae8e5bc5c97 100644 --- a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java +++ b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncRegisterUserPicTaskImpl.java @@ -68,8 +68,8 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { .filter(item -> !ObjectUtils.isEmpty(item.getSourcePhotoUri())).collect(Collectors.toList()); for (PersonEntity personEntity : collect) { //涓嬭浇鍥剧墖鍒版湰鍦颁繚瀛樺苟鏇存柊 - String downUrl = url + personEntity.getSourcePhotoUri(); //String downUrl = "http://192.168.0.98:11078/file/fileupload/1679215657433.jpg"; + String downUrl = url + personEntity.getSourcePhotoUri(); log.info("downUrl:{}", downUrl); byte[] bytes = HttpUtil.downloadBytes(downUrl); if (bytes.length > 0) { @@ -107,12 +107,4 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { public void stopTask(ITask task) throws AppException { } - - public static void main(String[] args) { - - - System.out.println(DateUtil.parse("19951071", "yyyyMMdd")); - } - - } diff --git a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java index 1fe1e75b019feae29a4177535fa02a75b5d133be..38f665b09326e2a98bbac4ad857710009e7375e0 100644 --- a/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java +++ b/refined-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSubmitAppointTaskImpl.java @@ -26,7 +26,7 @@ import java.util.Date; import java.util.List; /** - * 浠婃棩鎸傚彿浠诲姟銆� + * 鍚屾鎻愪氦棰勭害浠诲姟 */ @Slf4j @Service("SyncSubmitAppointTask")