摄像头管理页面增删改查调试成功

master
hush_goup 2023-03-28 19:53:56 +08:00
parent 7c105f2f4a
commit 0633723a81
3 changed files with 30 additions and 30 deletions

View File

@ -26,7 +26,7 @@ import java.util.List;
public class ApiFaceOneSearchReturnFaceVO { public class ApiFaceOneSearchReturnFaceVO {
private Double hitSimilarity; private Double hitSimilarity;
private List<ApiFaceOneSearchFaceVO> faces; //private List<ApiFaceOneSearchFaceVO> faces;
private String extraMeta; // private String extraMeta;
} }

View File

@ -107,24 +107,28 @@ public class CompareServiceImpl implements ICompareService {
if (compareRequestVo.getUrlList().size() != comparePicSize) { if (compareRequestVo.getUrlList().size() != comparePicSize) {
throw new DkException("请上传1:1比对的两张图片"); 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"; String apiUrltest = "192.168.1.196:5403/compare";
FaceCompareVO faceCompareVO = new FaceCompareVO(); FaceCompareVO faceCompareVO = new FaceCompareVO();
faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0)); faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0));
faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1)); faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1));
ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrltest, faceCompareVO, ReturnVO.class); ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrltest, faceCompareVO, ReturnVO.class);
//
ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference<ApiFaceOneSearchReturnFaceVO>() {}); ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference<ApiFaceOneSearchReturnFaceVO>() {});
//返回结果集 //返回结果集
OneToOneResultVo oneToOneResultVo = new OneToOneResultVo(); OneToOneResultVo oneToOneResultVo = new OneToOneResultVo();
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) { if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)){
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) { oneToOneResultVo.getUrls().add(faceCompareVO.getImage1());
for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) { oneToOneResultVo.getUrls().add(faceCompareVO.getImage2());
oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl());
}
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity()); 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; return oneToOneResultVo;
} }
@ -163,11 +167,7 @@ public class CompareServiceImpl implements ICompareService {
private void validateSingleFaceImage(String image) { private void validateSingleFaceImage(String image) {
//人脸检测url //人脸检测url
//String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); //String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl();
<<<<<<< HEAD String faceSearchUrltest ="http://192.168.3.134:5000/message/mask";
=======
>>>>>>> 2694213e787f28783bce92eaa5a3db9102554981
String faceSearchUrltest ="http://192.168.3.132:5000/message/mask";
//组装api请求数据 //组装api请求数据
ReturnVO returnVO; ReturnVO returnVO;
returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class); returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class);

View File

@ -368,16 +368,16 @@ public class FaceCameraServiceImpl extends ServiceImpl<FaceCameraDao, FaceCamera
} }
Map map = new HashMap(0); Map map = new HashMap(0);
//判断是否修改了名称rtsp //判断是否修改了名称rtsp
if (!faceCameraEntity.getCameraName().equals(faceCameraInfo.getCameraName()) || // if (!faceCameraEntity.getCameraName().equals(faceCameraInfo.getCameraName()) ||
!faceCameraEntity.getRtspUrl().equals(faceCameraInfo.getRtspUrl())) { // !faceCameraEntity.getRtspUrl().equals(faceCameraInfo.getRtspUrl())) {
map.put("name", faceCameraInfo.getCameraName()); // map.put("name", faceCameraInfo.getCameraName());
map.put("url", faceCameraInfo.getRtspUrl()); // map.put("url", faceCameraInfo.getRtspUrl());
map.put("carmeraId", faceCameraInfo.getIdFaceCamera()); // map.put("carmeraId", faceCameraInfo.getIdFaceCamera());
ApiVO result = httpUtil.put(link + ApiUrlEnum.CAMERA.getUrl(), map, ApiVO.class); // ApiVO result = httpUtil.put(link + ApiUrlEnum.CAMERA.getUrl(), map, ApiVO.class);
if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) { // if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) {
throw new DkException("修改摄像头失败"); // throw new DkException("修改摄像头失败");
} // }
} // }
BeanUtils.copyProperties(faceCameraInfo, faceCameraEntity); BeanUtils.copyProperties(faceCameraInfo, faceCameraEntity);
//摄像头区域类型修改 //摄像头区域类型修改
faceCameraEntity.setCameraRegionFirstlevel(null); 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); // ApiVO result = httpUtil.delete(link + ApiUrlEnum.CAMERA.getUrl() + "/" + camera, ApiVO.class);
if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) { // if (result == null || !ErrEnum.OK.getCode().equals(result.getCode())) {
throw new DkException("删除摄像头失败"); // throw new DkException("删除摄像头失败");
} // }
entity.setIsValid(YNEnums.NO.code); entity.setIsValid(YNEnums.NO.code);
return baseMapper.updateById(entity); return baseMapper.updateById(entity);
} }