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

添加服务追踪

parent 178b82d7
...@@ -95,6 +95,7 @@ public final class Constant { ...@@ -95,6 +95,7 @@ public final class Constant {
* 陌生人监控计划 * 陌生人监控计划
*/ */
public final static String STRANGER_PLAN = "stranger_plan"; public final static String STRANGER_PLAN = "stranger_plan";
public final static String STRANGER_PLAN_DESC = "陌生人监控计划";
/** /**
* 预约监控计划前缀 * 预约监控计划前缀
......
...@@ -103,7 +103,7 @@ public class SubEventStartedService implements IApplicationStartedService { ...@@ -103,7 +103,7 @@ public class SubEventStartedService implements IApplicationStartedService {
} }
//创建陌生人计划 //创建陌生人计划
facePlanService.createStrangerPlanByDay(); // facePlanService.createStrangerPlanByDay();
//删除重点人员计划 //删除重点人员计划
/* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq(); /* PlanRecognListReq planRecognBlackListReq = new PlanRecognListReq();
......
...@@ -5,6 +5,7 @@ import com.mortals.framework.common.Rest; ...@@ -5,6 +5,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.xhx.common.code.RecognitionResourceEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
...@@ -14,6 +15,9 @@ import com.mortals.xhx.module.hik.camera.model.req.CameraReq; ...@@ -14,6 +15,9 @@ import com.mortals.xhx.module.hik.camera.model.req.CameraReq;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraDataInfo;
import com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo; import com.mortals.xhx.module.hik.camera.model.rsp.CameraInfo;
import com.mortals.xhx.module.hik.camera.service.IHikCameraService; import com.mortals.xhx.module.hik.camera.service.IHikCameraService;
import com.mortals.xhx.module.hik.face.model.req.resource.ResourceReq;
import com.mortals.xhx.module.hik.face.model.rsp.resource.ResourceDataInfo;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -35,6 +39,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -35,6 +39,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
private DeviceService deviceService; private DeviceService deviceService;
@Autowired @Autowired
private IHikCameraService hikCameraService; private IHikCameraService hikCameraService;
@Autowired
private IHikFaceService hikFaceService;
@Override @Override
...@@ -85,10 +91,22 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -85,10 +91,22 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
* "updateTime": "2023-04-10T15:11:56.446+08:00" * "updateTime": "2023-04-10T15:11:56.446+08:00"
*/ */
private void syncDevice() { private void syncDevice() {
//获取识别资源
ResourceReq resourceReq = new ResourceReq();
resourceReq.setRecognitionResourceType(RecognitionResourceEnum.SUPER_BRAIN.getValue());
Rest<List<ResourceDataInfo>> resourceRecognition = hikFaceService.getResourceRecognition(resourceReq);
if (resourceRecognition.getCode() == YesNoEnum.YES.getValue() && !ObjectUtils.isEmpty(resourceRecognition.getData())) {
ArrayList<String> recognitionResourceIndexCodes = new ArrayList<>();
recognitionResourceIndexCodes.add(resourceRecognition.getData().get(0).getIndexCode());
// planRecognWhiteReq.setRecognitionResourceIndexCodes(recognitionResourceIndexCodes);
CameraListReq cameraListReq = new CameraListReq(); CameraListReq cameraListReq = new CameraListReq();
cameraListReq.setPageNo(1); cameraListReq.setPageNo(1);
cameraListReq.setPageSize(200); cameraListReq.setPageSize(200);
cameraListReq.setRegionIndexCode("root000000"); cameraListReq.setEncodeDevIndexCode(resourceRecognition.getData().get(0).getIndexCode());
//cameraListReq.setRegionIndexCode("root000000");
Rest<CameraDataInfo> rest = hikCameraService.findCameraList(cameraListReq); Rest<CameraDataInfo> rest = hikCameraService.findCameraList(cameraListReq);
if (rest.getCode() == YesNoEnum.YES.getValue()) { if (rest.getCode() == YesNoEnum.YES.getValue()) {
List<CameraInfo> cameraDataInfoList = rest.getData().getList(); List<CameraInfo> cameraDataInfoList = rest.getData().getList();
...@@ -148,6 +166,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -148,6 +166,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
} else { } else {
log.info("同步设备异常=>{}", JSON.toJSONString(rest)); log.info("同步设备异常=>{}", JSON.toJSONString(rest));
} }
}
} }
......
...@@ -2,10 +2,12 @@ package com.mortals.xhx.module.device.model; ...@@ -2,10 +2,12 @@ package com.mortals.xhx.module.device.model;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceVo; import com.mortals.xhx.module.device.model.vo.DeviceVo;
/** /**
* 设备业务实体对象 * 设备业务实体对象
* *
...@@ -110,351 +112,442 @@ public class DeviceEntity extends DeviceVo { ...@@ -110,351 +112,442 @@ public class DeviceEntity extends DeviceVo {
private String deviceRemark; private String deviceRemark;
public DeviceEntity() {
}
public DeviceEntity(){}
/** /**
* 获取 站点Id * 获取 站点Id
*
* @return Long * @return Long
*/ */
public Long getSiteId(){ public Long getSiteId() {
return siteId; return siteId;
} }
/** /**
* 设置 站点Id * 设置 站点Id
*
* @param siteId * @param siteId
*/ */
public void setSiteId(Long siteId){ public void setSiteId(Long siteId) {
this.siteId = siteId; this.siteId = siteId;
} }
/** /**
* 获取 站点名称 * 获取 站点名称
*
* @return String * @return String
*/ */
public String getSiteName(){ public String getSiteName() {
return siteName; return siteName;
} }
/** /**
* 设置 站点名称 * 设置 站点名称
*
* @param siteName * @param siteName
*/ */
public void setSiteName(String siteName){ public void setSiteName(String siteName) {
this.siteName = siteName; this.siteName = siteName;
} }
/** /**
* 获取 设备ID,海康 * 获取 设备ID,海康
*
* @return String * @return String
*/ */
public String getDeviceId(){ public String getDeviceId() {
return deviceId; return deviceId;
} }
/** /**
* 设置 设备ID,海康 * 设置 设备ID,海康
*
* @param deviceId * @param deviceId
*/ */
public void setDeviceId(String deviceId){ public void setDeviceId(String deviceId) {
this.deviceId = deviceId; this.deviceId = deviceId;
} }
/** /**
* 获取 设备名称 * 获取 设备名称
*
* @return String * @return String
*/ */
public String getDeviceName(){ public String getDeviceName() {
return deviceName; return deviceName;
} }
/** /**
* 设置 设备名称 * 设置 设备名称
*
* @param deviceName * @param deviceName
*/ */
public void setDeviceName(String deviceName){ public void setDeviceName(String deviceName) {
this.deviceName = deviceName; this.deviceName = deviceName;
} }
/** /**
* 获取 设备编码 * 获取 设备编码
*
* @return String * @return String
*/ */
public String getDeviceCode(){ public String getDeviceCode() {
return deviceCode; return deviceCode;
} }
/** /**
* 设置 设备编码 * 设置 设备编码
*
* @param deviceCode * @param deviceCode
*/ */
public void setDeviceCode(String deviceCode){ public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode; this.deviceCode = deviceCode;
} }
/** /**
* 获取 设备的MAC地址 * 获取 设备的MAC地址
*
* @return String * @return String
*/ */
public String getDeviceMac(){ public String getDeviceMac() {
return deviceMac; return deviceMac;
} }
/** /**
* 设置 设备的MAC地址 * 设置 设备的MAC地址
*
* @param deviceMac * @param deviceMac
*/ */
public void setDeviceMac(String deviceMac){ public void setDeviceMac(String deviceMac) {
this.deviceMac = deviceMac; this.deviceMac = deviceMac;
} }
/** /**
* 获取 设备位置 * 获取 设备位置
*
* @return String * @return String
*/ */
public String getDeviceLocation(){ public String getDeviceLocation() {
return deviceLocation; return deviceLocation;
} }
/** /**
* 设置 设备位置 * 设置 设备位置
*
* @param deviceLocation * @param deviceLocation
*/ */
public void setDeviceLocation(String deviceLocation){ public void setDeviceLocation(String deviceLocation) {
this.deviceLocation = deviceLocation; this.deviceLocation = deviceLocation;
} }
/** /**
* 获取 经度 * 获取 经度
*
* @return String * @return String
*/ */
public String getLon(){ public String getLon() {
return lon; return lon;
} }
/** /**
* 设置 经度 * 设置 经度
*
* @param lon * @param lon
*/ */
public void setLon(String lon){ public void setLon(String lon) {
this.lon = lon; this.lon = lon;
} }
/** /**
* 获取 纬度 * 获取 纬度
*
* @return String * @return String
*/ */
public String getLati(){ public String getLati() {
return lati; return lati;
} }
/** /**
* 设置 纬度 * 设置 纬度
*
* @param lati * @param lati
*/ */
public void setLati(String lati){ public void setLati(String lati) {
this.lati = lati; this.lati = lati;
} }
/** /**
* 获取 楼层 * 获取 楼层
*
* @return Integer * @return Integer
*/ */
public Integer getFloor(){ public Integer getFloor() {
return floor; return floor;
} }
/** /**
* 设置 楼层 * 设置 楼层
*
* @param floor * @param floor
*/ */
public void setFloor(Integer floor){ public void setFloor(Integer floor) {
this.floor = floor; this.floor = floor;
} }
/** /**
* 获取 楼栋 * 获取 楼栋
*
* @return Integer * @return Integer
*/ */
public Integer getBuild(){ public Integer getBuild() {
return build; return build;
} }
/** /**
* 设置 楼栋 * 设置 楼栋
*
* @param build * @param build
*/ */
public void setBuild(Integer build){ public void setBuild(Integer build) {
this.build = build; this.build = build;
} }
/** /**
* 获取 负责人 * 获取 负责人
*
* @return String * @return String
*/ */
public String getLeadingOfficial(){ public String getLeadingOfficial() {
return leadingOfficial; return leadingOfficial;
} }
/** /**
* 设置 负责人 * 设置 负责人
*
* @param leadingOfficial * @param leadingOfficial
*/ */
public void setLeadingOfficial(String leadingOfficial){ public void setLeadingOfficial(String leadingOfficial) {
this.leadingOfficial = leadingOfficial; this.leadingOfficial = leadingOfficial;
} }
/** /**
* 获取 联系电话 * 获取 联系电话
*
* @return String * @return String
*/ */
public String getLeadingOfficialTelephone(){ public String getLeadingOfficialTelephone() {
return leadingOfficialTelephone; return leadingOfficialTelephone;
} }
/** /**
* 设置 联系电话 * 设置 联系电话
*
* @param leadingOfficialTelephone * @param leadingOfficialTelephone
*/ */
public void setLeadingOfficialTelephone(String leadingOfficialTelephone){ public void setLeadingOfficialTelephone(String leadingOfficialTelephone) {
this.leadingOfficialTelephone = leadingOfficialTelephone; this.leadingOfficialTelephone = leadingOfficialTelephone;
} }
/** /**
* 获取 超时时间,单位天 * 获取 超时时间,单位天
*
* @return Integer * @return Integer
*/ */
public Integer getTimeOutPeriod(){ public Integer getTimeOutPeriod() {
return timeOutPeriod; return timeOutPeriod;
} }
/** /**
* 设置 超时时间,单位天 * 设置 超时时间,单位天
*
* @param timeOutPeriod * @param timeOutPeriod
*/ */
public void setTimeOutPeriod(Integer timeOutPeriod){ public void setTimeOutPeriod(Integer timeOutPeriod) {
this.timeOutPeriod = timeOutPeriod; this.timeOutPeriod = timeOutPeriod;
} }
/** /**
* 获取 临近时间,单位天 * 获取 临近时间,单位天
*
* @return Integer * @return Integer
*/ */
public Integer getNearTime(){ public Integer getNearTime() {
return nearTime; return nearTime;
} }
/** /**
* 设置 临近时间,单位天 * 设置 临近时间,单位天
*
* @param nearTime * @param nearTime
*/ */
public void setNearTime(Integer nearTime){ public void setNearTime(Integer nearTime) {
this.nearTime = nearTime; this.nearTime = nearTime;
} }
/** /**
* 获取 设备状态 (1.离线,2.在线) * 获取 设备状态 (1.离线,2.在线)
*
* @return Integer * @return Integer
*/ */
public Integer getDeviceStatus(){ public Integer getDeviceStatus() {
return deviceStatus; return deviceStatus;
} }
/** /**
* 设置 设备状态 (1.离线,2.在线) * 设置 设备状态 (1.离线,2.在线)
*
* @param deviceStatus * @param deviceStatus
*/ */
public void setDeviceStatus(Integer deviceStatus){ public void setDeviceStatus(Integer deviceStatus) {
this.deviceStatus = deviceStatus; this.deviceStatus = deviceStatus;
} }
/** /**
* 获取 区域编码 * 获取 区域编码
*
* @return String * @return String
*/ */
public String getRegionIndexCode(){ public String getRegionIndexCode() {
return regionIndexCode; return regionIndexCode;
} }
/** /**
* 设置 区域编码 * 设置 区域编码
*
* @param regionIndexCode * @param regionIndexCode
*/ */
public void setRegionIndexCode(String regionIndexCode){ public void setRegionIndexCode(String regionIndexCode) {
this.regionIndexCode = regionIndexCode; this.regionIndexCode = regionIndexCode;
} }
/** /**
* 获取 类型名称 * 获取 类型名称
*
* @return String * @return String
*/ */
public String getCameraTypeName(){ public String getCameraTypeName() {
return cameraTypeName; return cameraTypeName;
} }
/** /**
* 设置 类型名称 * 设置 类型名称
*
* @param cameraTypeName * @param cameraTypeName
*/ */
public void setCameraTypeName(String cameraTypeName){ public void setCameraTypeName(String cameraTypeName) {
this.cameraTypeName = cameraTypeName; this.cameraTypeName = cameraTypeName;
} }
/** /**
* 获取 设备类型 * 获取 设备类型
*
* @return Integer * @return Integer
*/ */
public Integer getCameraType(){ public Integer getCameraType() {
return cameraType; return cameraType;
} }
/** /**
* 设置 设备类型 * 设置 设备类型
*
* @param cameraType * @param cameraType
*/ */
public void setCameraType(Integer cameraType){ public void setCameraType(Integer cameraType) {
this.cameraType = cameraType; this.cameraType = cameraType;
} }
/** /**
* 获取 编码 * 获取 编码
*
* @return String * @return String
*/ */
public String getEncodeDevIndexCode(){ public String getEncodeDevIndexCode() {
return encodeDevIndexCode; return encodeDevIndexCode;
} }
/** /**
* 设置 编码 * 设置 编码
*
* @param encodeDevIndexCode * @param encodeDevIndexCode
*/ */
public void setEncodeDevIndexCode(String encodeDevIndexCode){ public void setEncodeDevIndexCode(String encodeDevIndexCode) {
this.encodeDevIndexCode = encodeDevIndexCode; this.encodeDevIndexCode = encodeDevIndexCode;
} }
/** /**
* 获取 设备能力 * 获取 设备能力
*
* @return String * @return String
*/ */
public String getCapabilitySet(){ public String getCapabilitySet() {
return capabilitySet; return capabilitySet;
} }
/** /**
* 设置 设备能力 * 设置 设备能力
*
* @param capabilitySet * @param capabilitySet
*/ */
public void setCapabilitySet(String capabilitySet){ public void setCapabilitySet(String capabilitySet) {
this.capabilitySet = capabilitySet; this.capabilitySet = capabilitySet;
} }
/** /**
* 获取 设备能力名称 * 获取 设备能力名称
*
* @return String * @return String
*/ */
public String getCapabilitySetName(){ public String getCapabilitySetName() {
return capabilitySetName; return capabilitySetName;
} }
/** /**
* 设置 设备能力名称 * 设置 设备能力名称
*
* @param capabilitySetName * @param capabilitySetName
*/ */
public void setCapabilitySetName(String capabilitySetName){ public void setCapabilitySetName(String capabilitySetName) {
this.capabilitySetName = capabilitySetName; this.capabilitySetName = capabilitySetName;
} }
/** /**
* 获取 备注 * 获取 备注
*
* @return String * @return String
*/ */
public String getDeviceRemark(){ public String getDeviceRemark() {
return deviceRemark; return deviceRemark;
} }
/** /**
* 设置 备注 * 设置 备注
*
* @param deviceRemark * @param deviceRemark
*/ */
public void setDeviceRemark(String deviceRemark){ public void setDeviceRemark(String deviceRemark) {
this.deviceRemark = deviceRemark; this.deviceRemark = deviceRemark;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return this.getEncodeDevIndexCode().hashCode(); return this.getDeviceId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) return false; if (obj == null) return false;
if (obj instanceof DeviceEntity) { if (obj instanceof DeviceEntity) {
DeviceEntity tmp = (DeviceEntity) obj; DeviceEntity tmp = (DeviceEntity) obj;
if (this.getEncodeDevIndexCode() .equals( tmp.getEncodeDevIndexCode())) { if (this.getDeviceId().equals(tmp.getDeviceId())) {
return true; return true;
} }
} }
return false; return false;
} }
public String toString(){ public String toString() {
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId()); sb.append(",siteId:").append(getSiteId());
sb.append(",siteName:").append(getSiteName()); sb.append(",siteName:").append(getSiteName());
...@@ -482,7 +575,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -482,7 +575,7 @@ public class DeviceEntity extends DeviceVo {
return sb.toString(); return sb.toString();
} }
public void initAttrValue(){ public void initAttrValue() {
this.siteId = null; this.siteId = null;
......
...@@ -321,7 +321,7 @@ public class FacePlanEntity extends FacePlanVo { ...@@ -321,7 +321,7 @@ public class FacePlanEntity extends FacePlanVo {
this.status = ""; this.status = "";
this.available = ""; this.available = "true";
this.description = ""; this.description = "";
......
...@@ -118,12 +118,12 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -118,12 +118,12 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
faceGroupIndexCodes.add(faceGroupEntity.getIndexCode()); faceGroupIndexCodes.add(faceGroupEntity.getIndexCode());
planRecognWhiteReq.setFaceGroupIndexCodes(faceGroupIndexCodes); planRecognWhiteReq.setFaceGroupIndexCodes(faceGroupIndexCodes);
//设置监控点 //设置监控点
List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().distinct().map(DeviceEntity::getDeviceCode).collect(Collectors.toList()); List<String> cameraIndexCodes = deviceService.find(new DeviceQuery()).stream().map(DeviceEntity::getDeviceCode).distinct().collect(Collectors.toList());
ArrayList<String> temp = new ArrayList<>(); // ArrayList<String> temp = new ArrayList<>();
temp.add(cameraIndexCodes.get(2)); // temp.add(cameraIndexCodes.get(2));
//planRecognWhiteReq.setCameraIndexCodes(cameraIndexCodes); planRecognWhiteReq.setCameraIndexCodes(cameraIndexCodes);
planRecognWhiteReq.setCameraIndexCodes(temp); //planRecognWhiteReq.setCameraIndexCodes(temp);
//设置识别方式 //设置识别方式
planRecognWhiteReq.setRecognitionResourceType(RecognitionResourceEnum.SUPER_BRAIN.getValue()); planRecognWhiteReq.setRecognitionResourceType(RecognitionResourceEnum.SUPER_BRAIN.getValue());
...@@ -137,7 +137,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -137,7 +137,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
} }
//设置时间段 默认全天候 //设置时间段 默认全天候
List<TimeBlockListItem> timeBlockListItemList=new ArrayList<>(); /* List<TimeBlockListItem> timeBlockListItemList=new ArrayList<>();
TimeBlockListItem timeBlockListItem = new TimeBlockListItem(); TimeBlockListItem timeBlockListItem = new TimeBlockListItem();
timeBlockListItem.setDayOfWeek("7"); timeBlockListItem.setDayOfWeek("7");
List<TimeRangeItem> timeRange=new ArrayList<>(); List<TimeRangeItem> timeRange=new ArrayList<>();
...@@ -147,7 +147,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -147,7 +147,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
timeRange.add(timeRangeItem); timeRange.add(timeRangeItem);
timeBlockListItem.setTimeRange(timeRange); timeBlockListItem.setTimeRange(timeRange);
timeBlockListItemList.add(timeBlockListItem); timeBlockListItemList.add(timeBlockListItem);
planRecognWhiteReq.setTimeBlockList(timeBlockListItemList); planRecognWhiteReq.setTimeBlockList(timeBlockListItemList);*/
if (ObjectUtils.isEmpty(planRecognWhiteInfo)) { if (ObjectUtils.isEmpty(planRecognWhiteInfo)) {
Rest<String> planRecognWhiteAddRest = hikPlanService.planRecognWhiteAdd(planRecognWhiteReq); Rest<String> planRecognWhiteAddRest = hikPlanService.planRecognWhiteAdd(planRecognWhiteReq);
...@@ -155,8 +155,15 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -155,8 +155,15 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
FacePlanEntity planEntity = new FacePlanEntity(); FacePlanEntity planEntity = new FacePlanEntity();
planEntity.initAttrValue(); planEntity.initAttrValue();
planEntity.setIndexCode(planRecognWhiteAddRest.getData()); planEntity.setIndexCode(planRecognWhiteAddRest.getData());
planEntity.setFaceGroupIndexCodes(faceGroupEntity.getIndexCode());
planEntity.setCameraIndexCodes(planRecognWhiteReq.getCameraIndexCodes().stream().collect(Collectors.joining(",")));
planEntity.setRecognitionResourceIndexCodes(planRecognWhiteReq.getRecognitionResourceIndexCodes().stream().collect(Collectors.joining(",")));
planEntity.setRecognitionResourceType(RecognitionResourceEnum.SUPER_BRAIN.getDesc());
planEntity.setThreshold(threshold);
planEntity.setStatus(PlanStatusEnum.RUNNING.getValue());
planEntity.setStartTime(new Date());
planEntity.setName(Constant.STRANGER_PLAN); planEntity.setName(Constant.STRANGER_PLAN);
planEntity.setDescription(Constant.STRANGER_PLAN); planEntity.setDescription(Constant.STRANGER_PLAN_DESC);
planEntity.setCreateTime(new Date()); planEntity.setCreateTime(new Date());
planEntity.setCreateUserId(1L); planEntity.setCreateUserId(1L);
planEntity.setCreateUserName("admin"); planEntity.setCreateUserName("admin");
...@@ -182,9 +189,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -182,9 +189,7 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
planRecognWhiteReq.setIndexCode(planRecognWhiteInfo.getIndexCode()); planRecognWhiteReq.setIndexCode(planRecognWhiteInfo.getIndexCode());
Rest<Boolean> planRecognWhiteUpdateRest = hikPlanService.planRecognWhiteUpdate(planRecognWhiteReq); Rest<Boolean> planRecognWhiteUpdateRest = hikPlanService.planRecognWhiteUpdate(planRecognWhiteReq);
if (planRecognWhiteUpdateRest.getCode() == YesNoEnum.YES.getValue() && planRecognWhiteUpdateRest.getData()) { if (planRecognWhiteUpdateRest.getCode() == YesNoEnum.YES.getValue() && planRecognWhiteUpdateRest.getData()) {
FacePlanEntity whitePlan = facePlanService.selectOne(new FacePlanQuery().indexCode(planRecognWhiteInfo.getIndexCode())); FacePlanEntity whitePlan = facePlanService.selectOne(new FacePlanQuery().indexCode(planRecognWhiteInfo.getIndexCode()));
if (!ObjectUtils.isEmpty(whitePlan)) { if (!ObjectUtils.isEmpty(whitePlan)) {
whitePlan.setUpdateTime(new Date()); whitePlan.setUpdateTime(new Date());
whitePlan.setUpdateUserId(1L); whitePlan.setUpdateUserId(1L);
...@@ -193,12 +198,9 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa ...@@ -193,12 +198,9 @@ public class FacePlanServiceImpl extends AbstractCRUDServiceImpl<FacePlanDao, Fa
} }
} }
} }
} }
return planRecognWhiteListRest; return planRecognWhiteListRest;
} }
......
...@@ -11,6 +11,7 @@ public class CameraListReq { ...@@ -11,6 +11,7 @@ public class CameraListReq {
private String cameraIndexCodes; private String cameraIndexCodes;
//识别资源,默认超脑
private String encodeDevIndexCode; private String encodeDevIndexCode;
private String regionIndexCode; private String regionIndexCode;
......
...@@ -149,7 +149,7 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe ...@@ -149,7 +149,7 @@ public class HikPlanServiceImpl extends AbstractHikService implements IHikPlanSe
HikApiRest<String> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<String>>() { HikApiRest<String> rest = JSON.parseObject(respJson, new TypeReference<HikApiRest<String>>() {
}); });
if ("0".equals(rest.getCode())) { if ("0".equals(rest.getCode())) {
return Rest.ok(rest.getData()); return Rest.ok(rest.getMsg(),rest.getData());
} else { } else {
log.info("plan recognize white add error resp=>{}", respJson); log.info("plan recognize white add error resp=>{}", respJson);
return Rest.fail(rest.getMsg()); return Rest.fail(rest.getMsg());
......
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