Commit 12254c87 authored by yzm's avatar yzm

修复ftpbug

parent 42a7d921
...@@ -93,10 +93,6 @@ ...@@ -93,10 +93,6 @@
<version>1.9</version> <version>1.9</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
...@@ -120,15 +116,9 @@ ...@@ -120,15 +116,9 @@
<artifactId>spring-boot-starter-quartz</artifactId> <artifactId>spring-boot-starter-quartz</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-httpclient</artifactId>
<version>2.6</version> <version>3.1</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.6</version>
</dependency> </dependency>
<!-- redis --> <!-- redis -->
...@@ -142,12 +132,6 @@ ...@@ -142,12 +132,6 @@
<groupId>org.springframework.kafka</groupId> <groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId> <artifactId>spring-kafka</artifactId>
</dependency> </dependency>
<!-- HttpClient依赖 -->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
......
package com.cx.cn.cxquartz.config; package com.cx.cn.cxquartz.config;
import com.cx.cn.cxquartz.service.quartz.SbtdspsrService;
import com.cx.cn.cxquartz.util.RestUtil;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import java.util.Calendar; import java.util.Calendar;
import java.util.List;
@Configuration @Configuration
@EnableScheduling @EnableScheduling
public class ScheduleTaskConfig { public class ScheduleTaskConfig {
@Autowired
private SbtdspsrService sbtdspsrService;
@Value("${file.getrtspbyurl}")
private String getrtspbyurl;
RestUtil restUtil=new RestUtil();
/*** /***
* 每隔20分钟执行一遍判断rtsp 是否变换 * 每隔20分钟执行一遍判断rtsp 是否变换
*/ */
@Scheduled(cron = "0 0 2 * * ? ") @Scheduled(cron = "0 0 2 * * ? ")
private void statis() { private void statis() {
//查询所有监控设备,更新rtsp 地址
List<Sbtdspsr> sbtdpsrList= sbtdspsrService.list();
//调用decice 端口获得新的rtsp 地址,如果与表里的一样无需更新,不一样则立即更新
for(Sbtdspsr sbtd:sbtdpsrList)
{
restUtil.rtspChangeVlue(sbtd.getSbbh(),sbtd.getSqurllj(),getrtspbyurl);
}
} }
......
...@@ -20,20 +20,14 @@ import org.springframework.context.annotation.PropertySource; ...@@ -20,20 +20,14 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder; import sun.misc.BASE64Encoder;
import sun.net.www.protocol.ftp.FtpURLConnection;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.jws.Oneway;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.*; import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
...@@ -41,82 +35,53 @@ import java.util.concurrent.*; ...@@ -41,82 +35,53 @@ import java.util.concurrent.*;
@RestController @RestController
@RequestMapping("/ext") @RequestMapping("/ext")
@PropertySource("classpath:file.properties")
public class ExtController { public class ExtController {
private static final Logger logger = LoggerFactory.getLogger(ExtController.class); private static final Logger logger = LoggerFactory.getLogger(ExtController.class);
@Autowired @Autowired
private QuartzService quartzService; private QuartzService quartzService;
@Value("${file.uploadpath}") @Value("${file.uploadpath}")
private String uploadpath; private String uploadpath;
@Value("${file.alarmpath}") @Value("${file.alarmpath}")
private String alarmpath; private String alarmpath;
@Value("${file.alarmurl}") @Value("${file.alarmurl}")
private String alarmurl; private String alarmurl;
@Value("${file.recordurl}") @Value("${file.recordurl}")
private String recordurl; private String recordurl;
@Value("${file.rtspurl}") @Value("${file.rtspurl}")
private String rtspurl; private String rtspurl;
@Value("${file.recogurl}") @Value("${file.recogurl}")
private String recogurl; private String recogurl;
@Value("${file.getrtspbyurl}") @Value("${file.getrtspbyurl}")
private String getrtspbyurl; private String getrtspbyurl;
@Value("${file.publicpictureurl}") @Value("${file.publicpictureurl}")
private String publicpictureurl; private String publicpictureurl;
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Autowired @Autowired
private SbtdspsrService sbtdspsrService; private SbtdspsrService sbtdspsrService;
@Autowired @Autowired
FtpService ftpService; FtpService ftpService;
@Autowired
private QuartzTaskInformationsService quartzTaskInformationsService;
@Autowired @Autowired
TraffAlarmRecordService traffAlarmRecordService; TraffAlarmRecordService traffAlarmRecordService;
@Autowired @Autowired
TraffPictureService traffPictureService; TraffPictureService traffPictureService;
@Autowired @Autowired
PedestrianService pedestrianService; PedestrianService pedestrianService;
@Autowired @Autowired
TrafficService trafficService; TrafficService trafficService;
@Autowired @Autowired
FaceService faceService; FaceService faceService;
@Value("${file.ftppath}")
private String ftppath;
@Autowired @Autowired
PeopleridebicycService peopleridebicycService; PeopleridebicycService peopleridebicycService;
@Autowired @Autowired
WebSocket webSocket; WebSocket webSocket;
@Autowired @Autowired
CodeService codeservice; CodeService codeservice;
@Autowired @Autowired
EventWriteService eventWriteService; EventWriteService eventWriteService;
RestUtil restutil=new RestUtil();
private static CompletionService<PictureResult> threadService = new ExecutorCompletionService<PictureResult>(ThreadPoolUtil.getPool());
@RequestMapping(value = "/patrolCtrlRecord", method = RequestMethod.POST) @RequestMapping(value = "/patrolCtrlRecord", method = RequestMethod.POST)
public String upload(HttpServletRequest request) { public String upload(HttpServletRequest request) {
try { try {
...@@ -128,7 +93,6 @@ public class ExtController { ...@@ -128,7 +93,6 @@ public class ExtController {
String[] fileParam = null;//文件名称数组 String[] fileParam = null;//文件名称数组
String filename = "", fileatream = "", picturetime;//文件名拼接成的日期,图片生成时间 String filename = "", fileatream = "", picturetime;//文件名拼接成的日期,图片生成时间
SimpleDateFormat simpledate = new SimpleDateFormat("yyyyMMddHHmmss"), newsimpledate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//日期转换成特定格式 SimpleDateFormat simpledate = new SimpleDateFormat("yyyyMMddHHmmss"), newsimpledate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//日期转换成特定格式
List<File> newfilelist = new ArrayList<>();
RecursiveGetJsonData fileutil = new RecursiveGetJsonData(); RecursiveGetJsonData fileutil = new RecursiveGetJsonData();
fileutil.getDataFromFile(uploadpath, "jpeg"); fileutil.getDataFromFile(uploadpath, "jpeg");
List<File> jsonFile = fileutil.getJsonFileList(); //获得文件夹下所有文件信息 List<File> jsonFile = fileutil.getJsonFileList(); //获得文件夹下所有文件信息
...@@ -147,58 +111,56 @@ public class ExtController { ...@@ -147,58 +111,56 @@ public class ExtController {
headers.add("access-token", session.getAttribute("token").toString()); headers.add("access-token", session.getAttribute("token").toString());
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(5); ExecutorService fixedThreadPool = Executors.newFixedThreadPool(5);
for (File file : jsonFile) { for (File file : jsonFile) {
fixedThreadPool.execute(new Runnable() { fixedThreadPool.execute(() -> {
public void run() { String[] fileParam1 = file.getAbsolutePath().split("\\\\");
String[] fileParam = file.getAbsolutePath().split("\\\\"); String filename1 = fileParam1[fileParam1.length - 2] + fileParam1[fileParam1.length - 1].replace(".jpeg", "");
String filename = fileParam[fileParam.length - 2] + fileParam[fileParam.length - 1].replace(".jpeg", ""); if (null != fileParam1 && fileParam1.length > 4) {
if (null != fileParam && fileParam.length > 4) { String fileatream1 = fileutil.ImageToBase64ByLocal(file);
String fileatream = fileutil.ImageToBase64ByLocal(file); for (PatrolCtrlRecord record : recordList) {
for (PatrolCtrlRecord record : recordList) { if (record.getDeviceid().equals(fileParam1[fileParam1.length - 3])) {
if (record.getDeviceid().equals(fileParam[fileParam.length - 3])) { try {
try { String picturetime1 = newsimpledate.format(simpledate.parse(filename1));
String picturetime = newsimpledate.format(simpledate.parse(filename)); record.setPatrolTime(picturetime1);
record.setPatrolTime(picturetime); record.setRecordSrc("2");
record.setRecordSrc("2"); record.setFile(fileatream1);
record.setFile(fileatream); //调用推送接口
//调用推送接口 HttpEntity<String> requestEntity = new HttpEntity<>(JSONObject.toJSONString(record), headers);
HttpEntity<String> requestEntity = new HttpEntity<String>(JSONObject.toJSONString(record), headers); ResponseEntity<String> response = restTemplate.exchange(recordurl, HttpMethod.POST, requestEntity, String.class);
ResponseEntity<String> response = restTemplate.exchange(recordurl, HttpMethod.POST, requestEntity, String.class); String body = response.getBody();
String body = response.getBody(); JSONObject json = JSONObject.parseObject(body);
JSONObject json = JSONObject.parseObject(body); if (null != json.getString("status") && json.getString("status").equals("0")) {
if (null != json.getString("status") && json.getString("status").equals("0")) { record.setFile(null);
record.setFile(null); record.setPatrolTime(filename1);
record.setPatrolTime(filename); quartzService.insertRecord(record);
quartzService.insertRecord(record); logger.info("ext/patrolCtrlRecord success-->" + file.getAbsolutePath());
logger.info("ext/patrolCtrlRecord success-->" + file.getAbsolutePath()); } else {
} else { logger.info("ext/patrolCtrlRecord fail-->" + fileParam1[fileParam1.length - 1] + body);
logger.info("ext/patrolCtrlRecord fail-->" + fileParam[fileParam.length - 1] + body);
}
PatrolCtrlAlarm alarm = new PatrolCtrlAlarm();
alarm.setCameraCode(record.getCameraCode());
alarm.setCameraName(record.getCameraName());
alarm.setFile(fileatream);
alarm.setTime(picturetime);
alarm.setType("2");
//调用告警接口
ResponseEntity<String> alarmresponse = restTemplate.exchange(alarmurl, HttpMethod.POST, new HttpEntity<String>(JSONObject.toJSONString(alarm), headers), String.class);
JSONObject alarmjson = JSONObject.parseObject(alarmresponse.getBody());
if (null != alarmjson.getString("status") && alarmjson.getString("status").equals("0")) {
alarm.setFile(null);
alarm.setTime(filename);
quartzService.insertAlarm(alarm);
logger.info("ext/alarm success-->" + file.getAbsolutePath());
} else {
logger.info("ext/alarm fail-->" + fileParam[fileParam.length - 1] + alarmresponse.getBody());
}
} catch (Exception e) {
logger.error("ext/patrolCtrlRecord-->" + e.toString());
} }
PatrolCtrlAlarm alarm = new PatrolCtrlAlarm();
alarm.setCameraCode(record.getCameraCode());
alarm.setCameraName(record.getCameraName());
alarm.setFile(fileatream1);
alarm.setTime(picturetime1);
alarm.setType("2");
//调用告警接口
ResponseEntity<String> alarmresponse = restTemplate.exchange(alarmurl, HttpMethod.POST, new HttpEntity<>(JSONObject.toJSONString(alarm), headers), String.class);
JSONObject alarmjson = JSONObject.parseObject(alarmresponse.getBody());
if (null != alarmjson.getString("status") && alarmjson.getString("status").equals("0")) {
alarm.setFile(null);
alarm.setTime(filename1);
quartzService.insertAlarm(alarm);
logger.info("ext/alarm success-->" + file.getAbsolutePath());
} else {
logger.info("ext/alarm fail-->" + fileParam1[fileParam1.length - 1] + alarmresponse.getBody());
}
} catch (Exception e) {
logger.error("ext/patrolCtrlRecord-->" + e.toString());
} }
} }
} }
}
}
}); });
logger.info("ext/patrolCtrlRecord success-->" + "总共" + jsonFile.size() + "张,推送成功" + resultSuccess + "张,告警成功" + alarmresultSuccess + "张"); logger.info("ext/patrolCtrlRecord success-->" + "总共" + jsonFile.size() + "张,推送成功" + resultSuccess + "张,告警成功" + alarmresultSuccess + "张");
} }
...@@ -229,9 +191,9 @@ public class ExtController { ...@@ -229,9 +191,9 @@ public class ExtController {
List<String> imgUrls = new ArrayList<>(); List<String> imgUrls = new ArrayList<>();
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8); headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Map<String, Object> maps = new HashMap<String, Object>(); Map<String, Object> maps = new HashMap<>();
if(null==sbtdspsr.getSqurllj() ||"".equals(sbtdspsr.getSqurllj())){ if(null==sbtdspsr.getSqurllj() ||"".equals(sbtdspsr.getSqurllj())){
String rtsp=getnewRtspVlue(sbtdspsr.getSbbh()); String rtsp=restutil.getnewRtspVlue(sbtdspsr.getSbbh(),getrtspbyurl);
sbtdspsr.setSqurllj(rtsp); sbtdspsr.setSqurllj(rtsp);
} }
maps.put("rtspvalue", sbtdspsr.getSqurllj()); maps.put("rtspvalue", sbtdspsr.getSqurllj());
...@@ -246,13 +208,11 @@ public class ExtController { ...@@ -246,13 +208,11 @@ public class ExtController {
String body = exchange.getBody(); String body = exchange.getBody();
logger.info("getRTSP/1->body:",body); logger.info("getRTSP/1->body:",body);
if(null==body|| "".equals(body)){ if(null==body|| "".equals(body)){
JSONObject json = JSONObject.parseObject(exchange.getBody());
//rtsp地址可能改变,重新获取 //rtsp地址可能改变,重新获取
if(!videoid.contains("rtsp")) { if(!videoid.contains("rtsp")) {
String rtsp = getnewRtspVlue(sbtdspsr.getSbbh()); String rtsp =restutil.getnewRtspVlue(sbtdspsr.getSbbh(),getrtspbyurl);
maps.put("rtspvalue", rtsp); maps.put("rtspvalue", rtsp);
} }
} }
else{ else{
JSONObject json = JSONObject.parseObject(exchange.getBody()); JSONObject json = JSONObject.parseObject(exchange.getBody());
...@@ -264,108 +224,66 @@ public class ExtController { ...@@ -264,108 +224,66 @@ public class ExtController {
}catch (Exception ex) }catch (Exception ex)
{ {
//rtsp地址可能改变,重新获取 //rtsp地址可能改变,重新获取
String rtsp=getnewRtspVlue(sbtdspsr.getSbbh()); String rtsp=restutil.getnewRtspVlue(sbtdspsr.getSbbh(),getrtspbyurl);
maps.put("rtspvalue", rtsp); maps.put("rtspvalue", rtsp);
} }
try{ try{
if(imgUrls.size()==0){ if(imgUrls.size()==0){
logger.info("no picture data "); 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;
}
while (i < photonum) {
i++;
//第一张判断是否已经抽完图片,最多5张
if (i > 4) {
break;
}
ResponseEntity<String> exchange = restTemplate.exchange(rtspurl + "?url={rtspvalue}&refresh={refresh}",
HttpMethod.GET, formEntity, String.class, maps);
if(null!=exchange.getBody()|| !"".equals(exchange.getBody())) {
JSONObject json = JSONObject.parseObject(exchange.getBody());
if (null != json.getString("ret") && json.getString("ret").equals("0")) {
//获得图片地址
imgUrls.add(json.getString("url"));
}
}
}
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();
//入表
Long recordid = Long.parseLong(String.valueOf(traffAlarmRecordService.inserTraffAlarmRecord(traffAlarmRecord)));
FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap);
List<TransferResult> results = FileTransferManager.transferFile(transferRecordMap, ftp, basepath);
// logger.info("缓存数据上传结果:" + results.toString());
TraffAlarmRecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results);
traffAlarmRecord.setImg1path(recordBak.getImg1path());
traffAlarmRecord.setImg2path(recordBak.getImg2path());
traffAlarmRecord.setImg3path(recordBak.getImg3path());
traffAlarmRecord.setImg4path(recordBak.getImg4path());
traffAlarmRecord.setImg5path(recordBak.getImg5path());
traffAlarmRecord.setVideopath(recordBak.getVideopath());
//更新图片地址
traffAlarmRecordService.updateTraffAlarmRecordUrl(traffAlarmRecord);
return ResultUtil.success(); return ResultUtil.success();
} catch(Exception e){
logger.error("ext/getRTSPr-->error" + e.toString());
} }
return ResultUtil.success(); //根据rtsp 进行图片获取及存储
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;
}
//抽取图片
restutil.getPicture(imgUrls, maps, formEntity,rtspurl);
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);
FileTransferManager.fetchUrlsFromRecord(traffAlarmRecord, transferRecordMap);
List<TransferResult> results = FileTransferManager.transferFile(transferRecordMap, ftp, basepath);
// logger.info("缓存数据上传结果:" + results.toString());
TraffAlarmRecord recordBak = FileTransferManager.traffAlarmRecordUrlUpdate(results);
traffAlarmRecord.setImg1path(recordBak.getImg1path());
traffAlarmRecord.setImg2path(recordBak.getImg2path());
traffAlarmRecord.setImg3path(recordBak.getImg3path());
traffAlarmRecord.setImg4path(recordBak.getImg4path());
traffAlarmRecord.setImg5path(recordBak.getImg5path());
traffAlarmRecord.setVideopath(recordBak.getVideopath());
//更新图片地址
traffAlarmRecordService.updateTraffAlarmRecordUrl(traffAlarmRecord);
return ResultUtil.success();
} catch(Exception e){
logger.error("ext/getRTSPr-->error" + e.toString());
}
return ResultUtil.success();
} }
public String getnewRtspVlue(String devicecode ){
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;
}
/*** /***
* 适配算法偏移-30 的情况 * 适配算法偏移-30 的情况
* @param taskno * @param taskno 设备编号
* @return * @return
*/ */
@RequestMapping(value = "/getRecog", method = RequestMethod.POST) @RequestMapping(value = "/getRecog", method = RequestMethod.POST)
...@@ -375,13 +293,17 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -375,13 +293,17 @@ public String getnewRtspVlue(String devicecode ){
String model ="1"; String model ="1";
String recordtype ="1"; String recordtype ="1";
//图片框选出来的范围 //图片框选出来的范围
Long[] roiarray=new Long[4]; Long[] roiarray;
String videoid="",tdmc=""; String videoid,tdmc;
HttpHeaders headers = new HttpHeaders();
BASE64Encoder base64Encoder = new BASE64Encoder();
if (null != mapList && !mapList.equals("") && mapList.size()>0) { if (null != mapList && !mapList.equals("") && mapList.size()>0) {
//获得该监控的检测业务与检测范围 //获得该监控的检测业务与检测范围
for (Map<String, Object> map: mapList) { for (Map<String, Object> mapobj: mapList) {
for (Map.Entry<String, Object> maps:map.entrySet()) { roiarray=new Long[4];
videoid="";
tdmc="";
for (Map.Entry<String, Object> maps:mapobj.entrySet()) {
if("videoid".equals(maps.getKey())){ if("videoid".equals(maps.getKey())){
videoid = String.valueOf(maps.getValue()); videoid = String.valueOf(maps.getValue());
} }
...@@ -408,166 +330,162 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -408,166 +330,162 @@ public String getnewRtspVlue(String devicecode ){
tdmc=String.valueOf(maps.getValue()); tdmc=String.valueOf(maps.getValue());
} }
} }
}
//查询该监控下面还没有经过分析的数据 //查询该监控下面还没有经过分析的数据
String basepath = "gstraff/" + videoid+ "/" + DateUtils.formatCurrDayNoSign(); String basepath = "gstraff/" + videoid+ "/" + DateUtils.formatCurrDayNoSign();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("sbbh", videoid);
if(videoid.split("_").length<2){
logger.info("监控不存在"+videoid);
return ResultUtil.success();
}
map.put("sbbh", videoid.split("_")[0]);
map.put("tdbh", videoid.split("_")[1]);
List<TraffAlarmRecord> traffalarmrecordlist = traffAlarmRecordService.getTraffAlarmRecordByProgress(map); List<TraffAlarmRecord> traffalarmrecordlist = traffAlarmRecordService.getTraffAlarmRecordByProgress(map);
if(traffalarmrecordlist.size()<1) { if(traffalarmrecordlist.size()<1) {
return ResultUtil.success(); return ResultUtil.success();
} }
BASE64Decoder base64Decoder = new BASE64Decoder();
//开启多线程
//调用结构化服务,获得图片返回结果 //调用结构化服务,获得图片返回结果
HttpHeaders headers = new HttpHeaders();
BASE64Encoder base64Encoder = new BASE64Encoder();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8); headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
HttpEntity<String> requestEntity = null; HttpEntity<String> requestEntity = null;
for (TraffAlarmRecord transferRecord : traffalarmrecordlist) { if (getAlarm(model, recordtype, roiarray, tdmc, headers, base64Encoder, basepath, traffalarmrecordlist))
GoalStructureParam param = FileTransferManager.getGoalStructureParam(roiarray, return ResultUtil.success();
Integer.parseInt(model == null ? "1" : "".equals(model) ? "1" : model
), base64Encoder, transferRecord); }
if (param.getImageList().size() < 1) { return ResultUtil.success();
logger.info(" no imagelist "); }else {
logger.info("监控不属于该范围");
}
//更新record 表Progress 字段,0为 未检测,-2 为检测失败,将检测
//结果进行额外封装入表
logger.error("rtsp 不存在-->");
return ResultUtil.fail();
}
public boolean getAlarm(String model, String recordtype, Long[] roiarray, String tdmc, HttpHeaders headers, BASE64Encoder base64Encoder, String basepath, List<TraffAlarmRecord> traffalarmrecordlist) {
HttpEntity<String> requestEntity;
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 ");
transferRecord.setProcessstatus("-1");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
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 = JSONArray.parseArray(String.valueOf(result.get("ObjectList")), TraffpictureParam.class);
//获得 type,更新 recordalarm 为已分析
transferRecord.setProcessstatus("-1"); transferRecord.setProcessstatus("-1");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord); traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
continue; if (objectList.size() < 1) {
} logger.info(" no picturedata ");
requestEntity = new HttpEntity<>(JSONObject.toJSONString(param), headers); continue;
try { }
ResponseEntity<String> response = restTemplate.exchange(recogurl, HttpMethod.POST, requestEntity, String.class); TraffrecordData traffrecordData=new TraffrecordData();
//根据结构化统计查询是否超过密度,超过则预警
String body = response.getBody(); Code code = codeservice.selectalarmNum(recordtype);
JSONObject result = JSONObject.parseObject(body); roiarray[0] = roiarray[0] - 30;
if (null != result.get("ret") && result.get("ret").equals("200")) { roiarray[1] = roiarray[1] - 30;
//获得返回结果,根据 Metadata.type 判断是人,车,人骑车,并将详细信息入对应的表 roiarray[2] = roiarray[2] - 30;
List<TraffpictureParam> objectList = (List<TraffpictureParam>) JSONArray.parseArray(String.valueOf(result.get("ObjectList")), TraffpictureParam.class); roiarray[3] = roiarray[3] - 30;
//获得 type //判断是否统计结构化数据
//更新 recordalarm 为已分析 TraffpictureParam traffpictureParamresult = new TraffpictureParam();
transferRecord.setProcessstatus("-1"); traffpictureParamresult.setImagedata(transferRecord.getImg1path());
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord); if (("6".equals(recordtype) || "2".equals(recordtype))) {
if (objectList.size() < 1) { if (null != code && null != code.getAlarmnum() && code.getAlarmnum() < objectList.size()) {
logger.info(" no picturedata "); setTraffpictureParam(recordtype, transferRecord, traffpictureParamresult);
continue; traffpictureParamresult.setTargetnum(objectList.size());
//超过则预警
traffpictureParamresult.setRecordtype(recordtype);
traffPictureService.updateTraffpicture(traffpictureParamresult);
} }
else{
TraffrecordData sendtozhiui=new TraffrecordData(); return true;
//根据结构化统计查询是否超过密度,超过则预警
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()) {
setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParamresult);
traffpictureParamresult.setTargetnum(objectList.size());
//超过则预警
traffpictureParamresult.setRecordtype(recordtype);
traffPictureService.updateTraffpicture(traffpictureParamresult);
}
else{
return ResultUtil.success();
}
} }
}
// if ((("6".equals(recordtype) || "2".equals(recordtype)) // if ((("6".equals(recordtype) || "2".equals(recordtype))
// && (null != code && null != code.getAlarmnum() && code.getAlarmnum() < objectList.size())) // && (null != code && null != code.getAlarmnum() && code.getAlarmnum() < objectList.size()))
// && (!"6".equals(recordtype) && !"2".equals(recordtype))) { // && (!"6".equals(recordtype) && !"2".equals(recordtype))) {
List<ObjectBoundingBox> list = new ArrayList<>(); List<ObjectBoundingBox> list = new ArrayList<>();
for (TraffpictureParam traffpictureParam : objectList) { for (TraffpictureParam traffpictureParam : objectList) {
//根据imageid 获得 base64图片 //根据imageid 获得 base64图片
JSONObject metadata = JSONObject.parseObject(String.valueOf(traffpictureParam.getMetadata())); JSONObject metadata = JSONObject.parseObject(String.valueOf(traffpictureParam.getMetadata()));
JSONObject ObjectBoundingBox = metadata.getJSONObject("ObjectBoundingBox"); JSONObject ObjectBoundingBox = metadata.getJSONObject("ObjectBoundingBox");
//获得物体特征值 //获得物体特征值
if (null == ObjectBoundingBox) { if (null == ObjectBoundingBox) {
list.add(new ObjectBoundingBox(metadata.getIntValue("LeftTopX") + roiarray[0].intValue(), list.add(new ObjectBoundingBox(metadata.getIntValue("LeftTopX") + roiarray[0].intValue(),
metadata.getIntValue("LeftTopY") + roiarray[1].intValue(), metadata.getIntValue("LeftTopY") + roiarray[1].intValue(),
metadata.getIntValue("RightBtmX") - metadata.getIntValue("LeftTopX"), metadata.getIntValue("RightBtmX") - metadata.getIntValue("LeftTopX"),
metadata.getIntValue("RightBtmY") - metadata.getIntValue("LeftTopY") metadata.getIntValue("RightBtmY") - metadata.getIntValue("LeftTopY")
)); ));
} else { } else {
list.add(new ObjectBoundingBox(ObjectBoundingBox.getIntValue("X") + roiarray[0].intValue(), list.add(new ObjectBoundingBox(ObjectBoundingBox.getIntValue("X") + roiarray[0].intValue(),
ObjectBoundingBox.getIntValue("Y") + roiarray[1].intValue(), ObjectBoundingBox.getIntValue("Y") + roiarray[1].intValue(),
ObjectBoundingBox.getIntValue("W"), ObjectBoundingBox.getIntValue("W"),
ObjectBoundingBox.getIntValue("H") ObjectBoundingBox.getIntValue("H")
)); ));
}
//根据对应的解析结果获得相应的数据,存放到对应的表中
getMetaData(recordtype, roiarray, base64Encoder, transferRecord, traffpictureParamresult, list, traffpictureParam, metadata);
} }
//根据对应的解析结果获得相应的数据,存放到对应的表中
getMetaData(recordtype, roiarray, base64Encoder, transferRecord, traffpictureParamresult, list, traffpictureParam, metadata);
}
//更新 traffpicture特征值 //更新 traffpicture特征值
try { try {
byte[] Img = FTPUtil.getFtpPicBytes(traffpictureParamresult.getImagedata()); byte[] Img = FTPUtil.getFtpPicBytes(traffpictureParamresult.getImagedata());
if (null != Img) { if (null != Img) {
ByteArrayInputStream bais = new ByteArrayInputStream(Img); ByteArrayInputStream bais = new ByteArrayInputStream(Img);
BufferedImage image = ImageIO.read(bais); BufferedImage image = ImageIO.read(bais);
Graphics g = image.getGraphics(); Graphics g = image.getGraphics();
g.setColor(Color.RED); g.setColor(Color.RED);
//遍历所有特征值,画到图片上 //遍历所有特征值,画到图片上
for (ObjectBoundingBox box : list) { for (ObjectBoundingBox box : list) {
if (null != box) { if (null != box) {
g.drawRect(box.getX(), box.getY(), box.getW(), box.getH()); g.drawRect(box.getX(), box.getY(), box.getW(), box.getH());
}
} }
}
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
ImageIO.write(image, "png", stream); ImageIO.write(image, "png", stream);
//上传ftp //上传ftp
Ftp ftp = ftpService.reloadFtp(); Ftp ftp = ftpService.reloadFtp();
String filename = DateUtils.formatCurrDateNoSign() + "imgdata.png"; String filename = DateUtils.formatCurrDateNoSign() + "imgdata.png";
String ftputl = FTPUtil.getFtpUrl(ftp) + basepath + "/" + traffpictureParamresult.getId() + "/" + filename; String ftputl = FTPUtil.getFtpUrl(ftp) + basepath + "/" + traffpictureParamresult.getId() + "/" + filename;
traffpictureParamresult.setImagedata(ftputl); traffpictureParamresult.setImagedata(ftputl);
//base 64 图片 //base 64 图片
String png_base64 = base64Encoder.encode(stream.toByteArray()).trim(); String png_base64 = base64Encoder.encode(stream.toByteArray()).trim();
FTPUtil.uploadFile(ftp, basepath + "/" + traffpictureParamresult.getId(), filename,png_base64 ); FTPUtil.uploadFile(ftp, basepath + "/" + traffpictureParamresult.getId(), filename,png_base64 );
}
} catch (Exception ex) {
logger.info("base64画框异常:" + ex.toString());
} }
traffPictureService.updateTraffpicture(traffpictureParamresult); } catch (Exception ex) {
//推送给第三方的base64 logger.info("base64画框异常:" + ex.toString());
sendtozhiui.setImagedata(publicpictureurl+"/fielagent?ftpPath="+traffpictureParamresult.getId());
//赋值推送第三方数据
sendtozhiui.setRecordlevel(code.getAlarmlevel());
sendtozhiui.setTargetnum(code.getMaxnum());
sendtozhiui.setRecordname(code.getName());
sendtozhiui.setTdmc(tdmc);
//推送给第三方
eventWriteService.sendEvent(traffpictureParamresult,sendtozhiui);
//推送告警到前端
webSocket.GroupSending(JSONObject.toJSONString(traffpictureParamresult));
} }
traffPictureService.updateTraffpicture(traffpictureParamresult);
//推送给第三方的base64
traffrecordData.setImagedata(publicpictureurl+"?location="+traffpictureParamresult.getImagedata().replace("ftp://"+ftppath+"/",""));
//赋值推送第三方数据
traffrecordData.setRecordlevel(code.getAlarmlevel());
traffrecordData.setTargetnum(code.getMaxnum());
traffrecordData.setRecordname(code.getName());
traffrecordData.setTdmc(tdmc);
//推送给第三方
eventWriteService.sendEvent(traffpictureParamresult,traffrecordData);
logger.info(" send to meili: {}",JSONObject.toJSON(traffrecordData));
//推送告警到前端
webSocket.GroupSending(JSONObject.toJSONString(traffpictureParamresult));
}
} catch (Exception ex) { } catch (Exception ex) {
//推送失败 //推送失败
transferRecord.setProcessstatus("-3"); transferRecord.setProcessstatus("-3");
traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord); traffAlarmRecordService.updateTraffAlarmRecordProcess(transferRecord);
}
} }
return ResultUtil.success();
} else {
logger.info("监控不属于该范围");
} }
//更新record 表Progress 字段,0为 未检测,-2 为检测失败,将检测 return false;
//结果进行额外封装入表
logger.error("rtsp 不存在-->");
return ResultUtil.fail();
} }
private void getMetaData(String recordtype, Long[] roiarray, BASE64Encoder base64Encoder, TraffAlarmRecord transferRecord, TraffpictureParam traffpictureParamresult, List<ObjectBoundingBox> list, TraffpictureParam traffpictureParam, JSONObject metadata) { private void getMetaData(String recordtype, Long[] roiarray, BASE64Encoder base64Encoder, TraffAlarmRecord transferRecord, TraffpictureParam traffpictureParamresult, List<ObjectBoundingBox> list, TraffpictureParam traffpictureParam, JSONObject metadata) {
...@@ -575,7 +493,7 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -575,7 +493,7 @@ public String getnewRtspVlue(String devicecode ){
traffpictureParamresult.setMetatype(String.valueOf(metadata.get("Type"))); traffpictureParamresult.setMetatype(String.valueOf(metadata.get("Type")));
//规定区域内出现告警对象 //规定区域内出现告警对象
if(null==traffpictureParamresult.getId()) { if(null==traffpictureParamresult.getId()) {
setTraffpictureParam(recordtype, base64Encoder, transferRecord, traffpictureParamresult); setTraffpictureParam(recordtype, transferRecord, traffpictureParamresult);
} }
if ("1".equals(metadata.get("Type"))) { if ("1".equals(metadata.get("Type"))) {
//规定范围内检测到人 //规定范围内检测到人
...@@ -691,7 +609,6 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -691,7 +609,6 @@ public String getnewRtspVlue(String devicecode ){
/*** /***
* 原来推送 * 原来推送
* @param recordtype * @param recordtype
* @param base64Encoder
* @param transferRecord * @param transferRecord
* @param traffpictureParam * @param traffpictureParam
*/ */
...@@ -985,7 +902,7 @@ public String getnewRtspVlue(String devicecode ){ ...@@ -985,7 +902,7 @@ public String getnewRtspVlue(String devicecode ){
// logger.error("rtsp 不存在-->"); // logger.error("rtsp 不存在-->");
// return ResultUtil.fail(); // return ResultUtil.fail();
// } // }
private void setTraffpictureParam(String recordtype, BASE64Encoder base64Encoder, TraffAlarmRecord transferRecord, TraffpictureParam traffpictureParam) { private void setTraffpictureParam(String recordtype, TraffAlarmRecord transferRecord, TraffpictureParam traffpictureParam) {
traffpictureParam.setAreaid(transferRecord.getAreaid()); traffpictureParam.setAreaid(transferRecord.getAreaid());
traffpictureParam.setFdid(transferRecord.getFdid()); traffpictureParam.setFdid(transferRecord.getFdid());
traffpictureParam.setRecordid(transferRecord.getRecordid()); traffpictureParam.setRecordid(transferRecord.getRecordid());
......
...@@ -35,7 +35,7 @@ public class IndexController { ...@@ -35,7 +35,7 @@ public class IndexController {
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Value("${ftppath}") @Value("${file.ftppath}")
private String ftppath; private String ftppath;
@Autowired @Autowired
......
...@@ -45,7 +45,7 @@ public class QuartzController { ...@@ -45,7 +45,7 @@ public class QuartzController {
private String rtspurl; private String rtspurl;
@Value("${ftppath}") @Value("${file.ftppath}")
private String ftppath; private String ftppath;
......
...@@ -9,6 +9,5 @@ public interface SbtdspsrService { ...@@ -9,6 +9,5 @@ public interface SbtdspsrService {
List<Sbtdspsr> selectByRtsp(String videoid); List<Sbtdspsr> selectByRtsp(String videoid);
List<Map> selectRecogByRtsp(String rtsp); List<Map> selectRecogByRtsp(String rtsp);
int updateRecogByRtsp(String rtsp,String devicecode); int updateRecogByRtsp(String rtsp,String devicecode);
List<Sbtdspsr> list(); List<Sbtdspsr> list();
} }
package com.cx.cn.cxquartz.service.quartz.impl; package com.cx.cn.cxquartz.service.quartz.impl;
import com.alibaba.fastjson.JSONObject;
import com.cx.cn.cxquartz.dao.SbtdspsrMapper; import com.cx.cn.cxquartz.dao.SbtdspsrMapper;
import com.cx.cn.cxquartz.service.quartz.SbtdspsrService; import com.cx.cn.cxquartz.service.quartz.SbtdspsrService;
import com.cx.cn.cxquartz.vo.Sbtdspsr; import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
......
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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class RestUtil {
private static final Logger logger = LoggerFactory.getLogger(RestUtil.class);
@Autowired
private RestTemplate restTemplate;
@Autowired
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 void getPicture(List<String> imgUrls, Map<String, Object> maps, HttpEntity<String> formEntity,String rtspurl) {
ResponseEntity<String> exchange = restTemplate.exchange(rtspurl + "?url={rtspvalue}&refresh={refresh}",
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"));
}
}
}
}
...@@ -11,12 +11,12 @@ mybatis: ...@@ -11,12 +11,12 @@ mybatis:
spring: spring:
datasource: datasource:
# url: jdbc:mysql://192.168.168.212:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true url: jdbc:mysql://192.168.168.110:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
#username: zn06
#password: znznzn8
url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: 123456
# url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
# username: root
# password: 123456
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
filters: stat filters: stat
...@@ -51,6 +51,4 @@ spring: ...@@ -51,6 +51,4 @@ spring:
logging: logging:
level: level:
com.cx.cn.cxquartz.dao: com.cx.cn.cxquartz.dao:
debug debug
\ No newline at end of file
...@@ -20,6 +20,6 @@ eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraa ...@@ -20,6 +20,6 @@ eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraa
countryside.appid=05744e80b2c211ebe32a8e271066b19e countryside.appid=05744e80b2c211ebe32a8e271066b19e
countryside.appsecret=a55a8870b2e911ebe32a8e271066b19e countryside.appsecret=a55a8870b2e911ebe32a8e271066b19e
countryside.tokenurl=http://countryside.51iwifi.com/gw/getAccessToken countryside.tokenurl=http://countryside.51iwifi.com/gw/getAccessToken
file.publicpictureurl=http://zjh189.ncpoi.cc:10001 file.publicpictureurl=http://zjh189.ncpoi.cc:10001/api/alg/files
ftppath=jiuling:9ling.cn@172.16.24.29:21 file.ftppath=jiuling:9ling.cn@172.16.24.29:21
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<select id="selectRecogByRtsp" parameterType="java.lang.String" resultType="java.util.HashMap"> <select id="selectRecogByRtsp" parameterType="java.lang.String" resultType="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
(select concat(sbbh,"_",tdbh) from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) videoid, (select sbbh from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) videoid,
(select tdmc from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) tdmc, (select tdmc from sbtdspsr where sbbh=b.videoid or squrllj=b.videoid limit 1) tdmc,
metatype, metatype,
recordtype, recordtype,
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
FROM FROM
quartz_task_informations b quartz_task_informations b
WHERE WHERE
(videoid=#{rtsp} or executeparamter=#{rtsp}) (videoid=#{rtsp} or executeparamter=#{rtsp})and recordtype is not null
</select> </select>
<update id="updateRecogByRtsp" parameterType="java.util.HashMap" > <update id="updateRecogByRtsp" parameterType="java.util.HashMap" >
......
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
</update> </update>
<select id="getTraffAlarmRecordByProgress" parameterType="java.util.HashMap" resultType="com.cx.cn.cxquartz.vo.TraffAlarmRecord"> <select id="getTraffAlarmRecordByProgress" parameterType="java.util.HashMap" resultType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
select * from traffalarmrecord where fdid=#{sbbh} and channelid=#{tdbh} and processstatus='-2' select * from traffalarmrecord where fdid=#{sbbh} and processstatus='-2'
</select> </select>
<update id="updateTraffAlarmRecordProcess" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord"> <update id="updateTraffAlarmRecordProcess" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
......
...@@ -72,7 +72,18 @@ ...@@ -72,7 +72,18 @@
</div> </div>
<div class="form-group"><label <div class="form-group"><label
class="col-sm-2 control-label text-right">监控id:</label> class="col-sm-2 control-label text-right">监控id:</label>
<select class="form-control" id="metatype">
<option th:value="3DHCA343714GMCE"
山河村
</option>
<option th:value="3DHCA34401BUXS9">
赵家上村
</option>
<option th:value="3YSCA44524PUH3B" >
3YSCA44524PUH3B
</option>
</select>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -81,8 +92,8 @@ ...@@ -81,8 +92,8 @@
id="videoid" class="form-control" style="width:65%;float: left"> id="videoid" class="form-control" style="width:65%;float: left">
<a id="getrtsp" href=" javascript:void(0)" <a id="getrtsp" href=" javascript:void(0)"
style="float: left;padding-left: 12px;padding-top: 10px;">获得监控图片</a> style="float: left;padding-left: 12px;padding-top: 10px;">获得监控图片</a>
<a id="getwidth" href=" javascript:void(0)" <!--<a id="getwidth" href=" javascript:void(0)"-->
style="float: left;padding-left: 12px;padding-top: 10px;">编辑监控范围</a> <!--style="float: left;padding-left: 12px;padding-top: 10px;">编辑监控范围</a>-->
</div> </div>
</div> </div>
...@@ -95,7 +106,6 @@ ...@@ -95,7 +106,6 @@
</option> </option>
<option th:value="2"> <option th:value="2">
行人、骑行、车辆检测识别 行人、骑行、车辆检测识别
</option> </option>
<option th:value="3" > <option th:value="3" >
人脸检测识别 人脸检测识别
......
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