Commit 60a42fe1 authored by yzm's avatar yzm

改为单独调用抽帧和分析的服务

parent 8de39672
......@@ -12,7 +12,7 @@
<artifactId>VideoofCultural</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<description>文物局视频截图推送</description>
<description></description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -175,11 +175,7 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.46</version>
</dependency>
</dependencies>
......
......@@ -22,19 +22,19 @@ public class ScheduleTaskConfig {
@Value("${file.getrtspbyurl}")
private String getrtspbyurl;
RestUtil restUtil=new RestUtil();
/***
* 每隔20分钟执行一遍判断rtsp 是否变换
*/
// @Scheduled(cron = "0 0 2 * * ? ")
private void statis() {
//查询所有监控设备,更新rtsp 地址
List<Sbtdspsr> sbtdpsrList= sbtdspsrService.list();
//调用decice 端口获得新的rtsp 地址,如果与表里的一样无需更新,不一样则立即更新
for(Sbtdspsr sbtd:sbtdpsrList)
{
restUtil.rtspChangeVlue(sbtd.getSbbh(),sbtd.getSqurllj(),getrtspbyurl);
}
}
// /***
// * 每隔20分钟执行一遍判断rtsp 是否变换
// */
//// @Scheduled(cron = "0 0 2 * * ? ")
// private void statis() {
// //查询所有监控设备,更新rtsp 地址
// List<Sbtdspsr> sbtdpsrList= sbtdspsrService.list();
// //调用decice 端口获得新的rtsp 地址,如果与表里的一样无需更新,不一样则立即更新
// for(Sbtdspsr sbtd:sbtdpsrList)
// {
// restUtil.rtspChangeVlue(sbtd.getSbbh(),sbtd.getSqurllj(),getrtspbyurl);
// }
// }
// @Scheduled(cron = "0 30/5 6-19 * * ?")//每隔5分钟统计当天目前为止的数据
......
package com.cx.cn.cxquartz.controller;
import com.alibaba.fastjson.JSONObject;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.job.WebSocket;
import com.cx.cn.cxquartz.service.quartz.*;
......@@ -107,21 +106,23 @@ public class ExtController {
public String getrtsp(@RequestBody String videoid,
@PathVariable("photonum") Integer photonum) {
//根据videoID查询 rtsp 值
List<Sbtdspsr> sbtdspsrlist = sbtdspsrService.selectByRtsp(videoid);
logger.info("sbtdspsrlist:{}", JSONObject.toJSON(sbtdspsrlist));
if (sbtdspsrlist.size() == 0) {
logger.info(videoid + "设备不存在");
return ResultUtil.success();
}
Sbtdspsr sbtdspsr = sbtdspsrlist.get(0);
// List<Sbtdspsr> sbtdspsrlist = sbtdspsrService.selectByRtsp(videoid);
// if (sbtdspsrlist.size() == 0) {
// logger.info(videoid + "设备不存在");
// return ResultUtil.success();
// }
// Sbtdspsr sbtdspsr = sbtdspsrlist.get(0);
//尝试抽取第一张图片
List<String> imgUrls = new ArrayList<>();
TraffAlarmRecord traffAlarmRecord = new TraffAlarmRecord();
try {
//尝试抽取图片
logger.info("rtspurl" + rtspurl);
String timestamp = restutil.getPicture(imgUrls, sbtdspsr.getSbbh(), rtspurl, traffAlarmRecord);
String timestamp = restutil.getPicture(imgUrls, videoid, rtspurl,traffAlarmRecord);
logger.info("timestamp" + timestamp);
if(null==timestamp){
logger.info("getRTSP/1 no snapshot");
return ResultUtil.success();
}
if (timestamp.contains(".")) {
traffAlarmRecord.setCreatetime(timestamp.split("\\.")[0]);
} else {
......@@ -133,25 +134,22 @@ public class ExtController {
}
try {
if (imgUrls.size() == 0) {
restutil.getPicture(imgUrls, sbtdspsr.getSbbh(), rtspurl, traffAlarmRecord);
restutil.getPicture(imgUrls, videoid, rtspurl,traffAlarmRecord);
}
traffAlarmRecord.setFdid(sbtdspsr.getSbbh());
traffAlarmRecord.setChannelid(Integer.parseInt(String.valueOf(sbtdspsr.getTdbh())));
traffAlarmRecord.setAreaid(Long.parseLong(sbtdspsr.getXzbh()));
traffAlarmRecord.setFdid(videoid);
traffAlarmRecord.setChannelid(0);
traffAlarmRecord.setAreaid(Long.parseLong("-1"));
traffAlarmRecord.setPushstatus(9);
//免审
traffAlarmRecord.setCheckstatus(9);
//未提取特征
traffAlarmRecord.setProcessstatus("-2");
traffAlarmRecord.setImg1urlfrom(imgUrls.get(0));
//String basepath = "gstraff/" + traffAlarmRecord.getFdid() + (traffAlarmRecord.getChannelid() < 10 ? "0" + traffAlarmRecord.getChannelid() : traffAlarmRecord.getChannelid()) + "/" + DateUtils.formatCurrDayNoSign();
//Ftp ftp = ftpService.reloadFtp();
//入表
//异步新增五条数据
traffAlarmRecordService.inserTraffAlarmRecord(traffAlarmRecord);
//FileTransferManager.transferFile(traffAlarmRecord, ftp, basepath);
//更新图片地址
// traffAlarmRecordService.updateTraffAlarmRecordUrl(traffAlarmRecord);
return ResultUtil.success();
} catch (Exception e) {
logger.error("ext/getRTSPr-->error:{}" + e.toString());
......@@ -167,98 +165,106 @@ public class ExtController {
String model = "1";
//图片框选出来的范围
Long[] roiarray;
String devicecode="";
HttpEntity<GoalStructureParam> requestEntity = null;
if (null != mapList && !mapList.equals("") && mapList.size() > 0) {
//查询该监控下面还没有经过分析的数据
//Map<String, Object> map = new HashMap<>();
//map.put("sbbh", devicecode);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Map<String, Object> mapparam = new HashMap<>();
roiarray = new Long[4];
//获得该监控的检测业务与检测范围
for (QuartzTaskInformations taskinfo : mapList) {
roiarray[0] = new Long(taskinfo.getObjectx());
roiarray[1] = new Long(taskinfo.getObjecty());
roiarray[2] = new Long(taskinfo.getObjectw());
roiarray[3] = new Long(taskinfo.getObjecth());
devicecode=taskinfo.getExecuteparamter();
// roiarray[0] = new Long(0);
// roiarray[1] = new Long(0);
// roiarray[2] = new Long(0);
// roiarray[3] = new Long(0);
// for (TraffAlarmRecord transferRecord : traffalarmrecordlist) {
mapparam.put("deviceCode", devicecode);
mapparam.put("model", model);
mapparam.put("roi", roiarray);
// logger.info("recogurl="+recogurl);
Map objectList = restTemplate.getForObject(recogurl + "?deviceCode={deviceCode}&model={model}&roi={roi}", Map.class, mapparam);
String devicecode=taskinfo.getExecuteparamter();
//查询该监控下面还没有经过分析的数据
Map<String, Object> map = new HashMap<>();
map.put("sbbh", devicecode);
map.put("recordtype", taskinfo.getRecordtype());
if (String.valueOf(objectList.get("ret")).equals("0")) {
//变成为已分析
// transferRecord.setProcessstatus("-1");
// traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
String recordtype=taskinfo.getRecordtype();
JobTjParam jobTjParam = new JobTjParam();
jobTjParam.setDeviceId(devicecode);
jobTjParam.setDetectType(recordtype);
String imageurl=objectList.get("url").toString();
try {
Map maprecogdata =new ObjectMapper().readValue(objectList.get("recogdata").toString(),Map.class);
List<Map> points = new ArrayList<>();
//分析结果数据
List<Map> objectresult = (List<Map>) maprecogdata.get("ObjectList");
if(objectresult.size()<1){
logger.info(" objectresult is empty");
continue;
}
//获得点位
TraffpictureParam traffpictureParamresult = eventWriteService.getResult(Integer.parseInt(taskinfo.getMetatype())
, roiarray,imageurl , objectresult, jobTjParam, points);
eventWriteService.setTraffpictureParam(recordtype,devicecode,
objectList.get("timestamp").toString(),
traffpictureParamresult);
//图片划线并上传
String basepath = DateUtils.formatCurrDayYM()+
File.separator+DateUtils.formatCurrDayDD()+ File.separator+
devicecode ;
String filename = devicecode+"_"+ DateUtils.formatCurrDateNoSign()+ "_result.jpg";
eventWriteService.uploadPicture(traffpictureParamresult,imageurl, points, basepath, filename);
String filenameurl=File.separator+outpath+File.separator+basepath+File.separator+filename;
jobTjParam.setImageUrl(weburl+filenameurl);
// logger.info("file path:{}",filenameurl);
traffpictureParamresult.setImagedata(filenameurl);
traffpictureParamresult.setProcessstatus("-1");
traffPictureService.updateTraffpicture(traffpictureParamresult);
List<TraffAlarmRecord> traffalarmrecordlist=traffAlarmRecordService.getTraffAlarmRecordByProgress(map);
if(traffalarmrecordlist.size()<1) {
return ResultUtil.success();
}
for (TraffAlarmRecord transferRecord : traffalarmrecordlist) {
GoalStructureParam param = FileTransferManager.getGoalStructureParam(roiarray,
Integer.parseInt(model == null ? "1" : "".equals(model) ? "1" : model),2, transferRecord);
if (param.getImageList().size() < 1) {
logger.info(" no imagelist ");
continue;
}
String maprecogdata = restTemplate.postForObject(recogurl, param, String.class);
try {
Map result = new ObjectMapper().readValue(maprecogdata, Map.class);
if (null != result.get("ret") && result.get("ret").equals("200")) {
//变成为已分析
transferRecord.setProcessstatus("-1");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
String recordtype = taskinfo.getRecordtype();
JobTjParam jobTjParam = new JobTjParam();
jobTjParam.setDeviceId(devicecode);
jobTjParam.setDetectType(recordtype);
String imageurl = transferRecord.getImg1path();
List<Map> points = new ArrayList<>();
//分析结果数据
List<Map> objectresult = (List<Map>) result.get("ObjectList");
if (objectresult.size() < 1) {
logger.info(" objectresult is empty");
continue;
}
//获得点位
logger.info("获得点位");
TraffpictureParam traffpictureParamresult = eventWriteService.getResult(Integer.parseInt(taskinfo.getMetatype())
, roiarray, imageurl, objectresult, jobTjParam, points);
if(null==traffpictureParamresult){
logger.info("人群密度未超或目标未出现");
continue;
}
eventWriteService.setTraffpictureParam(recordtype, devicecode,
transferRecord.getCreatetime(),
traffpictureParamresult);
//图片划线并上传
logger.info("图片划线并上传");
String basepath = DateUtils.formatCurrDayYM() +
File.separator + DateUtils.formatCurrDayDD() + File.separator +
devicecode;
String filename = devicecode + "_" + DateUtils.formatCurrDateNoSign() +"_"+ recordtype+"_result.jpg";
eventWriteService.uploadPicture(traffpictureParamresult, transferRecord.getImg1urlfrom(), points, basepath, filename);
String filenameurl = File.separator + outpath + File.separator + basepath + File.separator + filename;
jobTjParam.setImageUrl(weburl + filenameurl);
logger.info("file path:{}",filenameurl);
traffpictureParamresult.setImagedata(filenameurl);
traffpictureParamresult.setProcessstatus("-1");
traffPictureService.updateTraffpicture(traffpictureParamresult);
//回调
// logger.info("send to dianxin data:{}",JSONObject.toJSONString(jobTjParam));
eventWriteService.sendEventByCallUrl(traffpictureParamresult, jobTjParam, taskinfo.getUrl().equals("")?callbackurl:taskinfo.getUrl());
//回调
logger.info("send to dianxin data:{}",jobTjParam.toString());
eventWriteService.sendEventByCallUrl(traffpictureParamresult, jobTjParam, taskinfo.getUrl().equals("") ? callbackurl : taskinfo.getUrl());
if (unionId.contains(devicecode)) {
VoiceData voicedata = new VoiceData();
voicedata.setAppKey(appKey);
voicedata.setCorpId(corpId);
Voice voice = new Voice();
voice.setEventId(eventId);
voice.setUnionId(unionId);
voicedata.setRequestData(voice);
// logger.info(" send to voice: {}", new ObjectMapper().writeValueAsString(voicedata));
eventWriteService.sendVoice(voicedata);
}
//推送告警到前端
webSocket.GroupSending(new ObjectMapper().writeValueAsString(traffpictureParamresult));
if (unionId.contains(devicecode)) {
VoiceData voicedata = new VoiceData();
voicedata.setAppKey(appKey);
voicedata.setCorpId(corpId);
Voice voice = new Voice();
voice.setEventId(eventId);
voice.setUnionId(unionId);
voicedata.setRequestData(voice);
// logger.info(" send to voice: {}", new ObjectMapper().writeValueAsString(voicedata));
eventWriteService.sendVoice(voicedata);
}
//推送告警到前端
webSocket.GroupSending(new ObjectMapper().writeValueAsString(traffpictureParamresult));
}
} catch (Exception ex) {
logger.error(ex.toString());
}
//其他数据如表
//getMetaData( objectresult );
}
}
//}
return ResultUtil.success();
} else {
logger.info("监控不属于该范围");
......@@ -267,7 +273,113 @@ public class ExtController {
//结果进行额外封装入表
return ResultUtil.success();
}
// @RequestMapping(value = "/getDeviceSnapshotAndRecognize", method = RequestMethod.POST)
// public String getDeviceSnapshotAndRecognize(@RequestBody String taskno) {
// //根据判断监控是否存在,该监控检测的事件是什么
// List<QuartzTaskInformations> mapList = sbtdspsrService.selectRecogByRtsp(taskno);
// String model = "1";
// //图片框选出来的范围
// Long[] roiarray;
// String devicecode="";
// if (null != mapList && !mapList.equals("") && mapList.size() > 0) {
// //查询该监控下面还没有经过分析的数据
// //Map<String, Object> map = new HashMap<>();
// //map.put("sbbh", devicecode);
//
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
// Map<String, Object> mapparam = new HashMap<>();
// roiarray = new Long[4];
// //获得该监控的检测业务与检测范围
// for (QuartzTaskInformations taskinfo : mapList) {
// roiarray[0] = new Long(taskinfo.getObjectx());
// roiarray[1] = new Long(taskinfo.getObjecty());
// roiarray[2] = new Long(taskinfo.getObjectw());
// roiarray[3] = new Long(taskinfo.getObjecth());
// devicecode=taskinfo.getExecuteparamter();
//// roiarray[0] = new Long(0);
//// roiarray[1] = new Long(0);
//// roiarray[2] = new Long(0);
//// roiarray[3] = new Long(0);
// // for (TraffAlarmRecord transferRecord : traffalarmrecordlist) {
// mapparam.put("deviceCode", devicecode);
// mapparam.put("model", model);
// mapparam.put("roi", roiarray);
//// logger.info("recogurl="+recogurl);
// Map objectList = restTemplate.getForObject(recogurl + "?deviceCode={deviceCode}&model={model}&roi={roi}", Map.class, mapparam);
//
// if (String.valueOf(objectList.get("ret")).equals("0")) {
// //变成为已分析
// // transferRecord.setProcessstatus("-1");
// // traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
// String recordtype=taskinfo.getRecordtype();
// JobTjParam jobTjParam = new JobTjParam();
// jobTjParam.setDeviceId(devicecode);
// jobTjParam.setDetectType(recordtype);
// String imageurl=objectList.get("url").toString();
// try {
// Map maprecogdata =new ObjectMapper().readValue(objectList.get("recogdata").toString(),Map.class);
// List<Map> points = new ArrayList<>();
// //分析结果数据
// List<Map> objectresult = (List<Map>) maprecogdata.get("ObjectList");
// if(objectresult.size()<1){
// logger.info(" objectresult is empty");
// continue;
// }
// //获得点位
// TraffpictureParam traffpictureParamresult = eventWriteService.getResult(Integer.parseInt(taskinfo.getMetatype())
// , roiarray,imageurl , objectresult, jobTjParam, points);
//
// eventWriteService.setTraffpictureParam(recordtype,devicecode,
// objectList.get("timestamp").toString(),
// traffpictureParamresult);
// //图片划线并上传
// String basepath = DateUtils.formatCurrDayYM()+
// File.separator+DateUtils.formatCurrDayDD()+ File.separator+
// devicecode ;
// String filename = devicecode+"_"+ DateUtils.formatCurrDateNoSign()+ "_result.jpg";
// eventWriteService.uploadPicture(traffpictureParamresult,imageurl, points, basepath, filename);
// String filenameurl=File.separator+outpath+File.separator+basepath+File.separator+filename;
// jobTjParam.setImageUrl(weburl+filenameurl);
//// logger.info("file path:{}",filenameurl);
// traffpictureParamresult.setImagedata(filenameurl);
// traffpictureParamresult.setProcessstatus("-1");
// traffPictureService.updateTraffpicture(traffpictureParamresult);
//
// //回调
//// logger.info("send to dianxin data:{}",JSONObject.toJSONString(jobTjParam));
// eventWriteService.sendEventByCallUrl(traffpictureParamresult, jobTjParam, taskinfo.getUrl().equals("")?callbackurl:taskinfo.getUrl());
//
// if (unionId.contains(devicecode)) {
// VoiceData voicedata = new VoiceData();
// voicedata.setAppKey(appKey);
// voicedata.setCorpId(corpId);
// Voice voice = new Voice();
// voice.setEventId(eventId);
// voice.setUnionId(unionId);
// voicedata.setRequestData(voice);
// // logger.info(" send to voice: {}", new ObjectMapper().writeValueAsString(voicedata));
// eventWriteService.sendVoice(voicedata);
// }
// //推送告警到前端
// webSocket.GroupSending(new ObjectMapper().writeValueAsString(traffpictureParamresult));
// } catch (Exception ex) {
//
// }
// //其他数据如表
// //getMetaData( objectresult );
// }
//
// }
// //}
// return ResultUtil.success();
// } else {
// logger.info("监控不属于该范围");
// }
// //更新record 表Progress 字段,0为 未检测,-2 为检测失败,将检测
// //结果进行额外封装入表
// return ResultUtil.success();
// }
// private void getMetaData( List<Map> objectresult ) {
// if (null != metadata) {
// traffpictureParamresult.setMetatype(String.valueOf(metadata.get("Type")));
......
package com.cx.cn.cxquartz.controller;
import com.alibaba.fastjson.JSONObject;
import com.cx.cn.cxquartz.bean.QuartzTaskErrors;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.service.quartz.FtpService;
......@@ -77,14 +76,15 @@ public class QuartzController {
public TaskResultObj scheduleJob(@RequestBody JobParam jobParam) {
String taskno="fx_" + jobParam.getDeviceId() + "_" + jobParam.getDetectType();
String cztaskno="cz_" + jobParam.getDeviceId() + "_" + jobParam.getDetectType();
QuartzTaskInformations taskInformations = new QuartzTaskInformations();
taskInformations.setExecuteparamter(jobParam.getDeviceId());
taskInformations.setMetatype(jobParam.getDetectType());
//查询是否有抽帧服务
// List<QuartzTaskInformations> tasks = quartzService.getTaskSByDeviceCode(jobParam.getDeviceId());
// Map<String, Integer> map = getTaskCzAndFxNumer(tasks);
//Integer cznum = map.get("cznum");
//Integer fxnum = map.get("fxnum");
List<QuartzTaskInformations> tasks = quartzService.getTaskSByDeviceCode(jobParam.getDeviceId());
Map<String, Integer> map = getTaskCzAndFxNumer(tasks);
Integer cznum = map.get("cznum");
Integer fxnum = map.get("fxnum");
Long[] roiarray=new Long[4];
if ("0".equals(jobParam.getType())) {//0新增 1开启 2停止 3删除
//判断是否存在抽帧任务,存在则直接新增分析任务,不存在则新增
......@@ -104,15 +104,28 @@ public class QuartzController {
taskInformations.setVideoid(jobParam.getDeviceId() );
taskInformations.setRecordtype(jobParam.getDetectType());
String result = quartzService.addTask(taskInformations);
try {
quartzService.startJob(taskno, "UNFROZEN");
}catch (Exception ex){
logger.error(taskno+" fx startJob error:"+ex.toString());
}
//查询是否有抽帧服务
//if (cznum == 0) {
// taskInformations.setExecutorno("cz_" + jobParam.getDeviceId() + "_" + jobParam.getDetectType());
// taskInformations.setTaskno(taskInformations.getExecutorno());
// quartzService.addTask(taskInformations);
// }
if (cznum == 0) {
taskInformations.setExecutorno(cztaskno);
taskInformations.setTaskno(cztaskno);
quartzService.addTask(taskInformations);
try {
quartzService.startJob(cztaskno, "UNFROZEN");
}catch (Exception ex){
logger.error(cztaskno+"cz startJob error:"+ex.toString());
}
}
} else if ("1".equals(jobParam.getType()))//开启
{
try {
if (fxnum == 1) {
quartzService.startOrStopJob(cztaskno,"UNFROZEN");
}//开启分析服务,开启抽帧
quartzService.startOrStopJob(taskno,"UNFROZEN");
} catch (Exception ex) {
logger.error(ex.toString());
......@@ -120,15 +133,22 @@ public class QuartzController {
} else if ("2".equals(jobParam.getType()) ) {//停止
//一抽帧多分析,停止不停抽帧服务
try {
if (fxnum == 1) {
quartzService.startOrStopJob(cztaskno,"FROZEN");
}
quartzService.startOrStopJob(taskno, "FROZEN");
} catch (Exception ex) {
logger.error(ex.toString());
}
} else if ("3".equals(jobParam.getType())) {//删除
//一抽帧多分析,停止不停抽帧服务
try {
try {
quartzService.startOrStopJob(taskno, "FROZEN");
quartzService.deletetask(taskno);
if(fxnum==1){
quartzService.startOrStopJob(cztaskno, "FROZEN");
quartzService.deletetask(cztaskno);
}
} catch (Exception ex) {
logger.error(ex.toString());
}
......
......@@ -50,7 +50,7 @@ public class QuartzMainJobFactory implements Job {
//if (ResultEnum.HTTP.getMessage().equals(sendType)) {
try {
String result = HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", taskNo);
String result = HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", executeParameter);
logger.info("taskNo={},执行结果result{}", taskNo, result);
if (StringUtils.isEmpty(result)) {
throw new RuntimeException("taskNo=" + taskNo + "http方式返回null");
......
package com.cx.cn.cxquartz.job;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Component;
import javax.websocket.*;
......@@ -60,7 +60,12 @@ public class WebSocket {
Map map=new HashMap();
map.put("type","HEARTBEAT");
map.put("ts",new Date().getTime());
AppointSending(name, JSONObject.toJSONString(map));
try {
AppointSending(name, new ObjectMapper().writeValueAsString(map));
}catch (Exception ex)
{
ex.printStackTrace();
}
}
}
......
......@@ -32,7 +32,7 @@ import java.util.concurrent.*;
/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author wjj
......@@ -81,7 +81,6 @@ public class EventWriteService {
private String outpath;
@Value("${file.uploadurl}")
private String uploadurl;
......@@ -148,7 +147,8 @@ public class EventWriteService {
HttpEntity<TraffrecordData> requestEntity = new HttpEntity<>(traffalarmrecord, headers);
return CompletableFuture.supplyAsync(() -> restTemplate.postForObject(url, requestEntity, ResultObj.class)).get(timeout, TimeUnit.SECONDS);
}
private ResultObj sendToCalluri(JobTjParam jobTjParam,String callbackurl) throws InterruptedException, ExecutionException, TimeoutException {
private ResultObj sendToCalluri(JobTjParam jobTjParam, String callbackurl) throws InterruptedException, ExecutionException, TimeoutException {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
HttpEntity<JobTjParam> requestEntity = new HttpEntity<>(jobTjParam, headers);
......@@ -156,11 +156,10 @@ public class EventWriteService {
}
public void sendEventByCallUrl(TraffpictureParam traffpictureParamresult, JobTjParam jobTjParam, String callbackurl) {
ResultObj resultObj;
try {
resultObj= sendToCalluri(jobTjParam,callbackurl);
resultObj = sendToCalluri(jobTjParam, callbackurl);
// boolean successFlag = resultObj.getCode() == ResponseEnum.SUCCESS.getCode();
traffpictureParamresult.setPushdesc(resultObj.getMsg());
/* 成功 */
......@@ -224,10 +223,14 @@ public class EventWriteService {
for (Map traffpictureParam : objectList) {
//根据imageid 获得 base64图片
Map metadata = (Map) traffpictureParam.get("Metadata");
String metatype = String.valueOf(metadata.get("Type"));
// String metatype = String.valueOf(metadata.get("Type"));
//获得点位坐标
Map objlocation = new HashMap();
getObjectPoint(objlocation, metadata, roiarray,traffpictureParamresult);
Map objlocation = getObjectPoint(metadata, roiarray, traffpictureParamresult, recordtype);
if (null == objlocation) {
log.info("点位未空");
continue;
}
//获得特征属性
getDetectInfo(recordtype, metadata, objlocation);
//根据对应的解析结果获得相应的数据,存放到对应的表中
......@@ -235,6 +238,10 @@ public class EventWriteService {
//getMetaData( roiarray, traffpictureParamresult,list,traffpictureParam,metadata);
detectObjects.add(objlocation);
}
if (detectObjects.size() == 0) {
log.info(" 特征对象为空 ");
return null;
}
//获得其他告警事件的返回结果
//超过则预警
obj.put("detectObjects", detectObjects);
......@@ -288,80 +295,95 @@ public class EventWriteService {
return objsize;
}
public void getObjectPoint(Map objlocation, Map metadata, Long[] roiarray,TraffpictureParam traff) {
Map objectBoundingBox = (Map) metadata.get("ObjectBoundingBox");
Location lo=new Location();
if (null != metadata.get("LeftTopX") &&
!"".equals(metadata.get("LeftTopX").toString())
&& null != metadata.get("LeftTopY")
&& !"".equals(metadata.get("LeftTopY").toString())
&& null != metadata.get("RightBtmX")
&& !"".equals(metadata.get("RightBtmX").toString())
&& null != metadata.get("RightBtmY")
&& !"".equals(metadata.get("RightBtmY").toString())
) {
try {
lo = new Location(
Integer.parseInt(metadata.get("LeftTopX").toString()) + roiarray[0].intValue(), Integer.parseInt(metadata.get("LeftTopY").toString()) + roiarray[1].intValue(),
Integer.parseInt(metadata.get("RightBtmX").toString()) + roiarray[0].intValue(), Integer.parseInt(metadata.get("RightBtmY").toString()) + roiarray[1].intValue()
);
} catch (Exception ex) {
log.error(ex.toString());
}
} else if (null != objectBoundingBox) {
try {
lo=new Location(Integer.parseInt(objectBoundingBox.get("x").toString()) + roiarray[0].intValue(),
Integer.parseInt(objectBoundingBox.get("y").toString()) + roiarray[1].intValue(),
Integer.parseInt(objectBoundingBox.get("x").toString()) + Integer.parseInt(objectBoundingBox.get("w").toString()) + roiarray[0].intValue(),
Integer.parseInt(objectBoundingBox.get("y").toString()) + Integer.parseInt(objectBoundingBox.get("h").toString()) + roiarray[1].intValue()
);
} catch (Exception ex) {
log.error(ex.toString());
}
} else {
if (null != metadata.get("FaceBoundingBox")) {
public Map getObjectPoint(Map metadata, Long[] roiarray, TraffpictureParam traff, String recordtype) {
String metatype = metadata.get("Type").toString();
Map objlocation = new HashMap();
Location lo = null;
if (
("41".equals(recordtype) && "2".equals(metatype))
|| ("42".equals(recordtype) && "4".equals(metatype))
|| ("43".equals(recordtype) && "4".equals(metatype))
|| ("50".equals(recordtype) && ("1".equals(metatype) || "3".equals(metatype) || "4".equals(metatype))
) || ("20".equals(recordtype))) {
Map objectBoundingBox = (Map) metadata.get("ObjectBoundingBox");
if (null != metadata.get("LeftTopX") &&
!"".equals(metadata.get("LeftTopX").toString())
&& null != metadata.get("LeftTopY")
&& !"".equals(metadata.get("LeftTopY").toString())
&& null != metadata.get("RightBtmX")
&& !"".equals(metadata.get("RightBtmX").toString())
&& null != metadata.get("RightBtmY")
&& !"".equals(metadata.get("RightBtmY").toString())
) {
try {
Map faceBoundingBox = (Map) metadata.get("FaceBoundingBox");
lo=new Location(
Integer.parseInt(faceBoundingBox.get("x").toString()) + roiarray[0].intValue(),
Integer.parseInt(faceBoundingBox.get("y").toString()) + roiarray[1].intValue(),
Integer.parseInt(faceBoundingBox.get("x").toString()) +
Integer.parseInt(faceBoundingBox.get("w").toString()) + roiarray[0].intValue(),
Integer.parseInt(faceBoundingBox.get("y").toString()) +
Integer.parseInt(faceBoundingBox.get("h").toString()) + roiarray[1].intValue()
lo = new Location(
Integer.parseInt(metadata.get("LeftTopX").toString()) + roiarray[0].intValue(),
Integer.parseInt(metadata.get("LeftTopY").toString()) + roiarray[1].intValue(),
Integer.parseInt(metadata.get("RightBtmX").toString()) + roiarray[0].intValue(),
Integer.parseInt(metadata.get("RightBtmY").toString()) + roiarray[1].intValue()
);
} catch (Exception ex) {
log.error(ex.toString());
}
} else if (null != objectBoundingBox) {
try {
lo = new Location(Integer.parseInt(objectBoundingBox.get("x").toString()) + roiarray[0].intValue(),
Integer.parseInt(objectBoundingBox.get("y").toString()) + roiarray[1].intValue(),
Integer.parseInt(objectBoundingBox.get("x").toString()) + Integer.parseInt(objectBoundingBox.get("w").toString()) + roiarray[0].intValue(),
Integer.parseInt(objectBoundingBox.get("y").toString()) + Integer.parseInt(objectBoundingBox.get("h").toString()) + roiarray[1].intValue()
);
} catch (Exception ex) {
log.error(ex.toString());
}
} else {
if (null != metadata.get("HeadBoundingBox")) {
if (null != metadata.get("FaceBoundingBox")) {
try {
Map headBoundingBox = (Map) metadata.get("HeadBoundingBox");
lo=new Location(
Integer.parseInt(headBoundingBox.get("x").toString()) + roiarray[0].intValue(),
Integer.parseInt(headBoundingBox.get("y").toString()) + roiarray[1].intValue(),
Integer.parseInt(headBoundingBox.get("x").toString()) + Integer.parseInt(headBoundingBox.get("w").toString()) + roiarray[0].intValue(),
Integer.parseInt(headBoundingBox.get("y").toString()) + Integer.parseInt(headBoundingBox.get("h").toString()) + roiarray[1].intValue()
Map faceBoundingBox = (Map) metadata.get("FaceBoundingBox");
lo = new Location(
Integer.parseInt(faceBoundingBox.get("x").toString()) + roiarray[0].intValue(),
Integer.parseInt(faceBoundingBox.get("y").toString()) + roiarray[1].intValue(),
Integer.parseInt(faceBoundingBox.get("x").toString()) +
Integer.parseInt(faceBoundingBox.get("w").toString()) + roiarray[0].intValue(),
Integer.parseInt(faceBoundingBox.get("y").toString()) +
Integer.parseInt(faceBoundingBox.get("h").toString()) + roiarray[1].intValue()
);
} catch (Exception ex) {
log.error(ex.toString());
}
} else {
if (null != metadata.get("HeadBoundingBox")) {
try {
Map headBoundingBox = (Map) metadata.get("HeadBoundingBox");
lo = new Location(
Integer.parseInt(headBoundingBox.get("x").toString()) + roiarray[0].intValue(),
Integer.parseInt(headBoundingBox.get("y").toString()) + roiarray[1].intValue(),
Integer.parseInt(headBoundingBox.get("x").toString()) + Integer.parseInt(headBoundingBox.get("w").toString()) + roiarray[0].intValue(),
Integer.parseInt(headBoundingBox.get("y").toString()) + Integer.parseInt(headBoundingBox.get("h").toString()) + roiarray[1].intValue()
);
} catch (Exception ex) {
log.error(ex.toString());
}
}
}
}
}
objlocation.put("location",lo);
if(null!=lo) {
traff.setObjx(lo.getX1()<lo.getX2()?lo.getX1():lo.getX2());
traff.setObjy(lo.getY1()<lo.getY2()?lo.getY1():lo.getY2());
traff.setObjw(lo.getX1()<lo.getX2()?lo.getX2() - lo.getX1():lo.getX1() - lo.getX2());
traff.setObjh(lo.getY1()<lo.getY2()?lo.getY2() - lo.getY1():lo.getY1() - lo.getY2());
if (null != lo) {
objlocation.put("location", lo);
traff.setObjx(lo.getX1() < lo.getX2() ? lo.getX1() : lo.getX2());
traff.setObjy(lo.getY1() < lo.getY2() ? lo.getY1() : lo.getY2());
traff.setObjw(lo.getX1() < lo.getX2() ? lo.getX2() - lo.getX1() : lo.getX1() - lo.getX2());
traff.setObjh(lo.getY1() < lo.getY2() ? lo.getY2() - lo.getY1() : lo.getY1() - lo.getY2());
return objlocation;
} else {
return null;
}
}
public void getDetectInfo(String recordtype, Map metadata, Map objlocation) {
String metatype = metadata.get("Type").toString();
if ("20".equals(recordtype)) {//周界入侵,展示objectType
objlocation.put("objectType", metadata.get("Type").toString());
objlocation.put("objectType", metatype);
} else if ("41".equals(recordtype)) {
//汽车
if ("2".equals(metatype)) {
......@@ -381,22 +403,31 @@ log.error(ex.toString());
objlocation.put("helmet", helmet);
}
}
} else if ("50".equals(recordtype)) {
if ("1".equals(metatype) || "3".equals(metatype) || "4".equals(metatype)) {
int mask = Integer.parseInt(metadata.get("HasMask").toString());
//佩戴口罩识别
objlocation.put("mask", mask);
// if (mask == 0) {
// objlocation.put("mask", mask);
// }
}
}
}
public void uploadPicture(TraffpictureParam traffpictureParam,String url, List<Map> points, String basepath, String filename) {
public void uploadPicture(TraffpictureParam traffpictureParam, String url, List<Map> points, String basepath, String filename) {
try {
completionService.submit(() -> {
InputStream streanm = RestUtil.ReadFromURL(url);
ByteArrayOutputStream bos = PointUtil.drawByPoints(streanm, points);
if (null == bos) {
log.error("picture is null");
return false;
}
InputStream streanm = RestUtil.ReadFromURL(url);
ByteArrayOutputStream bos = PointUtil.drawByPoints(streanm, points);
if (null == bos) {
log.error("picture is null");
return false;
}
File file= FileUtil.uploadToLocal(filerootpath+File.separator+
outpath+File.separator+
basepath,bos,filename);
File file = FileUtil.uploadToLocal(filerootpath + File.separator +
outpath + File.separator +
basepath, bos, filename);
// HttpHeaders headers = new HttpHeaders();
......@@ -423,10 +454,10 @@ log.error(ex.toString());
// }
//
// };
// parts.add(basepath+File.separator+filename, resource);
// parts.add(basepath+File.separator+filename, resource);
// parts.add("name", basepath);
// parts.add("filename", filename);
// parts.add("folder", "1");
// parts.add("folder", "1");
// headers.setContentType(MediaType.MULTIPART_FORM_DATA);
// HttpEntity<MultiValueMap<String, Object>> files = new HttpEntity<>(parts, headers);
......@@ -435,11 +466,11 @@ log.error(ex.toString());
// parts.add("file", new FileSystemResource(file));
// }
//traffpictureParam.setImagedata(basepath+File.separator+filename);
// traffPictureService.updateTraffpicture(traffpictureParam);
// traffPictureService.updateTraffpicture(traffpictureParam);
// FileUploadResultVo resultVo=new FileUploadResultVo();
//resultVo = restTemplate.postForObject(uploadurl, files, FileUploadResultVo.class);
//resultVo = restTemplate.postForObject(uploadurl, files, FileUploadResultVo.class);
//restTemplate.put(uploadurl, files);
//删除
//删除
// if (file.delete()) {
// log.info("delete file success");
// }
......@@ -453,7 +484,7 @@ log.error(ex.toString());
// return true;
// }
return true;
return true;
}).get(timeout, TimeUnit.SECONDS);
} catch (Exception ex) {
log.error(" uplaod file:{}", ex.toString());
......
......@@ -340,9 +340,7 @@ public class QuartzServiceImpl implements QuartzService, InitializingBean {
// if (ResultEnum.HTTP.getMessage().equals(sendType)) {
try {
//将抽取的时间段获得,如果是没有规则,全抽所有。、
//如果是当天上午八点,就抽当天8点之前喝前一天的3点之后0 30 8 ? * *
HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", taskNo);
HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", executeParameter);
logger.info("");
} catch (Exception ex) {
logger.error("");
......
......@@ -11,6 +11,7 @@ import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletionService;
......@@ -89,32 +90,57 @@ public class FileTransferManager {
return record;
}
public static GoalStructureParam getGoalStructureParam(Long[] roiarray, int model, BASE64Encoder base64Encoder, TraffAlarmRecord transferRecord) {
// public static GoalStructureParam getGoalStructureParam(Long[] roiarray, int model, BASE64Encoder base64Encoder, TraffAlarmRecord transferRecord) {
// //获得图片进行分析
// GoalStructureParam param = new GoalStructureParam();
// param.setOutput(new Output(1));
// param.setModel(model);
// param.setApiout("1");////打开1400标准输出,默认可以不填
// List<ImageList> list = new ArrayList<>();
// getImageList("1", roiarray, base64Encoder, list, transferRecord.getImg1path());
// param.setImageList(list);
// return param;
//
// }
public static GoalStructureParam getGoalStructureParam(Long[] roiarray, int model,int format, TraffAlarmRecord transferRecord) {
//获得图片进行分析
GoalStructureParam param = new GoalStructureParam();
param.setOutput(new Output(1));
Map outmap=new HashMap();
outmap.put("SubClass",1);
param.setOutput(outmap);
param.setModel(model);
param.setApiout("1");////打开1400标准输出,默认可以不填
List<ImageList> list = new ArrayList<>();
getImageList("1", roiarray, base64Encoder, list, transferRecord.getImg1path());
List<Map> list = new ArrayList<>();
Map imgmap=new HashMap();
imgmap.put("ImageID","1");
imgmap.put("Roi",roiarray);
imgmap.put("apiout","1");
imgmap.put("Format",format);
imgmap.put("Data",transferRecord.getImg1path());
imgmap.put("RoiPadding",0);
imgmap.put("CropObjectImage",1);
imgmap.put("CropObjectImagePadding",20);
imgmap.put("CropObjectImageQuality",100);
list.add(imgmap);
// new ImageList("1", roiarray, format,10, 1, 20, 100, transferRecord.getImg1urlfrom())
// getImageList("1", roiarray,format, list, transferRecord.getImg1urlfrom());
param.setImageList(list);
return param;
}
private static void getImageList(String id, Long[] roiarray, BASE64Encoder base64Encoder, List<ImageList> list, String img1path) {
if (null != img1path && !"".equals(img1path)) {
byte[] Img = FTPUtil.getFtpPicBytes(img1path);
if (Img != null) {
list.add(new ImageList(id, roiarray, 10, 1, 20, 100, base64Encoder.encode(Img).replaceAll("\r|\n", "")));
}
}
}
// private static void getImageList(String id, Long[] roiarray, BASE64Encoder base64Encoder, List<ImageList> list, String img1path) {
// if (null != img1path && !"".equals(img1path)) {
//
// byte[] Img = FTPUtil.getFtpPicBytes(img1path);
// if (Img != null) {
// list.add(new ImageList(id, roiarray, 10, 1, 20, 100, base64Encoder.encode(Img).replaceAll("\r|\n", "")));
//
// }
// }
// }
public static String urlTransToFtp(String url, final Ftp ftp, final String basePath) {
threadService.submit(() -> {
......
......@@ -59,7 +59,8 @@ public static ByteArrayOutputStream drawByPoints(InputStream bais,List<Map> det
try {
Location lo =(Location) box.get("location");
logger.info("detectObjects x1,x2,y1,y2==="+lo.toString());
g.drawRect(lo.getX1(),lo.getY1(),lo.getX2()-lo.getX1(),lo.getY2()-lo.getY1());
g.drawRect(lo.getX1(),
lo.getY1(),lo.getX2()-lo.getX1(),lo.getY2()-lo.getY1());
}catch (Exception ex){
logger.error("Location Map error:{}", ex.toString());
}
......
package com.cx.cn.cxquartz.util;
import com.alibaba.fastjson.JSONObject;
import com.cx.cn.cxquartz.controller.ExtController;
import com.cx.cn.cxquartz.service.quartz.SbtdspsrService;
import com.cx.cn.cxquartz.vo.TraffAlarmRecord;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,61 +25,61 @@ public class RestUtil {
@Autowired
public SbtdspsrService sbtdspsrService;
public String getnewRtspVlue(String devicecode,String getrtspbyurl ){
String rtspnewvalue="";
Map<String, String> map = new HashMap<>();
map.put("deviceCode", devicecode);
ResponseEntity<String> responseEntity = restTemplate.getForEntity(getrtspbyurl+"?deviceCode={deviceCode}", String.class, map);
JSONObject json = JSONObject.parseObject(responseEntity.getBody());
if (null != json.getString("errorCode") && json.getString("errorCode").equals("0")) {
//返回rtsp 地址
json = JSONObject.parseObject(json.getString("data"));
if (null != json.get("rtspUri") && !"".equals(json.get("rtspUri"))) {
rtspnewvalue = String.valueOf(json.get("rtspUri"));
if(rtspnewvalue.contains("rtsp")) {
//更新sbtdspsr 地址
int result = sbtdspsrService.updateRecogByRtsp(rtspnewvalue, devicecode);
if (result > 0) {
logger.info("更新rtsp success");
} else {
logger.info("设备" + devicecode + "不存在");
}
}
else {
logger.info("获取失败");
}
}
}
return rtspnewvalue;
}
public void rtspChangeVlue(String devicecode,String oldrtsp,String getrtspbyurl ){
String rtspnewvalue="";
Map<String, String> map = new HashMap<>();
map.put("deviceCode", devicecode);
ResponseEntity<String> responseEntity = restTemplate.getForEntity(getrtspbyurl+"?deviceCode={deviceCode}", String.class, map);
JSONObject json = JSONObject.parseObject(responseEntity.getBody());
if (null != json.getString("errorCode") && json.getString("errorCode").equals("0")) {
//返回rtsp 地址
json = JSONObject.parseObject(json.getString("data"));
if (null != json.get("rtspUri") && !"".equals(json.get("rtspUri"))) {
rtspnewvalue = String.valueOf(json.get("rtspUri"));
//与新获得的rtsp 比较,如果一样则不更新,否则更新
if(oldrtsp.contains("rtsp") && !oldrtsp.equals(rtspnewvalue)) {
//更新sbtdspsr 地址
int result = sbtdspsrService.updateRecogByRtsp(rtspnewvalue, devicecode);
if (result > 0) {
logger.info("更新rtsp success");
} else {
logger.info("设备" + devicecode + "不存在");
}
}
else {
logger.info("获取失败");
}
}
}
}
//
// public String getnewRtspVlue(String devicecode,String getrtspbyurl ){
// String rtspnewvalue="";
// Map<String, String> map = new HashMap<>();
// map.put("deviceCode", devicecode);
// ResponseEntity<String> responseEntity = restTemplate.getForEntity(getrtspbyurl+"?deviceCode={deviceCode}", String.class, map);
// JSONObject json = JSONObject.parseObject(responseEntity.getBody());
// if (null != json.getString("errorCode") && json.getString("errorCode").equals("0")) {
// //返回rtsp 地址
// json = JSONObject.parseObject(json.getString("data"));
// if (null != json.get("rtspUri") && !"".equals(json.get("rtspUri"))) {
// rtspnewvalue = String.valueOf(json.get("rtspUri"));
// if(rtspnewvalue.contains("rtsp")) {
// //更新sbtdspsr 地址
// int result = sbtdspsrService.updateRecogByRtsp(rtspnewvalue, devicecode);
// if (result > 0) {
// logger.info("更新rtsp success");
// } else {
// logger.info("设备" + devicecode + "不存在");
// }
// }
// else {
// logger.info("获取失败");
// }
// }
// }
// return rtspnewvalue;
// }
// public void rtspChangeVlue(String devicecode,String oldrtsp,String getrtspbyurl ){
// String rtspnewvalue="";
// Map<String, String> map = new HashMap<>();
// map.put("deviceCode", devicecode);
// ResponseEntity<String> responseEntity = restTemplate.getForEntity(getrtspbyurl+"?deviceCode={deviceCode}", String.class, map);
// JSONObject json = JSONObject.parseObject(responseEntity.getBody());
// if (null != json.getString("errorCode") && json.getString("errorCode").equals("0")) {
// //返回rtsp 地址
// json = JSONObject.parseObject(json.getString("data"));
// if (null != json.get("rtspUri") && !"".equals(json.get("rtspUri"))) {
// rtspnewvalue = String.valueOf(json.get("rtspUri"));
// //与新获得的rtsp 比较,如果一样则不更新,否则更新
// if(oldrtsp.contains("rtsp") && !oldrtsp.equals(rtspnewvalue)) {
// //更新sbtdspsr 地址
// int result = sbtdspsrService.updateRecogByRtsp(rtspnewvalue, devicecode);
// if (result > 0) {
// logger.info("更新rtsp success");
// } else {
// logger.info("设备" + devicecode + "不存在");
// }
// }
// else {
// logger.info("获取失败");
// }
// }
// }
// }
public String getPicture(List<String> imgUrls, String deviceCode, String rtspurl, TraffAlarmRecord record ) {
HttpHeaders headers = new HttpHeaders();
......@@ -88,42 +87,40 @@ public class RestUtil {
Map<String, Object> maps = new HashMap<>();
maps.put("deviceCode", deviceCode);
logger.info("rtspurl:{}",rtspurl);
HttpEntity<String> formEntity = new HttpEntity<>(null, headers);
ResponseEntity<String> exchange = restTemplate.exchange(rtspurl + "?deviceCode={deviceCode}",
HttpMethod.GET, formEntity, String.class, maps);
if(null!=exchange.getBody()) {
JSONObject json = JSONObject.parseObject(exchange.getBody());
if (null != json.getString("ret") && json.getString("ret").equals("0")) {
Map result = restTemplate.getForObject(rtspurl + "?deviceCode={deviceCode}", Map.class, maps);
if(null!=result) {
if (null != result.get("ret") && String.valueOf(result.get("ret")).equals("0")) {
//获得图片地址
imgUrls.add(json.getString("url"));
record.setImg1urlfrom(json.getString("url"));
record.setImg1path(json.getString("localuri"));
imgUrls.add(result.get("url").toString());
record.setImg1urlfrom(result.get("url").toString());
record.setImg1path(result.get("localuri").toString());
return result.get("timestamp").toString();
}
return json.getString("timestamp");
}
return null;
}
public String getSnapshot(List<String> imgUrls, String deviceCode, String rtspurl, TraffAlarmRecord record ) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Map<String, Object> maps = new HashMap<>();
maps.put("deviceCode", deviceCode);
logger.info("rtspurl:{}",rtspurl);
HttpEntity<String> formEntity = new HttpEntity<>(null, headers);
ResponseEntity<String> exchange = restTemplate.exchange(rtspurl + "?deviceCode={deviceCode}",
HttpMethod.GET, formEntity, String.class, maps);
if(null!=exchange.getBody()) {
JSONObject json = JSONObject.parseObject(exchange.getBody());
if (null != json.getString("ret") && json.getString("ret").equals("0")) {
//获得图片地址
imgUrls.add(json.getString("url"));
record.setImg1path(json.getString("url"));
}
return json.getString("timestamp");
}
return null;
}
//
// public String getSnapshot(List<String> imgUrls, String deviceCode, String rtspurl, TraffAlarmRecord record ) {
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
// Map<String, Object> maps = new HashMap<>();
// maps.put("deviceCode", deviceCode);
// logger.info("rtspurl:{}",rtspurl);
// HttpEntity<String> formEntity = new HttpEntity<>(null, headers);
// ResponseEntity<String> exchange = restTemplate.exchange(rtspurl + "?deviceCode={deviceCode}",
// HttpMethod.GET, formEntity, String.class, maps);
// if(null!=exchange.getBody()) {
// JSONObject json = JSONObject.parseObject(exchange.getBody());
// if (null != json.getString("ret") && json.getString("ret").equals("0")) {
// //获得图片地址
// imgUrls.add(json.getString("url"));
// record.setImg1path(json.getString("url"));
// }
// return json.getString("timestamp");
// }
// return null;
// }
/// <summary>
/// 读取远程文件的内容
......@@ -143,6 +140,7 @@ public class RestUtil {
}
} catch (IOException e) {
logger.error(e.toString());
}
return null;
}
......
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonAutoDetect(fieldVisibility=JsonAutoDetect.Visibility.ANY, getterVisibility=JsonAutoDetect.Visibility.NONE)
public class GoalStructureParam {
@JsonProperty("Output")
private Output Output;
private Map Output;
@JsonProperty("Model")
private int Model;
......@@ -19,16 +21,9 @@ public class GoalStructureParam {
private String apiout;
@JsonProperty("ImageList")
private List<ImageList> ImageList;
public void setOutput(Output Output) {
this.Output = Output;
}
private List<Map> ImageList;
public Output getOutput() {
return this.Output;
}
public void setModel(int Model) {
this.Model = Model;
......@@ -47,12 +42,19 @@ public class GoalStructureParam {
return this.apiout;
}
public void setImageList(List<ImageList> ImageList) {
this.ImageList = ImageList;
public Map getOutput() {
return Output;
}
public void setOutput(Map output) {
Output = output;
}
public List<Map> getImageList() {
return ImageList;
}
public List<ImageList> getImageList() {
return this.ImageList;
public void setImageList(List<Map> imageList) {
ImageList = imageList;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ImageList {
......@@ -10,12 +9,12 @@ public class ImageList {
@JsonProperty("Roi")
private Long[] Roi;
@JsonIgnore
@JsonProperty("Format")
private int Format;
@JsonProperty("Data")
private String Data;
// private Integer RoiPadding;
private Integer RoiPadding;
private Integer CropObjectImage;
private Integer CropObjectImagePadding;
private Integer CropObjectImageQuality;
......@@ -29,13 +28,13 @@ public class ImageList {
Roi = roi;
}
// public Integer getRoiPadding() {
// return RoiPadding;
// }
//
// public void setRoiPadding(Integer roiPadding) {
// RoiPadding = roiPadding;
// }
public Integer getRoiPadding() {
return RoiPadding;
}
public void setRoiPadding(Integer roiPadding) {
RoiPadding = roiPadding;
}
public Integer getCropObjectImage() {
return CropObjectImage;
......@@ -70,13 +69,24 @@ public class ImageList {
public ImageList(String imageID, Long[] roi, Integer roiPadding, Integer cropObjectImage, Integer cropObjectImagePadding, Integer cropObjectImageQuality, String data) {
ImageID = imageID;
Roi = roi;
// RoiPadding = roiPadding;
RoiPadding = roiPadding;
CropObjectImage = cropObjectImage;
CropObjectImagePadding = cropObjectImagePadding;
CropObjectImageQuality = cropObjectImageQuality;
Data = data;
}
public ImageList(String imageID, Long[] roi, int format, Integer roiPadding, Integer cropObjectImage, Integer cropObjectImagePadding, Integer cropObjectImageQuality,String data) {
ImageID = imageID;
Roi = roi;
Format = format;
Data = data;
RoiPadding = roiPadding;
CropObjectImage = cropObjectImage;
CropObjectImagePadding = cropObjectImagePadding;
CropObjectImageQuality = cropObjectImageQuality;
}
public ImageList() {
}
......
package com.cx.cn.cxquartz.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/***
* 行人
*/
public class Pedestrian {
@JsonIgnore
private Long id;
private String Type;
private ObjectBoundingBox ObjectBoundingBox;
......@@ -43,7 +39,7 @@ public class Pedestrian {
public void setType(String Type) {
this.Type = Type;
}
@JSONField(name = "Type")
@JsonProperty("Type")
public String getType() {
return Type;
}
......@@ -52,7 +48,7 @@ public class Pedestrian {
public void setObjectBoundingBox(ObjectBoundingBox ObjectBoundingBox) {
this.ObjectBoundingBox = ObjectBoundingBox;
}
@JSONField(name = "ObjectBoundingBox")
@JsonProperty("ObjectBoundingBox")
public ObjectBoundingBox getObjectBoundingBox() {
return ObjectBoundingBox;
}
......@@ -68,7 +64,7 @@ public class Pedestrian {
public void setGender(String Gender) {
this.Gender = Gender;
}
@JSONField(name = "Gender")
@JsonProperty("Gender")
public String getGender() {
return Gender;
}
......@@ -76,7 +72,7 @@ public class Pedestrian {
public void setAge(String Age) {
this.Age = Age;
}
@JSONField(name = "Age")
@JsonProperty("Age")
public String getAge() {
return Age;
}
......@@ -84,7 +80,7 @@ public class Pedestrian {
public void setAngle(String Angle) {
this.Angle = Angle;
}
@JSONField(name = "Angle")
@JsonProperty("Angle")
public String getAngle() {
return Angle;
}
......@@ -92,7 +88,7 @@ public class Pedestrian {
public void setHasBackpack(String HasBackpack) {
this.HasBackpack = HasBackpack;
}
@JSONField(name = "HasBackpack")
@JsonProperty("HasBackpack")
public String getHasBackpack() {
return HasBackpack;
}
......@@ -100,7 +96,7 @@ public class Pedestrian {
public void setHasGlasses(String HasGlasses) {
this.HasGlasses = HasGlasses;
}
@JSONField(name = "HasGlasses")
@JsonProperty("HasGlasses")
public String getHasGlasses() {
return HasGlasses;
}
......@@ -108,7 +104,7 @@ public class Pedestrian {
public void setHasCarrybag(String HasCarrybag) {
this.HasCarrybag = HasCarrybag;
}
@JSONField(name = "HasCarrybag")
@JsonProperty("HasCarrybag")
public String getHasCarrybag() {
return HasCarrybag;
}
......@@ -116,7 +112,7 @@ public class Pedestrian {
public void setHasUmbrella(String HasUmbrella) {
this.HasUmbrella = HasUmbrella;
}
@JSONField(name = "HasUmbrella")
@JsonProperty("HasUmbrella")
public String getHasUmbrella() {
return HasUmbrella;
}
......@@ -124,7 +120,7 @@ public class Pedestrian {
public void setCoatLength(String CoatLength) {
this.CoatLength = CoatLength;
}
@JSONField(name = "CoatLength")
@JsonProperty("CoatLength")
public String getCoatLength() {
return CoatLength;
}
......@@ -132,7 +128,7 @@ public class Pedestrian {
public void setCoatColorNums(String CoatColorNums) {
this.CoatColorNums = CoatColorNums;
}
@JSONField(name = "CoatColorNums")
@JsonProperty("CoatColorNums")
public String getCoatColorNums() {
return CoatColorNums;
}
......@@ -142,7 +138,7 @@ public class Pedestrian {
public void setTrousersLength(String TrousersLength) {
this.TrousersLength = TrousersLength;
}
@JSONField(name = "TrousersLength")
@JsonProperty( "TrousersLength")
public String getTrousersLength() {
return TrousersLength;
}
......@@ -150,7 +146,7 @@ public class Pedestrian {
public void setTrousersColorNums(String TrousersColorNums) {
this.TrousersColorNums = TrousersColorNums;
}
@JSONField(name = "TrousersColorNums")
@JsonProperty( "TrousersColorNums")
public String getTrousersColorNums() {
return TrousersColorNums;
}
......@@ -160,7 +156,7 @@ public class Pedestrian {
public void setHeadBoundingBox(HeadBoundingBox HeadBoundingBox) {
this.HeadBoundingBox = HeadBoundingBox;
}
@JSONField(name = "HeadBoundingBox")
@JsonProperty("HeadBoundingBox")
public HeadBoundingBox getHeadBoundingBox() {
return HeadBoundingBox;
}
......@@ -168,7 +164,7 @@ public class Pedestrian {
public void setUpperBoundingBox(UpperBoundingBox UpperBoundingBox) {
this.UpperBoundingBox = UpperBoundingBox;
}
@JSONField(name = "UpperBoundingBox")
@JsonProperty("UpperBoundingBox")
public UpperBoundingBox getUpperBoundingBox() {
return UpperBoundingBox;
}
......@@ -176,7 +172,7 @@ public class Pedestrian {
public void setLowerBoundingBox(LowerBoundingBox LowerBoundingBox) {
this.LowerBoundingBox = LowerBoundingBox;
}
@JSONField(name = "LowerBoundingBox")
@JsonProperty("LowerBoundingBox")
public LowerBoundingBox getLowerBoundingBox() {
return LowerBoundingBox;
}
......@@ -184,7 +180,7 @@ public class Pedestrian {
public void setFaceBoundingBox(FaceBoundingBox FaceBoundingBox) {
this.FaceBoundingBox = FaceBoundingBox;
}
@JSONField(name = "FaceBoundingBox")
@JsonProperty("FaceBoundingBox")
public FaceBoundingBox getFaceBoundingBox() {
return FaceBoundingBox;
}
......@@ -192,7 +188,7 @@ public class Pedestrian {
public void setHasHat(String HasHat) {
this.HasHat = HasHat;
}
@JSONField(name = "HasHat")
@JsonProperty("HasHat")
public String getHasHat() {
return HasHat;
}
......@@ -200,7 +196,7 @@ public class Pedestrian {
public void setHasMask(String HasMask) {
this.HasMask = HasMask;
}
@JSONField(name = "HasMask")
@JsonProperty("HasMask")
public String getHasMask() {
return HasMask;
}
......@@ -208,7 +204,7 @@ public class Pedestrian {
public void setHairStyle(String HairStyle) {
this.HairStyle = HairStyle;
}
@JSONField(name = "HairStyle")
@JsonProperty( "HairStyle")
public String getHairStyle() {
return HairStyle;
}
......@@ -216,7 +212,7 @@ public class Pedestrian {
public void setCoatTexture(String CoatTexture) {
this.CoatTexture = CoatTexture;
}
@JSONField(name = "CoatTexture")
@JsonProperty("CoatTexture")
public String getCoatTexture() {
return CoatTexture;
}
......@@ -224,7 +220,7 @@ public class Pedestrian {
public void setTrousersTexture(String TrousersTexture) {
this.TrousersTexture = TrousersTexture;
}
@JSONField(name = "TrousersTexture")
@JsonProperty("TrousersTexture")
public String getTrousersTexture() {
return TrousersTexture;
}
......@@ -232,7 +228,7 @@ public class Pedestrian {
public void setHasTrolley(String HasTrolley) {
this.HasTrolley = HasTrolley;
}
@JSONField(name = "HasTrolley")
@JsonProperty("HasTrolley")
public String getHasTrolley() {
return HasTrolley;
}
......@@ -240,7 +236,7 @@ public class Pedestrian {
public void setHasLuggage(String HasLuggage) {
this.HasLuggage = HasLuggage;
}
@JSONField(name = "HasLuggage")
@JsonProperty("HasLuggage")
public String getHasLuggage() {
return HasLuggage;
}
......@@ -248,7 +244,7 @@ public class Pedestrian {
public void setLuggageColorNums(String LuggageColorNums) {
this.LuggageColorNums = LuggageColorNums;
}
@JSONField(name = "LuggageColorNums")
@JsonProperty("LuggageColorNums")
public String getLuggageColorNums() {
return LuggageColorNums;
}
......@@ -256,12 +252,12 @@ public class Pedestrian {
public void setHasKnife(int HasKnife) {
this.HasKnife = HasKnife;
}
@JSONField(name = "HasKnife")
@JsonProperty("HasKnife")
public int getHasKnife() {
return HasKnife;
}
@JSONField(name = "CoatColor")
@JsonProperty("CoatColor")
public String getCoatColor() {
return CoatColor;
}
......@@ -270,7 +266,7 @@ public class Pedestrian {
CoatColor = coatColor;
}
@JSONField(name = "TrousersColor")
@JsonProperty("TrousersColor")
public String getTrousersColor() {
return TrousersColor;
}
......@@ -279,7 +275,7 @@ public class Pedestrian {
TrousersColor = trousersColor;
}
@JSONField(name = "LuggageColor")
@JsonProperty("LuggageColor")
public String getLuggageColor() {
return LuggageColor;
}
......
......@@ -35,11 +35,11 @@ local:
file:
rtspurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshot
recogurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshotAndRecognize
recogurl: http://zjh189.ncpoi.cc:9098/images/recog
uploadurl: http://home2.ncpoi.cc:7080/uploadResultFile
countryside:
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc
logging:
level:
......
......@@ -27,7 +27,9 @@ local:
countryside:
callbackurl: http://kvideo.51iwifi.com
file:
rootpath: /home/ubuntu/pictures
# rootpath: /home/ubuntu/pictures
recogurl: http://172.16.24.29:9098/images/recog
rtspurl: http://172.16.24.29:7180/getDeviceSnapshot
logging:
level:
com.cx.cn.cxquartz.dao:
......
spring:
profiles:
active: local
active: dev85
mybatis:
type-aliases-package: com.cx.cn.cxquartz.bean
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="/home/ubuntu/tar/zjdxtest/logs/${spring.application.name}"/>
<!--<property name="log.path" value="/home/prod/deploy/HZDXService/logs/${spring.application.name}"/>-->
<!--<property name="log.path" value="/home/ubuntu/tar/zjdxtest/logs/${spring.application.name}"/>-->
<property name="log.path" value="/home/prod/deploy/HZDXService/logs/${spring.application.name}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......
......@@ -20,7 +20,7 @@
select * from
quartz_task_informations b
WHERE
(taskNo = #{rtsp})
(taskNo =#{rtsp})
and frozenstatus='UNFROZEN'
</select>
......
......@@ -13,86 +13,10 @@
<insert id="inserTraffAlarmRecord" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord" useGeneratedKeys="true" keyProperty="recordid" keyColumn="recordid">
insert into traffalarmrecord
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="algotype != null">algotype,</if>
<if test="areaid != null">areaid,</if>
<if test="fdid != null">fdid,</if>
<if test="channelid != null">channelid,</if>
<if test="channeletype != null">channeletype,</if>
<if test="channelname != null">channelname ,</if>
<if test="recordtime != null">recordtime,</if>
<if test="recordtype != null">recordtype,</if>
<if test="location != null">location,</if>
<if test="img1urlfrom != null">img1urlfrom,</if>
<if test="img1path != null">img1path,</if>
<if test="img2urlfrom != null">img2urlfrom,</if>
<if test="img2path != null">img2path,</if>
<if test="img3urlfrom != null">img3urlfrom,</if>
<if test="img3path != null">img3path,</if>
<if test="img4urlfrom != null">img4urlfrom,</if>
<if test="img4path != null">img4path,</if>
<if test="img5urlfrom != null">img5urlfrom,</if>
<if test="img5path != null">img5path,</if>
<if test="videourlfrom != null">videourlfrom,</if>
<if test="videopath != null">videopath,</if>
<if test="retrytime != null">retrytime,</if>
<if test="retrycount != null">retrycount,</if>
<if test="recordlevel != null">recordlevel,</if>
<if test="checkstatus != null">checkstatus,</if>
<if test="creator != null">creator,</if>
<if test="createtime != null">createtime,</if>
<if test="updator != null">updator,</if>
<if test="updatetime != null">updatetime,</if>
<if test="remark != null">remark,</if>
<if test="pushstatus != null">pushstatus,</if>
<if test="pushdesc != null">pushdesc,</if>
<if test="processstatus != null">processstatus,</if>
<if test="objlable != null">objlable,</if>
<if test="rectificationtype != null">rectificationtype ,</if>
<if test="manualstatus != null">manualstatus ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="algotype != null">#{algotype},</if>
<if test="areaid != null">#{areaid},</if>
<if test="fdid != null">#{fdid},</if>
<if test="channelid != null">#{ channelid},</if>
<if test="channeletype != null">#{channeletype},</if>
<if test="channelname != null">#{ channelname },</if>
<if test="recordtime != null">#{ recordtime},</if>
<if test="recordtype != null">#{ recordtype},</if>
<if test="location != null">#{ location},</if>
<if test="img1urlfrom != null">#{img1urlfrom},</if>
<if test="img1path != null">#{ img1path},</if>
<if test="img2urlfrom != null">#{img2urlfrom},</if>
<if test="img2path != null">#{ img2path},</if>
<if test="img3urlfrom != null">#{img3urlfrom},</if>
<if test="img3path != null">#{ img3path},</if>
<if test="img4urlfrom != null">#{img4urlfrom},</if>
<if test="img4path != null">#{ img4path},</if>
<if test="img5urlfrom != null">#{img5urlfrom},</if>
<if test="img5path != null">#{img5path},</if>
<if test="videourlfrom != null">#{videourlfrom},</if>
<if test="videopath != null">#{videopath},</if>
<if test="retrytime != null">#{retrytime},</if>
<if test="retrycount != null">#{retrycount},</if>
<if test="recordlevel != null">#{recordlevel,jdbcType=INTEGER},</if>
<if test="checkstatus != null">#{checkstatus,jdbcType=INTEGER},</if>
<if test="creator != null">#{creator},</if>
<if test="createtime != null">str_to_date(#{createtime},'%Y-%m-%d %H:%i:%s'),</if>
<if test="updator != null">#{updator},</if>
<if test="updatetime != null">#{updatetime},</if>
<if test="remark != null">#{remark},</if>
<if test="pushstatus != null">#{pushstatus},</if>
<if test="pushdesc != null">#{pushdesc},</if>
<if test="processstatus != null">#{processstatus},</if>
<if test="objlable != null">#{objlable},</if>
<if test="rectificationtype != null">#{rectificationtype},</if>
<if test="manualstatus != null">#{manualstatus,jdbcType=INTEGER},</if>
</trim>
</insert>
insert into traffalarmrecord(areaid,fdid,recordtype,channelid,recordtime,img1urlfrom,img1path,processstatus)
select #{areaid}, #{fdid},recordtype,#{ channelid},#{ recordtime},#{img1urlfrom},#{img1path},#{processstatus} from quartz_task_informations
where executeparamter=#{fdid} and frozenStatus='UNFROZEN' and taskno like 'fx_%'
</insert>
<update id="updateTraffAlarmRecordUrl" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
UPDATE traffalarmrecord
set updatetime= now()
......@@ -150,7 +74,7 @@
</update>
<select id="getTraffAlarmRecordByProgress" parameterType="java.util.HashMap" resultType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
select * from traffalarmrecord where fdid=#{sbbh} and processstatus='-2'
select * from traffalarmrecord where fdid=#{sbbh} and recordtype=#{recordtype} and processstatus='-2'
</select>
<update id="updateTraffAlarmRecordProcess" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
......
package com.quartz.cn.com.cx.cn.cxquartz;
import com.alibaba.fastjson.JSONObject;
import com.cx.cn.cxquartz.service.quartz.impl.SbtdspsrImpl;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.junit.Test;
......@@ -11,27 +10,27 @@ import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest
public class CXQuartzApplicationTests {
@Test
public void contextLoads() {
String body = "{\"errorCode\":\"0\",\"errorMsg\":\"success\",\"data\":{\"rtspUri\":\"rtsp://60.188.134.18:30030/streamDelivery_JX04_136/1_0_52268/3d10d70b9e7012bd2f85f35fa3d5f8d3\",\"rtpUri\":\"rtp://60.188.134.18:11348/304\",\"rtmpUri\":\"rtmp://60.188.134.18:30031/streamDelivery_JX04_136/1_0_52268/3d10d70b9e7012bd2f85f35fa3d5f8d3\",\"hlsUri\":\"http://60.188.134.18:30120/streamDelivery_JX04_136/1_0_52268/3d10d70b9e7012bd2f85f35fa3d5f8d3.m3u8\",\"received\":true}}";
JSONObject json = JSONObject.parseObject(body);
if (null != json.getString("errorCode") && json.getString("errorCode").equals("0")) {
json = JSONObject.parseObject(json.getString("data"));
//返回rtsp 地址
if (null != json.get("rtspUri") && !"".equals(json.get("rtspUri"))) {
String rtspnewvalue = String.valueOf(json.get("rtspUri"));
if (rtspnewvalue.contains("rtsp")) {
//更新sbtdspsr 地址
//int result = sbtdspsrService.updateRecogByRtsp(rtspnewvalue, devicecode);
}
}
}
}
//
// @Test
// public void contextLoads() {
// String body = "{\"errorCode\":\"0\",\"errorMsg\":\"success\",\"data\":{\"rtspUri\":\"rtsp://60.188.134.18:30030/streamDelivery_JX04_136/1_0_52268/3d10d70b9e7012bd2f85f35fa3d5f8d3\",\"rtpUri\":\"rtp://60.188.134.18:11348/304\",\"rtmpUri\":\"rtmp://60.188.134.18:30031/streamDelivery_JX04_136/1_0_52268/3d10d70b9e7012bd2f85f35fa3d5f8d3\",\"hlsUri\":\"http://60.188.134.18:30120/streamDelivery_JX04_136/1_0_52268/3d10d70b9e7012bd2f85f35fa3d5f8d3.m3u8\",\"received\":true}}";
// JSONObject json = JSONObject.parseObject(body);
// if (null != json.getString("errorCode") && json.getString("errorCode").equals("0")) {
// json = JSONObject.parseObject(json.getString("data"));
// //返回rtsp 地址
// if (null != json.get("rtspUri") && !"".equals(json.get("rtspUri"))) {
// String rtspnewvalue = String.valueOf(json.get("rtspUri"));
// if (rtspnewvalue.contains("rtsp")) {
// //更新sbtdspsr 地址
// //int result = sbtdspsrService.updateRecogByRtsp(rtspnewvalue, devicecode);
//
// }
//
// }
// }
// }
@Test
public void testfilepath(){
String ftpfilepath="ftp://jiuling:9ling.cn@172.16.24.29:21/gstraff/picturedemo/20210625.jpg";
......
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