初次提交

master
coco1986509808 2023-12-28 15:14:02 +08:00
parent 527d3788ad
commit 12e07f5d79
12 changed files with 155 additions and 35 deletions

View File

@ -20,6 +20,8 @@ public enum ApiUrlEnum {
//口罩人脸识别项目所用的接口地址重新定义 //口罩人脸识别项目所用的接口地址重新定义
FACE_SEARCH("message/mask", "人脸检测"), FACE_SEARCH("message/mask", "人脸检测"),
FACE_COMPARISON("compare", "一比一比对"), FACE_COMPARISON("compare", "一比一比对"),
FACE_COMPARISON_MUCH("compares", "一比多比对"),
FACELIB_POSTURL("dkha/faceLib", "添加人脸"), FACELIB_POSTURL("dkha/faceLib", "添加人脸"),
FACELIST_POSTURL("dkha/face", "添加人像"), FACELIST_POSTURL("dkha/face", "添加人像"),
FACE_POSTURL("dkha/face", "添加人像"), FACE_POSTURL("dkha/face", "添加人像"),

View File

@ -0,0 +1,19 @@
package com.dkha.common.modules.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "人脸库1N比对返回", description = "人脸检索")
public class CompareMuch {
private Double hitSimilarity;
@ApiModelProperty(value = "比对最相似的人脸地址")
private String rphoto;
}

View File

@ -18,4 +18,7 @@ public class CompareRequestVo {
@ApiModelProperty(value = "阀值") @ApiModelProperty(value = "阀值")
private Double minScore; private Double minScore;
@ApiModelProperty(value = "查询的库id")
private String value;
} }

View File

@ -27,7 +27,7 @@ public class FaceCompareVO {
private String image1; private String image1;
@ApiModelProperty(value = "人脸图片2") @ApiModelProperty(value = "人脸图片2")
private String image2; private String image2;
// @ApiModelProperty(value = "拓展字段") @ApiModelProperty(value = "拓展字段")
// private String extraMeta; private String extraMeta;
} }

View File

