Commit 1a58ea4e by 毛树良

<feat>:增加繁星同步gb1400协议

1 parent 2e054773
Showing 64 changed files with 4637 additions and 0 deletions
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.viontech</groupId>
<artifactId>fanxing-docking-gb1400</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>fanxing-docking-gb1400</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.72</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.8</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
</dependencies>
<build>
<finalName>fanxing-docking-gb1400</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>
package com.viontech;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@MapperScan("com.viontech.mapper")
@EnableScheduling
@SpringBootApplication
public class FanxingDockingGb1400Application {
public static void main(String[] args) {
SpringApplication.run(FanxingDockingGb1400Application.class, args);
}
}
package com.viontech;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInit extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(FanxingDockingGb1400Application.class);
}
}
package com.viontech.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@Getter
@Setter
@ConfigurationProperties(prefix = "gb1400")
public class Gb1400Config {
//同步1400开关:1:开启,0:未开启
private String enable;
private String username;
private String password;
private String userIdentify;
private String ipPort;
}
package com.viontech.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
/**
* @author vion
**/
@Component
@Slf4j
public class Gb1400RestTemplate {
@Autowired
private RestTemplate restTemplate;
@Autowired
private Gb1400Config gb1400Config;
public String doPost(String userIdentify, String uri, String content) {
HttpHeaders httpHeaders = setHeader(userIdentify);
if (!uri.startsWith("/")) {
uri = "/" + uri;
}
String url = "http://" + gb1400Config.getIpPort() + uri;
HttpEntity<String> entity = new HttpEntity<>(content, httpHeaders);
if (content.length() > 500) {
// log.info("1400:{} data docking,params:{}", uri, content.substring(0, 500));
log.info("1400:{} data docking,params:{}", uri, content);
} else {
log.info("1400:{} data docking,params:{}", uri, content);
}
ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, entity, String.class);
String result = responseEntity.getBody();
log.info("1400:{} data docking,result:{}", uri, result);
return result;
}
private HttpHeaders setHeader(String userIdentify) {
HttpHeaders headers = new HttpHeaders();
headers.add("User-Identify", userIdentify);
headers.add("Content-Type", "application/VIID+JSON;charset=utf-8");
// String currentTime = DateUtil.getCurrentTime(DateUtil.TIMESTAMP_NO_DELIMITER);
// headers.add("User-SendTime", currentTime);
return headers;
}
}
\ No newline at end of file
package com.viontech.config;
import com.viontech.interceptor.Gb1400AuthInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author vion
**/
@Component
public class InterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
InterceptorRegistration registration = registry.addInterceptor(new Gb1400AuthInterceptor());
registration.addPathPatterns("/VIID/**");
}
}
\ No newline at end of file
package com.viontech.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.InputStream;
import java.util.Properties;
@Configuration
@Slf4j
public class PropertiesConfiguration {
@Bean(name = "wflxProperties")
public Properties wflxProperties() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/dict/wflx.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 wflx.properties 失败", e);
}
return properties;
}
@Bean(name = "hpysProperties")
public Properties hpysProperties() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/dict/hpys.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 hpys.properties 失败", e);
}
return properties;
}
@Bean(name = "hpzlProperties")
public Properties hpzlProperties() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/dict/hpzl.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 hpzl.properties 失败", e);
}
return properties;
}
@Bean(name = "csysProperties")
public Properties csysProperties() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/dict/csys.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 csys.properties 失败", e);
}
return properties;
}
@Bean(name = "cllxProperties")
public Properties cllxProperties() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/dict/cllx.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 cllx.properties 失败", e);
}
return properties;
}
@Bean(name = "clppProperties")
public Properties clppProperties() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/dict/clpp.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 clpp.properties 失败", e);
}
return properties;
}
}
package com.viontech.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* @Author: zhaibailin
* @Date: 2020/7/16.
* @Description:
*/
@Configuration
public class RedisConfiguration {
@Autowired
private RedisConnectionFactory factory;
@Bean
public RedisTemplate<String,Object> redisTemplate(){
RedisTemplate<String,Object> redisTemplate=new RedisTemplate<>();
redisTemplate.setKeySerializer(new StringRedisSerializer());
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer=new Jackson2JsonRedisSerializer(Object.class);
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
redisTemplate.setConnectionFactory(factory);
return redisTemplate;
}
}
package com.viontech.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate(ClientHttpRequestFactory simpleClientHttpRequestFactory) {
RestTemplate restTemplate = new RestTemplate(simpleClientHttpRequestFactory);
restTemplate.setMessageConverters(getConverts());
return restTemplate;
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(20000);//ms
factory.setConnectTimeout(20000);//ms
return factory;
}
private List<HttpMessageConverter<?>> getConverts() {
List<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
StringHttpMessageConverter stringConvert = new StringHttpMessageConverter();
List<MediaType> stringMediaTypes = new ArrayList<MediaType>() {{
add(MediaType.TEXT_PLAIN);
add(MediaType.TEXT_HTML);
add(MediaType.APPLICATION_JSON);
add(new MediaType("application", "VIID+JSON"));
}};
stringConvert.setSupportedMediaTypes(stringMediaTypes);
messageConverters.add(stringConvert);
return messageConverters;
}
}
package com.viontech.constant;
public class Gb1400Constants {
public volatile static Boolean LinkStatus= false;
}
package com.viontech.constant;
/**
* @author vion
**/
public class Gb1400UriConstants {
/** 注册 */
public static final String LOGIN = "/VIID/System/Register";
/** 保活 */
public static final String KEEPALIVE = "/VIID/System/Keepalive";
/** 校时 */
public static final String CHECKTIME = "/VIID/Time";
/** 通知 */
public static final String SUBSCRIBENOTIFICATIONS = "/VIID/SubscribeNotifications";
/** 上传设备信息(上传电子警察主机配置信息) */
public static final String TOLLGATES = "/VIID/Tollgates";
/** 上传车道信息(上传电子警察主机关联的车道配置信息) */
public static final String LANES = "/VIID/Lanes";
/** 上传机动车对象(上传过车数据(含过车图片url链接与违法图片数据)) */
public static final String MOTORVEHICLES = "/VIID/MotorVehicles";
/** 上传摄像机对象(上传电子警察主机关联的摄像机配置信息) */
public static final String APES = "/VIID/APEs";
}
\ No newline at end of file
package com.viontech.constant;
/**
* @Author: msl
* @Description:
*/
public class RedisConstants {
/**
* 上次同步到的时间点
*/
public static final String FANXING_TO_GB1400_LASTTIME = "fanxing:to:gb1400:lasttime";
/**
* 国标1400注册auth
*/
public static final String GB1400_REGISTER_AUTH = "fanxing:to:gb1400:register:auth";
/**
* 已订阅数据的集合
*/
public static final String GB1400_SUBSCRIBES_HASH = "fanxing:to:gb1400:subscribes";
/**
* 取消订阅数据的集合
*/
public static final String GB1400_UNSUBSCRIBES_HASH = "fanxing:to:gb1400:unsubscribes";
/**
* 其他系统的注册信息集合
*/
public static final String GB1400_REGISTER_TO_MYSYSTEM_SET = "fanxing:to:gb1400:registertoour";
}
package com.viontech.constant;
import org.springframework.stereotype.Component;
@Component
public class SystemConstants {
public static final int APP_CODE_SUCCESS = 200;
public static final int APP_CODE_ERROR = 500;
//--------------------------------------------------
//交通类型
public static final String CATE_TRAFFIC = "traffic";
//事件类型
public static final String CATE_BEHAVIOR = "behavior";
//交通过车
public static final String TYPE_VEHICLE = "vehicle";
//交通非机动车
public static final String TYPE_XCYCLE = "xcycle";
//交通行人
public static final String TYPE_PEDESTRIAN = "pedestrian";
//违法类型
public static final String TYPE_ILLEGAL = "illegal";
//交通流量
public static final String TYPE_TFLOW = "tflow";
//行人流量
public static final String TYPE_PFLOW = "pflow";
//区域人流密度
public static final String TYPE_PDENSITY = "pdensity";
public static final String REDIS_KEY_EVENT_ID_SET = "eventIdSet";
}
package com.viontech.controller;
import com.alibaba.fastjson.JSONObject;
import com.viontech.constant.SystemConstants;
import com.viontech.service.Gb1400Service;
import com.viontech.utils.Gb1400ResponseUtil;
import com.viontech.utils.JsonMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/VIID")
public class Gb1400Controller {
@Resource
private Gb1400Service gb1400Service;
/**
* 批量订阅
* @param params
* @return
*/
@RequestMapping(value = "/Subscribes" ,method = RequestMethod.POST)
@ResponseBody
public JSONObject subscribes(@RequestBody String params){
log.info("收到请求[Subscribes.request]:{}", params);
JsonMessage vo = gb1400Service.subscribes(params);
log.info("响应[Subscribes.request]:{}", JSONObject.toJSONString(vo));
if (SystemConstants.APP_CODE_SUCCESS == vo.getCode()) {
return Gb1400ResponseUtil.responseStatusListObject((List<JSONObject>) vo.getData());
} else {
return Gb1400ResponseUtil.error(1, vo.getMsg(),"/VIID/Subscribes");
}
}
/**
* 取消订阅
* @param ID
* @return
*/
@RequestMapping(value = "/Subscribes/{ID}" ,method = RequestMethod.PUT)
@ResponseBody
public JSONObject unSubscribes(@PathVariable String ID, @RequestBody String params){
log.info("收到请求[unSubscribes.request]:{}-{}", ID, params);
JsonMessage vo = gb1400Service.unSubscribes(ID, params);
log.info("响应[unSubscribes.request]:{}-{}", ID, JSONObject.toJSONString(vo));
if (SystemConstants.APP_CODE_SUCCESS == vo.getCode()) {
return Gb1400ResponseUtil.success("/VIID/Subscribes/" + ID);
} else {
return Gb1400ResponseUtil.error(1, vo.getMsg(),"/VIID/Subscribes/" + ID);
}
}
/**
* 注册接口
* @param params
* @return
*/
@RequestMapping(value = "/System/Register" ,method = RequestMethod.POST)
@ResponseBody
public JSONObject Register(@RequestBody String params){
log.info("收到请求[Register.request]:{}", params);
JsonMessage vo = gb1400Service.registerToMySystem(params);
log.info("响应[Register.request]:{}", JSONObject.toJSONString(vo));
if (SystemConstants.APP_CODE_SUCCESS == vo.getCode()) {
return Gb1400ResponseUtil.success("/VIID/System/Register");
} else {
return Gb1400ResponseUtil.error(1, vo.getMsg(),"/VIID/System/Register");
}
}
}
package com.viontech.controller;
import com.viontech.service.TransferService;
import com.viontech.vo.FxData;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
//@RestController
//@RequestMapping("/api/v1/gb1400_recv")
public class ReceiveDataController {
@Resource
private TransferService transferService;
@PostMapping(value = "/event_data", name = "接收繁星数据")
@ResponseBody
public Object saveData(@RequestBody FxData eventData) throws Exception {
transferService.receiveData(eventData);
Map map=new HashMap();
map.put("code", "200");
map.put("note", "success");
return map;
}
}
package com.viontech.handler;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.Date;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import com.viontech.utils.DateUtil;
@MappedJdbcTypes({JdbcType.TIMESTAMP})
@MappedTypes({Date.class})
public class MilliDateTypeHandler extends BaseTypeHandler<String> {
@Override
public void setNonNullParameter(PreparedStatement arg0, int arg1,
String arg2, JdbcType arg3) throws SQLException {
Date time = new Date();
try {
time = DateUtil.dateFormat(arg2);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
java.sql.Timestamp sqlTimestamp = new java.sql.Timestamp(time.getTime());
arg0.setTimestamp(arg1, sqlTimestamp);
}
@Override
public String getNullableResult(ResultSet arg0, String arg1)
throws SQLException {
// TODO Auto-generated method stub
return arg0.getString(arg1);
}
@Override
public String getNullableResult(ResultSet arg0, int arg1)
throws SQLException {
// TODO Auto-generated method stub
return arg0.getString(arg1);
}
@Override
public String getNullableResult(CallableStatement arg0, int arg1)
throws SQLException {
// TODO Auto-generated method stub
return arg0.getString(arg1);
}
}
package com.viontech.interceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author vion
**/
public class Gb1400AuthInterceptor implements HandlerInterceptor {
private Logger log = LoggerFactory.getLogger(Gb1400AuthInterceptor.class);
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//拦截国标1400相关接口
String servletPath = request.getServletPath();
if(!servletPath.contains("/VIID/System/Register")){
return true;
}
String authorization = request.getHeader("Authorization");
if(StringUtils.isEmpty(authorization)){
response.addHeader("WWW-Authenticate","Digest realm=\"viid\",qop=\"auth\",nonce=\"123456\",opaque=\"654321\"");
response.setStatus(HttpStatus.UNAUTHORIZED.value());
return false;
}
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
}
}
\ No newline at end of file
package com.viontech.mapper;
import com.viontech.vo.traffic.TrafficModel;
import java.util.List;
public interface TrafficEventMapper {
List<Object> selectJsonDatas(TrafficModel trafficModel);
}
<?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.viontech.mapper.TrafficEventMapper">
<!-- fetchSize="5000" -->
<select id="selectJsonDatas" parameterType="com.viontech.vo.traffic.TrafficModel"
resultType="java.lang.String" fetchSize="5000">
<!-- select json_data from tb_traffic-->
select json_data
<!--||(select '{"unid":"'||unid||'"}' from tb_traffic as t1 where t1.unid=t2.unid )::jsonb as json_data -->
from tb_traffic as t2
<where>
<!-- <if test="event_type != null and (event_type == 'pedestrian' or event_type == 'xcycle')">-->
<if test="(sex != null and sex != '') or (upbody_color != null and upbody_color != '') or (lobody_color != null and lobody_color != '')">
and unid in(
select tb_face.traffic_unid
from tb_face where 1 = 1
<if test="sex != null and sex != ''">
and tb_face.sex = #{sex}
</if>
<if test="upbody_color != null and upbody_color != ''">
and tb_face.upbody_color = #{upbody_color}
</if>
<if test="lobody_color != null and lobody_color != ''">
and tb_face.lobody_color = #{lobody_color}
</if>)
</if>
<if test="subtaskIds != null and subtaskIds != ''">
and EXISTS(select 1
from (values
${subtaskIds}
) as tt(ids)
where tt.ids = tb_traffic.subtask_id)
</if>
<if test="event_type != null and event_type != ''">
and event_type = #{event_type}
</if>
<if test="with_hats != null">
and with_hats = #{with_hats}
</if>
<if test="event_types != null">
and event_type in
<foreach item="item" index="index" collection="event_types"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="task_id != null and task_id != ''">
and task_id = #{task_id}
</if>
<if test="subtask_id != null and subtask_id != ''">
and subtask_id = #{subtask_id}
</if>
<if test="plate_text != null and plate_text != ''">
and plate_text like '%' || #{plate_text} || '%'
</if>
<if test="task_type != null and task_type != ''">
and task_type = #{task_type}
</if>
<if test="dev_unid != null and dev_unid != ''">
and dev_unid = #{dev_unid}
</if>
<if test="vchan_refid != null and vchan_refid != ''">
and vchan_refid = #{vchan_refid}
</if>
<if test="xcycle_type != null and xcycle_type != ''">
and xcycle_type = #{xcycle_type}
</if>
<if test="vchan_duid != null and vchan_duid != ''">
and vchan_duid = #{vchan_duid}
</if>
<if test="plate_color_code != null and plate_color_code != ''">
and plate_color_code = #{plate_color_code}
</if>
<if test="location_code != null and location_code != ''">
and location_code = #{location_code}
</if>
<if test="lane_code != null and lane_code != ''">
and lane_code = #{lane_code}
</if>
<if test="direction_code != null and direction_code != ''">
and direction_code = #{direction_code}
</if>
<if test="location_name != null and location_name != ''">
and location_name = #{location_name}
</if>
<if test="body_type_code != null">
and body_type_code = #{body_type_code}
</if>
<if test="body_type_codes != null">
and body_type_code in
<foreach item="item" index="index" collection="body_type_codes"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="device_name != null and device_name != ''">
and device_name like '%' || #{device_name} || '%'
</if>
<if test="illegal_code != null and illegal_code != ''">
and illegal_code = #{illegal_code}
</if>
<if test="illegal_codes != null">
and illegal_code in
<foreach item="item" index="index" collection="illegal_codes"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="illegal_state != null">
and illegal_state = #{illegal_state}
</if>
<if test="body_color_code != null and body_color_code != ''">
and body_color_code = #{body_color_code}
</if>
<if test="body_logo_code != null and body_logo_code != ''">
and body_logo_code = #{body_logo_code}
</if>
<if test="refinedFeature_rAnnualInspection != null">
and "refinedFeature_rAnnualInspection" = #{refinedFeature_rAnnualInspection}
</if>
<if test="refinedFeature_rDecoration != null">
and "refinedFeature_rDecoration" = #{refinedFeature_rDecoration}
</if>
<if test="refinedFeature_rPendant != null">
and "refinedFeature_rPendant" = #{refinedFeature_rPendant}
</if>
<if test="refinedFeature_rSunshading != null">
and "refinedFeature_rSunshading" = #{refinedFeature_rSunshading}
</if>
<if test="company != null">
and "company" = #{company}
</if>
and is_active = 'true'
<if test="special_type != null and special_type != ''">
and special_type = #{special_type}
</if>
<if test="event_dt__gte != null and event_dt__gte != ''">
and shoot_dt > #{event_dt__gte,typeHandler=com.viontech.handler.MilliDateTypeHandler}
<!-- and shoot_dtime >= #{event_dt__gte}-->
</if>
<if test="event_dt__lt != null and event_dt__lt != ''">
and shoot_dt <![CDATA[<=]]> #{event_dt__lt,typeHandler=com.viontech.handler.MilliDateTypeHandler}
<!-- and shoot_dtime <![CDATA[<]]> #{event_dt__lt}-->
</if>
</where>
order by shoot_dt asc
<if test="limit != null and offset != null">
LIMIT #{limit} OFFSET #{offset}
</if>
</select>
</mapper>
\ No newline at end of file
package com.viontech.runner;
import com.alibaba.fastjson.JSONObject;
import com.viontech.config.Gb1400Config;
import com.viontech.constant.RedisConstants;
import com.viontech.service.Gb1400Service;
import com.viontech.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* @author vion
**/
@Component
@Slf4j
public class Gb1400RegisterRunner implements CommandLineRunner {
@Autowired
private Gb1400Config gb1400Config;
@Resource
private Gb1400Service gb1400Service;
@Override
public void run(String... args) {
if("1".equals(gb1400Config.getEnable()) && !StringUtils.isEmpty(gb1400Config.getUserIdentify())){
log.info("准备注册平台");
new Thread(new Runnable() {
@Override
public void run() {
gb1400Service.register(gb1400Config.getUserIdentify());
}
}).start();
}
}
public static void main(String[] args) {
String body = "{\"ResponseStatusObject\":{\"RequestURL\":\"/VIID/System/Keepalive\",\"StatusCode\":0,\"StatusString\":\"保活成功\",\"Id\":\"41011000005038163699\",\"LocalTime\":\"20220422105631\"}}";
JSONObject registerResult = JSONObject.parseObject(body);
System.out.println("x");
}
}
\ No newline at end of file
package com.viontech.scheduled;
import com.viontech.config.Gb1400Config;
import com.viontech.constant.Gb1400Constants;
import com.viontech.service.Gb1400Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
@Slf4j
@Component
public class Gb1400KeepAlive {
@Autowired
private Gb1400Config gb1400Config;
@Autowired
private RestTemplate restTemplate;
@Resource
private Gb1400Service gb1400Service;
private String registerLock = new String("REGISTERLOCK");
@Scheduled(cron = "10 * * * * ?")
public void keepalive() {
if("0".equals(gb1400Config.getEnable())){
return;
}
if (!Gb1400Constants.LinkStatus) {
return;
}
//保活
String lkh = gb1400Config.getUserIdentify();
if(StringUtils.isBlank(lkh)){
return;
}
try{
HttpHeaders headers = new HttpHeaders();
headers.add("User-Identify",lkh);
headers.add("Content-Type","application/VIID+JSON;charset=utf-8");
// String currentTime = DateUtil.getCurrentTime(DateUtil.TIMESTAMP_NO_DELIMITER);
// headers.add("User-SendTime", currentTime);
// String content = "{\"DeviceID\":\""+lkh+"\"}";
String content = "{\"KeepaliveObject\":{\"DeviceID\":\""+lkh+"\"}}";
HttpEntity<String> entity = new HttpEntity<>(content, headers);
String url = "http://"+gb1400Config.getIpPort()+"/VIID/System/Keepalive";
ResponseEntity<String> postForEntity = restTemplate.postForEntity(url, entity, String.class);
String body = postForEntity.getBody();
log.info("keepalive.result:{}", body);
}catch (Exception e){
log.error("keepalive.Exception",e);
}
}
@Scheduled(cron = "0/30 * * * * ? ")
public void register() throws Exception{
if("0".equals(gb1400Config.getEnable())){
return;
}
synchronized (registerLock) {
if(!Gb1400Constants.LinkStatus) {
gb1400Service.register(gb1400Config.getUserIdentify());
} else {
return;
}
}
}
}
package com.viontech.scheduled;
import com.viontech.constant.Gb1400Constants;
import com.viontech.constant.RedisConstants;
import com.viontech.constant.SystemConstants;
import com.viontech.handler.TrafficDataConvertHandler;
import com.viontech.service.Gb1400Service;
import com.viontech.service.TrafficEventService;
import com.viontech.utils.DateUtil;
import com.viontech.utils.JavaBean2Json;
import com.viontech.utils.JsonMessage;
import com.viontech.vo.gb1400.SubscribeNotificationsObj;
import com.viontech.vo.traffic.TrafficModel;
import com.viontech.vo.traffic.TrafficMongoModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Slf4j
@Component
public class TrafficIllegalScheduled {
@Resource
private TrafficEventService trafficEventService;
@Resource
private Gb1400Service gb1400Service;
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private TrafficDataConvertHandler trafficDataConvertHandler;
@Scheduled(cron = "0/5 * * * * ?")
public void handleIllegal() {
log.info("开始处理违法数据");
if (!Gb1400Constants.LinkStatus) {
return;
}
Object o = redisTemplate.opsForValue().get(RedisConstants.FANXING_TO_GB1400_LASTTIME);
//上次对接到的违法记录时间
String lastTimeUtc = "";
if (o == null) {
//查询一小时前的数据,-1,-8:转UTC时间,总-9
lastTimeUtc = DateUtil.formatDate(DateUtil.addHours(new Date(), -9), DateUtil.TIMESTAMP_FORMAT);
} else {
lastTimeUtc = (String) o;
}
String currentTimeUtc = DateUtil.formatDate(DateUtil.addHours(new Date(), -8), DateUtil.TIMESTAMP_FORMAT);
if (StringUtils.isBlank(lastTimeUtc) || StringUtils.isBlank(currentTimeUtc)) {
log.warn("lastTimeUtc or currentTimeUtc isBlank");
return;
}
int offset = 0;
int limit = 10;
//utc时间,当前时间减8小时
String event_dt__gte = lastTimeUtc;
String event_dt__lt = currentTimeUtc;
TrafficModel trafficQry = new TrafficModel();
trafficQry.setEvent_cate("traffic");
trafficQry.setEvent_type("vehicle");
trafficQry.setIllegal_state("true");
trafficQry.setEvent_dt__gte(event_dt__gte);
trafficQry.setEvent_dt__lt(event_dt__lt);
trafficQry.setLimit(limit);
trafficQry.setOffset(offset);
List<Object> trafficModels = trafficEventService.selectJsonDatas(trafficQry);
log.info("查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步数据总{}条。", lastTimeUtc, currentTimeUtc, trafficModels.size());
if (!CollectionUtils.isEmpty(trafficModels)) {
List<TrafficMongoModel> trafficMongoModels = new ArrayList<>();
for (Object model : trafficModels) {
trafficMongoModels.add(JavaBean2Json.Json2JavaBean(JavaBean2Json.javaBean2Json(model), TrafficMongoModel.class));
}
//List<TrafficMongoModel> 转 SubscribeNotificationsObj
SubscribeNotificationsObj subscribeNotificationsObj = trafficDataConvertHandler.trafficIllegalToSubscribeNotifications(trafficMongoModels);
//将违法数据同步gb1400
if (subscribeNotificationsObj != null) {
JsonMessage resultVo = gb1400Service.subscribeNotifications(subscribeNotificationsObj);
if (SystemConstants.APP_CODE_SUCCESS == resultVo.getCode()) {
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_LASTTIME, trafficMongoModels.get(trafficMongoModels.size() - 1).getEvent_dt());
}
} else {
log.error("trafficDataConvertHandler.trafficIllegalToSubscribeNotifications is null");
}
}
log.info("结束处理违法数据");
}
}
package com.viontech.service;
import com.viontech.utils.JsonMessage;
import com.viontech.vo.gb1400.SubscribeNotificationsObj;
public interface Gb1400Service {
JsonMessage registerToMySystem(String params);
void register(String userIdentify);
JsonMessage subscribes(String params);
JsonMessage unSubscribes(String subscribeId, String params);
JsonMessage subscribeNotifications(SubscribeNotificationsObj subscribeNotificationsObj);
}
package com.viontech.service;
import com.viontech.vo.traffic.TrafficModel;
import java.util.List;
public interface TrafficEventService {
List<Object> selectJsonDatas(TrafficModel trafficModel);
}
package com.viontech.service;
import com.viontech.vo.FxData;
public interface TransferService {
void receiveData(FxData fxdata);
}
package com.viontech.service.impl;
import com.viontech.mapper.TrafficEventMapper;
import com.viontech.service.TrafficEventService;
import com.viontech.vo.traffic.TrafficModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class TrafficEventServiceImpl implements TrafficEventService {
@Autowired
private TrafficEventMapper trafficEventMapper;
@Override
public List<Object> selectJsonDatas(TrafficModel trafficModel) {
return trafficEventMapper.selectJsonDatas(trafficModel);
}
}
package com.viontech.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.viontech.constant.SystemConstants;
import com.viontech.service.TransferService;
import com.viontech.vo.FxData;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@Slf4j
@Service
public class TransferServiceImpl implements TransferService {
private final ThreadPoolExecutor recvDataTaskAsyncPool = new ThreadPoolExecutor(5, 10, 8l, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10), new ThreadPoolExecutor.CallerRunsPolicy());
@Override
public void receiveData(FxData fxdata) {
try {
String event_cate = fxdata.getEvent_cate();
if (!event_cate.equals(SystemConstants.CATE_TRAFFIC)) {
log.warn("event_cate与traffic不匹配,跳过");
return;
}
String event_type = fxdata.getEvent_type();
if (StringUtils.isBlank(event_type)) {
log.warn("event_type为空,跳过");
return;
}
recvDataTaskAsyncPool.submit(new Runnable() {
@Override
public void run() {
switch (event_cate) {
case SystemConstants.CATE_TRAFFIC:
switch (event_type) {
case SystemConstants.TYPE_VEHICLE:
String ID = fxdata.getEvent_data().getID();
String startDt = fxdata.getEvent_data().getStart_dt();
String endDt = fxdata.getEvent_data().getEnd_dt();
String deviceCode = fxdata.getEvent_data().getDevice().getCode();
String vchanRefid = fxdata.getVchan_refid();
Map vehicle = JSONObject.parseObject(JSONObject.toJSONString(fxdata.getEvent_data().getVehicle()), Map.class);
Map illegal = JSONObject.parseObject(JSONObject.toJSONString(fxdata.getEvent_data().getIllegal()), Map.class);
String state = (String) illegal.get("state");
String base64 = fxdata.getPics().get(0).getPic_base64();
Map lane = JSONObject.parseObject(JSONObject.toJSONString(fxdata.getEvent_data().getLane()), Map.class);
try {
if ("1".equals(state)) {
// iilleProcessor.addIill(ID, startDt, endDt, deviceCode, vchanRefid, vehicle, illegal, base64);
} else {
return;
}
} catch (Exception e) {
log.error("handle.Exception", e);
}
break;
default:
log.warn("event_type类型无法判断:{},跳过处理", event_type);
break;
}
break;
default:
log.warn("event_cate类型无法判断:{}跳过处理", event_cate);
break;
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
fxdata.setPics(null);
}
}
package com.viontech.utils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class Gb1400GenerateIDUtil {
//公安机关机构代码
@Value("${gb1400.gongan.orgcode:}")
private String gonganOrgcode;
//
private volatile Long notificationSequence = 0L;
private volatile Long sourceIdSequence = 0L;
private volatile Long motorVehicleIDSequence = 0L;
// 序列号的最大值
private final int sequenceMax = 99999;
/**
* 自动生成NotificationID
* @return NotificationID
*/
public String generateNotificationID() {
StringBuilder idstr = new StringBuilder();
String currentTime = DateUtil.format(new Date(), DateUtil.DATE_TIME_FORMAT_NO_DELIMITER);
idstr.append(gonganOrgcode);
idstr.append("04");
idstr.append(currentTime);
idstr.append(nextNotificationId());
return idstr.toString();
}
/**
* 自动生成SourceID
* @return SourceID
*/
public String generateSourceID(String DeviceID, String type, String PassTime) {
StringBuilder idstr = new StringBuilder();
idstr.append(DeviceID);
idstr.append(type);
idstr.append(PassTime);
idstr.append(nextSourceId());
return idstr.toString();
}
/**
* 自动生成MotorVehicleID
* @return MotorVehicleID
*/
public String generateMotorVehicleID(String SourceID, String type) {
StringBuilder idstr = new StringBuilder();
idstr.append(SourceID);
idstr.append(type);
idstr.append(nextMotorVehicleId());
return idstr.toString();
}
public String nextNotificationId(){
synchronized (this.notificationSequence) {
this.notificationSequence = (this.notificationSequence + 1) % this.sequenceMax;
return String.format("%05d", this.notificationSequence.longValue());
}
}
public String nextSourceId(){
synchronized (this.sourceIdSequence) {
this.sourceIdSequence = (this.sourceIdSequence + 1) % this.sequenceMax;
return String.format("%05d", this.sourceIdSequence.longValue());
}
}
public String nextMotorVehicleId(){
synchronized (this.motorVehicleIDSequence) {
this.motorVehicleIDSequence = (this.motorVehicleIDSequence + 1) % this.sequenceMax;
return String.format("%05d", this.motorVehicleIDSequence.longValue());
}
}
public static void main(String[] args) {
Gb1400GenerateIDUtil xx = new Gb1400GenerateIDUtil();
for (int i = 0; i < 10; i++) {
System.out.println(xx.generateNotificationID());
}
}
}
package com.viontech.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List;
/**
* @author vion
**/
public class Gb1400ResponseUtil {
public static JSONObject success(String id, String requestURL) {
JSONObject response = new JSONObject();
response.put("Id", id);
response.put("LocalTime", new Date());
response.put("RequestURL", requestURL);
response.put("StatusCode", 0);
response.put("StatusString", "成功");
JSONObject result = new JSONObject();
result.put("ResponseStatusObject", response);
return result;
}
public static JSONObject success(String requestURL) {
JSONObject response = new JSONObject();
response.put("Id", null);
response.put("LocalTime", new Date());
response.put("RequestURL", requestURL);
response.put("StatusCode", 0);
response.put("StatusString", "成功");
JSONObject result = new JSONObject();
result.put("ResponseStatusObject", response);
return result;
}
public static JSONObject successList(String requestURL) {
JSONObject item = new JSONObject();
item.put("Id", null);
item.put("LocalTime", new Date());
item.put("RequestURL", requestURL);
item.put("StatusCode", 0);
item.put("StatusString", "成功");
JSONArray items = new JSONArray();
items.add(item);
JSONObject object = new JSONObject();
object.put("ResponseStatusObject", items);
JSONObject result = new JSONObject();
result.put("ResponseStatusListObject", object);
return result;
}
public static JSONObject responseStatusListObject(List<JSONObject> list) {
JSONObject object = new JSONObject();
object.put("ResponseStatusObject", list);
JSONObject result = new JSONObject();
result.put("ResponseStatusListObject", object);
return result;
}
public static JSONObject buildResponseStatusObject(String id, String requestURL, Integer StatusCode, String StatusString) {
JSONObject response = new JSONObject();
response.put("Id", id);
response.put("LocalTime", new Date());
response.put("RequestURL", requestURL);
response.put("StatusCode", StatusCode);
response.put("StatusString", StatusString);
return response;
}
public static JSONObject error(Integer errorNo, String errorMsg, String requestURL) {
JSONObject response = new JSONObject();
response.put("Id", null);
response.put("LocalTime", new Date());
response.put("RequestURL", requestURL);
response.put("StatusCode", errorNo);
response.put("StatusString", errorMsg);
JSONObject result = new JSONObject();
result.put("ResponseStatusObject", response);
return result;
}
}
\ No newline at end of file
package com.viontech.utils;
import java.util.*;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import net.sf.json.util.PropertyFilter;
public class JavaBean2Json {
public static String javaBean2Json(Object obj) {
return JSONObject.fromObject(obj,getJsonConfig()).toString();
}
public static <T> T Json2JavaBean(String json,Class<T> clas) {
try {
ObjectMapper om = new ObjectMapper();
om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return om.readValue(json, clas);
} catch (Exception e) {
JSONObject jsb = new JSONObject();
return (T) jsb.toBean(JSONObject.fromObject(json), clas, getJsonConfig());
}
}
/**
* json转List
* @param json
* @param clazz
* @param <T>
* @return
*/
public static <T> List<T> json2List(String json,Class<T> clazz) {
if(json.startsWith("[")){//json.indexOf("[")==0
JSONArray array = JSONArray.fromObject(json);
List<T> list = JSONArray.toList(array, clazz);
return list;
}
return null;
}
/**
* json转Array
* @param json
* @param clazz
* @param <T>
* @return
*/
public static <T> T[] json2Array(String json,Class<T> clazz) {
if(json.indexOf("[")==0){
JSONArray array = JSONArray.fromObject(json);
T[] ray = (T[]) JSONArray.toArray(array, clazz);
return ray;
}
return null;
}
private static JsonConfig getJsonConfig(){
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setJsonPropertyFilter(new PropertyFilter() {
public boolean apply(Object source/* 属性的拥有者 */, String name /* 属性名字 */,Object value/* 属性值 */) {
if(value instanceof List){
List<Object> list = (List<Object>) value;
if (list == null || list.size()==0) {
return true;
}
}else if(value instanceof Map){
Map map = (Map) value;
if (map == null || map.size() == 0) {
return true;
}
}
return null == value || "".equals(value);
}
});
return jsonConfig;
}
public static void jsonToMap(String json, Map map) {
JSONObject jsonObject = JSONObject.fromObject(json);
populate(jsonObject, map);
}
private static void populate(JSONObject jsonObject, Map map) {
for (Iterator iterator = jsonObject.entrySet().iterator(); iterator
.hasNext();) {
String entryStr = String.valueOf(iterator.next());
String key = entryStr.substring(0, entryStr.indexOf("="));
String value = entryStr.substring(entryStr.indexOf("=") + 1,entryStr.length());
if (jsonObject.get(key).getClass().equals(JSONObject.class)) {
HashMap _map = new HashMap();
map.put(key, _map);
populate(jsonObject.getJSONObject(key), ((Map) (_map)));
} else if (jsonObject.get(key).getClass().equals(JSONArray.class)) {
ArrayList list = new ArrayList();
map.put(key, list);
populateArray(jsonObject.getJSONArray(key), list);
} else {
map.put(key, jsonObject.get(key));
}
}
}
private static void populateArray(JSONArray jsonArray, List list) {
for (int i = 0; i < jsonArray.size(); i++)
if (jsonArray.get(i).getClass().equals(JSONArray.class)) {
ArrayList _list = new ArrayList();
list.add(_list);
populateArray(jsonArray.getJSONArray(i), _list);
} else if (jsonArray.get(i).getClass().equals(JSONObject.class)) {
HashMap _map = new HashMap();
list.add(_map);
populate(jsonArray.getJSONObject(i), _map);
} else {
list.add(jsonArray.get(i));
}
}
/***
* 判断发过来的信息是否是json格式
*
* @param json
* @return
*/
public static boolean isJson(String json) {
try {
JSONObject.fromObject(json);
return true;
} catch (Exception e) {
return false;
}
}
}
package com.viontech.utils;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
public class JsonMessage<T> {
private boolean success;
private int code;
private String msg;
private T data;
public JsonMessage() {
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
@Override
public String toString() {
return JSONObject.toJSONString(this, SerializerFeature.WriteMapNullValue);
}
}
package com.viontech.utils;
import com.viontech.constant.SystemConstants;
public class JsonMessageUtil {
/**
* 返回成功json信息
*
* @param msg
* 成功信息
* @param data
* 对应的数据
* @return json消息对象
*/
public static <T> JsonMessage<T> getSuccessJsonMsg(String msg, T data) {
JsonMessage jsonMessage = getJsonMessageInstance();
jsonMessage.setSuccess(true);
jsonMessage.setCode(SystemConstants.APP_CODE_SUCCESS);
jsonMessage.setMsg(msg);
jsonMessage.setData(data);
return jsonMessage;
}
public static<T> JsonMessage<T> getSuccessJsonMsg(T data) {
return getSuccessJsonMsg("", data);
}
public static JsonMessage getSuccessJsonMsg(String msg) {
return getSuccessJsonMsg(msg, null);
}
/**
* 返回失败json信息
*
* @param msg
* 成功信息
* @return json消息对象
*/
public static JsonMessage getErrorJsonMsg(String msg) {
JsonMessage jsonMessage = getJsonMessageInstance();
jsonMessage.setSuccess(false);
jsonMessage.setCode(SystemConstants.APP_CODE_ERROR);
jsonMessage.setMsg(msg);
jsonMessage.setData(null);
return jsonMessage;
}
/**
* 返回失败json信息
*
* @param msg
* 成功信息
* @return json消息对象
*/
public static JsonMessage getErrorJsonMsg(Integer code,String msg) {
JsonMessage jsonMessage = getJsonMessageInstance();
jsonMessage.setSuccess(false);
jsonMessage.setCode(code);
jsonMessage.setMsg(msg);
jsonMessage.setData(null);
return jsonMessage;
}
/**
* Json消息对象,用来返回给前台json
*
* @author suman 2016年8月15日 上午10:55:05
*/
public static JsonMessage getJsonMessageInstance(){
return new JsonMessage();
}
}
package com.viontech.vo;
import java.util.List;
import java.util.Map;
/**
* @Author: zhaibailin
* @Date: 2020/7/9.
* @Description:
*/
public class DriverDataVo {
private Map holdingchild;
private List<Map> safe_belt;
private String image;
private List<FaceDataVo> face;
private Map phone;
public Map getHoldingchild() {
return holdingchild;
}
public void setHoldingchild(Map holdingchild) {
this.holdingchild = holdingchild;
}
public List<Map> getSafe_belt() {
return safe_belt;
}
public void setSafe_belt(List<Map> safe_belt) {
this.safe_belt = safe_belt;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public List<FaceDataVo> getFace() {
return face;
}
public void setFace(List<FaceDataVo> face) {
this.face = face;
}
public Map getPhone() {
return phone;
}
public void setPhone(Map phone) {
this.phone = phone;
}
}
package com.viontech.vo;
import java.util.Map;
public class FaceDataVo {
private String state;
private Map rect;
private String with_hats;
private String sex;
private Map upbody;
private Map lobody;
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Map getRect() {
return rect;
}
public void setRect(Map rect) {
this.rect = rect;
}
public String getWith_hats() {
return with_hats;
}
public void setWith_hats(String with_hats) {
this.with_hats = with_hats;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Map getUpbody() {
return upbody;
}
public void setUpbody(Map upbody) {
this.upbody = upbody;
}
public Map getLobody() {
return lobody;
}
public void setLobody(Map lobody) {
this.lobody = lobody;
}
}
package com.viontech.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Author: zhaibailin
* @Date: 2020/7/8.
* @Description:
*/
public class FxData{
private String event_cate;
private String event_type;
private String event_refid;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS", timezone = "GMT+8")
private String event_dt;
private String dev_unid;
private String vdev_unid;
private String vchan_duid;
private String vchan_refid;
private Map aux_dev_info;
private TrafficDataVo event_data;
private List<PicDataVo> pics;
private List<VideoDataVo> video;
private String task_type;
private String task_id;
private String subtask_id;
private String source_type;
private String test_pic_file;
private String test_frame_no;
public String getEvent_cate() {
return event_cate;
}
public void setEvent_cate(String event_cate) {
this.event_cate = event_cate;
}
public String getEvent_type() {
return event_type;
}
public void setEvent_type(String event_type) {
this.event_type = event_type;
}
public String getEvent_refid() {
return event_refid;
}
public void setEvent_refid(String event_refid) {
this.event_refid = event_refid;
}
public String getEvent_dt() {
return event_dt;
}
public void setEvent_dt(String event_dt) {
this.event_dt = event_dt;
}
public String getDev_unid() {
return dev_unid;
}
public void setDev_unid(String dev_unid) {
this.dev_unid = dev_unid;
}
public String getVdev_unid() {
return vdev_unid;
}
public void setVdev_unid(String vdev_unid) {
this.vdev_unid = vdev_unid;
}
public String getVchan_duid() {
return vchan_duid;
}
public void setVchan_duid(String vchan_duid) {
this.vchan_duid = vchan_duid;
}
public String getVchan_refid() {
return vchan_refid;
}
public void setVchan_refid(String vchan_refid) {
this.vchan_refid = vchan_refid;
}
public Map getAux_dev_info() {
return aux_dev_info;
}
public void setAux_dev_info(Map aux_dev_info) {
this.aux_dev_info = aux_dev_info;
}
public TrafficDataVo getEvent_data() {
return event_data;
}
public void setEvent_data(TrafficDataVo event_data) {
this.event_data = event_data;
}
public List<PicDataVo> getPics() {
return pics;
}
public void setPics(List<PicDataVo> pics) {
this.pics = pics;
}
public List<VideoDataVo> getVideo() {
return video;
}
public void setVideo(List<VideoDataVo> video) {
this.video = video;
}
public String getTask_type() {
return task_type;
}
public void setTask_type(String task_type) {
this.task_type = task_type;
}
public String getTask_id() {
return task_id;
}
public void setTask_id(String task_id) {
this.task_id = task_id;
}
public String getSubtask_id() {
return subtask_id;
}
public void setSubtask_id(String subtask_id) {
this.subtask_id = subtask_id;
}
public String getSource_type() {
return source_type;
}
public void setSource_type(String source_type) {
this.source_type = source_type;
}
public String getTest_pic_file() {
return test_pic_file;
}
public void setTest_pic_file(String test_pic_file) {
this.test_pic_file = test_pic_file;
}
public String getTest_frame_no() {
return test_frame_no;
}
public void setTest_frame_no(String test_frame_no) {
this.test_frame_no = test_frame_no;
}
}
package com.viontech.vo;
import java.util.List;
import java.util.Map;
/**
* @Author: zhaibailin
* @Date: 2020/7/8.
* @Description:
*/
public class IllegalDataVo {
private String state;
private String code;
private Detail detail;
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Detail getDetail() {
return detail;
}
public void setDetail(Detail detail) {
this.detail = detail;
}
public class Detail{
private String limit_speed;
private String spark_speed;
private String over_speed_rate;
private String start_dt;
private String end_dt;
private List<Map> limit_time;
public String getLimit_speed() {
return limit_speed;
}
public void setLimit_speed(String limit_speed) {
this.limit_speed = limit_speed;
}
public String getSpark_speed() {
return spark_speed;
}
public void setSpark_speed(String spark_speed) {
this.spark_speed = spark_speed;
}
public String getOver_speed_rate() {
return over_speed_rate;
}
public void setOver_speed_rate(String over_speed_rate) {
this.over_speed_rate = over_speed_rate;
}
public String getStart_dt() {
return start_dt;
}
public void setStart_dt(String start_dt) {
this.start_dt = start_dt;
}
public String getEnd_dt() {
return end_dt;
}
public void setEnd_dt(String end_dt) {
this.end_dt = end_dt;
}
public List<Map> getLimit_time() {
return limit_time;
}
public void setLimit_time(List<Map> limit_time) {
this.limit_time = limit_time;
}
}
}
package com.viontech.vo;
import java.util.Map;
/**
* @Author: zhaibailin
* @Date: 2020/7/8.
* @Description:
*/
public class PicDataVo {
private String pic_base64;
private String src_url;
private String format;
private String pic_unid;
private String shoot_dt;
private String width;
private String hight;
private String ofilename;
private String type;
private Map object_rect;
private Map feature_rect;
public String getPic_base64() {
return pic_base64;
}
public void setPic_base64(String pic_base64) {
this.pic_base64 = pic_base64;
}
public String getSrc_url() {
return src_url;
}
public void setSrc_url(String src_url) {
this.src_url = src_url;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getPic_unid() {
return pic_unid;
}
public void setPic_unid(String pic_unid) {
this.pic_unid = pic_unid;
}
public String getShoot_dt() {
return shoot_dt;
}
public void setShoot_dt(String shoot_dt) {
this.shoot_dt = shoot_dt;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHight() {
return hight;
}
public void setHight(String hight) {
this.hight = hight;
}
public String getOfilename() {
return ofilename;
}
public void setOfilename(String ofilename) {
this.ofilename = ofilename;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Map getObject_rect() {
return object_rect;
}
public void setObject_rect(Map object_rect) {
this.object_rect = object_rect;
}
public Map getFeature_rect() {
return feature_rect;
}
public void setFeature_rect(Map feature_rect) {
this.feature_rect = feature_rect;
}
}
package com.viontech.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.viontech.vo.VehicleDataVo;
import org.springframework.context.annotation.Conditional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Author: zhaibailin
* @Date: 2020/7/8.
* @Description:
*/
public class TrafficDataVo {
private String version;
private String speed;
private String model;
private String start_dt;
private String end_dt;
@JsonProperty(value = "ID")
private String ID;
private Location location;
private Device device;
private Lane lane;
@JsonProperty(value = "vehicle")
private VehicleDataVo vehicle;
private Map RefinedFeature;
@JsonProperty(value = "driver")
private DriverDataVo driver;
@JsonProperty(value = "illegal")
private IllegalDataVo illegal;
private String xcycle_type;
@JsonProperty(value = "xcycle")
private Object xcycle;
@JsonProperty(value = "pedestrian")
private Object pedestrian;
private Map xcycleData;
private Map pedestrianData;
private List<VehicleFlowVo> xcycleFlow;
private List<VehicleFlowVo> pedestrianFlow;
@JsonProperty(value = "big_vehicle")
private List<VehicleFlowVo> big_vehicle;
@JsonProperty(value = "small_vehicle")
private List<VehicleFlowVo> small_vehicle;
public List<VehicleFlowVo> getBig_vehicle() {
return big_vehicle;
}
public void setBig_vehicle(List<VehicleFlowVo> big_vehicle) {
this.big_vehicle = big_vehicle;
}
public List<VehicleFlowVo> getSmall_vehicle() {
return small_vehicle;
}
public void setSmall_vehicle(List<VehicleFlowVo> small_vehicle) {
this.small_vehicle = small_vehicle;
}
public Map getXcycleData() {
if(xcycle instanceof Map){
xcycleData= (Map) xcycle;
}
return xcycleData;
}
public void setXcycleData(Map xcycleData) {
this.xcycleData = xcycleData;
}
public Map getPedestrianData() {
if(pedestrian instanceof Map){
pedestrianData= (Map) pedestrian;
}
return pedestrianData;
}
public void setPedestrianData(Map pedestrianData) {
this.pedestrianData = pedestrianData;
}
public List<VehicleFlowVo> getXcycleFlow() {
if(xcycle instanceof Map){
xcycleFlow= (List<VehicleFlowVo>) xcycle;
}
return xcycleFlow;
}
public void setXcycleFlow(List<VehicleFlowVo> xcycleFlow) {
this.xcycleFlow = xcycleFlow;
}
public List<VehicleFlowVo> getPedestrianFlow() {
if(pedestrian instanceof List){
pedestrianFlow=(List<VehicleFlowVo>) pedestrian;
}
return pedestrianFlow;
}
public void setPedestrianFlow(List<VehicleFlowVo> pedestrianFlow) {
this.pedestrianFlow = pedestrianFlow;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getSpeed() {
return speed;
}
public void setSpeed(String speed) {
this.speed = speed;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getStart_dt() {
return start_dt;
}
public void setStart_dt(String start_dt) {
this.start_dt = start_dt;
}
public String getEnd_dt() {
return end_dt;
}
public void setEnd_dt(String end_dt) {
this.end_dt = end_dt;
}
public String getID() {
return ID;
}
public void setID(String ID) {
this.ID = ID;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public Device getDevice() {
return device;
}
public void setDevice(Device device) {
this.device = device;
}
public Lane getLane() {
return lane;
}
public void setLane(Lane lane) {
this.lane = lane;
}
public VehicleDataVo getVehicle() {
return vehicle;
}
public void setVehicle(VehicleDataVo vehicle) {
this.vehicle = vehicle;
}
public Map getRefinedFeature() {
return RefinedFeature;
}
public void setRefinedFeature(Map refinedFeature) {
RefinedFeature = refinedFeature;
}
public DriverDataVo getDriver() {
return driver;
}
public void setDriver(DriverDataVo driver) {
this.driver = driver;
}
public IllegalDataVo getIllegal() {
return illegal;
}
public void setIllegal(IllegalDataVo illegal) {
this.illegal = illegal;
}
public String getXcycle_type() {
return xcycle_type;
}
public void setXcycle_type(String xcycle_type) {
this.xcycle_type = xcycle_type;
}
public Object getXcycle() {
return xcycle;
}
public void setXcycle(Object xcycle) {
this.xcycle = xcycle;
}
public Object getPedestrian() {
return pedestrian;
}
public void setPedestrian(Object pedestrian) {
this.pedestrian = pedestrian;
}
public class Location{
private String name;
private String code;
private Map department;
private Map direction;
private Map drive_direction;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Map getDepartment() {
return department;
}
public void setDepartment(Map department) {
this.department = department;
}
public Map getDirection() {
return direction;
}
public void setDirection(Map direction) {
this.direction = direction;
}
public Map getDrive_direction() {
return drive_direction;
}
public void setDrive_direction(Map drive_direction) {
this.drive_direction = drive_direction;
}
}
public class Device{
private String name;
private String code;
private String ip;
private String model;
private String host;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
}
public class Lane{
private String code;
private String number;
private String description;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
}
package com.viontech.vo;
import java.util.List;
import java.util.Map;
/**
* @Author: zhaibailin
* @Date: 2020/7/8.
* @Description:
*/
public class VehicleDataVo {
private String image;
private Map global_feature;
private Map local_feature;
private Map rect;
private Map plate;
private Map body;
private Map driver;
private List<Map> tracks;
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Map getGlobal_feature() {
return global_feature;
}
public void setGlobal_feature(Map global_feature) {
this.global_feature = global_feature;
}
public Map getLocal_feature() {
return local_feature;
}
public void setLocal_feature(Map local_feature) {
this.local_feature = local_feature;
}
public Map getRect() {
return rect;
}
public void setRect(Map rect) {
this.rect = rect;
}
public Map getPlate() {
return plate;
}
public void setPlate(Map plate) {
this.plate = plate;
}
public Map getBody() {
return body;
}
public void setBody(Map body) {
this.body = body;
}
public Map getDriver() {
return driver;
}
public void setDriver(Map driver) {
this.driver = driver;
}
public List<Map> getTracks() {
return tracks;
}
public void setTracks(List<Map> tracks) {
this.tracks = tracks;
}
}
package com.viontech.vo;
/**
* @Author: zhaibailin
* @Date: 2020/7/20.
* @Description:
*/
public class VehicleFlowVo {
private String road;
private String direction;
private Integer sample_dura;
private Integer sample_num;
private Integer velocity;
private String velocity_unit;
private Float occupy;
private Float distance;
private Integer queue_length;
public String getRoad() {
return road;
}
public void setRoad(String road) {
this.road = road;
}
public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public Integer getSample_dura() {
return sample_dura;
}
public void setSample_dura(Integer sample_dura) {
this.sample_dura = sample_dura;
}
public Integer getSample_num() {
return sample_num;
}
public void setSample_num(Integer sample_num) {
this.sample_num = sample_num;
}
public Integer getVelocity() {
return velocity;
}
public void setVelocity(Integer velocity) {
this.velocity = velocity;
}
public String getVelocity_unit() {
return velocity_unit;
}
public void setVelocity_unit(String velocity_unit) {
this.velocity_unit = velocity_unit;
}
public Float getOccupy() {
return occupy;
}
public void setOccupy(Float occupy) {
this.occupy = occupy;
}
public Float getDistance() {
return distance;
}
public void setDistance(Float distance) {
this.distance = distance;
}
public Integer getQueue_length() {
return queue_length;
}
public void setQueue_length(Integer queue_length) {
this.queue_length = queue_length;
}
}
package com.viontech.vo;
/**
* @Author: zhaibailin
* @Date: 2020/7/8.
* @Description:
*/
public class VideoDataVo {
private String video_base64;
private String src_url;
private String start_dt;
private String end_dt;
private String format;
private String unid;
private String width;
private String height;
private String fps;
private String ofilename;
public String getVideo_base64() {
return video_base64;
}
public void setVideo_base64(String video_base64) {
this.video_base64 = video_base64;
}
public String getSrc_url() {
return src_url;
}
public void setSrc_url(String src_url) {
this.src_url = src_url;
}
public String getStart_dt() {
return start_dt;
}
public void setStart_dt(String start_dt) {
this.start_dt = start_dt;
}
public String getEnd_dt() {
return end_dt;
}
public void setEnd_dt(String end_dt) {
this.end_dt = end_dt;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHeight() {
return height;
}
public void setHeight(String height) {
this.height = height;
}
public String getFps() {
return fps;
}
public void setFps(String fps) {
this.fps = fps;
}
public String getOfilename() {
return ofilename;
}
public void setOfilename(String ofilename) {
this.ofilename = ofilename;
}
}
package com.viontech.vo.gb1400;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.List;
@Data
public class MotorVehicleObj {
@JSONField(name = "MotorVehicleObject")
private List<MotorVehicleObject> motorVehicleObject;
@Data
public static class MotorVehicleObject {
@JSONField(name = "MotorVehicleID")
private String MotorVehicleID;
@JSONField(name = "InfoKind")
private Integer InfoKind;
@JSONField(name = "SourceID")
private String SourceID;
@JSONField(name = "TollgateID")
private String TollgateID;
@JSONField(name = "PassTime")
private String PassTime;
@JSONField(name = "DeviceID")
private String DeviceID;
@JSONField(name = "StorageUrl1")
private String StorageUrl1;
@JSONField(name = "StorageUrl2")
private String StorageUrl2;
@JSONField(name = "LeftTopX")
private Integer LeftTopX;
@JSONField(name = "LeftTopY")
private Integer LeftTopY;
@JSONField(name = "RightBtmX")
private Integer RightBtmX;
@JSONField(name = "RightBtmY")
private Integer RightBtmY;
@JSONField(name = "LaneNo")
private Integer LaneNo;
@JSONField(name = "HasPlate")
private String HasPlate;
@JSONField(name = "PlateClass")
private String PlateClass;
@JSONField(name = "PlateColor")
private String PlateColor;
@JSONField(name = "PlateNo")
private String PlateNo;
@JSONField(name = "Direction")
private String Direction;
@JSONField(name = "VehicleClass")
private String VehicleClass;
@JSONField(name = "VehicleBrand")
private String VehicleBrand;
@JSONField(name = "VehicleStyles")
private String VehicleStyles;
@JSONField(name = "VehicleColor")
private String VehicleColor;
@JSONField(name = "Sunvisor")
private Integer Sunvisor;
@JSONField(name = "SafetyBelt")
private Integer SafetyBelt;
@JSONField(name = "Calling")
private Integer Calling;
//违法过车类型
@JSONField(name = "BreakRuleMode")
private String BreakRuleMode;
}
}
package com.viontech.vo.gb1400;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.List;
@Data
public class SubscribeNotificationsObj {
@JSONField(name = "SubscribeNotificationListObject")
private SubscribeNotificationListObject subscribeNotificationListObject;
@Data
public static class SubscribeNotificationListObject {
@JSONField(name = "SubscribeNotificationObject")
private List<SubscribeNotificationObject> subscribeNotificationObjects;
}
@Data
public static class SubscribeNotificationObject {
@JSONField(name = "NotificationID")
private String NotificationID;
@JSONField(name = "SubscribeID")
private String SubscribeID;
@JSONField(name = "Title")
private String Title;
@JSONField(name = "TriggerTime")
private String TriggerTime;
@JSONField(name = "InfoIDs")
private String InfoIDs;
@JSONField(name = "MotorVehicleObjectList")
private MotorVehicleObj MotorVehicleObjectList;
}
}
package com.viontech.vo.traffic;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class FaceModel {
private String unid;
private String traffic_unid;
private String state;
private String sex;
private String upbody_color;
private String lobody_color;
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getTraffic_unid() {
return traffic_unid;
}
public void setTraffic_unid(String traffic_unid) {
this.traffic_unid = traffic_unid;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getUpbody_color() {
return upbody_color;
}
public void setUpbody_color(String upbody_color) {
this.upbody_color = upbody_color;
}
public String getLobody_color() {
return lobody_color;
}
public void setLobody_color(String lobody_color) {
this.lobody_color = lobody_color;
}
}
package com.viontech.vo.traffic;
public class TrafficBaseModel {
private String event_cate;
private String task_id;
private String task_type;
private String subtask_id;
private String source_type;
private String event_type;
private String dev_unid;
private String vchan_refid;
private String vdev_unid;
private String vchan_duid;
private String event_dt;
private String event_data;
private String device_name;
private String location_name;
private String device_code;
private String location_code;
public String getEvent_cate() {
return event_cate;
}
public void setEvent_cate(String event_cate) {
this.event_cate = event_cate;
}
public String getTask_id() {
return task_id;
}
public void setTask_id(String task_id) {
this.task_id = task_id;
}
public String getTask_type() {
return task_type;
}
public void setTask_type(String task_type) {
this.task_type = task_type;
}
public String getSubtask_id() {
return subtask_id;
}
public void setSubtask_id(String subtask_id) {
this.subtask_id = subtask_id;
}
public String getSource_type() {
return source_type;
}
public void setSource_type(String source_type) {
this.source_type = source_type;
}
public String getEvent_type() {
return event_type;
}
public void setEvent_type(String event_type) {
this.event_type = event_type;
}
public String getDev_unid() {
return dev_unid;
}
public void setDev_unid(String dev_unid) {
this.dev_unid = dev_unid;
}
public String getVchan_refid() {
return vchan_refid;
}
public void setVchan_refid(String vchan_refid) {
this.vchan_refid = vchan_refid;
}
public String getVdev_unid() {
return vdev_unid;
}
public void setVdev_unid(String vdev_unid) {
this.vdev_unid = vdev_unid;
}
public String getVchan_duid() {
return vchan_duid;
}
public void setVchan_duid(String vchan_duid) {
this.vchan_duid = vchan_duid;
}
public String getEvent_dt() {
return event_dt;
}
public void setEvent_dt(String event_dt) {
this.event_dt = event_dt;
}
public String getEvent_data() {
return event_data;
}
public void setEvent_data(String event_data) {
this.event_data = event_data;
}
public String getDevice_name() {
return device_name;
}
public void setDevice_name(String device_name) {
this.device_name = device_name;
}
public String getLocation_name() {
return location_name;
}
public void setLocation_name(String location_name) {
this.location_name = location_name;
}
public String getDevice_code() {
return device_code;
}
public void setDevice_code(String device_code) {
this.device_code = device_code;
}
public String getLocation_code() {
return location_code;
}
public void setLocation_code(String location_code) {
this.location_code = location_code;
}
}
package com.viontech.vo.traffic;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class TrafficModel extends TrafficBaseModel {
private String unid;
private String plate_color_code;
private String plate_text;
private String location_code;
private String lane_code;
private String direction_code;
private String body_type_code;
private String illegal_code;
private String[] illegal_codes;
private String illegal_state;
private String body_color_code;
private String body_logo_code;
private Boolean refinedFeature_rAnnualInspection;
private Boolean refinedFeature_rDecoration;
private Boolean refinedFeature_rPendant;
private Boolean refinedFeature_rSunshading;
private String event_dt__gte;
private String event_dt__lt;
private List location_codes;
private List body_type_codes;
private List task_ids;
// 行人事件
private String sex;
private String upbody_color;
private String lobody_color;
private List<FaceModel> faces;
// 非机动车事件 车辆类型,motorcycle, bicycle, tricycle共三种
private String xcycle_type;
private List event_types;
private List unids;
private String event_id;
private Integer offset;
private Integer limit;
private String shoot_dt;
private String special_type;
private String subtaskIds;
private Object json_data;
private String pic_name;
private String video_name;
private Integer with_hats;
private String shoot_dtime;
private Integer company;
public Integer getCompany() {
return company;
}
public TrafficModel setCompany(Integer company) {
this.company = company;
return this;
}
public String getPic_name() {
return pic_name;
}
public void setPic_name(String pic_name) {
this.pic_name = pic_name;
}
public String getVideo_name() {
return video_name;
}
public void setVideo_name(String video_name) {
this.video_name = video_name;
}
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
public String getPlate_color_code() {
return plate_color_code;
}
public void setPlate_color_code(String plate_color_code) {
this.plate_color_code = plate_color_code;
}
public String getPlate_text() {
return plate_text;
}
public void setPlate_text(String plate_text) {
this.plate_text = plate_text;
}
public String getLocation_code() {
return location_code;
}
public void setLocation_code(String location_code) {
this.location_code = location_code;
}
public String getLane_code() {
return lane_code;
}
public void setLane_code(String lane_code) {
this.lane_code = lane_code;
}
public String getDirection_code() {
return direction_code;
}
public void setDirection_code(String direction_code) {
this.direction_code = direction_code;
}
public String getBody_type_code() {
return body_type_code;
}
public void setBody_type_code(String body_type_code) {
this.body_type_code = body_type_code;
}
public String getIllegal_code() {
return illegal_code;
}
public void setIllegal_code(String illegal_code) {
this.illegal_code = illegal_code;
}
public String getIllegal_state() {
return illegal_state;
}
public void setIllegal_state(String illegal_state) {
this.illegal_state = illegal_state;
}
public String getBody_color_code() {
return body_color_code;
}
public void setBody_color_code(String body_color_code) {
this.body_color_code = body_color_code;
}
public String getBody_logo_code() {
return body_logo_code;
}
public void setBody_logo_code(String body_logo_code) {
this.body_logo_code = body_logo_code;
}
public Boolean getRefinedFeature_rAnnualInspection() {
return refinedFeature_rAnnualInspection;
}
public void setRefinedFeature_rAnnualInspection(Boolean refinedFeature_rAnnualInspection) {
this.refinedFeature_rAnnualInspection = refinedFeature_rAnnualInspection;
}
public Boolean getRefinedFeature_rDecoration() {
return refinedFeature_rDecoration;
}
public void setRefinedFeature_rDecoration(Boolean refinedFeature_rDecoration) {
this.refinedFeature_rDecoration = refinedFeature_rDecoration;
}
public Boolean getRefinedFeature_rPendant() {
return refinedFeature_rPendant;
}
public void setRefinedFeature_rPendant(Boolean refinedFeature_rPendant) {
this.refinedFeature_rPendant = refinedFeature_rPendant;
}
public Boolean getRefinedFeature_rSunshading() {
return refinedFeature_rSunshading;
}
public void setRefinedFeature_rSunshading(Boolean refinedFeature_rSunshading) {
this.refinedFeature_rSunshading = refinedFeature_rSunshading;
}
public String getEvent_dt__gte() {
return event_dt__gte;
}
public void setEvent_dt__gte(String event_dt__gte) {
this.event_dt__gte = event_dt__gte;
}
public String getEvent_dt__lt() {
return event_dt__lt;
}
public void setEvent_dt__lt(String event_dt__lt) {
this.event_dt__lt = event_dt__lt;
}
public List getLocation_codes() {
return location_codes;
}
public void setLocation_codes(List location_codes) {
this.location_codes = location_codes;
}
public List getBody_type_codes() {
return body_type_codes;
}
public void setBody_type_codes(List body_type_codes) {
this.body_type_codes = body_type_codes;
}
public List getTask_ids() {
return task_ids;
}
public void setTask_ids(List task_ids) {
this.task_ids = task_ids;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getUpbody_color() {
return upbody_color;
}
public void setUpbody_color(String upbody_color) {
this.upbody_color = upbody_color;
}
public String getLobody_color() {
return lobody_color;
}
public void setLobody_color(String lobody_color) {
this.lobody_color = lobody_color;
}
public List<FaceModel> getFaces() {
return faces;
}
public void setFaces(List<FaceModel> faces) {
this.faces = faces;
}
public String getXcycle_type() {
return xcycle_type;
}
public void setXcycle_type(String xcycle_type) {
this.xcycle_type = xcycle_type;
}
public List getEvent_types() {
return event_types;
}
public void setEvent_types(List event_types) {
this.event_types = event_types;
}
public List getUnids() {
return unids;
}
public void setUnids(List unids) {
this.unids = unids;
}
public String getEvent_id() {
return event_id;
}
public void setEvent_id(String event_id) {
this.event_id = event_id;
}
public Integer getOffset() {
return offset;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public String getShoot_dt() {
return shoot_dt;
}
public void setShoot_dt(String shoot_dt) {
this.shoot_dt = shoot_dt;
}
public String[] getIllegal_codes() {
return illegal_codes;
}
public void setIllegal_codes(String[] illegal_codes) {
this.illegal_codes = illegal_codes;
}
public String getSpecial_type() {
return special_type;
}
public void setSpecial_type(String special_type) {
this.special_type = special_type;
}
public String getSubtaskIds() {
return subtaskIds;
}
public void setSubtaskIds(String subtaskIds) {
this.subtaskIds = subtaskIds;
}
public Object getJson_data() {
return json_data;
}
public void setJson_data(Object json_data) {
this.json_data = json_data;
}
public Integer getWith_hats() {
return with_hats;
}
public void setWith_hats(Integer with_hats) {
this.with_hats = with_hats;
}
public String getShoot_dtime() {
return shoot_dtime;
}
public void setShoot_dtime(String shoot_dtime) {
this.shoot_dtime = shoot_dtime;
}
}
package com.viontech.vo.traffic;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import org.springframework.data.annotation.Id;
import java.util.List;
import java.util.Map;
@JsonInclude(value = Include.NON_NULL)
//@Document(collection = "tb_traffic")
public class TrafficMongoModel implements Comparable<TrafficMongoModel> {
@Id
private String id;
// @Indexed(direction = IndexDirection.DESCENDING)
private String task_type;
// @Indexed(direction = IndexDirection.DESCENDING)
private String task_id;
// @Indexed(direction = IndexDirection.DESCENDING)
private String event_type;
// @Indexed(direction = IndexDirection.DESCENDING)
private String event_refid;
// @Indexed(direction = IndexDirection.DESCENDING)
private String event_dt;
// @Indexed(direction = IndexDirection.DESCENDING)
private String dev_unid;
private Map aux_dev_info;
private Map event_data;
private List pics;
private String event_cate;
private String vdev_unid;
private String vchan_duid;
private String vchan_refid;
private List video;
private String test_pic_file;
private String test_frame_no;
private String subtask_id;
private String source_type;
/***
* 相识度
*/
private Double similarity;
private String pic_name;
private String video_name;
private String unid;
public String getPic_name() {
return pic_name;
}
public void setPic_name(String pic_name) {
this.pic_name = pic_name;
}
public String getVideo_name() {
return video_name;
}
public void setVideo_name(String video_name) {
this.video_name = video_name;
}
public String getTask_type() {
return task_type;
}
public void setTask_type(String task_type) {
this.task_type = task_type;
}
public String getTask_id() {
return task_id;
}
public void setTask_id(String task_id) {
this.task_id = task_id;
}
public String getEvent_type() {
return event_type;
}
public void setEvent_type(String event_type) {
this.event_type = event_type;
}
public String getEvent_refid() {
return event_refid;
}
public void setEvent_refid(String event_refid) {
this.event_refid = event_refid;
}
public String getEvent_dt() {
return event_dt;
}
public void setEvent_dt(String event_dt) {
this.event_dt = event_dt;
}
public String getDev_unid() {
return dev_unid;
}
public void setDev_unid(String dev_unid) {
this.dev_unid = dev_unid;
}
public Map getAux_dev_info() {
return aux_dev_info;
}
public void setAux_dev_info(Map aux_dev_info) {
this.aux_dev_info = aux_dev_info;
}
public Map getEvent_data() {
return event_data;
}
public void setEvent_data(Map event_data) {
this.event_data = event_data;
}
public List getPics() {
return pics;
}
public void setPics(List pics) {
this.pics = pics;
}
public String getEvent_cate() {
return event_cate;
}
public void setEvent_cate(String event_cate) {
this.event_cate = event_cate;
}
public String getVdev_unid() {
return vdev_unid;
}
public void setVdev_unid(String vdev_unid) {
this.vdev_unid = vdev_unid;
}
public String getVchan_duid() {
return vchan_duid;
}
public void setVchan_duid(String vchan_duid) {
this.vchan_duid = vchan_duid;
}
public String getVchan_refid() {
return vchan_refid;
}
public void setVchan_refid(String vchan_refid) {
this.vchan_refid = vchan_refid;
}
public List getVideo() {
return video;
}
public void setVideo(List video) {
this.video = video;
}
public String getTest_pic_file() {
return test_pic_file;
}
public void setTest_pic_file(String test_pic_file) {
this.test_pic_file = test_pic_file;
}
public String getTest_frame_no() {
return test_frame_no;
}
public void setTest_frame_no(String test_frame_no) {
this.test_frame_no = test_frame_no;
}
public String getSubtask_id() {
return subtask_id;
}
public void setSubtask_id(String subtask_id) {
this.subtask_id = subtask_id;
}
public String getSource_type() {
return source_type;
}
public void setSource_type(String source_type) {
this.source_type = source_type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Double getSimilarity() {
return similarity;
}
public void setSimilarity(Double similarity) {
this.similarity = similarity;
}
@Override
public int compareTo(TrafficMongoModel o) {
return -1 * this.getSimilarity().compareTo(o.getSimilarity());
}
public String getUnid() {
return unid;
}
public void setUnid(String unid) {
this.unid = unid;
}
@Override
public String toString() {
return "TrafficMongoModel{" +
"id='" + id + '\'' +
", task_type='" + task_type + '\'' +
", task_id='" + task_id + '\'' +
", event_type='" + event_type + '\'' +
", event_refid='" + event_refid + '\'' +
", event_dt='" + event_dt + '\'' +
", dev_unid='" + dev_unid + '\'' +
", aux_dev_info=" + aux_dev_info +
", event_data=" + event_data +
", pics=" + pics +
", event_cate='" + event_cate + '\'' +
", vdev_unid='" + vdev_unid + '\'' +
", vchan_duid='" + vchan_duid + '\'' +
", vchan_refid='" + vchan_refid + '\'' +
", video=" + video +
", test_pic_file='" + test_pic_file + '\'' +
", test_frame_no='" + test_frame_no + '\'' +
", subtask_id='" + subtask_id + '\'' +
", source_type='" + source_type + '\'' +
", similarity=" + similarity +
'}';
}
}
server.port=30101
spring.application.name=fanxing-docking-gb1400
### 繁星postgresDB
########################################################
spring.datasource.url=jdbc:postgresql://192.168.1.64:5432/traffic
spring.datasource.username=postgres
spring.datasource.password=VIONauthpass
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.druid.max-active=20
spring.datasource.druid.max-idle=8
spring.datasource.druid.min-idle=8
spring.datasource.druid.initial-size=10
spring.datasource.druid.max-wait=60000
mybatis.mapper-locations=classpath:com/viontech/mapping/*.xml
#redis
spring.redis.host=192.168.1.16
spring.redis.port=7379
spring.redis.password=vionredis
spring.redis.timeout=5000
spring.redis.jedis.pool.max-active=100
spring.redis.jedis.pool.max-idle=20
spring.redis.jedis.pool.min-idle=1
#获取图片地址的url
fanxing.getPicInfo.url=http://192.168.1.64:20080/api/v1/web/pics/
#gb1400配置
gb1400.enable=0
gb1400.gongan.orgcode=321283170000
gb1400.username=huawei
gb1400.password=huawei123
gb1400.userIdentify=32128317051310778562
gb1400.ipPort=32.165.198.11:8120
\ No newline at end of file
02=M20
B10=B10
B11=B11
B12=B12
B13=B13
B14=B14
B15=B15
B16=B16
B17=B17
B18=B18
B19=B19
B1A=B1A
B1B=B1B
B20=B20
B21=B21
B22=B22
B23=B23
B24=B24
B25=B25
B26=B26
B27=B27
B28=B28
B29=B29
B2A=B2A
B2B=B2B
B30=B30
B31=B31
B32=B32
B33=B33
B34=B34
B35=B35
B36=B36
B37=B37
B38=B38
B39=B39
D11=D11
D12=D12
G10=G10
G11=G11
G12=G12
G13=G13
G14=G14
G15=G15
G16=G16
G17=G17
G18=G18
G19=G19
G20=G20
G21=G21
G22=G22
G23=G23
G24=G24
G25=G25
G26=G26
G27=G27
G28=G28
G29=G29
G30=G30
G31=G31
G32=G32
G33=G33
G34=G34
G35=G35
G36=G36
G37=G37
G38=G38
H10=H10
H11=H11
H12=H12
H13=H13
H14=H14
H15=H15
H16=H16
H17=H17
H18=H18
H19=H19
H20=H20
H21=H21
H22=H22
H23=H23
H24=H24
H25=H25
H26=H26
H27=H27
H28=H28
H29=H29
H30=H30
H31=H31
H32=H32
H33=H33
H34=H34
H35=H35
H37=H37
H38=H38
H39=H39
H40=H40
H41=H41
H42=H42
H43=H43
H44=H44
H45=H45
H46=H46
H47=H47
H50=H50
H51=H51
H52=H52
H53=H53
H54=H54
H55=H55
J11=J11
J12=J12
J13=J13
K10=K10
K11=K11
K12=K12
K13=K13
K14=K14
K15=K15
K16=K16
K17=K17
K20=K20
K21=K21
K22=K22
K23=K23
K24=K24
K25=K25
K27=K27
K30=K30
K31=K31
K32=K32
K33=K33
K34=K34
K40=K40
K41=K41
K42=K42
K43=K43
M10=M10
M11=M11
M12=M12
M13=M13
M14=M14
M15=M15
M20=M20
M21=M21
M22=M22
N11=N11
Q10=Q10
Q11=Q11
Q12=Q12
Q20=Q20
Q21=Q21
Q22=Q22
Q30=Q30
Q31=Q31
Q32=Q32
T11=T11
T20=T20
T21=T21
T22=T22
T23=T23
X99=X99
Z11=Z11
Z21=Z21
Z31=Z31
Z41=Z41
Z51=Z51
Z71=Z71
\ No newline at end of file
0=0
1=1
2=13
3=6
4=4
5=38
6=30
7=2
8=8
9=12
10=9
11=14
12=40
13=15
14=7
15=11
16=26
17=34
18=19
19=27
20=25
21=10
22=18
23=42
24=17
25=3
26=41
27=5
28=29
29=35
30=45
31=31
32=28
33=20
34=52
35=16
36=21
37=24
38=32
39=37
40=70
41=39
42=22
43=0
44=68
45=62
46=108
47=95
48=96
49=67
50=51
51=122
52=47
53=66
54=53
55=69
56=124
57=90
58=121
59=107
60=87
61=44
62=109
63=92
64=49
65=110
66=104
67=23
68=33
69=0
70=0
71=0
72=0
73=0
74=0
75=0
76=0
77=128
78=0
79=0
80=65
81=25
82=43
83=71
84=191
85=230
88=58
89=36
110=0
111=81
112=0
113=155
90=0
91=56
92=0
93=0
94=0
95=0
96=0
97=0
98=0
99=0
100=0
101=0
102=0
103=0
104=0
105=57
106=86
107=0
108=0
109=0
86=0
87=0
114=0
115=112
116=0
117=0
118=0
119=0
120=117
121=0
122=0
123=0
124=103
125=0
126=0
127=0
128=0
129=0
130=0
131=0
132=83
133=0
134=0
135=0
136=0
137=0
\ No newline at end of file
A=2
B=3
C=6
D=12
E=4
F=10
G=9
H=5
I=8
J=1
K=99
Z=99
\ No newline at end of file
0=99
1=6
2=5
3=1
5=2
6=9
7=9
9=99
\ No newline at end of file
00=99
01=01
02=02
03=03
04=04
05=05
06=06
07=07
08=08
09=09
10=10
11=11
12=12
13=13
14=14
15=15
16=16
17=17
18=99
19=99
20=20
21=21
22=22
23=23
24=24
25=25
31=99
32=99
99=99
\ No newline at end of file
59=59
47=47
60=60
17=17
01=01
40=40
55=55
58=58
20=20
65=65
66=66
67=67
69=69
46=46
12=12
05=1345
53=53
25=1345
68=1345
45=45
56=56
29=29
10=1625
02=02
21=21
24=24
09=1625
31=31
54=54
26=26
13=6095
11=6095
28=28
18=18
03=03
06=1117
61=61
52=52
15=15
64=64
49=49
19=19
41=41
42=1625
43=1625
44=1625
38=1223
36=1240
27=27
57=57
51=51
33=33
14=6095
16=16
04=10396
23=23
37=37
07=07
48=48
50=50
22=22
30=10396
62=62
63=63
70=1719
71=71
72=72
73=73
74=74
75=75
76=76
77=1119
78=78
08=1625
79=79
83=70112
82=82
80=80
81=81
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="logs" />
<property name="pattern" value="[%d{yyyy-MM-dd HH:mm:ss.SSS,GMT+8}] [%-5level] [%thread] %logger{50} - %msg%n" />
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<encoder>
<Pattern>${pattern}</Pattern>
<!-- 设置字符集 -->
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_debug.log</file>
<!--日志文件输出格式-->
<encoder>
<Pattern>${pattern}</Pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_info.log</file>
<!--日志文件输出格式-->
<encoder>
<Pattern>${pattern}</Pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 记录XML数据 -->
<appender name="XML_DATA_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/send_jgj_kafka.log</file>
<!--日志文件输出格式-->
<encoder>
<Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] - %msg%n</Pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/send_jgj_kafka/data-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 记录繁星错误数据 -->
<appender name="FANXING_ERROR_DATA_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/fanxing_error.log</file>
<!--日志文件输出格式-->
<encoder>
<Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] - %msg%n</Pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/fanxing_error/data-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_warn.log</file>
<!--日志文件输出格式-->
<encoder>
<Pattern>${pattern}</Pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_error.log</file>
<!--日志文件输出格式-->
<encoder>
<Pattern>${pattern}</Pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<logger name="XML_DATA_LOGGER">
<appender-ref ref="XML_DATA_APPENDER" />
</logger>
<logger name="FANXING_ERROR_DATA_LOGGER">
<appender-ref ref="FANXING_ERROR_DATA_APPENDER" />
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
</configuration>
\ No newline at end of file
package com.viontech;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class FanxingDockingGb1400ApplicationTests {
@Test
void contextLoads() {
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!