Commit 9e042857 authored by wangjinjing's avatar wangjinjing

init

parent af2eace4
Pipeline #198 failed with stages
in 0 seconds
长兴县博物馆,每天8:30和15:00抽取监控截图,上传至服务器 自动推送到第三方
\ No newline at end of file \ No newline at end of file
...@@ -9,10 +9,9 @@ ...@@ -9,10 +9,9 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.quartz.cn</groupId> <groupId>com.quartz.cn</groupId>
<artifactId>VideoofCultural</artifactId> <artifactId>AlarmAutoSend</artifactId>
<version>1.0</version> <version>1.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<description>文物局视频截图推送</description>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
...@@ -27,12 +26,6 @@ ...@@ -27,12 +26,6 @@
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--mybatis--> <!--mybatis-->
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
...@@ -50,137 +43,39 @@ ...@@ -50,137 +43,39 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> <version>8.0.27</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId> <!--<dependency>-->
</dependency> <!--<groupId>ch.qos.logback</groupId>-->
<!--<artifactId>logback-classic</artifactId>-->
<dependency> <!--<version>1.2.3</version>-->
<groupId>org.springframework.boot</groupId> <!--<scope>compile</scope>-->
<artifactId>spring-boot-starter-tomcat</artifactId> <!--</dependency>-->
<scope>provided</scope> <!--<dependency>-->
</dependency> <!--<groupId>org.apache.logging.log4j</groupId>-->
<!--<artifactId>log4j-to-slf4j</artifactId>-->
<dependency> <!--<version>2.10.0</version>-->
<groupId>org.apache.commons</groupId> <!--<scope>compile</scope>-->
<artifactId>commons-lang3</artifactId> <!--</dependency>-->
<version>3.6</version> <!--<dependency>-->
</dependency> <!--<groupId>org.slf4j</groupId>-->
<!--<artifactId>jul-to-slf4j</artifactId>-->
<dependency> <!--<version>1.7.25</version>-->
<groupId>net.sf.json-lib</groupId> <!--<scope>compile</scope>-->
<artifactId>json-lib</artifactId> <!--</dependency>-->
<version>2.4</version>
<classifier>jdk15</classifier> <!--<dependency>-->
</dependency> <!--<groupId>com.alibaba</groupId>-->
<!--<artifactId>fastjson</artifactId>-->
<dependency> <!--<version>1.2.46</version>-->
<groupId>org.apache.poi</groupId> <!--</dependency>-->
<artifactId>poi</artifactId> <!--<dependency>-->
<version>3.15-beta2</version> <!--<groupId>org.apache.logging.log4j</groupId>-->
</dependency> <!--<artifactId>log4j-api</artifactId>-->
<!--<version>2.17.0</version>-->
<dependency> <!--</dependency>-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.9.6</version>
</dependency>
<!--quartz依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.3.8</version>
</dependency>
<!-- redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--kafka依赖-->
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<!-- HttpClient依赖 -->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.10.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.46</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -3,18 +3,21 @@ package com.cx.cn.cxquartz; ...@@ -3,18 +3,21 @@ package com.cx.cn.cxquartz;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication @SpringBootApplication
public class CXQuartzApplication extends SpringBootServletInitializer { public class AlarmAutoSendApplication extends SpringBootServletInitializer {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(CXQuartzApplication.class, args); SpringApplication.run(AlarmAutoSendApplication.class, args);
} }
@Bean
@Override public RestTemplate restTemplate(RestTemplateBuilder builder) {
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // Do any additional configuration here
return builder.sources(CXQuartzApplication.class); return builder.build();
} }
} }
package com.cx.cn.cxquartz.bean;
public class PatrolCtrlAlarm {
private String cameraCode;
private String cameraName;
private String time;
private String type;
private String file;
public String getCameraCode() {
return cameraCode;
}
public void setCameraCode(String cameraCode) {
this.cameraCode = cameraCode;
}
public String getCameraName() {
return cameraName;
}
public void setCameraName(String cameraName) {
this.cameraName = cameraName;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
}
package com.cx.cn.cxquartz.bean;
public class PatrolCtrlRecord {
private String cameraCode;
private String cameraName;
private String patrolTime;
private String recordSrc;
private String file;
private String deviceid;
public String getDeviceid() {
return deviceid;
}
public void setDeviceid(String deviceid) {
this.deviceid = deviceid;
}
public String getCameraCode() {
return cameraCode;
}
public void setCameraCode(String cameraCode) {
this.cameraCode = cameraCode;
}
public String getCameraName() {
return cameraName;
}
public void setCameraName(String cameraName) {
this.cameraName = cameraName;
}
public String getPatrolTime() {
return patrolTime;
}
public void setPatrolTime(String patrolTime) {
this.patrolTime = patrolTime;
}
public String getRecordSrc() {
return recordSrc;
}
public void setRecordSrc(String recordSrc) {
this.recordSrc = recordSrc;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
}
package com.cx.cn.cxquartz.bean;
public class PictureTime {
String deviceid;
String lasttime;
public String getDeviceid() {
return deviceid;
}
public void setDeviceid(String deviceid) {
this.deviceid = deviceid;
}
public String getLasttime() {
return lasttime;
}
public void setLasttime(String lasttime) {
this.lasttime = lasttime;
}
}
package com.cx.cn.cxquartz.bean;
public class QuartzTaskErrors {
private Long id;
private String taskexecuterecordid;
private String errorkey;
private Long createtime;
private Long lastmodifytime;
private String errorvalue;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTaskexecuterecordid() {
return taskexecuterecordid;
}
public void setTaskexecuterecordid(String taskexecuterecordid) {
this.taskexecuterecordid = taskexecuterecordid == null ? null : taskexecuterecordid.trim();
}
public String getErrorkey() {
return errorkey;
}
public void setErrorkey(String errorkey) {
this.errorkey = errorkey == null ? null : errorkey.trim();
}
public Long getCreatetime() {
return createtime;
}
public void setCreatetime(Long createtime) {
this.createtime = createtime;
}
public Long getLastmodifytime() {
return lastmodifytime;
}
public void setLastmodifytime(Long lastmodifytime) {
this.lastmodifytime = lastmodifytime;
}
public String getErrorvalue() {
return errorvalue;
}
public void setErrorvalue(String errorvalue) {
this.errorvalue = errorvalue == null ? null : errorvalue.trim();
}
}
package com.cx.cn.cxquartz.bean;
public class QuartzTaskInformations {
private Long id;
private Integer version;
private String taskno;
private String taskname;
private String schedulerrule;
private String frozenstatus;
private String executorno;
private Long frozentime;
private Long unfrozentime;
private Long createtime;
private Long lastmodifytime;
private String sendtype;
private String url;
private String executeparamter;
private String timekey;
private Long objectx;
private Long objecty;
private Long objectw;
private Long objecth;
private String recordtype;
private String metatype;
private String imgsrc;
private String rtsp;
private String videoid;
public String getVideoid() {
return videoid;
}
public void setVideoid(String videoid) {
this.videoid = videoid;
}
public String getImgsrc() {
return imgsrc;
}
public void setImgsrc(String imgsrc) {
this.imgsrc = imgsrc;
}
public String getRtsp() {
return rtsp;
}
public void setRtsp(String rtsp) {
this.rtsp = rtsp;
}
public String getMetatype() {
return metatype;
}
public void setMetatype(String metatype) {
this.metatype = metatype;
}
public Long getObjectx() {
return objectx;
}
public void setObjectx(Long objectx) {
this.objectx = objectx;
}
public Long getObjecty() {
return objecty;
}
public void setObjecty(Long objecty) {
this.objecty = objecty;
}
public Long getObjectw() {
return objectw;
}
public void setObjectw(Long objectw) {
this.objectw = objectw;
}
public Long getObjecth() {
return objecth;
}
public void setObjecth(Long objecth) {
this.objecth = objecth;
}
public String getRecordtype() {
return recordtype;
}
public void setRecordtype(String recordtype) {
this.recordtype = recordtype;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getTaskno() {
return taskno;
}
public void setTaskno(String taskno) {
this.taskno = taskno == null ? null : taskno.trim();
}
public String getTaskname() {
return taskname;
}
public void setTaskname(String taskname) {
this.taskname = taskname == null ? null : taskname.trim();
}
public String getSchedulerrule() {
return schedulerrule;
}
public void setSchedulerrule(String schedulerrule) {
this.schedulerrule = schedulerrule == null ? null : schedulerrule.trim();
}
public String getFrozenstatus() {
return frozenstatus;
}
public void setFrozenstatus(String frozenstatus) {
this.frozenstatus = frozenstatus == null ? null : frozenstatus.trim();
}
public String getExecutorno() {
return executorno;
}
public void setExecutorno(String executorno) {
this.executorno = executorno == null ? null : executorno.trim();
}
public Long getFrozentime() {
return frozentime;
}
public void setFrozentime(Long frozentime) {
this.frozentime = frozentime;
}
public Long getUnfrozentime() {
return unfrozentime;
}
public void setUnfrozentime(Long unfrozentime) {
this.unfrozentime = unfrozentime;
}
public Long getCreatetime() {
return createtime;
}
public void setCreatetime(Long createtime) {
this.createtime = createtime;
}
public Long getLastmodifytime() {
return lastmodifytime;
}
public void setLastmodifytime(Long lastmodifytime) {
this.lastmodifytime = lastmodifytime;
}
public String getSendtype() {
return sendtype;
}
public void setSendtype(String sendtype) {
this.sendtype = sendtype == null ? null : sendtype.trim();
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public String getExecuteparamter() {
return executeparamter;
}
public void setExecuteparamter(String executeparamter) {
this.executeparamter = executeparamter == null ? null : executeparamter.trim();
}
public String getTimekey() {
return timekey;
}
public void setTimekey(String timekey) {
this.timekey = timekey == null ? null : timekey.trim();
}
}
package com.cx.cn.cxquartz.bean;
public class QuartzTaskRecords {
private Long id;
private String taskno;
private String timekeyvalue;
private Long executetime;
private String taskstatus;
private Integer failcount;
private String failreason;
private Long createtime;
private Long lastmodifytime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTaskno() {
return taskno;
}
public void setTaskno(String taskno) {
this.taskno = taskno == null ? null : taskno.trim();
}
public String getTimekeyvalue() {
return timekeyvalue;
}
public void setTimekeyvalue(String timekeyvalue) {
this.timekeyvalue = timekeyvalue == null ? null : timekeyvalue.trim();
}
public Long getExecutetime() {
return executetime;
}
public void setExecutetime(Long executetime) {
this.executetime = executetime;
}
public String getTaskstatus() {
return taskstatus;
}
public void setTaskstatus(String taskstatus) {
this.taskstatus = taskstatus == null ? null : taskstatus.trim();
}
public Integer getFailcount() {
return failcount;
}
public void setFailcount(Integer failcount) {
this.failcount = failcount;
}
public String getFailreason() {
return failreason;
}
public void setFailreason(String failreason) {
this.failreason = failreason == null ? null : failreason.trim();
}
public Long getCreatetime() {
return createtime;
}
public void setCreatetime(Long createtime) {
this.createtime = createtime;
}
public Long getLastmodifytime() {
return lastmodifytime;
}
public void setLastmodifytime(Long lastmodifytime) {
this.lastmodifytime = lastmodifytime;
}
}
package com.cx.cn.cxquartz.bean;
public class User {
String id;
String loginName;
String loginCode;
String area1;
String areaName;
String organCode;
String organName;
String types;
String tatus;
String addTime;
String token;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getLoginCode() {
return loginCode;
}
public void setLoginCode(String loginCode) {
this.loginCode = loginCode;
}
public String getArea1() {
return area1;
}
public void setArea1(String area1) {
this.area1 = area1;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getOrganCode() {
return organCode;
}
public void setOrganCode(String organCode) {
this.organCode = organCode;
}
public String getOrganName() {
return organName;
}
public void setOrganName(String organName) {
this.organName = organName;
}
public String getTypes() {
return types;
}
public void setTypes(String types) {
this.types = types;
}
public String getTatus() {
return tatus;
}
public void setTatus(String tatus) {
this.tatus = tatus;
}
public String getAddTime() {
return addTime;
}
public void setAddTime(String addTime) {
this.addTime = addTime;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}
package com.cx.cn.cxquartz.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
// @Configuration
@EnableCaching //开启注解
public class RedisConfig extends CachingConfigurerSupport {
/**
* retemplate相关配置
*
* @param factory
* @return
*/
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 配置连接工厂
template.setConnectionFactory(factory);
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jacksonSeial.setObjectMapper(om);
// 值采用json序列化
template.setValueSerializer(jacksonSeial);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
// 设置hash key 和value序列化模式
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(jacksonSeial);
template.afterPropertiesSet();
return template;
}
/**
* 对hash类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForHash();
}
/**
* 对redis字符串类型数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForValue();
}
@Bean
public JedisConnectionFactory redisConnectionFactory() {
JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
jedisConnectionFactory.setHostName("<server-hostname-here>");
jedisConnectionFactory.setPort(6379);
jedisConnectionFactory.setPassword("<server-password-here>");
jedisConnectionFactory.afterPropertiesSet();
return jedisConnectionFactory;
}
/**
* 对链表类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForList();
}
/**
* 对无序集合类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForSet();
}
/**
* 对有序集合类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForZSet();
}
}
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.service.quartz.TaskService;
import com.cx.cn.cxquartz.util.RestUtil; import com.cx.cn.cxquartz.vo.TraffrecordData;
import com.cx.cn.cxquartz.vo.Sbtdspsr; import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
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 org.springframework.web.client.RestTemplate;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Map;
@Configuration @Configuration
@EnableScheduling @EnableScheduling
public class ScheduleTaskConfig { public class ScheduleTaskConfig {
private static final Logger logger = LoggerFactory.getLogger(ScheduleTaskConfig.class);
@Autowired @Autowired
private SbtdspsrService sbtdspsrService; private TaskService taskService;
@Value("${file.getrtspbyurl}")
private String getrtspbyurl; @Autowired
RestUtil restUtil=new RestUtil(); private RestTemplate restTemplate;
/***
* 每隔20分钟执行一遍判断rtsp 是否变换 @Scheduled(cron = "*/5 * * * * ?")//每隔5s统计1个小时前到目前为止的数据推送
*/ private void sendAlarm() {
// @Scheduled(cron = "0 0 2 * * ? ") try {
private void statis() { //查询待推送告警信息
//查询所有监控设备,更新rtsp 地址 List<TraffrecordData> list=taskService.list();
List<Sbtdspsr> sbtdpsrList= sbtdspsrService.list(); if(list.size()>0){
//调用decice 端口获得新的rtsp 地址,如果与表里的一样无需更新,不一样则立即更新 Map map=restTemplate.getForObject("http://countryside.51iwifi.com/gw/getAccessToken?appid=05744e80b2c211ebe32a8e271066b19e&appsecret=a55a8870b2e911ebe32a8e271066b19e",Map.class);
for(Sbtdspsr sbtd:sbtdpsrList) if(null!=map.get("code") && map.get("code").toString().equals("0")) {
{ Map mapobj = (Map) map.get("obj");
restUtil.rtspChangeVlue(sbtd.getSbbh(),sbtd.getSqurllj(),getrtspbyurl); String accessToken = mapobj.get("accessToken").toString();
} HttpHeaders headers = new HttpHeaders();
} headers.add("accessToken", accessToken);
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
for (TraffrecordData traff : list) {
if(traff.getFdid().contains("3YSCA450426N3XP")){
traff.setTdmc("红菱村河道监控测试点");
traff.setXzmc("红菱村");
traff.setRecordname("河道监控");
}
if(traff.getRecordtype().equals("20")){
traff.setRecordtype("1");
}
traff.setImagedata("http://zjh189.ncpoi.cc:7180" + traff.getImagedata());
logger.info(" result:{}", new ObjectMapper().writeValueAsString(traff));
HttpEntity<TraffrecordData> requestEntity = new HttpEntity<>(traff, headers);
// @Scheduled(cron = "0 30/5 6-19 * * ?")//每隔5分钟统计当天目前为止的数据 Map result = restTemplate.postForObject("http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraalarm", requestEntity, Map.class);
// private void statistoday() { logger.info(" result:{}", new ObjectMapper().writeValueAsString(result));
// //判断是否为空表 if (null != result.get("code") && result.get("code").toString().equals("0")) {
// //执行查询存在更新,不存在新增 taskService.update(traff.getAlarmnum());
// log.info("每隔5分钟"); logger.info(" send to countryside success");
// Integer result= traffFlowService.insertOrUpdatevehicleTodaystatistic();
// log.info("today"+result); } else {
// logger.error(" send to countryside error");
// } }
}
}
}
} catch (Exception ex){
logger.error(" send to countryside error:{}",ex);
}
}
} }
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.*;
import com.cx.cn.cxquartz.service.quartz.impl.EventWriteService;
import com.cx.cn.cxquartz.util.*;
import com.cx.cn.cxquartz.vo.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
import java.util.List;
@RestController
@RequestMapping("/ext")
@PropertySource("classpath:file.properties")
public class ExtController {
private static final Logger logger = LoggerFactory.getLogger(ExtController.class);
@Autowired
private QuartzService quartzService;
@Value("${file.rtspurl}")
private String rtspurl;
@Value("${file.recogurl}")
private String recogurl;
@Value("${file.getrtspbyurl}")
private String getrtspbyurl;
@Value("${file.publicpictureurl}")
private String publicpictureurl;
@Value("${voice.appKey}")
private String appKey;
@Value("${voice.corpId}")
private String corpId;
@Value("${voice.eventId}")
private Integer eventId;
@Value("${file.rootpath}")
private String filerootpath;
@Value("${file.outpath}")
private String outpath;
@Value("${voice.unionId}")
private String unionId;
@Value("${countryside.callbackurl}")
private String callbackurl;
@Autowired
private RestTemplate restTemplate;
@Autowired
private SbtdspsrService sbtdspsrService;
@Autowired
FtpService ftpService;
@Autowired
TraffAlarmRecordService traffAlarmRecordService;
@Autowired
TraffPictureService traffPictureService;
@Autowired
PedestrianService pedestrianService;
@Autowired
TrafficService trafficService;
@Autowired
FaceService faceService;
@Value("${file.ftppath}")
private String ftppath;
@Autowired
PeopleridebicycService peopleridebicycService;
@Autowired
WebSocket webSocket;
@Autowired
CodeService codeservice;
@Autowired
EventWriteService eventWriteService;
RestUtil restutil = new RestUtil();
@Resource
public void setRestTemplate(RestTemplate restTemplate) {
restutil.restTemplate = restTemplate;
}
@Resource
public void setSbtdspsrService(SbtdspsrService sbtdspsrService) {
restutil.sbtdspsrService = sbtdspsrService;
}
@RequestMapping(value = "/getRTSP/{photonum}", method = RequestMethod.POST)
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<String> imgUrls = new ArrayList<>();
TraffAlarmRecord traffAlarmRecord = new TraffAlarmRecord();
try {
//尝试抽取图片
logger.info("rtspurl" + rtspurl);
String timestamp = restutil.getPicture(imgUrls, sbtdspsr.getSbbh(), rtspurl, traffAlarmRecord);
logger.info("timestamp" + timestamp);
if (timestamp.contains(".")) {
traffAlarmRecord.setCreatetime(timestamp.split("\\.")[0]);
} else {
traffAlarmRecord.setCreatetime(timestamp);
}
} catch (Exception ex) {
logger.info("getRTSP/1 error:{}", ex.toString());
traffAlarmRecord.setCreatetime(DateUtils.formatCurrDate());
}
try {
if (imgUrls.size() == 0) {
restutil.getPicture(imgUrls, sbtdspsr.getSbbh(), rtspurl, traffAlarmRecord);
}
traffAlarmRecord.setFdid(sbtdspsr.getSbbh());
traffAlarmRecord.setChannelid(Integer.parseInt(String.valueOf(sbtdspsr.getTdbh())));
traffAlarmRecord.setAreaid(Long.parseLong(sbtdspsr.getXzbh()));
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());
}
return ResultUtil.success();
}
@RequestMapping(value = "/getDeviceSnapshotAndRecognize", method = RequestMethod.POST)
public String getDeviceSnapshotAndRecognize(@RequestBody String taskno) {
//根据判断监控是否存在,该监控检测的事件是什么
List<QuartzTaskInformations> mapList = sbtdspsrService.selectRecogByRtsp(taskno);
String model = "3";
//图片框选出来的范围
Long[] roiarray;
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];
//获得该监控的检测业务与检测范围
String devicecode="";
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) {
String roistr= roiarray[0]+","+roiarray[1]+","+roiarray[2]+","+roiarray[3];
mapparam.put("deviceCode", devicecode);
mapparam.put("model", model);
mapparam.put("roi",roistr);
// logger.info("recogurl="+recogurl);
String getresult= HttpClientUtil.doGet(recogurl + "?deviceCode="+taskinfo.getExecuteparamter()+"&model="+model+"&roi="+ URLEncoder.encode("[")+roistr+URLEncoder.encode("]"));
Map objectList=null;
try {
if(null==getresult){
logger.info("get result is null");
continue;
}
objectList = new ObjectMapper().readValue(getresult, Map.class);
}catch (Exception ex){
logger.error(ex.toString());
}
// Map objectList = restTemplate.getForObject(recogurl + "?deviceCode={deviceCode}&model={model}&roi={roi}", Map.class, mapparam);
if(null==objectList){
logger.info("objectList is null");
continue;
}
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;
}
//获得点位
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,
objectList.get("timestamp").toString(),
traffpictureParamresult);
//图片划线并上传
logger.info("图片划线并上传");
String basepath = DateUtils.formatCurrDayYM()+
File.separator+DateUtils.formatCurrDayDD()+ File.separator+
devicecode ;
String filename = devicecode+"_"+ DateUtils.formatCurrDateNoSign()+ "_"+recordtype+ "_result.jpg";
eventWriteService.uploadPicture(roiarray,imageurl, points, basepath, filename);
String filenameurl=File.separator+outpath+File.separator+basepath+File.separator+filename;
jobTjParam.setImageUrl(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")));
// if ("1".equals(metadata.get("Type"))) {
// //规定范围内检测到人
// Pedestrian meta = new ObjectMapper().convertValue(metadata, Pedestrian.class);
// meta.setId(traffpictureParamresult.getId());
// pedestrianService.insertpedestrian(meta);
// if (null != meta.getFaceBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
// meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
// meta.getFaceBoundingBox().getW(),
// meta.getFaceBoundingBox().getH()
// ));
// }
// if (null != meta.getObjectBoundingBox()) {
//
// list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
// meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
// meta.getObjectBoundingBox().getW(),
// meta.getObjectBoundingBox().getH()
// ));
// }
//
// if (null != meta.getHeadBoundingBox()) {
//
// list.add(new ObjectBoundingBox(meta.getHeadBoundingBox().getX() + roiarray[0].intValue(),
// meta.getHeadBoundingBox().getY() + roiarray[1].intValue(),
// meta.getHeadBoundingBox().getW(),
// meta.getHeadBoundingBox().getH()
// ));
// }
//
// if (null != meta.getUpperBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getUpperBoundingBox().getX() + roiarray[0].intValue(),
// meta.getUpperBoundingBox().getY() + roiarray[1].intValue(),
// meta.getUpperBoundingBox().getW(),
// meta.getUpperBoundingBox().getH()
// ));
// }
// if (null != meta.getLowerBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getLowerBoundingBox().getX() + roiarray[0].intValue(),
// meta.getLowerBoundingBox().getY() + roiarray[1].intValue(),
// meta.getLowerBoundingBox().getW(),
// meta.getLowerBoundingBox().getH()
// ));
// }
//
// } else if (null != metadata && "2".equals(metadata.get("Type"))) {
// //车辆
// Traffic meta = new ObjectMapper().convertValue(metadata, Traffic.class);
// meta.setId(traffpictureParamresult.getId());
// //新增到车辆详情表
// trafficService.insertTraffic(meta);
// if (null != meta.getObjectBoundingBox()) {
//
// list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
// meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
// meta.getObjectBoundingBox().getW(),
// meta.getObjectBoundingBox().getH()
// ));
// }
// } else if (null != metadata && "3".equals(metadata.get("Type"))) {
// Face meta = new ObjectMapper().convertValue(metadata, Face.class);
// meta.setId(traffpictureParamresult.getId());
// faceService.insertFace(meta);
// if (null != meta.getFaceBoundingBox()) {
// traffpictureParam.setObjx(meta.getFaceBoundingBox().getX() + roiarray[0].intValue());
// traffpictureParam.setObjy(meta.getFaceBoundingBox().getY() + roiarray[1].intValue());
// traffpictureParam.setObjw(meta.getFaceBoundingBox().getW());
// traffpictureParam.setObjh(meta.getFaceBoundingBox().getH());
// }
//
// if (null != meta.getFaceBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
// meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
// meta.getFaceBoundingBox().getW(),
// meta.getFaceBoundingBox().getH()
// ));
// }
// if (null != meta.getHeadBoundingBox()) {
//
// list.add(new ObjectBoundingBox(meta.getHeadBoundingBox().getX() + roiarray[0].intValue(),
// meta.getHeadBoundingBox().getY() + roiarray[1].intValue(),
// meta.getHeadBoundingBox().getW(),
// meta.getHeadBoundingBox().getH()
// ));
// }
// //人骑车
// } else if (null != metadata && "4".equals(metadata.get("Type"))) {
// PeopleRideBicyc meta = new ObjectMapper().convertValue(metadata, PeopleRideBicyc.class);
// meta.setId(traffpictureParamresult.getId());
// peopleridebicycService.insertPeopleRideBicyc(meta);
// if (null != meta.getFaceBoundingBox()) {
// list.add(new ObjectBoundingBox(meta.getFaceBoundingBox().getX() + roiarray[0].intValue(),
// meta.getFaceBoundingBox().getY() + roiarray[1].intValue(),
// meta.getFaceBoundingBox().getW(),
// meta.getFaceBoundingBox().getH()
// ));
// }
// if (null != meta.getObjectBoundingBox()) {
//
// list.add(new ObjectBoundingBox(meta.getObjectBoundingBox().getX() + roiarray[0].intValue(),
// meta.getObjectBoundingBox().getY() + roiarray[1].intValue(),
// meta.getObjectBoundingBox().getW(),
// meta.getObjectBoundingBox().getH()
// ));
// }
// }
//
// }
// }
}
package com.cx.cn.cxquartz.controller;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.service.quartz.QuartzService;
import com.cx.cn.cxquartz.service.quartz.TraffPictureService;
import com.cx.cn.cxquartz.util.Page;
import com.cx.cn.cxquartz.vo.GoalStructureParam;
import com.cx.cn.cxquartz.vo.JobParam;
import com.cx.cn.cxquartz.vo.TaskResultObj;
import org.apache.commons.lang3.StringUtils;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import sun.net.www.protocol.ftp.FtpURLConnection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import java.util.Map;
@Controller
public class IndexController {
private static final Logger logger = LoggerFactory.getLogger(IndexController.class);
@Autowired
private QuartzService quartzService;
@Autowired
private RestTemplate restTemplate;
@Value("${file.ftppath}")
private String ftppath;
@Autowired
TraffPictureService traffPictureService;
//
// @RequestMapping(value = "/", method = RequestMethod.GET)
// public String listTasks(Model model, @RequestParam(value = "currentPage", required = false, defaultValue = "1") String currentPage,
// @RequestParam(value = "taskNo", required = false) String taskNo, HttpServletRequest request) {
// try {
//
// List<QuartzTaskInformations> taskList = quartzService.getTaskList(taskNo, currentPage);
// for(QuartzTaskInformations task:taskList)
// {
// task.setSchedulerrule(task.getSchedulerrule().replaceAll("\\?","").replaceAll("\\*","").replaceAll("\\/",""));
//
// }
// int current = Integer.parseInt(currentPage);
// Page<QuartzTaskInformations> page = new Page(taskList, taskList.size(), current);
// model.addAttribute("taskList", taskList);
// model.addAttribute("size", taskList.size());
// model.addAttribute("currentPage", page.getCurrentPage());
// model.addAttribute("totalPage", page.getTotalPage());
// model.addAttribute("taskNo", taskNo);
// } catch (Exception e) {
// logger.error("首页跳转发生异常exceptions-->" + e.toString());
// }
// return "index";
// }
//
// @GetMapping("/getrealcamerasnapshot")
// @ResponseBody
// public String index(@RequestParam("url") String url,
// @RequestParam("refresh") String refresh) {
// return "{\"ret\": 0," +
// "\"desc\": \"succ!\"," +
// "\"url\": \"http://localhost:8089/snapshot/11111.jpg\"" +
// "}";
// }
//
//
// @PostMapping("/images/recog")
// @ResponseBody
// public String images(@RequestBody GoalStructureParam param) {
// return "{\"ret\":\"200\",\"error_msg\":\"OK\",\"ObjectList\":[{\"ImageID\":\"1\",\"ObjectID\":1,\"Metadata\":{\"Gender\":\"1\",\"Age\":\"32\",\"Angle\":\"128\",\"HeadBoundingBox\":{\"x\":96,\"y\":16,\"w\":107,\"h\":136},\"FaceBoundingBox\":{\"x\":115,\"y\":61,\"w\":57,\"h\":77},\"UpperBoundingBox\":{\"x\":34,\"y\":123,\"w\":232,\"h\":263},\"LowerBoundingBox\":{\"x\":74,\"y\":309,\"w\":176,\"h\":408},\"CoatLength\":\"2\",\"CoatTexture\":\"1\",\"CoatColor\":[\"2\"],\"CoatColorNums\":\"1\",\"TrousersLength\":\"1\",\"TrousersTexture\":\"1\",\"TrousersColor\":[\"5\"],\"TrousersColorNums\":\"1\",\"HairStyle\":\"2\",\"HasHat\":\"1\",\"HasGlasses\":\"0\",\"HasMask\":\"0\",\"HasBackpack\":\"0\",\"HasCarrybag\":\"0\",\"HasUmbrella\":\"0\",\"HasTrolley\":\"-1\",\"HasLuggage\":\"-1\",\"LuggageColor\":[],\"LuggageColorNums\":\"0\",\"HasKnife\":\"-1\",\"ObjectBoundingBox\":{\"x\":26,\"y\":13,\"w\":256,\"h\":708},\"TrafficViolation\":\"-1\",\"Type\":\"6\"},\"Feature\":\"UVNURgUA//0BCP4BAQcAAwQBBvsCB/v8Af4A+wD5+AcBAgL9AgIEAgH4AQQA+f77+P77AAAIA/8A+QQJ/fz8AgACBfsAAgAC/AcIAQD++fgCAAUB/gb//AEAAf4B/QP+AQD0/QMDAfkD+f//A/7+/AD6B/f7/AH7/gAFAAMBAPb/AAP//wAIBQD7Af0FAAD9AAgC/gYF/f/8DAAC//4BAP/6AgECAgADAPz++v0A/wD//fz5AAIB/f0IBAQA/v8CBwP//wYE+/sCCP0BBAMD/gQA/QH/AgL6AgX/BP7/+AD5A/75/QH+A/8H/QAACP//AQT7+QICAfv/Afj9A/0D/wAA/f/8/wYL/wACAQYAAAAD/ggAAQMABv/6BAIADPv+A/wEAQAA/AD5AwT///4BAPz8CgUCDf78AwEA/f4AA/8C/wQB/P8A/wEA/gsAAwEF/v0AAf7/+QQECAcGAP0AAgH//AAHBwD3/fwB+/7/AQj//wUFAP/+/gYBAgYD+fv/BwH8Af0EBAD+AP3++gIH+v8CAPQEAAT//gDzAP0A+AL6BP4I9wMJAP0CAPX6APz9/gALAP7/BgQD+wIDBPn+CwIH/fz7A/3+9wAJ/QD9AP/++wME/v/+Avv+APoFAAAB+gD5APn//gEGBAME/wX5/AD/CAL+9QD8BAD2/wMCCf38+/oB+f0C/f39AQL+AAEAAgAE/wEIA///AP8HAQT+8fn7AP4AAAMA+QQDAwIB//j+/QEAAAIAAgj/A/n8AAP9AQD8AQYF+PgAA/4B+gEE+QYA/wYAB/0BAQD+/P/+BQf5BwIAAPsBBAEGAP4JAwEE////AAEF/wL4AAAFAQYA/vz+/AACAv8CAwIA+wIAAAUJAP0C/wIHAAEABgQF/QAEAAL7BP0A//wC+vr+/AIGAwAEAP0A/P/8BAD//AD5+wQEAAEHAv/8AP77+vQEBP4BAAAAAAr7/wD5AgD7BAEA/gT7AAAEAAMABPkLAQYABff+/wEDAP8EA/4AAf8A/gX9+wACAv3//f7/BAH+Bf/+AAH/AAAE9wAHAP/+/P8DAQD7/QQB/P3/AwAAAQAB/wD+BwAB/vwAAAL/AAYAAAf/Af76+fj6AP4F/gD9AgIB/Qr59f8CAAMCBgQHAf0FAP34AAQH/P79/wQGBA4D+f4AA/v+AAAA+wIE/gIH+QP2AQQGAwAE/vwI/P4GBwD/AAX4AAP+/f0A/Af/AgEBA/v9BPgDBwAC/wD8Bv36A/gBAAH+AAX+BP/9AAIF+AD8Av4B/wT/AQAAAQL/BPwA/PsA/AMDBfb/+AEBCAL+//36APz//wEHBv3/BQAA/QP9+wABAQL6//4CAAH/CP/+AAMBAf0CAAD9+g==\",\"BucketID\":32,\"BucketIDList\":[32,87,20,68,45,78,10,6,52,65,1,94,79,16,61,38,55,89,43,51,60,27,54,25,17,83,9,40,14,22,50,44,18,66,82,4,48,31,69,77,90,63,92,73,70,84,67,23,12,3,74,47,21,41,28,96,36,97,5,85,39,95,64,26,80,53,91,37,34,57,46,15,2,93,11,98,75,81,56,0,24,62,86,13,19,71,72,7,58,29,59,49,88,76,35,99,33,30,42,8],\"FaceFeature\":\"AwQF+foK/vcCAAD4/wD7CQH39vP7/gz/CAAB/AX++AAI/v8D+gQAAP0G/wAA+/oAAAP+Af79CwEAAgAA+/oFBe/3AgIFAgP0/vr8Cf4C+AMHBPn5Afr5AQQGBQD58gMG+wQTAgTzAPr9BQYEA/j//gT8+wXx9wMC+gcH/wAC8v0A+gD7+wkE/gAA7wL78gX/AgIGBvr8AAgD/woEAvkEAwv5CP/8/fz+/fwMAvr7AgD4APcEAA0F//kAAAAG+gADAQEB/wD+AQgCBg35+QQC/vv//vcAAPgEAwAAAgD9Af32/wMLAwD8B/75AQIB+/z/+v4AA/n//gL8+/0BAPv//PgIAAD0CQALAAUF/fwA/wYBAQf9+/f++Af49gMB/AMABwAA9vr5//sE/PoD+QP6+wsA/wEB+QIC+/8B/wD88QkACAIAAPn5AAUD/QL++P4H/f3+A/gG/f8G/QkA8wD0BAMBBwD59AAB+QUA//v2/wEJAQD8DAL5CPoA+/b+/Qr5AwcA/AD+CAEDBgEH/Qb+AQUHAAQK/fUA+/sI9/0I+QcKBQP6/gX0+QgI9gIBAAMFAAAA/vcD/vYI9wj9+v76C/gAAgIH+gMHBP8IAAT6BgAI+vsJ/v7/DAUABgIA+gAHBf0D+/oDAwEABv359QAB+AEG8w7+//0ABf78CPr8Afs=\",\"FaceBucketID\":91,\"FaceBucketIDList\":[91,12,50,84,52,13,57,54,4,53,70,36,64,58,81,10,78,63,35,75,34,16,86,3,99,40,26,42,48,30,25,23,11,62,72,51,18,17,46,27,97,61,49,43,66,37,89,19,24,1,98,76,32,83,44,96,87,31,8,20,33,21,6,56,41,88,82,47,69,93,14,79,38,29,80,85,90,94,55,60,67,95,9,2,71,65,68,77,7,74,59,28,92,73,15,39,22,0,45,5],\"FaceQuality\":\"0.379721\",\"FaceYaw\":\"-0.135311\",\"FacePitch\":\"0.508456\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.555109\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1},{\"ImageID\":\"3\",\"ObjectID\":1,\"Metadata\":{\"Angle\":\"128\",\"VehicleClass\":\"1\",\"VehicleColor\":[\"9\"],\"VehicleColorNums\":\"1\",\"VehicleBrand\":\"\\u96ea\\u4f5b\\u5170-\\u79d1\\u9c81\\u5179-2009_2013\",\"VehicleMainBrandName\":\"\\u96ea\\u4f5b\\u5170\",\"VehicleSubBrandName\":\"\\u79d1\\u9c81\\u5179\",\"VehicleYearName\":\"2009_2013\",\"HasPlate\":\"1\",\"PlateClass\":\"1\",\"PlateColor\":\"2\",\"PlateNo\":\"\\u6d59AJ079B\",\"PlateNeatness\":\"2\",\"Sunvisor\":\"0\",\"Paper\":\"0\",\"Decoration\":\"0\",\"Drop\":\"1\",\"Tag\":\"1\",\"SafetyBelt\":{\"MainDriver\":\"-1\",\"CoDriver\":\"-1\"},\"HasCall\":\"-1\",\"HasSkylight\":\"0\",\"HasBaggage\":\"0\",\"HasAerial\":\"0\",\"HasCrash\":\"-1\",\"HasDanger\":\"0\",\"HighwayTollVehicles\":\"1\",\"ObjectBoundingBox\":{\"x\":41,\"y\":40,\"w\":894,\"h\":717},\"TrafficViolation\":\"-1\",\"Type\":\"6\"},\"Feature\":\"AAAAAAAAAAAAAAAPAAAAAAAKABQAAAAAAAAAAAAAAAAhAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAB0AAAAAAAAAAAAAEwELAAAAAAAAAAAAAAAAAAAAAAAFCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAABIAAAAAABMAAAEAAAAAAAAAAAAAAAAAABAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAAAAHgAAAAAAAAAAAAAAAgAAAAAHAAATAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAAAAAAAAAcAAAAAB8AAAAAAAAAAAAAAAAAAAAAABoDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVAAAAAAAMDgAAAAAAAB0AAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAA=\",\"BucketID\":76,\"BucketIDList\":[76,91,82,57,36,51,75,55,71,43,84,63,8,98,83,65,90,60,35,3,37,39,74,2,12,9,1,20,79,32,95,49,33,58,42,66,38,69,45,56,59,0,87,19,41,34,21,14,13,6,4,26,68,96,72,7,85,29,48,40,88,99,23,46,27,18,77,78,11,97,17,50,15,61,16,31,80,44,52,25,10,86,92,5,54,53,73,89,94,93,70,62,30,47,64,22,28,67,81,24],\"FaceFeature\":\"\",\"FaceBucketID\":-1,\"FaceBucketIDList\":[],\"FaceQuality\":\"0.000000\",\"FaceYaw\":\"0.000000\",\"FacePitch\":\"0.000000\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.000000\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1},{\"ImageID\":\"4\",\"ObjectID\":1,\"Metadata\":{\"Gender\":\"1\",\"Age\":\"16\",\"Angle\":\"128\",\"BikeClass\":\"1\",\"SocialAttribute\":\"1\",\"Enterprise\":\"-1\",\"FaceBoundingBox\":{\"x\":145,\"y\":65,\"w\":54,\"h\":66},\"CoatLength\":\"2\",\"CoatTexture\":\"5\",\"CoatColor\":[\"2\"],\"CoatColorNums\":\"1\",\"HelmetColor\":\"-1\",\"HasHelmet\":\"0\",\"HasGlasses\":\"1\",\"HasMask\":\"0\",\"HasBackpack\":\"0\",\"HasCarrybag\":\"-1\",\"HasUmbrella\":\"0\",\"HasPlate\":\"-1\",\"PlateNo\":\"-1\",\"HasPassenger\":\"1\",\"ObjectBoundingBox\":{\"x\":54,\"y\":16,\"w\":276,\"h\":635},\"TrafficViolation\":\"-1\",\"Type\":\"6\"},\"Feature\":\"UVNURgUA/wACAf/3AfwEA/kC/AMAAwAEAQACAPv+AAAB/wMHAgEA/wAGAAj/+AD7APwCAwkD9wsAAP4CBvn7/wz5A/wBBP8D/QICCAUCBv/7AgABAv7+AAH9AAUC/AX/AvsC/P4CAv39BAMA/gAAAAIA/wT6/v77A/YEAPoB//sG//7+/wD+/QAA/AMAAAQCAvz8/P3/AAH9+gX8/wD8/fr7AQAD//oA+AECAAAFAAH+/QH7/gIHAgYA/vz+AwADAgQCAgAL+wD9BgMGBv8E+/oF/P4H/wMD/gQC/wQH/v/4Agn9BQAC/wAE/P37BP/7AgIA/gj8APv7CAL9/vkABgL7/fz9/AD1BwD7AwAAAwH7AAb7+v4AAwX6/PsDBwMA/wH9AQD8AQP8APz7/vb8APoDAAT8AP0FAwYG/P39/P4B/vkA/f8AAgQBB/0D+wAFBwX4Aff+Bvz2/wEEBAIABQQD/wABAAMA//0AAP/+/wAC9/4AAfz+AAEF/f/6CAD9Bfn/APn9CwP3BAABBAAIAfr8/wP/CQn9BgL+Bf38A/z89gf6AAf9//wABAP9AgT19/4DAQMCAQQDAAABBf76+gEC/Pv9//4E//76AAAACQAA//kE//sDCfsGA/z7AAD7BAMAAAIAAgMA/P0D/wIE/v36//wAAgX8/voCAAT8BAkCAgEBAfwG+gEA/vr++AYAAQL7AAcAAP8BAAH9Af8A+QD+Agj7+wID/AAB+QcD//4ACQMEAvv+AvwBB/r7/gL/+AL7A/78+/4AAP39/QEFAwEA/QECCfz6AfwE/QMAAwD/Av4HAPz/AP4F/ggD+gMH+/UH+wID/wQGBPr2BP8KBAP/+/7//AP2/QT6//4CBAAFBgAFBf4E//v9BgADAAH9/gb4BAQHAAEA/QIB/vsE+/8GAPb7Av79AAD4AP4B+wf+/P4ABf79/wD/+QQA+fkB/voAA/oDAQUDAP79BAkGAAn/AQMB//76APz8BQD9AgEB/Pf6/wcAAwcHAgEA/QH/AP/6A/75BP8E/QD+AgT+AwEF+PkC//37/f79/gAAAQUA+AEEAAX9/wL8AgAFAwAA+v8G+wQA/QEF/wD+BAAGAwABAf0JAgMD+wUGAf39APoA/gQHAAID/AAF//8GA//8/QUC/gEC/vwGAv0BAAD9/ggCAAYBAwL/AQD9/fYD/wIE/f/4BP4AAAD8+wH5Bwb7AAQF+v/0//j9+/v/AP4CAgAA/v4AAP7+Bfv/CwECAQD7CgH5AQEAAQQAAP76APkABQIBBv0JAwABBwD++wD+//35+QPy/v0FAAYC+QD9Avr5CgQIA/35/AADAQH6+AEIAwEEAAMA/AMD+wADAAP///kFBAEBAA==\",\"BucketID\":5,\"BucketIDList\":[5,3,83,30,43,82,55,80,46,51,61,79,97,67,21,91,88,90,99,12,23,0,1,36,47,54,37,27,14,50,16,8,53,25,52,29,18,60,38,98,62,4,15,2,20,22,17,96,65,44,75,59,93,66,31,10,45,48,13,7,57,76,72,77,56,94,81,87,95,6,92,69,74,39,35,26,34,71,41,85,64,49,24,42,73,78,58,63,89,11,86,68,32,28,19,9,40,33,70,84],\"FaceFeature\":\"BQD5+Af/BP4I/AD7AP/9AAcC/QT6/P4HAfr9B/sIBf8O/AD8BwYKCA0AAv77/gAE+gAL/wMA/QD9AAAG/vv8AAP7BvwBAAn4AAf/AQAOAP8A7wIBAv8EAwAFAf/5CPoABQEDBwEFBQb5/fb+AO4G+AAB/wML9PsAA/oHBwYF/Pz7/gUK9QUABgEE+wH8AgL6+gb3AwEAAxL7CwD/DPcFAf30AAPz/QAE/QAABvn9AwD2/wQCAwACAQAKBAUD/v0A/voE//0B+Ab//vkC+vj/AAH7+AL7A/sDAPj7Bvn+/QoGAwEA/v//AP4D+wQDAf8K/QP2BgD5/QD//gEKA/v+BwAAAf3xAf/+/gT9AwP8DADzBw4AAvn//wAE+QH5AQv3C+38/Pf9/QII8gID9wMFCggFAv/9AvsEBvkACP8G9/z9AP/7/fwE+v39DPgAAAAB/fr5A/n8/wIDAAQK/wH+AwAAAvwADQoKAgAFAfsF+vsE//35C/3zCAD9BPsB/wMGB/n5/Pv0+Pb+BPn5/wMKAQAB8fT9Awf++/YAAAICAwUG+wD0+fkBB/0AAAQIBfgEBPkG/wcJAgD7CAv1Avf9AQYAAAEDAPYC+foJ+/78APwD8f4A/gUBB/7///oLAwD/AAUD+/39+PsH+QIF9gMEA/oGAQsMBQkHA/wB+PwCAgA=\",\"FaceBucketID\":82,\"FaceBucketIDList\":[82,45,63,31,16,1,7,98,40,24,65,19,62,48,94,72,92,17,91,52,77,76,85,87,81,21,93,64,37,42,30,78,25,61,9,12,22,2,13,34,4,15,46,3,14,99,90,28,66,29,75,68,80,59,60,88,69,83,36,55,11,44,96,89,10,26,49,50,73,6,53,20,47,86,58,84,27,8,70,43,57,71,97,79,0,67,54,33,23,95,56,5,41,38,51,32,74,39,35,18],\"FaceQuality\":\"0.365118\",\"FaceYaw\":\"0.257412\",\"FacePitch\":\"0.390233\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.475882\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1},{\"ImageID\":\"2\",\"ObjectID\":1,\"Metadata\":{\"Gender\":\"1\",\"Age\":\"32\",\"HeadBoundingBox\":{\"x\":96,\"y\":16,\"w\":107,\"h\":136},\"FaceBoundingBox\":{\"x\":115,\"y\":61,\"w\":57,\"h\":77},\"HairStyle\":\"2\",\"HasHat\":\"1\",\"HasMask\":\"1\",\"HasGlasses\":\"0\",\"Type\":\"6\"},\"Feature\":\"UVNURgUA//0BCP4BAQcAAwQBBvsCB/v8Af4A+wD5+AcBAgL9AgIEAgH4AQQA+f77+P77AAAIA/8A+QQJ/fz8AgACBfsAAgAC/AcIAQD++fgCAAUB/gb//AEAAf4B/QP+AQD0/QMDAfkD+f//A/7+/AD6B/f7/AH7/gAFAAMBAPb/AAP//wAIBQD7Af0FAAD9AAgC/gYF/f/8DAAC//4BAP/6AgECAgADAPz++v0A/wD//fz5AAIB/f0IBAQA/v8CBwP//wYE+/sCCP0BBAMD/gQA/QH/AgL6AgX/BP7/+AD5A/75/QH+A/8H/QAACP//AQT7+QICAfv/Afj9A/0D/wAA/f/8/wYL/wACAQYAAAAD/ggAAQMABv/6BAIADPv+A/wEAQAA/AD5AwT///4BAPz8CgUCDf78AwEA/f4AA/8C/wQB/P8A/wEA/gsAAwEF/v0AAf7/+QQECAcGAP0AAgH//AAHBwD3/fwB+/7/AQj//wUFAP/+/gYBAgYD+fv/BwH8Af0EBAD+AP3++gIH+v8CAPQEAAT//gDzAP0A+AL6BP4I9wMJAP0CAPX6APz9/gALAP7/BgQD+wIDBPn+CwIH/fz7A/3+9wAJ/QD9AP/++wME/v/+Avv+APoFAAAB+gD5APn//gEGBAME/wX5/AD/CAL+9QD8BAD2/wMCCf38+/oB+f0C/f39AQL+AAEAAgAE/wEIA///AP8HAQT+8fn7AP4AAAMA+QQDAwIB//j+/QEAAAIAAgj/A/n8AAP9AQD8AQYF+PgAA/4B+gEE+QYA/wYAB/0BAQD+/P/+BQf5BwIAAPsBBAEGAP4JAwEE////AAEF/wL4AAAFAQYA/vz+/AACAv8CAwIA+wIAAAUJAP0C/wIHAAEABgQF/QAEAAL7BP0A//wC+vr+/AIGAwAEAP0A/P/8BAD//AD5+wQEAAEHAv/8AP77+vQEBP4BAAAAAAr7/wD5AgD7BAEA/gT7AAAEAAMABPkLAQYABff+/wEDAP8EA/4AAf8A/gX9+wACAv3//f7/BAH+Bf/+AAH/AAAE9wAHAP/+/P8DAQD7/QQB/P3/AwAAAQAB/wD+BwAB/vwAAAL/AAYAAAf/Af76+fj6AP4F/gD9AgIB/Qr59f8CAAMCBgQHAf0FAP34AAQH/P79/wQGBA4D+f4AA/v+AAAA+wIE/gIH+QP2AQQGAwAE/vwI/P4GBwD/AAX4AAP+/f0A/Af/AgEBA/v9BPgDBwAC/wD8Bv36A/gBAAH+AAX+BP/9AAIF+AD8Av4B/wT/AQAAAQL/BPwA/PsA/AMDBfb/+AEBCAL+//36APz//wEHBv3/BQAA/QP9+wABAQL6//4CAAH/CP/+AAMBAf0CAAD9+g==\",\"BucketID\":32,\"BucketIDList\":[32,87,20,68,45,78,10,6,52,65,1,94,79,16,61,38,55,89,43,51,60,27,54,25,17,83,9,40,14,22,50,44,18,66,82,4,48,31,69,77,90,63,92,73,70,84,67,23,12,3,74,47,21,41,28,96,36,97,5,85,39,95,64,26,80,53,91,37,34,57,46,15,2,93,11,98,75,81,56,0,24,62,86,13,19,71,72,7,58,29,59,49,88,76,35,99,33,30,42,8],\"FaceFeature\":\"AwQF+foK/vcCAAD4/wD7CQH39vP7/gz/CAAB/AX++AAI/v8D+gQAAP0G/wAA+/oAAAP+Af79CwEAAgAA+/oFBe/3AgIFAgP0/vr8Cf4C+AMHBPn5Afr5AQQGBQD58gMG+wQTAgTzAPr9BQYEA/j//gT8+wXx9wMC+gcH/wAC8v0A+gD7+wkE/gAA7wL78gX/AgIGBvr8AAgD/woEAvkEAwv5CP/8/fz+/fwMAvr7AgD4APcEAA0F//kAAAAG+gADAQEB/wD+AQgCBg35+QQC/vv//vcAAPgEAwAAAgD9Af32/wMLAwD8B/75AQIB+/z/+v4AA/n//gL8+/0BAPv//PgIAAD0CQALAAUF/fwA/wYBAQf9+/f++Af49gMB/AMABwAA9vr5//sE/PoD+QP6+wsA/wEB+QIC+/8B/wD88QkACAIAAPn5AAUD/QL++P4H/f3+A/gG/f8G/QkA8wD0BAMBBwD59AAB+QUA//v2/wEJAQD8DAL5CPoA+/b+/Qr5AwcA/AD+CAEDBgEH/Qb+AQUHAAQK/fUA+/sI9/0I+QcKBQP6/gX0+QgI9gIBAAMFAAAA/vcD/vYI9wj9+v76C/gAAgIH+gMHBP8IAAT6BgAI+vsJ/v7/DAUABgIA+gAHBf0D+/oDAwEABv359QAB+AEG8w7+//0ABf78CPr8Afs=\",\"FaceBucketID\":91,\"FaceBucketIDList\":[91,12,50,84,52,13,57,54,4,53,70,36,64,58,81,10,78,63,35,75,34,16,86,3,99,40,26,42,48,30,25,23,11,62,72,51,18,17,46,27,97,61,49,43,66,37,89,19,24,1,98,76,32,83,44,96,87,31,8,20,33,21,6,56,41,88,82,47,69,93,14,79,38,29,80,85,90,94,55,60,67,95,9,2,71,65,68,77,7,74,59,28,92,73,15,39,22,0,45,5],\"FaceQuality\":\"0.379721\",\"FaceYaw\":\"-0.135311\",\"FacePitch\":\"0.508456\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.555109\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1}]}";}
// @GetMapping("/images1/recog")
// @ResponseBody
// //http://zlsh.ncpoi.cc:7080/getDeviceSnapshotAndRecognize?deviceCode=33050300001327599605&model=7&roi=[10,10,10,10]
// public String getimages(@RequestParam("deviceCode") String deviceCode,
// @RequestParam("model") String model,
// @RequestParam("roi") Long[] roi) {
// return "{\"ret\":\"200\",\"error_msg\":\"OK\",\"ObjectList\":[{\"ImageID\":\"1\",\"ObjectID\":1,\"Metadata\":{\"Gender\":\"1\",\"Age\":\"32\",\"Angle\":\"128\",\"HeadBoundingBox\":{\"x\":96,\"y\":16,\"w\":107,\"h\":136},\"FaceBoundingBox\":{\"x\":115,\"y\":61,\"w\":57,\"h\":77},\"UpperBoundingBox\":{\"x\":34,\"y\":123,\"w\":232,\"h\":263},\"LowerBoundingBox\":{\"x\":74,\"y\":309,\"w\":176,\"h\":408},\"CoatLength\":\"2\",\"CoatTexture\":\"1\",\"CoatColor\":[\"2\"],\"CoatColorNums\":\"1\",\"TrousersLength\":\"1\",\"TrousersTexture\":\"1\",\"TrousersColor\":[\"5\"],\"TrousersColorNums\":\"1\",\"HairStyle\":\"2\",\"HasHat\":\"1\",\"HasGlasses\":\"0\",\"HasMask\":\"0\",\"HasBackpack\":\"0\",\"HasCarrybag\":\"0\",\"HasUmbrella\":\"0\",\"HasTrolley\":\"-1\",\"HasLuggage\":\"-1\",\"LuggageColor\":[],\"LuggageColorNums\":\"0\",\"HasKnife\":\"-1\",\"ObjectBoundingBox\":{\"x\":26,\"y\":13,\"w\":256,\"h\":708},\"TrafficViolation\":\"-1\",\"Type\":\"6\"},\"Feature\":\"UVNURgUA//0BCP4BAQcAAwQBBvsCB/v8Af4A+wD5+AcBAgL9AgIEAgH4AQQA+f77+P77AAAIA/8A+QQJ/fz8AgACBfsAAgAC/AcIAQD++fgCAAUB/gb//AEAAf4B/QP+AQD0/QMDAfkD+f//A/7+/AD6B/f7/AH7/gAFAAMBAPb/AAP//wAIBQD7Af0FAAD9AAgC/gYF/f/8DAAC//4BAP/6AgECAgADAPz++v0A/wD//fz5AAIB/f0IBAQA/v8CBwP//wYE+/sCCP0BBAMD/gQA/QH/AgL6AgX/BP7/+AD5A/75/QH+A/8H/QAACP//AQT7+QICAfv/Afj9A/0D/wAA/f/8/wYL/wACAQYAAAAD/ggAAQMABv/6BAIADPv+A/wEAQAA/AD5AwT///4BAPz8CgUCDf78AwEA/f4AA/8C/wQB/P8A/wEA/gsAAwEF/v0AAf7/+QQECAcGAP0AAgH//AAHBwD3/fwB+/7/AQj//wUFAP/+/gYBAgYD+fv/BwH8Af0EBAD+AP3++gIH+v8CAPQEAAT//gDzAP0A+AL6BP4I9wMJAP0CAPX6APz9/gALAP7/BgQD+wIDBPn+CwIH/fz7A/3+9wAJ/QD9AP/++wME/v/+Avv+APoFAAAB+gD5APn//gEGBAME/wX5/AD/CAL+9QD8BAD2/wMCCf38+/oB+f0C/f39AQL+AAEAAgAE/wEIA///AP8HAQT+8fn7AP4AAAMA+QQDAwIB//j+/QEAAAIAAgj/A/n8AAP9AQD8AQYF+PgAA/4B+gEE+QYA/wYAB/0BAQD+/P/+BQf5BwIAAPsBBAEGAP4JAwEE////AAEF/wL4AAAFAQYA/vz+/AACAv8CAwIA+wIAAAUJAP0C/wIHAAEABgQF/QAEAAL7BP0A//wC+vr+/AIGAwAEAP0A/P/8BAD//AD5+wQEAAEHAv/8AP77+vQEBP4BAAAAAAr7/wD5AgD7BAEA/gT7AAAEAAMABPkLAQYABff+/wEDAP8EA/4AAf8A/gX9+wACAv3//f7/BAH+Bf/+AAH/AAAE9wAHAP/+/P8DAQD7/QQB/P3/AwAAAQAB/wD+BwAB/vwAAAL/AAYAAAf/Af76+fj6AP4F/gD9AgIB/Qr59f8CAAMCBgQHAf0FAP34AAQH/P79/wQGBA4D+f4AA/v+AAAA+wIE/gIH+QP2AQQGAwAE/vwI/P4GBwD/AAX4AAP+/f0A/Af/AgEBA/v9BPgDBwAC/wD8Bv36A/gBAAH+AAX+BP/9AAIF+AD8Av4B/wT/AQAAAQL/BPwA/PsA/AMDBfb/+AEBCAL+//36APz//wEHBv3/BQAA/QP9+wABAQL6//4CAAH/CP/+AAMBAf0CAAD9+g==\",\"BucketID\":32,\"BucketIDList\":[32,87,20,68,45,78,10,6,52,65,1,94,79,16,61,38,55,89,43,51,60,27,54,25,17,83,9,40,14,22,50,44,18,66,82,4,48,31,69,77,90,63,92,73,70,84,67,23,12,3,74,47,21,41,28,96,36,97,5,85,39,95,64,26,80,53,91,37,34,57,46,15,2,93,11,98,75,81,56,0,24,62,86,13,19,71,72,7,58,29,59,49,88,76,35,99,33,30,42,8],\"FaceFeature\":\"AwQF+foK/vcCAAD4/wD7CQH39vP7/gz/CAAB/AX++AAI/v8D+gQAAP0G/wAA+/oAAAP+Af79CwEAAgAA+/oFBe/3AgIFAgP0/vr8Cf4C+AMHBPn5Afr5AQQGBQD58gMG+wQTAgTzAPr9BQYEA/j//gT8+wXx9wMC+gcH/wAC8v0A+gD7+wkE/gAA7wL78gX/AgIGBvr8AAgD/woEAvkEAwv5CP/8/fz+/fwMAvr7AgD4APcEAA0F//kAAAAG+gADAQEB/wD+AQgCBg35+QQC/vv//vcAAPgEAwAAAgD9Af32/wMLAwD8B/75AQIB+/z/+v4AA/n//gL8+/0BAPv//PgIAAD0CQALAAUF/fwA/wYBAQf9+/f++Af49gMB/AMABwAA9vr5//sE/PoD+QP6+wsA/wEB+QIC+/8B/wD88QkACAIAAPn5AAUD/QL++P4H/f3+A/gG/f8G/QkA8wD0BAMBBwD59AAB+QUA//v2/wEJAQD8DAL5CPoA+/b+/Qr5AwcA/AD+CAEDBgEH/Qb+AQUHAAQK/fUA+/sI9/0I+QcKBQP6/gX0+QgI9gIBAAMFAAAA/vcD/vYI9wj9+v76C/gAAgIH+gMHBP8IAAT6BgAI+vsJ/v7/DAUABgIA+gAHBf0D+/oDAwEABv359QAB+AEG8w7+//0ABf78CPr8Afs=\",\"FaceBucketID\":91,\"FaceBucketIDList\":[91,12,50,84,52,13,57,54,4,53,70,36,64,58,81,10,78,63,35,75,34,16,86,3,99,40,26,42,48,30,25,23,11,62,72,51,18,17,46,27,97,61,49,43,66,37,89,19,24,1,98,76,32,83,44,96,87,31,8,20,33,21,6,56,41,88,82,47,69,93,14,79,38,29,80,85,90,94,55,60,67,95,9,2,71,65,68,77,7,74,59,28,92,73,15,39,22,0,45,5],\"FaceQuality\":\"0.379721\",\"FaceYaw\":\"-0.135311\",\"FacePitch\":\"0.508456\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.555109\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1},{\"ImageID\":\"3\",\"ObjectID\":1,\"Metadata\":{\"Angle\":\"128\",\"VehicleClass\":\"1\",\"VehicleColor\":[\"9\"],\"VehicleColorNums\":\"1\",\"VehicleBrand\":\"\\u96ea\\u4f5b\\u5170-\\u79d1\\u9c81\\u5179-2009_2013\",\"VehicleMainBrandName\":\"\\u96ea\\u4f5b\\u5170\",\"VehicleSubBrandName\":\"\\u79d1\\u9c81\\u5179\",\"VehicleYearName\":\"2009_2013\",\"HasPlate\":\"1\",\"PlateClass\":\"1\",\"PlateColor\":\"2\",\"PlateNo\":\"\\u6d59AJ079B\",\"PlateNeatness\":\"2\",\"Sunvisor\":\"0\",\"Paper\":\"0\",\"Decoration\":\"0\",\"Drop\":\"1\",\"Tag\":\"1\",\"SafetyBelt\":{\"MainDriver\":\"-1\",\"CoDriver\":\"-1\"},\"HasCall\":\"-1\",\"HasSkylight\":\"0\",\"HasBaggage\":\"0\",\"HasAerial\":\"0\",\"HasCrash\":\"-1\",\"HasDanger\":\"0\",\"HighwayTollVehicles\":\"1\",\"ObjectBoundingBox\":{\"x\":41,\"y\":40,\"w\":894,\"h\":717},\"TrafficViolation\":\"-1\",\"Type\":\"6\"},\"Feature\":\"AAAAAAAAAAAAAAAPAAAAAAAKABQAAAAAAAAAAAAAAAAhAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAB0AAAAAAAAAAAAAEwELAAAAAAAAAAAAAAAAAAAAAAAFCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAABIAAAAAABMAAAEAAAAAAAAAAAAAAAAAABAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAAAAHgAAAAAAAAAAAAAAAgAAAAAHAAATAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAAAAAAAAAcAAAAAB8AAAAAAAAAAAAAAAAAAAAAABoDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVAAAAAAAMDgAAAAAAAB0AAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAA=\",\"BucketID\":76,\"BucketIDList\":[76,91,82,57,36,51,75,55,71,43,84,63,8,98,83,65,90,60,35,3,37,39,74,2,12,9,1,20,79,32,95,49,33,58,42,66,38,69,45,56,59,0,87,19,41,34,21,14,13,6,4,26,68,96,72,7,85,29,48,40,88,99,23,46,27,18,77,78,11,97,17,50,15,61,16,31,80,44,52,25,10,86,92,5,54,53,73,89,94,93,70,62,30,47,64,22,28,67,81,24],\"FaceFeature\":\"\",\"FaceBucketID\":-1,\"FaceBucketIDList\":[],\"FaceQuality\":\"0.000000\",\"FaceYaw\":\"0.000000\",\"FacePitch\":\"0.000000\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.000000\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1},{\"ImageID\":\"4\",\"ObjectID\":1,\"Metadata\":{\"Gender\":\"1\",\"Age\":\"16\",\"Angle\":\"128\",\"BikeClass\":\"1\",\"SocialAttribute\":\"1\",\"Enterprise\":\"-1\",\"FaceBoundingBox\":{\"x\":145,\"y\":65,\"w\":54,\"h\":66},\"CoatLength\":\"2\",\"CoatTexture\":\"5\",\"CoatColor\":[\"2\"],\"CoatColorNums\":\"1\",\"HelmetColor\":\"-1\",\"HasHelmet\":\"0\",\"HasGlasses\":\"1\",\"HasMask\":\"0\",\"HasBackpack\":\"0\",\"HasCarrybag\":\"-1\",\"HasUmbrella\":\"0\",\"HasPlate\":\"-1\",\"PlateNo\":\"-1\",\"HasPassenger\":\"1\",\"ObjectBoundingBox\":{\"x\":54,\"y\":16,\"w\":276,\"h\":635},\"TrafficViolation\":\"-1\",\"Type\":\"6\"},\"Feature\":\"UVNURgUA/wACAf/3AfwEA/kC/AMAAwAEAQACAPv+AAAB/wMHAgEA/wAGAAj/+AD7APwCAwkD9wsAAP4CBvn7/wz5A/wBBP8D/QICCAUCBv/7AgABAv7+AAH9AAUC/AX/AvsC/P4CAv39BAMA/gAAAAIA/wT6/v77A/YEAPoB//sG//7+/wD+/QAA/AMAAAQCAvz8/P3/AAH9+gX8/wD8/fr7AQAD//oA+AECAAAFAAH+/QH7/gIHAgYA/vz+AwADAgQCAgAL+wD9BgMGBv8E+/oF/P4H/wMD/gQC/wQH/v/4Agn9BQAC/wAE/P37BP/7AgIA/gj8APv7CAL9/vkABgL7/fz9/AD1BwD7AwAAAwH7AAb7+v4AAwX6/PsDBwMA/wH9AQD8AQP8APz7/vb8APoDAAT8AP0FAwYG/P39/P4B/vkA/f8AAgQBB/0D+wAFBwX4Aff+Bvz2/wEEBAIABQQD/wABAAMA//0AAP/+/wAC9/4AAfz+AAEF/f/6CAD9Bfn/APn9CwP3BAABBAAIAfr8/wP/CQn9BgL+Bf38A/z89gf6AAf9//wABAP9AgT19/4DAQMCAQQDAAABBf76+gEC/Pv9//4E//76AAAACQAA//kE//sDCfsGA/z7AAD7BAMAAAIAAgMA/P0D/wIE/v36//wAAgX8/voCAAT8BAkCAgEBAfwG+gEA/vr++AYAAQL7AAcAAP8BAAH9Af8A+QD+Agj7+wID/AAB+QcD//4ACQMEAvv+AvwBB/r7/gL/+AL7A/78+/4AAP39/QEFAwEA/QECCfz6AfwE/QMAAwD/Av4HAPz/AP4F/ggD+gMH+/UH+wID/wQGBPr2BP8KBAP/+/7//AP2/QT6//4CBAAFBgAFBf4E//v9BgADAAH9/gb4BAQHAAEA/QIB/vsE+/8GAPb7Av79AAD4AP4B+wf+/P4ABf79/wD/+QQA+fkB/voAA/oDAQUDAP79BAkGAAn/AQMB//76APz8BQD9AgEB/Pf6/wcAAwcHAgEA/QH/AP/6A/75BP8E/QD+AgT+AwEF+PkC//37/f79/gAAAQUA+AEEAAX9/wL8AgAFAwAA+v8G+wQA/QEF/wD+BAAGAwABAf0JAgMD+wUGAf39APoA/gQHAAID/AAF//8GA//8/QUC/gEC/vwGAv0BAAD9/ggCAAYBAwL/AQD9/fYD/wIE/f/4BP4AAAD8+wH5Bwb7AAQF+v/0//j9+/v/AP4CAgAA/v4AAP7+Bfv/CwECAQD7CgH5AQEAAQQAAP76APkABQIBBv0JAwABBwD++wD+//35+QPy/v0FAAYC+QD9Avr5CgQIA/35/AADAQH6+AEIAwEEAAMA/AMD+wADAAP///kFBAEBAA==\",\"BucketID\":5,\"BucketIDList\":[5,3,83,30,43,82,55,80,46,51,61,79,97,67,21,91,88,90,99,12,23,0,1,36,47,54,37,27,14,50,16,8,53,25,52,29,18,60,38,98,62,4,15,2,20,22,17,96,65,44,75,59,93,66,31,10,45,48,13,7,57,76,72,77,56,94,81,87,95,6,92,69,74,39,35,26,34,71,41,85,64,49,24,42,73,78,58,63,89,11,86,68,32,28,19,9,40,33,70,84],\"FaceFeature\":\"BQD5+Af/BP4I/AD7AP/9AAcC/QT6/P4HAfr9B/sIBf8O/AD8BwYKCA0AAv77/gAE+gAL/wMA/QD9AAAG/vv8AAP7BvwBAAn4AAf/AQAOAP8A7wIBAv8EAwAFAf/5CPoABQEDBwEFBQb5/fb+AO4G+AAB/wML9PsAA/oHBwYF/Pz7/gUK9QUABgEE+wH8AgL6+gb3AwEAAxL7CwD/DPcFAf30AAPz/QAE/QAABvn9AwD2/wQCAwACAQAKBAUD/v0A/voE//0B+Ab//vkC+vj/AAH7+AL7A/sDAPj7Bvn+/QoGAwEA/v//AP4D+wQDAf8K/QP2BgD5/QD//gEKA/v+BwAAAf3xAf/+/gT9AwP8DADzBw4AAvn//wAE+QH5AQv3C+38/Pf9/QII8gID9wMFCggFAv/9AvsEBvkACP8G9/z9AP/7/fwE+v39DPgAAAAB/fr5A/n8/wIDAAQK/wH+AwAAAvwADQoKAgAFAfsF+vsE//35C/3zCAD9BPsB/wMGB/n5/Pv0+Pb+BPn5/wMKAQAB8fT9Awf++/YAAAICAwUG+wD0+fkBB/0AAAQIBfgEBPkG/wcJAgD7CAv1Avf9AQYAAAEDAPYC+foJ+/78APwD8f4A/gUBB/7///oLAwD/AAUD+/39+PsH+QIF9gMEA/oGAQsMBQkHA/wB+PwCAgA=\",\"FaceBucketID\":82,\"FaceBucketIDList\":[82,45,63,31,16,1,7,98,40,24,65,19,62,48,94,72,92,17,91,52,77,76,85,87,81,21,93,64,37,42,30,78,25,61,9,12,22,2,13,34,4,15,46,3,14,99,90,28,66,29,75,68,80,59,60,88,69,83,36,55,11,44,96,89,10,26,49,50,73,6,53,20,47,86,58,84,27,8,70,43,57,71,97,79,0,67,54,33,23,95,56,5,41,38,51,32,74,39,35,18],\"FaceQuality\":\"0.365118\",\"FaceYaw\":\"0.257412\",\"FacePitch\":\"0.390233\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.475882\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1},{\"ImageID\":\"2\",\"ObjectID\":1,\"Metadata\":{\"Gender\":\"1\",\"Age\":\"32\",\"HeadBoundingBox\":{\"x\":96,\"y\":16,\"w\":107,\"h\":136},\"FaceBoundingBox\":{\"x\":115,\"y\":61,\"w\":57,\"h\":77},\"HairStyle\":\"2\",\"HasHat\":\"1\",\"HasMask\":\"1\",\"HasGlasses\":\"0\",\"Type\":\"6\"},\"Feature\":\"UVNURgUA//0BCP4BAQcAAwQBBvsCB/v8Af4A+wD5+AcBAgL9AgIEAgH4AQQA+f77+P77AAAIA/8A+QQJ/fz8AgACBfsAAgAC/AcIAQD++fgCAAUB/gb//AEAAf4B/QP+AQD0/QMDAfkD+f//A/7+/AD6B/f7/AH7/gAFAAMBAPb/AAP//wAIBQD7Af0FAAD9AAgC/gYF/f/8DAAC//4BAP/6AgECAgADAPz++v0A/wD//fz5AAIB/f0IBAQA/v8CBwP//wYE+/sCCP0BBAMD/gQA/QH/AgL6AgX/BP7/+AD5A/75/QH+A/8H/QAACP//AQT7+QICAfv/Afj9A/0D/wAA/f/8/wYL/wACAQYAAAAD/ggAAQMABv/6BAIADPv+A/wEAQAA/AD5AwT///4BAPz8CgUCDf78AwEA/f4AA/8C/wQB/P8A/wEA/gsAAwEF/v0AAf7/+QQECAcGAP0AAgH//AAHBwD3/fwB+/7/AQj//wUFAP/+/gYBAgYD+fv/BwH8Af0EBAD+AP3++gIH+v8CAPQEAAT//gDzAP0A+AL6BP4I9wMJAP0CAPX6APz9/gALAP7/BgQD+wIDBPn+CwIH/fz7A/3+9wAJ/QD9AP/++wME/v/+Avv+APoFAAAB+gD5APn//gEGBAME/wX5/AD/CAL+9QD8BAD2/wMCCf38+/oB+f0C/f39AQL+AAEAAgAE/wEIA///AP8HAQT+8fn7AP4AAAMA+QQDAwIB//j+/QEAAAIAAgj/A/n8AAP9AQD8AQYF+PgAA/4B+gEE+QYA/wYAB/0BAQD+/P/+BQf5BwIAAPsBBAEGAP4JAwEE////AAEF/wL4AAAFAQYA/vz+/AACAv8CAwIA+wIAAAUJAP0C/wIHAAEABgQF/QAEAAL7BP0A//wC+vr+/AIGAwAEAP0A/P/8BAD//AD5+wQEAAEHAv/8AP77+vQEBP4BAAAAAAr7/wD5AgD7BAEA/gT7AAAEAAMABPkLAQYABff+/wEDAP8EA/4AAf8A/gX9+wACAv3//f7/BAH+Bf/+AAH/AAAE9wAHAP/+/P8DAQD7/QQB/P3/AwAAAQAB/wD+BwAB/vwAAAL/AAYAAAf/Af76+fj6AP4F/gD9AgIB/Qr59f8CAAMCBgQHAf0FAP34AAQH/P79/wQGBA4D+f4AA/v+AAAA+wIE/gIH+QP2AQQGAwAE/vwI/P4GBwD/AAX4AAP+/f0A/Af/AgEBA/v9BPgDBwAC/wD8Bv36A/gBAAH+AAX+BP/9AAIF+AD8Av4B/wT/AQAAAQL/BPwA/PsA/AMDBfb/+AEBCAL+//36APz//wEHBv3/BQAA/QP9+wABAQL6//4CAAH/CP/+AAMBAf0CAAD9+g==\",\"BucketID\":32,\"BucketIDList\":[32,87,20,68,45,78,10,6,52,65,1,94,79,16,61,38,55,89,43,51,60,27,54,25,17,83,9,40,14,22,50,44,18,66,82,4,48,31,69,77,90,63,92,73,70,84,67,23,12,3,74,47,21,41,28,96,36,97,5,85,39,95,64,26,80,53,91,37,34,57,46,15,2,93,11,98,75,81,56,0,24,62,86,13,19,71,72,7,58,29,59,49,88,76,35,99,33,30,42,8],\"FaceFeature\":\"AwQF+foK/vcCAAD4/wD7CQH39vP7/gz/CAAB/AX++AAI/v8D+gQAAP0G/wAA+/oAAAP+Af79CwEAAgAA+/oFBe/3AgIFAgP0/vr8Cf4C+AMHBPn5Afr5AQQGBQD58gMG+wQTAgTzAPr9BQYEA/j//gT8+wXx9wMC+gcH/wAC8v0A+gD7+wkE/gAA7wL78gX/AgIGBvr8AAgD/woEAvkEAwv5CP/8/fz+/fwMAvr7AgD4APcEAA0F//kAAAAG+gADAQEB/wD+AQgCBg35+QQC/vv//vcAAPgEAwAAAgD9Af32/wMLAwD8B/75AQIB+/z/+v4AA/n//gL8+/0BAPv//PgIAAD0CQALAAUF/fwA/wYBAQf9+/f++Af49gMB/AMABwAA9vr5//sE/PoD+QP6+wsA/wEB+QIC+/8B/wD88QkACAIAAPn5AAUD/QL++P4H/f3+A/gG/f8G/QkA8wD0BAMBBwD59AAB+QUA//v2/wEJAQD8DAL5CPoA+/b+/Qr5AwcA/AD+CAEDBgEH/Qb+AQUHAAQK/fUA+/sI9/0I+QcKBQP6/gX0+QgI9gIBAAMFAAAA/vcD/vYI9wj9+v76C/gAAgIH+gMHBP8IAAT6BgAI+vsJ/v7/DAUABgIA+gAHBf0D+/oDAwEABv359QAB+AEG8w7+//0ABf78CPr8Afs=\",\"FaceBucketID\":91,\"FaceBucketIDList\":[91,12,50,84,52,13,57,54,4,53,70,36,64,58,81,10,78,63,35,75,34,16,86,3,99,40,26,42,48,30,25,23,11,62,72,51,18,17,46,27,97,61,49,43,66,37,89,19,24,1,98,76,32,83,44,96,87,31,8,20,33,21,6,56,41,88,82,47,69,93,14,79,38,29,80,85,90,94,55,60,67,95,9,2,71,65,68,77,7,74,59,28,92,73,15,39,22,0,45,5],\"FaceQuality\":\"0.379721\",\"FaceYaw\":\"-0.135311\",\"FacePitch\":\"0.508456\",\"FaceRoll\":\"0.000000\",\"FaceBlurry\":\"0.555109\",\"ObjectImageData\":\"\",\"FaceImageData\":\"\",\"Index\":1}]}";}
//
/***
* 旧版本透露账号密码舍弃掉
* @param ftpPath
* @param request
* @param response
*/
// @GetMapping("/fielagent")
// @ResponseBody
// protected void fielagent(@RequestParam("ftpPath") String ftpPath, HttpServletRequest request, HttpServletResponse response) {
// long startTime = System.currentTimeMillis();
// FileInputStream hFile = null;
// OutputStream toClient = null;
// InputStream inputStream = null;
// BufferedInputStream bis = null;
// try {
// response.reset();
// response.setHeader("Expires", "Sat, 10 May 2059 12:00:00 GMT");
// response.setHeader("Cache-Control", "max-age=315360000");
//
// if (StringUtils.isNotBlank(ftpPath)) {
// //根据ftp path 查询
//
// if (ftpPath.endsWith(".jpg") || ftpPath.endsWith(".JPG") || ftpPath.endsWith(".png") || ftpPath.endsWith(".PNG") || ftpPath.endsWith(".gif") || ftpPath.endsWith(".GIF")) {
// response.setContentType("image/" + ftpPath.substring(ftpPath.lastIndexOf(".") + 1) + "; charset=utf-8");
// } else if (ftpPath.endsWith(".mp4") || ftpPath.endsWith(".MP4")) {
// response.setContentType("video/mpeg4; charset=utf-8");
// String mp4file = ftpPath.substring(ftpPath.lastIndexOf("/") + 1);
// response.setHeader("Content-Disposition", "attachment;fileName=" + mp4file);
// }
//
// String destUrl = ftpPath;
// destUrl = new String(destUrl.getBytes("ISO8859-1"), "GBK");
// String[] arr = destUrl.split(";");
// FtpURLConnection ftpUrl = null;
// HttpURLConnection httpUrl = null;
// for (int i = 0; i < arr.length; i++) {
// try {
// URL url = new URL(arr[i]);
// if (arr[i].toUpperCase().indexOf("FTP") != -1) { // ftp
// ftpUrl = (FtpURLConnection) url.openConnection();
// ftpUrl.setConnectTimeout(5000);
// ftpUrl.setReadTimeout(5000);
// bis = new BufferedInputStream(ftpUrl.getInputStream());
// response.setContentLength(ftpUrl.getContentLength());
// } else { // http
// httpUrl = (HttpURLConnection) url.openConnection();
// httpUrl.setConnectTimeout(5000);
// httpUrl.setReadTimeout(5000);
// bis = new BufferedInputStream(httpUrl.getInputStream());
// response.setContentLength(httpUrl.getContentLength());
// }
// toClient = response.getOutputStream();
// IOUtils.copy(bis, toClient);
// } catch (Exception e) {
// response.setContentType("text/html;charset=GBK");
// response.setCharacterEncoding("GBK");
// PrintWriter out = response.getWriter();
// out.write("无法打开图片!");
// out.flush();
// } finally {
// if (bis != null) {
// bis.close();
// }
// if (bis != null) {
// bis.close();
// }
// if (httpUrl != null) {
// httpUrl.disconnect();
// }
// if (ftpUrl != null) {
// ftpUrl.close();
// }
// if (toClient != null) {
// toClient.close();
// }
// }
// }
// return;
// }
//
// } catch (Exception e) {
// } finally {
// IOUtils.closeQuietly(bis);
// IOUtils.closeQuietly(toClient);
// IOUtils.closeQuietly(hFile);
// IOUtils.closeQuietly(inputStream);
// }
//
// }
//
//
//
// @GetMapping("/fielagent")
// @ResponseBody
// protected void fielagent(@RequestParam("ftpPath") String ftpPath, HttpServletRequest request, HttpServletResponse response) {
//
// long startTime = System.currentTimeMillis();
// FileInputStream hFile = null;
// OutputStream toClient = null;
// InputStream inputStream = null;
// BufferedInputStream bis = null;
// try {
// response.reset();
// response.setHeader("Expires", "Sat, 10 May 2059 12:00:00 GMT");
// response.setHeader("Cache-Control", "max-age=315360000");
//
// if (StringUtils.isNotBlank(ftpPath)) {
// //根据ftp path 查询 该traffpicture 的imagedata 的值,然后处理返回
//
// ftpPath= traffPictureService.queryimgdataByid(ftpPath);
//
// if (ftpPath.endsWith(".jpg") || ftpPath.endsWith(".JPG") || ftpPath.endsWith(".png") || ftpPath.endsWith(".PNG") || ftpPath.endsWith(".gif") || ftpPath.endsWith(".GIF")) {
// response.setContentType("image/" + ftpPath.substring(ftpPath.lastIndexOf(".") + 1) + "; charset=utf-8");
// } else if (ftpPath.endsWith(".mp4") || ftpPath.endsWith(".MP4")) {
// response.setContentType("video/mpeg4; charset=utf-8");
// String mp4file = ftpPath.substring(ftpPath.lastIndexOf("/") + 1);
// response.setHeader("Content-Disposition", "attachment;fileName=" + mp4file);
// }
//
// String destUrl = ftpPath;
// destUrl = new String(destUrl.getBytes("ISO8859-1"), "GBK");
// String[] arr = destUrl.split(";");
// FtpURLConnection ftpUrl = null;
// HttpURLConnection httpUrl = null;
// for (int i = 0; i < arr.length; i++) {
// try {
// URL url = new URL(arr[i]);
// if (arr[i].toUpperCase().indexOf("FTP") != -1) { // ftp
// ftpUrl = (FtpURLConnection) url.openConnection();
// ftpUrl.setConnectTimeout(5000);
// ftpUrl.setReadTimeout(5000);
// bis = new BufferedInputStream(ftpUrl.getInputStream());
// response.setContentLength(ftpUrl.getContentLength());
// } else { // http
// httpUrl = (HttpURLConnection) url.openConnection();
// httpUrl.setConnectTimeout(5000);
// httpUrl.setReadTimeout(5000);
// bis = new BufferedInputStream(httpUrl.getInputStream());
// response.setContentLength(httpUrl.getContentLength());
// }
// toClient = response.getOutputStream();
// IOUtils.copy(bis, toClient);
// } catch (Exception e) {
// response.setContentType("text/html;charset=GBK");
// response.setCharacterEncoding("GBK");
// PrintWriter out = response.getWriter();
// out.write("无法打开图片!");
// out.flush();
// } finally {
// if (bis != null) {
// bis.close();
// }
// if (bis != null) {
// bis.close();
// }
// if (httpUrl != null) {
// httpUrl.disconnect();
// }
// if (ftpUrl != null) {
// ftpUrl.close();
// }
// if (toClient != null) {
// toClient.close();
// }
// }
// }
// return;
// }
//
// } catch (Exception e) {
// } finally {
// IOUtils.closeQuietly(bis);
// IOUtils.closeQuietly(toClient);
// IOUtils.closeQuietly(hFile);
// IOUtils.closeQuietly(inputStream);
// }
//
// }
//
// @GetMapping("/api/alg/files")
// protected void files(@RequestParam("location") String location, HttpServletRequest request, HttpServletResponse response) {
// long startTime = System.currentTimeMillis();
// //ftp://reader:reader@33.50.1.22:21/
// //ftp.host=33.65.250.179:21:hzjt:1qaz2wsx
// String ftpPath="ftp://"+ftppath+"/"+location;
// FileInputStream hFile = null;
// OutputStream toClient = null;
// InputStream inputStream = null;
// BufferedInputStream bis = null;
// try {
// response.reset();
// response.setHeader("Expires", "Sat, 10 May 2059 12:00:00 GMT");
// response.setHeader("Cache-Control", "max-age=315360000");
//
// if (StringUtils.isNotBlank(ftpPath)) {
// if (ftpPath.endsWith(".jpg") || ftpPath.endsWith(".JPG") || ftpPath.endsWith(".png") || ftpPath.endsWith(".PNG") || ftpPath.endsWith(".gif") || ftpPath.endsWith(".GIF")) {
// response.setContentType("image/" + ftpPath.substring(ftpPath.lastIndexOf(".") + 1) + "; charset=utf-8");
// } else if (ftpPath.endsWith(".mp4") || ftpPath.endsWith(".MP4")) {
// response.setContentType("video/mpeg4; charset=utf-8");
// String mp4file = ftpPath.substring(ftpPath.lastIndexOf("/") + 1);
// response.setHeader("Content-Disposition", "attachment;fileName=" + mp4file);
// }
//
// String destUrl = ftpPath;
// destUrl = new String(destUrl.getBytes("ISO8859-1"), "GBK");
// String[] arr = destUrl.split(";");
// FtpURLConnection ftpUrl = null;
// HttpURLConnection httpUrl = null;
// for (int i = 0; i < arr.length; i++) {
// try {
// URL url = new URL(arr[i]);
// if (arr[i].toUpperCase().indexOf("FTP") != -1) { // ftp
// ftpUrl = (FtpURLConnection) url.openConnection();
// ftpUrl.setConnectTimeout(30000);
// ftpUrl.setReadTimeout(30000);
// bis = new BufferedInputStream(ftpUrl.getInputStream());
// response.setContentLength(ftpUrl.getContentLength());
// } else { // http
// httpUrl = (HttpURLConnection) url.openConnection();
// httpUrl.setConnectTimeout(30000);
// httpUrl.setReadTimeout(30000);
// bis = new BufferedInputStream(httpUrl.getInputStream());
// response.setContentLength(httpUrl.getContentLength());
// }
// toClient = response.getOutputStream();
// IOUtils.copy(bis, toClient);
// } catch (Exception e) {
// response.setContentType("text/html;charset=GBK");
// response.setCharacterEncoding("GBK");
// PrintWriter out = response.getWriter();
// out.write("无法打开图片!");
// out.flush();
// logger.info("ftpagent error:{} ",ftpUrl+e.toString());
// } finally {
// if (bis != null) {
// bis.close();
// }
// if (bis != null) {
// bis.close();
// }
// if (httpUrl != null) {
// httpUrl.disconnect();
// }
// if (ftpUrl != null) {
// ftpUrl.close();
// }
// if (toClient != null) {
// toClient.close();
// }
// }
// }
// return;
// }
//
// } catch (Exception e) {
// } finally {
// IOUtils.closeQuietly(bis);
// IOUtils.closeQuietly(toClient);
// IOUtils.closeQuietly(hFile);
// IOUtils.closeQuietly(inputStream);
// }
//
// }
}
\ No newline at end of file
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;
import com.cx.cn.cxquartz.service.quartz.QuartzService;
import com.cx.cn.cxquartz.service.quartz.SbtdspsrService;
import com.cx.cn.cxquartz.util.*;
import com.cx.cn.cxquartz.vo.*;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/ai")
public class QuartzController {
private static final Logger logger = LoggerFactory.getLogger(QuartzController.class);
@Autowired
private QuartzService quartzService;
@Value("${file.getrtspbyurl}")
private String getrtspbyurl;
@Value("${file.rtspurl}")
private String rtspurl;
@Value("${file.ftppath}")
private String ftppath;
@Autowired
private SbtdspsrService sbtdspsrService;
@Autowired
private RestTemplate restTemplate;
// @Autowired
// FtpService ftpService;
//
// @RequestMapping(value = "/add/taskpage", method = RequestMethod.GET)
// public String addTaskpage() {
// return "addtask";
// }
//
// @ResponseBody
// @RequestMapping(value = "/add/task", method = RequestMethod.POST)
// public String addTask(QuartzTaskInformations taskInformations) {
// try {
// taskInformations.setSchedulerrule("*/" + taskInformations.getSchedulerrule() + " * * * * ?");
// String result = quartzService.addTask(taskInformations);
// return result;
// } catch (Exception e) {
// logger.error("/add/task exception={}", e);
// return ResultUtil.fail();
// }
// }
@PostMapping("/task")
@ResponseBody
public TaskResultObj scheduleJob(@RequestBody JobParam jobParam) {
String taskno="fx_" + 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");
Long[] roiarray=new Long[4];
if ("0".equals(jobParam.getType())) {//0新增 1开启 2停止 3删除
//判断是否存在抽帧任务,存在则直接新增分析任务,不存在则新增
taskInformations.setFrozenstatus("UNFROZEN");
taskInformations.setSchedulerrule("*/" + jobParam.getParams().get("schedulerRule").toString() + " * * * * ?");
List<Point> listpoint=jobParam.getArea();
PointUtil.getXYWH(listpoint,roiarray);
taskInformations.setObjectx(roiarray[0]);
taskInformations.setObjecty(roiarray[1]);
taskInformations.setObjectw(roiarray[2]);
taskInformations.setObjecth(roiarray[3]);
taskInformations.setMetatype( jobParam.getParams().get("thresholdValue").toString());
taskInformations.setUrl(jobParam.getCallBackUrl());
taskInformations.setExecutorno(taskno);
taskInformations.setTaskno(taskInformations.getExecutorno());
taskInformations.setTaskname(jobParam.getName());
taskInformations.setVideoid(jobParam.getDeviceId() );
taskInformations.setRecordtype(jobParam.getDetectType());
String result = quartzService.addTask(taskInformations);
try {
quartzService.startJob(taskno, "UNFROZEN");
}catch (Exception ex){
logger.error(ex.toString());
}
//查询是否有抽帧服务
//if (cznum == 0) {
// taskInformations.setExecutorno("cz_" + jobParam.getDeviceId() + "_" + jobParam.getDetectType());
// taskInformations.setTaskno(taskInformations.getExecutorno());
// quartzService.addTask(taskInformations);
// }
} else if ("1".equals(jobParam.getType()))//开启
{
try {
quartzService.startOrStopJob(taskno,"UNFROZEN");
} catch (Exception ex) {
logger.error(ex.toString());
}
} else if ("2".equals(jobParam.getType()) ) {//停止
//一抽帧多分析,停止不停抽帧服务
try {
quartzService.startOrStopJob(taskno, "FROZEN");
} catch (Exception ex) {
logger.error(ex.toString());
}
} else if ("3".equals(jobParam.getType())) {//删除
//一抽帧多分析,停止不停抽帧服务
try {
quartzService.startOrStopJob(taskno, "FROZEN");
quartzService.deletetask(taskno);
} catch (Exception ex) {
logger.error(ex.toString());
}
//quartzService.("fx_" + jobParam.getDeviceId() + "_" + jobParam.getDetectType(), fxnum);
}
return TaskResultObj.ok();
}
public Map getTaskCzAndFxNumer(List<QuartzTaskInformations> tasks) {
Map<String, Integer> map = new HashMap();
int cznum = 0, fxnum = 0;
if (tasks.size() > 0) {
//一抽多分析
for (QuartzTaskInformations item : tasks) {
if (item.getTaskno().contains("cz")) {
cznum++;
} else if (item.getTaskno().contains("fx")) {
fxnum++;
}
}
}
map.put("cznum", cznum);
map.put("fxnum", fxnum);
return map;
}
//
// @RequestMapping(value = "/edit/taskpage", method = RequestMethod.GET)
// public String editTaskpage(Model model, String id) {
// QuartzTaskInformations taskInformation = quartzService.getTaskById(id);
// taskInformation.setSchedulerrule(taskInformation.getSchedulerrule().replaceAll("\\?", "").replaceAll("\\*", "").replaceAll("\\/", ""));
// model.addAttribute("taskInformation", taskInformation);
// return "updatetask";
// }
//
// @ResponseBody
// @RequestMapping(value = "/edit/task", method = RequestMethod.POST)
// public String editTask(QuartzTaskInformations taskInformations) {
// try {
// taskInformations.setSchedulerrule("*/" + taskInformations.getSchedulerrule() + " * * * * ?");
// String result = quartzService.updateTask(taskInformations);
// if (null != taskInformations.getExecuteparamter() && !taskInformations.getExecuteparamter().contains("rtsp:")) {
// int upresult = sbtdspsrService.updateRecogByRtsp(taskInformations.getRtsp(), taskInformations.getVideoid());
//
// if (upresult > 0) {
// logger.info("更新sbtddspsr squrllj 的值为:" + taskInformations.getExecuteparamter());
// }
// }
// return result;
// } catch (Exception e) {
// logger.error("/edit/task exception={}", e);
// return ResultUtil.fail();
// }
// }
//
// /**
// * 启动 或者 暂定定时任务
// *
// * @param taskNo
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/list/optionjob", method = RequestMethod.GET)
// public String optionJob(String taskNo) {
// logger.info("");
// if (StringUtils.isEmpty(taskNo)) {
// return ResultUtil.success(ResultEnum.PARAM_EMPTY.getCode(), ResultEnum.PARAM_EMPTY.getMessage());
// }
// try {
// return quartzService.startJob(taskNo,null);
// } catch (Exception e) {
// logger.error("/list/optionjob exception={}", e);
// return ResultUtil.fail();
// }
// }
//
// /**
// * 定时任务执行情况
// *
// * @param taskNo
// * @param model
// * @return
// */
// @RequestMapping(value = "/taskrecords", method = RequestMethod.GET)
// public String taskRecordsPage(@RequestParam(value = "taskno", required = false) String taskNo, Model model) {
// logger.info("");
// try {
// if (StringUtils.isEmpty(taskNo)) {
// return "redirect:/";
// }
// List<QuartzTaskRecordsVo> quartzTaskRecords = quartzService.taskRecords(taskNo);
// model.addAttribute("quartzTaskRecords", quartzTaskRecords);
// } catch (Exception e) {
// logger.error("");
// return "redirect:/";
// }
// return "taskrecords";
// }
//
// /**
// * 立即运行一次定时任务
// *
// * @param taskNo
// * @param model
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/runtask/rightnow", method = RequestMethod.GET)
// public String runTaskRightNow(@RequestParam(value = "taskno", required = false) String taskNo, Model model) {
// logger.info("");
// try {
// if (StringUtils.isEmpty(taskNo)) {
// return ResultUtil.success(ResultEnum.PARAM_EMPTY.getCode(), ResultEnum.PARAM_EMPTY.getMessage());
// }
// return quartzService.runTaskRightNow(taskNo);
// } catch (Exception e) {
// logger.error("");
// return ResultUtil.success(ResultEnum.FAIL.getCode(), ResultEnum.FAIL.getMessage());
// }
// }
//
// /**
// * 定时任务失败详情
// *
// * @param recordId
// * @param model
// * @return
// */
// @RequestMapping(value = "/task/errors", method = RequestMethod.GET)
// public String detailTaskErrors(@RequestParam(value = "recordid", required = false) String recordId, Model model) {
// logger.info("");
// try {
// if (StringUtils.isEmpty(recordId)) {
// return ResultUtil.success(ResultEnum.PARAM_EMPTY.getCode(), ResultEnum.PARAM_EMPTY.getMessage());
// }
// QuartzTaskErrors taskErrors = quartzService.detailTaskErrors(recordId);
// model.addAttribute("taskErrors", taskErrors);
// return "taskerrors";
// } catch (Exception e) {
// logger.error("");
// return "redirect:/";
// }
// }
// @RequestMapping(value = "/getRtsp", method = RequestMethod.POST)
// @ResponseBody
// public String getRTSP(@RequestBody JSONObject devicecode) {
// //判断rtsp 是否过期http://212.129.142.17:8281/gh/device/test?deviceCode=3YSCA44445TFCPX
// //判断是否是rtsp 地址
// String rtspValue = devicecode.getString("data");
// if (!rtspValue.contains("rtsp://")) {
// Map<String, String> map = new HashMap<>();
// map.put("deviceCode", rtspValue);
// 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 地址,更新 sbtdspsr 地址
// json = JSONObject.parseObject(json.getString("data"));
// rtspValue = String.valueOf(json.get("rtspUri"));
// }
// }
//
// //获得抽帧图片
// Map maps = new HashMap<>();
// maps.put("rtspvalue", rtspValue);
// maps.put("refresh", 1);
// try {
// ResponseEntity<String> result = restTemplate.exchange(rtspurl + "?url={rtspvalue}&refresh={refresh}",
// HttpMethod.GET, null, String.class, maps);
// JSONObject jsonresult = JSONObject.parseObject(result.getBody());
// logger.info("getRtsp:{}", jsonresult);
// if (null != jsonresult.getString("ret") && jsonresult.getString("ret").equals("0") && !"".equals(jsonresult.getString("url"))) {
// //获得图片地址,存放到ftp上面
// //将图片存储到ftp 上去,jsonresult.getString("url")
// Ftp ftp = ftpService.reloadFtp();
// String ftpfilepath = FileTransferManager.urlTransToFtp(jsonresult.getString("url"), ftp, "gstraff/picturedemo/");
// logger.info("ftppath" + ftpfilepath);
// ftpfilepath = ftpfilepath.replace("ftp://" + ftppath + "/", "");
// // return ResultUtil.success(ResultEnum.SUCCESS.getCode(), jsonresult.getString("url")+ "," + rtspValue);
//
// return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ftpfilepath + "," + rtspValue);
// }
// return ResultUtil.fail();
// } catch (Exception ex) {
// logger.info(ex.toString());
// return ResultUtil.fail();
// }
// }
}
package com.cx.cn.cxquartz.controller;
import com.cx.cn.cxquartz.bean.QuartzTaskErrors;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.service.quartz.QuartzService;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskRecordsService;
import com.cx.cn.cxquartz.service.quartz.SbtdspsrService;
import com.cx.cn.cxquartz.util.ResultEnum;
import com.cx.cn.cxquartz.util.ResultUtil;
import com.cx.cn.cxquartz.vo.QuartzTaskRecordsVo;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping("/video")
public class SbtdspsrController {
private static final Logger logger = LoggerFactory.getLogger(SbtdspsrController.class);
@Autowired
private SbtdspsrService sbtdspsrService;
//
// @RequestMapping(value = "/getSbtdspsrbyrtsp", method = RequestMethod.GET)
// public String addTaskpage() {
// return "addtask";
// }
// @RequestMapping(value = "/list", method = RequestMethod.GET)
// @ResponseBody
// public List<Sbtdspsr> list() {
// return sbtdspsrService.list();
//
// }
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.Code;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Mapper
public interface CodeMapper {
Code selectalarmNum(String keyid);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.Face;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Mapper
public interface FaceMapper {
int insertFace(Face face);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.Pedestrian;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Mapper
public interface PedestrianMapper {
int insertpedestrian(Pedestrian pedestrian);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.PeopleRideBicyc;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Mapper
public interface PeopleridebicycMapper {
int insertPeopleRideBicyc( PeopleRideBicyc peopleridebicyc);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.bean.QuartzTaskErrors;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface QuartzTaskErrorsMapper {
int deleteByPrimaryKey(Long id);
int insert(QuartzTaskErrors record);
int insertSelective(QuartzTaskErrors record);
QuartzTaskErrors selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(QuartzTaskErrors record);
int updateByPrimaryKeyWithBLOBs(QuartzTaskErrors record);
int updateByPrimaryKey(QuartzTaskErrors record);
QuartzTaskErrors detailTaskErrors(String recordId);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.bean.PatrolCtrlAlarm;
import com.cx.cn.cxquartz.bean.PatrolCtrlRecord;
import com.cx.cn.cxquartz.bean.PictureTime;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface QuartzTaskInformationsMapper {
int deleteByPrimaryKey(Long id);
int insert(QuartzTaskInformations record);
int insertSelective(QuartzTaskInformations record);
QuartzTaskInformations selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(QuartzTaskInformations record);
int updateByPrimaryKey(QuartzTaskInformations record);
List<QuartzTaskInformations> selectList(Map<String, Object> map);
Integer selectByTaskNo(String taskNo);
QuartzTaskInformations getTaskByTaskNo(String taskNo);
List<QuartzTaskInformations> getUnfrozenTasks(String status);
int insertRecord(PatrolCtrlRecord record);
int insertAlarm(PatrolCtrlAlarm alarm);
List<PictureTime> findLastPicTime();
List< PatrolCtrlRecord> queryCameraCode(List<String> ids);
List<Sbtdspsr> selectByRtsp(String rtsp);
Integer UpdateExecuteParam(Map map);
List<QuartzTaskInformations> getTaskSByDeviceCode(String devicecode);
Integer deletetask(String tasKno);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.bean.QuartzTaskRecords;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface QuartzTaskRecordsMapper {
int deleteByPrimaryKey(Long id);
long insert(QuartzTaskRecords record);
int insertSelective(QuartzTaskRecords record);
QuartzTaskRecords selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(QuartzTaskRecords record);
int updateByPrimaryKey(QuartzTaskRecords record);
List<QuartzTaskRecords> getTaskRecordsByTaskNo(String taskNo);
}
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface SbtdspsrMapper {
List<Sbtdspsr> selectByRtsp( String rtsp);
List<Sbtdspsr> list( );
List<QuartzTaskInformations> selectRecogByRtsp(String rtsp);
int updateRecogByRtsp(Map map);
}
package com.cx.cn.cxquartz.dao; package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.Storageserver;
import com.cx.cn.cxquartz.vo.TraffrecordData;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface StorageServerMapper { public interface TaskMapper {
List<TraffrecordData> list();
List<Storageserver> queryStorageServerAll(Storageserver storageServer); int update(Integer id);
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.TraffAlarmRecord;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import java.util.List;
import java.util.Map;
@Mapper
public interface TraffAlarmRecordMapper {
int inserTraffAlarmRecord(TraffAlarmRecord traffalarmrecord);
int selectmax();
int updateTraffAlarmRecordUrl(TraffAlarmRecord traffalarmrecord);
List<TraffAlarmRecord> getTraffAlarmRecordByProgress(Map<String, Object> map);
int updateTraffAlarmRecordProcess(TraffAlarmRecord traffalarmrecord);
}
\ No newline at end of file
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.TraffpictureParam;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TraffPictureMapper {
int inserTraffpicture(TraffpictureParam traffalarmrecord);
int updateTraffpicture(TraffpictureParam traffalarmrecord);
String queryimgpath(TraffpictureParam traffpicture);
String queryimgdataByid(String id);
int updateTraffpicturePushStatus(TraffpictureParam traffpicture );
}
\ No newline at end of file
package com.cx.cn.cxquartz.dao;
import com.cx.cn.cxquartz.vo.Traffic;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wjj
* @since 2021-04-29
*/@Mapper
public interface TrafficMapper {
int insertTraffic(Traffic traffic);
}
package com.cx.cn.cxquartz.job;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.service.quartz.QuartzService;
import com.cx.cn.cxquartz.util.CommonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.concurrent.atomic.AtomicInteger;
@Component
public class KafkaListener {
@Autowired
private QuartzService quartzService;
private static final Logger logger = LoggerFactory.getLogger(KafkaListener.class);
private AtomicInteger atomicInteger;
public void messageConsumerHandler(String content) {
logger.info("监听到消息:{}", content);
atomicInteger = new AtomicInteger(0);
String id = "";
String taskNo = "";
try {
// message格式 ---------> taskNo:id:executeParameter;
String[] split = ":".split(content);
id = split[1];
taskNo = split[0];
//TODO kafka逻辑
} catch (Exception ex) {
logger.error("");
atomicInteger.incrementAndGet();
quartzService.addTaskErrorRecord(id, taskNo + ":" + ex.getMessage(), CommonUtil.getExceptionDetail(ex));
}
quartzService.updateRecordById(atomicInteger.get(), Long.parseLong(id));
QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations();
quartzTaskInformation.setId(Long.parseLong(id));
quartzTaskInformation.setLastmodifytime(System.currentTimeMillis());
quartzService.updateTask(quartzTaskInformation);
}
}
package com.cx.cn.cxquartz.job;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.bean.QuartzTaskRecords;
import com.cx.cn.cxquartz.service.quartz.QuartzService;
import com.cx.cn.cxquartz.service.quartz.impl.QuartzServiceImpl;
import com.cx.cn.cxquartz.util.ApplicationContextHolder;
import com.cx.cn.cxquartz.util.CommonUtil;
import com.cx.cn.cxquartz.util.HttpClientUtil;
import com.cx.cn.cxquartz.util.ResultEnum;
import org.apache.commons.lang.StringUtils;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import java.util.concurrent.atomic.AtomicInteger;
@DisallowConcurrentExecution
public class QuartzMainJobFactory implements Job {
private static Logger logger = LoggerFactory.getLogger(QuartzMainJobFactory.class);
private AtomicInteger atomicInteger;
@Value("${local.czurl}")
private String czurl;
@Value("${local.fxurl}")
private String fxurl;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
atomicInteger = new AtomicInteger(0);
JobDataMap jobDataMap = jobExecutionContext.getMergedJobDataMap();
String id = jobDataMap.getString("id");
String taskNo = jobDataMap.getString("taskNo");
String executorNo = jobDataMap.getString("executorNo");
String url = jobDataMap.getString("url");
String executeParameter = jobDataMap.getString("executeParameter");
logger.info("定时任务被执行:taskNo={},executorNo={},url={},executeParameter={}", taskNo, executorNo, url, executeParameter);
QuartzService quartzService = (QuartzServiceImpl) ApplicationContextHolder.getBean("quartzServiceImpl");
QuartzTaskRecords records = null;
try {
//保存定时任务的执行记录
records = quartzService.addTaskRecords(taskNo);
if (null == records || !ResultEnum.INIT.name().equals(records.getTaskstatus())) {
logger.info("taskNo={}保存执行记录失败", taskNo);
return;
}
//if (ResultEnum.HTTP.getMessage().equals(sendType)) {
try {
String result = HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", taskNo);
logger.info("taskNo={},执行结果result{}", taskNo, result);
if (StringUtils.isEmpty(result)) {
throw new RuntimeException("taskNo=" + taskNo + "http方式返回null");
}
} catch (Exception ex) {
logger.error("");
throw ex;
}
// } else if (ResultEnum.KAFKA.getMessage().equals(sendType)) {
// try {
// String message = new StringBuffer(taskNo).append(":").append(id).append(":").append(executeParameter).toString();
// quartzService.sendMessage(message);
// logger.info("taskNo={},sendtype={}推送至kafka成功", taskNo, sendType);
// } catch (Exception ex) {
// logger.error("");
// throw ex;
// }
// }
} catch (Exception ex) {
String exception=CommonUtil.getExceptionDetail(ex);
logger.error(exception);
atomicInteger.incrementAndGet();
quartzService.addTaskErrorRecord(records.getId().toString(), taskNo + ":" + ex.getMessage(), exception);
}
// quartzService.updateRecordById(atomicInteger.get(), records.getId());
//QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations();
//quartzTaskInformation.setId(Long.parseLong(id));
//quartzTaskInformation.setLastmodifytime(System.currentTimeMillis());
//quartzService.updateTask(quartzTaskInformation);
}
}
package com.cx.cn.cxquartz.job;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@Component
@ServerEndpoint("/websocket/{name}")
public class WebSocket {
/**
* 与某个客户端的连接对话,需要通过它来给客户端发送消息
*/
private Session session;
/**
* 标识当前连接客户端的用户名
*/
private String name;
/**
* 用于存所有的连接服务的客户端,这个对象存储是安全的
*/
private static ConcurrentHashMap<String, WebSocket> webSocketSet = new ConcurrentHashMap<>();
@OnOpen
public void OnOpen(Session session, @PathParam(value = "name") String name) {
this.session = session;
this.name = name;
// name是用来表示唯一客户端,如果需要指定发送,需要指定发送通过name来区分
webSocketSet.put(name, this);
}
@OnClose
public void OnClose() {
webSocketSet.remove(this.name);
}
@OnError
public void OnError(@PathParam("name") String name, Throwable throwable, Session session) {
webSocketSet.remove(name);
}
@OnMessage
public void OnMessage(String message) {
//判断是否需要指定发送,具体规则自定义
if(message.indexOf("HEARTBEAT")>=0){
Map map=new HashMap();
map.put("type","HEARTBEAT");
map.put("ts",new Date().getTime());
AppointSending(name, JSONObject.toJSONString(map));
}
}
/**
* 群发
*
* @param message
*/
public static void GroupSending(String message) {
for (String name : webSocketSet.keySet()) {
try {
if (null != webSocketSet.get(name) && null != webSocketSet.get(name).session && null != webSocketSet.get(name).session.getBasicRemote())
webSocketSet.get(name).session.getBasicRemote().sendText(message);
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 指定发送
*
* @param name
* @param message
*/
public void AppointSending(String name, String message) {
if (null != webSocketSet.get(name) && null != webSocketSet.get(name).session && null != webSocketSet.get(name).session.getBasicRemote()) {
synchronized (webSocketSet.get(name).session) {
try {
webSocketSet.get(name).session.getBasicRemote().sendText(message);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.dao.StorageServerMapper;
import com.cx.cn.cxquartz.vo.Storageserver;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.concurrent.TimeUnit;
@Service
public class CacheLoadService {
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Value("${redis.cachekey.ftplist}")
private String ftplistkey;
@Autowired
private StorageServerMapper storageServerMapper;
public boolean loadFtpCache() {
try {
Storageserver server = new Storageserver();
server.setServerstatus(0);//�����õ�
server.setServertype("ftp");
List<Storageserver> storageServers = storageServerMapper.queryStorageServerAll(server);
if (!storageServers.isEmpty() && storageServers.size() > 0) {
stringRedisTemplate.opsForValue().set(ftplistkey, new Gson().toJson(storageServers),60, TimeUnit.SECONDS);
} else {
System.out.println("storageServers.isEmpty");
}
return true;
} catch (Exception e) {
System.out.println(e.toString());
return false;
}
}
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.Code;
/**
* <p>
* 服务类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public interface CodeService {
Code selectalarmNum(String keyid);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.bean.PatrolCtrlAlarm;
import com.cx.cn.cxquartz.bean.PatrolCtrlRecord;
import com.cx.cn.cxquartz.bean.*;
public interface ExtService {
int insertRecord(PatrolCtrlRecord record);
int insertAlarm(PatrolCtrlAlarm alarm);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.Face;
/**
* <p>
* 服务类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public interface FaceService {
int insertFace(Face face);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.util.RedisEnum;
import com.cx.cn.cxquartz.vo.Ftp;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class FtpService {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private static final Logger logger = LoggerFactory.getLogger(FtpService.class);
@Autowired
private StringRedisTemplate stringRedisTemplate;
private List<Ftp> ftpList;
@Autowired
CacheLoadService cacheLoadService;
@Autowired
public FtpService(StringRedisTemplate stringRedisTemplate) {
// try {
// this.ftpList = getFtpList(stringRedisTemplate.opsForValue().get(RedisEnum.FTPLIST.getValue()));
// }catch (Exception e){
// logger.error("ftpList error:"+e.toString());
// }
}
public Ftp reloadFtp() {
try {
// cacheLoadService.loadFtpCache();
if(null==stringRedisTemplate.opsForValue().get(RedisEnum.FTPLIST.getValue())){
cacheLoadService.loadFtpCache();
}
ftpList = getFtpList(stringRedisTemplate.opsForValue().get(RedisEnum.FTPLIST.getValue()));
}catch (Exception e){
logger.error("ftpListerror:"+e.toString());
}
Long count = null;
try {
count = stringRedisTemplate.opsForValue().increment(RedisEnum.FTPLIST_INDEX.getValue(), 1L);
} catch (Exception e) {
logger.error("redis error" + e.toString());
}
if (count == null) {
count = 0L;
}
long index = count % ftpList.size();
return ftpList.get((int) index);
}
private List<Ftp> getFtpList(String ftpJson) {
try {
JavaType javaType =OBJECT_MAPPER.getTypeFactory().constructParametricType(ArrayList.class, Map.class);
List<Map> jsonArr = OBJECT_MAPPER.readValue(ftpJson, javaType);
List<Ftp> ftpList = new ArrayList<>();
for (int i = 0; i < jsonArr.size(); i++) {
Ftp ftp = new Ftp();
Map jsonObject = jsonArr.get(i);
ftp.setFtpIp(jsonObject.get("serveip").toString());
ftp.setFtpPort(Integer.parseInt(jsonObject.get("serverport")==null?"21":jsonObject.get("serverport").toString()));
ftp.setFtpUsername(jsonObject.get("serveruser").toString());
ftp.setFtpPassword(jsonObject.get("serverpassword").toString());
ftpList.add(ftp);
}
}catch (Exception ex){
logger.error("ftpListerror:"+ex.toString());
}
return ftpList;
}
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.Pedestrian;
/**
* <p>
* 服务类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public interface PedestrianService {
int insertpedestrian(Pedestrian pedestrian);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.PeopleRideBicyc;
/**
* <p>
* 服务类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public interface PeopleridebicycService {
int insertPeopleRideBicyc( PeopleRideBicyc peopleridebicyc);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.bean.*;
import com.cx.cn.cxquartz.vo.QuartzTaskRecordsVo;
import org.quartz.SchedulerException;
import java.util.List;
import java.util.Map;
public interface QuartzService {
String addTask(QuartzTaskInformations quartzTaskInformations);
List<QuartzTaskInformations> getTaskList(String taskNo, String currentPage);
QuartzTaskInformations getTaskById(String id);
String updateTask(QuartzTaskInformations quartzTaskInformations);
Integer UpdateExecuteParam(Map map);
String startJob(String taskNo,String status) throws SchedulerException;
String startOrStopJob(String taskNo,String status) throws SchedulerException;
void initLoadOnlineTasks();
void sendMessage(String message);
QuartzTaskRecords addTaskRecords(String taskNo);
Integer updateRecordById(Integer count, Long id);
Integer updateModifyTimeById(QuartzTaskInformations quartzTaskInformations);
Integer addTaskErrorRecord(String id, String errorKey, String errorValue);
List<QuartzTaskRecordsVo> taskRecords(String taskNo);
String runTaskRightNow(String taskNo);
QuartzTaskErrors detailTaskErrors(String recordId);
Integer insertRecord(PatrolCtrlRecord record);
Integer insertAlarm(PatrolCtrlAlarm alarm);
List<PictureTime> findLastPicTime();
List< PatrolCtrlRecord> queryCameraCode(List<String> ids);
List<QuartzTaskInformations> getTaskSByDeviceCode(String devicecode);
Integer deletetask(String taskno);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.bean.QuartzTaskErrors;
public interface QuartzTaskErrorsService {
Integer addTaskErrorRecord(QuartzTaskErrors quartzTaskErrors);
QuartzTaskErrors detailTaskErrors(String recordId);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.bean.PatrolCtrlAlarm;
import com.cx.cn.cxquartz.bean.PatrolCtrlRecord;
import com.cx.cn.cxquartz.bean.PictureTime;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import java.util.List;
import java.util.Map;
public interface QuartzTaskInformationsService {
String insert(QuartzTaskInformations quartzTaskInformations);
List<QuartzTaskInformations> selectList(String taskNo, String currentPage);
QuartzTaskInformations getTaskById(String id);
String updateTask(QuartzTaskInformations quartzTaskInformations);
Integer UpdateExecuteParam(Map map);
QuartzTaskInformations getTaskByTaskNo(String taskNo);
Integer updateStatusById(QuartzTaskInformations quartzTaskInformations);
List<QuartzTaskInformations> getUnnfrozenTasks(String status);
Integer updateModifyTimeById(QuartzTaskInformations quartzTaskInformations);
Integer insertRecord(PatrolCtrlRecord record);
Integer insertAlarm(PatrolCtrlAlarm alarm);
List<PictureTime> findLastPicTime();
List< PatrolCtrlRecord> queryCameraCode(List<String> ids);
List<QuartzTaskInformations> getTaskSByDeviceCode(String devicecode);
Integer deletetask(String taskno);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.bean.QuartzTaskRecords;
import java.util.List;
public interface QuartzTaskRecordsService {
long addTaskRecords(QuartzTaskRecords quartzTaskRecords);
Integer updateTaskRecords(QuartzTaskRecords quartzTaskRecords);
List<QuartzTaskRecords> listTaskRecordsByTaskNo(String taskNo);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import java.util.List;
import java.util.Map;
public interface SbtdspsrService {
List<Sbtdspsr> selectByRtsp(String videoid);
List<QuartzTaskInformations> selectRecogByRtsp(String rtsp);
int updateRecogByRtsp(String rtsp,String devicecode);
List<Sbtdspsr> list();
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.TraffrecordData;
import java.util.List;
public interface TaskService {
List<TraffrecordData> list();
int update(Integer id );
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.TraffAlarmRecord;
import java.util.List;
import java.util.Map;
public interface TraffAlarmRecordService {
int inserTraffAlarmRecord(TraffAlarmRecord traffalarmrecord);
int selectmax();
int updateTraffAlarmRecordUrl(TraffAlarmRecord record);
int updateTraffAlarmRecordProcess(TraffAlarmRecord recordid);
List<TraffAlarmRecord> getTraffAlarmRecordByProgress(Map<String, Object> map);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.TraffpictureParam;
public interface TraffPictureService {
int inserTraffpicture( TraffpictureParam traffpicture);
int updateTraffpicture( TraffpictureParam traffpicture);
String queryimgpath(TraffpictureParam traffpicture);
String queryimgdataByid(String id);
}
package com.cx.cn.cxquartz.service.quartz;
import com.cx.cn.cxquartz.vo.Traffic;
/**
* <p>
* 服务类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public interface TrafficService {
int insertTraffic(Traffic traffic);
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.CodeMapper;
import com.cx.cn.cxquartz.service.quartz.CodeService;
import com.cx.cn.cxquartz.vo.Code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service
public class CodeServiceImpl implements CodeService {
@Autowired
private CodeMapper codeMapper;
@Override
public Code selectalarmNum(String keyid) {
return codeMapper.selectalarmNum(keyid);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.TraffPictureMapper;
import com.cx.cn.cxquartz.service.quartz.FtpService;
import com.cx.cn.cxquartz.service.quartz.TraffPictureService;
import com.cx.cn.cxquartz.util.*;
import com.cx.cn.cxquartz.vo.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.quartz.JobKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import sun.misc.BASE64Encoder;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
/**
* <p>
* 服务类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service
public class EventWriteService {
private static final Logger log = LoggerFactory.getLogger(EventWriteService.class);
@Autowired
private RestTemplate restTemplate;
@Autowired
private TraffPictureMapper traffPictureMapper;
@Value("${countryside.eventwrite.url}")
private String url;
@Value("${voice.url}")
private String voiceurl;
@Value("${countryside.eventwrite.timeout}")
private Integer timeout;
@Value("${countryside.eventwrite.token}")
private String qztoken;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
TraffPictureService traffPictureService;
@Autowired
TokenCacheService tokensertvice;
@Autowired
FtpService ftpService;
@Value("${local.czurl}")
private String czurl;
@Value("${local.fxurl}")
private String fxurl;
@Value("${file.rootpath}")
private String filerootpath;
@Value("${file.outpath}")
private String outpath;
@Value("${file.uploadurl}")
private String uploadurl;
private static CompletionService<Boolean> completionService = new ExecutorCompletionService<Boolean>(ThreadPoolUtil.getPool());
public void sendEvent(TraffpictureParam traffpictureParamresult, TraffrecordData sendtozhiui) {
sendtozhiui.setAlarmnum(traffpictureParamresult.getTargetnum());
sendtozhiui.setFdid(traffpictureParamresult.getFdid());
sendtozhiui.setRecordtype(traffpictureParamresult.getRecordtype());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sendtozhiui.setRecordtime(traffpictureParamresult.getCreatetime() == null ? "" : format.format(traffpictureParamresult.getCreatetime()));
ResultObj resultObj;
try {
resultObj = sendMessage(sendtozhiui);
traffpictureParamresult.setPushdesc(resultObj.getMsg());
/* 成功 */
if ("0".equals(resultObj.getCode())) {
traffpictureParamresult.setPushstatus(0);
traffpictureParamresult.setPushdesc("推送成功");
traffPictureMapper.updateTraffpicturePushStatus(traffpictureParamresult);
return;
}
/* 其他失败 */
} catch (TimeoutException e) {
traffpictureParamresult.setPushdesc("请求超时");
log.error("eventwrite - sendEvent 请求超时:" + e.toString());
//return ResultObj.error(ResponseEnum.E_1008.getCode(), ResponseEnum.E_1008.getMsg());
} catch (Exception e) {
traffpictureParamresult.setPushdesc("请求失败");
log.error("eventwrite - sendEvent 异常:" + e.toString());
//return ResultObj.error(ResponseEnum.E_9999.getCode(), e.toString());
}
traffpictureParamresult.setPushstatus(-1);
traffPictureMapper.updateTraffpicturePushStatus(traffpictureParamresult);
}
public void sendVoice(VoiceData voice) {
VoiceResultObj result;
try {
result = sendVoioceMessage(voice);
/* 成功 */
if (result.getCode() == 1) {
log.info(" push to voice success");
} else {
log.info(" push to voice result", new ObjectMapper().writeValueAsString(result));
}
} catch (TimeoutException e) {
log.error("push to voice 请求超时:" + e.toString());
} catch (Exception e) {
log.error("push to voice 异常:" + e.toString());
}
}
private ResultObj sendMessage(TraffrecordData traffalarmrecord) throws InterruptedException, ExecutionException, TimeoutException {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
String token = stringRedisTemplate.opsForValue().get(qztoken);
if (null == token) {
token = tokensertvice.keepAlive();
}
headers.add("accessToken", token);
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 {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
HttpEntity<JobTjParam> requestEntity = new HttpEntity<>(jobTjParam, headers);
return CompletableFuture.supplyAsync(() -> restTemplate.postForObject(callbackurl, requestEntity, ResultObj.class)).get(timeout, TimeUnit.SECONDS);
}
public void sendEventByCallUrl(TraffpictureParam traffpictureParamresult, JobTjParam jobTjParam, String callbackurl) {
ResultObj resultObj;
try {
resultObj= sendToCalluri(jobTjParam,callbackurl);
// boolean successFlag = resultObj.getCode() == ResponseEnum.SUCCESS.getCode();
traffpictureParamresult.setPushdesc(resultObj.getMsg());
/* 成功 */
if ("0".equals(resultObj.getCode())) {
traffpictureParamresult.setPushstatus(0);
//traffpictureParamresult.setPushdesc("推送第三方成功");
traffPictureMapper.updateTraffpicturePushStatus(traffpictureParamresult);
return;
}
/* 其他失败 */
} catch (Exception e) {
traffpictureParamresult.setPushdesc("推送第三方失败");
log.error("eventwrite - sendEventByCallUrl 异常:" + e.toString());
//return ResultObj.error(ResponseEnum.E_9999.getCode(), e.toString());
}
traffpictureParamresult.setPushstatus(-1);
traffPictureMapper.updateTraffpicturePushStatus(traffpictureParamresult);
}
private VoiceResultObj sendVoioceMessage(VoiceData voiceData) throws InterruptedException, ExecutionException, TimeoutException {
HttpHeaders headers = new HttpHeaders();
HttpEntity<VoiceData> requestEntity = new HttpEntity<>(voiceData, headers);
return CompletableFuture.supplyAsync(() -> restTemplate.postForObject(voiceurl, requestEntity, VoiceResultObj.class)).get(timeout, TimeUnit.SECONDS);
}
public String sendToService(JobKey jobKey, String jsondata) {
try {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
HttpEntity<String> requestEntity = new HttpEntity<>(jsondata, headers);
return CompletableFuture.supplyAsync(() -> restTemplate.postForObject(jobKey.getName().contains("cz_") ? czurl : fxurl, requestEntity, String.class)).get(timeout, TimeUnit.SECONDS);
} catch (Exception ex) {
log.info("getRtspJob->executeInternal error:{}", ex.toString());
return null;
}
}
public TraffpictureParam getResult(int tarnum, Long[] roiarray, String imgurl,
List<Map> objectList,
JobTjParam jobTjParam, List<Map> detectObjects) {
Map obj = new HashMap();
String recordtype = jobTjParam.getDetectType();
//判断是否统计结构化数据
TraffpictureParam traffpictureParamresult = new TraffpictureParam();
traffpictureParamresult.setImagedata(imgurl);
//人群统计
if ("10".equals(recordtype)) {
int larmnum = getManNumber(objectList);
//获得所有对象的坐标
if (tarnum < larmnum) {
traffpictureParamresult.setTargetnum(larmnum);
obj.put("objectCount", larmnum);
} else {
return null;
}
}
//获得所有对象的坐标
for (Map traffpictureParam : objectList) {
//根据imageid 获得 base64图片
Map metadata = (Map) traffpictureParam.get("Metadata");
// String metatype = String.valueOf(metadata.get("Type"));
//获得点位坐标
Map objlocation = getObjectPoint(metadata, roiarray, traffpictureParamresult, recordtype);
if (null == objlocation) {
log.info("点位未空");
continue;
}
//获得特征属性
getDetectInfo(recordtype, metadata, objlocation);
//根据对应的解析结果获得相应的数据,存放到对应的表中
List<Location> list = new ArrayList<>();
//getMetaData( roiarray, traffpictureParamresult,list,traffpictureParam,metadata);
detectObjects.add(objlocation);
}
if (detectObjects.size() == 0) {
log.info(" 特征对象为空 ");
return null;
}
//获得其他告警事件的返回结果
//超过则预警
obj.put("detectObjects", detectObjects);
jobTjParam.setDetectInfo(obj);
jobTjParam.setTimestamp(new Date().getTime());
return traffpictureParamresult;
}
public void setTraffpictureParam(String recordtype, String sbbh, String createtime,
TraffpictureParam traffpictureParam) {
traffpictureParam.setAreaid(Long.parseLong("-1"));
traffpictureParam.setFdid(sbbh);
//traffpictureParam.setRecordid(transferRecord.getRecordid());
traffpictureParam.setChannelid(0);
if (createtime.contains(".")) {
traffpictureParam.setCreatetime(createtime.split("\\.")[0]);
} else {
traffpictureParam.setCreatetime(createtime);
}
traffpictureParam.setRecordtype(recordtype);
//新增到picture
traffPictureService.inserTraffpicture(traffpictureParam);
}
public List<Map> getLocation(List<Map> objectList, String recordtype, Long[] roiarray) {
for (Map traffpictureParam : objectList) {
//根据imageid 获得 base64图片
Map metadata = (Map) traffpictureParam.get("Metadata");
Map objectBoundingBox = (Map) metadata.get("ObjectBoundingBox");
String metatype = String.valueOf(metadata.get("Type"));
Map objlocation = new HashMap();
//获得物体特征值,只能有一个框框
}
return null;
}
public int getManNumber(List<Map> objectList) {
int objsize = 0;
for (Map traffpictureParam : objectList) {
//根据imageid 获得 base64图片
Map metadata = (Map) traffpictureParam.get("Metadata");
String metadatatyp = metadata.get("Type").toString();
if ("1".equals(metadatatyp) || "4".equals(metadatatyp)
|| "3".equals(metadatatyp)) {
//返回结果是人相关的
objsize++;
}
}
return objsize;
}
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 {
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")) {
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()
);
} 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());
}
}
}
}
}
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());
} else if ("41".equals(recordtype)) {
//汽车
if ("2".equals(metatype)) {
objlocation.put("carNo", String.valueOf(metadata.get("PlateNo")));
objlocation.put("carBrand", String.valueOf(metadata.get("carBrand")));
}
} else if ("42".equals(recordtype)) {
//非机动车
if ("4".equals(metatype)) {
objlocation.put("bikeClassType", String.valueOf(metadata.get("BikeClass")));
}
} else if ("43".equals(recordtype)) {
if ("4".equals(metatype)) {
int helmet = Integer.parseInt(metadata.get("Helmet").toString());
//非机动车未戴头盔
if (helmet == 0) {
objlocation.put("helmet", helmet);
}
}
}
}
public void uploadPicture(Long[] roi,String url, List<Map> points, String basepath, String filename) {
try {
completionService.submit(() -> {
InputStream streanm = RestUtil.ReadFromURL(url);
ByteArrayOutputStream bos = PointUtil.drawByPoints(streanm, points,roi);
if (null == bos) {
log.error("picture is null");
return false;
}
File file= FileUtil.uploadToLocal(filerootpath+File.separator+
outpath+File.separator+
basepath,bos,filename);
// HttpHeaders headers = new HttpHeaders();
// headers.add("Accept", MediaType.ALL_VALUE);
// // headers.setContentType(MediaType.parseMediaType("multipart/form-data"));
// MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();
//
// org.springframework.core.io.Resource resource = new ByteArrayResource(bos.toByteArray()){
// @Override
// public String getFilename () {
// return filename;
// }
// } ;
//
// ByteArrayResource arrayResource = new ByteArrayResource(bos.toByteArray()) {
// @Override
// public String getFilename() throws IllegalStateException {
// return filename;
// }
// @Override
// public long contentLength() {
// int estimate = bos.size();
// return estimate == 0 ? 1 : estimate;
// }
//
// };
// parts.add(basepath+File.separator+filename, resource);
// parts.add("name", basepath);
// parts.add("filename", filename);
// parts.add("folder", "1");
// headers.setContentType(MediaType.MULTIPART_FORM_DATA);
// HttpEntity<MultiValueMap<String, Object>> files = new HttpEntity<>(parts, headers);
// if(null!=file){
// parts.add("file", new FileSystemResource(file));
// }
//traffpictureParam.setImagedata(basepath+File.separator+filename);
// traffPictureService.updateTraffpicture(traffpictureParam);
// FileUploadResultVo resultVo=new FileUploadResultVo();
//resultVo = restTemplate.postForObject(uploadurl, files, FileUploadResultVo.class);
//restTemplate.put(uploadurl, files);
//删除
// if (file.delete()) {
// log.info("delete file success");
// }
// if(resultVo.getCode()==200){
// //更新地址
// if(resultVo.getData().size()>0) {
// traffpictureParam.setImagedata(resultVo.getData().get(0).getLocaluri());
// traffPictureService.updateTraffpicture(traffpictureParam);
// }
// return true;
// }
return true;
}).get(timeout, TimeUnit.SECONDS);
} catch (Exception ex) {
log.error(" uplaod file:{}", ex.toString());
}
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.bean.PatrolCtrlAlarm;
import com.cx.cn.cxquartz.bean.PatrolCtrlRecord;
import com.cx.cn.cxquartz.service.quartz.ExtService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ExtServiceImpl implements ExtService {
private static final Logger logger = LoggerFactory.getLogger(ExtServiceImpl.class);
@Autowired
private ExtService extService;
@Override
public int insertAlarm(PatrolCtrlAlarm alarm) {
int result = extService.insertAlarm(alarm);
return result;
}
/**
* 新增图片
*
* @param record
* @returnString
*/
@Override
public int insertRecord(PatrolCtrlRecord record) {
int result = extService.insertRecord(record);
return result;
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.FaceMapper;
import com.cx.cn.cxquartz.service.quartz.FaceService;
import com.cx.cn.cxquartz.vo.Face;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service
public class FaceServiceImpl implements FaceService {
@Autowired
private FaceMapper faceMapper;
@Override
public int insertFace(Face face) {
return faceMapper.insertFace(face);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.PedestrianMapper;
import com.cx.cn.cxquartz.service.quartz.PedestrianService;
import com.cx.cn.cxquartz.vo.Pedestrian;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service
public class PedestrianServiceImpl implements PedestrianService {
@Autowired
private PedestrianMapper pedestrianMapper;
@Override
public int insertpedestrian(Pedestrian pedestrian) {
return pedestrianMapper.insertpedestrian(pedestrian);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.PeopleridebicycMapper;
import com.cx.cn.cxquartz.service.quartz.PeopleridebicycService;
import com.cx.cn.cxquartz.vo.PeopleRideBicyc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service
public class PeopleridebicycServiceImpl implements PeopleridebicycService {
@Autowired
private PeopleridebicycMapper peopleridebicycMapper;
@Override
public int insertPeopleRideBicyc(PeopleRideBicyc peopleridebicyc) {
return peopleridebicycMapper.insertPeopleRideBicyc( peopleridebicyc);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.bean.*;
import com.cx.cn.cxquartz.job.QuartzMainJobFactory;
import com.cx.cn.cxquartz.service.quartz.QuartzService;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskErrorsService;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskInformationsService;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskRecordsService;
import com.cx.cn.cxquartz.util.CommonUtil;
import com.cx.cn.cxquartz.util.HttpClientUtil;
import com.cx.cn.cxquartz.util.ResultEnum;
import com.cx.cn.cxquartz.util.ResultUtil;
import com.cx.cn.cxquartz.vo.QuartzTaskRecordsVo;
import org.apache.commons.collections.CollectionUtils;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
@Service
@Configuration
public class QuartzServiceImpl implements QuartzService, InitializingBean {
private static final Logger logger = LoggerFactory.getLogger(QuartzServiceImpl.class);
public static final String QUARTZ_TOPIC = "quartztopic";
private AtomicInteger atomicInteger;
@Autowired
private KafkaTemplate kafkaTemplate;
@Autowired
private QuartzTaskInformationsService quartzTaskInformationsService;
@Autowired
private QuartzTaskErrorsService quartzTaskErrorsService;
@Autowired
private QuartzTaskRecordsService quartzTaskRecordsService;
@Autowired
private SchedulerFactoryBean schedulerBean;
@Value("${local.czurl}")
private String czurl;
@Value("${local.fxurl}")
private String fxurl;
/**
* 列表查询所有定时任务
*
* @return
*/
@Override
public List<QuartzTaskInformations> getTaskList(String taskNo, String currentPage) {
List<QuartzTaskInformations> quartzTaskInformations = quartzTaskInformationsService.selectList(taskNo, currentPage);
return quartzTaskInformations;
}
/**
* 新增定时任务
*
* @param quartzTaskInformations
* @return
*/
@Override
public String addTask(QuartzTaskInformations quartzTaskInformations) {
String result = quartzTaskInformationsService.insert(quartzTaskInformations);
return result;
}
@Override
public QuartzTaskInformations getTaskById(String id) {
return quartzTaskInformationsService.getTaskById(id);
}
@Override
public String updateTask(QuartzTaskInformations quartzTaskInformations) {
return quartzTaskInformationsService.updateTask(quartzTaskInformations);
}
@Override
public Integer UpdateExecuteParam(Map map) {
return quartzTaskInformationsService.UpdateExecuteParam(map);
}
/**
* 启动 or 暂停定时任务
*
* @param taskNo
* @return
* @throws SchedulerException
*/
@Override
@Transactional
public String startJob(String taskNo,String status) throws SchedulerException {
QuartzTaskInformations quartzTaskInformation = quartzTaskInformationsService.getTaskByTaskNo(taskNo);
if (quartzTaskInformation == null) {
return ResultUtil.success(ResultEnum.NO_DATA.getCode(), ResultEnum.NO_DATA.getMessage());
}
//String status = quartzTaskInformation.getFrozenstatus();
Scheduler scheduler = schedulerBean.getScheduler();
long currentTimeMillis = System.currentTimeMillis();
QuartzTaskInformations task = new QuartzTaskInformations();
task.setId(quartzTaskInformation.getId());
task.setVersion(quartzTaskInformation.getVersion());
//说明要暂停
if (ResultEnum.FROZEN.name().equals(status)) {
//删除
//暂停
scheduler.pauseTrigger(new TriggerKey(taskNo));
// 移除触发器中的任务
scheduler.unscheduleJob(new TriggerKey(taskNo));
scheduler.deleteJob(new JobKey(taskNo));
task.setFrozentime(currentTimeMillis);
task.setFrozenstatus(ResultEnum.FROZEN.name());
} else if (ResultEnum.UNFROZEN.name().equals(status)) {
//删除后启动
//暂停
scheduler.pauseTrigger(new TriggerKey(taskNo));
// 移除触发器中的任务
scheduler.unscheduleJob(new TriggerKey(taskNo));
scheduler.deleteJob(new JobKey(taskNo));
this.schedule(quartzTaskInformation, scheduler);
task.setUnfrozentime(currentTimeMillis);
task.setFrozenstatus(ResultEnum.UNFROZEN.name());
}
// task.setLastmodifytime(currentTimeMillis);
//quartzTaskInformationsService.updateStatusById(task);
// logger.info("taskNo={},taskName={},scheduleRule={},任务{}成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname(), quartzTaskInformation.getSchedulerrule(), ResultEnum.FROZEN.name().equals(status) ? "启动" : "暂停");
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
}
public String startOrStopJob(String taskNo,String status) throws SchedulerException {
QuartzTaskInformations quartzTaskInformation = quartzTaskInformationsService.getTaskByTaskNo(taskNo);
if (quartzTaskInformation == null) {
return ResultUtil.success(ResultEnum.NO_DATA.getCode(), ResultEnum.NO_DATA.getMessage());
}
Scheduler scheduler = schedulerBean.getScheduler();
long currentTimeMillis = System.currentTimeMillis();
QuartzTaskInformations task = new QuartzTaskInformations();
task.setId(quartzTaskInformation.getId());
task.setVersion(quartzTaskInformation.getVersion());
//暂停
scheduler.pauseTrigger(new TriggerKey(taskNo));
// 移除触发器中的任务
scheduler.unscheduleJob(new TriggerKey(taskNo));
scheduler.deleteJob(new JobKey(taskNo));
task.setFrozentime(currentTimeMillis);
if (ResultEnum.FROZEN.name().equals(status)) {
task.setFrozenstatus(ResultEnum.FROZEN.name());
//启动
} else if (ResultEnum.UNFROZEN.name().equals(status)) {
this.schedule(quartzTaskInformation, scheduler);
task.setFrozenstatus(ResultEnum.UNFROZEN.name());
}
task.setLastmodifytime(currentTimeMillis);
quartzTaskInformationsService.updateStatusById(task);
logger.info("taskNo={},taskName={},scheduleRule={},任务{}成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname(), quartzTaskInformation.getSchedulerrule(), ResultEnum.FROZEN.name().equals(status) ? "启动" : "暂停");
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
}
/**
* 初始化加载定时任务
*
* @throws Exception
*/
@Override
public void initLoadOnlineTasks() {
List<QuartzTaskInformations> unnfrozenTasks = quartzTaskInformationsService.getUnnfrozenTasks(ResultEnum.UNFROZEN.name());
if (CollectionUtils.isEmpty(unnfrozenTasks)) {
logger.info("没有需要初始化加载的定时任务");
return;
}
Scheduler scheduler = schedulerBean.getScheduler();
for (QuartzTaskInformations unnfrozenTask : unnfrozenTasks) {
try {
this.schedule(unnfrozenTask, scheduler);
} catch (Exception e) {
logger.error("系统初始化加载定时任务:taskno={},taskname={}失败原因exception={}", unnfrozenTask.getTaskno(), unnfrozenTask.getTaskname(), e);
}
}
}
/**
* 初始化加载定时任务
*
* @throws Exception
*/
@Override
public void afterPropertiesSet() throws Exception {
this.initLoadOnlineTasks();
}
@Override
public QuartzTaskRecords addTaskRecords(String taskNo) {
QuartzTaskRecords quartzTaskRecords = null;
try {
QuartzTaskInformations quartzTaskInformation = quartzTaskInformationsService.getTaskByTaskNo(taskNo);
if (null == quartzTaskInformation || ResultEnum.FROZEN.name().equals(quartzTaskInformation.getFrozenstatus())) {
logger.info("taskNo={} not exist or status is frozen!");
return null;
}
long currentTimeMillis = System.currentTimeMillis();
//QuartzTaskInformations task = new QuartzTaskInformations();
//task.setId(quartzTaskInformation.getId());
// task.setLastmodifytime(currentTimeMillis);
// quartzTaskInformationsService.updateTask(task);
//logger.info("taskNo={},taskName={}更新最后修改时间成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname());
quartzTaskRecords = new QuartzTaskRecords();
quartzTaskRecords.setTaskno(taskNo);
quartzTaskRecords.setTimekeyvalue(quartzTaskInformation.getTimekey());
quartzTaskRecords.setExecutetime(currentTimeMillis);
quartzTaskRecords.setTaskstatus(ResultEnum.INIT.name());
quartzTaskRecords.setFailcount(0);
quartzTaskRecords.setFailreason("");
quartzTaskRecords.setCreatetime(currentTimeMillis);
quartzTaskRecords.setLastmodifytime(currentTimeMillis);
quartzTaskRecordsService.addTaskRecords(quartzTaskRecords);
logger.info("taskNo={},taskName={}添加执行记录表成功", quartzTaskInformation.getTaskno(), quartzTaskInformation.getTaskname());
} catch (Exception ex) {
logger.error("添加执行记录表异常exceptio={}", ex);
return null;
}
return quartzTaskRecords;
}
@Override
public Integer updateRecordById(Integer count, Long id) {
QuartzTaskRecords records = new QuartzTaskRecords();
records.setId(id);
records.setFailcount(count);
records.setLastmodifytime(System.currentTimeMillis());
if (count > 0) {
records.setTaskstatus(ResultEnum.FAIL.name());
} else {
records.setTaskstatus(ResultEnum.SUCCESS.name());
}
return quartzTaskRecordsService.updateTaskRecords(records);
}
@Override
public Integer updateModifyTimeById(QuartzTaskInformations quartzTaskInformations) {
return quartzTaskInformationsService.updateModifyTimeById(quartzTaskInformations);
}
@Override
public Integer addTaskErrorRecord(String id, String errorKey, String errorValue) {
QuartzTaskErrors taskErrors = new QuartzTaskErrors();
taskErrors.setTaskexecuterecordid(String.valueOf(id));
taskErrors.setErrorkey(errorKey);
taskErrors.setCreatetime(System.currentTimeMillis());
taskErrors.setLastmodifytime(System.currentTimeMillis());
taskErrors.setErrorvalue(errorValue);
return quartzTaskErrorsService.addTaskErrorRecord(taskErrors);
}
public void schedule(QuartzTaskInformations quartzTaskInfo, Scheduler scheduler) throws SchedulerException {
TriggerKey triggerKey = TriggerKey.triggerKey(quartzTaskInfo.getTaskno(), Scheduler.DEFAULT_GROUP);
JobDetail jobDetail = JobBuilder.newJob(QuartzMainJobFactory.class).withDescription(quartzTaskInfo.getTaskname()).withIdentity(quartzTaskInfo.getTaskno(), Scheduler.DEFAULT_GROUP).build();
JobDataMap jobDataMap = jobDetail.getJobDataMap();
jobDataMap.put("id", quartzTaskInfo.getId().toString());
jobDataMap.put("taskNo", quartzTaskInfo.getTaskno());
jobDataMap.put("executorNo", quartzTaskInfo.getExecutorno());
jobDataMap.put("sendType", quartzTaskInfo.getSendtype());
jobDataMap.put("url", quartzTaskInfo.getUrl());
jobDataMap.put("executeParameter", quartzTaskInfo.getExecuteparamter());
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(quartzTaskInfo.getSchedulerrule());
CronTrigger cronTrigger = TriggerBuilder.newTrigger().withDescription(quartzTaskInfo.getTaskname()).withIdentity(triggerKey).withSchedule(cronScheduleBuilder).build();
scheduler.scheduleJob(jobDetail, cronTrigger);
logger.info("taskNo={},taskName={},scheduleRule={} load to quartz success!", quartzTaskInfo.getTaskno(), quartzTaskInfo.getTaskname(), quartzTaskInfo.getSchedulerrule());
}
/**
* kafka推送消息
*
* @param message
*/
@Override
public void sendMessage(String message) {
kafkaTemplate.send(QUARTZ_TOPIC, message);
logger.info("给kafka推送消息message={}成功", message);
}
@Override
public List<QuartzTaskRecordsVo> taskRecords(String taskNo) {
List<QuartzTaskRecords> quartzTaskRecords = quartzTaskRecordsService.listTaskRecordsByTaskNo(taskNo);
QuartzTaskRecordsVo recordsVo = null;
List<QuartzTaskRecordsVo> voList = new ArrayList<>();
for (QuartzTaskRecords quartzTaskRecord : quartzTaskRecords) {
recordsVo = new QuartzTaskRecordsVo();
BeanUtils.copyProperties(quartzTaskRecord, recordsVo);
recordsVo.setTime(quartzTaskRecord.getLastmodifytime() - quartzTaskRecord.getCreatetime());
voList.add(recordsVo);
}
return voList;
}
/**
* 立即运行一次定时任务
*
* @param taskNo
* @return
*/
@Override
public String runTaskRightNow(String taskNo) {
atomicInteger = new AtomicInteger(0);
QuartzTaskInformations quartzTaskInformations = quartzTaskInformationsService.getTaskByTaskNo(taskNo);
if (quartzTaskInformations == null) {
return ResultUtil.success(ResultEnum.NO_DATA.getCode(), ResultEnum.NO_DATA.getMessage());
}
// Long id = quartzTaskInformations.getId();
//String sendType = quartzTaskInformations.getSendtype();
//String executorNo = quartzTaskInformations.getExecutorno();
// String url = quartzTaskInformations.getUrl();
String executeParameter = quartzTaskInformations.getExecuteparamter();
// logger.info("定时任务被执行:taskNo={},executorNo={},sendType={},url={},executeParameter={}", taskNo, executorNo, sendType, url, executeParameter);
QuartzTaskRecords records = null;
try {
//保存定时任务的执行记录
//records = this.addTaskRecords(taskNo);
if (null == records || !ResultEnum.INIT.name().equals(records.getTaskstatus())) {
logger.info("taskNo={}立即运行失--->>保存执行记录失败", taskNo);
return ResultUtil.success(ResultEnum.RUN_NOW_FAIL.getCode(), ResultEnum.RUN_NOW_FAIL.getMessage());
}
// if (ResultEnum.HTTP.getMessage().equals(sendType)) {
try {
//将抽取的时间段获得,如果是没有规则,全抽所有。、
//如果是当天上午八点,就抽当天8点之前喝前一天的3点之后0 30 8 ? * *
HttpClientUtil.doPost(taskNo.contains("cz_") ? czurl : fxurl, "text/json", taskNo);
logger.info("");
} catch (Exception ex) {
logger.error("");
atomicInteger.incrementAndGet();
throw ex;
}
// } else if (ResultEnum.KAFKA.getMessage().equals(sendType)) {
// try {
// String message = new StringBuffer(taskNo).append(":").append(executeParameter).toString();
// this.sendMessage(message);
// } catch (Exception ex) {
// logger.error("");
// atomicInteger.incrementAndGet();
// throw ex;
// }
// }
} catch (Exception ex) {
logger.error("");
atomicInteger.incrementAndGet();
this.addTaskErrorRecord(records.getId().toString(), taskNo + ":" + ex.getMessage(), CommonUtil.getExceptionDetail(ex));
}
//更改record表的执行状态、最后修改时间、失败个数
// this.updateRecordById(atomicInteger.get(), records.getId());
//更新taskinfo表的最后修改时间
// QuartzTaskInformations quartzTaskInformation = new QuartzTaskInformations();
// quartzTaskInformation.setId(id);
//quartzTaskInformation.setLastmodifytime(System.currentTimeMillis());
// this.updateTask(quartzTaskInformation);
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
}
@Override
public QuartzTaskErrors detailTaskErrors(String recordId) {
return quartzTaskErrorsService.detailTaskErrors(recordId);
}
@Override
public Integer insertRecord(PatrolCtrlRecord record) {
return quartzTaskInformationsService.insertRecord(record);
}
@Override
public Integer insertAlarm(PatrolCtrlAlarm alarm) {
return quartzTaskInformationsService.insertAlarm(alarm);
}
@Override
public List<PictureTime> findLastPicTime() {
return quartzTaskInformationsService.findLastPicTime();
}
@Override
public List< PatrolCtrlRecord> queryCameraCode(List<String> ids){
return quartzTaskInformationsService.queryCameraCode(ids);
}
@Override
public List<QuartzTaskInformations> getTaskSByDeviceCode(String devicecode) {
return quartzTaskInformationsService.getTaskSByDeviceCode(devicecode);
}
@Override
public Integer deletetask(String taskno) {
return quartzTaskInformationsService.deletetask(taskno);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.bean.QuartzTaskErrors;
import com.cx.cn.cxquartz.dao.QuartzTaskErrorsMapper;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskErrorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class QuartzTaskErrorsServiceImpl implements QuartzTaskErrorsService {
@Autowired
private QuartzTaskErrorsMapper quartzTaskErrorsMapper;
@Override
public Integer addTaskErrorRecord(QuartzTaskErrors quartzTaskErrors) {
return quartzTaskErrorsMapper.insert(quartzTaskErrors);
}
@Override
public QuartzTaskErrors detailTaskErrors(String recordId) {
return quartzTaskErrorsMapper.detailTaskErrors(recordId);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.bean.PatrolCtrlAlarm;
import com.cx.cn.cxquartz.bean.PatrolCtrlRecord;
import com.cx.cn.cxquartz.bean.PictureTime;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.dao.QuartzTaskInformationsMapper;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskInformationsService;
import com.cx.cn.cxquartz.util.ResultEnum;
import com.cx.cn.cxquartz.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class QuartzTaskInformationsServiceImpl implements QuartzTaskInformationsService {
@Autowired
private QuartzTaskInformationsMapper quartzTaskInformationsMapper;
@Override
public String insert(QuartzTaskInformations quartzTaskInformations) {
String taskNo = quartzTaskInformations.getTaskno();
quartzTaskInformations.setVersion(0);
quartzTaskInformations.setCreatetime(System.currentTimeMillis());
quartzTaskInformations.setLastmodifytime(System.currentTimeMillis());
Integer count = quartzTaskInformationsMapper.selectByTaskNo(taskNo);
//判断是否重复任务编号
if (count > 0) {
return ResultUtil.success(ResultEnum.TASKNO_EXIST.getCode(), ResultEnum.TASKNO_EXIST.getMessage());
}
int insert = quartzTaskInformationsMapper.insert(quartzTaskInformations);
if (insert < 1) {
return ResultUtil.success(ResultEnum.FAIL.getCode(), ResultEnum.FAIL.getMessage());
}
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
}
@Override
public List<QuartzTaskInformations> selectList(String taskNo, String currentPage) {
Map<String, Object> map = new HashMap<>();
Integer start = Integer.parseInt(currentPage);
map.put("taskNo", taskNo);
map.put("startIndex", 10 * (start - 1));
return quartzTaskInformationsMapper.selectList(map);
}
@Override
public QuartzTaskInformations getTaskById(String id) {
return quartzTaskInformationsMapper.selectByPrimaryKey(Long.parseLong(id));
}
@Override
public String updateTask(QuartzTaskInformations quartzTaskInformations) {
Integer count = quartzTaskInformationsMapper.selectByTaskNo(quartzTaskInformations.getTaskno());
//判断是否重复任务编号
if (count >= 2) {
return ResultUtil.success(ResultEnum.TASKNO_EXIST.getCode(), ResultEnum.TASKNO_EXIST.getMessage());
}
//设置解冻时间或冻结时间及最后修改时间
if (ResultEnum.FROZEN.name().equals(quartzTaskInformations.getFrozenstatus())) {
quartzTaskInformations.setFrozentime(System.currentTimeMillis());
} else if (ResultEnum.UNFROZEN.name().equals(quartzTaskInformations.getFrozenstatus())) {
quartzTaskInformations.setUnfrozentime(System.currentTimeMillis());
}
quartzTaskInformations.setLastmodifytime(System.currentTimeMillis());
int updateCount = quartzTaskInformationsMapper.updateByPrimaryKeySelective(quartzTaskInformations);
//乐观锁控制并发修改
if (updateCount < 1) {
return ResultUtil.success(ResultEnum.UPDATE_FAIL.getCode(), ResultEnum.UPDATE_FAIL.getMessage());
}
return ResultUtil.success(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
}
@Override
public Integer UpdateExecuteParam(Map map) {
return quartzTaskInformationsMapper.UpdateExecuteParam(map);
}
@Override
public QuartzTaskInformations getTaskByTaskNo(String taskNo) {
return quartzTaskInformationsMapper.getTaskByTaskNo(taskNo);
}
@Override
public Integer updateStatusById(QuartzTaskInformations quartzTaskInformations) {
return quartzTaskInformationsMapper.updateByPrimaryKeySelective(quartzTaskInformations);
}
@Override
public List<QuartzTaskInformations> getUnnfrozenTasks(String status) {
return quartzTaskInformationsMapper.getUnfrozenTasks(status);
}
@Override
public Integer updateModifyTimeById(QuartzTaskInformations quartzTaskInformations) {
return quartzTaskInformationsMapper.updateByPrimaryKeySelective(quartzTaskInformations);
}
@Override
public Integer insertRecord(PatrolCtrlRecord record) {
return quartzTaskInformationsMapper.insertRecord(record);
}
@Override
public Integer insertAlarm(PatrolCtrlAlarm alarm) {
return quartzTaskInformationsMapper.insertAlarm(alarm);
}
@Override
public List<PictureTime> findLastPicTime() {
return quartzTaskInformationsMapper.findLastPicTime();
}
@Override
public List<PatrolCtrlRecord> queryCameraCode(List<String> ids){
return quartzTaskInformationsMapper.queryCameraCode(ids);
}
@Override
public List<QuartzTaskInformations> getTaskSByDeviceCode(String devicecode) {
return quartzTaskInformationsMapper.getTaskSByDeviceCode(devicecode);
}
@Override
public Integer deletetask(String taskno) {
return quartzTaskInformationsMapper.deletetask(taskno);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.bean.QuartzTaskRecords;
import com.cx.cn.cxquartz.dao.QuartzTaskRecordsMapper;
import com.cx.cn.cxquartz.service.quartz.QuartzTaskRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class QuartzTaskRecordsServiceImpl implements QuartzTaskRecordsService {
@Autowired
private QuartzTaskRecordsMapper quartzTaskRecordsMapper;
@Override
public long addTaskRecords(QuartzTaskRecords quartzTaskRecords) {
return quartzTaskRecordsMapper.insert(quartzTaskRecords);
}
@Override
public Integer updateTaskRecords(QuartzTaskRecords quartzTaskRecords) {
return quartzTaskRecordsMapper.updateByPrimaryKeySelective(quartzTaskRecords);
}
public List<QuartzTaskRecords> listTaskRecordsByTaskNo(String taskNo) {
return quartzTaskRecordsMapper.getTaskRecordsByTaskNo(taskNo);
}
;
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.bean.QuartzTaskInformations;
import com.cx.cn.cxquartz.dao.SbtdspsrMapper;
import com.cx.cn.cxquartz.service.quartz.SbtdspsrService;
import com.cx.cn.cxquartz.vo.Sbtdspsr;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class SbtdspsrImpl implements SbtdspsrService {
@Autowired
private SbtdspsrMapper sbtdspsrMapper;
public List<Sbtdspsr> selectByRtsp(String videoid)
{
return sbtdspsrMapper.selectByRtsp(videoid);
}
@Override
public List<QuartzTaskInformations> selectRecogByRtsp(String rtsp) {
return sbtdspsrMapper.selectRecogByRtsp(rtsp);
}
@Override
public int updateRecogByRtsp(String rtsp, String devicecode) {
Map map =new HashMap();
map.put("rtsp",rtsp);
map.put("devicecode",devicecode);
return sbtdspsrMapper.updateRecogByRtsp(map);
}
@Override
public List<Sbtdspsr> list() {
return sbtdspsrMapper.list();
}
}
package com.cx.cn.cxquartz.service.quartz.impl; package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.TrafficMapper; import com.cx.cn.cxquartz.dao.TaskMapper;
import com.cx.cn.cxquartz.service.quartz.TrafficService; import com.cx.cn.cxquartz.service.quartz.TaskService;
import com.cx.cn.cxquartz.vo.Traffic; import com.cx.cn.cxquartz.vo.TraffrecordData;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** import java.util.List;
* <p>
* 服务实现类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service @Service
public class TrafficServiceImpl implements TrafficService { public class TaskImpl implements TaskService {
@Autowired @Autowired
TrafficMapper trafficMapper; private TaskMapper taskMapper;
@Override
public List<TraffrecordData> list() {
return taskMapper.list();
}
@Override @Override
public int insertTraffic(Traffic traffic) { public int update(Integer id) {
return trafficMapper.insertTraffic(traffic); return taskMapper.update(id);
} }
} }
package com.cx.cn.cxquartz.service.quartz.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service
public class TokenCacheService {
private static final Logger log = LoggerFactory.getLogger(TokenCacheService.class);
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Value("${countryside.eventwrite.token}")
private String qztoken;
@Value("${countryside.eventwrite.expiretoken}")
private String expiretoken;
@Value("${countryside.appid}")
private String appid;
@Value("${countryside.appsecret}")
private String appsecret;
@Value("${countryside.tokenurl}")
private String tokenurl;
public String keepAlive() {
try {
String tokencache = stringRedisTemplate.opsForValue().get(qztoken);
if (tokencache != null) {
//判断是否过期
String datetime=stringRedisTemplate.opsForValue().get(expiretoken);
if( null!=datetime){
//预留1分钟过期时间
Long expireminiseconds =Long.parseLong(datetime);
if(new Date().getTime()<expireminiseconds)
{
return tokencache;
}
}
return loginServer();
} else {
return loginServer();
}
} catch (Exception e) {
System.out.println(e.toString());
}
return null;
}
private String loginServer() {
HttpHeaders headers = getHttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
RestTemplate client = new RestTemplate();
ResponseEntity<String> response = client.getForEntity((tokenurl+"?appid="+appid+"&appsecret="+appsecret),String.class);
return getTokenData(response);
}
private HttpHeaders getHttpHeaders() {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
return headers;
}
private String getTokenData(ResponseEntity<String> response){
try {
if (response != null && response.getBody() != null && response.getBody().contains("code")) {
String ret = response.getBody();
Map map= new ObjectMapper().readValue(ret,Map.class);
if ( null !=map && null!=map.get("obj") &&("0").equals(map.get("code"))) {
Map object= new ObjectMapper().readValue(map.get("obj").toString(),Map.class);
if(null!=object && null!=object.get("accessToken")) {
Long time=Long.parseLong(object.get("expire").toString())-new Date().getTime();
stringRedisTemplate.opsForValue().set(expiretoken,time.toString(),time,TimeUnit.MILLISECONDS);
stringRedisTemplate.opsForValue().set(qztoken, String.valueOf(object.get("accessToken")), time,TimeUnit.MILLISECONDS);
return String.valueOf(object.get("accessToken"));
}
} else {
log.error("getTokenData error :" + response.getBody());
}
} else {
log.error("getTokenData empty...");
}
}catch (Exception e){
System.out.println(e.toString());
log.error(e.getMessage());
}
return null;
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.TraffAlarmRecordMapper;
import com.cx.cn.cxquartz.service.quartz.TraffAlarmRecordService;
import com.cx.cn.cxquartz.vo.TraffAlarmRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class TraffAlarmRecordImpl implements TraffAlarmRecordService {
@Autowired
private TraffAlarmRecordMapper traffAlarmRecordMapper;
public int inserTraffAlarmRecord(TraffAlarmRecord traffalarmrecord){
return traffAlarmRecordMapper.inserTraffAlarmRecord(traffalarmrecord);
}
public int selectmax(){
return traffAlarmRecordMapper.selectmax();
}
public int updateTraffAlarmRecordUrl(TraffAlarmRecord record){
return traffAlarmRecordMapper.updateTraffAlarmRecordUrl(record);
}
public int updateTraffAlarmRecordProcess(TraffAlarmRecord traffalarmrecord){
return traffAlarmRecordMapper.updateTraffAlarmRecordProcess(traffalarmrecord);
}
public List<TraffAlarmRecord> getTraffAlarmRecordByProgress(Map<String, Object> map){
return traffAlarmRecordMapper.getTraffAlarmRecordByProgress( map);
}
}
package com.cx.cn.cxquartz.service.quartz.impl;
import com.cx.cn.cxquartz.dao.TraffPictureMapper;
import com.cx.cn.cxquartz.service.quartz.TraffPictureService;
import com.cx.cn.cxquartz.vo.TraffpictureParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author wjj
* @since 2021-04-29
*/
@Service
public class TraffpictureServiceImpl implements TraffPictureService {
@Autowired
private TraffPictureMapper traffPictureMapper;
@Override
public int inserTraffpicture(TraffpictureParam traffpicture) {
return traffPictureMapper.inserTraffpicture(traffpicture);
}
@Override
public int updateTraffpicture(TraffpictureParam traffpicture) {
return traffPictureMapper.updateTraffpicture(traffpicture);
}
@Override
public String queryimgpath(TraffpictureParam traffpicture) {
return traffPictureMapper.queryimgpath(traffpicture);
}
@Override
public String queryimgdataByid(String id) {
return traffPictureMapper.queryimgdataByid(id);
}
}
package com.cx.cn.cxquartz.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class AdminInterceptor implements HandlerInterceptor {
/**
* 在请求处理之前进行调用(Controller方法调用之前)
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
// System.out.println("执行了TestInterceptor的preHandle方法");
try {
//
// //统一拦截(查询当前session是否存在user)(这里user会在每次登陆成功后,写入session)
// String token = (String) request.getSession().getAttribute("token");
// RestTemplate restTemplate = new RestTemplate();
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
// ResponseEntity<String> result = null;
// if (null == token) {
// //登录
//// String jsontoken= dologin(restTemplate,headers);
//// request.getSession().setAttribute("token",jsontoken);
// }
// else{//验证权限
// headers.add("access-token", request.getSession().getAttribute("token").toString());
// ResponseEntity<Map> response_result = restTemplate.exchange(
// "http://www.zjwwzf.cn/xzzfSpv/ext/auth/verify.do",
// HttpMethod.GET,
// new HttpEntity<String>(headers),
// Map.class,
// new HashMap<>());
// Map<Object,Object> bodyresult = response_result.getBody();
// if(null!=bodyresult.get("status") && !String.valueOf(bodyresult.get("status")).equals("0")){
// String jsontoken= dologin(restTemplate,headers);
// request.getSession().setAttribute("token",jsontoken);
// }
// }
} catch (Exception e) {
e.printStackTrace();
}
return true;//如果设置为false时,被请求时,拦截器执行到此处将不会继续操作
//如果设置为true时,请求将会继续执行后面的操作
}
/**
* 请求处理之后进行调用,但是在视图被渲染之前(Controller方法调用之后)
*/
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
// System.out.println("执行了TestInterceptor的postHandle方法");
}
/**
* 在整个请求结束之后被调用,也就是在DispatcherServlet 渲染了对应的视图之后执行(主要是用于进行资源清理工作)
*/
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
// System.out.println("执行了TestInterceptor的afterCompletion方法");
}
}
package com.cx.cn.cxquartz.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* 类描述:获取Spring代理类(上下文)
*/
@Component
public class ApplicationContextHolder implements ApplicationContextAware {
private static ApplicationContext context;
@Override
public void setApplicationContext(ApplicationContext applicationcontext)
throws BeansException {
ApplicationContextHolder.context = applicationcontext;
}
public static Object getBean(String beanName) {
return context.getBean(beanName);
}
}
package com.cx.cn.cxquartz.util;
import com.cx.cn.cxquartz.bean.PictureTime;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
public class CommonUtil {
/**
* 获取具体的异常信息
*
* @param ex
* @return
*/
public static String getExceptionDetail(Exception ex) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
try {
ex.printStackTrace(pw);
return sw.toString();
} finally {
pw.close();
}
}
public static void removeFinishFiles( List<File> jsonFile, List<PictureTime> picturses)
{
if (picturses.size() > 0) {
//根据每个设备最新的时间进行过滤D:\imp\VideoPic\202009021049435991_0\20200906\112004.jpeg
String filetime = "";
for (int i = 0; i < jsonFile.size(); i++) {
String[] str = jsonFile.get(i).getAbsolutePath().split("\\\\");
for (PictureTime pic : picturses) {
filetime = str[str.length - 2] + str[str.length - 1].replace(".jpeg", "");
if (str[str.length - 3].equals(pic.getDeviceid())
&& pic.getLasttime().compareTo(filetime) != -1) {
jsonFile.remove(i--);
}
}
}
}
}
}
package com.cx.cn.cxquartz.util;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.Months;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import java.util.Date;
public class DateUtils {
private static final DateTimeFormatter YMD_HMS = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
private static final DateTimeFormatter YMDHMS = DateTimeFormat.forPattern("yyyyMMddHHmmss");
private static final DateTimeFormatter YMD = DateTimeFormat.forPattern("yyyyMMdd");
private static final DateTimeFormatter Y_M_D = DateTimeFormat.forPattern("yyyy-MM-dd");
private static final DateTimeFormatter YM= DateTimeFormat.forPattern("yyyyMM");
private static final DateTimeFormatter DD= DateTimeFormat.forPattern("dd");
public static String formatCurrDate(){
return formatCurrDateByType(YMD_HMS);
}
public static String formatCurrDateNoSign(){
return formatCurrDateByType(YMDHMS);
}
public static String formatCurrDateYMD(){
return formatCurrDateByType(Y_M_D);
}
public static String formatCurrDayNoSign(){
return formatCurrDateByType(YMD);
}
public static String formatCurrDayYM(){
return formatCurrDateByType(YM);
}
public static String formatCurrDayDD(){
return formatCurrDateByType(DD);
}
public static Date parseDate(String date){
return DateTime.parse(date,YMD_HMS).toDate();
}
public static Date parseDateNoSign(String date){
return DateTime.parse(date,YMDHMS).toDate();
}
public static String getYesterday(int day){
Date date= addDay(new Date(),day);
return new DateTime(date).toString(YMD_HMS);
}
public static String getlastMonth(int month){
Date date= addMonth(new Date(),month);
return new DateTime(date).toString(YMD_HMS);
}
public static String formatDate(Date date){
return new DateTime(date).toString(YMD_HMS);
}
public static String formatDateToNoSign(Date date){
return new DateTime(date).toString(YMDHMS);
}
public static String formatDateToNoSign(String date){
return DateTime.parse(date,YMD_HMS).toString(YMDHMS);
}
private static String formatCurrDateByType(DateTimeFormatter dateTimeFormatter){
return DateTime.now().toString(dateTimeFormatter);
}
public static Date addMinutes(Date date, int minutes) {
return new DateTime(date).plusMinutes(minutes).toDate();
}
public static Date addDay(Date date, int day) {
if(day == 0){
return date;
}
return new DateTime(date).plusDays(day).toDate();
}
public static Date addMonth(Date date, int month) {
if(month == 0){
return date;
}
return new DateTime(date).plusMonths(month).toDate();
}
public static int diffMonth(Date date1, Date date2) {
if (date1 == null || date2 == null) {
return 0;
}
DateTime dt1 = new DateTime(date1);
DateTime dt2 = new DateTime(date2);
return Months.monthsBetween(dt1, dt2).getMonths();
}
public static int diffDay(Date date1, Date date2) {
if (date1 == null || date2 == null) {
return 0;
}
DateTime dt1 = new DateTime(date1);
DateTime dt2 = new DateTime(date2);
return Days.daysBetween(dt1, dt2).getDays();
}
}
package com.cx.cn.cxquartz.util;
import com.cx.cn.cxquartz.controller.ExtController;
import com.cx.cn.cxquartz.vo.Ftp;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import sun.misc.BASE64Decoder;
import javax.annotation.PostConstruct;
import java.io.*;
import java.net.MalformedURLException;
import java.net.SocketException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("all")
@Component
public class FTPUtil {
private static final Logger log = LoggerFactory.getLogger(ExtController.class);
// @Value("${ftp.host}")
// private String ftpHost ;
private List<Ftp> ftps = new ArrayList<Ftp>();
// @PostConstruct
// private void initHostMap(){
// if(ftpHost==null){
// log.error("ftp�洢��δ���ã���������");
// log.error("ftp�洢��δ���ã���������");
// return;
// }
//
//
//
// }
public static void downLoadFile(String path, OutputStream toClient) {
BufferedInputStream bis = null;
InputStream is = null;
try {
if (path.toUpperCase().indexOf("FTP") != -1) {
String tempUrl = path;
tempUrl = tempUrl.replaceAll("\\\\", "/");
URL url = new URL(tempUrl);
is = url.openStream();
bis = new BufferedInputStream(is);
IOUtils.copy(bis, toClient);
return;
}
} catch (Exception e) {
log.error("FTP����ͼƬ����", e);
} finally {
IOUtils.closeQuietly(toClient);
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(bis);
}
}
public static byte[] getFtpPicBytes(String path) {
URL url = null;
byte[] buffer = null;
try {
url = new URL(path);
} catch (MalformedURLException e) {
log.error("FTP URL·������"+e.toString());
return buffer;
}
try (InputStream is = url.openStream();ByteArrayOutputStream bos = new ByteArrayOutputStream(1000)){
byte[] b = new byte[1000];
int n;
while ((n = is.read(b)) != -1) {
bos.write(b, 0, n);
}
buffer = bos.toByteArray();
}catch (Exception e) {
log.error("FTP����ͼƬ����", e);
return buffer;
}
return buffer;
}
//ftpͼƬ�ϴ���ͼƬ����Ϊbase64��װ��String
public static boolean uploadFile(Ftp ftpUrl, String path, String filename, String inputImg) {
boolean flag = true;
FTPClient ftpClient = null;
ByteArrayInputStream input = null;
try {
if (inputImg == null) {
return false;
}
BASE64Decoder decoder = new BASE64Decoder();
byte[] b_img = decoder.decodeBuffer(inputImg);
input = new ByteArrayInputStream(b_img);
ftpClient = connectServer(ftpUrl);
if (ftpClient.isConnected()) {
changeWorkingDirectory(ftpClient, path);
flag = ftpClient.storeFile(filename, input);
if (flag) {
// log.info("FTP�ϴ��ļ��ɹ���");
} else {
flag = false;
log.info("FTP�ϴ��ļ�ʧ�ܣ�");
}
}
} catch (Exception e) {
flag = false;
log.error("FTP�ļ��ϴ�ʧ�ܣ�", e.toString());
} finally {
IOUtils.closeQuietly(input);
closeConnect(ftpClient);
}
return flag;
}
public static boolean uploadFile(Ftp ftpUrl, String path, String filename, InputStream input){
boolean flag = true;
FTPClient ftpClient = null;
try {
ftpClient = connectServer(ftpUrl);
if (ftpClient.isConnected()) {
changeWorkingDirectory(ftpClient, path);
flag = ftpClient.storeFile(filename, input);
if (flag) {
// log.info("FTP upload success��");
} else {
log.info("FTP upload fail��");
}
} else {
flag = false;
// log.info("FTP server refused connection ��");
}
} catch (IOException e) {
flag = false;
log.error("FTP upload fail��", e);
} catch (Exception e) {
flag = false;
log.error("FTP upload fail��", e);
} finally {
IOUtils.closeQuietly(input);
closeConnect(ftpClient);
}
return flag;
}
/*
* �õ������ļ��е�FTP��������ַ
*/
public static String getFtpUrl(Ftp ftpUrl) {
StringBuffer buffer = new StringBuffer();
buffer.append("ftp://");
String ftpUsername = ftpUrl.getFtpUsername();
if (ftpUsername != null && ftpUsername.trim().length() > 0) {
buffer.append(ftpUsername);
buffer.append(":");
buffer.append(ftpUrl.getFtpPassword());
buffer.append("@");
}
buffer.append(ftpUrl.getFtpIp());
if (ftpUrl.getFtpPort() != null) {
buffer.append(":");
buffer.append(ftpUrl.getFtpPort());
}
buffer.append("/");
return buffer.toString();
}
/**
* @param ftpUrl
* @return
* @throws Exception
* @description ɾ��ftp�ϵ��ļ�
* @author sunw
*/
public static boolean deleteFileFromFtpUrl(String ftpUrl) throws Exception {
boolean flag = false;
if (null == ftpUrl || StringUtils.isBlank(ftpUrl)) {
throw new Exception("ftpUrl����");
}
Map<String, String> result = getFtpInfoMapByFullPath(ftpUrl);
String ftpUser = result.get("ftpUser");
String ftpPassword = result.get("ftpPassword");
String ftpIp = result.get("ftpIp");
String ftpPort = result.get("ftpPort");
String fileName = result.get("fileName");
String path = result.get("path");
Ftp ftp = FTPUtil.getFtpUrlObj(ftpIp, ftpPort, ftpUser, ftpPassword);
FTPClient ftpClient = connectServer(ftp);
if (null == ftpClient) {
throw new Exception("ftp��¼ʧ�� ");
} else {
String fullPath = (null == path || "".equals(path.trim())) ? fileName : (path + "/" + fileName);
try {
flag = ftpClient.deleteFile(fullPath);
} catch (Exception e) {
e.printStackTrace();
}
}
return flag;
}
/**
* @param ftpUrlStr
* @return
* @throws Exception
* @author sunw ͨ��ͼƬ·��
* ���ftpuser,ftppassword,ftpip,ftpport,��fpt�ϵ��ļ�·��,�ļ�realname
*/
private static Map<String, String> getFtpInfoMapByFullPath(String ftpUrlStr) throws Exception {
if (null == ftpUrlStr || "".equals(ftpUrlStr.trim())) {
throw new Exception("ftpstr����");
}
ftpUrlStr = ftpUrlStr.replaceAll("\\\\", "/");
ftpUrlStr = changeUrlCharater(ftpUrlStr);
String array[] = ftpUrlStr.split("/");
String[] ftpUserPasswordAndIpPort = array[2].split("@");
String[] ftpUserAndPassword = ftpUserPasswordAndIpPort[0].split(":");
String[] ftpIpAndPort = ftpUserPasswordAndIpPort[1].split(":");
String ftpUser = ftpUserAndPassword[0];
String ftpPassword = ftpUserAndPassword[1];
String ftpIp = ftpIpAndPort[0];
String ftpPort = ftpIpAndPort.length > 1 ? ftpIpAndPort[1] : "";
String fileName = array[array.length - 1];// ������
Map<String, String> resultMap = new HashMap<String, String>();
resultMap.put("ftpUser", ftpUser);
resultMap.put("ftpPassword", ftpPassword);
resultMap.put("ftpIp", ftpIp);
resultMap.put("ftpPort", ftpPort);
resultMap.put("fileName", fileName);
String path = "";
for (int i = 3; i < array.length - 1; i++) {
if (i != array.length - 2) {
path += array[i] + "/";
} else {
path += array[i];
}
}
resultMap.put("path", path);
return resultMap;
}
public static void main(String[] args) {
String temp = "ftp://vpftp:zn7070@10.10.10.207:21/2018/0101.jpg";
try {
boolean flag = deleteFileFromFtpUrl(temp);
System.out.println(flag);
} catch (Exception e) {
System.out.println("ɾ���ļ�ʧ��");
}
// String [] strSplit = temp.split("/");
// for(int i = 0 ; i < strSplit.length ; i++) {
// System.out.println(i+" = " + strSplit[i]);
// }
}
public static String changeUrlCharater(String tempUrl) {
tempUrl = tempUrl.replaceAll("%", "%25").replaceAll("#", "%23").replaceAll("\\+", "%2B").replaceAll("&", "%26");
tempUrl = tempUrl.replaceAll("=", "%3D").replaceAll("\\?", "%3F");
return tempUrl;
}
/**
* ���ӵ�������
*/
private static FTPClient connectServer(Ftp ftpUrl) {
FTPClient ftpClient = null;
try {
ftpClient = new FTPClient();
ftpClient.setControlEncoding("utf-8");
if (ftpUrl.getFtpPort() != null) {
ftpClient.setDefaultPort(ftpUrl.getFtpPort());
}
ftpClient.connect(ftpUrl.getFtpIp());
ftpClient.login(ftpUrl.getFtpUsername(), ftpUrl.getFtpPassword());
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
ftpClient.enterLocalPassiveMode();
// ftpClient.setFileTransferMode(FTP.STREAM_TRANSFER_MODE);
ftpClient.setBufferSize(10240);
int reply = ftpClient.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftpClient.disconnect();
System.err.println("FTP server refused connection.");
log.info("FTP ����ܾ����ӣ�");
}
} catch (SocketException e) {
log.error("��¼ftp������ " + ftpUrl.getFtpIp() + " ʧ��,���ӳ�ʱ��", e);
} catch (IOException e) {
log.error("��¼ftp������ " + ftpUrl.getFtpIp() + " ʧ�ܣ�FTP�������޷��򿪣�", e);
}
return ftpClient;
}
/**
* �ر�����
*/
private static void closeConnect(FTPClient ftpClient) {
try {
if (ftpClient != null) {
if (ftpClient.isConnected() == true) {
ftpClient.logout();
}
ftpClient.disconnect();
}
} catch (Exception e) {
log.error("�ر�ftp����ʧ��", e);
}
}
/**
* ���뵽��������ij��Ŀ¼��
*
* @param directory
*/
private static void changeWorkingDirectory(FTPClient ftpClient, String directory) throws Exception {
try {
if(directory.contains("\\")){
directory = directory.replaceAll("\\\\","/");
}
String splitType = "/";
ftpClient.changeWorkingDirectory(splitType);
String[] subPathArray = directory.split(splitType);
for (String subPath : subPathArray) {
ftpClient.makeDirectory(subPath);
ftpClient.changeWorkingDirectory(subPath);
}
} catch (IOException ioe) {
log.error("�ı�ftp����·��ʧ��", ioe);
}
}
/**
* ת��[ISO-8859-1 -> GBK] ��ͬ��ƽ̨��Ҫ��ͬ��ת��
*
* @param obj
* @return ""
*/
private static String iso8859togbk(Object obj) {
try {
if (obj == null) {
return "";
}
return new String(obj.toString().getBytes("iso-8859-1"), "GBK");
} catch (Exception e) {
return "";
}
}
public static Ftp getFtpUrlObj(String ftpIp, String ftpPort, String ftpUser, String ftpPassword) {
Ftp ftpUrl = new Ftp();
ftpUrl.setFtpIp(ftpIp);
if (ftpPort != null) {
ftpUrl.setFtpPort(Integer.parseInt(ftpPort));
}
ftpUrl.setFtpUsername(ftpUser);
ftpUrl.setFtpPassword(ftpPassword);
return ftpUrl;
}
}
package com.cx.cn.cxquartz.util;
import com.cx.cn.cxquartz.controller.ExtController;
import com.cx.cn.cxquartz.vo.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Encoder;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.TimeUnit;
public class FileTransferManager {
private static CompletionService<String> completionService = new ExecutorCompletionService<String>(ThreadPoolUtil.getPool());
private static CompletionService<String> threadService = new ExecutorCompletionService<String>(ThreadPoolUtil.getPool());
private static final Logger log = LoggerFactory.getLogger(ExtController.class);
/**
* @param ftp
* @param basePath
* @return
* @throws Exception
*/
public static void transferFile(final TraffAlarmRecord traffAlarmRecord, final Ftp ftp, final String basePath) throws Exception {
final Long recordid = traffAlarmRecord.getRecordid();
String fileName = DateUtils.formatCurrDayNoSign() + "_" + recordid + "_img1.jpg";
String ftputl = FTPUtil.getFtpUrl(ftp) + basePath + "/" + fileName;
traffAlarmRecord.setImg1path(ftputl);
completionService.submit(() -> {
try {
HttpURLConnection connection = (HttpURLConnection) new URL(traffAlarmRecord.getImg1urlfrom()).openConnection();
connection.setReadTimeout(2000); //延迟连接
connection.setConnectTimeout(3000);
connection.setRequestMethod("GET");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK || connection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {
InputStream inputStream = connection.getInputStream();
boolean r = FTPUtil.uploadFile(ftp, basePath, fileName, inputStream);
if (r) {
log.info(" ftpupload success:{}", ftputl);
}
} else {
log.error("connection code: " + connection.getResponseCode());
}
} catch (IOException e) {
log.error("ftputl connection error:{}", e.toString());
return "0";
}
return "1";
}
);
}
public static void fetchUrlsFromRecord(TraffAlarmRecord record, Map<String, Object> transferRecord) {
if (record == null || record.getRecordid() == null) {
return;
}
transferRecord.put("recordid", record.getRecordid());
if (record.getImg1path() == null && record.getImg1urlfrom() != null) {
transferRecord.put("img1path", record.getImg1urlfrom());
}
}
public static TraffAlarmRecord traffAlarmRecordUrlUpdate(List<TransferResult> results) throws Exception {
TraffAlarmRecord record = new TraffAlarmRecord();
for (TransferResult result : results) {
record.setRecordid(result.getRecordid());
if (result.getResult()) {
switch (result.getPathvalue()) {
case "img1path":
record.setImg1path(result.getImgpath());
break;
case "videopath":
record.setVideopath(result.getImgpath());
break;
default:
break;
}
}
}
return record;
}
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;
}
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(() -> {
try {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setReadTimeout(2000); //延迟连接
connection.setConnectTimeout(3000);
connection.setRequestMethod("GET");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK || connection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {
InputStream inputStream = connection.getInputStream();
String pname = DateUtils.formatCurrDayNoSign() + ".jpg";
String ftputl = FTPUtil.getFtpUrl(ftp) + basePath + pname;
boolean r = FTPUtil.uploadFile(ftp, basePath, pname, inputStream);
if (r) {
return ftputl;
}
} else {
log.error("connection code: " + connection.getResponseCode());
}
} catch (IOException e) {
System.out.println(e.toString());
log.error(e.toString());
}
return url;
});
try {
return threadService.poll(10, TimeUnit.SECONDS).get();
} catch (Exception ex) {
return url;
}
}
}
package com.cx.cn.cxquartz.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
public class FileUtil {
private static final Logger logger = LoggerFactory.getLogger(FileUtil.class);
public static File uploadToLocal(String path,ByteArrayOutputStream bout, String fileName) {
logger.info("file upload :{}",path+fileName);
DataOutputStream to=null;
try {
File tempFile = new File(path);
if (!tempFile.exists()) {
tempFile.mkdirs();
}
File file= new File(tempFile.getPath() + File.separator + fileName);
if (!file.exists()) {
file.createNewFile();
}
to=new DataOutputStream(new FileOutputStream(file));
bout.writeTo(to);
return file;
} catch (IOException e) {
logger.error(e.toString());
e.printStackTrace();
return null;
} catch (Exception e) {
logger.error(e.toString());
e.printStackTrace();
return null;
} finally {
try {
if(null!=bout)
bout.close();
if(null!=to){
to.close();
}
} catch (IOException e) {
logger.error(e.toString());
e.printStackTrace();
}
}
}
}
package com.cx.cn.cxquartz.util;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.cookie.CookiePolicy;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HttpClientUtil {
private static Logger log = LoggerFactory.getLogger(HttpClientUtil.class);
private static final String ENCODING = "UTF-8";
private static final int CONNECTION_TIME_OUT = 3000;
private static final int SO_TIME_OUT = 100000;
private static final boolean STALE_CHECK_ENABLED = true;
private static final boolean TCP_NO_DELAY = true;
private static final int DEFAULT_MAX_CONNECTIONS_PER_HOST = 100;
private static final int MAX_TOTAL_CONNECTIONS = 1000;
private static final HttpConnectionManager connectionManager;
public static final HttpClient client;
static {
HttpConnectionManagerParams params = loadHttpConfFromFile();
connectionManager = new MultiThreadedHttpConnectionManager();
connectionManager.setParams(params);
client = new HttpClient(connectionManager);
}
private static HttpConnectionManagerParams loadHttpConfFromFile() {
HttpConnectionManagerParams params = new HttpConnectionManagerParams();
params.setConnectionTimeout(CONNECTION_TIME_OUT);
params.setStaleCheckingEnabled(STALE_CHECK_ENABLED);
params.setTcpNoDelay(TCP_NO_DELAY);
params.setSoTimeout(SO_TIME_OUT);
params.setDefaultMaxConnectionsPerHost(DEFAULT_MAX_CONNECTIONS_PER_HOST);
params.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS);
params.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(0, false));
return params;
}
/**
* get请求
*
* @param url
* @return
*/
public static String doGet(String url) {
String result = null;
try {
GetMethod getMethod = new GetMethod(url);
client.executeMethod(getMethod);
result = getMethod.getResponseBodyAsString();
} catch (Exception e) {
log.error("httpclient get request url=" + url + ",exception=" + e);
}
return result;
}
public static String doPost(String url, String contentType, String content) throws Exception {
PostMethod method = new PostMethod(url);
method.addRequestHeader("Connection", "Keep-Alive");
method.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(0, false));
try {
method.setRequestEntity(new ByteArrayRequestEntity(content.getBytes(ENCODING)));
method.addRequestHeader("Content-Type", contentType);
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
return null;
}
byte[] ret = method.getResponseBody();
if (ret == null)
return null;
return new String(ret, ENCODING);
} finally {
method.releaseConnection();
}
}
}
package com.cx.cn.cxquartz.util;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class LoginConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
//注册TestInterceptor拦截器
InterceptorRegistration registration = registry.addInterceptor(new AdminInterceptor());
registration.addPathPatterns("/**"); //所有路径都被拦截
registration.excludePathPatterns( //添加不拦截路径
"/**/*.html", //html静态资源
"/**/*.js", //js静态资源
"/**/*.css", //css静态资源
"/**/*.woff",
"/**/*.ttf"
);
}
}
package com.cx.cn.cxquartz.util;
import java.io.Serializable;
import java.util.List;
public class Page<T> implements Serializable {
private static final long serialVersionUID = 130050641959720183L;
private List<T> list; //数据集合
private int totalRecord; //总记录数
private int currentPage; //当前页
private int pageSize; //每页大小
private int startIndex;
private int totalPage; //总页数
private int previousPage; //前一页
private int nextPage; //下一页
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public int getTotalRecord() {
return totalRecord;
}
public void setTotalRecord(int totalRecord) {
this.totalRecord = list.size();
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = 10;
}
public int getStartIndex() {
return startIndex;
}
public void setStartIndex(int startIndex) {
this.startIndex = pageSize * (currentPage-1);
}
public void setTotalPage(int totalPage) {
if(this.totalRecord % this.pageSize == 0) {
this.totalPage = this.totalRecord / this.pageSize;
}else {
this.totalPage = this.totalRecord / this.pageSize + 1;
}
}
public void setPreviousPage(int previousPage) {
if(this.totalRecord % this.pageSize == 0) {
this.totalPage = this.totalRecord / this.pageSize;
}else {
this.totalPage = this.totalRecord / this.pageSize + 1;
}
}
public void setNextPage(int nextPage) {
if(this.currentPage + 1 > this.totalPage) {
this.nextPage = this.totalPage;
}else {
this.nextPage = this.currentPage + 1;
}
}
public int getTotalPage() {
return totalPage;
}
public int getPreviousPage() {
return previousPage;
}
public int getNextPage() {
return nextPage;
}
@Override
public String toString() {
return "Page{" +
"list=" + list +
", totalRecord=" + totalRecord +
", currentPage=" + currentPage +
", pageSize=" + pageSize +
", startIndex=" + startIndex +
", totalPage=" + totalPage +
", previousPage=" + previousPage +
", nextPage=" + nextPage +
'}';
}
public Page(List<T> list, int totalRecord, int currentPage) {
this.list = list;
this.totalRecord = totalRecord;
this.currentPage = currentPage;
}
}
package com.cx.cn.cxquartz.util;
import com.cx.cn.cxquartz.controller.IndexController;
import com.cx.cn.cxquartz.vo.Location;
import com.cx.cn.cxquartz.vo.Point;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.*;
import java.util.List;
public class PointUtil {
private static final Logger logger = LoggerFactory.getLogger(IndexController.class);
public static void getXYWH(List<Point> points, Long[] roiarray){
Map<Integer, Integer> map=new HashMap();
Map<Integer, Integer> mapy=new HashMap();
for(Point point :points){
map.put(point.getX(),point.getX());
mapy.put(point.getY(),point.getY());
}
//map有两个,mapy有两个值
List<Integer> numx = new ArrayList<Integer>();
for (Map.Entry<Integer, Integer> mx:map.entrySet()) {
numx.add(mx.getValue());
}
List<Integer> numy = new ArrayList<Integer>();
for (Map.Entry<Integer, Integer> my:mapy.entrySet()) {
numy.add(my.getValue());
}
Collections.sort(numx);
Collections.sort(numy);
if(numx.size()==2 && numy.size()==2) {
roiarray[0]=Long.parseLong(String.valueOf(numx.get(0)));
roiarray[1]=Long.parseLong(String.valueOf(numy.get(0)));
roiarray[2]=Long.parseLong(String.valueOf(numx.get(1) - numx.get(0)));
roiarray[3]=Long.parseLong(String.valueOf(numy.get(1) - numy.get(0)));
}}
public static ByteArrayOutputStream drawByPoints(InputStream bais,List<Map> detectObjects,Long[] roi) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
BufferedImage image = ImageIO.read(bais);
Graphics g = image.getGraphics();
g.setColor(Color.RED);
//遍历所有特征值,画到图片上
int x,y,w,h;
for (Map box : detectObjects) {
if (null != box) {
try {
if (null != box.get("location")) {
x=0;y=0;w=0;h=0;
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());
}catch (Exception ex){
logger.error("Location Map error:{}", ex.toString());
}
}
} catch (Exception ex) {
logger.error("Location readValue error:{}", ex.toString());
}
}
}
//辅助线框框
// if(null!=roi&& null!=roi[0]&& null!=roi[1]&& null!=roi[2]&& null!=roi[3]) {
// g.setColor(Color.GREEN);
// g.drawRect(roi[0].intValue(), roi[1].intValue(), roi[2].intValue(), roi[3].intValue());
// }
ImageIO.write(image, "JPEG", stream);
return stream;
}catch (Exception ex){
logger.error("Location readValue error:{}", ex.toString());
}
return stream;
}
}
package com.cx.cn.cxquartz.util;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
public class RecursiveGetJsonData {
private static List<Object> list = new ArrayList<Object>(); //公共的的数据池
private String rootDir;//根目录
private List<File> jsonFileList = new ArrayList<File>();//公共的数据区域 找到的文件数据
public List<File> getJsonFileList() {
return jsonFileList;
}
public void setJsonFileList(List<File> jsonFileList) {
this.jsonFileList = jsonFileList;
}
public RecursiveGetJsonData(String rootDir) {
this.setRootDir(rootDir);
}
public RecursiveGetJsonData() { // 空构造方法
}
/**
* rootDir 根目录
* fileNameEndFlag 问价结尾标识
*
* @param rootDir
*/
public void getDataFromFile(String rootDir, final String fileNameEndFlag) {
File rootFile = new File(rootDir);
FileFilter filter = new FileFilter() { //文件后缀过滤
@Override
public boolean accept(File file) {
String fileName = file.getName();
if (fileName != null && fileName != "" && fileName.endsWith(fileNameEndFlag)) {
return true;
}
return false;
}
};
if (rootFile.isDirectory()) { //如果是目录
File[] listFiles = rootFile.listFiles(filter); // 满足条件的文件装入公共数据区
if (null != listFiles && listFiles.length > 0) {
jsonFileList.addAll(Arrays.asList(listFiles)); //Arrays 将数组转化为List集合
}
File[] list = rootFile.listFiles();
if (null != list && list.length > 0) {
for (int i = 0; i < list.length; i++) {
if (list[i].isDirectory()) {
getDataFromFile(list[i].getAbsolutePath(), fileNameEndFlag); //递归调用方法
}
}
}
}
}
public String ImageToBase64ByLocal(File file) {
InputStream in = null;
byte[] data = null;
// 读取图片字节数组
try {
//获取图片路径
in = new FileInputStream(file.getPath());
data = new byte[in.available()];
in.read(data);
in.close();
} catch (IOException e) {
return null;
}
return Base64.getEncoder().encodeToString(data);
}
public String getRootDir() {
return rootDir;
}
public void setRootDir(String rootDir) {
this.rootDir = rootDir;
}
public static List<Object> getList() {
return list;
}
public static void setList(List<Object> list) {
RecursiveGetJsonData.list = list;
}
}
package com.cx.cn.cxquartz.util;
/**
* 通用序列枚举类
* @author cp
*/
public enum RedisEnum {
/**
* 支队心跳
*/
DETACHMENT_HEART_BEATS("gs:traff:detachment:heartbeats"),
/**
* FTP List
*/
FTPLIST("gs:traff:global:cache:ftplist"),
/**
* ftp index
*/
FTPLIST_INDEX("gs:traff:global:cache:ftplistindex");
private String value;
RedisEnum(String value){
this.value =value;
}
public String getValue() {
return value;
}
}
package com.cx.cn.cxquartz.util;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
return new RestTemplate(factory);
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(150000);
factory.setReadTimeout(150000);
return factory;
}
}
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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
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
public RestTemplate restTemplate;
@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 getPicture(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.setImg1urlfrom(json.getString("url"));
record.setImg1path(json.getString("localuri"));
}
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>
/// 读取远程文件的内容
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static InputStream ReadFromURL(String serverFilePath)
{
try {
HttpURLConnection connection = (HttpURLConnection) new URL(serverFilePath).openConnection();
connection.setReadTimeout(2000); //延迟连接
connection.setConnectTimeout(8000);
connection.setRequestMethod("GET");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK || connection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {
InputStream inputStream = connection.getInputStream();
return inputStream;
}
} catch (IOException e) {
}
return null;
}
}
package com.cx.cn.cxquartz.util;
public class Result<T> {
private Integer code;
private String message;
private T data;
public Result(ResultEnum resultEnum) {
this.code = resultEnum.getCode();
this.message = resultEnum.getMessage();
}
public Result(ResultEnum resultEnum, T data) {
this.code = resultEnum.getCode();
this.message = resultEnum.getMessage();
this.data = data;
}
public Result(Integer code, String message) {
this.code = code;
this.message = message;
}
public Result(Integer code, String message, T data) {
this.code = code;
this.message = message;
this.data = data;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package com.cx.cn.cxquartz.util;
public enum ResultEnum {
SUCCESS(200,"success"),
FAIL(500,"system error"),
INIT(600,"record init"),
TASKNO_EXIST(1001,"该任务编号已经存在"),
PARAM_EMPTY(6001,"parameter is empty"),
FROZEN(10001,"FROZEN"),
UNFROZEN(10002,"UNFROZEN"),
RUN_NOW_FAIL(7001,"立即运行失败"),
HTTP(10003,"http"),
KAFKA(10004,"kafka"),
UPDATE_FAIL(1002,"更新失败"),
NO_DATA(1003,"无此定时任务编号");
private Integer code;
private String message;
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
ResultEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
}
package com.cx.cn.cxquartz.util;
import com.google.gson.Gson;
public class ResultUtil<T> {
public static String success() {
Result result = new Result(ResultEnum.SUCCESS);
return new Gson().toJson(result);
}
public static String success(Object obj) {
Result result = new Result(ResultEnum.SUCCESS, obj);
return new Gson().toJson(result);
}
public static String fail() {
Result result = new Result(ResultEnum.FAIL);
return new Gson().toJson(result);
}
public static String success(Integer code, String message) {
Result result = new Result(code, message);
return new Gson().toJson(result);
}
}
package com.cx.cn.cxquartz.util;
import java.util.concurrent.*;
import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy;
public class ThreadPoolUtil {
private static BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(5000);
private static final ExecutorService pool =new ThreadPoolExecutor(10, 30, 2L, TimeUnit.MINUTES,
queue , Executors.defaultThreadFactory(), new CallerRunsPolicy());
private static final ScheduledExecutorService schedulepool = Executors.newScheduledThreadPool(2);
public static ScheduledExecutorService getSchedulePool() {
return schedulepool;
}
public static ExecutorService getPool() {
return pool;
}
public static int getQueueSize(){
return queue.size();
}
public static void executeSchedule(Runnable thread){
getSchedulePool().execute(thread);
}
public static void execute(Runnable thread){
getPool().execute(thread);
}
}
package com.cx.cn.cxquartz.util;
import com.cx.cn.cxquartz.vo.TraffAlarmRecord;
/**
* TraffAlarmRecord4��������ͼƬXԴ��ַ
* @author cp
*/
public enum TraffAlarmRecordFromImgEnum implements TraffAlarmRecordImg {
/**
* ����ͼƬ���õ�ַ
*/
IMG0 {
@Override
public void setImg(TraffAlarmRecord traffAlarmRecord, String img) {
traffAlarmRecord.setImg1urlfrom(img);
}
}
}
package com.cx.cn.cxquartz.util;
import com.cx.cn.cxquartz.vo.TraffAlarmRecord;
/**
* TraffAlarmRecordͼƬӿ
* @author cp
*/
public interface TraffAlarmRecordImg {
void setImg(TraffAlarmRecord traffAlarmRecord, String img);
}
package com.cx.cn.cxquartz.util;
import java.util.UUID;
public class UUIDUtils {
/**
* UUID
* @return String32λUUID
*/
public static String createuuid() {
return UUID.randomUUID().toString().replaceAll("-", "");
}
}
package com.cx.cn.cxquartz.vo;
import java.io.Serializable;
public class Code implements Serializable {
private String key;
private String name;
private String type;
private String alarmlevel;
private Integer rectifytime ;
private Integer manualchecktime;
private Integer pushchecktime ;
private Integer maxnum;
private Integer alarmnum;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getAlarmlevel() {
return alarmlevel;
}
public void setAlarmlevel(String alarmlevel) {
this.alarmlevel = alarmlevel;
}
public Integer getRectifytime() {
return rectifytime;
}
public void setRectifytime(Integer rectifytime) {
this.rectifytime = rectifytime;
}
public Integer getManualchecktime() {
return manualchecktime;
}
public void setManualchecktime(Integer manualchecktime) {
this.manualchecktime = manualchecktime;
}
public Integer getPushchecktime() {
return pushchecktime;
}
public void setPushchecktime(Integer pushchecktime) {
this.pushchecktime = pushchecktime;
}
public Integer getMaxnum() {
return maxnum;
}
public void setMaxnum(Integer maxnum) {
this.maxnum = maxnum;
}
public Integer getAlarmnum() {
return alarmnum;
}
public void setAlarmnum(Integer alarmnum) {
this.alarmnum = alarmnum;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class Face {
@JsonIgnore
private Long id;
private String Type;
private FaceBoundingBox FaceBoundingBox;
private HeadBoundingBox HeadBoundingBox;
private String Gender;
private String Age;
private String HasGlasses;
private String HasHat;
private String HasMask;
private String HairStyle;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setType(String Type) {
this.Type = Type;
}
public String getType() {
return Type;
}
public void setFaceBoundingBox(FaceBoundingBox FaceBoundingBox) {
this.FaceBoundingBox = FaceBoundingBox;
}
public FaceBoundingBox getFaceBoundingBox() {
return FaceBoundingBox;
}
public void setHeadBoundingBox(HeadBoundingBox HeadBoundingBox) {
this.HeadBoundingBox = HeadBoundingBox;
}
public HeadBoundingBox getHeadBoundingBox() {
return HeadBoundingBox;
}
public void setGender(String Gender) {
this.Gender = Gender;
}
public String getGender() {
return Gender;
}
public void setAge(String Age) {
this.Age = Age;
}
public String getAge() {
return Age;
}
public void setHasGlasses(String HasGlasses) {
this.HasGlasses = HasGlasses;
}
public String getHasGlasses() {
return HasGlasses;
}
public void setHasHat(String HasHat) {
this.HasHat = HasHat;
}
public String getHasHat() {
return HasHat;
}
public void setHasMask(String HasMask) {
this.HasMask = HasMask;
}
public String getHasMask() {
return HasMask;
}
public void setHairStyle(String HairStyle) {
this.HairStyle = HairStyle;
}
public String getHairStyle() {
return HairStyle;
}
}
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class FaceBoundingBox {
private int x;
private int y;
private int w;
private int h;
public void setX(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setY(int y) {
this.y = y;
}
public int getY() {
return y;
}
public void setW(int w) {
this.w = w;
}
public int getW() {
return w;
}
public void setH(int h) {
this.h = h;
}
public int getH() {
return h;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import java.util.Date;
public class FileUploadResult {
private String filename;
private String url;
private String localuri;
private long length;
private Date timestamp;
public void setFilename(String filename) {
this.filename = filename;
}
public String getFilename() {
return filename;
}
public void setUrl(String url) {
this.url = url;
}
public String getUrl() {
return url;
}
public void setLocaluri(String localuri) {
this.localuri = localuri;
}
public String getLocaluri() {
return localuri;
}
public void setLength(long length) {
this.length = length;
}
public long getLength() {
return length;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Date getTimestamp() {
return timestamp;
}
}
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
import java.util.List;
public class FileUploadResultVo {
@JsonProperty("Url")
private String Url;
@JsonProperty("Error")
private String Error;
@JsonProperty("Code")
private int Code;
@JsonProperty("StackTrace")
private String StackTrace;
@JsonProperty("Data")
private List<FileUploadResult> Data;
@JsonProperty("ID")
private String ID;
public void setUrl(String Url) {
this.Url = Url;
}
public String getUrl() {
return Url;
}
public void setError(String Error) {
this.Error = Error;
}
public String getError() {
return Error;
}
public void setCode(int Code) {
this.Code = Code;
}
public int getCode() {
return Code;
}
public void setStackTrace(String StackTrace) {
this.StackTrace = StackTrace;
}
public String getStackTrace() {
return StackTrace;
}
public List<FileUploadResult> getData() {
return Data;
}
public void setData(List<FileUploadResult> data) {
Data = data;
}
public void setID(String ID) {
this.ID = ID;
}
public String getID() {
return ID;
}
}
package com.cx.cn.cxquartz.vo;
public class Ftp {
private String ftpIp;
private Integer ftpPort;
private String ftpUsername;
private String ftpPassword;
public Ftp() {
}
public Ftp(String ftpIp, Integer ftpPort, String ftpUsername, String ftpPassword) {
this.ftpIp = ftpIp;
this.ftpPort = ftpPort;
this.ftpUsername = ftpUsername;
this.ftpPassword = ftpPassword;
}
public String getFtpIp() {
return ftpIp;
}
public void setFtpIp(String ftpIp) {
this.ftpIp = ftpIp;
}
public Integer getFtpPort() {
return ftpPort;
}
public void setFtpPort(Integer ftpPort) {
this.ftpPort = ftpPort;
}
public String getFtpUsername() {
return ftpUsername;
}
public void setFtpUsername(String ftpUsername) {
this.ftpUsername = ftpUsername;
}
public String getFtpPassword() {
return ftpPassword;
}
public void setFtpPassword(String ftpPassword) {
this.ftpPassword = ftpPassword;
}
@Override
public String toString() {
return "Ftp{" +
"ftpIp='" + ftpIp + '\'' +
", ftpPort=" + ftpPort +
", ftpUsername='" + ftpUsername + '\'' +
", ftpPassword='" + ftpPassword + '\'' +
'}';
}
}
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class GoalStructureParam {
@JsonProperty("Output")
private Output Output;
@JsonProperty("Model")
private int Model;
@JsonIgnore
private String apiout;
@JsonProperty("ImageList")
private List<ImageList> ImageList;
public void setOutput(Output Output) {
this.Output = Output;
}
public Output getOutput() {
return this.Output;
}
public void setModel(int Model) {
this.Model = Model;
}
public int getModel() {
return this.Model;
}
public void setApiout(String apiout) {
this.apiout = apiout;
}
public String getApiout() {
return this.apiout;
}
public void setImageList(List<ImageList> ImageList) {
this.ImageList = ImageList;
}
public List<ImageList> getImageList() {
return this.ImageList;
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class HeadBoundingBox {
private int x;
private int y;
private int w;
private int h;
public void setX(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setY(int y) {
this.y = y;
}
public int getY() {
return y;
}
public void setW(int w) {
this.w = w;
}
public int getW() {
return w;
}
public void setH(int h) {
this.h = h;
}
public int getH() {
return h;
}
}
\ 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 {
@JsonProperty("ImageID")
private String ImageID;
@JsonProperty("Roi")
private Long[] Roi;
@JsonIgnore
private int Format;
@JsonProperty("Data")
private String Data;
// private Integer RoiPadding;
private Integer CropObjectImage;
private Integer CropObjectImagePadding;
private Integer CropObjectImageQuality;
public Long[] getRoi() {
return Roi;
}
public void setRoi(Long[] roi) {
Roi = roi;
}
// public Integer getRoiPadding() {
// return RoiPadding;
// }
//
// public void setRoiPadding(Integer roiPadding) {
// RoiPadding = roiPadding;
// }
public Integer getCropObjectImage() {
return CropObjectImage;
}
public void setCropObjectImage(Integer cropObjectImage) {
CropObjectImage = cropObjectImage;
}
public Integer getCropObjectImagePadding() {
return CropObjectImagePadding;
}
public void setCropObjectImagePadding(Integer cropObjectImagePadding) {
CropObjectImagePadding = cropObjectImagePadding;
}
public Integer getCropObjectImageQuality() {
return CropObjectImageQuality;
}
public void setCropObjectImageQuality(Integer cropObjectImageQuality) {
CropObjectImageQuality = cropObjectImageQuality;
}
public ImageList(String imageID, String data) {
ImageID = imageID;
Data = data;
}
public ImageList(String imageID, Long[] roi, Integer roiPadding, Integer cropObjectImage, Integer cropObjectImagePadding, Integer cropObjectImageQuality, String data) {
ImageID = imageID;
Roi = roi;
// RoiPadding = roiPadding;
CropObjectImage = cropObjectImage;
CropObjectImagePadding = cropObjectImagePadding;
CropObjectImageQuality = cropObjectImageQuality;
Data = data;
}
public ImageList() {
}
public void setImageID(String ImageID){
this.ImageID = ImageID;
}
public String getImageID(){
return this.ImageID;
}
public void setFormat(int Format){
this.Format = Format;
}
public int getFormat(){
return this.Format;
}
public void setData(String Data){
this.Data = Data;
}
public String getData(){
return this.Data;
}
}
package com.cx.cn.cxquartz.vo;
import java.util.List;
import java.util.Map;
public class JobParam {
private String detectType;
private String deviceId;
private String type;
private String name;
private Map params;
private String callBackUrl;
private List<Point> area;
public String getDetectType() {
return detectType;
}
public void setDetectType(String detectType) {
this.detectType = detectType;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map getParams() {
return params;
}
public void setParams(Map params) {
this.params = params;
}
public String getCallBackUrl() {
return callBackUrl;
}
public void setCallBackUrl(String callBackUrl) {
this.callBackUrl = callBackUrl;
}
public List<Point> getArea() {
return area;
}
public void setArea(List<Point> area) {
this.area = area;
}
}
package com.cx.cn.cxquartz.vo;
public class JobTjParam {
private String detectType;
private String deviceId;
private String imageUrl;
private Object detectInfo;
private Long timestamp;
public String getDetectType() {
return detectType;
}
public void setDetectType(String detectType) {
this.detectType = detectType;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public Object getDetectInfo() {
return detectInfo;
}
public void setDetectInfo(Object detectInfo) {
this.detectInfo = detectInfo;
}
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
@Override
public String toString() {
return "JobTjParam{" +
"detectType='" + detectType + '\'' +
", deviceId='" + deviceId + '\'' +
", imageUrl='" + imageUrl + '\'' +
", detectInfo=" + detectInfo +
", timestamp=" + timestamp +
'}';
}
}
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class Location {
private int x1;
private int y1;
private int x2;
private int y2;
public int getX1() {
return x1;
}
public void setX1(int x1) {
this.x1 = x1;
}
public int getY1() {
return y1;
}
public void setY1(int y1) {
this.y1 = y1;
}
public int getX2() {
return x2;
}
public void setX2(int x2) {
this.x2 = x2;
}
public int getY2() {
return y2;
}
public void setY2(int y2) {
this.y2 = y2;
}
public Location(int x1, int y1, int x2, int y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
public Location() {
}
@Override
public String toString() {
return "Location{" +
"x1=" + x1 +
", y1=" + y1 +
", x2=" + x2 +
", y2=" + y2 +
'}';
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class LowerBoundingBox {
private int x;
private int y;
private int w;
private int h;
public void setX(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setY(int y) {
this.y = y;
}
public int getY() {
return y;
}
public void setW(int w) {
this.w = w;
}
public int getW() {
return w;
}
public void setH(int h) {
this.h = h;
}
public int getH() {
return h;
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
import java.util.List;
public class Metadata {
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class ObjectBoundingBox {
private int x;
private int y;
private int w;
private int h;
public ObjectBoundingBox(int x, int y, int w, int h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
public void setX(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setY(int y) {
this.y = y;
}
public int getY() {
return y;
}
public void setW(int w) {
this.w = w;
}
public int getW() {
return w;
}
public void setH(int h) {
this.h = h;
}
public int getH() {
return h;
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
import java.util.List;
public class ObjectList {
private String ImageID;
private int ObjectID;
private Metadata Metadata;
private String Feature;
private int BucketID;
private List<Integer> BucketIDList;
private String FaceFeature;
private int FaceBucketID;
private List<Integer> FaceBucketIDList;
private String FaceQuality;
private String FaceYaw;
private String FacePitch;
private String FaceRoll;
private String FaceBlurry;
private String ObjectImageData;
private String FaceImageData;
private int Index;
public void setImageID(String ImageID) {
this.ImageID = ImageID;
}
public String getImageID() {
return ImageID;
}
public void setObjectID(int ObjectID) {
this.ObjectID = ObjectID;
}
public int getObjectID() {
return ObjectID;
}
public void setMetadata(Metadata Metadata) {
this.Metadata = Metadata;
}
public Metadata getMetadata() {
return Metadata;
}
public void setFeature(String Feature) {
this.Feature = Feature;
}
public String getFeature() {
return Feature;
}
public void setBucketID(int BucketID) {
this.BucketID = BucketID;
}
public int getBucketID() {
return BucketID;
}
public void setBucketIDList(List<Integer> BucketIDList) {
this.BucketIDList = BucketIDList;
}
public List<Integer> getBucketIDList() {
return BucketIDList;
}
public void setFaceFeature(String FaceFeature) {
this.FaceFeature = FaceFeature;
}
public String getFaceFeature() {
return FaceFeature;
}
public void setFaceBucketID(int FaceBucketID) {
this.FaceBucketID = FaceBucketID;
}
public int getFaceBucketID() {
return FaceBucketID;
}
public void setFaceBucketIDList(List<Integer> FaceBucketIDList) {
this.FaceBucketIDList = FaceBucketIDList;
}
public List<Integer> getFaceBucketIDList() {
return FaceBucketIDList;
}
public void setFaceQuality(String FaceQuality) {
this.FaceQuality = FaceQuality;
}
public String getFaceQuality() {
return FaceQuality;
}
public void setFaceYaw(String FaceYaw) {
this.FaceYaw = FaceYaw;
}
public String getFaceYaw() {
return FaceYaw;
}
public void setFacePitch(String FacePitch) {
this.FacePitch = FacePitch;
}
public String getFacePitch() {
return FacePitch;
}
public void setFaceRoll(String FaceRoll) {
this.FaceRoll = FaceRoll;
}
public String getFaceRoll() {
return FaceRoll;
}
public void setFaceBlurry(String FaceBlurry) {
this.FaceBlurry = FaceBlurry;
}
public String getFaceBlurry() {
return FaceBlurry;
}
public void setObjectImageData(String ObjectImageData) {
this.ObjectImageData = ObjectImageData;
}
public String getObjectImageData() {
return ObjectImageData;
}
public void setFaceImageData(String FaceImageData) {
this.FaceImageData = FaceImageData;
}
public String getFaceImageData() {
return FaceImageData;
}
public void setIndex(int Index) {
this.Index = Index;
}
public int getIndex() {
return Index;
}
public ObjectList() {
}
public ObjectList(String imageID, int objectID, com.cx.cn.cxquartz.vo.Metadata metadata, String feature, int bucketID, List<Integer> bucketIDList, String faceFeature, int faceBucketID, List<Integer> faceBucketIDList, String faceQuality, String faceYaw, String facePitch, String faceRoll, String faceBlurry, String objectImageData, String faceImageData, int index) {
ImageID = imageID;
ObjectID = objectID;
Metadata = metadata;
Feature = feature;
BucketID = bucketID;
BucketIDList = bucketIDList;
FaceFeature = faceFeature;
FaceBucketID = faceBucketID;
FaceBucketIDList = faceBucketIDList;
FaceQuality = faceQuality;
FaceYaw = faceYaw;
FacePitch = facePitch;
FaceRoll = faceRoll;
FaceBlurry = faceBlurry;
ObjectImageData = objectImageData;
FaceImageData = faceImageData;
Index = index;
}
}
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class ObjectListResult {
private ObjectResult recogdata;
private int ret;
private String desc;
private String url;
private String localuri;
private String timestamp;
public int getRet() {
return ret;
}
public void setRet(int ret) {
this.ret = ret;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLocaluri() {
return localuri;
}
public void setLocaluri(String localuri) {
this.localuri = localuri;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
public ObjectResult getRecogdata() {
return recogdata;
}
public void setRecogdata(ObjectResult recogdata) {
this.recogdata = recogdata;
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
import java.util.List;
public class ObjectResult {
private List<ObjectList> ObjectList;
private String ret;
private String error_msg;
public ObjectResult() {
}
public ObjectResult(List<com.cx.cn.cxquartz.vo.ObjectList> objectList, String ret, String error_msg) {
ObjectList = objectList;
this.ret = ret;
this.error_msg = error_msg;
}
public List<com.cx.cn.cxquartz.vo.ObjectList> getObjectList() {
return ObjectList;
}
public void setObjectList(List<com.cx.cn.cxquartz.vo.ObjectList> objectList) {
ObjectList = objectList;
}
public String getRet() {
return ret;
}
public void setRet(String ret) {
this.ret = ret;
}
public String getError_msg() {
return error_msg;
}
public void setError_msg(String error_msg) {
this.error_msg = error_msg;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Output {
private int SubClass;
// //最大行人细类输出个数为1
// @JsonIgnore
// private int MaxHumanSubClassNum;
//
// //最大车辆细类输出个数为输出全部
// @JsonIgnore
// private int MaxVehicleSubClassNum;
// //最大骑行细类输出个数为3
// @JsonIgnore
// private int MaxBikeSubClassNum;
public Output(int subClass) {
SubClass = subClass;
// MaxHumanSubClassNum = maxHumanSubClassNum;
// MaxVehicleSubClassNum = maxVehicleSubClassNum;
// MaxBikeSubClassNum = maxBikeSubClassNum;
}
public Output() {
}
public void setSubClass(int SubClass) {
this.SubClass = SubClass;
}
@JsonProperty("SubClass")
public int getSubClass() {
return this.SubClass;
}
//
// public void setMaxHumanSubClassNum(int MaxHumanSubClassNum) {
// this.MaxHumanSubClassNum = MaxHumanSubClassNum;
// }
//
// @JSONField(name = "MaxHumanSubClassNum")
// public int getMaxHumanSubClassNum() {
// return this.MaxHumanSubClassNum;
// }
//
// public void setMaxVehicleSubClassNum(int MaxVehicleSubClassNum) {
// this.MaxVehicleSubClassNum = MaxVehicleSubClassNum;
// }
//
// @JSONField(name = "MaxVehicleSubClassNum")
// public int getMaxVehicleSubClassNum() {
// return this.MaxVehicleSubClassNum;
// }
//
// public void setMaxBikeSubClassNum(int MaxBikeSubClassNum) {
// this.MaxBikeSubClassNum = MaxBikeSubClassNum;
// }
//
// @JSONField(name = "MaxBikeSubClassNum")
// public int getMaxBikeSubClassNum() {
// return this.MaxBikeSubClassNum;
// }
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
/***
* 行人
*/
public class Pedestrian {
@JsonIgnore
private Long id;
private String Type;
private ObjectBoundingBox ObjectBoundingBox;
private String Gender;
private String Age;
private String Angle;
private String HasBackpack;
private String HasGlasses;
private String HasCarrybag;
private String HasUmbrella;
private String CoatLength;
private String CoatColorNums;
private String CoatColor;
private String TrousersLength;
private String TrousersColorNums;
private String TrousersColor;
private HeadBoundingBox HeadBoundingBox;
private UpperBoundingBox UpperBoundingBox;
private LowerBoundingBox LowerBoundingBox;
private FaceBoundingBox FaceBoundingBox;
private String HasHat;
private String HasMask;
private String HairStyle;
private String CoatTexture;
private String TrousersTexture;
private String HasTrolley;
private String HasLuggage;
private String LuggageColorNums;
private String LuggageColor;
private int HasKnife;
public void setType(String Type) {
this.Type = Type;
}
@JSONField(name = "Type")
public String getType() {
return Type;
}
public void setObjectBoundingBox(ObjectBoundingBox ObjectBoundingBox) {
this.ObjectBoundingBox = ObjectBoundingBox;
}
@JSONField(name = "ObjectBoundingBox")
public ObjectBoundingBox getObjectBoundingBox() {
return ObjectBoundingBox;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setGender(String Gender) {
this.Gender = Gender;
}
@JSONField(name = "Gender")
public String getGender() {
return Gender;
}
public void setAge(String Age) {
this.Age = Age;
}
@JSONField(name = "Age")
public String getAge() {
return Age;
}
public void setAngle(String Angle) {
this.Angle = Angle;
}
@JSONField(name = "Angle")
public String getAngle() {
return Angle;
}
public void setHasBackpack(String HasBackpack) {
this.HasBackpack = HasBackpack;
}
@JSONField(name = "HasBackpack")
public String getHasBackpack() {
return HasBackpack;
}
public void setHasGlasses(String HasGlasses) {
this.HasGlasses = HasGlasses;
}
@JSONField(name = "HasGlasses")
public String getHasGlasses() {
return HasGlasses;
}
public void setHasCarrybag(String HasCarrybag) {
this.HasCarrybag = HasCarrybag;
}
@JSONField(name = "HasCarrybag")
public String getHasCarrybag() {
return HasCarrybag;
}
public void setHasUmbrella(String HasUmbrella) {
this.HasUmbrella = HasUmbrella;
}
@JSONField(name = "HasUmbrella")
public String getHasUmbrella() {
return HasUmbrella;
}
public void setCoatLength(String CoatLength) {
this.CoatLength = CoatLength;
}
@JSONField(name = "CoatLength")
public String getCoatLength() {
return CoatLength;
}
public void setCoatColorNums(String CoatColorNums) {
this.CoatColorNums = CoatColorNums;
}
@JSONField(name = "CoatColorNums")
public String getCoatColorNums() {
return CoatColorNums;
}
public void setTrousersLength(String TrousersLength) {
this.TrousersLength = TrousersLength;
}
@JSONField(name = "TrousersLength")
public String getTrousersLength() {
return TrousersLength;
}
public void setTrousersColorNums(String TrousersColorNums) {
this.TrousersColorNums = TrousersColorNums;
}
@JSONField(name = "TrousersColorNums")
public String getTrousersColorNums() {
return TrousersColorNums;
}
public void setHeadBoundingBox(HeadBoundingBox HeadBoundingBox) {
this.HeadBoundingBox = HeadBoundingBox;
}
@JSONField(name = "HeadBoundingBox")
public HeadBoundingBox getHeadBoundingBox() {
return HeadBoundingBox;
}
public void setUpperBoundingBox(UpperBoundingBox UpperBoundingBox) {
this.UpperBoundingBox = UpperBoundingBox;
}
@JSONField(name = "UpperBoundingBox")
public UpperBoundingBox getUpperBoundingBox() {
return UpperBoundingBox;
}
public void setLowerBoundingBox(LowerBoundingBox LowerBoundingBox) {
this.LowerBoundingBox = LowerBoundingBox;
}
@JSONField(name = "LowerBoundingBox")
public LowerBoundingBox getLowerBoundingBox() {
return LowerBoundingBox;
}
public void setFaceBoundingBox(FaceBoundingBox FaceBoundingBox) {
this.FaceBoundingBox = FaceBoundingBox;
}
@JSONField(name = "FaceBoundingBox")
public FaceBoundingBox getFaceBoundingBox() {
return FaceBoundingBox;
}
public void setHasHat(String HasHat) {
this.HasHat = HasHat;
}
@JSONField(name = "HasHat")
public String getHasHat() {
return HasHat;
}
public void setHasMask(String HasMask) {
this.HasMask = HasMask;
}
@JSONField(name = "HasMask")
public String getHasMask() {
return HasMask;
}
public void setHairStyle(String HairStyle) {
this.HairStyle = HairStyle;
}
@JSONField(name = "HairStyle")
public String getHairStyle() {
return HairStyle;
}
public void setCoatTexture(String CoatTexture) {
this.CoatTexture = CoatTexture;
}
@JSONField(name = "CoatTexture")
public String getCoatTexture() {
return CoatTexture;
}
public void setTrousersTexture(String TrousersTexture) {
this.TrousersTexture = TrousersTexture;
}
@JSONField(name = "TrousersTexture")
public String getTrousersTexture() {
return TrousersTexture;
}
public void setHasTrolley(String HasTrolley) {
this.HasTrolley = HasTrolley;
}
@JSONField(name = "HasTrolley")
public String getHasTrolley() {
return HasTrolley;
}
public void setHasLuggage(String HasLuggage) {
this.HasLuggage = HasLuggage;
}
@JSONField(name = "HasLuggage")
public String getHasLuggage() {
return HasLuggage;
}
public void setLuggageColorNums(String LuggageColorNums) {
this.LuggageColorNums = LuggageColorNums;
}
@JSONField(name = "LuggageColorNums")
public String getLuggageColorNums() {
return LuggageColorNums;
}
public void setHasKnife(int HasKnife) {
this.HasKnife = HasKnife;
}
@JSONField(name = "HasKnife")
public int getHasKnife() {
return HasKnife;
}
@JSONField(name = "CoatColor")
public String getCoatColor() {
return CoatColor;
}
public void setCoatColor(String coatColor) {
CoatColor = coatColor;
}
@JSONField(name = "TrousersColor")
public String getTrousersColor() {
return TrousersColor;
}
public void setTrousersColor(String trousersColor) {
TrousersColor = trousersColor;
}
@JSONField(name = "LuggageColor")
public String getLuggageColor() {
return LuggageColor;
}
public void setLuggageColor(String luggageColor) {
LuggageColor = luggageColor;
}
}
package com.cx.cn.cxquartz.vo;
import java.util.List;
public class PeopleRideBicyc {
private Long id;
private String Type;
private ObjectBoundingBox ObjectBoundingBox;
private String BikeClass;
private String Gender;
private String Age;
private String Angle;
private String HasBackpack;
private String HasGlasses;
private String HasMask;
private String HasCarrybag;
private String HasUmbrella;
private String CoatLength;
private String HasPlate;
private String PlateNo;
private String HasHelmet;
private String HelmetColor;
private String CoatColorNums;
private String CoatColor;
private String CoatTexture;
private FaceBoundingBox FaceBoundingBox;
private String SocialAttribute;
private String Enterprise;
private String HasPassenger;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setType(String Type) {
this.Type = Type;
}
public String getType() {
return Type;
}
public void setObjectBoundingBox(ObjectBoundingBox ObjectBoundingBox) {
this.ObjectBoundingBox = ObjectBoundingBox;
}
public ObjectBoundingBox getObjectBoundingBox() {
return ObjectBoundingBox;
}
public void setBikeClass(String BikeClass) {
this.BikeClass = BikeClass;
}
public String getBikeClass() {
return BikeClass;
}
public void setGender(String Gender) {
this.Gender = Gender;
}
public String getGender() {
return Gender;
}
public void setAge(String Age) {
this.Age = Age;
}
public String getAge() {
return Age;
}
public void setAngle(String Angle) {
this.Angle = Angle;
}
public String getAngle() {
return Angle;
}
public void setHasBackpack(String HasBackpack) {
this.HasBackpack = HasBackpack;
}
public String getHasBackpack() {
return HasBackpack;
}
public void setHasGlasses(String HasGlasses) {
this.HasGlasses = HasGlasses;
}
public String getHasGlasses() {
return HasGlasses;
}
public void setHasMask(String HasMask) {
this.HasMask = HasMask;
}
public String getHasMask() {
return HasMask;
}
public void setHasCarrybag(String HasCarrybag) {
this.HasCarrybag = HasCarrybag;
}
public String getHasCarrybag() {
return HasCarrybag;
}
public void setHasUmbrella(String HasUmbrella) {
this.HasUmbrella = HasUmbrella;
}
public String getHasUmbrella() {
return HasUmbrella;
}
public void setCoatLength(String CoatLength) {
this.CoatLength = CoatLength;
}
public String getCoatLength() {
return CoatLength;
}
public void setHasPlate(String HasPlate) {
this.HasPlate = HasPlate;
}
public String getHasPlate() {
return HasPlate;
}
public void setPlateNo(String PlateNo) {
this.PlateNo = PlateNo;
}
public String getPlateNo() {
return PlateNo;
}
public void setHasHelmet(String HasHelmet) {
this.HasHelmet = HasHelmet;
}
public String getHasHelmet() {
return HasHelmet;
}
public void setHelmetColor(String HelmetColor) {
this.HelmetColor = HelmetColor;
}
public String getHelmetColor() {
return HelmetColor;
}
public void setCoatColorNums(String CoatColorNums) {
this.CoatColorNums = CoatColorNums;
}
public String getCoatColorNums() {
return CoatColorNums;
}
public String getCoatColor() {
return CoatColor;
}
public void setCoatColor(String coatColor) {
CoatColor = coatColor;
}
public void setCoatTexture(String CoatTexture) {
this.CoatTexture = CoatTexture;
}
public String getCoatTexture() {
return CoatTexture;
}
public void setFaceBoundingBox(FaceBoundingBox FaceBoundingBox) {
this.FaceBoundingBox = FaceBoundingBox;
}
public FaceBoundingBox getFaceBoundingBox() {
return FaceBoundingBox;
}
public void setSocialAttribute(String SocialAttribute) {
this.SocialAttribute = SocialAttribute;
}
public String getSocialAttribute() {
return SocialAttribute;
}
public void setEnterprise(String Enterprise) {
this.Enterprise = Enterprise;
}
public String getEnterprise() {
return Enterprise;
}
public void setHasPassenger(String HasPassenger) {
this.HasPassenger = HasPassenger;
}
public String getHasPassenger() {
return HasPassenger;
}
}
package com.cx.cn.cxquartz.vo;
public class PictureResult {
Long recordid;
String key;
String result;
public PictureResult(Long recordid, String key, String result) {
this.recordid = recordid;
this.key = key;
this.result = result;
}
public Long getRecordid() {
return recordid;
}
public void setRecordid(Long recordid) {
this.recordid = recordid;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
public class Point {
int x;
int y;
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
package com.cx.cn.cxquartz.vo;
public class QuartzTaskRecordsVo
{
private Long id;
private String taskno;
private String timekeyvalue;
private Long executetime;
private String taskstatus;
private Integer failcount;
private String failreason;
private Long createtime;
private Long lastmodifytime;
private Long time;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTaskno() {
return taskno;
}
public void setTaskno(String taskno) {
this.taskno = taskno;
}
public String getTimekeyvalue() {
return timekeyvalue;
}
public void setTimekeyvalue(String timekeyvalue) {
this.timekeyvalue = timekeyvalue;
}
public Long getExecutetime() {
return executetime;
}
public void setExecutetime(Long executetime) {
this.executetime = executetime;
}
public String getTaskstatus() {
return taskstatus;
}
public void setTaskstatus(String taskstatus) {
this.taskstatus = taskstatus;
}
public Integer getFailcount() {
return failcount;
}
public void setFailcount(Integer failcount) {
this.failcount = failcount;
}
public String getFailreason() {
return failreason;
}
public void setFailreason(String failreason) {
this.failreason = failreason;
}
public Long getCreatetime() {
return createtime;
}
public void setCreatetime(Long createtime) {
this.createtime = createtime;
}
public Long getLastmodifytime() {
return lastmodifytime;
}
public void setLastmodifytime(Long lastmodifytime) {
this.lastmodifytime = lastmodifytime;
}
public Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
}
package com.cx.cn.cxquartz.vo;
public enum ResponseEnum {
/* 错误信息 */
E_1000(1000, "返回值必须为PageResult"),
E_1001(1001, "必须传递分页参数"),
E_1002(1002, "参数值异常"),
E_1003(1003, "参数值转换异常"),
E_1004(1004, "参数值为空"),
/* 保存 更新 重置 删除 等 */
E_1005(1005,"更新失败"),
E_1006(1006,"无结果"),
E_1007(1007,"未登录"),
E_1008(1008,"请求超时"),
E_1009(1009,"请求下游服务异常"),
E_1010(1010,"数据保存失败"),
E_1011(1011,"数据重复"),
E_9999(9999,"系统异常"),
SUCCESS(0,"请求成功");
private int code;
private String msg;
ResponseEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;
public class ResultObj {
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
* 响应业务状态
* 200 成功
* 201 错误
* 400 参数错误
*/
private String code;
/**
* 响应消息
*/
private String msg;
/**
* 响应中的数据
*/
private Object obj;
public static ResultObj error(String status, String msg, Object data) {
return new ResultObj(status, msg, data);
}
public static ResultObj ok(Object data) {
return new ResultObj(data);
}
public static ResultObj ok() {
return ok(null);
}
private ResultObj() {
}
public static ResultObj error(String status, String msg) {
return new ResultObj(status, msg, null);
}
private ResultObj(String status, String msg, Object data) {
this.code = status;
this.msg = msg;
this.obj = data;
}
private ResultObj(Object data) {
this.code = "200";
this.msg = "OK";
this.obj = data;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getObj() {
return obj;
}
public void setObj(Object obj) {
this.obj = obj;
}
/**
* 将json结果集转化为SysResult对象
*
* @param jsonData json数据
* @param clazz SysResult中的object类型
* @return SysResult对象
*/
public static ResultObj formatToPojo(String jsonData, Class<?> clazz) {
try {
if (clazz == null) {
return MAPPER.readValue(jsonData, ResultObj.class);
}
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isObject()) {
obj = MAPPER.readValue(data.traverse(), clazz);
} else if (data.isTextual()) {
obj = MAPPER.readValue(data.asText(), clazz);
}
return error(jsonNode.get("status").toString(), jsonNode.get("msg").asText(), obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 没有object对象的转化
*
* @param json 字符串
* @return SysResult对象
*/
public static ResultObj format(String json) {
try {
return MAPPER.readValue(json, ResultObj.class);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* Object是集合转化
*
* @param jsonData json数据
* @param clazz 集合中的类型
* @return SysResult对象
*/
public static ResultObj formatToList(String jsonData, Class<?> clazz) {
try {
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isArray() && data.size() > 0) {
obj = MAPPER.readValue(data.traverse(),
MAPPER.getTypeFactory().constructCollectionType(List.class, clazz));
}
return error(jsonNode.get("status").toString(), jsonNode.get("msg").asText(), obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
public String toString() {
return "ResultObj{" +
"code=" + code +
", msg='" + msg + '\'' +
", obj=" + obj +
'}';
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
public class SafetyBelt {
private String MainDriver;
private String CoDriver;
public void setMainDriver(String MainDriver) {
this.MainDriver = MainDriver;
}
public String getMainDriver() {
return MainDriver;
}
public void setCoDriver(String CoDriver) {
this.CoDriver = CoDriver;
}
public String getCoDriver() {
return CoDriver;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
public class Sbtdspsr {
private String xh;
private String sbbh;
private Integer tdbh;
private Long tdlx;
private String wbbh;
private String tdmc;
private String tdmcpy;
private Long tdzt;
private String tdazwz;
private String jd;
private String wd;
private Long tpwzx;
private Long tpwzy;
private Long spbmgs;
private Long spxsgs;
private Long ssspsfzzf;
private Long spzt;
private Long lxzt;
private Long lxsfzzf;
private Long spzl;
private Long gjzjg;
private Long ml;
private Long spmlyxgs;
private Long sfzcptzkz;
private String zxcczbh;
private Long zxccxe;
private Long zxccyyrl;
private Long zxccsyrl;
private Long lxblts;
private Long sfqy;
private String jlbh;
private String fxms;
private String jbms;
private String xzbh;
private String ggbh;
private String znbh;
private Long lxfs;
private String jpkzdh;
private Long jdpx;
private Long sfznfxjd;
private String znfxlx;
private Long sqms;
private String squrllj;
private Long ssmlxz;
private Long lxmlxz;
private String zburllj;
private Long zbdk;
private Long dqx;
private Long xqx;
private Long kqx;
private Long pqx;
private Long lxhfqx;
private Long lxxzqx;
private Long lxdjqx;
private Long sfzlx;
private Long sfzx;
private String hb;
private String jmcj;
private String sj;
private Long lxlrcyfs;
private String khdosdxsnr;
private String khdosdxswz;
private String cjry;
private String cjrq;
private String xgry;
private String xgrq;
private String bz;
private Long kz1;
private Long kz2;
private String kz3;
private String kz4;
private static final long serialVersionUID = 1L;
public String getXh() {
return xh;
}
public void setXh(String xh) {
this.xh = xh;
}
public String getSbbh() {
return sbbh;
}
public void setSbbh(String sbbh) {
this.sbbh = sbbh;
}
public Integer getTdbh() {
return tdbh;
}
public void setTdbh(Integer tdbh) {
this.tdbh = tdbh;
}
public Long getTdlx() {
return tdlx;
}
public void setTdlx(Long tdlx) {
this.tdlx = tdlx;
}
public String getWbbh() {
return wbbh;
}
public void setWbbh(String wbbh) {
this.wbbh = wbbh;
}
public String getTdmc() {
return tdmc;
}
public void setTdmc(String tdmc) {
this.tdmc = tdmc;
}
public String getTdmcpy() {
return tdmcpy;
}
public void setTdmcpy(String tdmcpy) {
this.tdmcpy = tdmcpy;
}
public Long getTdzt() {
return tdzt;
}
public void setTdzt(Long tdzt) {
this.tdzt = tdzt;
}
public String getTdazwz() {
return tdazwz;
}
public void setTdazwz(String tdazwz) {
this.tdazwz = tdazwz;
}
public String getJd() {
return jd;
}
public void setJd(String jd) {
this.jd = jd;
}
public String getWd() {
return wd;
}
public void setWd(String wd) {
this.wd = wd;
}
public Long getTpwzx() {
return tpwzx;
}
public void setTpwzx(Long tpwzx) {
this.tpwzx = tpwzx;
}
public Long getTpwzy() {
return tpwzy;
}
public void setTpwzy(Long tpwzy) {
this.tpwzy = tpwzy;
}
public Long getSpbmgs() {
return spbmgs;
}
public void setSpbmgs(Long spbmgs) {
this.spbmgs = spbmgs;
}
public Long getSpxsgs() {
return spxsgs;
}
public void setSpxsgs(Long spxsgs) {
this.spxsgs = spxsgs;
}
public Long getSsspsfzzf() {
return ssspsfzzf;
}
public void setSsspsfzzf(Long ssspsfzzf) {
this.ssspsfzzf = ssspsfzzf;
}
public Long getSpzt() {
return spzt;
}
public void setSpzt(Long spzt) {
this.spzt = spzt;
}
public Long getLxzt() {
return lxzt;
}
public void setLxzt(Long lxzt) {
this.lxzt = lxzt;
}
public Long getLxsfzzf() {
return lxsfzzf;
}
public void setLxsfzzf(Long lxsfzzf) {
this.lxsfzzf = lxsfzzf;
}
public Long getSpzl() {
return spzl;
}
public void setSpzl(Long spzl) {
this.spzl = spzl;
}
public Long getGjzjg() {
return gjzjg;
}
public void setGjzjg(Long gjzjg) {
this.gjzjg = gjzjg;
}
public Long getMl() {
return ml;
}
public void setMl(Long ml) {
this.ml = ml;
}
public Long getSpmlyxgs() {
return spmlyxgs;
}
public void setSpmlyxgs(Long spmlyxgs) {
this.spmlyxgs = spmlyxgs;
}
public Long getSfzcptzkz() {
return sfzcptzkz;
}
public void setSfzcptzkz(Long sfzcptzkz) {
this.sfzcptzkz = sfzcptzkz;
}
public String getZxcczbh() {
return zxcczbh;
}
public void setZxcczbh(String zxcczbh) {
this.zxcczbh = zxcczbh;
}
public Long getZxccxe() {
return zxccxe;
}
public void setZxccxe(Long zxccxe) {
this.zxccxe = zxccxe;
}
public Long getZxccyyrl() {
return zxccyyrl;
}
public void setZxccyyrl(Long zxccyyrl) {
this.zxccyyrl = zxccyyrl;
}
public Long getZxccsyrl() {
return zxccsyrl;
}
public void setZxccsyrl(Long zxccsyrl) {
this.zxccsyrl = zxccsyrl;
}
public Long getLxblts() {
return lxblts;
}
public void setLxblts(Long lxblts) {
this.lxblts = lxblts;
}
public Long getSfqy() {
return sfqy;
}
public void setSfqy(Long sfqy) {
this.sfqy = sfqy;
}
public String getJlbh() {
return jlbh;
}
public void setJlbh(String jlbh) {
this.jlbh = jlbh;
}
public String getFxms() {
return fxms;
}
public void setFxms(String fxms) {
this.fxms = fxms;
}
public String getJbms() {
return jbms;
}
public void setJbms(String jbms) {
this.jbms = jbms;
}
public String getXzbh() {
return xzbh;
}
public void setXzbh(String xzbh) {
this.xzbh = xzbh;
}
public String getGgbh() {
return ggbh;
}
public void setGgbh(String ggbh) {
this.ggbh = ggbh;
}
public String getZnbh() {
return znbh;
}
public void setZnbh(String znbh) {
this.znbh = znbh;
}
public Long getLxfs() {
return lxfs;
}
public void setLxfs(Long lxfs) {
this.lxfs = lxfs;
}
public String getJpkzdh() {
return jpkzdh;
}
public void setJpkzdh(String jpkzdh) {
this.jpkzdh = jpkzdh;
}
public Long getJdpx() {
return jdpx;
}
public void setJdpx(Long jdpx) {
this.jdpx = jdpx;
}
public Long getSfznfxjd() {
return sfznfxjd;
}
public void setSfznfxjd(Long sfznfxjd) {
this.sfznfxjd = sfznfxjd;
}
public String getZnfxlx() {
return znfxlx;
}
public void setZnfxlx(String znfxlx) {
this.znfxlx = znfxlx;
}
public Long getSqms() {
return sqms;
}
public void setSqms(Long sqms) {
this.sqms = sqms;
}
public String getSqurllj() {
return squrllj;
}
public void setSqurllj(String squrllj) {
this.squrllj = squrllj;
}
public Long getSsmlxz() {
return ssmlxz;
}
public void setSsmlxz(Long ssmlxz) {
this.ssmlxz = ssmlxz;
}
public Long getLxmlxz() {
return lxmlxz;
}
public void setLxmlxz(Long lxmlxz) {
this.lxmlxz = lxmlxz;
}
public String getZburllj() {
return zburllj;
}
public void setZburllj(String zburllj) {
this.zburllj = zburllj;
}
public Long getZbdk() {
return zbdk;
}
public void setZbdk(Long zbdk) {
this.zbdk = zbdk;
}
public Long getDqx() {
return dqx;
}
public void setDqx(Long dqx) {
this.dqx = dqx;
}
public Long getXqx() {
return xqx;
}
public void setXqx(Long xqx) {
this.xqx = xqx;
}
public Long getKqx() {
return kqx;
}
public void setKqx(Long kqx) {
this.kqx = kqx;
}
public Long getPqx() {
return pqx;
}
public void setPqx(Long pqx) {
this.pqx = pqx;
}
public Long getLxhfqx() {
return lxhfqx;
}
public void setLxhfqx(Long lxhfqx) {
this.lxhfqx = lxhfqx;
}
public Long getLxxzqx() {
return lxxzqx;
}
public void setLxxzqx(Long lxxzqx) {
this.lxxzqx = lxxzqx;
}
public Long getLxdjqx() {
return lxdjqx;
}
public void setLxdjqx(Long lxdjqx) {
this.lxdjqx = lxdjqx;
}
public Long getSfzlx() {
return sfzlx;
}
public void setSfzlx(Long sfzlx) {
this.sfzlx = sfzlx;
}
public Long getSfzx() {
return sfzx;
}
public void setSfzx(Long sfzx) {
this.sfzx = sfzx;
}
public String getHb() {
return hb;
}
public void setHb(String hb) {
this.hb = hb;
}
public String getJmcj() {
return jmcj;
}
public void setJmcj(String jmcj) {
this.jmcj = jmcj;
}
public String getSj() {
return sj;
}
public void setSj(String sj) {
this.sj = sj;
}
public Long getLxlrcyfs() {
return lxlrcyfs;
}
public void setLxlrcyfs(Long lxlrcyfs) {
this.lxlrcyfs = lxlrcyfs;
}
public String getKhdosdxsnr() {
return khdosdxsnr;
}
public void setKhdosdxsnr(String khdosdxsnr) {
this.khdosdxsnr = khdosdxsnr;
}
public String getKhdosdxswz() {
return khdosdxswz;
}
public void setKhdosdxswz(String khdosdxswz) {
this.khdosdxswz = khdosdxswz;
}
public String getCjry() {
return cjry;
}
public void setCjry(String cjry) {
this.cjry = cjry;
}
public String getCjrq() {
return cjrq;
}
public void setCjrq(String cjrq) {
this.cjrq = cjrq;
}
public String getXgry() {
return xgry;
}
public void setXgry(String xgry) {
this.xgry = xgry;
}
public String getXgrq() {
return xgrq;
}
public void setXgrq(String xgrq) {
this.xgrq = xgrq;
}
public String getBz() {
return bz;
}
public void setBz(String bz) {
this.bz = bz;
}
public Long getKz1() {
return kz1;
}
public void setKz1(Long kz1) {
this.kz1 = kz1;
}
public Long getKz2() {
return kz2;
}
public void setKz2(Long kz2) {
this.kz2 = kz2;
}
public String getKz3() {
return kz3;
}
public void setKz3(String kz3) {
this.kz3 = kz3;
}
public String getKz4() {
return kz4;
}
public void setKz4(String kz4) {
this.kz4 = kz4;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import java.io.Serializable;
import java.util.Date;
public class Storageserver{
private static final long serialVersionUID = 1L;
private Integer serverid;
private String servername;
private String servergroup;
private String servertype ;
private Integer serverstatus;
private String serveurl ;
private String serveip;
private String serverport;
private String serveruser;
private String serverpassword;
private String creator;
private Date createtime;
private String remark;
public Integer getServerid() {
return serverid;
}
public void setServerid(Integer serverid) {
this.serverid = serverid;
}
public String getServername() {
return servername;
}
public void setServername(String servername) {
this.servername = servername;
}
public String getServergroup() {
return servergroup;
}
public void setServergroup(String servergroup) {
this.servergroup = servergroup;
}
public String getServertype() {
return servertype;
}
public void setServertype(String servertype) {
this.servertype = servertype;
}
public Integer getServerstatus() {
return serverstatus;
}
public void setServerstatus(Integer serverstatus) {
this.serverstatus = serverstatus;
}
public String getServeurl() {
return serveurl;
}
public void setServeurl(String serveurl) {
this.serveurl = serveurl;
}
public String getServeip() {
return serveip;
}
public void setServeip(String serveip) {
this.serveip = serveip;
}
public String getServerport() {
return serverport;
}
public void setServerport(String serverport) {
this.serverport = serverport;
}
public String getServeruser() {
return serveruser;
}
public void setServeruser(String serveruser) {
this.serveruser = serveruser;
}
public String getServerpassword() {
return serverpassword;
}
public void setServerpassword(String serverpassword) {
this.serverpassword = serverpassword;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;
public class TaskResultObj {
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
* 响应业务状态
* 200 成功
* 201 错误
* 400 参数错误
*/
private String errorCode;
/**
* 响应消息
*/
private String errorMsg;
/**
* 响应中的数据
*/
private Object data;
public static TaskResultObj error(String status, String msg, Object data) {
return new TaskResultObj(status, msg, data);
}
public static TaskResultObj ok(Object data) {
return new TaskResultObj(data);
}
public static TaskResultObj ok() {
return ok(null);
}
private TaskResultObj() {
}
public static TaskResultObj error(String status, String msg) {
return new TaskResultObj(status, msg, null);
}
private TaskResultObj(String status, String msg, Object data) {
this.errorCode = status;
this.errorMsg = msg;
this.data = data;
}
private TaskResultObj(Object data) {
this.errorCode = "0";
this.errorMsg = "success";
this.data = data;
}
/**
* 将json结果集转化为SysResult对象
*
* @param jsonData json数据
* @param clazz SysResult中的object类型
* @return SysResult对象
*/
public static TaskResultObj formatToPojo(String jsonData, Class<?> clazz) {
try {
if (clazz == null) {
return MAPPER.readValue(jsonData, TaskResultObj.class);
}
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isObject()) {
obj = MAPPER.readValue(data.traverse(), clazz);
} else if (data.isTextual()) {
obj = MAPPER.readValue(data.asText(), clazz);
}
return error(jsonNode.get("errorCode").toString(), jsonNode.get("errorMsg").asText(), obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 没有object对象的转化
*
* @param json 字符串
* @return SysResult对象
*/
public static TaskResultObj format(String json) {
try {
return MAPPER.readValue(json, TaskResultObj.class);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* Object是集合转化
*
* @param jsonData json数据
* @param clazz 集合中的类型
* @return SysResult对象
*/
public static TaskResultObj formatToList(String jsonData, Class<?> clazz) {
try {
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isArray() && data.size() > 0) {
obj = MAPPER.readValue(data.traverse(),
MAPPER.getTypeFactory().constructCollectionType(List.class, clazz));
}
return error(jsonNode.get("errorCode").toString(), jsonNode.get("errorMsg").asText(), obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
import java.util.Date;
public class TraffAlarmRecord {
private static final long serialVersionUID = 1L;
private Long recordid ;// ��¼��� ��������
private Integer algotype ;//--�㷨���� Ĭ���� 0:��˾ 1:��������˾
private Long areaid ;//--Ͻ�����
private String fdid ;//�豸���
private Integer channelid ;//--ͨ�����
private Integer channeletype;//ͨ������ �ɺ���
private String channelname ;//ͨ������
private Date recordtime ;//�¼���¼ʱ��
private String recordtype ;//�¼���¼����
private String location ;//Ŀ�궨λ��Ϣ
private String img1urlfrom ;//ͼƬԴ��ַ
private String img1path ;//ͼƬ�洢��ַ
private String img2urlfrom ;//ͼƬԴ��ַ
private String img2path ;//ͼƬ�洢��ַ
private String img3urlfrom ;//ͼƬԴ��ַ
private String img3path ;//ͼƬ�洢��ַ
private String img4urlfrom ;//ͼƬԴ��ַ
private String img4path ;//ͼƬ�洢��ַ
private String img5urlfrom;//ͼƬԴ��ַ
private String img5path ;//ͼƬ�洢��ַ
private String videourlfrom ;//��ƵԴ��ַ
private String videopath ;//��Ƶ�洢��ַ
private Date retrytime ;//video���Ե����һ�εĶ�ȡ��ʱ��
private Integer retrycount ;//ideo���Զ�ȡ�ܴ���
private Integer recordlevel;//�¼����� --Ĭ��Ϊ0 ����������ʱδ֪
private Integer checkstatus ;//0:����� 1:���ͨ�� 2:��˲�ͨ�� 9:����
private String creator;//������
private String createtime ;//����ʱ��
private String updator ;//������
private Date updatetime ;//����ʱ��
private String remark ;
private Integer pushstatus;//����״̬
private String pushdesc;//��������
private String pushcount;//���ʹ���
private Date pushdate;//����ʱ��
private String processstatus ;//����״̬;
private String objlable;
private String rectificationtype;
private Integer manualstatus;
public Long getRecordid() {
return recordid;
}
public void setRecordid(Long recordid) {
this.recordid = recordid;
}
public Integer getAlgotype() {
return algotype;
}
public void setAlgotype(Integer algotype) {
this.algotype = algotype;
}
public Long getAreaid() {
return areaid;
}
public void setAreaid(Long areaid) {
this.areaid = areaid;
}
public String getFdid() {
return fdid;
}
public void setFdid(String fdid) {
this.fdid = fdid;
}
public Integer getChannelid() {
return channelid;
}
public void setChannelid(Integer channelid) {
this.channelid = channelid;
}
public Integer getChanneletype() {
return channeletype;
}
public void setChanneletype(Integer channeletype) {
this.channeletype = channeletype;
}
public String getChannelname() {
return channelname;
}
public void setChannelname(String channelname) {
this.channelname = channelname;
}
public Date getRecordtime() {
return recordtime;
}
public void setRecordtime(Date recordtime) {
this.recordtime = recordtime;
}
public String getRecordtype() {
return recordtype;
}
public void setRecordtype(String recordtype) {
this.recordtype = recordtype;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getImg1urlfrom() {
return img1urlfrom;
}
public void setImg1urlfrom(String img1urlfrom) {
this.img1urlfrom = img1urlfrom;
}
public String getImg1path() {
return img1path;
}
public void setImg1path(String img1path) {
this.img1path = img1path;
}
public String getVideourlfrom() {
return videourlfrom;
}
public void setVideourlfrom(String videourlfrom) {
this.videourlfrom = videourlfrom;
}
public String getVideopath() {
return videopath;
}
public void setVideopath(String videopath) {
this.videopath = videopath;
}
public Date getRetrytime() {
return retrytime;
}
public void setRetrytime(Date retrytime) {
this.retrytime = retrytime;
}
public Integer getRetrycount() {
return retrycount;
}
public void setRetrycount(Integer retrycount) {
this.retrycount = retrycount;
}
public Integer getRecordlevel() {
return recordlevel;
}
public void setRecordlevel(Integer recordlevel) {
this.recordlevel = recordlevel;
}
public Integer getCheckstatus() {
return checkstatus;
}
public void setCheckstatus(Integer checkstatus) {
this.checkstatus = checkstatus;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getCreatetime() {
return createtime;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public String getUpdator() {
return updator;
}
public void setUpdator(String updator) {
this.updator = updator;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getPushstatus() {
return pushstatus;
}
public void setPushstatus(Integer pushstatus) {
this.pushstatus = pushstatus;
}
public String getPushdesc() {
return pushdesc;
}
public void setPushdesc(String pushdesc) {
this.pushdesc = pushdesc;
}
public String getPushcount() {
return pushcount;
}
public void setPushcount(String pushcount) {
this.pushcount = pushcount;
}
public Date getPushdate() {
return pushdate;
}
public void setPushdate(Date pushdate) {
this.pushdate = pushdate;
}
public String getProcessstatus() {
return processstatus;
}
public void setProcessstatus(String processstatus) {
this.processstatus = processstatus;
}
public String getObjlable() {
return objlable;
}
public void setObjlable(String objlable) {
this.objlable = objlable;
}
public String getRectificationtype() {
return rectificationtype;
}
public void setRectificationtype(String rectificationtype) {
this.rectificationtype = rectificationtype;
}
public Integer getManualstatus() {
return manualstatus;
}
public void setManualstatus(Integer manualstatus) {
this.manualstatus = manualstatus;
}
public String getImg2urlfrom() {
return img2urlfrom;
}
public void setImg2urlfrom(String img2urlfrom) {
this.img2urlfrom = img2urlfrom;
}
public String getImg2path() {
return img2path;
}
public void setImg2path(String img2path) {
this.img2path = img2path;
}
public String getImg3urlfrom() {
return img3urlfrom;
}
public void setImg3urlfrom(String img3urlfrom) {
this.img3urlfrom = img3urlfrom;
}
public String getImg3path() {
return img3path;
}
public void setImg3path(String img3path) {
this.img3path = img3path;
}
public String getImg4urlfrom() {
return img4urlfrom;
}
public void setImg4urlfrom(String img4urlfrom) {
this.img4urlfrom = img4urlfrom;
}
public String getImg4path() {
return img4path;
}
public void setImg4path(String img4path) {
this.img4path = img4path;
}
public String getImg5urlfrom() {
return img5urlfrom;
}
public void setImg5urlfrom(String img5urlfrom) {
this.img5urlfrom = img5urlfrom;
}
public String getImg5path() {
return img5path;
}
public void setImg5path(String img5path) {
this.img5path = img5path;
}
@Override
public String toString() {
return "Traffalarmrecord{" +
"recordid=" + recordid +
", algotype=" + algotype +
", areaid=" + areaid +
", fdid='" + fdid + '\'' +
", channelid=" + channelid +
", channeletype=" + channeletype +
", channelname='" + channelname + '\'' +
", recordtime=" + recordtime +
", recordtype='" + recordtype + '\'' +
", location='" + location + '\'' +
", img1urlfrom='" + img1urlfrom + '\'' +
", img1path='" + img1path + '\'' +
", videourlfrom='" + videourlfrom + '\'' +
", videopath='" + videopath + '\'' +
", retrytime=" + retrytime +
", retrycount=" + retrycount +
", recordlevel=" + recordlevel +
", checkstatus=" + checkstatus +
", creator='" + creator + '\'' +
", createtime=" + createtime +
", updator='" + updator + '\'' +
", updatetime=" + updatetime +
", remark='" + remark + '\'' +
", pushstatus=" + pushstatus +
", pushdesc='" + pushdesc + '\'' +
", pushcount='" + pushcount + '\'' +
", pushdate=" + pushdate +
'}';
}
}
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Date;
import java.util.List;
public class Traffic {
@JsonIgnore
private Long id;
private String Type;
private ObjectBoundingBox ObjectBoundingBox;
private String VehicleClass;
private String VehicleColorNums;
private String VehicleColor;
private String VehicleBrand;
private String mainBrandName;
private String subBrandName;
private String yearName;
private String HasPlate;
private String PlateClass;
private String PlateColor;
private String PlateNo;
private String PlateNeatness;
private String Angle;
private String Sunvisor;
private String Paper;
private String Decoration;
private String Drop;
private String Tag;
private SafetyBelt SafetyBelt;
private String HasCall;
private String HasCrash;
private String HasDanger;
private String HasSkylight;
private String HasBaggage;
private String HasAerial;
private String creattime;
public String getCreattime() {
return creattime;
}
public void setCreattime(String creattime) {
this.creattime = creattime;
}
public void setType(String Type) {
this.Type = Type;
}
public String getType() {
return Type;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setObjectBoundingBox(ObjectBoundingBox ObjectBoundingBox) {
this.ObjectBoundingBox = ObjectBoundingBox;
}
public ObjectBoundingBox getObjectBoundingBox() {
return ObjectBoundingBox;
}
public void setVehicleClass(String VehicleClass) {
this.VehicleClass = VehicleClass;
}
public String getVehicleClass() {
return VehicleClass;
}
public void setVehicleColorNums(String VehicleColorNums) {
this.VehicleColorNums = VehicleColorNums;
}
public String getVehicleColorNums() {
return VehicleColorNums;
}
public void setMainBrandName(String mainBrandName) {
this.mainBrandName = mainBrandName;
}
public String getMainBrandName() {
return mainBrandName;
}
public void setSubBrandName(String subBrandName) {
this.subBrandName = subBrandName;
}
public String getSubBrandName() {
return subBrandName;
}
public void setYearName(String yearName) {
this.yearName = yearName;
}
public String getYearName() {
return yearName;
}
public void setHasPlate(String HasPlate) {
this.HasPlate = HasPlate;
}
public String getHasPlate() {
return HasPlate;
}
public void setPlateClass(String PlateClass) {
this.PlateClass = PlateClass;
}
public String getPlateClass() {
return PlateClass;
}
public void setPlateColor(String PlateColor) {
this.PlateColor = PlateColor;
}
public String getPlateColor() {
return PlateColor;
}
public void setPlateNo(String PlateNo) {
this.PlateNo = PlateNo;
}
public String getPlateNo() {
return PlateNo;
}
public void setPlateNeatness(String PlateNeatness) {
this.PlateNeatness = PlateNeatness;
}
public String getPlateNeatness() {
return PlateNeatness;
}
public void setAngle(String Angle) {
this.Angle = Angle;
}
public String getAngle() {
return Angle;
}
public void setSunvisor(String Sunvisor) {
this.Sunvisor = Sunvisor;
}
public String getSunvisor() {
return Sunvisor;
}
public void setPaper(String Paper) {
this.Paper = Paper;
}
public String getPaper() {
return Paper;
}
public void setDecoration(String Decoration) {
this.Decoration = Decoration;
}
public String getDecoration() {
return Decoration;
}
public void setDrop(String Drop) {
this.Drop = Drop;
}
public String getDrop() {
return Drop;
}
public void setTag(String Tag) {
this.Tag = Tag;
}
public String getTag() {
return Tag;
}
public void setSafetyBelt(SafetyBelt SafetyBelt) {
this.SafetyBelt = SafetyBelt;
}
public SafetyBelt getSafetyBelt() {
return SafetyBelt;
}
public void setHasCall(String HasCall) {
this.HasCall = HasCall;
}
public String getHasCall() {
return HasCall;
}
public void setHasCrash(String HasCrash) {
this.HasCrash = HasCrash;
}
public String getHasCrash() {
return HasCrash;
}
public void setHasDanger(String HasDanger) {
this.HasDanger = HasDanger;
}
public String getHasDanger() {
return HasDanger;
}
public void setHasSkylight(String HasSkylight) {
this.HasSkylight = HasSkylight;
}
public String getHasSkylight() {
return HasSkylight;
}
public void setHasBaggage(String HasBaggage) {
this.HasBaggage = HasBaggage;
}
public String getHasBaggage() {
return HasBaggage;
}
public void setHasAerial(String HasAerial) {
this.HasAerial = HasAerial;
}
public String getHasAerial() {
return HasAerial;
}
public String getVehicleColor() {
return VehicleColor;
}
public void setVehicleColor(String vehicleColor) {
VehicleColor = vehicleColor;
}
public String getVehicleBrand() {
return VehicleBrand;
}
public void setVehicleBrand(String vehicleBrand) {
VehicleBrand = vehicleBrand;
}
}
package com.cx.cn.cxquartz.vo;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public class Traffpicture{
private static final long serialVersionUID=1L;
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
private String imageid;
private Integer objectid;
private Object Metadata;
private String Feature;
private String bucketidlist;
private String facefeature;
private String facebucketid;
private String facebucketidlist;
private String facequality;
private String faceyaw;
private String facepitch;
private String faceroll;
private String faceblurry;
private String objectimagedata;
private String faceimagedata;
private String index;
private Integer targetnum;
private String creattime;
public String getCreattime() {
return creattime;
}
public void setCreattime(String creattime) {
this.creattime = creattime;
}
public Integer getTargetnum() {
return targetnum;
}
public void setTargetnum(Integer targetnum) {
this.targetnum = targetnum;
}
public String getImageid() {
return imageid;
}
public void setImageid(String imageid) {
this.imageid = imageid;
}
public Integer getObjectid() {
return objectid;
}
public void setObjectid(Integer objectid) {
this.objectid = objectid;
}
public Object getMetadata() {
return Metadata;
}
public void setMetadata(Object metadata) {
Metadata = metadata;
}
public String getFeature() {
return Feature;
}
public void setFeature(String feature) {
Feature = feature;
}
public String getFacefeature() {
return facefeature;
}
public void setFacefeature(String facefeature) {
this.facefeature = facefeature;
}
public String getBucketidlist() {
return bucketidlist;
}
public void setBucketidlist(String bucketidlist) {
this.bucketidlist = bucketidlist;
}
public String getFacebucketid() {
return facebucketid;
}
public void setFacebucketid(String facebucketid) {
this.facebucketid = facebucketid;
}
public String getFacebucketidlist() {
return facebucketidlist;
}
public void setFacebucketidlist(String facebucketidlist) {
this.facebucketidlist = facebucketidlist;
}
public String getFacequality() {
return facequality;
}
public void setFacequality(String facequality) {
this.facequality = facequality;
}
public String getFaceyaw() {
return faceyaw;
}
public void setFaceyaw(String faceyaw) {
this.faceyaw = faceyaw;
}
public String getFacepitch() {
return facepitch;
}
public void setFacepitch(String facepitch) {
this.facepitch = facepitch;
}
public String getFaceroll() {
return faceroll;
}
public void setFaceroll(String faceroll) {
this.faceroll = faceroll;
}
public String getFaceblurry() {
return faceblurry;
}
public void setFaceblurry(String faceblurry) {
this.faceblurry = faceblurry;
}
public String getObjectimagedata() {
return objectimagedata;
}
public void setObjectimagedata(String objectimagedata) {
this.objectimagedata = objectimagedata;
}
public String getFaceimagedata() {
return faceimagedata;
}
public void setFaceimagedata(String faceimagedata) {
this.faceimagedata = faceimagedata;
}
public String getIndex() {
return index;
}
public void setIndex(String index) {
this.index = index;
}
}
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public class TraffpictureParam extends Traffpicture {
private static final long serialVersionUID=1L;
@JsonIgnore
private Long recordid;
@JsonIgnore
private String fdid;
@JsonIgnore
private Integer channelid;
@JsonIgnore
private Long areaid;
@JsonIgnore
private String recordtype;
@JsonIgnore
private Integer retrycount;
@JsonIgnore
private String recordlevel;
@JsonIgnore
private Integer checkstatus;
@JsonIgnore
private String creator;
@JsonIgnore
private String createtime;
@JsonIgnore
private String updator;
@JsonIgnore
private Date updatetime;
@JsonIgnore
private String remark;
@JsonIgnore
private Integer pushstatus;
@JsonIgnore
private String pushdesc;
@JsonIgnore
private Integer pushcount;
@JsonIgnore
private Date pushdate;
@JsonIgnore
private String processstatus;
@JsonIgnore
private Integer manualstatus;
@JsonIgnore
private String imagedata;
@JsonIgnore
private Integer objx;
@JsonIgnore
private Integer objy;
@JsonIgnore
private Integer objw;
@JsonIgnore
private Integer objh;
private String metatype;
public String getMetatype() {
return metatype;
}
public void setMetatype(String metatype) {
this.metatype = metatype;
}
public Integer getObjx() {
return objx;
}
public void setObjx(Integer objx) {
this.objx = objx;
}
public Integer getObjy() {
return objy;
}
public void setObjy(Integer objy) {
this.objy = objy;
}
public Integer getObjw() {
return objw;
}
public void setObjw(Integer objw) {
this.objw = objw;
}
public Integer getObjh() {
return objh;
}
public void setObjh(Integer objh) {
this.objh = objh;
}
public String getImagedata() {
return imagedata;
}
public void setImagedata(String imagedata) {
this.imagedata = imagedata;
}
public Long getRecordid() {
return recordid;
}
public void setRecordid(Long recordid) {
this.recordid = recordid;
}
public String getFdid() {
return fdid;
}
public void setFdid(String fdid) {
this.fdid = fdid;
}
public Integer getRetrycount() {
return retrycount;
}
public void setRetrycount(Integer retrycount) {
this.retrycount = retrycount;
}
public String getRecordlevel() {
return recordlevel;
}
public void setRecordlevel(String recordlevel) {
this.recordlevel = recordlevel;
}
public Integer getCheckstatus() {
return checkstatus;
}
public void setCheckstatus(Integer checkstatus) {
this.checkstatus = checkstatus;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getCreatetime() {
return createtime;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public String getUpdator() {
return updator;
}
public void setUpdator(String updator) {
this.updator = updator;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getPushstatus() {
return pushstatus;
}
public void setPushstatus(Integer pushstatus) {
this.pushstatus = pushstatus;
}
public String getPushdesc() {
return pushdesc;
}
public void setPushdesc(String pushdesc) {
this.pushdesc = pushdesc;
}
public Integer getPushcount() {
return pushcount;
}
public void setPushcount(Integer pushcount) {
this.pushcount = pushcount;
}
public Date getPushdate() {
return pushdate;
}
public void setPushdate(Date pushdate) {
this.pushdate = pushdate;
}
public String getProcessstatus() {
return processstatus;
}
public void setProcessstatus(String processstatus) {
this.processstatus = processstatus;
}
public Integer getManualstatus() {
return manualstatus;
}
public void setManualstatus(Integer manualstatus) {
this.manualstatus = manualstatus;
}
public Integer getChannelid() {
return channelid;
}
public void setChannelid(Integer channelid) {
this.channelid = channelid;
}
public Long getAreaid() {
return areaid;
}
public void setAreaid(Long areaid) {
this.areaid = areaid;
}
public String getRecordtype() {
return recordtype;
}
public void setRecordtype(String recordtype) {
this.recordtype = recordtype;
}
}
...@@ -18,7 +18,7 @@ public class TraffrecordData { ...@@ -18,7 +18,7 @@ public class TraffrecordData {
private String recordname; private String recordname;
private String recordtime; private String recordtime;
private String recordtype; private String recordtype;
private Integer targetnum; private String targetnum;
private String tdmc; private String tdmc;
private String xzmc; private String xzmc;
...@@ -78,11 +78,11 @@ public class TraffrecordData { ...@@ -78,11 +78,11 @@ public class TraffrecordData {
this.recordtype = recordtype; this.recordtype = recordtype;
} }
public Integer getTargetnum() { public String getTargetnum() {
return targetnum; return targetnum;
} }
public void setTargetnum(Integer targetnum) { public void setTargetnum(String targetnum) {
this.targetnum = targetnum; this.targetnum = targetnum;
} }
......
package com.cx.cn.cxquartz.vo;
public class TransferResult {
Long recordid;
String pathvalue;
String urlfrom;
String imgpath;
Boolean result;
public TransferResult(Long recordid, String pathvalue, String urlfrom, String imgpath, Boolean result) {
this.recordid = recordid;
this.pathvalue = pathvalue;
this.urlfrom = urlfrom;
this.imgpath = imgpath;
this.result = result;
}
public Long getRecordid() {
return recordid;
}
public void setRecordid(Long recordid) {
this.recordid = recordid;
}
public String getPathvalue() {
return pathvalue;
}
public void setPathvalue(String pathvalue) {
this.pathvalue = pathvalue;
}
public String getUrlfrom() {
return urlfrom;
}
public void setUrlfrom(String urlfrom) {
this.urlfrom = urlfrom;
}
public String getImgpath() {
return imgpath;
}
public void setImgpath(String imgpath) {
this.imgpath = imgpath;
}
public Boolean getResult() {
return result;
}
public void setResult(Boolean result) {
this.result = result;
}
}
\ No newline at end of file
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
/**
* Auto-generated: 2021-04-28 19:16:46
*
* @author json.cn (i@json.cn)
* @website http://www.json.cn/java2pojo/
*/
public class UpperBoundingBox {
private int x;
private int y;
private int w;
private int h;
public void setX(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setY(int y) {
this.y = y;
}
public int getY() {
return y;
}
public void setW(int w) {
this.w = w;
}
public int getW() {
return w;
}
public void setH(int h) {
this.h = h;
}
public int getH() {
return h;
}
}
\ No newline at end of file
package com.cx.cn.cxquartz.vo;
/**
* <p>
*
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public class Voice {
private Integer eventId;
private String unionId;
public Integer getEventId() {
return eventId;
}
public void setEventId(Integer eventId) {
this.eventId = eventId;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
}
package com.cx.cn.cxquartz.vo;
/**
* <p>
*
* </p>
*
* @author wjj
* @since 2021-04-29
*/
public class VoiceData {
private String corpId;
private String appKey;
private Voice requestData;
public String getCorpId() {
return corpId;
}
public void setCorpId(String corpId) {
this.corpId = corpId;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public Voice getRequestData() {
return requestData;
}
public void setRequestData(Voice requestData) {
this.requestData = requestData;
}
}
/**
* Copyright 2021 json.cn
*/
package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;
public class VoiceResultObj {
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
* 响应业务状态
* 200 成功
* 201 错误
* 400 参数错误
*/
private Integer Code;
/**
* 响应消息
*/
private String msg;
/**
* 响应中的数据
*/
private Object data;
private String page;
public static VoiceResultObj error(Integer status, String msg, Object data) {
return new VoiceResultObj(status, msg, data);
}
public static VoiceResultObj ok(Object data) {
return new VoiceResultObj(data);
}
public static VoiceResultObj ok() {
return ok(null);
}
private VoiceResultObj() {
}
public static VoiceResultObj error(Integer status, String msg) {
return new VoiceResultObj(status, msg, null);
}
private VoiceResultObj(Integer code, String msg, Object data) {
this.Code = code;
this.msg = msg;
this.data = data;
}
private VoiceResultObj(Object data) {
this.Code =1;
this.msg = "success";
this.data = data;
}
public Integer getCode() {
return Code;
}
public void setCode(Integer code) {
this.Code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}
/**
* 将json结果集转化为SysResult对象
*
* @param jsonData json数据
* @param clazz SysResult中的object类型
* @return SysResult对象
*/
public static VoiceResultObj formatToPojo(String jsonData, Class<?> clazz) {
try {
if (clazz == null) {
return MAPPER.readValue(jsonData, VoiceResultObj.class);
}
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isObject()) {
obj = MAPPER.readValue(data.traverse(), clazz);
} else if (data.isTextual()) {
obj = MAPPER.readValue(data.asText(), clazz);
}
return error( Integer.parseInt(jsonNode.get("code").toString()), jsonNode.get("msg").asText(), obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 没有object对象的转化
*
* @param json 字符串
* @return SysResult对象
*/
public static VoiceResultObj format(String json) {
try {
return MAPPER.readValue(json, VoiceResultObj.class);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* Object是集合转化
*
* @param jsonData json数据
* @param clazz 集合中的类型
* @return SysResult对象
*/
public static VoiceResultObj formatToList(String jsonData, Class<?> clazz) {
try {
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isArray() && data.size() > 0) {
obj = MAPPER.readValue(data.traverse(),
MAPPER.getTypeFactory().constructCollectionType(List.class, clazz));
}
return error(Integer.parseInt(jsonNode.get("code").toString()), jsonNode.get("msg").asText(), obj);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
public String toString() {
return "ResultObj{" +
"code=" + Code +
", msg='" + msg + '\'' +
", obj=" + data +
'}';
}
}
\ No newline at end of file
server:
port: 4082
spring:
datasource:
url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: stat
maxActive: 1000
initialSize: 100
maxWait: 60000
minIdle: 500
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
local:
czurl: http://localhost:4082/ext/getRTSP/1
fxurl: http://localhost:4082/ext/getDeviceSnapshotAndRecognize
server: server:
port: 4085 port: 7088
spring: spring:
datasource: datasource:
url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true url: jdbc:mysql://172.16.24.29:3306/imagepro?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
username: root username: root
password: 123456 password: 123456
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
filters: stat maxActive: 20
maxActive: 1000 initialSize: 1
initialSize: 100 maxWait: 60000
maxWait: 60000 minIdle: 1
minIdle: 500
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
poolPreparedStatements: true poolPreparedStatements: true
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
local:
czurl: http://localhost:4085/ext/getRTSP/1
fxurl: http://localhost:4085/ext/getDeviceSnapshotAndRecognize
\ No newline at end of file
server:
port: 8089
spring:
datasource:
url: jdbc:mysql://192.168.168.110:3306/imagepro?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: stat
maxActive: 1000
initialSize: 100
maxWait: 60000
minIdle: 500
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
redis:
database: 0
host: 127.0.0.1
port: 6379
#logging:
# level:
# root:
# info
local:
czurl: http://localhost:8089/ext/getRTSP/1
fxurl: http://localhost:8089/ext/getDeviceSnapshotAndRecognize
file:
rtspurl: http://zjh189.ncpoi.cc:7080/getDeviceSnapshot
recogurl: http://zjh189.ncpoi.cc:7180/getDeviceSnapshotAndRecognize
uploadurl: http://home2.ncpoi.cc:7080/uploadResultFile
countryside:
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive
logging:
level:
com.cx.cn.cxquartz.dao:
debug
\ No newline at end of file
server:
port: 8089
spring:
datasource:
url: jdbc:mysql://172.16.24.29:3306/hzdxtest?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: hzdxtest
password: 1qaz@wsx
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
filters: stat
maxActive: 1000
initialSize: 100
maxWait: 60000
minIdle: 500
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
local:
czurl: http://localhost:8089/ext/getRTSP/1
fxurl: http://localhost:8089/ext/getDeviceSnapshotAndRecognize
countryside:
callbackurl: http://kvideo.51iwifi.com
file:
rootpath: /home/prod/pictures
logging:
level:
com.cx.cn.cxquartz.dao:
debug
spring: spring:
profiles: profiles:
active: dev85 active: devautosend
mybatis: mybatis:
type-aliases-package: com.cx.cn.cxquartz.bean type-aliases-package: com.cx.cn.cxquartz.bean
...@@ -10,16 +10,10 @@ mybatis: ...@@ -10,16 +10,10 @@ mybatis:
default-statement-timeout: 3000 default-statement-timeout: 3000
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml
file:
rtspurl: http://172.16.24.29:7180/getDeviceSnapshot
recogurl: http://172.16.24.29:7180/getDeviceSnapshotAndRecognize
uploadurl: http://172.16.24.29:7180/uploadResultFile
rootpath: /home/prod/pictures
outpath: result
redis:
database: 0
host: 172.16.24.29
port: 6379
countryside: countryside:
callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive/aiCallback callbackurl: http://kvideo.51iwifi.com/hesc-mq/hesc/mq/receive/aiCallback
logging:
level:
com.cx.cn.cxquartz.dao:
debug
\ No newline at end of file
#file.rtspurl=http://172.16.24.29:7080/getrealcamerasnapshot.php
#file.recogurl=http://172.16.24.29:9098/images/recog
redis.cachekey.ftplist=gs:traff:global:cache:ftplist
file.getrtspbyurl=http://212.129.142.17:8888/heschome_api/api/hesc/open/getRtsp
countryside.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraalarm
countryside.eventwrite.timeout=5
countryside.eventwrite.token=countrysidetoken
countryside.eventwrite.expiretoken=countrysideexpiretime
countryside.eventwrite.url=http://countryside.51iwifi.com/gw/hesc-mq/hesc/mq/receive/cameraalarm
countryside.appid=05744e80b2c211ebe32a8e271066b19e
countryside.appsecret=a55a8870b2e911ebe32a8e271066b19e
countryside.tokenurl=http://countryside.51iwifi.com/gw/getAccessToken
file.publicpictureurl=http://zjh189.ncpoi.cc:10001/api/alg/files
file.ftppath=jiuling:9ling.cn@172.16.24.29:21
voice.url=http://106.13.41.128:9102/giant-sound/api/voice/1.0/play
voice.appKey=9555a51a08a2e1b1c9f02a5b3e9bea11
voice.corpId=587c9d56ee324c0186a86aea85fc7691
voice.eventId=5
voice.unionId=3YSCA450426N3XP
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<configuration debug="false" scan="false"> <configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/> <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/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/prod/tar/log/task88SendTocountry/${spring.application.name}"/>
<!-- 彩色日志格式 --> <!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" <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}}"/> 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}}"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.CodeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.Code">
<result column="key" jdbcType="VARCHAR" property="key" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="CHAR" property="type" />
<result column="alarmlevel" jdbcType="VARCHAR" property="alarmlevel" />
<result column="rectifytime" jdbcType="INTEGER" property="rectifytime" />
<result column="manualchecktime" jdbcType="INTEGER" property="manualchecktime" />
<result column="pushchecktime" jdbcType="INTEGER" property="pushchecktime" />
<result column="maxnumvalue" jdbcType="INTEGER" property="maxnum" />
<result column="alarmnum" jdbcType="INTEGER" property="alarmnum" />
</resultMap>
<select id="selectalarmNum" resultMap="BaseResultMap">
select * from t_code t where t.type=2 and t.key=#{key,jdbcType=VARCHAR}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.FaceMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.Face">
<id column="id" property="id"/>
<result column="facex" property="facex"/>
<result column="facey" property="facey"/>
<result column="facew" property="facew"/>
<result column="faceh" property="faceh"/>
<result column="headx" property="headx"/>
<result column="heady" property="heady"/>
<result column="headw" property="headw"/>
<result column="headh" property="headh"/>
<result column="gender" property="gender"/>
<result column="age" property="age"/>
<result column="hasglasses" property="hasglasses"/>
<result column="hashat" property="hashat"/>
<result column="hasmask" property="hasmask"/>
<result column="hairstyle" property="hairstyle"/>
<result column="createtime" property="createtime"/>
<result column="updatetime" property="updatetime"/>
</resultMap>
<insert id="insertFace" parameterType="com.cx.cn.cxquartz.vo.Face">
insert into face
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id!= null">id,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">facex,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">facey,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">facew,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">faceh,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">headx,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">heady,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">headw,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">headh,</if>
<if test="Gender != null">gender ,</if>
<if test="Age != null">age ,</if>
<if test="HasGlasses != null">hasglasses ,</if>
<if test="HasHat != null">hashat ,</if>
<if test="HasMask!= null">hasmask ,</if>
<if test="HairStyle != null">hairstyle ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">#{FaceBoundingBox.h},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">#{HeadBoundingBox.x},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">#{HeadBoundingBox.y},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">#{HeadBoundingBox.w},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">#{HeadBoundingBox.h},</if>
<if test="Gender != null">#{Gender},</if>
<if test="Age!= null">#{Age},</if>
<if test="HasGlasses!= null">#{HasGlasses},</if>
<if test="HasHat!= null">#{HasHat},</if>
<if test="HasMask != null">#{HasMask},</if>
<if test="HairStyle!= null">#{HairStyle},</if>
</trim>
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.PedestrianMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.Pedestrian">
<result column="id" property="id"/>
<result column="type" property="Type"/>
<result column="gender" property="Gender"/>
<result column="age" property="Age"/>
<result column="angle" property="Angle"/>
<result column="hasbackpack" property="HasBackpack"/>
<result column="hasglasses" property="hasglasses"/>
<result column="hascarrybag" property="hascarrybag"/>
<result column="hasumbrella" property="hasumbrella"/>
<result column="coatlength" property="coatlength"/>
<result column="coatcolornums" property="coatcolornums"/>
<result column="coatcolor" property="coatcolor"/>
<result column="trouserslength" property="trouserslength"/>
<result column="trouserscolornums" property="trouserscolornums"/>
<result column="trouserscolor" property="trouserscolor"/>
<result column="headx" property="HeadBoundingBox.x"/>
<result column="heady" property="HeadBoundingBox.y"/>
<result column="headw" property="HeadBoundingBox.w"/>
<result column="headh" property="HeadBoundingBox.h"/>
<result column="upperx" property="UpperBoundingBox.x"/>
<result column="uppery" property="UpperBoundingBox.y"/>
<result column="upperw" property="UpperBoundingBox.w"/>
<result column="upperh" property="UpperBoundingBox.h"/>
<result column="lowerx" property="LowerBoundingBox.x"/>
<result column="lowery" property="LowerBoundingBox.y"/>
<result column="lowerw" property="LowerBoundingBox.w"/>
<result column="lowerh" property="LowerBoundingBox.h"/>
<result column="facex" property="FaceBoundingBox.x"/>
<result column="facey" property="FaceBoundingBox.y"/>
<result column="facew" property="FaceBoundingBox.w"/>
<result column="faceh" property="FaceBoundingBox.h"/>
<result column="hashat" property="hashat"/>
<result column="hasmask" property="hasmask"/>
<result column="hairstyle" property="hairstyle"/>
<result column="coattexture" property="coattexture"/>
<result column="trouserstexture" property="trouserstexture"/>
<result column="hastrolley" property="hastrolley"/>
<result column="hasluggage" property="hasluggage"/>
<result column="luggagecolornums" property="luggagecolornums"/>
<result column="luggagecolor" property="luggagecolor"/>
<result column="hasknife" property="hasknife"/>
<result column="objectx" property="objectx"/>
<result column="objecty" property="objecty"/>
<result column="objectw" property="objectw"/>
<result column="objecth" property="objecth"/>
</resultMap>
<insert id="insertpedestrian" parameterType="com.cx.cn.cxquartz.vo.Pedestrian">
insert into pedestrian
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id!= null">id ,</if>
<if test="Type!= null">type ,</if>
<if test="Gender!= null">gender ,</if>
<if test="Age!= null">age ,</if>
<if test="Angle!= null">Angle ,</if>
<if test="HasBackpack!= null">hasbackpack ,</if>
<if test="HasGlasses!= null">hasglasses ,</if>
<if test="HasCarrybag!= null">hascarrybag ,</if>
<if test="HasUmbrella!= null">hasumbrella ,</if>
<if test="CoatLength!= null">coatlength ,</if>
<if test="CoatColorNums!= null">coatcolornums ,</if>
<if test="CoatColor!= null">coatcolor ,</if>
<if test="TrousersLength!= null">trouserslength ,</if>
<if test="TrousersColorNums!= null">trouserscolornums ,</if>
<if test="TrousersColor!= null">trouserscolor ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">headx ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">heady ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">headw ,</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">headh ,</if>
<if test="HeadBoundingBox!=null and UpperBoundingBox.x!= null">upperx ,</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.y!= null">uppery ,</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.w!= null">upperw ,</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.h!= null">upperh ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.x!= null">lowerx ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.y!= null">lowery ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.w!= null">lowerw ,</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.h!= null">lowerh ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">facex ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">facey ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">facew ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">faceh ,</if>
<if test="HasHat!= null">hashat ,</if>
<if test="HasMask!= null">hasmask ,</if>
<if test="HairStyle!= null">hairstyle ,</if>
<if test="CoatTexture!= null">coattexture ,</if>
<if test="TrousersTexture!= null">trouserstexture ,</if>
<if test="HasTrolley!= null">hastrolley ,</if>
<if test="HasLuggage!= null">hasluggage ,</if>
<if test="LuggageColorNums!= null">luggagecolornums ,</if>
<if test="LuggageColor!= null">luggagecolor ,</if>
<if test="HasKnife!= null">hasknife ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x!= null">objectx ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y!= null">objecty ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w!= null">objectw ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h!= null">objecth ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id!= null">#{id},</if>
<if test="Type!= null">#{Type},</if>
<if test="Gender!= null">#{Gender},</if>
<if test="Age!= null">#{Age},</if>
<if test="Angle!= null">#{Angle},</if>
<if test="HasBackpack!= null">#{HasBackpack},</if>
<if test="HasGlasses!= null">#{HasGlasses},</if>
<if test="HasCarrybag!= null">#{HasCarrybag},</if>
<if test="HasUmbrella!= null">#{HasUmbrella},</if>
<if test="CoatLength!= null">#{CoatLength},</if>
<if test="CoatColorNums!= null">#{CoatColorNums},</if>
<if test="CoatColor!= null">#{CoatColor},</if>
<if test="TrousersLength!= null">#{TrousersLength},</if>
<if test="TrousersColorNums!= null">#{TrousersColorNums},</if>
<if test="TrousersColor!= null">#{TrousersColor},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.x!= null">#{HeadBoundingBox.x},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.y!= null">#{HeadBoundingBox.y},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.w!= null">#{HeadBoundingBox.w},</if>
<if test="HeadBoundingBox!=null and HeadBoundingBox.h!= null">#{HeadBoundingBox.h},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.x!= null">#{UpperBoundingBox.x},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.y!= null">#{UpperBoundingBox.y},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.w!= null">#{UpperBoundingBox.w},</if>
<if test="UpperBoundingBox!=null and UpperBoundingBox.h!= null">#{UpperBoundingBox.h},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.x!= null">#{LowerBoundingBox.x},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.y!= null">#{LowerBoundingBox.y},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.w!= null">#{LowerBoundingBox.w},</if>
<if test="LowerBoundingBox!=null and LowerBoundingBox.h!= null">#{LowerBoundingBox.h},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x!= null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y!= null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w!= null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h!= null">#{FaceBoundingBox.h},</if>
<if test="HasHat!= null">#{HasHat},</if>
<if test="HasMask!= null">#{HasMask},</if>
<if test="HairStyle!= null">#{HairStyle},</if>
<if test="CoatTexture!= null">#{CoatTexture},</if>
<if test="TrousersTexture!= null">#{TrousersTexture},</if>
<if test="HasTrolley!= null">#{HasTrolley},</if>
<if test="HasLuggage!= null">#{HasLuggage},</if>
<if test="LuggageColorNums!= null">#{LuggageColorNums},</if>
<if test="LuggageColor!= null">#{LuggageColor},</if>
<if test="HasKnife!= null">#{HasKnife},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x!= null">#{ObjectBoundingBox.x},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y!= null">#{ObjectBoundingBox.y},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w!= null">#{ObjectBoundingBox.w},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h!= null">#{ObjectBoundingBox.h},</if>
</trim>
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.PeopleridebicycMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.PeopleRideBicyc">
<id column="id" property="id" />
<result column="type" property="type" />
<result column="objectx" property="objectx" />
<result column="objecty" property="objecty" />
<result column="obectw" property="obectw" />
<result column="objecth" property="objecth" />
<result column="bikeclass" property="bikeclass" />
<result column="gender" property="gender" />
<result column="age" property="age" />
<result column="angle" property="angle" />
<result column="hasbackpack" property="hasbackpack" />
<result column="hasglasses" property="hasglasses" />
<result column="hasmask" property="hasmask" />
<result column="hascarrybag" property="hascarrybag" />
<result column="hasumbrella" property="hasumbrella" />
<result column="coatlength" property="coatlength" />
<result column="hasplate" property="hasplate" />
<result column="plateno" property="plateno" />
<result column="hashelmet" property="hashelmet" />
<result column="helmetcolor" property="helmetcolor" />
<result column="coatcolornums" property="coatcolornums" />
<result column="coatcolor" property="coatcolor" />
<result column="coattexture" property="coattexture" />
<result column="facex" property="facex" />
<result column="facey" property="facey" />
<result column="facew" property="facew" />
<result column="faceh" property="faceh" />
<result column="socialattribute" property="socialattribute" />
<result column="enterprise" property="enterprise" />
<result column="haspassenger" property="haspassenger" />
<result column="createtime" property="createtime" />
<result column="updatetime" property="updatetime" />
</resultMap>
<insert id="insertPeopleRideBicyc" parameterType="com.cx.cn.cxquartz.vo.PeopleRideBicyc">
insert into peopleridebicyc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="Type != null">type ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x != null">objectx ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y != null">objecty ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w != null">obectw ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h != null">objecth ,</if>
<if test="BikeClass != null">bikeclass ,</if>
<if test="Gender != null">gender ,</if>
<if test="Age != null">age ,</if>
<if test="Angle != null">angle ,</if>
<if test="HasBackpack != null">hasbackpack ,</if>
<if test="HasGlasses != null">hasglasses ,</if>
<if test="HasMask != null">hasmask ,</if>
<if test="HasCarrybag != null">hascarrybag ,</if>
<if test="HasUmbrella != null">hasumbrella ,</if>
<if test="CoatLength != null">coatlength ,</if>
<if test="HasPlate != null">hasplate ,</if>
<if test="PlateNo != null">plateno ,</if>
<if test="HasHelmet != null">hashelmet ,</if>
<if test="HelmetColor != null">helmetcolor ,</if>
<if test="CoatColorNums != null">coatcolornums ,</if>
<if test="CoatColor != null">coatcolor ,</if>
<if test="CoatTexture != null">coattexture ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x != null">facex ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y != null">facey ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w != null">facew ,</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h != null">faceh ,</if>
<if test="SocialAttribute != null">socialattribute ,</if>
<if test="Enterprise != null">enterprise ,</if>
<if test="HasPassenger != null">haspassenger ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="Type != null">#{Type},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x != null">#{ObjectBoundingBox.x},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y != null">#{ObjectBoundingBox.y},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w != null">#{ObjectBoundingBox.w},</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h != null">#{ObjectBoundingBox.h},</if>
<if test="BikeClass != null">#{BikeClass},</if>
<if test="Gender != null">#{Gender},</if>
<if test="Age != null">#{Age},</if>
<if test="Angle != null">#{Angle},</if>
<if test="HasBackpack != null">#{HasBackpack},</if>
<if test="HasGlasses != null">#{HasGlasses},</if>
<if test="HasMask != null">#{HasMask},</if>
<if test="HasCarrybag != null">#{HasCarrybag},</if>
<if test="HasUmbrella != null">#{HasUmbrella},</if>
<if test="CoatLength != null">#{CoatLength},</if>
<if test="HasPlate != null">#{HasPlate},</if>
<if test="PlateNo != null">#{PlateNo},</if>
<if test="HasHelmet != null">#{HasHelmet},</if>
<if test="HelmetColor != null">#{HelmetColor},</if>
<if test="CoatColorNums != null">#{CoatColorNums},</if>
<if test="CoatColor != null">#{CoatColor},</if>
<if test="CoatTexture != null">#{CoatTexture},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.x != null">#{FaceBoundingBox.x},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.y != null">#{FaceBoundingBox.y},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.w != null">#{FaceBoundingBox.w},</if>
<if test="FaceBoundingBox!=null and FaceBoundingBox.h != null">#{FaceBoundingBox.h},</if>
<if test="SocialAttribute != null">#{SocialAttribute},</if>
<if test="Enterprise != null">#{Enterprise},</if>
<if test="HasPassenger != null">#{HasPassenger},</if>
</trim>
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cx.cn.cxquartz.dao.QuartzTaskErrorsMapper">
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="taskExecuteRecordId" property="taskexecuterecordid" jdbcType="VARCHAR"/>
<result column="errorKey" property="errorkey" jdbcType="VARCHAR"/>
<result column="createTime" property="createtime" jdbcType="BIGINT"/>
<result column="lastModifyTime" property="lastmodifytime" jdbcType="BIGINT"/>
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.cx.cn.cxquartz.bean.QuartzTaskErrors"
extends="BaseResultMap">
<result column="errorValue" property="errorvalue" jdbcType="LONGVARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, taskExecuteRecordId, errorKey, createTime, lastModifyTime
</sql>
<sql id="Base_Column_List_With_ErrorValue">
id, taskExecuteRecordId, errorKey, errorValue ,createTime, lastModifyTime
</sql>
<sql id="Blob_Column_List">
errorValue
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from quartz_task_errors
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from quartz_task_errors
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
insert into quartz_task_errors (id, taskExecuteRecordId, errorKey,
createTime, lastModifyTime, errorValue
)
values (#{id,jdbcType=BIGINT}, #{taskexecuterecordid,jdbcType=VARCHAR}, #{errorkey,jdbcType=VARCHAR},
#{createtime,jdbcType=BIGINT}, #{lastmodifytime,jdbcType=BIGINT}, #{errorvalue,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
insert into quartz_task_errors
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="taskexecuterecordid != null">
taskExecuteRecordId,
</if>
<if test="errorkey != null">
errorKey,
</if>
<if test="createtime != null">
createTime,
</if>
<if test="lastmodifytime != null">
lastModifyTime,
</if>
<if test="errorvalue != null">
errorValue,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="taskexecuterecordid != null">
#{taskexecuterecordid,jdbcType=VARCHAR},
</if>
<if test="errorkey != null">
#{errorkey,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=BIGINT},
</if>
<if test="lastmodifytime != null">
#{lastmodifytime,jdbcType=BIGINT},
</if>
<if test="errorvalue != null">
#{errorvalue,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
update quartz_task_errors
<set>
<if test="taskexecuterecordid != null">
taskExecuteRecordId = #{taskexecuterecordid,jdbcType=VARCHAR},
</if>
<if test="errorkey != null">
errorKey = #{errorkey,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=BIGINT},
</if>
<if test="lastmodifytime != null">
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT},
</if>
<if test="errorvalue != null">
errorValue = #{errorvalue,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
update quartz_task_errors
set taskExecuteRecordId = #{taskexecuterecordid,jdbcType=VARCHAR},
errorKey = #{errorkey,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=BIGINT},
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT},
errorValue = #{errorvalue,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
update quartz_task_errors
set taskExecuteRecordId = #{taskexecuterecordid,jdbcType=VARCHAR},
errorKey = #{errorkey,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=BIGINT},
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="detailTaskErrors" parameterType="java.lang.String"
resultType="com.cx.cn.cxquartz.bean.QuartzTaskErrors">
select
<include refid="Base_Column_List_With_ErrorValue"/>
from quartz_task_errors where taskExecuteRecordId = #{recordId}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cx.cn.cxquartz.dao.QuartzTaskInformationsMapper">
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="version" property="version" jdbcType="INTEGER"/>
<result column="taskNo" property="taskno" jdbcType="VARCHAR"/>
<result column="taskName" property="taskname" jdbcType="VARCHAR"/>
<result column="schedulerRule" property="schedulerrule" jdbcType="VARCHAR"/>
<result column="frozenStatus" property="frozenstatus" jdbcType="VARCHAR"/>
<result column="executorNo" property="executorno" jdbcType="VARCHAR"/>
<result column="frozenTime" property="frozentime" jdbcType="BIGINT"/>
<result column="unfrozenTime" property="unfrozentime" jdbcType="BIGINT"/>
<result column="createTime" property="createtime" jdbcType="BIGINT"/>
<result column="lastModifyTime" property="lastmodifytime" jdbcType="BIGINT"/>
<result column="sendType" property="sendtype" jdbcType="VARCHAR"/>
<result column="url" property="url" jdbcType="VARCHAR"/>
<result column="executeParamter" property="executeparamter" jdbcType="VARCHAR"/>
<result column="timeKey" property="timekey" jdbcType="VARCHAR"/>
<result column="objectx" property="objectx" jdbcType="BIGINT"/>
<result column="objectx" property="objectx" jdbcType="BIGINT"/>
<result column="objecty" property="objecty" jdbcType="BIGINT"/>
<result column="objectw" property="objectw" jdbcType="BIGINT"/>
<result column="objecth" property="objecth" jdbcType="BIGINT"/>
<result column="recordtype" property="recordtype" jdbcType="VARCHAR"/>
<result column="metatype" property="metatype" jdbcType="VARCHAR"/>
<result column="rtsp" property="rtsp" jdbcType="VARCHAR"/>
<result column="videoid" property="videoid" jdbcType="VARCHAR"/>
<result column="imgsrc" property="imgsrc" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="PicResultMap" type="com.cx.cn.cxquartz.bean.PictureTime">
<id column="deviceid" property="deviceid" jdbcType="VARCHAR"/>
<result column="lasttime" property="lasttime" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="CameraResultMap" type="com.cx.cn.cxquartz.bean.PatrolCtrlRecord">
<result column="cameraName" property="cameraName" jdbcType="VARCHAR"/>
<result column="cameraCode" property="cameraCode" jdbcType="VARCHAR"/>
<result column="deviceid" property="deviceid" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, version, taskNo, taskName, schedulerRule, frozenStatus, executorNo, frozenTime,
unfrozenTime, createTime, lastModifyTime, sendType, url, executeParamter, timeKey,
objectx , objecty ,objectw,objecth,recordtype,metatype,videoid,rtsp,imgsrc
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
from quartz_task_informations
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from quartz_task_informations
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
insert into quartz_task_informations (id, version, taskNo,
taskName, schedulerRule, frozenStatus,
executorNo, frozenTime, unfrozenTime,
createTime, lastModifyTime, sendType,
url, executeParamter, timeKey,objectx,objecty,objectw,objecth,recordtype,metatype,
rtsp,imgsrc,videoid
)
values (#{id,jdbcType=BIGINT}, #{version,jdbcType=INTEGER}, #{taskno,jdbcType=VARCHAR},
#{taskname,jdbcType=VARCHAR}, #{schedulerrule,jdbcType=VARCHAR}, #{frozenstatus,jdbcType=VARCHAR},
#{executorno,jdbcType=VARCHAR}, #{frozentime,jdbcType=BIGINT}, #{unfrozentime,jdbcType=BIGINT},
#{createtime,jdbcType=BIGINT}, #{lastmodifytime,jdbcType=BIGINT}, #{sendtype,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR},
#{executeparamter,jdbcType=VARCHAR}, #{timekey,jdbcType=VARCHAR}
, #{objectx,jdbcType=BIGINT}
, #{objecty,jdbcType=BIGINT}
, #{objectw,jdbcType=BIGINT}
, #{objecth,jdbcType=BIGINT}
, #{recordtype,jdbcType=VARCHAR}
, #{metatype,jdbcType=VARCHAR}
, #{rtsp,jdbcType=VARCHAR}
, #{imgsrc,jdbcType=VARCHAR}
, #{videoid,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
insert into quartz_task_informations
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="version != null">
version,
</if>
<if test="taskno != null">
taskNo,
</if>
<if test="taskname != null">
taskName,
</if>
<if test="schedulerrule != null">
schedulerRule,
</if>
<if test="frozenstatus != null">
frozenStatus,
</if>
<if test="executorno != null">
executorNo,
</if>
<if test="frozentime != null">
frozenTime,
</if>
<if test="unfrozentime != null">
unfrozenTime,
</if>
<if test="createtime != null">
createTime,
</if>
<if test="lastmodifytime != null">
lastModifyTime,
</if>
<if test="sendtype != null">
sendType,
</if>
<if test="url != null">
url,
</if>
<if test="executeparamter != null">
executeParamter,
</if>
<if test="timekey != null">
timeKey,
</if>
<if test="objectx != null">
objectx,
</if>
<if test="objecty != null">
objecty,
</if>
<if test="objectw != null">
objectw,
</if>
<if test="objecth != null">
objecth,
</if>
<if test="recordtype != null">
recordtype,
</if>
<if test="metatype != null">
metatype,
</if>
<if test="rtsp != null">
rtsp,
</if>
<if test="imgsrc != null">
imgsrc,
</if>
<if test="videoid != null">
videoid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="version != null">
#{version,jdbcType=INTEGER},
</if>
<if test="taskno != null">
#{taskno,jdbcType=VARCHAR},
</if>
<if test="taskname != null">
#{taskname,jdbcType=VARCHAR},
</if>
<if test="schedulerrule != null">
#{schedulerrule,jdbcType=VARCHAR},
</if>
<if test="frozenstatus != null">
#{frozenstatus,jdbcType=VARCHAR},
</if>
<if test="executorno != null">
#{executorno,jdbcType=VARCHAR},
</if>
<if test="frozentime != null">
#{frozentime,jdbcType=BIGINT},
</if>
<if test="unfrozentime != null">
#{unfrozentime,jdbcType=BIGINT},
</if>
<if test="createtime != null">
#{createtime,jdbcType=BIGINT},
</if>
<if test="lastmodifytime != null">
#{lastmodifytime,jdbcType=BIGINT},
</if>
<if test="sendtype != null">
#{sendtype,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="executeparamter != null">
#{executeparamter,jdbcType=VARCHAR},
</if>
<if test="timekey != null">
#{timekey,jdbcType=VARCHAR},
</if>
<if test="objectx != null">
#{objectx,jdbcType=BIGINT},
</if>
<if test="objecty != null">
#{objecty,jdbcType=BIGINT},
</if>
<if test="objectw != null">
#{objectw,jdbcType=BIGINT},
</if>
<if test="objecth != null">
#{objecth,jdbcType=BIGINT},
</if>
<if test="recordtype != null">
#{recordtype,jdbcType=VARCHAR},
</if>
<if test="metatype != null">
#{metatype,jdbcType=VARCHAR},
</if>
<if test="rtsp != null">
#{rtsp,jdbcType=VARCHAR},
</if>
<if test="imgsrc != null">
#{imgsrc,jdbcType=VARCHAR},
</if>
<if test="videoid != null">
#{videoid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective"
parameterType="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
update quartz_task_informations
<set>
<if test="version != null">
version = version+1,
</if>
<if test="taskno != null">
taskNo = #{taskno,jdbcType=VARCHAR},
</if>
<if test="taskname != null">
taskName = #{taskname,jdbcType=VARCHAR},
</if>
<if test="schedulerrule != null">
schedulerRule = #{schedulerrule,jdbcType=VARCHAR},
</if>
<if test="frozenstatus != null">
frozenStatus = #{frozenstatus,jdbcType=VARCHAR},
</if>
<if test="executorno != null">
executorNo = #{executorno,jdbcType=VARCHAR},
</if>
<if test="frozentime != null">
frozenTime = #{frozentime,jdbcType=BIGINT},
</if>
<if test="unfrozentime != null">
unfrozenTime = #{unfrozentime,jdbcType=BIGINT},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=BIGINT},
</if>
<if test="lastmodifytime != null">
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT},
</if>
<if test="sendtype != null">
sendType = #{sendtype,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="executeparamter != null">
executeParamter = #{executeparamter,jdbcType=VARCHAR},
</if>
<if test="timekey != null">
timeKey = #{timekey,jdbcType=VARCHAR},
</if>
<if test="objectx != null">
objectx = #{objectx,jdbcType=BIGINT},
</if>
<if test="objecty != null">
objecty = #{objecty,jdbcType=BIGINT},
</if>
<if test="objectw != null">
objectw = #{objectw,jdbcType=BIGINT},
</if>
<if test="objecth != null">
objecth = #{objecth,jdbcType=BIGINT},
</if>
<if test="recordtype != null">
recordtype = #{recordtype,jdbcType=VARCHAR},
</if>
<if test="metatype != null">
metatype = #{metatype,jdbcType=VARCHAR},
</if>
<if test="rtsp != null">
rtsp = #{rtsp,jdbcType=VARCHAR},
</if>
<if test="imgsrc != null">
imgsrc = #{imgsrc,jdbcType=VARCHAR},
</if>
<if test="videoid != null">
videoid = #{videoid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
update quartz_task_informations
set version = #{version,jdbcType=INTEGER},
taskNo = #{taskno,jdbcType=VARCHAR},
taskName = #{taskname,jdbcType=VARCHAR},
schedulerRule = #{schedulerrule,jdbcType=VARCHAR},
frozenStatus = #{frozenstatus,jdbcType=VARCHAR},
executorNo = #{executorno,jdbcType=VARCHAR},
frozenTime = #{frozentime,jdbcType=BIGINT},
unfrozenTime = #{unfrozentime,jdbcType=BIGINT},
createTime = #{createtime,jdbcType=BIGINT},
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT},
sendType = #{sendtype,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
executeParamter = #{executeparamter,jdbcType=VARCHAR},
timeKey = #{timekey,jdbcType=VARCHAR} ,
objectx = #{objectx,jdbcType=BIGINT},
objecty = #{objecty,jdbcType=BIGINT} ,
objectw = #{lastmodifytime,jdbcType=BIGINT} ,
objecth = #{lastmodifytime,jdbcType=BIGINT},
recordtype = #{recordtype,jdbcType=VARCHAR} ,
metatype = #{metatype,jdbcType=VARCHAR},
rtsp = #{rtsp,jdbcType=VARCHAR},
videoid = #{videoid,jdbcType=VARCHAR},
imgsrc = #{imgsrc,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectList" parameterType="java.util.HashMap" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from quartz_task_informations
<if test="taskNo != null">
<where>
taskNo = #{taskNo}
</where>
</if>
order by id desc limit #{startIndex},10;
</select>
<select id="selectByTaskNo" parameterType="java.lang.String" resultType="java.lang.Integer">
select count(*) from quartz_task_informations where taskNo=#{taskNo}
</select>
<select id="getTaskByTaskNo" parameterType="java.lang.String"
resultType="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
select
<include refid="Base_Column_List"/>
from quartz_task_informations where taskNo = #{taskNo}
</select>
<select id="getUnfrozenTasks" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from quartz_task_informations where frozenStatus = #{frozenStatus}
</select>
<insert id="insertRecord" parameterType="com.cx.cn.cxquartz.bean.PatrolCtrlRecord">
insert into patrol_ctrl_records ( cameraCode,cameraName,patrolTime,recordSrc )
values (#{cameraCode,jdbcType=VARCHAR}, #{cameraName,jdbcType=VARCHAR},
#{patrolTime,jdbcType=VARCHAR}, #{recordSrc,jdbcType=VARCHAR}
)
</insert>
<insert id="insertAlarm" parameterType="com.cx.cn.cxquartz.bean.PatrolCtrlAlarm">
insert into patrol_ctrl_alarms ( cameraCode,cameraName,time,type )
values (#{cameraCode,jdbcType=VARCHAR}, #{cameraName,jdbcType=VARCHAR},
#{time,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}
)
</insert>
<select id="findLastPicTime" resultMap="PicResultMap">
select deviceid ,max(patroltime) lasttime from patrol_ctrl_records a ,sbxx b where a.cameracode=b.cameracode group by deviceid
</select>
<select id="queryCameraCode" resultMap="CameraResultMap">
select * from sbxx where deviceid in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<resultMap id="RtspMap" type="com.cx.cn.cxquartz.vo.Sbtdspsr">
<result column="sbbh" jdbcType="VARCHAR" property="sbbh"/>
<result column="tdbh" jdbcType="INTEGER" property="tdbh"/>
<result column="xzbh" jdbcType="VARCHAR" property="xzbh"/>
</resultMap>
<update id="UpdateExecuteParam" parameterType="java.util.HashMap">
update quartz_task_informations set executeParamter=#{nrtsp} where executeParamter=#{ortsp}
</update>
<select id="getTaskSByDeviceCode" resultMap="BaseResultMap" parameterType="java.lang.String">
select * from quartz_task_informations where
taskno like concat(concat('%',#{devicecode}),'%')
and frozenStatus='UNFROZEN'
</select>
<delete id="deletetask">
delete from quartz_task_informations
where taskno = #{taskno,jdbcType=BIGINT}
</delete>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cx.cn.cxquartz.dao.QuartzTaskRecordsMapper">
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.bean.QuartzTaskRecords">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="taskNo" property="taskno" jdbcType="VARCHAR"/>
<result column="timeKeyValue" property="timekeyvalue" jdbcType="VARCHAR"/>
<result column="executeTime" property="executetime" jdbcType="BIGINT"/>
<result column="taskStatus" property="taskstatus" jdbcType="VARCHAR"/>
<result column="failcount" property="failcount" jdbcType="INTEGER"/>
<result column="failReason" property="failreason" jdbcType="VARCHAR"/>
<result column="createTime" property="createtime" jdbcType="BIGINT"/>
<result column="lastModifyTime" property="lastmodifytime" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
id, taskNo, timeKeyValue, executeTime, taskStatus, failcount, failReason, createTime,
lastModifyTime
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
from quartz_task_records
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from quartz_task_records
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
parameterType="com.cx.cn.cxquartz.bean.QuartzTaskRecords">
insert into quartz_task_records (taskNo, timeKeyValue,
executeTime, taskStatus, failcount,
failReason, createTime, lastModifyTime
)
values (#{taskno,jdbcType=VARCHAR}, #{timekeyvalue,jdbcType=VARCHAR},
#{executetime,jdbcType=BIGINT}, #{taskstatus,jdbcType=VARCHAR}, #{failcount,jdbcType=INTEGER},
#{failreason,jdbcType=VARCHAR}, #{createtime,jdbcType=BIGINT}, #{lastmodifytime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskRecords">
insert into quartz_task_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="taskno != null">
taskNo,
</if>
<if test="timekeyvalue != null">
timeKeyValue,
</if>
<if test="executetime != null">
executeTime,
</if>
<if test="taskstatus != null">
taskStatus,
</if>
<if test="failcount != null">
failcount,
</if>
<if test="failreason != null">
failReason,
</if>
<if test="createtime != null">
createTime,
</if>
<if test="lastmodifytime != null">
lastModifyTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="taskno != null">
#{taskno,jdbcType=VARCHAR},
</if>
<if test="timekeyvalue != null">
#{timekeyvalue,jdbcType=VARCHAR},
</if>
<if test="executetime != null">
#{executetime,jdbcType=BIGINT},
</if>
<if test="taskstatus != null">
#{taskstatus,jdbcType=VARCHAR},
</if>
<if test="failcount != null">
#{failcount,jdbcType=INTEGER},
</if>
<if test="failreason != null">
#{failreason,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=BIGINT},
</if>
<if test="lastmodifytime != null">
#{lastmodifytime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskRecords">
update quartz_task_records
<set>
<if test="taskno != null">
taskNo = #{taskno,jdbcType=VARCHAR},
</if>
<if test="timekeyvalue != null">
timeKeyValue = #{timekeyvalue,jdbcType=VARCHAR},
</if>
<if test="executetime != null">
executeTime = #{executetime,jdbcType=BIGINT},
</if>
<if test="taskstatus != null">
taskStatus = #{taskstatus,jdbcType=VARCHAR},
</if>
<if test="failcount != null">
failcount = #{failcount,jdbcType=INTEGER},
</if>
<if test="failreason != null">
failReason = #{failreason,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=BIGINT},
</if>
<if test="lastmodifytime != null">
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.cx.cn.cxquartz.bean.QuartzTaskRecords">
update quartz_task_records
set taskNo = #{taskno,jdbcType=VARCHAR},
timeKeyValue = #{timekeyvalue,jdbcType=VARCHAR},
executeTime = #{executetime,jdbcType=BIGINT},
taskStatus = #{taskstatus,jdbcType=VARCHAR},
failcount = #{failcount,jdbcType=INTEGER},
failReason = #{failreason,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=BIGINT},
lastModifyTime = #{lastmodifytime,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getTaskRecordsByTaskNo" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from quartz_task_records where taskNo = #{taskNo} order by createTime desc;
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cx.cn.cxquartz.dao.SbtdspsrMapper">
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.Sbtdspsr">
<result column="sbbh" jdbcType="VARCHAR" property="sbbh"/>
<result column="tdbh" jdbcType="INTEGER" property="tdbh"/>
<result column="xzbh" jdbcType="VARCHAR" property="xzbh"/>
<result column="tdmc" jdbcType="VARCHAR" property="tdmc"/>
</resultMap>
<select id="selectByRtsp" parameterType="java.lang.String" resultType="com.cx.cn.cxquartz.vo.Sbtdspsr">
select * from sbtdspsr where
(sbbh=#{rtsp} or squrllj=#{rtsp})
</select>
<select id="selectRecogByRtsp" parameterType="java.lang.String" resultType="com.cx.cn.cxquartz.bean.QuartzTaskInformations">
select * from
quartz_task_informations b
WHERE
(taskNo = #{rtsp})
and frozenstatus='UNFROZEN'
</select>
<update id="updateRecogByRtsp" parameterType="java.util.HashMap" >
update sbtdspsr set squrllj= #{rtsp} where sbbh=#{devicecode}
</update>
<select id="list" resultType="com.cx.cn.cxquartz.vo.Sbtdspsr">
select * from sbtdspsr
</select>
</mapper>
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.StorageServerMapper">
<select id="queryStorageServerAll" resultType="com.cx.cn.cxquartz.vo.Storageserver">
select serverid
,servername ,servergroup ,servertype
,serverstatus ,serveurl ,serveip
,serverport ,serveruser ,serverpassword
from storageserver b
<where>
<if test="serverstatus != null">
and b.serverstatus = #{serverstatus}
</if>
<if test="servertype != null">
and b.servertype = #{servertype}
</if>
<if test="servergroup != null">
and b.servergroup = #{servergroup}
</if>
</where>
order by b.createtime desc
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cx.cn.cxquartz.dao.TaskMapper">
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.TraffrecordData">
<result column="fdid" jdbcType="VARCHAR" property="sbbh"/>
<result column="tdbh" jdbcType="INTEGER" property="tdbh"/>
<result column="xzbh" jdbcType="VARCHAR" property="xzbh"/>
<result column="tdmc" jdbcType="VARCHAR" property="tdmc"/>
</resultMap>
<select id="list" resultType="com.cx.cn.cxquartz.vo.TraffrecordData">
select id alarmnum,
fdid,
imagedata,
recordlevel alarmlevel ,
(select name from t_code t where t.key=recordtype and type=2)recordname,
date_format(createtime,'%Y-%m-%d %H:%i:%s') recordtime,
recordtype,
(select tdmc from sbtdspsr where sbbh=fdid) tdmc,
(select dept_name from sbtdspsr a,dept b where sbbh=fdid and a.xzbh=b.dept_id) xzmc
from traffpicture where (pushstatus is null or pushstatus=-1) and createtime>DATE_SUB(now(),INTERVAL 15 MINUTE )
</select>
<update id="update" parameterType="java.lang.Integer">
update traffpicture set pushstatus=0,pushdesc='推送成功' where id=#{id}
</update>
</mapper>
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.TraffAlarmRecordMapper">
<update id="updatePushEvent" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
update traffalarmrecord
set pushstatus = #{pushstatus},
pushdesc = #{pushdesc},
pushcount= case when pushcount is null then 1 else pushcount + 1 end,
pushdate= now()
where recordid = #{recordid}
</update>
<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>
<update id="updateTraffAlarmRecordUrl" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
UPDATE traffalarmrecord
set updatetime= now()
<trim prefix="," suffixOverrides=",">
<if test="img1path!=null">img1path=#{img1path},</if>
<if test="img2path!=null">img2path=#{img2path},</if>
<if test="img3path!=null">img3path=#{img3path},</if>
<if test="img4path!=null">img4path=#{img4path},</if>
<if test="img5path!=null">img5path=#{img5path},</if>
<if test="videopath!=null">videopath=#{videopath},</if>
<if test="processstatus!=null">processstatus=#{processstatus},</if>
</trim>
WHERE recordid=#{recordid}
</update>
<select id="selectmax" resultType="java.lang.Integer">
select nvl(max(recordid),0)+1 from traffalarmrecord
</select>
<update id="updateTraffAlarmRectificationType" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
update traffalarmrecord
<set>
<if test="processstatus != null">
rectificationtype=1,
</if>
</set>
from traffalarmrecord a,
(select * from TRAFFALARMRECORD a,(select * from TRAFFALARMRECORD b where
recordid=#{recordid,jdbcType=VARCHAR} )b
where a.fdid =b.fdid and a.channelid=b.channelid
AND ( a.recordtime<![CDATA[ <= ]]> b.recordtime-10/1440)
AND recordtype in ('roadworks_out_of_line','roadworks'))b
where recordtype in('illegal_parking','no_motor_ban') and a.fdid =b.fdid and a.channelid=b.channelid
</update>
<select id="selectInChecktimeTraffAlarm" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord" resultType="java.lang.Integer">
select count(1) from videochecktime a,t_code b where
a.FDID=#{fdid,jdbcType=VARCHAR}
and a.CHANNELID=#{channelid,jdbcType=VARCHAR}
and a.RECORDTYPE=#{recordtype,jdbcType=VARCHAR}
and a.RECORDTYPE=lower(b.key)
and LASTCHECKTIME+(b.PUSHCHECKTIME)/1440 <![CDATA[ >= ]]>#{recordtime,jdbcType=TIMESTAMP}
and LASTCHECKTIME <![CDATA[ < ]]>#{recordtime,jdbcType=TIMESTAMP}
</select>
<update id="updateInworkRectifytimeTraffAlarm" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
update traffalarmrecord set rectificationtype=1,recordtype='roadworks'
where fdid=#{fdid,jdbcType=VARCHAR}
and channelid=#{channelid,jdbcType=VARCHAR}
and recordtime>=#{recordtime,jdbcType=TIMESTAMP}-(select b.RECTIFYTIME from t_code b where recordtype=LOWER (b.key) )/1440
and recordtime<![CDATA[ < ]]>#{recordtime,jdbcType=TIMESTAMP}
and recordtype in ('illegal_parking','no_motor_ban')
</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>
<update id="updateTraffAlarmRecordProcess" parameterType="com.cx.cn.cxquartz.vo.TraffAlarmRecord">
update traffalarmrecord set processstatus=-1
where recordid=#{recordid}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.TraffPictureMapper">
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.TraffpictureParam">
<id column="recordid" property="recordid"/>
<result column="imageid" property="imageid"/>
<result column="areaid" property="areaid"/>
<result column="fdid" property="fdid"/>
<result column="channelid" property="channelid"/>
<result column="objectid" property="objectid"/>
<result column="recordtype" property="recordtype"/>
<result column="Feature" property="Feature"/>
<result column="bucketidlist" property="bucketidlist"/>
<result column="facefeature" property="facefeature"/>
<result column="facebucketid" property="facebucketid"/>
<result column="facebucketidlist" property="facebucketidlist"/>
<result column="facequality" property="facequality"/>
<result column="faceyaw" property="faceyaw"/>
<result column="facepitch" property="facepitch"/>
<result column="faceroll" property="faceroll"/>
<result column="faceblurry" property="faceblurry"/>
<result column="objectimagedata" property="objectimagedata"/>
<result column="faceimagedata" property="faceimagedata"/>
<result column="pindex" property="index"/>
<result column="metadataid" property="metadataid"/>
<result column="retrycount" property="retrycount"/>
<result column="recordlevel" property="recordlevel"/>
<result column="checkstatus" property="checkstatus"/>
<result column="creator" property="creator"/>
<result column="createtime" property="createtime"/>
<result column="updator" property="updator"/>
<result column="updatetime" property="updatetime"/>
<result column="remark" property="remark"/>
<result column="pushstatus" property="pushstatus"/>
<result column="pushdesc" property="pushdesc"/>
<result column="pushcount" property="pushcount"/>
<result column="pushdate" property="pushdate"/>
<result column="processstatus" property="processstatus"/>
<result column="manualstatus" property="manualstatus"/>
</resultMap>
<insert id="inserTraffpicture" useGeneratedKeys="true" keyProperty="id">
insert into traffpicture
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordid != null">recordid,</if>
<if test="fdid != null">fdid,</if>
<if test="channelid != null">channelid,</if>
<if test="recordtype != null">recordtype,</if>
<if test="areaid != null">areaid,</if>
<if test="imageid != null">imageid,</if>
<if test="objectid != null">objectid,</if>
<if test="feature != null">feature,</if>
<if test="bucketidlist != null">bucketidlist,</if>
<if test="facefeature != null">facefeature,</if>
<if test="facebucketid != null">facebucketid,</if>
<if test="facebucketidlist != null">facebucketidlist,</if>
<if test="facequality != null">facequality,</if>
<if test="faceyaw != null">faceyaw,</if>
<if test="faceroll != null">faceroll,</if>
<if test="facepitch != null">facepitch,</if>
<if test="faceblurry != null">faceblurry,</if>
<if test="objectimagedata != null">objectimagedata,</if>
<if test="faceimagedata != null">faceimagedata,</if>
<if test="index != null">pindex,</if>
<if test="imagedata != null">imagedata,</if>
<if test="processstatus != null">processstatus,</if>
<if test="createtime !=null">createtime ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordid != null">#{recordid},</if>
<if test="fdid != null">#{fdid},</if>
<if test="channelid != null">#{channelid},</if>
<if test="recordtype != null">#{recordtype},</if>
<if test="areaid != null">#{areaid},</if>
<if test="imageid != null">#{imageid},</if>
<if test="objectid != null">#{objectid},</if>
<if test="feature != null">#{feature},</if>
<if test="bucketidlist != null">#{bucketidlist},</if>
<if test="facefeature != null">#{facefeature},</if>
<if test="facebucketid != null">#{facebucketid},</if>
<if test="facebucketidlist != null">#{facebucketidlist},</if>
<if test="facequality != null">#{facequality},</if>
<if test="faceyaw != null">#{faceyaw},</if>
<if test="faceroll != null">#{faceroll},</if>
<if test="facepitch != null">#{facepitch},</if>
<if test="faceblurry != null">#{faceblurry},</if>
<if test="objectimagedata != null">#{objectimagedata},</if>
<if test="faceimagedata != null">#{faceimagedata},</if>
<if test="index != null">#{index},</if>
<if test="imagedata != null">#{imagedata},</if>
<if test="processstatus != null">#{processstatus},</if>
<if test="createtime !=null">str_to_date(#{createtime},'%Y-%m-%d %H:%i:%s') ,</if>
</trim>
</insert>
<select id="queryimgpath" resultType="java.lang.String">
select a.imgvalue from
(select img1path imgvalue,'1' imgid from traffalarmrecord where recordid=#{recordid}
union all
select img2path imgvalue,'2' imgid from traffalarmrecord where recordid=#{recordid}
union all
select img3path imgvalue,'3' imgid from traffalarmrecord where recordid=#{recordid}
union all
select img4path imgvalue,'4' imgid from traffalarmrecord where recordid=#{recordid}
union all
select img5path imgvalue,'5' imgid from traffalarmrecord where recordid=#{recordid}) a
where a.imgid=#{imageid}
</select>
<update id="updateTraffpicture">
update traffpicture
<trim prefix="set" suffixOverrides=",">
<if test="imagedata != null and imagedata !=''">
imagedata =#{imagedata},
</if>
<if test="targetnum != null and targetnum !=''">
targetnum =#{targetnum},
</if>
<if test="objx != null and objx !=''">
objx =#{objx},
</if>
<if test="objy != null and objy !=''">
objy =#{objy},
</if>
<if test="objw != null and objw !=''">
objw =#{objw},
</if>
<if test="objh != null and objh !=''">
objh =#{objh},
</if>
<if test="processstatus != null and processstatus !=''">
processstatus =#{processstatus},
</if>
</trim>
where id=#{id}
</update>
<update id="updateTraffpicturePushStatus">
update traffpicture set pushdesc=#{pushdesc} , pushstatus=#{pushstatus} where id=#{id}
</update>
<select id="queryimgdataByid" parameterType="java.lang.String" resultType="java.lang.String">
select imagedata from traffpicture where id=#{id}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cx.cn.cxquartz.dao.TrafficMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cx.cn.cxquartz.vo.Traffic">
<result column="id" property="id"/>
<result column="type" property="type"/>
<result column="objectx" property="objectx"/>
<result column="objecty" property="objecty"/>
<result column="objectw" property="objectw"/>
<result column="objecth" property="objecth"/>
<result column="vehicleclass" property="vehicleclass"/>
<result column="vehiclecolornums" property="vehiclecolornums"/>
<result column="vehiclecolor" property="vehiclecolor"/>
<result column="vehiclebrand" property="vehiclebrand"/>
<result column="mainbrandname" property="mainbrandname"/>
<result column="subbrandname" property="subbrandname"/>
<result column="yearname" property="yearname"/>
<result column="hasplate" property="hasplate"/>
<result column="plateclass" property="plateclass"/>
<result column="platecolor" property="platecolor"/>
<result column="plateno" property="plateno"/>
<result column="plateneatness" property="plateneatness"/>
<result column="angle" property="angle"/>
<result column="sunvisor" property="sunvisor"/>
<result column="paper" property="paper"/>
<result column="decoration" property="decoration"/>
<result column="drop" property="drop"/>
<result column="tag" property="tag"/>
<result column="maindriver" property="maindriver"/>
<result column="codriver" property="codriver"/>
<result column="hascall" property="hascall"/>
<result column="hascrash" property="hascrash"/>
<result column="hasdanger" property="hasdanger"/>
<result column="hasskylight" property="hasskylight"/>
<result column="hasbaggage" property="hasbaggage"/>
<result column="hasaerial" property="hasaerial"/>
</resultMap>
<insert id="insertTraffic" parameterType="com.cx.cn.cxquartz.vo.Traffic">
insert into traffic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id !=null">id,</if>
<if test="Type !=null"> type ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x !=null"> objectx ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y !=null"> objecty ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w !=null"> objectw ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h !=null"> objecth ,</if>
<if test="VehicleClass !=null"> vehicleclass ,</if>
<if test="VehicleColorNums !=null"> vehiclecolornums ,</if>
<if test="VehicleColor !=null"> vehiclecolor ,</if>
<if test="VehicleBrand !=null"> vehiclebrand ,</if>
<if test="mainBrandName !=null"> mainbrandname ,</if>
<if test="subBrandName !=null"> subbrandname ,</if>
<if test="yearName !=null"> yearname ,</if>
<if test="HasPlate !=null"> hasplate ,</if>
<if test="PlateClass !=null"> plateclass ,</if>
<if test="PlateColor !=null"> platecolor ,</if>
<if test="PlateNo !=null"> plateno ,</if>
<if test="PlateNeatness !=null"> plateneatness ,</if>
<if test="Angle !=null"> angle ,</if>
<if test="Sunvisor !=null"> sunvisor ,</if>
<if test="Paper !=null"> paper ,</if>
<if test="Decoration !=null"> decoration ,</if>
<if test="Drop !=null"> trafficdrop ,</if>
<if test="Tag !=null"> tag ,</if>
<if test="SafetyBelt.MainDriver !=null"> maindriver ,</if>
<if test="SafetyBelt.CoDriver !=null">codriver,</if>
<if test="HasCall !=null"> hascall ,</if>
<if test="HasCrash !=null"> hascrash ,</if>
<if test="HasDanger !=null"> hasdanger ,</if>
<if test="HasSkylight !=null"> hasskylight ,</if>
<if test="HasBaggage !=null"> hasbaggage ,</if>
<if test="HasAerial !=null"> hasaerial ,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id !=null">#{id} ,</if>
<if test="Type !=null">#{Type} ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.x !=null">#{ObjectBoundingBox.x } ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.y !=null">#{ObjectBoundingBox.y} ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.w !=null">#{ObjectBoundingBox.w} ,</if>
<if test="ObjectBoundingBox!=null and ObjectBoundingBox.h !=null">#{ObjectBoundingBox.h} ,</if>
<if test="VehicleClass !=null">#{VehicleClass} ,</if>
<if test="VehicleColorNums !=null">#{VehicleColorNums} ,</if>
<if test="VehicleColor !=null">#{VehicleColor} ,</if>
<if test="VehicleBrand !=null">#{VehicleBrand} ,</if>
<if test="mainBrandName !=null">#{mainBrandName} ,</if>
<if test="subBrandName !=null">#{subBrandName} ,</if>
<if test="yearName !=null">#{yearName} ,</if>
<if test="HasPlate !=null">#{HasPlate} ,</if>
<if test="PlateClass !=null">#{PlateClass} ,</if>
<if test="PlateColor !=null">#{PlateColor} ,</if>
<if test="PlateNo !=null">#{PlateNo} ,</if>
<if test="PlateNeatness !=null">#{PlateNeatness} ,</if>
<if test="Angle !=null">#{Angle} ,</if>
<if test="Sunvisor !=null">#{Sunvisor} ,</if>
<if test="Paper !=null">#{Paper} ,</if>
<if test="Decoration !=null">#{Decoration} ,</if>
<if test="Drop !=null">#{Drop},</if>
<if test="Tag !=null">#{Tag},</if>
<if test="SafetyBelt!=null and SafetyBelt.MainDriver !=null">#{SafetyBelt.MainDriver} ,</if>
<if test="SafetyBelt!=null and SafetyBelt.CoDriver !=null">#{SafetyBelt.CoDriver},</if>
<if test="HasCall !=null">#{HasCall} ,</if>
<if test="HasCrash !=null">#{HasCrash} ,</if>
<if test="HasDanger !=null">#{HasDanger} ,</if>
<if test="HasSkylight !=null">#{HasSkylight} ,</if>
<if test="HasBaggage !=null">#{HasBaggage} ,</if>
<if test="HasAerial !=null">#{HasAerial} ,</if>
</trim>
</insert>
</mapper>
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;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.test.context.SpringBootTest;
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 testfilepath(){
String ftpfilepath="ftp://jiuling:9ling.cn@172.16.24.29:21/gstraff/picturedemo/20210625.jpg";
String ftppath="jiuling:9ling.cn@172.16.24.29:21";
ftpfilepath=ftpfilepath.replace("ftp://"+ftppath+"/","");
System.out.println(ftpfilepath);
String ftpPath="ftp://"+ftppath+"/"+ftpfilepath;
System.out.println(ftpPath);
}
}
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