Commit a7fc5f1b authored by yzm's avatar yzm

修复bug

parent 56a562b4
......@@ -221,6 +221,10 @@ public class ExtController {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Map<String, Object> maps = new HashMap<String, Object>();
if(null==sbtdspsr.getSqurllj() ||"".equals(sbtdspsr.getSqurllj())){
String rtsp=getnewRtspVlue(sbtdspsr.getSbbh());
sbtdspsr.setSqurllj(rtsp);
}
maps.put("rtspvalue", sbtdspsr.getSqurllj());
maps.put("refresh", 1);
HttpEntity<String> formEntity = new HttpEntity<>(null, headers);
......@@ -229,6 +233,7 @@ public class ExtController {
HttpMethod.GET, formEntity, String.class, maps);
String body = exchange.getBody();
if(null==body|| "".equals(body)){
JSONObject json = JSONObject.parseObject(exchange.getBody());
//rtsp地址可能改变,重新获取
if(!videoid.contains("rtsp")) {
String rtsp = getnewRtspVlue(sbtdspsr.getSbbh());
......@@ -250,8 +255,17 @@ public class ExtController {
maps.put("rtspvalue", rtsp);
}
try{
if(imgUrls.size()==0){
logger.info("no picture data ");
return ResultUtil.success();
}
//根据rtsp 进行图片获取及存储
TraffAlarmRecord record = new TraffAlarmRecord();
Map<String, Object> transferRecordMap = new HashMap<>();
TraffAlarmRecord traffAlarmRecord = new TraffAlarmRecord();
traffAlarmRecord.setFdid(sbtdspsr.getSbbh());
traffAlarmRecord.setChannelid(Integer.parseInt(String.valueOf(sbtdspsr.getTdbh())));
traffAlarmRecord.setAreaid(Long.parseLong(sbtdspsr.getXzbh()));
int i = 0;
if(imgUrls.size()>0) {
i = 1;
......@@ -272,32 +286,22 @@ public class ExtController {
}
}
}
if(imgUrls.size()==0){
logger.info("no picture data ");
return ResultUtil.success();
}
//根据rtsp 进行图片获取及存储
TraffAlarmRecord record = new TraffAlarmRecord();
Map<String, Object> transferRecordMap = new HashMap<>();
TraffAlarmRecord traffAlarmRecord = new TraffAlarmRecord();
traffAlarmRecord.setFdid(sbtdspsr.getSbbh());
traffAlarmRecord.setChannelid(Integer.parseInt(String.valueOf(sbtdspsr.getTdbh())));
traffAlarmRecord.setAreaid(Long.parseLong(sbtdspsr.getXzbh()));
traffAlarmRecord.setCreatetime(new Date());
traffAlarmRecord.setPushstatus(9);
//免审
traffAlarmRecord.setCheckstatus(9);
//未提取特征
traffAlarmRecord.setProcessstatus("-2");
//存储到ftp 上去
for (int k = 0; k < imgUrls.size(); k++) {
TraffAlarmRecordFromImgEnum.valueOf("IMG" + k).setImg(traffAlarmRecord, imgUrls.get(k));
}
String basepath = "gstraff/" + traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign();
Ftp ftp = ftpService.reloadFtp();
//入表
traffAlarmRecordService.inserTraffAlarmRecord(traffAlarmRecord);
Long recordid = Long.parseLong(String.valueOf(traffAlarmRecordService.inserTraffAlarmRecord(traffAlarmRecord)));
FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap);
String basepath = "gstraff/" + traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign();
List<TransferResult> results = FileTransferManager.transferFile(transferRecordMap, ftp, basepath);
// logger.info("缓存数据上传结果:" + results.toString());
TraffAlarmRecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results);
......@@ -307,8 +311,6 @@ public class ExtController {
traffAlarmRecord.setImg4path(recordBak.getImg4path());
traffAlarmRecord.setImg5path(recordBak.getImg5path());
traffAlarmRecord.setVideopath(recordBak.getVideopath());
//未提取特征
traffAlarmRecord.setProcessstatus("-2");
//更新图片地址
traffAlarmRecordService.updateTraffAlarmRecordUrl(traffAlarmRecord);
return ResultUtil.success();
......@@ -344,15 +346,21 @@ public String getnewRtspVlue(String devicecode ){
}
return rtspnewvalue;
}
/***
* 适配算法偏移-30 的情况
* @param taskno
* @return
*/
@RequestMapping(value = "/getRecog", method = RequestMethod.POST)
public String getRecog(@RequestBody String videoid) {
public String getRecog(@RequestBody String taskno) {
//根据判断监控是否存在,该监控检测的事件是什么
List<Map> mapList = sbtdspsrService.selectRecogByRtsp(videoid);
List<Map> mapList = sbtdspsrService.selectRecogByRtsp(taskno);
String model ="1";
String recordtype ="1";
//图片框选出来的范围
Long[] roiarray=new Long[4];
String videoid="";
if (null != mapList && !mapList.equals("") && mapList.size()>0) {
//获得该监控的检测业务与检测范围
......@@ -386,9 +394,7 @@ public String getnewRtspVlue(String devicecode ){
String basepath = "gstraff/" + videoid+ "/" + DateUtils.formatCurrDayNoSign();
Map<String, Object> map = new HashMap<>();
if(videoid.indexOf("_")<0){
videoid=videoid+"_0";
}
if(videoid.split("_").length<2){
logger.info("监控不存在");
return ResultUtil.success();
......@@ -413,6 +419,8 @@ public String getnewRtspVlue(String devicecode ){
), base64Encoder, transferRecord);
if (param.getImageList().size() < 1) {
logger.info(" no imagelist ");
transferRecord.setProcessstatus("-1");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
continue;
}
requestEntity = new HttpEntity<>(JSONObject.toJSONString(param), headers);
......@@ -426,6 +434,7 @@ public String getnewRtspVlue(String devicecode ){
List<TraffpictureParam> objectList = (List<TraffpictureParam>) JSONArray.parseArray(String.valueOf(result.get("ObjectList")), TraffpictureParam.class);
//获得 type
//更新 recordalarm 为一分析
transferRecord.setProcessstatus("-1");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
if (objectList.size() < 1) {
logger.info(" no picturedata ");
......@@ -433,98 +442,194 @@ public String getnewRtspVlue(String devicecode ){
}
//根据结构化统计查询是否超过密度,超过则预警
Code code = codeservice.selectalarmNum(recordtype);
roiarray[0] = roiarray[0] - 30;
roiarray[1] = roiarray[1] - 30;
roiarray[2] = roiarray[2] - 30;
roiarray[3] = roiarray[3] - 30;
//判断是否统计结构化数据
TraffpictureParam traffpictureParamresult = new TraffpictureParam();
traffpictureParamresult.setImagedata(transferRecord.getImg1path());
if (("6".equals(recordtype) || "2".equals(recordtype))) {
if (null != code && null != code.getAlarmnum() && code.getAlarmnum() > objectList.size()) {
TraffpictureParam traffpictureParam = new TraffpictureParam();
setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParam);
traffpictureParam.setTargetnum(objectList.size());
if (null != code && null != code.getAlarmnum() && code.getAlarmnum() < objectList.size()) {
setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParamresult);
traffpictureParamresult.setTargetnum(objectList.size());
//超过则预警
traffpictureParam.setRecordtype(recordtype);
traffpictureParam.setImagedata(transferRecord.getImg1path());
traffPictureService.updateTraffpicture(traffpictureParam);
WebSocket.GroupSending(JSONObject.toJSONString(traffpictureParam));
traffpictureParamresult.setRecordtype(recordtype);
traffPictureService.updateTraffpicture(traffpictureParamresult);
}
} else {
}
if ((("6".equals(recordtype) || "2".equals(recordtype))
&& (null != code && null != code.getAlarmnum() && code.getAlarmnum() < objectList.size()))
&& (!"6".equals(recordtype) && !"2".equals(recordtype))) {
List<ObjectBoundingBox> list = new ArrayList<>();
for (TraffpictureParam traffpictureParam : objectList) {
//根据imageid 获得 base64图片
JSONObject metadata = JSONObject.parseObject(String.valueOf(traffpictureParam.getMetadata()));
JSONObject ObjectBoundingBox = metadata.getJSONObject("ObjectBoundingBox");
if (null == ObjectBoundingBox) {
traffpictureParam.setObjx(metadata.getIntValue("LeftTopX")+ roiarray[0].intValue());
traffpictureParam.setObjy(metadata.getIntValue("LeftTopY")+roiarray[1].intValue());
traffpictureParam.setObjw(metadata.getIntValue("RightBtmX") - metadata.getIntValue("LeftTopX"));
traffpictureParam.setObjh(metadata.getIntValue("RightBtmY") - metadata.getIntValue("LeftTopY"));
list.add(new ObjectBoundingBox(metadata.getIntValue("LeftTopX") + roiarray[0].intValue(),
metadata.getIntValue("LeftTopY") + roiarray[1].intValue(),
metadata.getIntValue("RightBtmX") - metadata.getIntValue("LeftTopX"),
metadata.getIntValue("RightBtmY") - metadata.getIntValue("LeftTopY")
));
} else {
traffpictureParam.setObjx(ObjectBoundingBox.getIntValue("X")+ roiarray[0].intValue());
traffpictureParam.setObjy(ObjectBoundingBox.getIntValue("Y")+roiarray[1].intValue());
traffpictureParam.setObjw(ObjectBoundingBox.getIntValue("W"));
traffpictureParam.setObjh(ObjectBoundingBox.getIntValue("H"));
list.add(new ObjectBoundingBox(ObjectBoundingBox.getIntValue("X") + roiarray[0].intValue(),
ObjectBoundingBox.getIntValue("Y") + roiarray[1].intValue(),
ObjectBoundingBox.getIntValue("W"),
ObjectBoundingBox.getIntValue("H")
));
}
if (null != metadata && metadata.get("Type").equals(model)) {
if (null != metadata) {
traffpictureParam.setMetatype(String.valueOf(metadata.get("Type")));
//规定区域内出现告警对象
setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParam);
//setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParam);
if ("1".equals(metadata.get("Type"))) {
//规定范围内检测到人
Pedestrian meta = JSON.toJavaObject(metadata, Pedestrian.class);
meta.setId(traffpictureParam.getId());
meta.setId(traffpictureParamresult.getId());
pedestrianService.insertpedestrian(meta);
//新增到事件详情表返回主键
if (null != meta.getFaceBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
meta.getFaceBoundingBox().getW(),
meta.getFaceBoundingBox().getH()
));
}
if (null != meta.getObjectBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
meta.getObjectBoundingBox().getW(),
meta.getObjectBoundingBox().getH()
));
}
if (null != meta.getHeadBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getHeadBoundingBox().getX() + roiarray[0].intValue(),
meta.getHeadBoundingBox().getY() + roiarray[1].intValue(),
meta.getHeadBoundingBox().getW(),
meta.getHeadBoundingBox().getH()
));
}
if (null != meta.getUpperBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getUpperBoundingBox().getX() + roiarray[0].intValue(),
meta.getUpperBoundingBox().getY() + roiarray[1].intValue(),
meta.getUpperBoundingBox().getW(),
meta.getUpperBoundingBox().getH()
));
}
if (null != meta.getLowerBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getLowerBoundingBox().getX() + roiarray[0].intValue(),
meta.getLowerBoundingBox().getY() + roiarray[1].intValue(),
meta.getLowerBoundingBox().getW(),
meta.getLowerBoundingBox().getH()
));
}
} else if (null != metadata && "2".equals(metadata.get("Type"))) {
//车辆
Traffic meta = JSON.toJavaObject(metadata, Traffic.class);
meta.setId(traffpictureParam.getId());
meta.setId(traffpictureParamresult.getId());
//新增到车辆详情表
trafficService.insertTraffic(meta);
if (null != meta.getObjectBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
meta.getObjectBoundingBox().getW(),
meta.getObjectBoundingBox().getH()
));
}
} else if (null != metadata && "3".equals(metadata.get("Type"))) {
Face meta = JSON.toJavaObject(metadata, Face.class);
meta.setId(traffpictureParam.getId());
meta.setId(traffpictureParamresult.getId());
faceService.insertFace(meta);
if (null != meta.getFaceBoundingBox()) {
traffpictureParam.setObjx(meta.getFaceBoundingBox().getX()+roiarray[0].intValue());
traffpictureParam.setObjy(meta.getFaceBoundingBox().getY()+roiarray[1].intValue());
traffpictureParam.setObjx(meta.getFaceBoundingBox().getX() + roiarray[0].intValue());
traffpictureParam.setObjy(meta.getFaceBoundingBox().getY() + roiarray[1].intValue());
traffpictureParam.setObjw(meta.getFaceBoundingBox().getW());
traffpictureParam.setObjh(meta.getFaceBoundingBox().getH());
}
if (null != meta.getFaceBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
meta.getFaceBoundingBox().getW(),
meta.getFaceBoundingBox().getH()
));
}
if (null != meta.getHeadBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getHeadBoundingBox().getX() + roiarray[0].intValue(),
meta.getHeadBoundingBox().getY() + roiarray[1].intValue(),
meta.getHeadBoundingBox().getW(),
meta.getHeadBoundingBox().getH()
));
}
//人骑车
} else if (null != metadata && "4".equals(metadata.get("Type"))) {
PeopleRideBicyc meta = JSON.toJavaObject(metadata, PeopleRideBicyc.class);
meta.setId(traffpictureParam.getId());
meta.setId(traffpictureParamresult.getId());
peopleridebicycService.insertPeopleRideBicyc(meta);
if (null != meta.getFaceBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
meta.getFaceBoundingBox().getW(),
meta.getFaceBoundingBox().getH()
));
}
if (null != meta.getObjectBoundingBox()) {
list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
meta.getObjectBoundingBox().getW(),
meta.getObjectBoundingBox().getH()
));
}
}
}
}
//更新 traffpicture特征值
try {
ByteArrayInputStream bais = new ByteArrayInputStream(base64Decoder.decodeBuffer(traffpictureParam.getImagedata()));
byte[] Img = FTPUtil.getFtpPicBytes(traffpictureParamresult.getImagedata());
if (null != Img) {
ByteArrayInputStream bais = new ByteArrayInputStream(Img);
BufferedImage image = ImageIO.read(bais);
Graphics g = image.getGraphics();
g.setColor(Color.RED);
if (null != traffpictureParam.getObjx() && null != traffpictureParam.getObjy() && null != traffpictureParam.getObjw() && null != traffpictureParam.getObjh())
g.drawRect(traffpictureParam.getObjx(), traffpictureParam.getObjy(), traffpictureParam.getObjw(), traffpictureParam.getObjh());
for (ObjectBoundingBox box : list) {
//if (null != box.getX() && null != traffpictureParam.getObjy() && null != traffpictureParam.getObjw() && null != traffpictureParam.getObjh())
if (null != box)
g.drawRect(box.getX(),
box.getY(),
box.getW(),
box.getH());
}
ByteArrayOutputStream stream = new ByteArrayOutputStream();
ImageIO.write(image, "png", stream);
//上传ftp
Ftp ftp = ftpService.reloadFtp();
String ftputl = FTPUtil.getFtpUrl(ftp) + basepath + "/" + traffpictureParam.getId() + "/imgdata.png";
traffpictureParam.setImagedata(ftputl);
FTPUtil.uploadFile(ftp, basepath + "/" + traffpictureParam.getId(), "imgdata.png", base64Encoder.encode(stream.toByteArray()));
String filename = DateUtils.formatCurrDateNoSign() + "imgdata.png";
String ftputl = FTPUtil.getFtpUrl(ftp) + basepath + "/" + traffpictureParamresult.getId() + "/" + filename;
traffpictureParamresult.setImagedata(ftputl);
FTPUtil.uploadFile(ftp, basepath + "/" + traffpictureParamresult.getId(), filename, base64Encoder.encode(stream.toByteArray()));
}
} catch (Exception ex) {
logger.info("base64画框异常:" + ex.toString());
}
traffPictureService.updateTraffpicture(traffpictureParam);
}
traffPictureService.updateTraffpicture(traffpictureParamresult);
//推送告警
WebSocket.GroupSending(JSONObject.toJSONString(traffpictureParam));
}
WebSocket.GroupSending(JSONObject.toJSONString(traffpictureParamresult));
}
}
} catch (Exception ex) {
......@@ -543,6 +648,303 @@ public String getnewRtspVlue(String devicecode ){
return ResultUtil.fail();
}
/***
* 原来推送
* @param recordtype
* @param base64Encoder
* @param transferRecord
* @param traffpictureParam
*/
// @RequestMapping(value = "/getRecog", method = RequestMethod.POST)
// public String getRecog(@RequestBody String videoid) {
// //根据判断监控是否存在,该监控检测的事件是什么
// List<Map> mapList = sbtdspsrService.selectRecogByRtsp(videoid);
// String model ="1";
// String recordtype ="1";
// //图片框选出来的范围
// Long[] roiarray=new Long[4];
//
// if (null != mapList && !mapList.equals("") && mapList.size()>0) {
//
// //获得该监控的检测业务与检测范围
// for (Map<String, Object> map: mapList) {
// for (Map.Entry<String, Object> maps:map.entrySet()) {
// if("videoid".equals(maps.getKey())){
// videoid = String.valueOf(maps.getValue());
// }
// else if("metatype".equals(maps.getKey())){
// model = String.valueOf(maps.getValue());
// }
// else if("recordtype".equals(maps.getKey())){
// recordtype = String.valueOf(maps.getValue());
// }
// else if("objectx".equals(maps.getKey())){
// roiarray[0]=new Long(String.valueOf(maps.getValue()));
// }
//
// else if("objecty".equals(maps.getKey())){
// roiarray[1]=new Long(String.valueOf(maps.getValue()));
// }
// else if("objectw".equals(maps.getKey())){
// roiarray[2]=new Long(String.valueOf(maps.getValue()));
// }
// else if("objecth".equals(maps.getKey())){
// roiarray[3]=new Long(String.valueOf(maps.getValue()));
// }
// }
// }
// //查询该监控下面还没有经过分析的数据
// String basepath = "gstraff/" + videoid+ "/" + DateUtils.formatCurrDayNoSign();
//
// Map<String, Object> map = new HashMap<>();
//
// if(videoid.split("_").length<2){
// logger.info("监控不存在");
// return ResultUtil.success();
// }
//
// map.put("sbbh", videoid.split("_")[0]);
// map.put("tdbh", videoid.split("_")[1]);
// List<TraffAlarmRecord> traffalarmrecordlist = traffAlarmRecordService.getTraffAlarmRecordByProgress(map);
// if(traffalarmrecordlist.size()<1) {
// return ResultUtil.success();
// }
// BASE64Decoder base64Decoder = new BASE64Decoder();
// //开启多线程
// //调用结构化服务,获得图片返回结果
// HttpHeaders headers = new HttpHeaders();
// BASE64Encoder base64Encoder = new BASE64Encoder();
// headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
// HttpEntity<String> requestEntity = null;
// for (TraffAlarmRecord transferRecord : traffalarmrecordlist) {
// GoalStructureParam param = FileTransferManager.getGoalStructureParam(roiarray,
// Integer.parseInt(model == null ? "1" : "".equals(model) ? "1" : model
// ), base64Encoder, transferRecord);
// if (param.getImageList().size() < 1) {
// logger.info(" no imagelist ");
// continue;
// }
// requestEntity = new HttpEntity<>(JSONObject.toJSONString(param), headers);
// try {
// ResponseEntity<String> response = restTemplate.exchange(recogurl, HttpMethod.POST, requestEntity, String.class);
//
// String body = response.getBody();
// JSONObject result = JSONObject.parseObject(body);
// if (null != result.get("ret") && result.get("ret").equals("200")) {
// //获得返回结果,根据 Metadata.type 判断是人,车,人骑车,并将详细信息入对应的表
// List<TraffpictureParam> objectList = (List<TraffpictureParam>) JSONArray.parseArray(String.valueOf(result.get("ObjectList")), TraffpictureParam.class);
// //获得 type
// //更新 recordalarm 为一分析
// traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
// if (objectList.size() < 1) {
// logger.info(" no picturedata ");
// continue;
// }
// //根据结构化统计查询是否超过密度,超过则预警
// Code code = codeservice.selectalarmNum(recordtype);
// //判断是否统计结构化数据
// if (("6".equals(recordtype) || "2".equals(recordtype))) {
// if (null != code && null != code.getAlarmnum() && code.getAlarmnum() < objectList.size()) {
// TraffpictureParam traffpictureParam = new TraffpictureParam();
// setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParam);
// traffpictureParam.setTargetnum(objectList.size());
// //超过则预警
// traffpictureParam.setRecordtype(recordtype);
// traffpictureParam.setImagedata(transferRecord.getImg1path());
// traffPictureService.updateTraffpicture(traffpictureParam);
//
// //WebSocket.GroupSending(JSONObject.toJSONString(traffpictureParam));
// }
// }
// //为了适配算法偏移-30问题
//
//
// List<ObjectBoundingBox> list=new ArrayList<>();
// for (TraffpictureParam traffpictureParam : objectList) {
//
// //根据imageid 获得 base64图片
// JSONObject metadata = JSONObject.parseObject(String.valueOf(traffpictureParam.getMetadata()));
// JSONObject ObjectBoundingBox = metadata.getJSONObject("ObjectBoundingBox");
// if (null == ObjectBoundingBox) {
// traffpictureParam.setObjx(metadata.getIntValue("LeftTopX")+ roiarray[0].intValue());
// traffpictureParam.setObjy(metadata.getIntValue("LeftTopY")+roiarray[1].intValue());
// traffpictureParam.setObjw(metadata.getIntValue("RightBtmX") - metadata.getIntValue("LeftTopX"));
// traffpictureParam.setObjh(metadata.getIntValue("RightBtmY") - metadata.getIntValue("LeftTopY"));
// list.add(new ObjectBoundingBox(metadata.getIntValue("LeftTopX")+ roiarray[0].intValue(),
// metadata.getIntValue("LeftTopY")+roiarray[1].intValue(),
// metadata.getIntValue("RightBtmX") - metadata.getIntValue("LeftTopX"),
// metadata.getIntValue("RightBtmY") - metadata.getIntValue("LeftTopY")
// ));
// } else {
// traffpictureParam.setObjx(ObjectBoundingBox.getIntValue("X")+ roiarray[0].intValue());
// traffpictureParam.setObjy(ObjectBoundingBox.getIntValue("Y")+roiarray[1].intValue());
// traffpictureParam.setObjw(ObjectBoundingBox.getIntValue("W"));
// traffpictureParam.setObjh(ObjectBoundingBox.getIntValue("H"));
// list.add(new ObjectBoundingBox(ObjectBoundingBox.getIntValue("X")+ roiarray[0].intValue(),
// ObjectBoundingBox.getIntValue("Y")+roiarray[1].intValue(),
// ObjectBoundingBox.getIntValue("W"),
// ObjectBoundingBox.getIntValue("H")
// ));
// }
// if (null != metadata ) {
// traffpictureParam.setMetatype(String.valueOf(metadata.get("Type")));
// //规定区域内出现告警对象
// setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParam);
// if ("1".equals(metadata.get("Type"))) {
// //规定范围内检测到人
// Pedestrian meta = JSON.toJavaObject(metadata, Pedestrian.class);
// meta.setId(traffpictureParam.getId());
// pedestrianService.insertpedestrian(meta);
// if(null!=meta.getFaceBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX()+roiarray[0].intValue(),
// meta.getFaceBoundingBox().getY()+roiarray[1].intValue(),
// meta.getFaceBoundingBox().getW(),
// meta.getFaceBoundingBox().getH()
// ));
// }
// if(null!=meta.getObjectBoundingBox()){
//
// list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX()+roiarray[0].intValue() ,
// meta.getObjectBoundingBox().getY()+roiarray[1].intValue(),
// meta.getObjectBoundingBox().getW(),
// meta.getObjectBoundingBox().getH()
// ));
// }
//
// if(null!=meta.getHeadBoundingBox()){
//
// list.add(new ObjectBoundingBox(meta.getHeadBoundingBox().getX() +roiarray[0].intValue(),
// meta.getHeadBoundingBox().getY() +roiarray[1].intValue(),
// meta.getHeadBoundingBox().getW(),
// meta.getHeadBoundingBox().getH()
// ));
// }
//
// if(null!=meta.getUpperBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getUpperBoundingBox().getX() +roiarray[0].intValue(),
// meta.getUpperBoundingBox().getY() +roiarray[1].intValue(),
// meta.getUpperBoundingBox().getW(),
// meta.getUpperBoundingBox().getH()
// ));
// }
// if(null!=meta.getLowerBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getLowerBoundingBox().getX() +roiarray[0].intValue(),
// meta.getLowerBoundingBox().getY() +roiarray[1].intValue(),
// meta.getLowerBoundingBox().getW(),
// meta.getLowerBoundingBox().getH()
// ));
// }
//
// } else if (null != metadata && "2".equals(metadata.get("Type"))) {
// //车辆
// Traffic meta = JSON.toJavaObject(metadata, Traffic.class);
// meta.setId(traffpictureParam.getId());
// //新增到车辆详情表
// trafficService.insertTraffic(meta);
// if(null!=meta.getObjectBoundingBox()){
//
// list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
// meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
// meta.getObjectBoundingBox().getW(),
// meta.getObjectBoundingBox().getH()
// ));
// }
//
// } else if (null != metadata && "3".equals(metadata.get("Type"))) {
// Face meta = JSON.toJavaObject(metadata, Face.class);
// meta.setId(traffpictureParam.getId());
// faceService.insertFace(meta);
// if (null != meta.getFaceBoundingBox()) {
// traffpictureParam.setObjx(meta.getFaceBoundingBox().getX()+roiarray[0].intValue());
// traffpictureParam.setObjy(meta.getFaceBoundingBox().getY()+roiarray[1].intValue());
// traffpictureParam.setObjw(meta.getFaceBoundingBox().getW());
// traffpictureParam.setObjh(meta.getFaceBoundingBox().getH());
// }
//
// if(null!=meta.getFaceBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
// meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
// meta.getFaceBoundingBox().getW(),
// meta.getFaceBoundingBox().getH()
// ));
// }
// if(null!=meta.getHeadBoundingBox()){
//
// list.add(new ObjectBoundingBox(meta.getHeadBoundingBox().getX() + roiarray[0].intValue(),
// meta.getHeadBoundingBox().getY() + roiarray[1].intValue(),
// meta.getHeadBoundingBox().getW(),
// meta.getHeadBoundingBox().getH()
// ));
// }
// //人骑车
// } else if (null != metadata && "4".equals(metadata.get("Type"))) {
// PeopleRideBicyc meta = JSON.toJavaObject(metadata, PeopleRideBicyc.class);
// meta.setId(traffpictureParam.getId());
// peopleridebicycService.insertPeopleRideBicyc(meta);
// if(null!=meta.getFaceBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
// meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
// meta.getFaceBoundingBox().getW(),
// meta.getFaceBoundingBox().getH()
// ));
// }
// if(null!=meta.getObjectBoundingBox()){
//
// list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
// meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
// meta.getObjectBoundingBox().getW(),
// meta.getObjectBoundingBox().getH()
// ));
// }
// }
// //更新 traffpicture特征值
// try {
// ByteArrayInputStream bais = new ByteArrayInputStream(base64Decoder.decodeBuffer(traffpictureParam.getImagedata()));
// BufferedImage image = ImageIO.read(bais);
// Graphics g = image.getGraphics();
// g.setColor(Color.RED);
// for(ObjectBoundingBox box :list) {
// //if (null != box.getX() && null != traffpictureParam.getObjy() && null != traffpictureParam.getObjw() && null != traffpictureParam.getObjh())
// if(null!=box)
// g.drawRect(box.getX(),
// box.getY(),
// box.getW(),
// box.getH());
// }
//
// ByteArrayOutputStream stream = new ByteArrayOutputStream();
// ImageIO.write(image, "png", stream);
// //上传ftp
// Ftp ftp = ftpService.reloadFtp();
// String ftputl = FTPUtil.getFtpUrl(ftp) + basepath + "/" + traffpictureParam.getId() + "/imgdata.png";
// traffpictureParam.setImagedata(ftputl);
// FTPUtil.uploadFile(ftp, basepath + "/" + traffpictureParam.getId(), "imgdata.png", base64Encoder.encode(stream.toByteArray()));
//
// } catch (Exception ex) {
// logger.info("base64画框异常:" + ex.toString());
// }
// traffPictureService.updateTraffpicture(traffpictureParam);
// }
//
// //推送告警
// WebSocket.GroupSending(JSONObject.toJSONString(traffpictureParam));
// }
// }
// } catch (Exception ex) {
// //推送失败
// transferRecord.setProcessstatus("-3");
// traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
// }
// }
// return ResultUtil.success();
// } else {
// logger.info("监控不属于该范围");
// }
// //更新record 表Progress 字段,0为 未检测,-2 为检测失败,将检测
// //结果进行额外封装入表
// logger.error("rtsp 不存在-->");
// return ResultUtil.fail();
// }
private void setTraffpictureParam(String recordtype, BASE64Encoder base64Encoder, TraffAlarmRecord transferRecord, TraffpictureParam traffpictureParam) {
traffpictureParam.setAreaid(transferRecord.getAreaid());
traffpictureParam.setFdid(transferRecord.getFdid());
......@@ -550,15 +952,15 @@ public String getnewRtspVlue(String devicecode ){
traffpictureParam.setChannelid(transferRecord.getChannelid());
traffpictureParam.setCreatetime(new Date());
//获得imgid 对应的 base64
String imgftpurl = traffPictureService.queryimgpath(traffpictureParam);
Ftp ftp = ftpService.reloadFtp();
if (null != imgftpurl && !"".equals(imgftpurl)) {
byte[] Img = FTPUtil.getFtpPicBytes(imgftpurl);
if (null != Img) {
traffpictureParam.setImagedata(base64Encoder.encode(Img));
}
}
// String imgftpurl = traffPictureService.queryimgpath(traffpictureParam);
// Ftp ftp = ftpService.reloadFtp();
// if (null != imgftpurl && !"".equals(imgftpurl)) {
// byte[] Img = FTPUtil.getFtpPicBytes(imgftpurl);
// if (null != Img) {
// traffpictureParam.setImagedata(base64Encoder.encode(Img));
// }
// }
traffpictureParam.setRecordtype(recordtype);
//新增到picture
int id = traffPictureService.inserTraffpicture(traffpictureParam);
......
......@@ -9,6 +9,14 @@ public class ObjectBoundingBox {
private int y;
private int w;
private int h;
public ObjectBoundingBox(int x, int y, int w, int h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
public void setX(int x) {
this.x = x;
}
......
......@@ -11,7 +11,7 @@
<result column="rectifytime" jdbcType="INTEGER" property="rectifytime" />
<result column="manualchecktime" jdbcType="INTEGER" property="manualchecktime" />
<result column="pushchecktime" jdbcType="INTEGER" property="pushchecktime" />
<result column="maxnum" jdbcType="INTEGER" property="maxnum" />
<result column="maxnumvalue" jdbcType="INTEGER" property="maxnum" />
<result column="alarmnum" jdbcType="INTEGER" property="alarmnum" />
</resultMap>
<select id="selectalarmNum" resultMap="BaseResultMap">
......
......@@ -26,14 +26,14 @@
insert into face
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id!= null">id,</if>
<if test="FaceBoundingBox.x!= null">facex,</if>
<if test="FaceBoundingBox.y!= null">facey,</if>
<if test="FaceBoundingBox.w!= null">facew,</if>
<if test="FaceBoundingBox.h!= null">faceh,</if>
<if test="HeadBoundingBox.x!= null">headx,</if>
<if test="HeadBoundingBox.y!= null">heady,</if>
<if test="HeadBoundingBox.w!= null">headw,</if>
<if test="HeadBoundingBox.h!= null">headh,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">facex,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">facey,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">facew,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">faceh,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">headx,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">heady,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">headw,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">headh,</if>
<if test="Gender != null">gender ,</if>
<if test="Age != null">age ,</if>
<if test="HasGlasses != null">hasglasses ,</if>
......@@ -43,14 +43,14 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="FaceBoundingBox.x!= null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox.y!= null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox.w!= null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox.h!= null">#{FaceBoundingBox.h},</if>
<if test="HeadBoundingBox.x!= null">#{HeadBoundingBox.x},</if>
<if test="HeadBoundingBox.y!= null">#{HeadBoundingBox.y},</if>
<if test="HeadBoundingBox.w!= null">#{HeadBoundingBox.w},</if>
<if test="HeadBoundingBox.h!= null">#{HeadBoundingBox.h},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">#{FaceBoundingBox.h},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">#{HeadBoundingBox.x},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">#{HeadBoundingBox.y},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">#{HeadBoundingBox.w},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">#{HeadBoundingBox.h},</if>
<if test="Gender != null">#{Gender},</if>
<if test="Age!= null">#{Age},</if>
<if test="HasGlasses!= null">#{HasGlasses},</if>
......
......@@ -68,22 +68,22 @@
<if test="TrousersLength!= null">trouserslength ,</if>
<if test="TrousersColorNums!= null">trouserscolornums ,</if>
<if test="TrousersColor!= null">trouserscolor ,</if>
<if test="HeadBoundingBox.x!= null">headx ,</if>
<if test="HeadBoundingBox.y!= null">heady ,</if>
<if test="HeadBoundingBox.w!= null">headw ,</if>
<if test="HeadBoundingBox.h!= null">headh ,</if>
<if test="UpperBoundingBox.x!= null">upperx ,</if>
<if test="UpperBoundingBox.y!= null">uppery ,</if>
<if test="UpperBoundingBox.w!= null">upperw ,</if>
<if test="UpperBoundingBox.h!= null">upperh ,</if>
<if test="LowerBoundingBox.x!= null">lowerx ,</if>
<if test="LowerBoundingBox.y!= null">lowery ,</if>
<if test="LowerBoundingBox.w!= null">lowerw ,</if>
<if test="LowerBoundingBox.h!= null">lowerh ,</if>
<if test="FaceBoundingBox.x!= null">facex ,</if>
<if test="FaceBoundingBox.y!= null">facey ,</if>
<if test="FaceBoundingBox.w!= null">facew ,</if>
<if test="FaceBoundingBox.h!= null">faceh ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">headx ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">heady ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">headw ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">headh ,</if>
<if test="HeadBoundingBox!=null and UpperBoundingBox.x!= null">upperx ,</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.y!= null">uppery ,</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.w!= null">upperw ,</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.h!= null">upperh ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.x!= null">lowerx ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.y!= null">lowery ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.w!= null">lowerw ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.h!= null">lowerh ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">facex ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">facey ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">facew ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">faceh ,</if>
<if test="HasHat!= null">hashat ,</if>
<if test="HasMask!= null">hasmask ,</if>
<if test="HairStyle!= null">hairstyle ,</if>
......@@ -94,10 +94,10 @@
<if test="LuggageColorNums!= null">luggagecolornums ,</if>
<if test="LuggageColor!= null">luggagecolor ,</if>
<if test="HasKnife!= null">hasknife ,</if>
<if test="ObjectBoundingBox.x!= null">objectx ,</if>
<if test="ObjectBoundingBox.y!= null">objecty ,</if>
<if test="ObjectBoundingBox.w!= null">objectw ,</if>
<if test="ObjectBoundingBox.h!= null">objecth ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x!= null">objectx ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y!= null">objecty ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w!= null">objectw ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h!= null">objecth ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id!= null">#{id},</if>
......@@ -115,22 +115,22 @@
<if test="TrousersLength!= null">#{TrousersLength},</if>
<if test="TrousersColorNums!= null">#{TrousersColorNums},</if>
<if test="TrousersColor!= null">#{TrousersColor},</if>
<if test="HeadBoundingBox.x!= null">#{HeadBoundingBox.x},</if>
<if test="HeadBoundingBox.y!= null">#{HeadBoundingBox.y},</if>
<if test="HeadBoundingBox.w!= null">#{HeadBoundingBox.w},</if>
<if test="HeadBoundingBox.h!= null">#{HeadBoundingBox.h},</if>
<if test="UpperBoundingBox.x!= null">#{UpperBoundingBox.x},</if>
<if test="UpperBoundingBox.y!= null">#{UpperBoundingBox.y},</if>
<if test="UpperBoundingBox.w!= null">#{UpperBoundingBox.w},</if>
<if test="UpperBoundingBox.h!= null">#{UpperBoundingBox.h},</if>
<if test="LowerBoundingBox.x!= null">#{LowerBoundingBox.x},</if>
<if test="LowerBoundingBox.y!= null">#{LowerBoundingBox.y},</if>
<if test="LowerBoundingBox.w!= null">#{LowerBoundingBox.w},</if>
<if test="LowerBoundingBox.h!= null">#{LowerBoundingBox.h},</if>
<if test="FaceBoundingBox.x!= null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox.y!= null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox.w!= null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox.h!= null">#{FaceBoundingBox.h},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">#{HeadBoundingBox.x},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">#{HeadBoundingBox.y},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">#{HeadBoundingBox.w},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">#{HeadBoundingBox.h},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.x!= null">#{UpperBoundingBox.x},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.y!= null">#{UpperBoundingBox.y},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.w!= null">#{UpperBoundingBox.w},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.h!= null">#{UpperBoundingBox.h},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.x!= null">#{LowerBoundingBox.x},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.y!= null">#{LowerBoundingBox.y},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.w!= null">#{LowerBoundingBox.w},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.h!= null">#{LowerBoundingBox.h},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">#{FaceBoundingBox.h},</if>
<if test="HasHat!= null">#{HasHat},</if>
<if test="HasMask!= null">#{HasMask},</if>
<if test="HairStyle!= null">#{HairStyle},</if>
......@@ -141,10 +141,10 @@
<if test="LuggageColorNums!= null">#{LuggageColorNums},</if>
<if test="LuggageColor!= null">#{LuggageColor},</if>
<if test="HasKnife!= null">#{HasKnife},</if>
<if test="ObjectBoundingBox.x!= null">#{ObjectBoundingBox.x},</if>
<if test="ObjectBoundingBox.y!= null">#{ObjectBoundingBox.y},</if>
<if test="ObjectBoundingBox.w!= null">#{ObjectBoundingBox.w},</if>
<if test="ObjectBoundingBox.h!= null">#{ObjectBoundingBox.h},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x!= null">#{ObjectBoundingBox.x},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y!= null">#{ObjectBoundingBox.y},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w!= null">#{ObjectBoundingBox.w},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h!= null">#{ObjectBoundingBox.h},</if>
</trim>
......
......@@ -42,10 +42,10 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="Type != null">type ,</if>
<if test="ObjectBoundingBox.x != null">objectx ,</if>
<if test="ObjectBoundingBox.y != null">objecty ,</if>
<if test="ObjectBoundingBox.w != null">obectw ,</if>
<if test="ObjectBoundingBox.h != null">objecth ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x != null">objectx ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y != null">objecty ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w != null">obectw ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h != null">objecth ,</if>
<if test="BikeClass != null">bikeclass ,</if>
<if test="Gender != null">gender ,</if>
<if test="Age != null">age ,</if>
......@@ -63,10 +63,10 @@
<if test="CoatColorNums != null">coatcolornums ,</if>
<if test="CoatColor != null">coatcolor ,</if>
<if test="CoatTexture != null">coattexture ,</if>
<if test="FaceBoundingBox.x != null">facex ,</if>
<if test="FaceBoundingBox.y != null">facey ,</if>
<if test="FaceBoundingBox.w != null">facew ,</if>
<if test="FaceBoundingBox.h != null">faceh ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x != null">facex ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y != null">facey ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w != null">facew ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h != null">faceh ,</if>
<if test="SocialAttribute != null">socialattribute ,</if>
<if test="Enterprise != null">enterprise ,</if>
<if test="HasPassenger != null">haspassenger ,</if>
......@@ -74,10 +74,10 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="Type != null">#{Type},</if>
<if test="ObjectBoundingBox.x != null">#{ObjectBoundingBox.x},</if>
<if test="ObjectBoundingBox.y != null">#{ObjectBoundingBox.y},</if>
<if test="ObjectBoundingBox.w != null">#{ObjectBoundingBox.w},</if>
<if test="ObjectBoundingBox.h != null">#{ObjectBoundingBox.h},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x != null">#{ObjectBoundingBox.x},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y != null">#{ObjectBoundingBox.y},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w != null">#{ObjectBoundingBox.w},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h != null">#{ObjectBoundingBox.h},</if>
<if test="BikeClass != null">#{BikeClass},</if>
<if test="Gender != null">#{Gender},</if>
<if test="Age != null">#{Age},</if>
......@@ -95,10 +95,10 @@
<if test="CoatColorNums != null">#{CoatColorNums},</if>
<if test="CoatColor != null">#{CoatColor},</if>
<if test="CoatTexture != null">#{CoatTexture},</if>
<if test="FaceBoundingBox.x != null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox.y != null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox.w != null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox.h != null">#{FaceBoundingBox.h},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x != null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y != null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w != null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h != null">#{FaceBoundingBox.h},</if>
<if test="SocialAttribute != null">#{SocialAttribute},</if>
<if test="Enterprise != null">#{Enterprise},</if>
<if test="HasPassenger != null">#{HasPassenger},</if>
......
......@@ -12,30 +12,24 @@
<select id="selectByRtsp" parameterType="java.lang.String" resultType="com.cx.cn.cxquartz.vo.Sbtdspsr">
select * from sbtdspsr where sbbh = #{videoid} or squrllj =#{rtsp}
select a.* from sbtdspsr a,
quartz_task_informations b
WHERE (a.sbbh=b.videoid or a.squrllj=b.videoid) and b.taskno=#{rtsp}
</select>
<select id="selectRecogByRtsp" parameterType="java.lang.String" resultType="java.util.HashMap">
SELECT DISTINCT
(select concat(sbbh,"_",tdbh) from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) videoid,
metatype,
recordtype,
objectx,
objecty,
objectw,
objecth,(
SELECT
concat( sbbh, '_', tdbh )
objecth
FROM
sbtdspsr
WHERE squrllj =#{rtsp}
OR (
sbbh = substring_index( #{rtsp}, '_', 1 )
AND tdbh = substring_index( #{rtsp}, '_',- 1 ))) videoid
FROM
quartz_task_informations
quartz_task_informations b
WHERE
videoid =#{rtsp}
OR executeParamter =#{rtsp}
taskno=#{rtsp}
</select>
<update id="updateRecogByRtsp" parameterType="java.util.HashMap" >
......
......@@ -110,7 +110,7 @@
</select>
<update id="updateTraffpicture">
update traffpicture set objx=#{objx},objy=#{objy},objw=#{objw},objh=#{objh},imagedata=#{imagedata},metatype=#{metatype} where id=#{id}
update traffpicture set objx=#{objx},objy=#{objy},objw=#{objw},objh=#{objh},imagedata=#{imagedata},metatype=#{metatype},targetnum=#{targetnum} where id=#{id}
</update>
......
......@@ -571,7 +571,7 @@
success: function (result) {
if (result.code == 200) {
if (result.message.indexOf(",") > -1) {
$("#executeparamter").val($("#videoid").val()+"_0");
$("#executeparamter").val($("#taskno").val());
$("#rtsp").val(result.message.split(",")[1]);
$("#imgsrc").val( result.message.split(",")[0]);
draw.src = result.message.split(",")[0];
......
......@@ -665,7 +665,7 @@
success: function (result) {
if (result.code == 200) {
if (result.message.indexOf(",") > -1) {
$("#executeparamter").val($("#videoid").val());
$("#executeparamter").val($("#taskno").val());
$("#rtsp").val(result.message.split(",")[1]);
$("#imgsrc").val( result.message.split(",")[0]);
draw.src = result.message.split(",")[0];
......
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