@ -88,7 +88,11 @@ public class CameraController extends CommonResult {
public CommonResult insert(@RequestBody @Valid InsertFaceCamera insertFaceCamera) { public CommonResult insert(@RequestBody @Valid InsertFaceCamera insertFaceCamera) {
try { try {
System.out.println("进入添加摄像头方法"); System.out.println("进入添加摄像头方法");
// for (InsertFaceCamera insertFaceCamera1:insertFaceCamera){
// faceCameraServiceImpl.insertCamera(insertFaceCamera1);
// }
faceCameraServiceImpl.insertCamera(insertFaceCamera); faceCameraServiceImpl.insertCamera(insertFaceCamera);
System.out.println(insertFaceCamera);
} catch (DkException e) { } catch (DkException e) {
return failResult(e.getMessage()); return failResult(e.getMessage());
} catch (Exception e) { } catch (Exception e) {

View File

@ -1,16 +1,26 @@
package com.dkha.server.controllers; package com.dkha.server.controllers;
import com.dkha.common.enums.ApiUrlEnum;
import com.dkha.common.exception.DkException; import com.dkha.common.exception.DkException;
import com.dkha.common.http.HttpUtil;
import com.dkha.common.modules.vo.CompareMuch;
import com.dkha.common.modules.vo.ReturnVO;
import com.dkha.common.modules.vo.face.ApiFaceOneSearchReturnFaceVO;
import com.dkha.common.modules.vo.facelib.CompareRequestVo; import com.dkha.common.modules.vo.facelib.CompareRequestVo;
import com.dkha.common.modules.vo.facelib.OneToOneResultVo;
import com.dkha.common.modules.vo.search.FaceCompareVO;
import com.dkha.common.result.CommonResult; import com.dkha.common.result.CommonResult;
import com.dkha.common.util.JsonUtil;
import com.dkha.common.util.UtilValidate; import com.dkha.common.util.UtilValidate;
import com.dkha.server.services.ICompareService; import com.dkha.server.services.ICompareService;
import com.fasterxml.jackson.core.type.TypeReference;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -29,6 +39,10 @@ public class CompareController extends CommonResult {
@Autowired @Autowired
private ICompareService compareService; private ICompareService compareService;
@Value("${api.server.prefix}")
private String apiServerPrefix;
@Autowired
private HttpUtil httpUtil;
@PostMapping(value = "/grouping") @PostMapping(value = "/grouping")
@ApiOperation(value = "分组比对") @ApiOperation(value = "分组比对")
@ -47,6 +61,29 @@ public class CompareController extends CommonResult {
@RequestBody CompareRequestVo compareRequestVo) { @RequestBody CompareRequestVo compareRequestVo) {
return successResult(compareService.oneToOne(compareRequestVo)); return successResult(compareService.oneToOne(compareRequestVo));
} }
@PostMapping(value = "/oneToMuch")
@ApiOperation(value = "一比多比对")
// @RequiresPermissions("face:onetoone:comparison")
public CommonResult oneToMuchCompare(
@ApiParam(required = true, name = "compareRequestVo", value = "")
@RequestBody CompareRequestVo compareRequestVo) {
System.out.println("comparerequest"+compareRequestVo);
String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON_MUCH.getUrl();
// String apiUrltest = "http://192.168.1.196:5001/compare";
FaceCompareVO faceCompareVO = new FaceCompareVO();
faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0));
faceCompareVO.setExtraMeta(compareRequestVo.getValue());
ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrl, faceCompareVO, ReturnVO.class);
CompareMuch compareMuch = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference<CompareMuch>() {});
//返回结果集
OneToOneResultVo oneToOneResultVo = new OneToOneResultVo();
if (UtilValidate.isNotEmpty(compareMuch)) {
oneToOneResultVo.getUrls().add(compareMuch.getRphoto());
oneToOneResultVo.setScore(compareMuch.getHitSimilarity());
}
System.out.println(oneToOneResultVo);
return successResult(oneToOneResultVo);
}
@PostMapping(value = "/oneToOneImage") @PostMapping(value = "/oneToOneImage")
@ApiOperation(value = "一比一比对上传 Image") @ApiOperation(value = "一比一比对上传 Image")
//@RequiresPermissions("employment:contract:upload") //@RequiresPermissions("employment:contract:upload")

View File

@ -176,7 +176,7 @@ public class FaceController extends CommonResult {
// compareFaceLists = oncompareFacelist; // compareFaceLists = oncompareFacelist;
for (FaceInformation faceInformation :onfaceInformations){ for (FaceInformation faceInformation :onfaceInformations){
// if(UtilValidate.isNotEmpty(com.getName())){ // if(UtilValidate.isNotEmpty(com.getName())){
//根据人脸名称去人像库中寻找rphoto //根据人脸名称,实际是id——portrait去人像库中寻找rphoto
QueryWrapper<Portrait> queryWrapper=new QueryWrapper<>(); QueryWrapper<Portrait> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("id_portrait",faceInformation.getName()); queryWrapper.eq("id_portrait",faceInformation.getName());
Portrait rphoto = iPortraitService.getBaseMapper().selectOne(queryWrapper); Portrait rphoto = iPortraitService.getBaseMapper().selectOne(queryWrapper);
@ -226,6 +226,7 @@ public class FaceController extends CommonResult {
} }
@GetMapping("test0509") @GetMapping("test0509")
public void getUrl(@RequestParam("url") String url) { public void getUrl(@RequestParam("url") String url) {
System.out.println(apiServerPrefix);
System.out.println("获取url"+url); System.out.println("获取url"+url);
} }

View File

@ -10,10 +10,8 @@ import com.dkha.common.modules.vo.warning.WarningBayonetReturnVO;
import com.dkha.common.result.CommonResult; import com.dkha.common.result.CommonResult;
import com.dkha.common.util.UtilValidate; import com.dkha.common.util.UtilValidate;
import com.dkha.server.common.config.InitStartDateConfig; import com.dkha.server.common.config.InitStartDateConfig;
import com.dkha.server.modules.entities.ControlLibraryMid; import com.dkha.server.mappers.FaceInformationMapper;
import com.dkha.server.modules.entities.ControlTask; import com.dkha.server.modules.entities.*;
import com.dkha.server.modules.entities.FaceLibrary;
import com.dkha.server.modules.entities.Portrait;
import com.dkha.server.services.IControlTaskService; import com.dkha.server.services.IControlTaskService;
import com.dkha.server.services.IFaceLibraryService; import com.dkha.server.services.IFaceLibraryService;
import com.dkha.server.services.IPortraitService; import com.dkha.server.services.IPortraitService;
@ -29,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -56,6 +55,7 @@ public class IndexContral extends CommonResult{
@Autowired @Autowired
private Gson gson; private Gson gson;
@Autowired @Autowired
private IFaceLibraryService iFaceLibraryService; private IFaceLibraryService iFaceLibraryService;
@Autowired @Autowired
@ -64,6 +64,9 @@ public class IndexContral extends CommonResult{
@Autowired @Autowired
private IPortraitService iPortraitService; private IPortraitService iPortraitService;
@Autowired
private FaceInformationMapper faceInformationMapper;
@GetMapping("/show") @GetMapping("/show")
@ApiOperation(value = "首页展示") @ApiOperation(value = "首页展示")
@ -76,6 +79,7 @@ public class IndexContral extends CommonResult{
Long b=InitStartDateConfig.initDate.getTime(); Long b=InitStartDateConfig.initDate.getTime();
// System.out.println("a-b的时间"+ (a-b)); // System.out.println("a-b的时间"+ (a-b));
Integer daysOfOperation=(int)((nowdate.getTime()-InitStartDateConfig.initDate.getTime())/(3600000*24)+1);//单位为毫秒 Integer daysOfOperation=(int)((nowdate.getTime()-InitStartDateConfig.initDate.getTime())/(3600000*24)+1);//单位为毫秒
daysOfOperation += 259;
//人像库数量 //人像库数量
Integer libNumber=0; Integer libNumber=0;
//人脸数量 //人脸数量
@ -99,13 +103,29 @@ public class IndexContral extends CommonResult{
try try
{ {
//人脸数量 Long numbershiwan =1681443666572L;
//要求为 1万*10+9格式的数字。。。。。。以下代码对功能没有实际作用
//先获取各人像库的idfactor
QueryWrapper<FaceLibrary> queryWrapper1 =new QueryWrapper<>();
List<FaceLibrary> id = iFaceLibraryService.getBaseMapper().selectList(queryWrapper1);
Long face_id[] =new Long[libNumber];
for (int i = 0; i < face_id.length; i++) {
face_id[i] = id.get(i).getIdFactory();
}
//在根据每个人像库的id进行查询
for (Long id_p: face_id) {
QueryWrapper<Portrait> queryWrapper=new QueryWrapper<>(); QueryWrapper<Portrait> queryWrapper=new QueryWrapper<>();
Portrait portrait=new Portrait(); Portrait portrait=new Portrait();
portrait.setIsValid("Y"); portrait.setIsValid("Y");
portrait.setIdFactory(id_p);
queryWrapper.setEntity(portrait); queryWrapper.setEntity(portrait);
faceNumber=iPortraitService.getBaseMapper().selectCount(queryWrapper); Integer faceNumber_intime=iPortraitService.getBaseMapper().selectCount(queryWrapper);
faceNumber = faceNumber*10; if(id_p.equals(numbershiwan)){
// faceNumber_intime =faceNumber_intime*10;
faceNumber_intime = 10000*10+(faceNumber_intime-10000);
}
faceNumber =faceNumber+faceNumber_intime;
}
}catch (Exception e){} }catch (Exception e){}
try try
@ -123,14 +143,18 @@ public class IndexContral extends CommonResult{
pageVO.setPageSize(1); pageVO.setPageSize(1);
pageVO.setPageNo(1); pageVO.setPageNo(1);
apiAlarmVO.setPage(pageVO); apiAlarmVO.setPage(pageVO);
ApiVO warningVO = (ApiVO) httpUtil.post(link + ApiUrlEnum.ALARMS_POSTURL.getUrl(), apiAlarmVO, ApiVO.class); //查询累计抓拍总数
if (!UtilValidate.isEmpty(warningVO)) {
if (!UtilValidate.isEmpty(warningVO) && !UtilValidate.isEmpty(warningVO.getData())) { QueryWrapper<FaceInformation> queryWrapper2 = new QueryWrapper<>();
WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class); warnNumber = faceInformationMapper.selectCount(queryWrapper2).longValue();
warnNumber=wvo.getPage().getTotal(); // ApiVO warningVO = (ApiVO) httpUtil.post("192.168.1.196:8889/face/warning/todayBayonet", apiAlarmVO, ApiVO.class);
} // if (!UtilValidate.isEmpty(warningVO)) {
} // if (!UtilValidate.isEmpty(warningVO) && !UtilValidate.isEmpty(warningVO.getData())) {
warnNumber = warnNumber+5000; // WarningBayonetReturnVO wvo = gson.fromJson(gson.toJson(warningVO.getData()), WarningBayonetReturnVO.class);
// warnNumber=wvo.getPage().getTotal();
// }
// }
// warnNumber = warnNumber+5000;
}catch (Exception e) }catch (Exception e)
{ {
@ -140,7 +164,7 @@ public class IndexContral extends CommonResult{
myMap.put("libNumber",libNumber); myMap.put("libNumber",libNumber);
myMap.put("faceNumber",faceNumber); myMap.put("faceNumber",faceNumber);
myMap.put("taskNumber",taskNumber); myMap.put("taskNumber",taskNumber);
myMap.put("warnNumber",warnNumber+5000); myMap.put("warnNumber",warnNumber);
//myMap.put("warnNumber",4); //myMap.put("warnNumber",4);
myMap.put("daysOfOperation",daysOfOperation); myMap.put("daysOfOperation",daysOfOperation);
return successResult(myMap); return successResult(myMap);

View File

@ -1,5 +1,6 @@
package com.dkha.server.controllers; package com.dkha.server.controllers;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dkha.common.enums.YNEnums; import com.dkha.common.enums.YNEnums;
import com.dkha.common.exception.DkException; import com.dkha.common.exception.DkException;
@ -35,6 +36,7 @@ import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @version V1.0 * @version V1.0
@ -142,6 +144,22 @@ public class ResourcesController extends CommonResult {
"\t}\n" + "\t}\n" +
"}")@RequestBody PageParam pageParam){ "}")@RequestBody PageParam pageParam){
Page<FaceLibrary> page = iFaceLibraryService.queryLibrary(pageParam); Page<FaceLibrary> page = iFaceLibraryService.queryLibrary(pageParam);
//以下为了满足甲方的 1万*10+9=100009无理要求所做,没有实际作用
List<FaceLibrary> faceLibraryList =page.getRecords();
// QueryWrapper<FaceLibrary> queryWrapper=new QueryWrapper<>();
// FaceLibrary shiwanlibrary = iFaceLibraryService.getBaseMapper().selectById(1681443666572L);
for (int i =0;i<faceLibraryList.size();i++) {
if(faceLibraryList.get(i).getIdFactory().equals(1681443666572L)){
// faceLibraryList.get(i).setNumber(faceLibraryList.get(i).getNumber()+ "0");
String s =faceLibraryList.get(i).getNumber();
faceLibraryList.get(i).setNumber(String.valueOf((Integer.parseInt(s) - 10000)+100000));
// System.out.println("输出人像表的人脸数量number"+ faceLibraryList.get(i).getNumber());
}
}
page.setRecords(faceLibraryList);
// System.out.println("facelibrary的total"+page.getTotal());
return successResult(page); return successResult(page);
} }
@ApiOperation("上传人像附件") @ApiOperation("上传人像附件")
@ -279,6 +297,12 @@ public class ResourcesController extends CommonResult {
"}")@RequestBody PageParam pageParam){ "}")@RequestBody PageParam pageParam){
//ReturnVO page = iPortraitService.queryPortrait(pageParam) //ReturnVO page = iPortraitService.queryPortrait(pageParam)
Page<Portrait> page = iPortraitService.queryPortrait(pageParam); Page<Portrait> page = iPortraitService.queryPortrait(pageParam);
System.out.println(pageParam.getNote().get("libraryId"));
if (Long.valueOf(pageParam.getNote().get("libraryId")).equals(1681443666572L)){
Long i =page.getTotal();
page.setTotal(100000L+ (i-10000));
// String.valueOf((Integer.parseInt(s) - 10000)+100000)
}
return successResult(page); return successResult(page);
} }

View File

@ -451,7 +451,7 @@ public class WarningController extends CommonResult {
// e.printStackTrace(); // e.printStackTrace();
// return failResult("查询异常:" + e.getMessage()); // return failResult("查询异常:" + e.getMessage());
// } // }
System.out.println(apiAlarmVO); //System.out.println(apiAlarmVO);
QueryWrapper<FaceInformation> queryWrapper=new QueryWrapper<>(); QueryWrapper<FaceInformation> queryWrapper=new QueryWrapper<>();
if(UtilValidate.isNotEmpty(apiAlarmVO.getPage().getStartTimestamp()) if(UtilValidate.isNotEmpty(apiAlarmVO.getPage().getStartTimestamp())
&&UtilValidate.isNotEmpty(apiAlarmVO.getPage().getStopTimestamp())) { &&UtilValidate.isNotEmpty(apiAlarmVO.getPage().getStopTimestamp())) {
@ -473,7 +473,7 @@ public class WarningController extends CommonResult {
pages.setCurrent(apiAlarmVO.getPage().getPageNo()); pages.setCurrent(apiAlarmVO.getPage().getPageNo());
pages.setSize(apiAlarmVO.getPage().getPageSize()); pages.setSize(apiAlarmVO.getPage().getPageSize());
IPage<FaceInformation> faceInformations = faceInformationMapper.selectPage(pages,queryWrapper); IPage<FaceInformation> faceInformations = faceInformationMapper.selectPage(pages,queryWrapper);
System.out.println(faceInformations.getRecords()); //System.out.println(faceInformations.getRecords());
Integer faceInformationsNumber = 0; Integer faceInformationsNumber = 0;
faceInformationsNumber = faceInformationMapper.selectCount(queryWrapper); faceInformationsNumber = faceInformationMapper.selectCount(queryWrapper);
pages.setRecords(faceInformations.getRecords()); pages.setRecords(faceInformations.getRecords());

View File

@ -19,6 +19,7 @@ import com.dkha.common.util.UtilValidate;
import com.dkha.server.mappers.ControlLibraryMidMapper; import com.dkha.server.mappers.ControlLibraryMidMapper;
import com.dkha.server.mappers.ControlTaskMapper; import com.dkha.server.mappers.ControlTaskMapper;
import com.dkha.server.mappers.FaceCameraDao; import com.dkha.server.mappers.FaceCameraDao;
import com.dkha.server.mappers.FaceLibraryMapper;
import com.dkha.server.modules.entities.*; import com.dkha.server.modules.entities.*;
import com.dkha.server.services.*; import com.dkha.server.services.*;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
@ -52,6 +53,8 @@ public class ControlTaskServiceImpl extends ServiceImpl<ControlTaskMapper, Contr
@Autowired @Autowired
ControlTaskMapper controlTaskMapper; ControlTaskMapper controlTaskMapper;
@Autowired @Autowired
FaceLibraryMapper faceLibraryMapper;
@Autowired
FaceCameraDao faceCameraDao; FaceCameraDao faceCameraDao;
@Autowired @Autowired
ControlBayonetMidServiceImpl controlBayonetMidService; ControlBayonetMidServiceImpl controlBayonetMidService;
@ -229,7 +232,10 @@ public class ControlTaskServiceImpl extends ServiceImpl<ControlTaskMapper, Contr
System.out.println("开始添加任务"); System.out.println("开始添加任务");
String testUrl = "http://192.168.1.196:5001/addTask/"; String testUrl = "http://192.168.1.196:5001/addTask/";
System.out.println(strTaskNo); System.out.println(strTaskNo);
ReturnVO returnVO = (ReturnVO)httpUtil.get(testUrl+"?strtaskno="+strTaskNo+"&rtspurl="+rtspUrl,null, ReturnVO.class); //获取布控的库id和名称
String libId =taskvo.getLibIds().get(0);
String libName = faceLibraryMapper.selectById(libId).getFactoryName();
ReturnVO returnVO = (ReturnVO)httpUtil.get(testUrl+"?strtaskno="+strTaskNo+"&rtspurl="+rtspUrl+"&libId="+libId+"libName"+libName,null, ReturnVO.class);
System.out.println("输出新建结果"); System.out.println("输出新建结果");
System.out.println(returnVO); System.out.println(returnVO);
if(returnVO.getCode().equals(ErrEnum.OK.getCode())){ if(returnVO.getCode().equals(ErrEnum.OK.getCode())){

View File

@ -120,23 +120,23 @@ public class FaceCameraServiceImpl extends ServiceImpl<FaceCameraDao, FaceCamera
throw new DkException("参数为空"); throw new DkException("参数为空");
} }
//校验经纬度是否重复 //校验经纬度是否重复
// System.out.println("校验经纬度"); System.out.println("校验经纬度");
FaceCameraEntity faceCameraInfo = this.findByCoordinate(insertFaceCamera.getCameraLongitude(), insertFaceCamera.getCameraLatitude()); FaceCameraEntity faceCameraInfo = this.findByCoordinate(insertFaceCamera.getCameraLongitude(), insertFaceCamera.getCameraLatitude());
if (UtilValidate.isNotEmpty(faceCameraInfo)) { if (UtilValidate.isNotEmpty(faceCameraInfo)) {
throw new DkException("摄像头经纬度坐标重复"); throw new DkException("摄像头经纬度坐标重复");
} }
// System.out.println(insertFaceCamera.getCameraLongitude()); System.out.println(insertFaceCamera.getCameraLongitude());
// System.out.println(insertFaceCamera.getCameraLatitude()); System.out.println(insertFaceCamera.getCameraLatitude());
//摄像头名称,ip,rtsp地址重复性校验 // 摄像头名称,ip,rtsp地址重复性校验
// System.out.println("校验名称iprtsp地址"); System.out.println("校验名称iprtsp地址");
FaceCameraEntity nameEntity = baseMapper.selectOne(new QueryWrapper<FaceCameraEntity>().eq("camera_name", insertFaceCamera.getCameraName().trim()).eq("is_valid", YNEnums.YES.code)); FaceCameraEntity nameEntity = baseMapper.selectOne(new QueryWrapper<FaceCameraEntity>().eq("camera_name", insertFaceCamera.getCameraName().trim()).eq("is_valid", YNEnums.YES.code));
FaceCameraEntity ipEntity = baseMapper.selectOne(new QueryWrapper<FaceCameraEntity>().eq("ip", insertFaceCamera.getIp().trim()).eq("is_valid", YNEnums.YES.code)); FaceCameraEntity ipEntity = baseMapper.selectOne(new QueryWrapper<FaceCameraEntity>().eq("ip", insertFaceCamera.getIp().trim()).eq("is_valid", YNEnums.YES.code));
FaceCameraEntity rtspUrlEntity = baseMapper.selectOne(new QueryWrapper<FaceCameraEntity>().eq("rtsp_url", insertFaceCamera.getRtspUrl().trim()).eq("is_valid", YNEnums.YES.code)); FaceCameraEntity rtspUrlEntity = baseMapper.selectOne(new QueryWrapper<FaceCameraEntity>().eq("rtsp_url", insertFaceCamera.getRtspUrl().trim()).eq("is_valid", YNEnums.YES.code));
//版本码表关联 //版本码表关联
SysDictDataEntity brand = sysDictDataDao.selectById(insertFaceCamera.getIdBrand()); SysDictDataEntity brand = sysDictDataDao.selectById(insertFaceCamera.getIdBrand());
// System.out.println( insertFaceCamera.getCameraName()); System.out.println( insertFaceCamera.getCameraName());
// System.out.println( insertFaceCamera.getIp()); System.out.println( insertFaceCamera.getIp());
// System.out.println( insertFaceCamera.getRtspUrl()); System.out.println( insertFaceCamera.getRtspUrl());
if (UtilValidate.isEmpty(brand)) { if (UtilValidate.isEmpty(brand)) {
throw new DkException("摄像头型号不能为空"); throw new DkException("摄像头型号不能为空");
@ -152,7 +152,7 @@ public class FaceCameraServiceImpl extends ServiceImpl<FaceCameraDao, FaceCamera
if (rtspUrlEntity != null) { if (rtspUrlEntity != null) {
throw new DkException("摄像头rtsp地址不能重复"); throw new DkException("摄像头rtsp地址不能重复");
} }
// System.out.println("开始装填map"); System.out.println("开始装填map");
Map map = new HashMap(); Map map = new HashMap();
map.put("name", insertFaceCamera.getCameraName()); map.put("name", insertFaceCamera.getCameraName());
map.put("url", insertFaceCamera.getRtspUrl()); map.put("url", insertFaceCamera.getRtspUrl());