摄像头管理页面增删改查调试成功
parent
7c105f2f4a
commit
0633723a81
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||
public class ApiFaceOneSearchReturnFaceVO {
|
||||
|
||||
private Double hitSimilarity;
|
||||
private List<ApiFaceOneSearchFaceVO> faces;
|
||||
//private List<ApiFaceOneSearchFaceVO> faces;
|
||||
|
||||
private String extraMeta;
|
||||
// private String extraMeta;
|
||||
}
|
||||
|
|
|
@ -107,24 +107,28 @@ public class CompareServiceImpl implements ICompareService {
|
|||
if (compareRequestVo.getUrlList().size() != comparePicSize) {
|
||||
throw new DkException("请上传1:1比对的两张图片");
|
||||
}
|
||||
// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl();
|
||||
// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl();
|
||||
String apiUrltest = "192.168.1.196:5403/compare";
|
||||
FaceCompareVO faceCompareVO = new FaceCompareVO();
|
||||
faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0));
|
||||
faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1));
|
||||
ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrltest, faceCompareVO, ReturnVO.class);
|
||||
//
|
||||
ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference<ApiFaceOneSearchReturnFaceVO>() {});
|
||||
//返回结果集
|
||||
OneToOneResultVo oneToOneResultVo = new OneToOneResultVo();
|
||||
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
|
||||
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
|
||||
for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) {
|
||||
oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl());
|
||||
}
|
||||
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
||||
}
|
||||
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)){
|
||||
oneToOneResultVo.getUrls().add(faceCompareVO.getImage1());
|
||||
oneToOneResultVo.getUrls().add(faceCompareVO.getImage2());
|
||||
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
||||
}
|
||||
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
|
||||
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
|
||||
// for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) {
|
||||
// oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl());
|
||||
// }
|
||||
// oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
||||
// }
|
||||
// }
|
||||
return oneToOneResultVo;
|
||||
}
|
||||
|
||||
|
@ -163,11 +167,7 @@ public class CompareServiceImpl implements ICompareService {
|
|||
private void validateSingleFaceImage(String image) {
|
||||
//人脸检测url
|
||||
//String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl();
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> 2694213e787f28783bce92eaa5a3db9102554981
|
||||
String faceSearchUrltest ="http://192.168.3.132:5000/message/mask";
|
||||
String faceSearchUrltest ="http://192.168.3.134:5000/message/mask";
|
||||
//组装api请求数据
|
||||
ReturnVO returnVO;
|
||||
returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class);
|
||||
|
|
|
@ -368,16 +368,16 @@ public class FaceCameraServiceImpl extends ServiceImpl<FaceCameraDao, FaceCamera
|
|||
}
|
||||
Map map = new HashMap(0);
|
||||
//判断是否修改了名称,rtsp
|
||||
if (!faceCameraEntity.getCameraName().equals(faceCameraInfo.getCameraName()) ||
|
||||
!faceCameraEntity.getRtspUrl().equals(faceCameraInfo.getRtspUrl())) {
|
||||
map.put("name", faceCameraInfo.getCameraName());
|
||||
map.put("url", faceCameraInfo.getRtspUrl());
|
||||
map.put("carmeraId", faceCameraInfo.getIdFaceCamera());
|
||||
ApiVO result = httpUtil.put(link + ApiUrlEnum.CAMERA.getUrl(), map, ApiVO.class);
|
||||
if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) {
|
||||
throw new DkException("修改摄像头失败");
|
||||
}
|
||||
}
|
||||
// if (!faceCameraEntity.getCameraName().equals(faceCameraInfo.getCameraName()) ||
|
||||
// !faceCameraEntity.getRtspUrl().equals(faceCameraInfo.getRtspUrl())) {
|
||||
// map.put("name", faceCameraInfo.getCameraName());
|
||||
// map.put("url", faceCameraInfo.getRtspUrl());
|
||||
// map.put("carmeraId", faceCameraInfo.getIdFaceCamera());
|
||||
// ApiVO result = httpUtil.put(link + ApiUrlEnum.CAMERA.getUrl(), map, ApiVO.class);
|
||||
// if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) {
|
||||
// throw new DkException("修改摄像头失败");
|
||||
// }
|
||||
// }
|
||||
BeanUtils.copyProperties(faceCameraInfo, faceCameraEntity);
|
||||
//摄像头区域类型修改
|
||||
faceCameraEntity.setCameraRegionFirstlevel(null);
|
||||
|
@ -423,10 +423,10 @@ public class FaceCameraServiceImpl extends ServiceImpl<FaceCameraDao, FaceCamera
|
|||
}
|
||||
|
||||
|
||||
ApiVO result = httpUtil.delete(link + ApiUrlEnum.CAMERA.getUrl() + "/" + camera, ApiVO.class);
|
||||
if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) {
|
||||
throw new DkException("删除摄像头失败");
|
||||
}
|
||||
// ApiVO result = httpUtil.delete(link + ApiUrlEnum.CAMERA.getUrl() + "/" + camera, ApiVO.class);
|
||||
// if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) {
|
||||
// throw new DkException("删除摄像头失败");
|
||||
// }
|
||||
entity.setIsValid(YNEnums.NO.code);
|
||||
return baseMapper.updateById(entity);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue