master
commit
30269c7a3b
|
@ -0,0 +1,195 @@
|
||||||
|
<?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.5.5</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>com.jepsoninfo</groupId>
|
||||||
|
<artifactId>transferService</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<name>transferService</name>
|
||||||
|
<description>transferService</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-starter-aop</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>1.3.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.tomcat</groupId>
|
||||||
|
<artifactId>tomcat-jdbc</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
|
<version>3.2.8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.11.28.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>1.2.76</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-fileupload</groupId>
|
||||||
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
<version>1.3.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
|
<version>1.4.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.10.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.xerial</groupId>
|
||||||
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
|
<version>3.34.0</version> <!-- Use the latest version -->
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-dependencies</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/lib/</outputDirectory>
|
||||||
|
<includeScope>compile</includeScope>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<includes>
|
||||||
|
<include>
|
||||||
|
<groupId>nothing</groupId>
|
||||||
|
<artifactId>nothing</artifactId>
|
||||||
|
</include>
|
||||||
|
</includes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<!-- https://gitee.com/roseboy/classfinal -->
|
||||||
|
<groupId>net.roseboy</groupId>
|
||||||
|
<artifactId>classfinal-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<configuration>
|
||||||
|
<password>#</password><!--加密打包之后pom.xml会被删除,不用担心在jar包里找到此密码-->
|
||||||
|
<packages>com.jepsoninfo</packages>
|
||||||
|
<!-- <cfgfiles>*.properties</cfgfiles>-->
|
||||||
|
<excludes>org.spring</excludes>
|
||||||
|
<!-- <code>CA5800E403C341E1D2738A951EF553B6D41D8CD98F00B204E9800998ECF8427ED41D8CD98F00B204E9800998ECF8427E</code>-->
|
||||||
|
<!-- <libjars>a.jar,b.jar</libjars>-->
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>classFinal</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.jepsoninfo;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
||||||
|
@EnableAsync
|
||||||
|
@EnableAspectJAutoProxy
|
||||||
|
@MapperScan("com.jepsoninfo.dao")
|
||||||
|
@ComponentScan("com.jepsoninfo.*")
|
||||||
|
@SpringBootApplication
|
||||||
|
public class TransferServiceApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(TransferServiceApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.jepsoninfo.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||||
|
import org.springframework.web.filter.CorsFilter;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
//@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
|
public class CorsConfig {
|
||||||
|
private CorsConfiguration buildConfig() {
|
||||||
|
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||||
|
corsConfiguration.addAllowedOrigin("*");
|
||||||
|
corsConfiguration.addAllowedHeader("*");
|
||||||
|
corsConfiguration.addAllowedMethod("*");
|
||||||
|
// corsConfiguration.setAllowCredentials(true);
|
||||||
|
return corsConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public CorsFilter corsFilter() {
|
||||||
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||||
|
source.registerCorsConfiguration("/**", buildConfig());
|
||||||
|
return new CorsFilter(source);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.jepsoninfo.config;
|
||||||
|
|
||||||
|
import com.jepsoninfo.dao.CommonConfigDao;
|
||||||
|
import com.jepsoninfo.entity.CommonConfig;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import com.jepsoninfo.util.StringToChineseUtil;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class InitCommonConfig {
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("initConfig.class");
|
||||||
|
@Resource
|
||||||
|
private CommonConfigDao commonConfigDao;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public void initCommon(){
|
||||||
|
CommonConfig config;
|
||||||
|
|
||||||
|
logger.info("config init");
|
||||||
|
|
||||||
|
//cmd
|
||||||
|
config = commonConfigDao.selectByName("cmd_path");
|
||||||
|
ConstUtil.CMD_PATH = config.getCnValue();
|
||||||
|
|
||||||
|
//oss
|
||||||
|
config = commonConfigDao.selectByName("oss_bucket");
|
||||||
|
ConstUtil.OSS_BUCKET = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("oss_secret_id");
|
||||||
|
ConstUtil.OSS_SECRET_ID = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("oss_secret_key");
|
||||||
|
ConstUtil.OSS_SECRET_KEY = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("oss_endpoint");
|
||||||
|
ConstUtil.OSS_ENDPOINT = config.getCnValue();
|
||||||
|
|
||||||
|
//local path
|
||||||
|
config = commonConfigDao.selectByName("local_path");
|
||||||
|
ConstUtil.LOCAL_PATH = config.getCnValue();
|
||||||
|
|
||||||
|
//report url
|
||||||
|
config = commonConfigDao.selectByName("report_server");
|
||||||
|
ConstUtil.REPORT_SERVER = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("report_server_url");
|
||||||
|
ConstUtil.REPORT_SERVER_URL = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("report_pass_server_url");
|
||||||
|
ConstUtil.REPORT_PASS_SERVER_URL = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("dcs_callback_url");
|
||||||
|
ConstUtil.DCS_CALLBACK = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("company_no");
|
||||||
|
ConstUtil.COMPANY_NO = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("company_name");
|
||||||
|
ConstUtil.COMPANY_NAME = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("default_advert_1");
|
||||||
|
ConstUtil.DEFAULT_ADVERT_1 = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("default_advert_2");
|
||||||
|
ConstUtil.DEFAULT_ADVERT_2 = config.getCnValue();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.jepsoninfo.config;
|
||||||
|
|
||||||
|
import com.jepsoninfo.service.ThreadLogReport;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class InitLogThread {
|
||||||
|
@Bean
|
||||||
|
public void initLog(){
|
||||||
|
// ThreadLogReport thread = new ThreadLogReport();
|
||||||
|
// thread.start();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.jepsoninfo.config;
|
||||||
|
|
||||||
|
import com.jepsoninfo.dao.IntegratedMachineConfigDao;
|
||||||
|
import com.jepsoninfo.entity.IntegratedMachineConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.IntegratedMachineConfigEx;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class IntegratedConfig {
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("IntegratedConfig.class");
|
||||||
|
@Resource
|
||||||
|
private IntegratedMachineConfigDao integratedMachineConfigDao;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public void initIntegrated(){
|
||||||
|
logger.info("config init");
|
||||||
|
IntegratedMachineConfig cond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
List<IntegratedMachineConfigEx> list = integratedMachineConfigDao.selectListByCond(cond);
|
||||||
|
|
||||||
|
for (int i = 0;i < list.size();i++){
|
||||||
|
IntegratedMachineConfigEx item = list.get(i);
|
||||||
|
|
||||||
|
ConstUtil.DOOR_STATUS.put(item.getDevNo(),0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.jepsoninfo.config;
|
||||||
|
|
||||||
|
import com.jepsoninfo.dao.CommonConfigDao;
|
||||||
|
import com.jepsoninfo.entity.CommonConfig;
|
||||||
|
import com.jepsoninfo.service.HardService;
|
||||||
|
import com.jepsoninfo.service.ThreadDeviceCmdMqtt;
|
||||||
|
import com.jepsoninfo.service.ThreadRecvCmdMqtt;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MqttConfig {
|
||||||
|
@Resource
|
||||||
|
private HardService hardService;
|
||||||
|
@Resource
|
||||||
|
private CommonConfigDao commonConfigDao;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public void initMqtt(){
|
||||||
|
CommonConfig config;
|
||||||
|
|
||||||
|
//get config info
|
||||||
|
config = commonConfigDao.selectByName("mqtt_broker");
|
||||||
|
ConstUtil.MQTT_BROKER = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("mqtt_topic_prefix");
|
||||||
|
ConstUtil.MQTT_TOPIC = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("mqtt_user_name");
|
||||||
|
ConstUtil.MQTT_USER_NAME = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("mqtt_password");
|
||||||
|
ConstUtil.MQTT_PASSWORD = config.getCnValue();
|
||||||
|
|
||||||
|
config = commonConfigDao.selectByName("mqtt_clientid");
|
||||||
|
ConstUtil.MQTT_CLIENTID = config.getCnValue();
|
||||||
|
|
||||||
|
// config = commonConfigDao.selectByName("mqtt_device_broker");
|
||||||
|
// ConstUtil.MQTT_DEVICE_BROKER = config.getCnValue();
|
||||||
|
//
|
||||||
|
// config = commonConfigDao.selectByName("mqtt_device_topic_prefix");
|
||||||
|
// ConstUtil.MQTT_DEVICE_TOPIC = config.getCnValue();
|
||||||
|
//
|
||||||
|
// config = commonConfigDao.selectByName("mqtt_device_user_name");
|
||||||
|
// ConstUtil.MQTT_DEVICE_USER_NAME = config.getCnValue();
|
||||||
|
//
|
||||||
|
// config = commonConfigDao.selectByName("mqtt_device_password");
|
||||||
|
// ConstUtil.MQTT_DEVICE_PASSWORD = config.getCnValue();
|
||||||
|
//
|
||||||
|
// config = commonConfigDao.selectByName("mqtt_device_clientid");
|
||||||
|
// ConstUtil.MQTT_DEVICE_CLIENTID = config.getCnValue();
|
||||||
|
//
|
||||||
|
// config = commonConfigDao.selectByName("mqtt_device_type");
|
||||||
|
// ConstUtil.MQTT_DEVICE_TYPE = config.getCnValue();
|
||||||
|
|
||||||
|
ThreadRecvCmdMqtt thread = new ThreadRecvCmdMqtt(hardService);
|
||||||
|
thread.start();
|
||||||
|
|
||||||
|
// ThreadDeviceCmdMqtt devThread = new ThreadDeviceCmdMqtt(hardService);
|
||||||
|
// devThread.start();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.jepsoninfo.config;
|
||||||
|
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ranmc
|
||||||
|
* @date 2019/5/13
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class WebConfig extends WebMvcConfigurerAdapter {
|
||||||
|
/**
|
||||||
|
* 静态资源映射
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
registry.addResourceHandler("/file/**").addResourceLocations(ConstUtil.HANDLER_URL + ConstUtil.LOCAL_PATH).setCachePeriod(1);
|
||||||
|
super.addResourceHandlers(registry);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,197 @@
|
||||||
|
package com.jepsoninfo.controller;
|
||||||
|
|
||||||
|
import com.jepsoninfo.req.*;
|
||||||
|
import com.jepsoninfo.service.HardService;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import com.jepsoninfo.util.ReturnCode;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class HardController {
|
||||||
|
@Autowired
|
||||||
|
private HardService hardService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/plateRecognize")
|
||||||
|
public ReturnCode plateRecognize(@RequestBody RecognizeAlarmInfoPlate req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
try {
|
||||||
|
req.getAlarmInfoPlate().getResult().getPlateResult().setTelephone("");
|
||||||
|
hardService.plateRecognize(req);
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/manualPlateRecognize")
|
||||||
|
public ReturnCode manualPlateRecognize(@RequestBody ManualPlateRecognizeReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
RecognizeAlarmInfoPlate recognizeAlarmInfoPlate = new RecognizeAlarmInfoPlate();
|
||||||
|
ClassAlarmInfoPlate alarmInfoPlate = new ClassAlarmInfoPlate();
|
||||||
|
AlarmInfoPlateResult result = new AlarmInfoPlateResult();
|
||||||
|
alarmInfoPlate.setResult(result);
|
||||||
|
AlarmInfoPlateResultPlateResult PlateResult = new AlarmInfoPlateResultPlateResult();
|
||||||
|
PlateResult.setTelephone(req.getTelephone());
|
||||||
|
result.setPlateResult(PlateResult);
|
||||||
|
|
||||||
|
alarmInfoPlate.setSerialno(req.getDeviceNo());
|
||||||
|
recognizeAlarmInfoPlate.setAlarmInfoPlate(alarmInfoPlate);
|
||||||
|
try {
|
||||||
|
int nRet = hardService.manualPlateRecognize(recognizeAlarmInfoPlate,req.getOrder_no());
|
||||||
|
|
||||||
|
if(nRet == 1) {
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}else{
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/openDoor")
|
||||||
|
public ReturnCode openDoor(@RequestBody DoorReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
int nRet = hardService.openDoor(req);
|
||||||
|
|
||||||
|
if(nRet == 1) {
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}else{
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/playVoice")
|
||||||
|
public ReturnCode playVoice(@RequestBody PlayVoiceReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
int nRet = hardService.playVoice(req);
|
||||||
|
|
||||||
|
if(nRet == 1) {
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}else{
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/displayInfo")
|
||||||
|
public ReturnCode displayInfo(@RequestBody DisplayInfoReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
int nRet = hardService.displayInfo(req);
|
||||||
|
|
||||||
|
if(nRet == 1) {
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}else{
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/resetDevTime")
|
||||||
|
public ReturnCode resetDevTime(@RequestBody TimeReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
hardService.resetDevTime(req);
|
||||||
|
|
||||||
|
//status.setData(ret);
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/manualTrigger")
|
||||||
|
public ReturnCode manualTrigger(@RequestBody DoorReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
int nRet = hardService.manualTrigger(req);
|
||||||
|
|
||||||
|
if(nRet == 1) {
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}else{
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/getDoorStatus")
|
||||||
|
public ReturnCode getDoorStatus(@RequestBody DoorReq req) {
|
||||||
|
ReturnCode status = new ReturnCode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
int nRet = hardService.getDoorStatus(req.getDeviceNo(),req.getCarNo());
|
||||||
|
|
||||||
|
if(nRet == 1) {
|
||||||
|
status.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}else{
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
status.setCode(ConstUtil.CODE_FAILURE[0]);
|
||||||
|
status.setMsg(ConstUtil.CODE_FAILURE[1]);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.CommonConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.CommonConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (CommonConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:49:29
|
||||||
|
*/
|
||||||
|
public interface CommonConfigDao {
|
||||||
|
|
||||||
|
CommonConfigEx selectByPrimaryKey(Long id);
|
||||||
|
|
||||||
|
int insert(CommonConfig commonConfig);
|
||||||
|
|
||||||
|
int insertSelective(CommonConfig commonConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(CommonConfig commonConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(CommonConfig commonConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Long id);
|
||||||
|
|
||||||
|
CommonConfigEx selectByName(@Param("cnName") String name);
|
||||||
|
|
||||||
|
CommonConfigEx selectByCond(@Param("cond") CommonConfig commonConfig);
|
||||||
|
|
||||||
|
List<CommonConfigEx> selectListByCond(@Param("cond") CommonConfig commonConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(CommonConfig commonConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.DisplayConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.DisplayConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (DisplayConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2025-01-10 17:23:18
|
||||||
|
*/
|
||||||
|
public interface DisplayConfigDao {
|
||||||
|
|
||||||
|
DisplayConfigEx selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(DisplayConfig displayConfig);
|
||||||
|
|
||||||
|
int insertSelective(DisplayConfig displayConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(DisplayConfig displayConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(DisplayConfig displayConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
DisplayConfigEx selectByCond(@Param("cond") DisplayConfig displayConfig);
|
||||||
|
|
||||||
|
List<DisplayConfigEx> selectListByCond(@Param("cond") DisplayConfig displayConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(DisplayConfig displayConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.HkCameraConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.HkCameraConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (HkCameraConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:49:42
|
||||||
|
*/
|
||||||
|
public interface HkCameraConfigDao {
|
||||||
|
|
||||||
|
HkCameraConfigEx selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(HkCameraConfigEx hkCameraConfig);
|
||||||
|
|
||||||
|
int insertSelective(HkCameraConfig hkCameraConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(HkCameraConfig hkCameraConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(HkCameraConfig hkCameraConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
HkCameraConfigEx selectByCond(@Param("cond") HkCameraConfig hkCameraConfig);
|
||||||
|
|
||||||
|
List<HkCameraConfigEx> selectListByCond(@Param("cond") HkCameraConfigEx hkCameraConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(HkCameraConfig hkCameraConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.IntegratedMachineConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.IntegratedMachineConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (IntegratedMachineConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:50:25
|
||||||
|
*/
|
||||||
|
public interface IntegratedMachineConfigDao {
|
||||||
|
|
||||||
|
IntegratedMachineConfigEx selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
|
||||||
|
int insertSelective(IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
IntegratedMachineConfigEx selectByCond(@Param("cond") IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
|
||||||
|
List<IntegratedMachineConfigEx> selectListByCond(@Param("cond") IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(IntegratedMachineConfig integratedMachineConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.IpVoiceboxConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.IpVoiceboxConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (IpVoiceboxConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:58:57
|
||||||
|
*/
|
||||||
|
public interface IpVoiceboxConfigDao {
|
||||||
|
|
||||||
|
IpVoiceboxConfigEx selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
|
||||||
|
int insertSelective(IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
IpVoiceboxConfigEx selectByCond(@Param("cond") IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
|
||||||
|
List<IpVoiceboxConfigEx> selectListByCond(@Param("cond") IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(IpVoiceboxConfig ipVoiceboxConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.MessageConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.MessageConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (MessageConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:59:14
|
||||||
|
*/
|
||||||
|
public interface MessageConfigDao {
|
||||||
|
|
||||||
|
MessageConfigEx selectByPrimaryKey(Long id);
|
||||||
|
|
||||||
|
int insert(MessageConfig messageConfig);
|
||||||
|
|
||||||
|
int insertSelective(MessageConfig messageConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(MessageConfig messageConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(MessageConfig messageConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Long id);
|
||||||
|
|
||||||
|
MessageConfigEx selectByCond(@Param("cond") MessageConfig messageConfig);
|
||||||
|
|
||||||
|
List<MessageConfigEx> selectListByCond(@Param("cond") MessageConfig messageConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(MessageConfig messageConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.dao;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.WagonBalanceConfig;
|
||||||
|
import com.jepsoninfo.entity.ex.WagonBalanceConfigEx;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (WagonBalanceConfig)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:59:27
|
||||||
|
*/
|
||||||
|
public interface WagonBalanceConfigDao {
|
||||||
|
|
||||||
|
WagonBalanceConfigEx selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
|
||||||
|
int insertSelective(WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
WagonBalanceConfigEx selectByCond(@Param("cond") WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
|
||||||
|
List<WagonBalanceConfigEx> selectListByCond(@Param("cond") WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
|
||||||
|
long selectCountByCond(WagonBalanceConfig wagonBalanceConfig);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (CommonConfig)实体类
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-11-06 14:14:34
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CommonConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = -31233206401398073L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String cnName;
|
||||||
|
|
||||||
|
private String cnValue;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (DisplayConfig)实体类
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2025-01-10 21:40:02
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DisplayConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 266099597204852678L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String laneName;
|
||||||
|
|
||||||
|
private String devNo;
|
||||||
|
|
||||||
|
private String ipAddr;
|
||||||
|
|
||||||
|
private Integer tcpPort;
|
||||||
|
|
||||||
|
private Integer rs485Port;
|
||||||
|
|
||||||
|
private Integer httpPort;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String passwd;
|
||||||
|
|
||||||
|
private String verNo;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (HkCameraConfig)实体类
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2025-01-02 14:39:03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class HkCameraConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = -74194322042160181L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String laneName;
|
||||||
|
|
||||||
|
private String ipAddr;
|
||||||
|
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
private String verNo;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (IntegratedMachineConfig)实体类
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2025-01-10 21:42:06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IntegratedMachineConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = -73818135359726256L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer laneNo;
|
||||||
|
|
||||||
|
private String laneName;
|
||||||
|
|
||||||
|
private String devNo;
|
||||||
|
|
||||||
|
private String ipAddr;
|
||||||
|
|
||||||
|
private Integer httpPort;
|
||||||
|
|
||||||
|
private Integer tcpPort;
|
||||||
|
|
||||||
|
private Integer rs485Port;
|
||||||
|
|
||||||
|
private Integer ioPort;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String passwd;
|
||||||
|
|
||||||
|
private Integer hkCameraId;
|
||||||
|
|
||||||
|
private Integer ipVoiceId;
|
||||||
|
|
||||||
|
private Integer wagonBalanceId;
|
||||||
|
|
||||||
|
private Integer isFront;
|
||||||
|
|
||||||
|
private Integer isDoorStatus;
|
||||||
|
|
||||||
|
private Integer nType;
|
||||||
|
|
||||||
|
private String verNo;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (IpVoiceboxConfig)实体类
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2025-01-14 15:49:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class IpVoiceboxConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = -46484269523542696L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String laneName;
|
||||||
|
|
||||||
|
private String devNo;
|
||||||
|
|
||||||
|
private String ipAddr;
|
||||||
|
|
||||||
|
private Integer tcpPort;
|
||||||
|
|
||||||
|
private Integer rs485Port;
|
||||||
|
|
||||||
|
private Integer httpPort;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String passwd;
|
||||||
|
|
||||||
|
private Integer maxVol;
|
||||||
|
|
||||||
|
private String verNo;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LogEntity {
|
||||||
|
public String carNo;
|
||||||
|
public String devNo;
|
||||||
|
public String laneName;
|
||||||
|
public String optName;
|
||||||
|
public Object content;
|
||||||
|
public Long logTime;
|
||||||
|
public String companyNo;
|
||||||
|
public String companyName;
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (MessageConfig)实体类
|
||||||
|
*
|
||||||
|
* @author w
|
||||||
|
* @since 2024-05-23 10:59:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MessageConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 122085442620701088L;
|
||||||
|
/**
|
||||||
|
* 自增id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String cnName;
|
||||||
|
/**
|
||||||
|
* 内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private String updateTime;
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.jepsoninfo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (WagonBalanceConfig)实体类
|
||||||
|
*
|
||||||
|
* @author makejava
|
||||||
|
* @since 2024-12-12 14:30:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WagonBalanceConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = -33910556689025663L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String portName;
|
||||||
|
|
||||||
|
private Integer baudRate;
|
||||||
|
|
||||||
|
private Integer dataBits;
|
||||||
|
|
||||||
|
private Integer parity;
|
||||||
|
|
||||||
|
private Integer stopBits;
|
||||||
|
|
||||||
|
private String laneName;
|
||||||
|
|
||||||
|
private String verNo;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String updateTime;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.CommonConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommonConfigEx extends CommonConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startUpdateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endUpdateTime;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.DisplayConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DisplayConfigEx extends DisplayConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.HkCameraConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HkCameraConfigEx extends HkCameraConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.IntegratedMachineConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IntegratedMachineConfigEx extends IntegratedMachineConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.IpVoiceboxConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IpVoiceboxConfigEx extends IpVoiceboxConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.MessageConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MessageConfigEx extends MessageConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startUpdateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endUpdateTime;
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.jepsoninfo.entity.ex;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.WagonBalanceConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WagonBalanceConfigEx extends WagonBalanceConfig {
|
||||||
|
private int pageNo = 1;
|
||||||
|
private int pageSize = 10;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endCreateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date startUpdateTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date endUpdateTime;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AlarmInfoPlateResult {
|
||||||
|
@JsonProperty("PlateResult")
|
||||||
|
private AlarmInfoPlateResultPlateResult PlateResult;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AlarmInfoPlateResultPlateResult {
|
||||||
|
private String telephone; //手机号
|
||||||
|
private String license; //车牌号
|
||||||
|
private String imagePath; //图片路径
|
||||||
|
private String imageFile; //图片数据
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ClassAlarmInfoPlate {
|
||||||
|
private int channel; //通道号
|
||||||
|
private String deviceName; //设备名
|
||||||
|
private String serialno; //设备编号
|
||||||
|
private String ipaddr; //设备IP
|
||||||
|
private AlarmInfoPlateResult result;
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.HkCameraConfig;
|
||||||
|
import com.jepsoninfo.entity.IntegratedMachineConfig;
|
||||||
|
import com.jepsoninfo.entity.IpVoiceboxConfig;
|
||||||
|
import com.jepsoninfo.entity.WagonBalanceConfig;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceInfoReq {
|
||||||
|
private HkCameraConfig camera;
|
||||||
|
private WagonBalanceConfig wagonBalance;
|
||||||
|
private IpVoiceboxConfig ipVoicebox;
|
||||||
|
private IntegratedMachineConfig integratedMachine;
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DisplayInfoReq {
|
||||||
|
private String uuid;
|
||||||
|
private String deviceNo; //设备编号
|
||||||
|
private String carPlate; //车牌号
|
||||||
|
private String info;
|
||||||
|
private String amount; //金额
|
||||||
|
private String weight; //磅重信息
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DoorReq {
|
||||||
|
private String uuid;
|
||||||
|
private int id; //自增id
|
||||||
|
private String deviceNo; //设备编号
|
||||||
|
private String carNo; //车牌号
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IpVoiceBoxParam {
|
||||||
|
String text;//"这⾥是要播放的⽂字",
|
||||||
|
String vcn = "xiaoyan";
|
||||||
|
int speed = 50;
|
||||||
|
int volume= 100;
|
||||||
|
String rdn = "0";
|
||||||
|
String rcn= "0";
|
||||||
|
int reg = 0;
|
||||||
|
boolean sync = false;
|
||||||
|
boolean queue = false;
|
||||||
|
IpVoiceBoxParamLoop loop;
|
||||||
|
boolean prompt = false;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IpVoiceBoxParamLoop {
|
||||||
|
// 循环(重复)播放时⻓(秒)
|
||||||
|
private Integer duration;//duration = 600;
|
||||||
|
private Integer times = 2;// 循环(重复)播放次数(次)
|
||||||
|
private Integer gap = 2;// 循环(重复)播放中的间歇时间(秒)
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ManualPlateRecognizeReq {
|
||||||
|
private String deviceNo; //设备编号
|
||||||
|
private String telephone; //手机号
|
||||||
|
private String order_no;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PlayVoiceReq {
|
||||||
|
private String uuid;
|
||||||
|
private String text; //播放的文本内容
|
||||||
|
private String deviceNo; //设备编号
|
||||||
|
private String carNo;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RecognizeAlarmInfoPlate {
|
||||||
|
@JsonProperty("AlarmInfoPlate")
|
||||||
|
private ClassAlarmInfoPlate alarmInfoPlate;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RecognizePlateResultAckQy {
|
||||||
|
private String cmd;
|
||||||
|
private String status;
|
||||||
|
private String msg_id;
|
||||||
|
private Integer ionum;
|
||||||
|
private String action;
|
||||||
|
private Integer utc_ts;
|
||||||
|
private ShowDataInfoQy showDataInfo;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RecognizePlateResultQy {
|
||||||
|
private String cmd;//": "result",
|
||||||
|
private String msg_id;//": "1646717165576ESXhd2F",
|
||||||
|
private String type;//": "online",
|
||||||
|
private String plate_num;//": "粤BD12345",
|
||||||
|
private String plate_encryption_state;//":0,
|
||||||
|
private String plate_color;//": "绿色",
|
||||||
|
private String plate_val;//": true,
|
||||||
|
private String confidence;//": 24,
|
||||||
|
private String car_logo;//": "未知车标",
|
||||||
|
private String car_color;//": "未知色",
|
||||||
|
private String vehicle_type;//": "小型车",
|
||||||
|
private String utc_ts;//": 1646717165,
|
||||||
|
private String local_time;//": "2022/03/08 13:26:05",
|
||||||
|
private String inout;//": "in",
|
||||||
|
private String trigger_type;//": "video",
|
||||||
|
private String plate_number;//": 6,
|
||||||
|
private String full_pic;//": 全景图base64编码后数据
|
||||||
|
private String full_pic_len;//": 27230,
|
||||||
|
private String plate_pic;//":车牌图base64编码后数据
|
||||||
|
private String plate_pic_len;//": 10634
|
||||||
|
private String sn;
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReportUnifyReq {
|
||||||
|
@JsonProperty("car_number")
|
||||||
|
private String carNumber;// string `json:"car_number" v:"required#车牌号不能为空"` // 车牌号
|
||||||
|
@JsonProperty("car_discern_code")
|
||||||
|
private String carDiscernCode;// string `json:"car_discern_code" v:"required#车辆识别一体机编号"` // 车辆识别一体机编号
|
||||||
|
@JsonProperty("weight")
|
||||||
|
private String weight;// string `json:"weight"` // 磅重
|
||||||
|
@JsonProperty("photo_front")
|
||||||
|
private String photoFront;// string `json:"photo_front"` // 进场车头照片
|
||||||
|
@JsonProperty("photo_body")
|
||||||
|
private String photoBody;// string `json:"photo_body"` // 进场车身照片
|
||||||
|
@JsonProperty("weighbridge_code")
|
||||||
|
private String weighBridgeCode;// string `json:"weighbridge_code"` // 地磅编号
|
||||||
|
@JsonProperty("telephone")
|
||||||
|
private String telephone;
|
||||||
|
@JsonProperty("only_car")
|
||||||
|
private Integer onlyCar;
|
||||||
|
@JsonProperty("order_no")
|
||||||
|
private String orderNo;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ShowDataInfoQy {
|
||||||
|
private Integer scond;
|
||||||
|
private List<ShowLineInfoQy> lineInfo;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ShowLineInfoQy {
|
||||||
|
private Integer line;//": 1,
|
||||||
|
private Integer fontcolor = 0;//": 0,
|
||||||
|
private Integer fontsize = 1;//": 1,
|
||||||
|
private String lcdcontent;//": "这是第一行数据"
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TimeReq {
|
||||||
|
private int id; //自增id
|
||||||
|
private String deviceNo; //设备编号
|
||||||
|
private String carNo; //车牌号
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.jepsoninfo.resp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DcsCallBackReg {
|
||||||
|
private String params;
|
||||||
|
private String result;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.jepsoninfo.resp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceTimestampRet {
|
||||||
|
private String cmd;
|
||||||
|
private String id;
|
||||||
|
private Integer state_code;
|
||||||
|
private Long timestamp;
|
||||||
|
private String error_msg;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.jepsoninfo.resp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DoorStatus {
|
||||||
|
private String cmd;
|
||||||
|
private String comm;
|
||||||
|
private String data;
|
||||||
|
private String datalen;
|
||||||
|
private String subcmd;
|
||||||
|
private String state_code;
|
||||||
|
private String id;
|
||||||
|
private String gpio;
|
||||||
|
private String value;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.resp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GetSnapshotRet {
|
||||||
|
private String cmd;
|
||||||
|
private String state_code;
|
||||||
|
private String imgdata;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.jepsoninfo.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReportCarPassRes {
|
||||||
|
@JsonProperty("car_number")
|
||||||
|
private String carNumber;
|
||||||
|
@JsonProperty("type")
|
||||||
|
private Integer type;
|
||||||
|
@JsonProperty("order_no")
|
||||||
|
private String orderNo;
|
||||||
|
@JsonProperty("err_msg")
|
||||||
|
private String errMsg;
|
||||||
|
@JsonProperty("scene")
|
||||||
|
private String Scene;
|
||||||
|
}
|
|
@ -0,0 +1,931 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.dao.*;
|
||||||
|
import com.jepsoninfo.entity.*;
|
||||||
|
import com.jepsoninfo.entity.ex.HkCameraConfigEx;
|
||||||
|
import com.jepsoninfo.entity.ex.IntegratedMachineConfigEx;
|
||||||
|
import com.jepsoninfo.entity.ex.IpVoiceboxConfigEx;
|
||||||
|
import com.jepsoninfo.req.*;
|
||||||
|
import com.jepsoninfo.resp.DoorStatus;
|
||||||
|
import com.jepsoninfo.resp.ReportCarPassRes;
|
||||||
|
import com.jepsoninfo.util.*;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||||
|
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class HardService {
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("HardService.class");//Logger.getLogger("HardService.class");
|
||||||
|
@Autowired
|
||||||
|
private IntegratedMachineConfigDao integratedMachineConfigDao;
|
||||||
|
@Autowired
|
||||||
|
private WagonBalanceConfigDao wagonBalanceConfigDao;
|
||||||
|
@Autowired
|
||||||
|
private HkCameraConfigDao hkCameraConfigDao;
|
||||||
|
@Autowired
|
||||||
|
private IpVoiceboxConfigDao ipVoiceboxConfigDao;
|
||||||
|
@Autowired
|
||||||
|
private DisplayConfigDao displayConfigDao;
|
||||||
|
@Autowired
|
||||||
|
private MessageConfigDao messageConfigDao;
|
||||||
|
public MqttClient recvClient;
|
||||||
|
public MqttClient deviceClient;
|
||||||
|
|
||||||
|
public void plateRecognize(RecognizeAlarmInfoPlate req) {
|
||||||
|
ReturnCode result;
|
||||||
|
ReportCarPassRes ret;
|
||||||
|
String strRet = "";
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "车牌识别";
|
||||||
|
String carNo = req.getAlarmInfoPlate().getResult().getPlateResult().getLicense();
|
||||||
|
String devNo = req.getAlarmInfoPlate().getSerialno();
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"收到车牌识别推送");
|
||||||
|
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
integratedCond.setDevNo(devNo);
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"车牌识别详细信息");
|
||||||
|
|
||||||
|
//保持车头照
|
||||||
|
String dirName = createLocalImgDir(carNo,devNo,laneName);
|
||||||
|
String PhotoFrontFileName = RandomUtil.getRandomUuid() + ".jpg";
|
||||||
|
String PhotoFrontFilePath = saveFrontImage(req.getAlarmInfoPlate().getResult().getPlateResult().getImageFile(),carNo,dirName,devNo,laneName,PhotoFrontFileName);
|
||||||
|
|
||||||
|
if(integratedCfg != null) {
|
||||||
|
if (integratedCfg.getIsFront() == 1) {
|
||||||
|
//获取音柱配置
|
||||||
|
IpVoiceboxConfigEx ipVoiceboxConfig = ipVoiceboxConfigDao.selectByPrimaryKey(integratedCfg.getIpVoiceId());
|
||||||
|
if (ipVoiceboxConfig != null) {
|
||||||
|
MessageConfig messageConfig = messageConfigDao.selectByPrimaryKey(3L);
|
||||||
|
|
||||||
|
PlayVoiceReq playVoice = new PlayVoiceReq();
|
||||||
|
playVoice.setCarNo(carNo);
|
||||||
|
playVoice.setDeviceNo(ipVoiceboxConfig.getDevNo());
|
||||||
|
playVoice.setText(messageConfig.getContent());
|
||||||
|
playVoice(playVoice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
printDate(carNo,devNo,laneName,optName,"not find integrated");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String PhotoBodyUrl = UploadToAliUtil.uploadFile(dirName, new File(PhotoFrontFilePath), PhotoFrontFileName,
|
||||||
|
ConstUtil.OSS_ENDPOINT, ConstUtil.OSS_BUCKET, ConstUtil.OSS_SECRET_ID, ConstUtil.OSS_SECRET_KEY);
|
||||||
|
|
||||||
|
|
||||||
|
ReportUnifyReq reportUnifyReq = new ReportUnifyReq();
|
||||||
|
|
||||||
|
reportUnifyReq.setCarNumber(carNo);
|
||||||
|
reportUnifyReq.setCarDiscernCode(devNo);
|
||||||
|
reportUnifyReq.setPhotoFront(PhotoBodyUrl);
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName + "上报",reportUnifyReq);
|
||||||
|
String jsonObj;
|
||||||
|
jsonObj = JSONObject.toJSONString(reportUnifyReq);
|
||||||
|
strRet = HttpClientUtil.postJson(ConstUtil.REPORT_SERVER + ConstUtil.REPORT_PASS_SERVER_URL, jsonObj);
|
||||||
|
// strRet = "{" +
|
||||||
|
// " \"data\":{" +
|
||||||
|
// " \"carNumber\":\"测试A12345\"," +
|
||||||
|
// " \"type\":\"1\"," +
|
||||||
|
// " \"orderNo\":\"12345\"," +
|
||||||
|
// " \"errMsg\":\"\"," +
|
||||||
|
// " \"scene\":\"CPR\"" +
|
||||||
|
// " }\n" +
|
||||||
|
// "}";
|
||||||
|
printDate(carNo,devNo,laneName,optName,"上报返回:" + strRet);
|
||||||
|
result = JSONObject.parseObject(strRet,ReturnCode.class);
|
||||||
|
|
||||||
|
//printDate(carNo,devNo,laneName,optName,"上报解析:" + result);
|
||||||
|
|
||||||
|
ConstUtil.DOOR_STATUS.put(devNo,0);
|
||||||
|
|
||||||
|
if(result != null && result.getData() != null) {
|
||||||
|
ret = JSONObject.parseObject(result.getData(), ReportCarPassRes.class);
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"type:" + ret.getType().intValue() + "");
|
||||||
|
|
||||||
|
if (ret.getScene().compareTo("OPEN") == 0) {
|
||||||
|
System.out.println("open enter door");
|
||||||
|
} else {
|
||||||
|
if (ret.getType().intValue() == 0) {
|
||||||
|
//无效数据
|
||||||
|
} else if (ret.getType().intValue() == 1) {
|
||||||
|
//进场,需要获取进场磅重
|
||||||
|
int nLane = integratedCfg.getNType();
|
||||||
|
printDate(carNo,devNo,laneName,optName,"车道编号:" + nLane + "");
|
||||||
|
if (nLane == 0) {
|
||||||
|
//出场
|
||||||
|
} else {
|
||||||
|
if(integratedCfg.getIsDoorStatus() == 1) {
|
||||||
|
if (checkDoorStatus(devNo,carNo,laneName) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
collectAndUploadData(req, ret.getOrderNo(),dirName,PhotoFrontFilePath);
|
||||||
|
//closeDoor(30000,carNo,devNo,laneName);
|
||||||
|
}
|
||||||
|
} else if (ret.getType().intValue() == 2) {
|
||||||
|
//出场,需要获取出场磅重
|
||||||
|
int nLane = integratedCfg.getNType();
|
||||||
|
printDate(carNo,devNo,laneName,optName,"车道编号:" + nLane + "");
|
||||||
|
if (nLane == 0) {
|
||||||
|
//出场
|
||||||
|
if(integratedCfg.getIsDoorStatus() == 1) {
|
||||||
|
if (checkDoorStatus(devNo,carNo,laneName) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
closeDoor(0,carNo,devNo,laneName);
|
||||||
|
collectAndUploadData(req, ret.getOrderNo(),dirName,PhotoFrontFilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
printDate(carNo,devNo,laneName,optName,"服务器无法访问或返回错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void collectAndUploadData(RecognizeAlarmInfoPlate req,String orderNo,String dirName,String PhotoFrontFilePath){
|
||||||
|
ReturnCode ret;
|
||||||
|
boolean bRet;
|
||||||
|
String PhotoBodyUrl = "";
|
||||||
|
String strRet = "";
|
||||||
|
String jsonObj = "";
|
||||||
|
String carNo = req.getAlarmInfoPlate().getResult().getPlateResult().getLicense();
|
||||||
|
String devNo = req.getAlarmInfoPlate().getSerialno();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "数据采集";
|
||||||
|
ReportUnifyReq reportUnifyReq = new ReportUnifyReq();
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
MessageConfig messageConfig;
|
||||||
|
|
||||||
|
integratedCond.setDevNo(devNo);
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfigEx integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
//获取地磅配置
|
||||||
|
WagonBalanceConfig wagonCfg = wagonBalanceConfigDao.selectByPrimaryKey(integratedCfg.getWagonBalanceId());
|
||||||
|
//获取网络摄像头1配置
|
||||||
|
HkCameraConfigEx hkCameraConfig = hkCameraConfigDao.selectByPrimaryKey(integratedCfg.getHkCameraId());
|
||||||
|
//获取网络音柱配置
|
||||||
|
IpVoiceboxConfig ipVoiceboxConfig = ipVoiceboxConfigDao.selectByPrimaryKey(integratedCfg.getIpVoiceId());
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
printDate(carNo,devNo,laneName,optName,"collectAndUploadData");
|
||||||
|
|
||||||
|
//显示车牌
|
||||||
|
DisplayInfoReq displayInfoReq = new DisplayInfoReq();
|
||||||
|
|
||||||
|
displayInfoReq.setCarPlate(carNo);
|
||||||
|
displayInfoReq.setAmount("");
|
||||||
|
displayInfoReq.setWeight("");
|
||||||
|
displayInfoReq.setDeviceNo(devNo);
|
||||||
|
displayInfo(displayInfoReq);
|
||||||
|
|
||||||
|
double weight = 0.0;
|
||||||
|
int weightLoop = 3;
|
||||||
|
if (wagonCfg != null) {
|
||||||
|
while (weightLoop > 0) {
|
||||||
|
//播放等待语音
|
||||||
|
if (ipVoiceboxConfig != null) {
|
||||||
|
messageConfig = messageConfigDao.selectByPrimaryKey(2L);
|
||||||
|
PlayVoiceReq playVoice = new PlayVoiceReq();
|
||||||
|
|
||||||
|
playVoice.setCarNo(carNo);
|
||||||
|
playVoice.setDeviceNo(ipVoiceboxConfig.getDevNo());
|
||||||
|
playVoice.setText(messageConfig.getContent());
|
||||||
|
playVoice(playVoice);
|
||||||
|
}
|
||||||
|
|
||||||
|
//printDate(carNo,devNo,laneName,"称重","读地磅开始");
|
||||||
|
|
||||||
|
//读取地磅数据
|
||||||
|
weight = getWeightInfo(wagonCfg.getPortName(), wagonCfg.getBaudRate(), wagonCfg.getDataBits().byteValue()
|
||||||
|
, wagonCfg.getParity().byteValue(), wagonCfg.getStopBits().byteValue()
|
||||||
|
, carNo, devNo, "称重");
|
||||||
|
|
||||||
|
int nWeight = (int) weight;
|
||||||
|
printDate(carNo, devNo, laneName, "称重", "磅重数据:" + weight);
|
||||||
|
//nWeight = 10000;
|
||||||
|
//printDate(carNo,devNo,laneName,"称重","读地磅结束");
|
||||||
|
if (nWeight <= 200) {
|
||||||
|
//播放重新称重提示
|
||||||
|
if (ipVoiceboxConfig != null) {
|
||||||
|
messageConfig = messageConfigDao.selectByPrimaryKey(4L);
|
||||||
|
PlayVoiceReq playVoice = new PlayVoiceReq();
|
||||||
|
|
||||||
|
playVoice.setCarNo(carNo);
|
||||||
|
playVoice.setDeviceNo(ipVoiceboxConfig.getDevNo());
|
||||||
|
playVoice.setText(messageConfig.getContent());
|
||||||
|
playVoice(playVoice);
|
||||||
|
}
|
||||||
|
weightLoop--;
|
||||||
|
}else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//显示磅重
|
||||||
|
displayInfoReq.setCarPlate(carNo);
|
||||||
|
displayInfoReq.setWeight("磅重:" + (weight / 1000));
|
||||||
|
displayInfoReq.setAmount("");
|
||||||
|
displayInfoReq.setDeviceNo(devNo);
|
||||||
|
displayInfo(displayInfoReq);
|
||||||
|
|
||||||
|
//抓拍车斗图片并上传
|
||||||
|
String PhotoBodyFileName = RandomUtil.getRandomUuid() + ".jpg";
|
||||||
|
String PhotoBodyFilePath = "/" +dirName + "/" + PhotoBodyFileName;
|
||||||
|
String PhotoFrontUrl = "";
|
||||||
|
|
||||||
|
if(hkCameraConfig != null) {
|
||||||
|
printDate(carNo,devNo,laneName,"高位","获取高位摄像头开始");
|
||||||
|
bRet = captureImage(hkCameraConfig, ConstUtil.LOCAL_PATH + PhotoBodyFilePath,carNo,devNo,laneName);
|
||||||
|
if (bRet == true) {
|
||||||
|
printDate(carNo,devNo,laneName,"高位","上传车斗照");
|
||||||
|
PhotoBodyUrl = "/file" + PhotoBodyFilePath;
|
||||||
|
PhotoBodyUrl = UploadToAliUtil.uploadFile(dirName, new File(ConstUtil.LOCAL_PATH + PhotoBodyFilePath), PhotoBodyFileName,
|
||||||
|
ConstUtil.OSS_ENDPOINT, ConstUtil.OSS_BUCKET, ConstUtil.OSS_SECRET_ID, ConstUtil.OSS_SECRET_KEY);
|
||||||
|
} else {
|
||||||
|
PhotoBodyFilePath = "";
|
||||||
|
printDate(carNo,devNo,laneName,"高位","高位摄像头拍摄失败");
|
||||||
|
}
|
||||||
|
printDate(carNo,devNo,laneName,"高位","获取高位摄像头结束");
|
||||||
|
}
|
||||||
|
printDate(carNo,devNo,laneName,"高位","上传车头照");
|
||||||
|
//上传车头照
|
||||||
|
File file = new File(PhotoFrontFilePath);
|
||||||
|
String PhotoFrontFileName = file.getName();
|
||||||
|
PhotoFrontUrl = UploadToAliUtil.uploadFile(dirName, new File(PhotoFrontFilePath), PhotoFrontFileName,
|
||||||
|
ConstUtil.OSS_ENDPOINT, ConstUtil.OSS_BUCKET, ConstUtil.OSS_SECRET_ID, ConstUtil.OSS_SECRET_KEY);
|
||||||
|
|
||||||
|
//ConstUtil.DOOR_STATUS.put(devNo,0);
|
||||||
|
//上传数据
|
||||||
|
// printDate(carNo,devNo,laneName,optName,"上传数据开始");
|
||||||
|
// //获取另一台识别设备的设备号
|
||||||
|
// IntegratedMachineConfig listCond = new IntegratedMachineConfig();
|
||||||
|
//
|
||||||
|
// listCond.setLaneNo(integratedCfg.getLaneNo());
|
||||||
|
// List<IntegratedMachineConfigEx> listIntegrated = integratedMachineConfigDao.selectListByCond(listCond);
|
||||||
|
//
|
||||||
|
// for(int i = 0;i < listIntegrated.size();i++){
|
||||||
|
// IntegratedMachineConfigEx item = listIntegrated.get(i);
|
||||||
|
// String curDevNo = item.getDevNo();
|
||||||
|
// printDate("当前编号:" + curDevNo);
|
||||||
|
// printDate("设备编号:" + devNo);
|
||||||
|
//
|
||||||
|
// if(curDevNo.equals(devNo) == false) {
|
||||||
|
// printDate("编号不同");
|
||||||
|
// devNo = item.getDevNo();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
reportUnifyReq.setCarNumber(carNo);
|
||||||
|
reportUnifyReq.setCarDiscernCode(devNo);
|
||||||
|
reportUnifyReq.setWeight(weight + "");
|
||||||
|
reportUnifyReq.setPhotoFront(PhotoFrontUrl);
|
||||||
|
reportUnifyReq.setPhotoBody(PhotoBodyUrl);
|
||||||
|
reportUnifyReq.setTelephone(req.getAlarmInfoPlate().getResult().getPlateResult().getTelephone());
|
||||||
|
reportUnifyReq.setOnlyCar(0);
|
||||||
|
reportUnifyReq.setOrderNo(orderNo);
|
||||||
|
|
||||||
|
jsonObj = JSONObject.toJSONString(reportUnifyReq);
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"上传数据开始:" + reportUnifyReq);
|
||||||
|
|
||||||
|
strRet = HttpClientUtil.postJson(ConstUtil.REPORT_SERVER + ConstUtil.REPORT_SERVER_URL, jsonObj);
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"上传数据返回:" + strRet);
|
||||||
|
//ret = JSONObject.parseObject(strRet, ReturnCode.class);
|
||||||
|
|
||||||
|
req.getAlarmInfoPlate().getResult().getPlateResult().setImageFile("");
|
||||||
|
jsonObj = JSONObject.toJSONString(req);
|
||||||
|
printDate(carNo,devNo,laneName,"车牌识别","车牌识别数据:" + req);
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"上传数据结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDoorStatus(String devNo,String carNo){
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "获取道闸状态";
|
||||||
|
printDate(carNo,devNo,laneName,optName,"获取道闸状态开始");
|
||||||
|
String strStatus = "";
|
||||||
|
DoorStatus doorStatus;
|
||||||
|
int nRet = 0;
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(devNo);
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
|
||||||
|
try {
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " getDoorStatus" + integratedCfg.getVerNo() + " " + integratedCfg.getIpAddr() +" " + integratedCfg.getTcpPort() +" " + integratedCfg.getRs485Port();
|
||||||
|
printDate(carNo,devNo,laneName,optName,cmd);
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++){
|
||||||
|
line = listRet.get(i);
|
||||||
|
int pos = line.indexOf("getDoorStatus_success:");
|
||||||
|
if(pos >= 0){
|
||||||
|
strStatus = line.substring(22);
|
||||||
|
printDate(carNo,devNo,laneName,optName,strStatus);
|
||||||
|
doorStatus = JSONObject.parseObject(strStatus, DoorStatus.class);
|
||||||
|
//信号为0的时候说明闸是关着的;信号是1的时候,说明闸开了
|
||||||
|
if(doorStatus.getValue().compareTo("0") == 0){
|
||||||
|
nRet = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
printDate(carNo,devNo,laneName,optName,"status is " + nRet);
|
||||||
|
printDate(carNo,devNo,laneName,optName,"获取道闸状态结束");
|
||||||
|
return nRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWeightInfo(String pPort,int BaudRate,byte ByteSize,byte Parity,byte StopBits,String carNo,String devNo,String laneName){
|
||||||
|
String weight = "0.0";
|
||||||
|
double dWeight = 0.0;
|
||||||
|
String optName = "称重";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " readWeight " + pPort + " " + BaudRate + " " + ByteSize + " " + Parity + " " + StopBits + "";
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
int pos = line.indexOf("weight:");
|
||||||
|
if(pos >= 0){
|
||||||
|
weight = line.substring(7,line.length() - 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dWeight = Double.parseDouble(weight);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean captureImage(HkCameraConfigEx config,String fileName,String carNo,String devNo,String laneName){
|
||||||
|
boolean bRet = false;
|
||||||
|
String optName = "高位";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " captureImage" + config.getVerNo() + " " + config.getIpAddr() + " " + fileName + " " + config.getPort() + " " + config.getUserName() + " " + config.getPassword();
|
||||||
|
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
int pos = line.indexOf("captureImage:success");
|
||||||
|
if (pos >= 0) {
|
||||||
|
bRet = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int playVoice(PlayVoiceReq req) {
|
||||||
|
String carNo = req.getCarNo();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "语音";
|
||||||
|
String jsonReq = JSONObject.toJSONString(req);
|
||||||
|
IpVoiceboxConfig cond = new IpVoiceboxConfig();
|
||||||
|
|
||||||
|
cond.setDevNo(req.getDeviceNo());
|
||||||
|
IpVoiceboxConfigEx cfg = ipVoiceboxConfigDao.selectByCond(cond);
|
||||||
|
if(cfg != null) {
|
||||||
|
try {
|
||||||
|
laneName = cfg.getLaneName();
|
||||||
|
//printDate(carNo, devNo, laneName, optName, "播放语音开始");
|
||||||
|
printDate(carNo, devNo, laneName, optName, req);
|
||||||
|
String strChinese = StringToChineseUtil.convert(req.getText());
|
||||||
|
String baseStr = Base64.encodeBase64String(strChinese.getBytes("UTF-8"));
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " playVoice" + cfg.getVerNo() + " " + cfg.getIpAddr() + " " + baseStr;
|
||||||
|
if (cfg.getTcpPort().intValue() >= 0) {
|
||||||
|
cmd += " " + cfg.getTcpPort();
|
||||||
|
}
|
||||||
|
if (cfg.getHttpPort().intValue() >= 0) {
|
||||||
|
cmd += " " + cfg.getHttpPort();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(cfg.getUserName()) == true) {
|
||||||
|
cmd += " " + cfg.getUserName();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(cfg.getPasswd()) == true) {
|
||||||
|
cmd += " " + cfg.getPasswd();
|
||||||
|
}
|
||||||
|
if (cfg.getRs485Port().intValue() >= 0) {
|
||||||
|
cmd += " " + cfg.getRs485Port();
|
||||||
|
}
|
||||||
|
if (cfg.getMaxVol().intValue() >= 0) {
|
||||||
|
cmd += " " + cfg.getMaxVol();
|
||||||
|
}
|
||||||
|
|
||||||
|
String prefix = "voice dev return ";
|
||||||
|
ThreadPlayVoice thread = new ThreadPlayVoice(this,cmd, prefix, jsonReq, optName, carNo, devNo, laneName);
|
||||||
|
thread.start();
|
||||||
|
|
||||||
|
//printDate(carNo, devNo, laneName, optName, "播放语音结束");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
printDate(carNo,devNo,laneName,optName,"device not fount");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int openDoor(DoorReq req) {
|
||||||
|
String jsonReq = JSONObject.toJSONString(req);
|
||||||
|
String carNo = req.getCarNo();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "开闸";
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(req.getDeviceNo());
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸开始");
|
||||||
|
if(integratedCfg != null) {
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " openDoor" + integratedCfg.getVerNo() + " " + integratedCfg.getIpAddr();
|
||||||
|
if(integratedCfg.getTcpPort().intValue() >= 0){
|
||||||
|
cmd += " " + integratedCfg.getTcpPort();
|
||||||
|
}
|
||||||
|
if(integratedCfg.getHttpPort().intValue() >= 0){
|
||||||
|
cmd += " " + integratedCfg.getHttpPort();
|
||||||
|
}
|
||||||
|
if(integratedCfg.getIoPort().intValue() >= 0){
|
||||||
|
cmd += " " + integratedCfg.getIoPort();
|
||||||
|
}
|
||||||
|
printDate(carNo,devNo,laneName,optName,cmd);
|
||||||
|
String prefix = "dev return ";
|
||||||
|
|
||||||
|
try {
|
||||||
|
ThreadOpenDoor thread = new ThreadOpenDoor(this,cmd, prefix, jsonReq, optName, carNo, devNo, laneName);
|
||||||
|
thread.start();
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int mqttOpenDoor(DoorReq req){
|
||||||
|
String[] TOPIC_ARRAY = {
|
||||||
|
ConstUtil.MQTT_DEVICE_TOPIC + "user/get"};
|
||||||
|
String carNo = req.getCarNo();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "开闸";
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(req.getDeviceNo());
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
String msgId = System.currentTimeMillis() + RandomUtil.getRandomStr(7);
|
||||||
|
|
||||||
|
RecognizePlateResultAckQy ack = new RecognizePlateResultAckQy();
|
||||||
|
ack.setCmd("iooutput");
|
||||||
|
ack.setMsg_id(msgId);
|
||||||
|
ack.setIonum(1);
|
||||||
|
ack.setAction("on");
|
||||||
|
ack.setUtc_ts(1);
|
||||||
|
|
||||||
|
MqttMessage ackMsg = new MqttMessage();
|
||||||
|
String strPayload = JSONObject.toJSONString(ack);
|
||||||
|
|
||||||
|
ackMsg.setPayload(strPayload.getBytes(StandardCharsets.UTF_8));
|
||||||
|
try {
|
||||||
|
String topic = ConstUtil.MQTT_DEVICE_TYPE + req.getDeviceNo() + TOPIC_ARRAY[0];
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸主题:" + topic);
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸消息:" + strPayload);
|
||||||
|
deviceClient.publish( topic, ackMsg);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸结束");
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int mqttCloseDoor(DoorReq req){
|
||||||
|
String[] TOPIC_ARRAY = {
|
||||||
|
ConstUtil.MQTT_DEVICE_TOPIC + "user/get"};
|
||||||
|
String carNo = req.getCarNo();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "开闸";
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(req.getDeviceNo());
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
String msgId = System.currentTimeMillis() + RandomUtil.getRandomStr(7);
|
||||||
|
|
||||||
|
RecognizePlateResultAckQy ack = new RecognizePlateResultAckQy();
|
||||||
|
ack.setCmd("iooutput");
|
||||||
|
ack.setMsg_id(msgId);
|
||||||
|
ack.setIonum(1);
|
||||||
|
ack.setAction("off");
|
||||||
|
ack.setUtc_ts(1);
|
||||||
|
|
||||||
|
MqttMessage ackMsg = new MqttMessage();
|
||||||
|
String strPayload = JSONObject.toJSONString(ack);
|
||||||
|
|
||||||
|
ackMsg.setPayload(strPayload.getBytes(StandardCharsets.UTF_8));
|
||||||
|
try {
|
||||||
|
String topic = ConstUtil.MQTT_DEVICE_TYPE + req.getDeviceNo() + TOPIC_ARRAY[0];
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸主题:" + topic);
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸消息:" + strPayload);
|
||||||
|
deviceClient.publish( topic, ackMsg);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸结束");
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int manualTrigger(DoorReq req) {
|
||||||
|
String carNo = req.getCarNo();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "手动触发";
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(req.getDeviceNo());
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
|
||||||
|
if(integratedCfg != null) {
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " manualTrigger " + integratedCfg.getIpAddr() + " " + integratedCfg.getTcpPort();
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
int pos = line.indexOf("dev return ");
|
||||||
|
if(pos >= 0){
|
||||||
|
String devRet = line.substring(11);
|
||||||
|
printDate(carNo,devNo,laneName,optName,devRet);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int displayInfo(DisplayInfoReq req) {
|
||||||
|
String jsonReq = JSONObject.toJSONString(req);
|
||||||
|
String carNo = req.getCarPlate();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "显示";
|
||||||
|
|
||||||
|
DisplayConfig displayCond = new DisplayConfig();
|
||||||
|
|
||||||
|
displayCond.setDevNo(devNo);
|
||||||
|
//获取一体机配置
|
||||||
|
DisplayConfig displayCfg = displayConfigDao.selectByCond(displayCond);
|
||||||
|
|
||||||
|
if(displayCfg != null) {
|
||||||
|
try {
|
||||||
|
laneName = displayCfg.getLaneName();
|
||||||
|
printDate(carNo, devNo, laneName, optName, req);
|
||||||
|
//printDate(carNo, devNo, laneName, optName, "显示文字开始");
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " displayInfo" + displayCfg.getVerNo() + " " + displayCfg.getIpAddr();
|
||||||
|
String clearCmd = ConstUtil.CMD_PATH + " displayInfo" + displayCfg.getVerNo() + " " + displayCfg.getIpAddr();
|
||||||
|
if (displayCfg.getTcpPort().intValue() >= 0) {
|
||||||
|
cmd += " " + displayCfg.getTcpPort();
|
||||||
|
clearCmd += " " + displayCfg.getTcpPort();
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(req.getCarPlate()) == true) {
|
||||||
|
cmd += " " + "IA==";
|
||||||
|
}else{
|
||||||
|
cmd += " " + Base64.encodeBase64String(req.getCarPlate().getBytes("UTF-8"));
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(req.getWeight()) == true) {
|
||||||
|
cmd += " " + "IA==";
|
||||||
|
}else {
|
||||||
|
cmd += " " + Base64.encodeBase64String(req.getWeight().getBytes("UTF-8"));
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(req.getAmount()) == true) {
|
||||||
|
cmd += " " + "IA==";
|
||||||
|
}else {
|
||||||
|
cmd += " " + Base64.encodeBase64String(req.getAmount().getBytes("UTF-8"));
|
||||||
|
}
|
||||||
|
clearCmd += " IA==";
|
||||||
|
clearCmd += " " + Base64.encodeBase64String(ConstUtil.DEFAULT_ADVERT_1.getBytes("UTF-8"));
|
||||||
|
clearCmd += " " + Base64.encodeBase64String(ConstUtil.DEFAULT_ADVERT_2.getBytes("UTF-8"));;
|
||||||
|
if (displayCfg.getRs485Port().intValue() >= 0) {
|
||||||
|
cmd += " " + displayCfg.getRs485Port();
|
||||||
|
clearCmd += " " + displayCfg.getRs485Port();
|
||||||
|
}
|
||||||
|
String prefix = "display dev return ";
|
||||||
|
|
||||||
|
ThreadDisplayInfo thread = new ThreadDisplayInfo(this,cmd, prefix, jsonReq, "显示", carNo, devNo, laneName);
|
||||||
|
thread.start();
|
||||||
|
ThreadClearDisplay clearThread = new ThreadClearDisplay(this,clearCmd, carNo, devNo, laneName);
|
||||||
|
clearThread.start();
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
printDate(carNo,devNo,laneName,optName,"device not find");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
public int mqttDisplayInfo(DisplayInfoReq req) {
|
||||||
|
String[] TOPIC_ARRAY = {
|
||||||
|
ConstUtil.MQTT_DEVICE_TOPIC + "user/get"};
|
||||||
|
String carNo = "";
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "开闸";
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(req.getDeviceNo());
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
String msgId = System.currentTimeMillis() + RandomUtil.getRandomStr(7);
|
||||||
|
|
||||||
|
RecognizePlateResultAckQy ack = new RecognizePlateResultAckQy();
|
||||||
|
ShowDataInfoQy showData = new ShowDataInfoQy();
|
||||||
|
List<ShowLineInfoQy> lineInfo = new ArrayList<ShowLineInfoQy>();
|
||||||
|
ShowLineInfoQy line1 = new ShowLineInfoQy();
|
||||||
|
line1.setLine(1);
|
||||||
|
line1.setLcdcontent(req.getCarPlate());
|
||||||
|
lineInfo.add(line1);
|
||||||
|
|
||||||
|
ShowLineInfoQy line2 = new ShowLineInfoQy();
|
||||||
|
line2.setLine(1);
|
||||||
|
line2.setLcdcontent(req.getWeight());
|
||||||
|
lineInfo.add(line2);
|
||||||
|
|
||||||
|
ShowLineInfoQy line3 = new ShowLineInfoQy();
|
||||||
|
line3.setLine(1);
|
||||||
|
line3.setLcdcontent(req.getAmount());
|
||||||
|
lineInfo.add(line3);
|
||||||
|
|
||||||
|
showData.setLineInfo(lineInfo);
|
||||||
|
showData.setScond(10);
|
||||||
|
|
||||||
|
ack.setCmd("LCDCurrentShowInfo");
|
||||||
|
ack.setMsg_id(msgId);
|
||||||
|
ack.setShowDataInfo(showData);
|
||||||
|
|
||||||
|
MqttMessage ackMsg = new MqttMessage();
|
||||||
|
String strPayload = JSONObject.toJSONString(ack);
|
||||||
|
|
||||||
|
ackMsg.setPayload(strPayload.getBytes(StandardCharsets.UTF_8));
|
||||||
|
try {
|
||||||
|
String topic = ConstUtil.MQTT_DEVICE_TYPE + req.getDeviceNo() + TOPIC_ARRAY[0];
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸主题:" + topic);
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸消息:" + strPayload);
|
||||||
|
deviceClient.publish(topic, ackMsg);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"开闸结束");
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearDisplay(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int manualPlateRecognize(RecognizeAlarmInfoPlate req,String orderNo) {
|
||||||
|
String jsonObj = JSONObject.toJSONString(req);
|
||||||
|
String devNo = req.getAlarmInfoPlate().getSerialno();
|
||||||
|
String carNo = req.getAlarmInfoPlate().getResult().getPlateResult().getLicense();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "手动车牌识别";
|
||||||
|
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(devNo);
|
||||||
|
//获取一体机配置
|
||||||
|
IntegratedMachineConfig integratedCfg = integratedMachineConfigDao.selectByCond(integratedCond);
|
||||||
|
|
||||||
|
laneName = integratedCfg.getLaneName();
|
||||||
|
|
||||||
|
String dirName = createLocalImgDir(carNo,carNo,laneName);
|
||||||
|
String PhotoFrontFileName = RandomUtil.getRandomUuid() + ".jpg";
|
||||||
|
String PhotoFrontFilePath = ConstUtil.LOCAL_PATH + "/" + dirName + "/" + PhotoFrontFileName;
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"手动获取数据");
|
||||||
|
printDate(carNo,devNo,laneName,optName,req);
|
||||||
|
|
||||||
|
if(integratedCfg != null) {
|
||||||
|
boolean bRet = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " manualPlateRecognize " + integratedCfg.getIpAddr() + " " + integratedCfg.getTcpPort() + " " + PhotoFrontFilePath;
|
||||||
|
printDate(carNo,devNo,laneName,optName,cmd);
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
int pos = line.indexOf("captureImage:success");
|
||||||
|
if (pos >= 0) {
|
||||||
|
bRet = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bRet == false){
|
||||||
|
PhotoFrontFilePath = "";
|
||||||
|
}
|
||||||
|
//req.getAlarmInfoPlate().getResult().getPlateResult().setImageFile(imageData);
|
||||||
|
ThreadManualPlateRecognize thread = new ThreadManualPlateRecognize(this, req, orderNo,dirName,PhotoFrontFilePath);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetDevTime(TimeReq req) {
|
||||||
|
String carNo = req.getCarNo();
|
||||||
|
String devNo = req.getDeviceNo();
|
||||||
|
String laneName = "";
|
||||||
|
String optName = "设置时间";
|
||||||
|
IntegratedMachineConfig integratedCond = new IntegratedMachineConfig();
|
||||||
|
|
||||||
|
integratedCond.setDevNo(req.getDeviceNo());
|
||||||
|
//获取一体机配置
|
||||||
|
List<IntegratedMachineConfigEx> list = integratedMachineConfigDao.selectListByCond(integratedCond);
|
||||||
|
|
||||||
|
for (int i = 0;i < list.size();i++){
|
||||||
|
IntegratedMachineConfigEx integratedCfg = list.get(i);
|
||||||
|
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " resetDevTime" + integratedCfg.getVerNo() + " " + integratedCfg.getIpAddr() + " " + integratedCfg.getTcpPort() + " " + integratedCfg.getRs485Port();
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,cmd);
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int j = 0;j < listRet.size();j++) {
|
||||||
|
line = listRet.get(j);
|
||||||
|
printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkDoorStatus(String devNo,String carNo,String laneName){
|
||||||
|
String optName = "获取道闸状态";
|
||||||
|
Integer status = ConstUtil.DOOR_STATUS.get(devNo);
|
||||||
|
int i = 0;
|
||||||
|
printDate(carNo,devNo,laneName,optName,"checkDoorStatus:" + status);
|
||||||
|
|
||||||
|
//20秒内是否已下发开闸指令,如果已下发,状态为IS_SEND_OPEN_DOOR,否则20秒内检测40次
|
||||||
|
while (status.compareTo(ConstUtil.IS_NOT_SEND_OPEN_DOOR) == 0 && i < 40){
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
status = ConstUtil.DOOR_STATUS.get(devNo);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
printDate(carNo,devNo,laneName,optName,"status:" + status);
|
||||||
|
//已下发开闸指令,开始获取落闸信号
|
||||||
|
if(status.compareTo(ConstUtil.IS_SEND_OPEN_DOOR) == 0) {
|
||||||
|
int nTotalTime = 0;
|
||||||
|
printDate(carNo,devNo,laneName,optName,"已开闸");
|
||||||
|
//50秒内取100次道闸状态,确认道闸是否为落闸
|
||||||
|
while (nTotalTime < 100) {
|
||||||
|
try {
|
||||||
|
int doorStatus = getDoorStatus(devNo,carNo);
|
||||||
|
if (doorStatus == ConstUtil.DOOR_STATUS_CLOSEED) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Thread.sleep(500);
|
||||||
|
nTotalTime++;
|
||||||
|
} catch (Exception e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeDoor(int times,String carNo,String devNo,String laneName){
|
||||||
|
//关卷帘门,苏州弘盛发专用
|
||||||
|
ThreadCloseDoor thread = new ThreadCloseDoor(this,carNo,devNo,laneName,times);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String createLocalImgDir(String carNo,String devNo,String laneName){
|
||||||
|
String optName = "创建图片目录";
|
||||||
|
Date date = new Date();
|
||||||
|
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyyMMdd");
|
||||||
|
String dirName = dateFormat.format(date);
|
||||||
|
printDate(carNo,devNo,laneName,optName,dirName);
|
||||||
|
|
||||||
|
File file = new File(ConstUtil.LOCAL_PATH + dirName);
|
||||||
|
|
||||||
|
if (!file.exists()) {
|
||||||
|
printDate(carNo,devNo,laneName,optName,"目录不存在");
|
||||||
|
//创建上级目录
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
return dirName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String saveFrontImage(String imageData,String carNo,String dirName,String devNo,String laneName,String PhotoFrontFileName){
|
||||||
|
String optName = "保存图片";
|
||||||
|
String PhotoFrontFilePath = ConstUtil.LOCAL_PATH + "/" + dirName + "/" + PhotoFrontFileName;
|
||||||
|
|
||||||
|
//保存车牌图片并上传
|
||||||
|
boolean bRet = ImageUtil.generateImage(imageData, PhotoFrontFilePath);
|
||||||
|
printDate(carNo,devNo,laneName,optName,"保存车牌图片完成:" + PhotoFrontFilePath);
|
||||||
|
if (bRet == false) {
|
||||||
|
PhotoFrontFilePath = "";
|
||||||
|
printDate(carNo,devNo,laneName,optName,"一体机拍摄失败:" + carNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PhotoFrontFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printDate(String carNo,String devNo,String laneName,String optName,Object content){
|
||||||
|
logger.info(optName + ":" + carNo + ":" + devNo + ":" + laneName + ":" + content);
|
||||||
|
|
||||||
|
LogEntity logEntity = new LogEntity();
|
||||||
|
|
||||||
|
logEntity.logTime = System.currentTimeMillis();
|
||||||
|
logEntity.content = content;
|
||||||
|
logEntity.carNo = carNo;
|
||||||
|
logEntity.devNo = devNo;
|
||||||
|
logEntity.laneName = laneName;
|
||||||
|
logEntity.optName = optName;
|
||||||
|
logEntity.companyNo = ConstUtil.COMPANY_NO;
|
||||||
|
logEntity.companyName = ConstUtil.COMPANY_NAME;
|
||||||
|
|
||||||
|
ConstUtil.deque.offer(logEntity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import com.jepsoninfo.util.CmdUtil;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class ThreadClearDisplay extends Thread{
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadClearDisplay.class");
|
||||||
|
private HardService hardService;
|
||||||
|
private String cmd;
|
||||||
|
private String carNo;
|
||||||
|
private String devNo;
|
||||||
|
private String laneName;
|
||||||
|
private String optName = "显示";
|
||||||
|
|
||||||
|
public ThreadClearDisplay(HardService hardService,String cmd,String carNo,String devNo,String laneName){
|
||||||
|
this.hardService = hardService;
|
||||||
|
this.cmd = cmd;
|
||||||
|
this.carNo = carNo;
|
||||||
|
this.devNo = devNo;
|
||||||
|
this.laneName = laneName;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Thread.sleep(10000);
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
// String line;
|
||||||
|
// for (int i = 0;i < listRet.size();i++) {
|
||||||
|
// line = listRet.get(i);
|
||||||
|
// printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
// }
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import com.jepsoninfo.util.CmdUtil;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class ThreadCloseDoor extends Thread{
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadCloseDoor.class");
|
||||||
|
private HardService hardService;
|
||||||
|
private String carNo;
|
||||||
|
private String devNo;
|
||||||
|
private String laneName;
|
||||||
|
private String optName = "卷帘门";
|
||||||
|
private int sleepTimes;
|
||||||
|
|
||||||
|
public ThreadCloseDoor(HardService hardService,String carNo,String devNo,String laneName,int sleepTimes){
|
||||||
|
this.hardService = hardService;
|
||||||
|
this.carNo = carNo;
|
||||||
|
this.devNo = devNo;
|
||||||
|
this.laneName = laneName;
|
||||||
|
this.sleepTimes = sleepTimes;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if(sleepTimes > 0) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(sleepTimes);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String cmd = ConstUtil.CMD_PATH + " closeDoorV4 192.168.1.202";
|
||||||
|
|
||||||
|
try {
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
hardService.printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,113 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.req.*;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
public class ThreadDeviceCmdMqtt extends Thread{
|
||||||
|
private HardService hardService;
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadDeviceCmdMqtt.class");
|
||||||
|
|
||||||
|
public ThreadDeviceCmdMqtt(HardService hardService){
|
||||||
|
this.hardService = hardService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
logger.info("ThreadDeviceCmdMqtt mqtt init");
|
||||||
|
|
||||||
|
String[] TOPIC_ARRAY = {
|
||||||
|
ConstUtil.MQTT_DEVICE_TOPIC + "user/get",
|
||||||
|
ConstUtil.MQTT_DEVICE_TOPIC + "user/update"};
|
||||||
|
try {
|
||||||
|
hardService.deviceClient = new MqttClient(ConstUtil.MQTT_DEVICE_BROKER, ConstUtil.MQTT_DEVICE_CLIENTID, new MemoryPersistence());
|
||||||
|
MqttClient client = hardService.deviceClient;
|
||||||
|
|
||||||
|
logger.info("ThreadDeviceCmdMqtt mqtt start connect");
|
||||||
|
//连接服务器
|
||||||
|
MqttConnectOptions options = new MqttConnectOptions();
|
||||||
|
options.setConnectionTimeout(10);
|
||||||
|
options.setUserName(ConstUtil.MQTT_DEVICE_USER_NAME);
|
||||||
|
options.setPassword(ConstUtil.MQTT_DEVICE_PASSWORD.toCharArray());
|
||||||
|
client.connect(options);
|
||||||
|
logger.info("ThreadDeviceCmdMqtt mqtt connect success");
|
||||||
|
//订阅主题
|
||||||
|
int[] qos = new int[TOPIC_ARRAY.length];
|
||||||
|
|
||||||
|
for (int i = 0; i < qos.length; ++i) {
|
||||||
|
qos[i] = 0;
|
||||||
|
}
|
||||||
|
client.subscribe(TOPIC_ARRAY, qos);
|
||||||
|
client.setCallback(new MqttCallback() {
|
||||||
|
@Override
|
||||||
|
public void connectionLost(Throwable e) {
|
||||||
|
logger.info("ThreadDeviceCmdMqtt mqtt connect lost");
|
||||||
|
ThreadDeviceCmdMqtt thread = new ThreadDeviceCmdMqtt(hardService);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void messageArrived(String topic, MqttMessage message) {
|
||||||
|
int nRet = 0;
|
||||||
|
String strMsg = new String(message.getPayload(), StandardCharsets.UTF_8);
|
||||||
|
JSONObject json = JSONObject.parseObject(strMsg);
|
||||||
|
|
||||||
|
logger.info("ThreadDeviceCmdMqtt topic is " + topic);
|
||||||
|
logger.info("ThreadDeviceCmdMqtt mqtt msg is " + strMsg);
|
||||||
|
RecognizePlateResultQy plateResultQy = JSONObject.toJavaObject(json, RecognizePlateResultQy.class);;
|
||||||
|
String cmd = plateResultQy.getCmd();
|
||||||
|
|
||||||
|
switch (cmd){
|
||||||
|
case "result":{
|
||||||
|
RecognizeAlarmInfoPlate recognizeAlarmInfoPlate = new RecognizeAlarmInfoPlate();
|
||||||
|
ClassAlarmInfoPlate alarmInfoPlate = new ClassAlarmInfoPlate();
|
||||||
|
AlarmInfoPlateResult result = new AlarmInfoPlateResult();
|
||||||
|
AlarmInfoPlateResultPlateResult PlateResult = new AlarmInfoPlateResultPlateResult();
|
||||||
|
|
||||||
|
//car no
|
||||||
|
PlateResult.setLicense(plateResultQy.getPlate_num());
|
||||||
|
result.setPlateResult(PlateResult);
|
||||||
|
alarmInfoPlate.setResult(result);
|
||||||
|
//devNo
|
||||||
|
alarmInfoPlate.setSerialno(plateResultQy.getSn());
|
||||||
|
recognizeAlarmInfoPlate.setAlarmInfoPlate(alarmInfoPlate);
|
||||||
|
|
||||||
|
hardService.plateRecognize(recognizeAlarmInfoPlate);
|
||||||
|
|
||||||
|
RecognizePlateResultAckQy ack = new RecognizePlateResultAckQy();
|
||||||
|
ack.setCmd("result_rsp");
|
||||||
|
ack.setStatus("ok");
|
||||||
|
ack.setMsg_id(plateResultQy.getMsg_id());
|
||||||
|
MqttMessage ackMsg = new MqttMessage();
|
||||||
|
|
||||||
|
try {
|
||||||
|
client.publish(TOPIC_ARRAY[1], ackMsg);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||||
|
System.out.println("ThreadDeviceCmdMqtt deliveryComplete---------" + token.isComplete());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch (MqttException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
try {
|
||||||
|
Thread.sleep(10000);
|
||||||
|
}catch (Exception e1){
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadDeviceCmdMqtt thread = new ThreadDeviceCmdMqtt(hardService);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import com.jepsoninfo.resp.DcsCallBackReg;
|
||||||
|
import com.jepsoninfo.util.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class ThreadDisplayInfo extends Thread{
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadReportDevice.class");
|
||||||
|
private HardService hardService;
|
||||||
|
private String prefix;
|
||||||
|
private String cmd;
|
||||||
|
private String jsonReq;
|
||||||
|
private String carNo;
|
||||||
|
private String devNo;
|
||||||
|
private String laneName;
|
||||||
|
private String optName = "车牌识别";
|
||||||
|
|
||||||
|
public ThreadDisplayInfo(HardService hardService,String cmd, String prefix, String jsonReq, String optName, String carNo, String devNo, String laneName){
|
||||||
|
this.hardService = hardService;
|
||||||
|
this.optName = optName;
|
||||||
|
this.cmd = cmd;
|
||||||
|
this.prefix = prefix;
|
||||||
|
this.jsonReq = jsonReq;
|
||||||
|
this.carNo = carNo;
|
||||||
|
this.devNo = devNo;
|
||||||
|
this.laneName = laneName;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0; i < listRet.size(); i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
hardService.printDate(carNo, devNo, laneName, optName, line);
|
||||||
|
int pos = line.indexOf(prefix);
|
||||||
|
if (pos >= 0) {
|
||||||
|
String devRet = line.substring(prefix.length());
|
||||||
|
//printDate(carNo,devNo,laneName,optName,devRet);
|
||||||
|
try {
|
||||||
|
DcsCallBackReg openDoorRet = new DcsCallBackReg();
|
||||||
|
DeviceRet deviceRet = JSONObject.parseObject(devRet, DeviceRet.class);
|
||||||
|
ReturnCode returnCode = new ReturnCode();
|
||||||
|
|
||||||
|
if (deviceRet != null) {
|
||||||
|
if ((deviceRet.getState_code() != null && deviceRet.getState_code().compareTo("200") == 0)
|
||||||
|
|| (deviceRet.getCode() != null && deviceRet.getCode().compareTo("200") == 0)) {
|
||||||
|
returnCode.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
returnCode.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
String strReturnCode = JSONObject.toJSONString(returnCode);
|
||||||
|
openDoorRet.setParams(jsonReq);
|
||||||
|
openDoorRet.setResult(strReturnCode);
|
||||||
|
|
||||||
|
String strReport = JSONObject.toJSONString(openDoorRet);
|
||||||
|
|
||||||
|
String strRet = HttpClientUtil.postJson(ConstUtil.REPORT_SERVER + ConstUtil.DCS_CALLBACK, strReport);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import com.jepsoninfo.util.HttpClientUtil;
|
||||||
|
|
||||||
|
public class ThreadLogReport extends Thread{
|
||||||
|
public ThreadLogReport(){
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
while (true){
|
||||||
|
if(ConstUtil.deque.size() > 0){
|
||||||
|
LogEntity logEntity = ConstUtil.deque.peek();
|
||||||
|
String jsonObj = JSONObject.toJSONString(logEntity);
|
||||||
|
HttpClientUtil.postJson(ConstUtil.LOG_SERVER_URL, jsonObj);
|
||||||
|
ConstUtil.deque.poll();
|
||||||
|
}else {
|
||||||
|
try {
|
||||||
|
Thread.sleep(500);
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.jepsoninfo.req.RecognizeAlarmInfoPlate;
|
||||||
|
|
||||||
|
class ThreadManualPlateRecognize extends Thread{
|
||||||
|
private RecognizeAlarmInfoPlate param;
|
||||||
|
private HardService hardService;
|
||||||
|
private String orderNo;
|
||||||
|
private String photoFrontFilePath;
|
||||||
|
private String dirName;
|
||||||
|
|
||||||
|
public ThreadManualPlateRecognize(HardService hardService,RecognizeAlarmInfoPlate param,String orderNo,String dirName,String photoFrontFilePath){
|
||||||
|
this.param = param;
|
||||||
|
this.hardService = hardService;
|
||||||
|
this.orderNo = orderNo;
|
||||||
|
this.photoFrontFilePath = photoFrontFilePath;
|
||||||
|
this.dirName = dirName;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
hardService.collectAndUploadData(param,orderNo,dirName,photoFrontFilePath);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import com.jepsoninfo.resp.DcsCallBackReg;
|
||||||
|
import com.jepsoninfo.util.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class ThreadOpenDoor extends Thread{
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadReportDevice.class");
|
||||||
|
private HardService hardService;
|
||||||
|
private String prefix;
|
||||||
|
private String cmd;
|
||||||
|
private String jsonReq;
|
||||||
|
private String carNo;
|
||||||
|
private String devNo;
|
||||||
|
private String laneName;
|
||||||
|
private String optName = "车牌识别";
|
||||||
|
|
||||||
|
public ThreadOpenDoor(HardService hardService,String cmd, String prefix, String jsonReq, String optName, String carNo, String devNo, String laneName){
|
||||||
|
this.hardService = hardService;
|
||||||
|
this.optName = optName;
|
||||||
|
this.cmd = cmd;
|
||||||
|
this.prefix = prefix;
|
||||||
|
this.jsonReq = jsonReq;
|
||||||
|
this.carNo = carNo;
|
||||||
|
this.devNo = devNo;
|
||||||
|
this.laneName = laneName;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
hardService.printDate(carNo,devNo,laneName,optName,"open door thread");
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
hardService.printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
int pos = line.indexOf(prefix);
|
||||||
|
if(pos >= 0){
|
||||||
|
String devRet = line.substring(prefix.length());
|
||||||
|
//printDate(carNo,devNo,laneName,optName,devRet);
|
||||||
|
try {
|
||||||
|
DcsCallBackReg openDoorRet = new DcsCallBackReg();
|
||||||
|
DeviceRet deviceRet = JSONObject.parseObject(devRet, DeviceRet.class);
|
||||||
|
ReturnCode returnCode = new ReturnCode();
|
||||||
|
|
||||||
|
if(deviceRet != null) {
|
||||||
|
if ((deviceRet.getState_code() != null && deviceRet.getState_code().compareTo("200") == 0)
|
||||||
|
|| (deviceRet.getCode() != null && deviceRet.getCode().compareTo("200") == 0)) {
|
||||||
|
//设置下发开闸指令状态为已下发
|
||||||
|
ConstUtil.DOOR_STATUS.put(devNo,ConstUtil.IS_SEND_OPEN_DOOR);
|
||||||
|
|
||||||
|
returnCode.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
returnCode.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
String strReturnCode = JSONObject.toJSONString(returnCode);
|
||||||
|
openDoorRet.setParams(jsonReq);
|
||||||
|
openDoorRet.setResult(strReturnCode);
|
||||||
|
|
||||||
|
String strReport = JSONObject.toJSONString(openDoorRet);
|
||||||
|
|
||||||
|
String strRet = HttpClientUtil.postJson(ConstUtil.REPORT_SERVER + ConstUtil.DCS_CALLBACK, strReport);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import com.jepsoninfo.resp.DcsCallBackReg;
|
||||||
|
import com.jepsoninfo.util.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class ThreadPlayVoice extends Thread{
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadReportDevice.class");
|
||||||
|
private HardService hardService;
|
||||||
|
private String prefix;
|
||||||
|
private String cmd;
|
||||||
|
private String jsonReq;
|
||||||
|
private String carNo;
|
||||||
|
private String devNo;
|
||||||
|
private String laneName;
|
||||||
|
private String optName = "车牌识别";
|
||||||
|
|
||||||
|
public ThreadPlayVoice(HardService hardService,String cmd, String prefix, String jsonReq, String optName, String carNo, String devNo, String laneName){
|
||||||
|
this.hardService = hardService;
|
||||||
|
this.optName = optName;
|
||||||
|
this.cmd = cmd;
|
||||||
|
this.prefix = prefix;
|
||||||
|
this.jsonReq = jsonReq;
|
||||||
|
this.carNo = carNo;
|
||||||
|
this.devNo = devNo;
|
||||||
|
this.laneName = laneName;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
CmdUtil cmdUtil = new CmdUtil();
|
||||||
|
List<String> listRet = cmdUtil.exec(cmd);
|
||||||
|
String line;
|
||||||
|
for (int i = 0;i < listRet.size();i++) {
|
||||||
|
line = listRet.get(i);
|
||||||
|
hardService.printDate(carNo,devNo,laneName,optName,line);
|
||||||
|
int pos = line.indexOf(prefix);
|
||||||
|
if(pos >= 0){
|
||||||
|
String devRet = line.substring(prefix.length());
|
||||||
|
//printDate(carNo,devNo,laneName,optName,devRet);
|
||||||
|
try {
|
||||||
|
DcsCallBackReg openDoorRet = new DcsCallBackReg();
|
||||||
|
DeviceRet deviceRet = JSONObject.parseObject(devRet, DeviceRet.class);
|
||||||
|
ReturnCode returnCode = new ReturnCode();
|
||||||
|
|
||||||
|
if(deviceRet != null) {
|
||||||
|
if ((deviceRet.getState_code() != null && deviceRet.getState_code().compareTo("200") == 0)
|
||||||
|
|| (deviceRet.getCode() != null && deviceRet.getCode().compareTo("200") == 0)) {
|
||||||
|
returnCode.setCode(ConstUtil.CODE_SUCCESS[0]);
|
||||||
|
returnCode.setMsg(ConstUtil.CODE_SUCCESS[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
String strReturnCode = JSONObject.toJSONString(returnCode);
|
||||||
|
openDoorRet.setParams(jsonReq);
|
||||||
|
openDoorRet.setResult(strReturnCode);
|
||||||
|
|
||||||
|
String strReport = JSONObject.toJSONString(openDoorRet);
|
||||||
|
|
||||||
|
String strRet = HttpClientUtil.postJson(ConstUtil.REPORT_SERVER + ConstUtil.DCS_CALLBACK, strReport);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
package com.jepsoninfo.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jepsoninfo.req.*;
|
||||||
|
import com.jepsoninfo.util.ConstUtil;
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
public class ThreadRecvCmdMqtt extends Thread{
|
||||||
|
private HardService hardService;
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("ThreadRecvCmdMqtt.class");
|
||||||
|
|
||||||
|
public ThreadRecvCmdMqtt(HardService hardService){
|
||||||
|
this.hardService = hardService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
logger.info("ThreadRecvCmdMqtt init");
|
||||||
|
|
||||||
|
String[] CONNECT_TOPIC_ARRAY = {
|
||||||
|
ConstUtil.MQTT_TOPIC + "display",
|
||||||
|
ConstUtil.MQTT_TOPIC + "voice",
|
||||||
|
ConstUtil.MQTT_TOPIC + "barrier",
|
||||||
|
ConstUtil.MQTT_TOPIC + "discern"};
|
||||||
|
try {
|
||||||
|
hardService.recvClient = new MqttClient(ConstUtil.MQTT_BROKER, ConstUtil.MQTT_CLIENTID, new MemoryPersistence());
|
||||||
|
MqttClient client = hardService.recvClient;
|
||||||
|
|
||||||
|
logger.info("ThreadRecvCmdMqtt start connect");
|
||||||
|
//连接服务器
|
||||||
|
MqttConnectOptions options = new MqttConnectOptions();
|
||||||
|
options.setConnectionTimeout(10);
|
||||||
|
options.setUserName(ConstUtil.MQTT_USER_NAME);
|
||||||
|
options.setPassword(ConstUtil.MQTT_PASSWORD.toCharArray());
|
||||||
|
client.connect(options);
|
||||||
|
logger.info("ThreadRecvCmdMqtt connect success");
|
||||||
|
//订阅主题
|
||||||
|
int[] qos = new int[CONNECT_TOPIC_ARRAY.length];
|
||||||
|
|
||||||
|
for (int i = 0; i < qos.length; ++i) {
|
||||||
|
qos[i] = 0;
|
||||||
|
}
|
||||||
|
client.subscribe(CONNECT_TOPIC_ARRAY, qos);
|
||||||
|
client.setCallback(new MqttCallback() {
|
||||||
|
@Override
|
||||||
|
public void connectionLost(Throwable e) {
|
||||||
|
logger.info("ThreadRecvCmdMqtt connect lost");
|
||||||
|
ThreadRecvCmdMqtt thread = new ThreadRecvCmdMqtt(hardService);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void messageArrived(String topic, MqttMessage message) {
|
||||||
|
int nRet = 0;
|
||||||
|
String strMsg = new String(message.getPayload(), StandardCharsets.UTF_8);
|
||||||
|
JSONObject json = JSONObject.parseObject(strMsg);
|
||||||
|
|
||||||
|
logger.info("ThreadRecvCmdMqtt topic is " + topic);
|
||||||
|
logger.info("ThreadRecvCmdMqtt msg is " + strMsg);
|
||||||
|
|
||||||
|
String cmd = topic.replace(ConstUtil.MQTT_TOPIC,"");
|
||||||
|
|
||||||
|
switch (cmd){
|
||||||
|
case "display":{
|
||||||
|
DisplayInfoReq displayInfoReq = JSONObject.toJavaObject(json, DisplayInfoReq.class);
|
||||||
|
//nRet = hardService.displayInfo(displayInfoReq);
|
||||||
|
nRet = hardService.mqttDisplayInfo(displayInfoReq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "voice": {
|
||||||
|
PlayVoiceReq playVoice = JSONObject.toJavaObject(json, PlayVoiceReq.class);
|
||||||
|
nRet = hardService.playVoice(playVoice);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "barrier": {
|
||||||
|
DoorReq doorReq = JSONObject.toJavaObject(json, DoorReq.class);
|
||||||
|
//nRet = hardService.openDoor(doorReq);
|
||||||
|
nRet = hardService.mqttOpenDoor(doorReq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "resetDevTime": {
|
||||||
|
TimeReq timeReq = JSONObject.toJavaObject(json, TimeReq.class);
|
||||||
|
hardService.resetDevTime(timeReq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "discern": {
|
||||||
|
ManualPlateRecognizeReq manualPlateRecognizeReq = JSONObject.toJavaObject(json, ManualPlateRecognizeReq.class);
|
||||||
|
RecognizeAlarmInfoPlate recognizeAlarmInfoPlate = new RecognizeAlarmInfoPlate();
|
||||||
|
ClassAlarmInfoPlate alarmInfoPlate = new ClassAlarmInfoPlate();
|
||||||
|
AlarmInfoPlateResult result = new AlarmInfoPlateResult();
|
||||||
|
alarmInfoPlate.setResult(result);
|
||||||
|
AlarmInfoPlateResultPlateResult PlateResult = new AlarmInfoPlateResultPlateResult();
|
||||||
|
PlateResult.setTelephone(manualPlateRecognizeReq.getTelephone());
|
||||||
|
result.setPlateResult(PlateResult);
|
||||||
|
|
||||||
|
alarmInfoPlate.setSerialno(manualPlateRecognizeReq.getDeviceNo());
|
||||||
|
recognizeAlarmInfoPlate.setAlarmInfoPlate(alarmInfoPlate);
|
||||||
|
nRet = hardService.manualPlateRecognize(recognizeAlarmInfoPlate,manualPlateRecognizeReq.getOrder_no());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "manualTrigger": {
|
||||||
|
DoorReq triggerReq = JSONObject.toJavaObject(json, DoorReq.class);
|
||||||
|
nRet = hardService.manualTrigger(triggerReq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||||
|
System.out.println("ThreadRecvCmdMqtt deliveryComplete---------" + token.isComplete());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch (MqttException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
try {
|
||||||
|
Thread.sleep(10000);
|
||||||
|
}catch (Exception e1){
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadRecvCmdMqtt thread = new ThreadRecvCmdMqtt(hardService);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.LineNumberReader;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CmdUtil {
|
||||||
|
private final Logger logger = LoggerFactory.getLogger("CmdUtil.class");
|
||||||
|
public List<String> exec(String cmd){
|
||||||
|
List<String> strList = new ArrayList<>();
|
||||||
|
Process process = null;
|
||||||
|
InputStreamReader ir = null;
|
||||||
|
LineNumberReader input = null;
|
||||||
|
InputStreamReader errorStream = null;
|
||||||
|
LineNumberReader errorReader = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
logger.info(cmd);
|
||||||
|
process = Runtime.getRuntime().exec(cmd);
|
||||||
|
|
||||||
|
// 处理标准输出流
|
||||||
|
ir = new InputStreamReader(process.getInputStream());
|
||||||
|
input = new LineNumberReader(ir);
|
||||||
|
String line;
|
||||||
|
while ((line = input.readLine()) != null){
|
||||||
|
//line = line.replaceAll(" ","");
|
||||||
|
strList.add(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理错误输出流
|
||||||
|
errorStream = new InputStreamReader(process.getErrorStream());
|
||||||
|
errorReader = new LineNumberReader(errorStream);
|
||||||
|
String errorLine;
|
||||||
|
while ((errorLine = errorReader.readLine()) != null) {
|
||||||
|
// 可以选择处理错误信息,或者直接打印出来
|
||||||
|
System.out.println("Error output: " + errorLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 等待命令执行结束
|
||||||
|
process.waitFor();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
// 关闭输入流和错误流
|
||||||
|
if (input != null) {
|
||||||
|
input.close();
|
||||||
|
}
|
||||||
|
if (ir != null) {
|
||||||
|
ir.close();
|
||||||
|
}
|
||||||
|
if (errorReader != null) {
|
||||||
|
errorReader.close();
|
||||||
|
}
|
||||||
|
if (errorStream != null) {
|
||||||
|
errorStream.close();
|
||||||
|
}
|
||||||
|
// 销毁进程
|
||||||
|
if (process != null) {
|
||||||
|
process.destroy();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return strList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import com.jepsoninfo.entity.LogEntity;
|
||||||
|
|
||||||
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.Deque;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ConstUtil {
|
||||||
|
public static String REPORT_SERVER = "";
|
||||||
|
public static String REPORT_SERVER_URL = "";
|
||||||
|
public static String REPORT_PASS_SERVER_URL = "";
|
||||||
|
public static String DCS_CALLBACK = "";
|
||||||
|
public static Integer RAND_COLOR_255 = 255;
|
||||||
|
|
||||||
|
public static String MQTT_TOPIC = "";
|
||||||
|
public static String MQTT_BROKER = "";
|
||||||
|
public static String MQTT_USER_NAME = "";
|
||||||
|
public static String MQTT_PASSWORD = "";
|
||||||
|
public static String MQTT_CLIENTID = "";
|
||||||
|
|
||||||
|
public static String MQTT_DEVICE_TOPIC = "";
|
||||||
|
public static String MQTT_DEVICE_BROKER = "";
|
||||||
|
public static String MQTT_DEVICE_USER_NAME = "";
|
||||||
|
public static String MQTT_DEVICE_PASSWORD = "";
|
||||||
|
public static String MQTT_DEVICE_CLIENTID = "";
|
||||||
|
public static String MQTT_DEVICE_TYPE = "";
|
||||||
|
|
||||||
|
public static String HANDLER_URL = "";
|
||||||
|
public static String LOCAL_PATH = "";
|
||||||
|
public static String IPBOX_MEDIA_SERVER = "";
|
||||||
|
public static String IPBOX_MEDIA_PREFIX = "";
|
||||||
|
public static String OSS_BUCKET = "";
|
||||||
|
public static String OSS_SECRET_ID = "";
|
||||||
|
public static String OSS_SECRET_KEY = "";
|
||||||
|
public static String OSS_ENDPOINT = "";
|
||||||
|
public static String CMD_PATH = "";
|
||||||
|
|
||||||
|
public static Deque<LogEntity> deque = new ArrayDeque<>();
|
||||||
|
|
||||||
|
public static String COMPANY_NO = "";
|
||||||
|
|
||||||
|
public static String COMPANY_NAME = "";
|
||||||
|
|
||||||
|
public static String LOG_SERVER_URL = "";
|
||||||
|
|
||||||
|
public static String DEFAULT_ADVERT_1 = "";
|
||||||
|
|
||||||
|
public static String DEFAULT_ADVERT_2 = "";
|
||||||
|
|
||||||
|
public static Map<String,Integer> DOOR_STATUS = new HashMap<>();
|
||||||
|
|
||||||
|
public static int IS_NOT_SEND_OPEN_DOOR = 0;
|
||||||
|
|
||||||
|
public static int IS_SEND_OPEN_DOOR = 1;
|
||||||
|
|
||||||
|
public static int DOOR_STATUS_CLOSEED = 1;
|
||||||
|
|
||||||
|
//成功
|
||||||
|
public static String[] CODE_SUCCESS = {"0","成功"};
|
||||||
|
//失败
|
||||||
|
public static String[] CODE_FAILURE = {"1","失败"};
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceRet {
|
||||||
|
private String cmd;
|
||||||
|
private String error_msg;
|
||||||
|
private String id;
|
||||||
|
private String state_code;
|
||||||
|
private String code;
|
||||||
|
private String message;
|
||||||
|
}
|
|
@ -0,0 +1,133 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ranmc
|
||||||
|
* @date 2019/4/18
|
||||||
|
*/
|
||||||
|
public enum ErrorStatus {
|
||||||
|
|
||||||
|
SUCCESS(0, "SUCCESS"),
|
||||||
|
PARAMETER_ERROR(3000, "参数错误"),
|
||||||
|
|
||||||
|
PARAMETER_NOT_EXISTS(3001, "参数缺失"),
|
||||||
|
|
||||||
|
PARAMETER_FORMAT_ERROR(3002, "参数格式不正确"),
|
||||||
|
|
||||||
|
NON_SUPPORT_SIGN_TYPE(3003, "不支持的签名方式"),
|
||||||
|
|
||||||
|
SIGN_ERROR(3004, "签名效验失败"),
|
||||||
|
|
||||||
|
NOT_PERMISSIONS(3005, "没有调用权限"),
|
||||||
|
|
||||||
|
SAVE_DATA_ERROR(3006, "保存数据失败"),
|
||||||
|
|
||||||
|
UPDATE_DATA_ERROR(3007, "修改数据失败"),
|
||||||
|
|
||||||
|
DELETE_DATA_ERROR(3008, "删除数据失败"),
|
||||||
|
|
||||||
|
DATA_IS_EXISTS(3009, "数据已存在"),
|
||||||
|
|
||||||
|
PLATFORM_NOT_EXISTS(3010, "平台不存在"),
|
||||||
|
|
||||||
|
PLATFORM_IS_DISABLED(3011, "平台不可用"),
|
||||||
|
|
||||||
|
COMPANY_NOT_EXISTS(3012, "公司不存在"),
|
||||||
|
|
||||||
|
COMPANY_IS_DISABLED(3013, "公司状态不可用"),
|
||||||
|
|
||||||
|
CONTRACT_IS_FINISH(3014, "合同已签署"),
|
||||||
|
|
||||||
|
TEMPLATE_IS_DISABLED(3015, "模板不可用"),
|
||||||
|
|
||||||
|
SEAL_IS_DISABLED(3016, "图章不可用"),
|
||||||
|
|
||||||
|
USER_IS_DISABLED(3017, "账户不可用"),
|
||||||
|
|
||||||
|
USER_NOT_EXISTS(3018, "用户不存在"),
|
||||||
|
|
||||||
|
USER_NOT_AUTH(3019, "用户未认证"),
|
||||||
|
|
||||||
|
SMS_CODE_ERROR(3020, "验证码错误"),
|
||||||
|
|
||||||
|
SMS_SEND_ERROR(3021, "验证码发送失败"),
|
||||||
|
|
||||||
|
DATA_NOT_EXISTS(3022, "数据不存在"),
|
||||||
|
|
||||||
|
BALANCE_NOT_ENOUFY(3023, "余额不足"),
|
||||||
|
|
||||||
|
ID_CARD_EXIST(3024, "身份证信息已存在"),
|
||||||
|
|
||||||
|
ORDER_ID_REPREAT(3025, "订单号重复"),
|
||||||
|
|
||||||
|
BALANCE_NOT_EXISTS(3026, "计费账户不存在"),
|
||||||
|
|
||||||
|
CONTRACT_BEING_SIGNED(3027, "其他人正在签署该合同"),
|
||||||
|
|
||||||
|
SEAL_NOT_EXITS(3028, "图章或签名不存在"),
|
||||||
|
|
||||||
|
CONTRACT_NOT_EXITS(3029, "合同不存在"),
|
||||||
|
|
||||||
|
CONTRACT_BEEN_REFUSED(3030, "合同被拒签"),
|
||||||
|
|
||||||
|
CONTRACT_NOT_REFUSED(3031, "合同不能被拒签"),
|
||||||
|
|
||||||
|
SHORT_CODE_NOT_EXIST(3032, "短码信息不存在"),
|
||||||
|
|
||||||
|
APP_NOT_EXIST(3033, "app信息不存在"),
|
||||||
|
|
||||||
|
USER_IS_EXISTED(3034, "该用户已存在"),
|
||||||
|
|
||||||
|
TEMPLATE_NOT_EXIST(3035, "模板不存在"),
|
||||||
|
|
||||||
|
SIGN_POSITION_NOT_SET(3036, "签署位置未设置"),
|
||||||
|
|
||||||
|
CONTRACT_NOT_FINISH_SIGN(3037, "合同未签署完成"),
|
||||||
|
|
||||||
|
USER_NOT_ALLOW_MODIFY(3038, "用户信息不能修改"),
|
||||||
|
|
||||||
|
SIGN_POS_NOT_FIND(3039, "未找到指定的签署位置标识符"),
|
||||||
|
|
||||||
|
COMPANY_EXISTS(3040, "公司已存在"),
|
||||||
|
|
||||||
|
ACCOUNT_EXISTS(3041, "手机号已存在"),
|
||||||
|
|
||||||
|
ID_CARD_EXISTS(3042, "身份证号已存在"),
|
||||||
|
|
||||||
|
PASSWORD_ERROR(3043, "密码错误"),
|
||||||
|
|
||||||
|
ACCOUNT_ALREADY_AUDIT(3044, "账号已审核"),
|
||||||
|
|
||||||
|
TOKEN_ERROR(4000, "令牌无效"),
|
||||||
|
PERMISS_NOT_ENOUFY(4001, "您没有该权限,请联系管理员"),
|
||||||
|
|
||||||
|
INVALID_FILE_FORMAT(4010, "无效的文件格式"),
|
||||||
|
BUSINESS_ERROR(4011,"合同校验失败,请确认文件是否正确"),
|
||||||
|
/**
|
||||||
|
* 服务器异常
|
||||||
|
*/
|
||||||
|
APPLY_CA_CERT_FAIL(4999, "申请证书失败,请联系管理员"),
|
||||||
|
|
||||||
|
SERVER_ERROR(5000, "服务器繁忙,请稍后再试...");
|
||||||
|
/**
|
||||||
|
* 错误码
|
||||||
|
*/
|
||||||
|
private Integer errCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误信息
|
||||||
|
*/
|
||||||
|
private String errMsg;
|
||||||
|
|
||||||
|
ErrorStatus(Integer errCode, String errMsg) {
|
||||||
|
this.errCode = errCode;
|
||||||
|
this.errMsg = errMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getErrCode() {
|
||||||
|
return errCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrMsg() {
|
||||||
|
return errMsg;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,152 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import org.apache.http.client.ClientProtocolException;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Classname HttpClient
|
||||||
|
* @Description No bug
|
||||||
|
* @Date 2020/4/7 15:06
|
||||||
|
* @Created by YUNMW
|
||||||
|
*/
|
||||||
|
public class HttpClientUtil {
|
||||||
|
private static Logger logger = LoggerFactory.getLogger("HttpClientUtil.class");
|
||||||
|
|
||||||
|
public static String postJson(String url, String json) {
|
||||||
|
HttpClient httpclient = HttpClients.createDefault();
|
||||||
|
HttpPost httppost = new HttpPost(url);
|
||||||
|
String strResult = null;
|
||||||
|
try {
|
||||||
|
StringEntity reqEntity = new StringEntity(json, "UTF-8");
|
||||||
|
httppost.setEntity(reqEntity);
|
||||||
|
httppost.addHeader("Content-type", "application/json; charset=utf-8");
|
||||||
|
HttpResponse response = httpclient.execute(httppost);
|
||||||
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
|
strResult = EntityUtils.toString(response.getEntity());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info(e.toString());
|
||||||
|
strResult = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return strResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String postMap(String url, Map<String, String> paramMap, String encode) {
|
||||||
|
HttpClient httpclient = SslUtil.SslHttpClientBuild();
|
||||||
|
HttpPost httppost = new HttpPost(url);
|
||||||
|
String strResult = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
|
||||||
|
|
||||||
|
Set<Map.Entry<String, String>> set = paramMap.entrySet();
|
||||||
|
Iterator<Map.Entry<String, String>> iter = set.iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
Map.Entry<String, String> entry = iter.next();
|
||||||
|
nameValuePairs.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
|
||||||
|
}
|
||||||
|
if (paramMap.get("contentType") != null) {
|
||||||
|
httppost.addHeader("Content-type", paramMap.get("contentType"));
|
||||||
|
} else {
|
||||||
|
httppost.addHeader("Content-type", "application/x-www-form-urlencoded");
|
||||||
|
}
|
||||||
|
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, encode));
|
||||||
|
HttpResponse response = httpclient.execute(httppost);
|
||||||
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
|
strResult = EntityUtils.toString(response.getEntity());
|
||||||
|
}
|
||||||
|
} catch (ClientProtocolException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return strResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String postFormData(String strUrl,String filename){
|
||||||
|
String res = "";
|
||||||
|
HttpURLConnection conn = null;
|
||||||
|
String BOUNDARY = "---------------------------" + RandomUtil.getRandomUuid(); //boundary就是request头和上传文件内容的分隔符
|
||||||
|
try {
|
||||||
|
URL url = new URL(strUrl);
|
||||||
|
conn = (HttpURLConnection) url.openConnection();
|
||||||
|
conn.setConnectTimeout(5000);
|
||||||
|
conn.setReadTimeout(30000);
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
conn.setDoInput(true);
|
||||||
|
conn.setUseCaches(false);
|
||||||
|
conn.setRequestMethod("POST");
|
||||||
|
conn.setRequestProperty("Connection", "Keep-Alive");
|
||||||
|
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.6)");
|
||||||
|
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
|
||||||
|
|
||||||
|
OutputStream out = new DataOutputStream(conn.getOutputStream());
|
||||||
|
|
||||||
|
// file
|
||||||
|
File file = new File(filename);
|
||||||
|
|
||||||
|
StringBuffer sendStrBuf = new StringBuffer();
|
||||||
|
sendStrBuf.append("\r\n").append("--").append(BOUNDARY).append("\r\n");
|
||||||
|
sendStrBuf.append("Content-Disposition: form-data; name=\"file\"; filename=\"" + filename + "\"\r\n");
|
||||||
|
sendStrBuf.append("Content-Type:application/octet-stream\r\n\r\n");
|
||||||
|
|
||||||
|
out.write(sendStrBuf.toString().getBytes());
|
||||||
|
|
||||||
|
DataInputStream in = new DataInputStream(new FileInputStream(file));
|
||||||
|
int bytes = 0;
|
||||||
|
byte[] bufferOut = new byte[1024];
|
||||||
|
while ((bytes = in.read(bufferOut)) != -1) {
|
||||||
|
out.write(bufferOut, 0, bytes);
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
|
||||||
|
byte[] endData = ("\r\n--" + BOUNDARY + "--\r\n").getBytes();
|
||||||
|
out.write(endData);
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
|
||||||
|
// 读取返回数据
|
||||||
|
StringBuffer recvStrBuf = new StringBuffer();
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||||
|
String line = null;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
recvStrBuf.append(line).append("\n");
|
||||||
|
}
|
||||||
|
res = recvStrBuf.toString();
|
||||||
|
logger.info("上传数据返回:" + res);
|
||||||
|
reader.close();
|
||||||
|
reader = null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.info("上传数据超时:" + res);
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (conn != null) {
|
||||||
|
conn.disconnect();
|
||||||
|
conn = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
public class ImageUtil {
|
||||||
|
public static boolean generateImage(String base64, String savePath) {
|
||||||
|
// 解密
|
||||||
|
byte[] buffer = Base64.getDecoder().decode(base64); //将base64字符串转为字节
|
||||||
|
FileOutputStream out = null; //创建一个FileOutputStream对象
|
||||||
|
try{
|
||||||
|
out = new FileOutputStream(savePath); //向文件中写入数据
|
||||||
|
out.write(buffer); //将字节数据写入到文件中
|
||||||
|
}catch (Exception e){
|
||||||
|
System.out.printf("生成图片失败");
|
||||||
|
return false;
|
||||||
|
}finally {
|
||||||
|
if(null != out){
|
||||||
|
try {
|
||||||
|
out.close();
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 返回图片的相对路径 = 图片分类路径+图片名+图片后缀
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
public class Md5Util {
|
||||||
|
private static final String[] HEX_DIGITS = { "0", "1", "2", "3", "4", "5",
|
||||||
|
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
|
||||||
|
public static String encode(String str){
|
||||||
|
String newstr = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
MessageDigest md5;
|
||||||
|
|
||||||
|
md5 = MessageDigest.getInstance("MD5");
|
||||||
|
|
||||||
|
//加密后的字符串
|
||||||
|
newstr = bytesToHex(md5.digest(str.getBytes("utf-8")));
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return newstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 二进制转十六进制
|
||||||
|
public static String bytesToHex(byte[] bytes) {
|
||||||
|
StringBuffer hexStr = new StringBuffer();
|
||||||
|
int num;
|
||||||
|
for (int i = 0; i < bytes.length; i++) {
|
||||||
|
num = bytes[i];
|
||||||
|
if(num < 0) {
|
||||||
|
num += 256;
|
||||||
|
}
|
||||||
|
if(num < 16){
|
||||||
|
hexStr.append("0");
|
||||||
|
}
|
||||||
|
hexStr.append(Integer.toHexString(num));
|
||||||
|
}
|
||||||
|
return hexStr.toString().toUpperCase();
|
||||||
|
}
|
||||||
|
private static String byteArrayToHexString(byte b[]) {
|
||||||
|
StringBuffer resultSb = new StringBuffer();
|
||||||
|
for (int i = 0; i < b.length; i++){
|
||||||
|
resultSb.append(byteToHexString(b[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultSb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String byteToHexString(byte b) {
|
||||||
|
int n = b;
|
||||||
|
if (n < 0){
|
||||||
|
n += 256;
|
||||||
|
}
|
||||||
|
|
||||||
|
int d1 = n / 16;
|
||||||
|
int d2 = n % 16;
|
||||||
|
return HEX_DIGITS[d1] + HEX_DIGITS[d2];
|
||||||
|
}
|
||||||
|
public static String md5Encode(String origin, String charsetname) {
|
||||||
|
String resultString = null;
|
||||||
|
try {
|
||||||
|
resultString = new String(origin);
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
if (charsetname == null || "".equals(charsetname)){
|
||||||
|
resultString = byteArrayToHexString(md.digest(resultString
|
||||||
|
.getBytes()));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
resultString = byteArrayToHexString(md.digest(resultString
|
||||||
|
.getBytes(charsetname)));
|
||||||
|
}
|
||||||
|
} catch (Exception exception) {
|
||||||
|
}
|
||||||
|
return resultString;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
|
||||||
|
public class MqttUtil {
|
||||||
|
public MqttClient client = null;
|
||||||
|
public void Connect(String broker,String username,String password,String clientid){
|
||||||
|
try {
|
||||||
|
client = new MqttClient(broker, clientid, new MemoryPersistence());
|
||||||
|
MqttConnectOptions options = new MqttConnectOptions();
|
||||||
|
options.setUserName(username);
|
||||||
|
options.setPassword(password.toCharArray());
|
||||||
|
options.setAutomaticReconnect(true);
|
||||||
|
client.connect(options);
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Subscribe(String[] sub){
|
||||||
|
try {
|
||||||
|
int[] qos = new int[sub.length];
|
||||||
|
|
||||||
|
for(int i = 0; i < qos.length; ++i) {
|
||||||
|
qos[i] = 0;
|
||||||
|
}
|
||||||
|
client.subscribe(sub,qos);
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Subscribe(String sub,int qos){
|
||||||
|
try {
|
||||||
|
client.subscribe(sub,qos);
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Send(String topic,MqttMessage message){
|
||||||
|
try {
|
||||||
|
client.publish(topic,message);
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReConnect(){
|
||||||
|
try {
|
||||||
|
if(client != null && client.isConnected() == false) {
|
||||||
|
client.reconnect();
|
||||||
|
}
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close(){
|
||||||
|
try {
|
||||||
|
client.close();
|
||||||
|
}catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ranmc
|
||||||
|
* @date 2019/4/23
|
||||||
|
*/
|
||||||
|
public class MyException extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误码
|
||||||
|
*/
|
||||||
|
private Integer errCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误原因
|
||||||
|
*/
|
||||||
|
private String errMsg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getErrCode() {
|
||||||
|
return errCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrMsg() {
|
||||||
|
return errMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MyException(ErrorStatus errorStatus) {
|
||||||
|
super(errorStatus.getErrMsg());
|
||||||
|
this.errCode = errorStatus.getErrCode();
|
||||||
|
this.errMsg = errorStatus.getErrMsg();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyException(Integer errCode, String errMsg) {
|
||||||
|
this.errCode = errCode;
|
||||||
|
this.errMsg = errMsg;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
public class NetUtils {
|
||||||
|
public static String getClientIp() {
|
||||||
|
printHttpHeader(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
|
if (((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
|
||||||
|
.getHeader("x-forwarded-for") == null) {
|
||||||
|
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
|
||||||
|
.getRemoteAddr();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
|
||||||
|
.getHeader("x-forwarded-for");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUserAgent() {
|
||||||
|
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
|
||||||
|
.getHeader("user-agent");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取编码字符集
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static String getCharEncoding(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
|
if (null == request || null == response) {
|
||||||
|
return "gbk";
|
||||||
|
}
|
||||||
|
|
||||||
|
String enc = request.getCharacterEncoding();
|
||||||
|
if (null == enc || "".equals(enc)) {
|
||||||
|
enc = response.getCharacterEncoding();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null == enc || "".equals(enc)) {
|
||||||
|
enc = "gbk";
|
||||||
|
}
|
||||||
|
|
||||||
|
return enc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printHttpHeader(HttpServletRequest request) {
|
||||||
|
Enumeration<String> headerNames = request.getHeaderNames();
|
||||||
|
while(headerNames.hasMoreElements()) {//判断是否还有下一个元素
|
||||||
|
String nextElement = headerNames.nextElement();//获取headerNames集合中的请求头
|
||||||
|
String header2 = request.getHeader(nextElement);//通过请求头得到请求内容
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,139 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
public class RandomUtil {
|
||||||
|
private String randString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
private int width = 95;
|
||||||
|
private int height = 25;
|
||||||
|
//private int lineSize = 40;
|
||||||
|
private int stringNum = 4;
|
||||||
|
|
||||||
|
private Random random = new Random();
|
||||||
|
|
||||||
|
private Font getFont() {
|
||||||
|
return new Font("Fixedsys", Font.CENTER_BASELINE, 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color getRandColor(int fc, int bc) {
|
||||||
|
if (fc > ConstUtil.RAND_COLOR_255) {
|
||||||
|
fc = ConstUtil.RAND_COLOR_255;
|
||||||
|
}
|
||||||
|
if (bc > ConstUtil.RAND_COLOR_255) {
|
||||||
|
bc = ConstUtil.RAND_COLOR_255;
|
||||||
|
}
|
||||||
|
int r = fc + random.nextInt(bc - fc - 16);
|
||||||
|
int g = fc + random.nextInt(bc - fc - 14);
|
||||||
|
int b = fc + random.nextInt(bc - fc - 18);
|
||||||
|
return new Color(r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRandcode(HttpServletResponse response) {
|
||||||
|
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
|
||||||
|
Graphics g = image.getGraphics();
|
||||||
|
g.fillRect(0, 0, width, height);
|
||||||
|
g.setFont(new Font("Times New Roman", Font.ROMAN_BASELINE, 18));
|
||||||
|
g.setColor(getRandColor(110, 133));
|
||||||
|
|
||||||
|
String randomString = "";
|
||||||
|
for (int i = 1; i <= stringNum; i++) {
|
||||||
|
randomString = drowString(g, randomString, i);
|
||||||
|
}
|
||||||
|
g.dispose();
|
||||||
|
try {
|
||||||
|
ImageIO.write(image, "JPEG", response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return randomString;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String drowString(Graphics g, String randomString, int i) {
|
||||||
|
g.setFont(getFont());
|
||||||
|
g.setColor(new Color(random.nextInt(101), random.nextInt(111), random.nextInt(121)));
|
||||||
|
String rand = String.valueOf(randString.charAt(random.nextInt(randString.length())));
|
||||||
|
randomString += rand;
|
||||||
|
g.translate(random.nextInt(3), random.nextInt(3));
|
||||||
|
g.drawString(rand, 13 * i, 16);
|
||||||
|
return randomString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRandomUuid() {
|
||||||
|
String uuid = UUID.randomUUID().toString();
|
||||||
|
return StringUtils.remove(uuid, "-");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRandomStr(int length) {
|
||||||
|
String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
Random random = new Random();
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
int number = random.nextInt(base.length());
|
||||||
|
sb.append(base.charAt(number));
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRandomNum(int length) {
|
||||||
|
String base = "0123456789";
|
||||||
|
Random random = new Random();
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
int number = random.nextInt(base.length());
|
||||||
|
sb.append(base.charAt(number));
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRandomString(int length) {
|
||||||
|
String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*";
|
||||||
|
Random random = new Random();
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
int number = random.nextInt(base.length());
|
||||||
|
sb.append(base.charAt(number));
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRandomNonce(int length) {
|
||||||
|
String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
Random random = new Random();
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
int number = random.nextInt(base.length());
|
||||||
|
sb.append(base.charAt(number));
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int[] getRandomArray(int n){
|
||||||
|
int[] x = new int[n];
|
||||||
|
|
||||||
|
for(int i = 0; i < n; i++){
|
||||||
|
x[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
Random r = new Random();
|
||||||
|
for(int i = 0; i < n; i++){
|
||||||
|
int in = r.nextInt(n - i) + i;
|
||||||
|
int t = x[in];
|
||||||
|
|
||||||
|
x[in] = x[i];
|
||||||
|
x[i] = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author w
|
||||||
|
* @date 2019/4/23
|
||||||
|
* 返回基础数据
|
||||||
|
*/
|
||||||
|
public class ResultEntity<T> {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public static <T> ResultEntity<T> success(){
|
||||||
|
return new ResultEntity<T>()
|
||||||
|
.setCode(ErrorStatus.SUCCESS.getErrCode())
|
||||||
|
.setMsg(ErrorStatus.SUCCESS.getErrMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ResultEntity<T> success(T data){
|
||||||
|
return new ResultEntity<T>()
|
||||||
|
.setCode(ErrorStatus.SUCCESS.getErrCode())
|
||||||
|
.setMsg(ErrorStatus.SUCCESS.getErrMsg())
|
||||||
|
.setData(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ResultEntity<T> fail(ErrorStatus errorStatus) {
|
||||||
|
return new ResultEntity<T>()
|
||||||
|
.setCode(errorStatus.getErrCode())
|
||||||
|
.setMsg(errorStatus.getErrMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ResultEntity<T> fail(Integer errCode, String errMsg){
|
||||||
|
return new ResultEntity<T>()
|
||||||
|
.setCode(errCode)
|
||||||
|
.setMsg(errMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ResultEntity<T> fail(Integer errCode, String errMsg,T data){
|
||||||
|
return new ResultEntity<T>()
|
||||||
|
.setCode(errCode)
|
||||||
|
.setMsg(errMsg)
|
||||||
|
.setData(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultEntity<T> setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultEntity<T> setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultEntity<T> setData(T data) {
|
||||||
|
this.data = data;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReturnCode {
|
||||||
|
private String code = ConstUtil.CODE_FAILURE[0];
|
||||||
|
private String msg = ConstUtil.CODE_FAILURE[1];
|
||||||
|
private String data;
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
public class Sha256Util {
|
||||||
|
public static String encode(String str){
|
||||||
|
MessageDigest messageDigest;
|
||||||
|
String encodestr = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
messageDigest = MessageDigest.getInstance("SHA-256");
|
||||||
|
messageDigest.update(str.getBytes("UTF-8"));
|
||||||
|
encodestr = byte2Hex(messageDigest.digest());
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return encodestr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String byte2Hex(byte[] bytes){
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
String temp = null;
|
||||||
|
|
||||||
|
for (int i = 0;i < bytes.length;i++){
|
||||||
|
temp = Integer.toHexString(bytes[i] & 0xFF);
|
||||||
|
|
||||||
|
if (temp.length()==1){
|
||||||
|
//1得到一位的进行补0操作
|
||||||
|
stringBuffer.append("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
stringBuffer.append(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return stringBuffer.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import org.apache.http.config.Registry;
|
||||||
|
import org.apache.http.config.RegistryBuilder;
|
||||||
|
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
//import org.zalando.logbook.httpclient.LogbookHttpRequestInterceptor;
|
||||||
|
//import org.zalando.logbook.httpclient.LogbookHttpResponseInterceptor;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
import java.security.KeyManagementException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Classname SslUtil
|
||||||
|
* @Description No bug
|
||||||
|
* @Date 2020/2/25 14:07
|
||||||
|
* @Created by YUNMW
|
||||||
|
*/
|
||||||
|
public class SslUtil {
|
||||||
|
// @Autowired
|
||||||
|
// private static LogbookHttpRequestInterceptor logbookHttpRequestInterceptor;
|
||||||
|
// @Autowired
|
||||||
|
// private static LogbookHttpResponseInterceptor logbookHttpResponseInterceptor;
|
||||||
|
|
||||||
|
public static CloseableHttpClient SslHttpClientBuild() {
|
||||||
|
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||||
|
.register("http", PlainConnectionSocketFactory.INSTANCE).register("https",
|
||||||
|
trustAllHttpsCertificates()).build();
|
||||||
|
//创建ConnectionManager,添加Connection配置信息
|
||||||
|
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||||
|
CloseableHttpClient httpClient = HttpClients.custom()
|
||||||
|
// .addInterceptorFirst(logbookHttpRequestInterceptor)
|
||||||
|
// .addInterceptorFirst(logbookHttpResponseInterceptor)
|
||||||
|
.setConnectionManager(connectionManager).build();
|
||||||
|
return httpClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SSLConnectionSocketFactory trustAllHttpsCertificates() {
|
||||||
|
SSLConnectionSocketFactory socketFactory = null;
|
||||||
|
TrustManager[] trustAllCerts = new TrustManager[1];
|
||||||
|
TrustManager tm = new miTM();
|
||||||
|
trustAllCerts[0] = tm;
|
||||||
|
SSLContext sc = null;
|
||||||
|
try {
|
||||||
|
sc = SSLContext.getInstance("TLS");//sc = SSLContext.getInstance("TLS")
|
||||||
|
sc.init(null, trustAllCerts, null);
|
||||||
|
socketFactory = new SSLConnectionSocketFactory(sc, NoopHostnameVerifier.INSTANCE);
|
||||||
|
//HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (KeyManagementException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return socketFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class miTM implements TrustManager, X509TrustManager {
|
||||||
|
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkServerTrusted(X509Certificate[] certs, String authType) {
|
||||||
|
//don't check
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkClientTrusted(X509Certificate[] certs, String authType) {
|
||||||
|
//don't check
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
public class StringToChineseUtil {
|
||||||
|
private static final char[] digits = {'零', '一', '二', '三', '四', '五', '六', '七', '八', '九'};
|
||||||
|
|
||||||
|
public static String convert(String numberStr) {
|
||||||
|
StringBuilder chineseStr = new StringBuilder();
|
||||||
|
for (char c : numberStr.toCharArray()) {
|
||||||
|
if ('0' <= c && c <= '9') {
|
||||||
|
chineseStr.append(digits[c - '0']);
|
||||||
|
} else if ('.' == c){
|
||||||
|
chineseStr.append('点');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 非数字字符处理
|
||||||
|
chineseStr.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return chineseStr.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import com.aliyun.oss.OSS;
|
||||||
|
import com.aliyun.oss.OSSClient;
|
||||||
|
import com.aliyun.oss.OSSClientBuilder;
|
||||||
|
import com.aliyun.oss.model.PutObjectRequest;
|
||||||
|
import com.aliyun.oss.model.PutObjectResult;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class UploadToAliUtil {
|
||||||
|
private static Logger logger = LoggerFactory.getLogger("HttpClientUtil.class");
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static String uploadFile(String packageName,File file,String name,String endpoint,String bucketName,String secretId,String secretKey){
|
||||||
|
//Endpoint以杭州为例,其它Region请按实际情况填写。
|
||||||
|
//String endpoint = "oss-cn-beijing.aliyuncs.com";
|
||||||
|
//String bucketName = "aliyunosslaowu";
|
||||||
|
// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
|
||||||
|
// 创建OSSClient实例。
|
||||||
|
String url = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 创建OSSClient实例
|
||||||
|
OSS ossClient = new OSSClientBuilder().build(endpoint, secretId, secretKey);
|
||||||
|
|
||||||
|
// 创建上传请求
|
||||||
|
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, packageName+"/"+ name+"", file);
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
ossClient.putObject(putObjectRequest);
|
||||||
|
|
||||||
|
// 关闭OSSClient
|
||||||
|
ossClient.shutdown();
|
||||||
|
|
||||||
|
url = "https://" + bucketName + "." + endpoint + "/" + packageName + "/" + name;
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info(e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class VerifyCodeUtils {
|
||||||
|
private static final String VERIFY_CODES = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
private static final String NUMBER_VERIFY_CODES = "123456789";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用系统默认字符源生成验证码
|
||||||
|
* @param verifySize 验证码长度
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String generateVerifyCode(int verifySize){
|
||||||
|
return generateVerifyCode(verifySize, VERIFY_CODES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateNumberVerifyCode(int verifySize){
|
||||||
|
return generateVerifyCode(verifySize, NUMBER_VERIFY_CODES);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 使用指定源生成验证码
|
||||||
|
* @param verifySize 验证码长度
|
||||||
|
* @param sources 验证码字符源
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String generateVerifyCode(int verifySize, String sources){
|
||||||
|
if(sources == null || sources.length() == 0){
|
||||||
|
sources = VERIFY_CODES;
|
||||||
|
}
|
||||||
|
int codesLen = sources.length();
|
||||||
|
Random rand = new Random(System.currentTimeMillis());
|
||||||
|
StringBuilder verifyCode = new StringBuilder(verifySize);
|
||||||
|
for(int i = 0; i < verifySize; i++){
|
||||||
|
verifyCode.append(sources.charAt(rand.nextInt(codesLen-1)));
|
||||||
|
}
|
||||||
|
return verifyCode.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.security.KeyStore;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.SortedMap;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.ssl.SSLContexts;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
public class WeChatPayUtil {
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
|
public static String createSign(String characterEncoding,SortedMap<String,String> parameters,String appKey){
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
Set es = parameters.entrySet();
|
||||||
|
Iterator it = es.iterator();
|
||||||
|
while(it.hasNext()) {
|
||||||
|
Map.Entry entry = (Map.Entry)it.next();
|
||||||
|
String k = (String)entry.getKey();
|
||||||
|
Object v = entry.getValue();
|
||||||
|
if(null != v && !"".equals(v)
|
||||||
|
&& !"sign".equals(k) && !"key".equals(k)) {
|
||||||
|
sb.append(k + "=" + v + "&");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//最后加密时添加商户密钥,由于key值放在最后,所以不用添加到SortMap里面去,单独处理,编码方式采用UTF-8
|
||||||
|
sb.append("key=" + appKey);
|
||||||
|
String signStr = sb.toString();
|
||||||
|
String signRet = Md5Util.md5Encode(signStr, characterEncoding).toUpperCase();
|
||||||
|
|
||||||
|
return signRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author:
|
||||||
|
* @version:1.0
|
||||||
|
* @see:原始价格为单位为元,微信单位为分,所以需要转换*/
|
||||||
|
public static String yuanTofen(String price) {
|
||||||
|
//原始价格 单位元
|
||||||
|
BigDecimal sourcePrice = new BigDecimal(price);
|
||||||
|
//将元换算为分的单位 100
|
||||||
|
BigDecimal b2 = new BigDecimal("100");
|
||||||
|
String tfee=Double.toString(sourcePrice.multiply(b2).doubleValue());
|
||||||
|
// 订单金额
|
||||||
|
String totalFee = tfee.substring(0, tfee.indexOf("."));
|
||||||
|
|
||||||
|
return totalFee;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author:
|
||||||
|
* @version:1.0
|
||||||
|
* @see:将分转换为元 如:1 分= 0.01元*/
|
||||||
|
public static String fenToYuan(String price){
|
||||||
|
//原始价格 单位元
|
||||||
|
BigDecimal sourcePrice = new BigDecimal(price);
|
||||||
|
//将元换算为分的单位 100
|
||||||
|
BigDecimal b2 = new BigDecimal("100");
|
||||||
|
String tfee=Double.toString(sourcePrice.divide(b2).doubleValue());
|
||||||
|
// 订单金额
|
||||||
|
return tfee;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public static String executePost(String url, String body,String certificatePath,String password) throws Exception {
|
||||||
|
String result = "";
|
||||||
|
//商户id
|
||||||
|
//指定读取证书格式为PKCS12
|
||||||
|
KeyStore keyStore = KeyStore.getInstance("PKCS12");
|
||||||
|
//读取本机存放的PKCS12证书文件
|
||||||
|
FileInputStream instream = new FileInputStream(new File(certificatePath));
|
||||||
|
try {
|
||||||
|
//指定PKCS12的密码(商户ID)
|
||||||
|
keyStore.load(instream, password.toCharArray());
|
||||||
|
} finally {
|
||||||
|
instream.close();
|
||||||
|
}
|
||||||
|
SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, password.toCharArray()).build();
|
||||||
|
//指定TLS版本
|
||||||
|
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[]{"TLSv1"}, null, SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
|
||||||
|
//设置httpclient的SSLSocketFactory
|
||||||
|
CloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
|
||||||
|
try {
|
||||||
|
HttpPost httppost = new HttpPost(url);
|
||||||
|
StringEntity reqEntity = new StringEntity(body, "UTF-8");
|
||||||
|
httppost.setEntity(reqEntity);
|
||||||
|
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
try {
|
||||||
|
response = httpclient.execute(httppost);
|
||||||
|
result = EntityUtils.toString(response.getEntity(),"UTF-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
response.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
httpclient.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,275 @@
|
||||||
|
package com.jepsoninfo.util;
|
||||||
|
|
||||||
|
import org.jdom.Document;
|
||||||
|
import org.jdom.Element;
|
||||||
|
import org.jdom.JDOMException;
|
||||||
|
import org.jdom.input.SAXBuilder;
|
||||||
|
import org.jdom.output.Format;
|
||||||
|
import org.jdom.output.XMLOutputter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Reader;
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class XmlUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <P>
|
||||||
|
* map集合转化成xml字符串
|
||||||
|
* </P>
|
||||||
|
*
|
||||||
|
* @param map
|
||||||
|
* @param rootName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String mapToXml(Map<String, String> map, String rootName) {
|
||||||
|
Element root = new Element(rootName);
|
||||||
|
if (map == null){
|
||||||
|
return xmlToString(root);
|
||||||
|
}
|
||||||
|
for (String str : map.keySet()){
|
||||||
|
root.addContent(new Element(str).setText((map.get(str) == null ? "" : map.get(str) + "")));
|
||||||
|
}
|
||||||
|
return xmlToString(root);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <P>
|
||||||
|
* xml字符串转化成map集合
|
||||||
|
* </P>
|
||||||
|
*
|
||||||
|
* @param xmlStr字符串
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Map<String, String> xmlToMap(String xmlStr) {
|
||||||
|
|
||||||
|
SAXBuilder builder = new SAXBuilder();
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
try {
|
||||||
|
xmlStr = URLDecoder.decode(xmlStr, "UTF-8");
|
||||||
|
Reader in = new StringReader(xmlStr);
|
||||||
|
Document doc = builder.build(in);
|
||||||
|
Element root = doc.getRootElement();
|
||||||
|
List<Element> list = root.getChildren();
|
||||||
|
for (Element e : list){
|
||||||
|
map.put(e.getName(), e.getText());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
} catch (JDOMException e) {
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
} catch (IOException e) {
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <P>
|
||||||
|
* list集合转化成xml字符串
|
||||||
|
* </P>
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
* @param rootName
|
||||||
|
* @param parentName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String listToXml(List<Map<String, Object>> list, String rootName, String parentName) {
|
||||||
|
Element root = new Element(rootName);
|
||||||
|
boolean flag = false;
|
||||||
|
Element parentElement = null;
|
||||||
|
Element child = null;
|
||||||
|
if (list == null){
|
||||||
|
return xmlToString(root);
|
||||||
|
}
|
||||||
|
for (Map<String, Object> map : list){
|
||||||
|
if (flag) {
|
||||||
|
flag = false;
|
||||||
|
for (String str : map.keySet()) {
|
||||||
|
child = new Element(str).setText(map.get(str) == null ? "" : (map.get(str) + ""));
|
||||||
|
root.addContent(child);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
parentElement = new Element(parentName);
|
||||||
|
root.addContent(parentElement);
|
||||||
|
for (String str : map.keySet()) {
|
||||||
|
String value = map.get(str) == null ? "" : (map.get(str) + "");
|
||||||
|
value = wrapXmlContent(value);
|
||||||
|
child = new Element(str).setText(value);
|
||||||
|
parentElement.addContent(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return xmlToString(root);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <P>
|
||||||
|
* xml字符串转化成list集合
|
||||||
|
* </P>
|
||||||
|
*
|
||||||
|
* @param xmlStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static List<Map<String, Object>> xmlToList(String xmlStr) {
|
||||||
|
SAXBuilder builder = new SAXBuilder();
|
||||||
|
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
|
||||||
|
Map<String, Object> map = null;
|
||||||
|
boolean flag = true;
|
||||||
|
try {
|
||||||
|
xmlStr = URLDecoder.decode(xmlStr, "UTF-8");
|
||||||
|
Reader in = new StringReader(xmlStr);
|
||||||
|
Document doc = builder.build(in);
|
||||||
|
Element root = doc.getRootElement();
|
||||||
|
List<Element> list = root.getChildren();
|
||||||
|
for (Element e : list) {
|
||||||
|
if (e.getChildren().size() == 0) {
|
||||||
|
if (flag) {
|
||||||
|
flag = false;
|
||||||
|
map = new HashMap<String, Object>();
|
||||||
|
resultList.add(map);
|
||||||
|
}
|
||||||
|
map.put(e.getName(), e.getText());
|
||||||
|
} else {
|
||||||
|
map = new HashMap<String, Object>();
|
||||||
|
List<Element> childrenList = e.getChildren();
|
||||||
|
resultList.add(map);
|
||||||
|
for (Element element : childrenList) {
|
||||||
|
map.put(element.getName(), element.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
} catch (JDOMException e) {
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
} catch (IOException e) {
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author joed 描述: 字符转意
|
||||||
|
*/
|
||||||
|
public static String wrapXmlContent(String content) {
|
||||||
|
StringBuffer appender = new StringBuffer("");
|
||||||
|
|
||||||
|
if ((content != null) && (!content.trim().isEmpty())) {
|
||||||
|
appender = new StringBuffer(content.length());
|
||||||
|
|
||||||
|
for (int i = 0; i < content.length(); i++) {
|
||||||
|
char ch = content.charAt(i);
|
||||||
|
if ((ch == '\t') || (ch == '\n') || (ch == '\r') || ((ch >= ' ') && (ch <= 55295))
|
||||||
|
|| ((ch >= 57344) && (ch <= 65533)) || ((ch >= 65536) && (ch <= 1114111))) {
|
||||||
|
appender.append(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String result = appender.toString();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将Element对象转化成字串
|
||||||
|
*
|
||||||
|
* @param element
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String xmlToString(Element element) {
|
||||||
|
XMLOutputter output = new XMLOutputter();
|
||||||
|
output.setFormat(Format.getPrettyFormat().setEncoding("UTF-8"));
|
||||||
|
Document doc = new Document(element);
|
||||||
|
String str = output.outputString(doc);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析xml字符串获取节点内容
|
||||||
|
*
|
||||||
|
* @param xmlStr
|
||||||
|
* xml字符串
|
||||||
|
* @param nodeStr
|
||||||
|
* 需要获取的节点
|
||||||
|
* @return 解析信息
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Map<String, String> readXml(String xmlStr, String[] nodeStrArr) {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
SAXBuilder builder = new SAXBuilder();
|
||||||
|
try {
|
||||||
|
xmlStr = URLDecoder.decode(xmlStr, "UTF-8");
|
||||||
|
Reader in = new StringReader(xmlStr);
|
||||||
|
Document doc = builder.build(in);
|
||||||
|
Element root = doc.getRootElement();
|
||||||
|
List<Element> l = null;
|
||||||
|
String str = "";
|
||||||
|
for (String nodeStr : nodeStrArr) {
|
||||||
|
l = root.getChildren(nodeStr);
|
||||||
|
str = l.get(0).getText();
|
||||||
|
if ("".equals(str) || str == null) {
|
||||||
|
map.put("msg", "01: 传入参数为空或格式错误,请检查各节点是否为有效XML节点");
|
||||||
|
return map;
|
||||||
|
} else {
|
||||||
|
map.put("msg", "00: 解析xml成功");
|
||||||
|
map.put(nodeStr, str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (JDOMException e) {
|
||||||
|
map.put("msg", "01: 传入参数为空或格式错误,请检查各节点是否为有效XML节点");
|
||||||
|
return map;
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
map.put("msg", "05:编码格式错误,不支持的字符编码");
|
||||||
|
return map;
|
||||||
|
} catch (IOException e) {
|
||||||
|
map.put("msg", "02: 读取失败");
|
||||||
|
return map;
|
||||||
|
} catch (Exception e) {
|
||||||
|
map.put("msg", "02: 读取失败");
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成带内容的节点
|
||||||
|
*
|
||||||
|
* @param parentElement父节点
|
||||||
|
* @param map
|
||||||
|
* 数据集
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Element createNodes(Element parentElement, Map<String, Object> map) {
|
||||||
|
String msg = "";
|
||||||
|
Iterator<String> it = map.keySet().iterator();
|
||||||
|
String tempStr = "";
|
||||||
|
Element sonElement = null;
|
||||||
|
while (it.hasNext()) {
|
||||||
|
tempStr = it.next();
|
||||||
|
msg = (map.get(tempStr)) == null ? "" : (map.get(tempStr) + "");
|
||||||
|
sonElement = new Element(tempStr);
|
||||||
|
parentElement.addContent(sonElement.setText(msg));
|
||||||
|
}
|
||||||
|
return parentElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成不带内容的节点
|
||||||
|
*
|
||||||
|
* @param root根节点
|
||||||
|
* @param strArr
|
||||||
|
* 节点字符
|
||||||
|
*/
|
||||||
|
public static void createNodes(Element root, String[] strArr) {
|
||||||
|
Element e = null;
|
||||||
|
for (String str : strArr) {
|
||||||
|
e = new Element(str);
|
||||||
|
root.addContent(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
spring.application.name=transfer-service
|
||||||
|
server.port=11000
|
||||||
|
|
||||||
|
debug=false
|
||||||
|
|
||||||
|
spring.swagger.enabled=true
|
||||||
|
spring.swagger.version=2.0
|
||||||
|
spring.swagger.base-package=com.jepsoninfo.controller
|
||||||
|
|
||||||
|
spring.jackson.time-zone=GMT+8
|
||||||
|
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||||
|
|
||||||
|
# Jdbc
|
||||||
|
spring.datasource.url=jdbc:sqlite:D:/devApp/dll/mfcdirectlib.dll
|
||||||
|
spring.datasource.cipher=sqlcipher
|
||||||
|
spring.datasource.driver-class-name=org.sqlite.JDBC
|
||||||
|
|
||||||
|
# Timeout
|
||||||
|
custom.rest.connection.connection-request-timeout=10000
|
||||||
|
custom.rest.connection.connect-timeout=10000
|
||||||
|
custom.rest.connection.read-timeout=10000
|
||||||
|
|
||||||
|
# MyBatis
|
||||||
|
mybatis.configuration.mapUnderscoreToCamelCase=true
|
||||||
|
mapper.not-empty=false
|
||||||
|
mapper.identity=MYSQL
|
||||||
|
mybatis.type-aliases-package=com.jepsoninfo.dao.entity
|
||||||
|
mybatis.mapperLocations=classpath:mapper/*.xml
|
||||||
|
|
||||||
|
spring.http.multipart.maxFileSize=10MB
|
||||||
|
spring.http.multipart.maxRequestSize=10MB
|
||||||
|
|
||||||
|
#打印日志文件
|
||||||
|
#logging.level.shortMessageService=debug
|
||||||
|
#日志生成方式效果配置文件
|
||||||
|
logging.config=classpath:logback.xml
|
||||||
|
# 默认该目录下会生成spring.log logging.file.path 和 logging.file.name 2选1,如果都配置,以后者为准
|
||||||
|
logging.file.path=logs
|
||||||
|
#日志文件路径(默认在项目根目录)
|
||||||
|
|
||||||
|
#logging.file.name=./logs/my-project.logs
|
|
@ -0,0 +1,105 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||||
|
<logger name="org.springframework.web" level="all"/>
|
||||||
|
|
||||||
|
<!-- 定义日志文件 输入位置 -->
|
||||||
|
<property name="logDir" value="logs" />
|
||||||
|
<!-- 日志最大的历史 30天 -->
|
||||||
|
<property name="maxHistory" value="30"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出日志 -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger -%msg%n</pattern>
|
||||||
|
<charset class="java.nio.charset.Charset">UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- ERROR级别日志 -->
|
||||||
|
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${logDir}\%d{yyyyMMdd}\error.log</fileNamePattern>
|
||||||
|
<maxHistory>${maxHistory}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
||||||
|
<charset class="java.nio.charset.Charset">UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<append>false</append>
|
||||||
|
<prudent>false</prudent>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- WARN级别日志 -->
|
||||||
|
<appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>WARN</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${logDir}\%d{yyyyMMdd}\warn.log</fileNamePattern>
|
||||||
|
<maxHistory>${maxHistory}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
||||||
|
<charset class="java.nio.charset.Charset">UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<append>false</append>
|
||||||
|
<prudent>false</prudent>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- INFO级别日志 -->
|
||||||
|
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>INFO</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${logDir}\%d{yyyyMMdd}\info.log</fileNamePattern>
|
||||||
|
<maxHistory>${maxHistory}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
||||||
|
<charset class="java.nio.charset.Charset">UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<append>false</append>
|
||||||
|
<prudent>false</prudent>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- DEBUG级别日志 -->
|
||||||
|
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>DEBUG</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${logDir}\%d{yyyyMMdd}\debug.log</fileNamePattern>
|
||||||
|
<maxHistory>${maxHistory}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
||||||
|
<charset class="java.nio.charset.Charset">UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<append>false</append>
|
||||||
|
<prudent>false</prudent>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- root级别 DEBUG -->
|
||||||
|
<root level="INFO">
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
<!-- 文件输出 -->
|
||||||
|
<appender-ref ref="ERROR" />
|
||||||
|
<appender-ref ref="INFO" />
|
||||||
|
<appender-ref ref="WARN" />
|
||||||
|
<appender-ref ref="DEBUG" />
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,195 @@
|
||||||
|
<?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.jepsoninfo.dao.CommonConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.CommonConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="cnName" column="cn_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="cnValue" column="cn_value" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.CommonConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, cn_name, cn_value, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByName" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from common_config
|
||||||
|
<where>
|
||||||
|
<if test="cnName != null and cnName != ''">
|
||||||
|
and cn_name = #{cnName}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from common_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.cnName != null and cond.cnName != ''">
|
||||||
|
and cn_name = #{cond.cnName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.cnValue != null and cond.cnValue != ''">
|
||||||
|
and cn_value = #{cond.cnValue}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from common_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.cnName != null and cond.cnName != ''">
|
||||||
|
and cn_name = #{cond.cnName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.cnValue != null and cond.cnValue != ''">
|
||||||
|
and cn_value = #{cond.cnValue}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from common_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from common_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null and cnName != ''">
|
||||||
|
and cn_name = #{cnName}
|
||||||
|
</if>
|
||||||
|
<if test="cnValue != null and cnValue != ''">
|
||||||
|
and cn_value = #{cnValue}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into common_config(id, cn_name, cn_value, create_time, update_time)
|
||||||
|
values (#{id}, #{cnName}, #{cnValue}, #{createTime}, #{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into common_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null">
|
||||||
|
cn_name,
|
||||||
|
</if>
|
||||||
|
<if test="cnValue != null">
|
||||||
|
cn_value,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null">
|
||||||
|
#{cnName},
|
||||||
|
</if>
|
||||||
|
<if test="cnValue != null">
|
||||||
|
#{cnValue},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update common_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
cn_name = #{cnName},
|
||||||
|
cn_value = #{cnValue},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update common_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null and cnName != ''">
|
||||||
|
cn_name = #{cnName},
|
||||||
|
</if>
|
||||||
|
<if test="cnValue != null and cnValue != ''">
|
||||||
|
cn_value = #{cnValue},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from common_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,325 @@
|
||||||
|
<?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.jepsoninfo.dao.DisplayConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.DisplayConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="laneName" column="lane_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="devNo" column="dev_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="ipAddr" column="ip_addr" jdbcType="VARCHAR"/>
|
||||||
|
<result property="tcpPort" column="tcp_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="rs485Port" column="rs485_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="httpPort" column="http_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="passwd" column="passwd" jdbcType="VARCHAR"/>
|
||||||
|
<result property="verNo" column="ver_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.DisplayConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, lane_name, dev_no, ip_addr, tcp_port, rs485_port, http_port, user_name, passwd, ver_no, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from display_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.devNo != null and cond.devNo != ''">
|
||||||
|
and dev_no = #{cond.devNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.tcpPort != null">
|
||||||
|
and tcp_port = #{cond.tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.rs485Port != null">
|
||||||
|
and rs485_port = #{cond.rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.httpPort != null">
|
||||||
|
and http_port = #{cond.httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.passwd != null and cond.passwd != ''">
|
||||||
|
and passwd = #{cond.passwd}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from display_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.devNo != null and cond.devNo != ''">
|
||||||
|
and dev_no = #{cond.devNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.tcpPort != null">
|
||||||
|
and tcp_port = #{cond.tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.rs485Port != null">
|
||||||
|
and rs485_port = #{cond.rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.httpPort != null">
|
||||||
|
and http_port = #{cond.httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.passwd != null and cond.passwd != ''">
|
||||||
|
and passwd = #{cond.passwd}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from display_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from display_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
and lane_name = #{laneName}
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null and devNo != ''">
|
||||||
|
and dev_no = #{devNo}
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
and ip_addr = #{ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
and tcp_port = #{tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
and rs485_port = #{rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
and http_port = #{httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
and user_name = #{userName}
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null and passwd != ''">
|
||||||
|
and passwd = #{passwd}
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
and ver_no = #{verNo}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into display_config(id, lane_name, dev_no, ip_addr, tcp_port, rs485_port, http_port, user_name, passwd,
|
||||||
|
ver_no, create_time, update_time)
|
||||||
|
values (#{id}, #{laneName}, #{devNo}, #{ipAddr}, #{tcpPort}, #{rs485Port}, #{httpPort}, #{userName}, #{passwd},
|
||||||
|
#{verNo}, #{createTime}, #{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into display_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
lane_name,
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null">
|
||||||
|
dev_no,
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
ip_addr,
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
tcp_port,
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
rs485_port,
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
http_port,
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
user_name,
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null">
|
||||||
|
passwd,
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
ver_no,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
#{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null">
|
||||||
|
#{devNo},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
#{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
#{tcpPort},
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
#{rs485Port},
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
#{httpPort},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
#{userName},
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null">
|
||||||
|
#{passwd},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
#{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update display_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
lane_name = #{laneName},
|
||||||
|
dev_no = #{devNo},
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
tcp_port = #{tcpPort},
|
||||||
|
rs485_port = #{rs485Port},
|
||||||
|
http_port = #{httpPort},
|
||||||
|
user_name = #{userName},
|
||||||
|
passwd = #{passwd},
|
||||||
|
ver_no = #{verNo},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update display_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
lane_name = #{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null and devNo != ''">
|
||||||
|
dev_no = #{devNo},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
tcp_port = #{tcpPort},
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
rs485_port = #{rs485Port},
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
http_port = #{httpPort},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
user_name = #{userName},
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null and passwd != ''">
|
||||||
|
passwd = #{passwd},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
ver_no = #{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from display_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,265 @@
|
||||||
|
<?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.jepsoninfo.dao.HkCameraConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.HkCameraConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="laneName" column="lane_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="ipAddr" column="ip_addr" jdbcType="VARCHAR"/>
|
||||||
|
<result property="port" column="port" jdbcType="INTEGER"/>
|
||||||
|
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="password" column="password" jdbcType="VARCHAR"/>
|
||||||
|
<result property="verNo" column="ver_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.HkCameraConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, lane_name, ip_addr, port, user_name, password, ver_no, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from hk_camera_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.port != null">
|
||||||
|
and port = #{cond.port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.password != null and cond.password != ''">
|
||||||
|
and password = #{cond.password}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from hk_camera_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.port != null">
|
||||||
|
and port = #{cond.port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.password != null and cond.password != ''">
|
||||||
|
and password = #{cond.password}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from hk_camera_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from hk_camera_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
and lane_name = #{laneName}
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
and ip_addr = #{ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="port != null">
|
||||||
|
and port = #{port}
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
and user_name = #{userName}
|
||||||
|
</if>
|
||||||
|
<if test="password != null and password != ''">
|
||||||
|
and password = #{password}
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
and ver_no = #{verNo}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into hk_camera_config(id, lane_name, ip_addr, port, user_name, password, ver_no, create_time,
|
||||||
|
update_time)
|
||||||
|
values (#{id}, #{laneName}, #{ipAddr}, #{port}, #{userName}, #{password}, #{verNo}, #{createTime},
|
||||||
|
#{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into hk_camera_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
lane_name,
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
ip_addr,
|
||||||
|
</if>
|
||||||
|
<if test="port != null">
|
||||||
|
port,
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
user_name,
|
||||||
|
</if>
|
||||||
|
<if test="password != null">
|
||||||
|
password,
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
ver_no,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
#{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
#{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="port != null">
|
||||||
|
#{port},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
#{userName},
|
||||||
|
</if>
|
||||||
|
<if test="password != null">
|
||||||
|
#{password},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
#{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update hk_camera_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
lane_name = #{laneName},
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
port = #{port},
|
||||||
|
user_name = #{userName},
|
||||||
|
password = #{password},
|
||||||
|
ver_no = #{verNo},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update hk_camera_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
lane_name = #{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="port != null">
|
||||||
|
port = #{port},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
user_name = #{userName},
|
||||||
|
</if>
|
||||||
|
<if test="password != null and password != ''">
|
||||||
|
password = #{password},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
ver_no = #{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from hk_camera_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,487 @@
|
||||||
|
<?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.jepsoninfo.dao.IntegratedMachineConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.IntegratedMachineConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="laneNo" column="lane_no" jdbcType="INTEGER"/>
|
||||||
|
<result property="laneName" column="lane_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="devNo" column="dev_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="ipAddr" column="ip_addr" jdbcType="VARCHAR"/>
|
||||||
|
<result property="httpPort" column="http_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="tcpPort" column="tcp_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="rs485Port" column="rs485_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="ioPort" column="io_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="passwd" column="passwd" jdbcType="VARCHAR"/>
|
||||||
|
<result property="hkCameraId" column="hk_camera_id" jdbcType="INTEGER"/>
|
||||||
|
<result property="ipVoiceId" column="ip_voice_id" jdbcType="INTEGER"/>
|
||||||
|
<result property="wagonBalanceId" column="wagon_balance_id" jdbcType="INTEGER"/>
|
||||||
|
<result property="isFront" column="is_front" jdbcType="INTEGER"/>
|
||||||
|
<result property="isDoorStatus" column="is_door_status" jdbcType="INTEGER"/>
|
||||||
|
<result property="nType" column="n_type" jdbcType="INTEGER"/>
|
||||||
|
<result property="verNo" column="ver_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.IntegratedMachineConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, lane_no, lane_name, dev_no, ip_addr, http_port, tcp_port, rs485_port, io_port, user_name, passwd, hk_camera_id, ip_voice_id, wagon_balance_id, is_front, is_door_status, n_type, ver_no, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from integrated_machine_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneNo != null">
|
||||||
|
and lane_no = #{cond.laneNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.devNo != null and cond.devNo != ''">
|
||||||
|
and dev_no = #{cond.devNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.httpPort != null">
|
||||||
|
and http_port = #{cond.httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.tcpPort != null">
|
||||||
|
and tcp_port = #{cond.tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.rs485Port != null">
|
||||||
|
and rs485_port = #{cond.rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ioPort != null">
|
||||||
|
and io_port = #{cond.ioPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.passwd != null and cond.passwd != ''">
|
||||||
|
and passwd = #{cond.passwd}
|
||||||
|
</if>
|
||||||
|
<if test="cond.hkCameraId != null">
|
||||||
|
and hk_camera_id = #{cond.hkCameraId}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipVoiceId != null">
|
||||||
|
and ip_voice_id = #{cond.ipVoiceId}
|
||||||
|
</if>
|
||||||
|
<if test="cond.wagonBalanceId != null">
|
||||||
|
and wagon_balance_id = #{cond.wagonBalanceId}
|
||||||
|
</if>
|
||||||
|
<if test="cond.isFront != null">
|
||||||
|
and is_front = #{cond.isFront}
|
||||||
|
</if>
|
||||||
|
<if test="cond.isDoorStatus != null">
|
||||||
|
and is_door_status = #{cond.isDoorStatus}
|
||||||
|
</if>
|
||||||
|
<if test="cond.nType != null">
|
||||||
|
and n_type = #{cond.nType}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from integrated_machine_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneNo != null">
|
||||||
|
and lane_no = #{cond.laneNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.devNo != null and cond.devNo != ''">
|
||||||
|
and dev_no = #{cond.devNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.httpPort != null">
|
||||||
|
and http_port = #{cond.httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.tcpPort != null">
|
||||||
|
and tcp_port = #{cond.tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.rs485Port != null">
|
||||||
|
and rs485_port = #{cond.rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ioPort != null">
|
||||||
|
and io_port = #{cond.ioPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.passwd != null and cond.passwd != ''">
|
||||||
|
and passwd = #{cond.passwd}
|
||||||
|
</if>
|
||||||
|
<if test="cond.hkCameraId != null">
|
||||||
|
and hk_camera_id = #{cond.hkCameraId}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipVoiceId != null">
|
||||||
|
and ip_voice_id = #{cond.ipVoiceId}
|
||||||
|
</if>
|
||||||
|
<if test="cond.wagonBalanceId != null">
|
||||||
|
and wagon_balance_id = #{cond.wagonBalanceId}
|
||||||
|
</if>
|
||||||
|
<if test="cond.isFront != null">
|
||||||
|
and is_front = #{cond.isFront}
|
||||||
|
</if>
|
||||||
|
<if test="cond.isDoorStatus != null">
|
||||||
|
and is_door_status = #{cond.isDoorStatus}
|
||||||
|
</if>
|
||||||
|
<if test="cond.nType != null">
|
||||||
|
and n_type = #{cond.nType}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from integrated_machine_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from integrated_machine_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="laneNo != null">
|
||||||
|
and lane_no = #{laneNo}
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
and lane_name = #{laneName}
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null and devNo != ''">
|
||||||
|
and dev_no = #{devNo}
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
and ip_addr = #{ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
and http_port = #{httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
and tcp_port = #{tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
and rs485_port = #{rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="ioPort != null">
|
||||||
|
and io_port = #{ioPort}
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
and user_name = #{userName}
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null and passwd != ''">
|
||||||
|
and passwd = #{passwd}
|
||||||
|
</if>
|
||||||
|
<if test="hkCameraId != null">
|
||||||
|
and hk_camera_id = #{hkCameraId}
|
||||||
|
</if>
|
||||||
|
<if test="ipVoiceId != null">
|
||||||
|
and ip_voice_id = #{ipVoiceId}
|
||||||
|
</if>
|
||||||
|
<if test="wagonBalanceId != null">
|
||||||
|
and wagon_balance_id = #{wagonBalanceId}
|
||||||
|
</if>
|
||||||
|
<if test="isFront != null">
|
||||||
|
and is_front = #{isFront}
|
||||||
|
</if>
|
||||||
|
<if test="isDoorStatus != null">
|
||||||
|
and is_door_status = #{isDoorStatus}
|
||||||
|
</if>
|
||||||
|
<if test="nType != null">
|
||||||
|
and n_type = #{nType}
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
and ver_no = #{verNo}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into integrated_machine_config(id, lane_no, lane_name, dev_no, ip_addr, http_port, tcp_port, rs485_port,
|
||||||
|
io_port, user_name, passwd, hk_camera_id, ip_voice_id, wagon_balance_id,
|
||||||
|
is_front, is_door_status, n_type, ver_no, create_time, update_time)
|
||||||
|
values (#{id}, #{laneNo}, #{laneName}, #{devNo}, #{ipAddr}, #{httpPort}, #{tcpPort}, #{rs485Port}, #{ioPort},
|
||||||
|
#{userName}, #{passwd}, #{hkCameraId}, #{ipVoiceId}, #{wagonBalanceId}, #{isFront}, #{isDoorStatus},
|
||||||
|
#{nType}, #{verNo}, #{createTime}, #{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into integrated_machine_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="laneNo != null">
|
||||||
|
lane_no,
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
lane_name,
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null">
|
||||||
|
dev_no,
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
ip_addr,
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
http_port,
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
tcp_port,
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
rs485_port,
|
||||||
|
</if>
|
||||||
|
<if test="ioPort != null">
|
||||||
|
io_port,
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
user_name,
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null">
|
||||||
|
passwd,
|
||||||
|
</if>
|
||||||
|
<if test="hkCameraId != null">
|
||||||
|
hk_camera_id,
|
||||||
|
</if>
|
||||||
|
<if test="ipVoiceId != null">
|
||||||
|
ip_voice_id,
|
||||||
|
</if>
|
||||||
|
<if test="wagonBalanceId != null">
|
||||||
|
wagon_balance_id,
|
||||||
|
</if>
|
||||||
|
<if test="isFront != null">
|
||||||
|
is_front,
|
||||||
|
</if>
|
||||||
|
<if test="isDoorStatus != null">
|
||||||
|
is_door_status,
|
||||||
|
</if>
|
||||||
|
<if test="nType != null">
|
||||||
|
n_type,
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
ver_no,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneNo != null">
|
||||||
|
#{laneNo},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
#{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null">
|
||||||
|
#{devNo},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
#{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
#{httpPort},
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
#{tcpPort},
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
#{rs485Port},
|
||||||
|
</if>
|
||||||
|
<if test="ioPort != null">
|
||||||
|
#{ioPort},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
#{userName},
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null">
|
||||||
|
#{passwd},
|
||||||
|
</if>
|
||||||
|
<if test="hkCameraId != null">
|
||||||
|
#{hkCameraId},
|
||||||
|
</if>
|
||||||
|
<if test="ipVoiceId != null">
|
||||||
|
#{ipVoiceId},
|
||||||
|
</if>
|
||||||
|
<if test="wagonBalanceId != null">
|
||||||
|
#{wagonBalanceId},
|
||||||
|
</if>
|
||||||
|
<if test="isFront != null">
|
||||||
|
#{isFront},
|
||||||
|
</if>
|
||||||
|
<if test="isDoorStatus != null">
|
||||||
|
#{isDoorStatus},
|
||||||
|
</if>
|
||||||
|
<if test="nType != null">
|
||||||
|
#{nType},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
#{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update integrated_machine_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
lane_no = #{laneNo},
|
||||||
|
lane_name = #{laneName},
|
||||||
|
dev_no = #{devNo},
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
http_port = #{httpPort},
|
||||||
|
tcp_port = #{tcpPort},
|
||||||
|
rs485_port = #{rs485Port},
|
||||||
|
io_port = #{ioPort},
|
||||||
|
user_name = #{userName},
|
||||||
|
passwd = #{passwd},
|
||||||
|
hk_camera_id = #{hkCameraId},
|
||||||
|
ip_voice_id = #{ipVoiceId},
|
||||||
|
wagon_balance_id = #{wagonBalanceId},
|
||||||
|
is_front = #{isFront},
|
||||||
|
is_door_status = #{isDoorStatus},
|
||||||
|
n_type = #{nType},
|
||||||
|
ver_no = #{verNo},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update integrated_machine_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneNo != null">
|
||||||
|
lane_no = #{laneNo},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
lane_name = #{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null and devNo != ''">
|
||||||
|
dev_no = #{devNo},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
http_port = #{httpPort},
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
tcp_port = #{tcpPort},
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
rs485_port = #{rs485Port},
|
||||||
|
</if>
|
||||||
|
<if test="ioPort != null">
|
||||||
|
io_port = #{ioPort},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
user_name = #{userName},
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null and passwd != ''">
|
||||||
|
passwd = #{passwd},
|
||||||
|
</if>
|
||||||
|
<if test="hkCameraId != null">
|
||||||
|
hk_camera_id = #{hkCameraId},
|
||||||
|
</if>
|
||||||
|
<if test="ipVoiceId != null">
|
||||||
|
ip_voice_id = #{ipVoiceId},
|
||||||
|
</if>
|
||||||
|
<if test="wagonBalanceId != null">
|
||||||
|
wagon_balance_id = #{wagonBalanceId},
|
||||||
|
</if>
|
||||||
|
<if test="isFront != null">
|
||||||
|
is_front = #{isFront},
|
||||||
|
</if>
|
||||||
|
<if test="isDoorStatus != null">
|
||||||
|
is_door_status = #{isDoorStatus},
|
||||||
|
</if>
|
||||||
|
<if test="nType != null">
|
||||||
|
n_type = #{nType},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
ver_no = #{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from integrated_machine_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,345 @@
|
||||||
|
<?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.jepsoninfo.dao.IpVoiceboxConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.IpVoiceboxConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="laneName" column="lane_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="devNo" column="dev_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="ipAddr" column="ip_addr" jdbcType="VARCHAR"/>
|
||||||
|
<result property="tcpPort" column="tcp_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="rs485Port" column="rs485_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="httpPort" column="http_port" jdbcType="INTEGER"/>
|
||||||
|
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="passwd" column="passwd" jdbcType="VARCHAR"/>
|
||||||
|
<result property="maxVol" column="max_vol" jdbcType="INTEGER"/>
|
||||||
|
<result property="verNo" column="ver_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.IpVoiceboxConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, lane_name, dev_no, ip_addr, tcp_port, rs485_port, http_port, user_name, passwd, max_vol, ver_no, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from ip_voicebox_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.devNo != null and cond.devNo != ''">
|
||||||
|
and dev_no = #{cond.devNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.tcpPort != null">
|
||||||
|
and tcp_port = #{cond.tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.rs485Port != null">
|
||||||
|
and rs485_port = #{cond.rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.httpPort != null">
|
||||||
|
and http_port = #{cond.httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.passwd != null and cond.passwd != ''">
|
||||||
|
and passwd = #{cond.passwd}
|
||||||
|
</if>
|
||||||
|
<if test="cond.maxVol != null">
|
||||||
|
and max_vol = #{cond.maxVol}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from ip_voicebox_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.devNo != null and cond.devNo != ''">
|
||||||
|
and dev_no = #{cond.devNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.ipAddr != null and cond.ipAddr != ''">
|
||||||
|
and ip_addr = #{cond.ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="cond.tcpPort != null">
|
||||||
|
and tcp_port = #{cond.tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.rs485Port != null">
|
||||||
|
and rs485_port = #{cond.rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="cond.httpPort != null">
|
||||||
|
and http_port = #{cond.httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="cond.userName != null and cond.userName != ''">
|
||||||
|
and user_name = #{cond.userName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.passwd != null and cond.passwd != ''">
|
||||||
|
and passwd = #{cond.passwd}
|
||||||
|
</if>
|
||||||
|
<if test="cond.maxVol != null">
|
||||||
|
and max_vol = #{cond.maxVol}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from ip_voicebox_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from ip_voicebox_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
and lane_name = #{laneName}
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null and devNo != ''">
|
||||||
|
and dev_no = #{devNo}
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
and ip_addr = #{ipAddr}
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
and tcp_port = #{tcpPort}
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
and rs485_port = #{rs485Port}
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
and http_port = #{httpPort}
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
and user_name = #{userName}
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null and passwd != ''">
|
||||||
|
and passwd = #{passwd}
|
||||||
|
</if>
|
||||||
|
<if test="maxVol != null">
|
||||||
|
and max_vol = #{maxVol}
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
and ver_no = #{verNo}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into ip_voicebox_config(id, lane_name, dev_no, ip_addr, tcp_port, rs485_port, http_port, user_name,
|
||||||
|
passwd, max_vol, ver_no, create_time, update_time)
|
||||||
|
values (#{id}, #{laneName}, #{devNo}, #{ipAddr}, #{tcpPort}, #{rs485Port}, #{httpPort}, #{userName}, #{passwd},
|
||||||
|
#{maxVol}, #{verNo}, #{createTime}, #{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into ip_voicebox_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
lane_name,
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null">
|
||||||
|
dev_no,
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
ip_addr,
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
tcp_port,
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
rs485_port,
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
http_port,
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
user_name,
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null">
|
||||||
|
passwd,
|
||||||
|
</if>
|
||||||
|
<if test="maxVol != null">
|
||||||
|
max_vol,
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
ver_no,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
#{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null">
|
||||||
|
#{devNo},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null">
|
||||||
|
#{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
#{tcpPort},
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
#{rs485Port},
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
#{httpPort},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null">
|
||||||
|
#{userName},
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null">
|
||||||
|
#{passwd},
|
||||||
|
</if>
|
||||||
|
<if test="maxVol != null">
|
||||||
|
#{maxVol},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
#{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update ip_voicebox_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
lane_name = #{laneName},
|
||||||
|
dev_no = #{devNo},
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
tcp_port = #{tcpPort},
|
||||||
|
rs485_port = #{rs485Port},
|
||||||
|
http_port = #{httpPort},
|
||||||
|
user_name = #{userName},
|
||||||
|
passwd = #{passwd},
|
||||||
|
max_vol = #{maxVol},
|
||||||
|
ver_no = #{verNo},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update ip_voicebox_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
lane_name = #{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="devNo != null and devNo != ''">
|
||||||
|
dev_no = #{devNo},
|
||||||
|
</if>
|
||||||
|
<if test="ipAddr != null and ipAddr != ''">
|
||||||
|
ip_addr = #{ipAddr},
|
||||||
|
</if>
|
||||||
|
<if test="tcpPort != null">
|
||||||
|
tcp_port = #{tcpPort},
|
||||||
|
</if>
|
||||||
|
<if test="rs485Port != null">
|
||||||
|
rs485_port = #{rs485Port},
|
||||||
|
</if>
|
||||||
|
<if test="httpPort != null">
|
||||||
|
http_port = #{httpPort},
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
user_name = #{userName},
|
||||||
|
</if>
|
||||||
|
<if test="passwd != null and passwd != ''">
|
||||||
|
passwd = #{passwd},
|
||||||
|
</if>
|
||||||
|
<if test="maxVol != null">
|
||||||
|
max_vol = #{maxVol},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
ver_no = #{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from ip_voicebox_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,196 @@
|
||||||
|
<?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.jepsoninfo.dao.MessageConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.MessageConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="cnName" column="cn_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.MessageConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, cn_name, content, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from message_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.cnName != null and cond.cnName != ''">
|
||||||
|
and cn_name = #{cond.cnName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.content != null and cond.content != ''">
|
||||||
|
and content = #{cond.content}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from message_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.cnName != null and cond.cnName != ''">
|
||||||
|
and cn_name = #{cond.cnName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.content != null and cond.content != ''">
|
||||||
|
and content = #{cond.content}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.startCreateTime != null">
|
||||||
|
and create_time >= #{cond.startCreateTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.endCreateTime != null">
|
||||||
|
and create_time <= #{cond.endCreateTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.startUpdateTime != null">
|
||||||
|
and update_time >= #{cond.startUpdateTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.endUpdateTime != null">
|
||||||
|
and update_time <= #{cond.endUpdateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by update_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from message_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from message_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null and cnName != ''">
|
||||||
|
and cn_name = #{cnName}
|
||||||
|
</if>
|
||||||
|
<if test="content != null and content != ''">
|
||||||
|
and content = #{content}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into message_config(id, cn_name, content, create_time, update_time)
|
||||||
|
values (#{id}, #{cnName}, #{content}, #{createTime}, #{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into message_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null">
|
||||||
|
cn_name,
|
||||||
|
</if>
|
||||||
|
<if test="content != null">
|
||||||
|
content,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null">
|
||||||
|
#{cnName},
|
||||||
|
</if>
|
||||||
|
<if test="content != null">
|
||||||
|
#{content},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update message_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
cn_name = #{cnName},
|
||||||
|
content = #{content},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update message_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="cnName != null and cnName != ''">
|
||||||
|
cn_name = #{cnName},
|
||||||
|
</if>
|
||||||
|
<if test="content != null and content != ''">
|
||||||
|
content = #{content},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from message_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,285 @@
|
||||||
|
<?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.jepsoninfo.dao.WagonBalanceConfigDao">
|
||||||
|
|
||||||
|
<resultMap type="com.jepsoninfo.entity.WagonBalanceConfig" id="BaseResultMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="portName" column="port_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="baudRate" column="baud_rate" jdbcType="INTEGER"/>
|
||||||
|
<result property="dataBits" column="data_bits" jdbcType="INTEGER"/>
|
||||||
|
<result property="parity" column="parity" jdbcType="INTEGER"/>
|
||||||
|
<result property="stopBits" column="stop_bits" jdbcType="INTEGER"/>
|
||||||
|
<result property="laneName" column="lane_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="verNo" column="ver_no" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="BaseResultMapEx" extends="BaseResultMap" type="com.jepsoninfo.entity.ex.WagonBalanceConfigEx">
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, port_name, baud_rate, data_bits, parity, stop_bits, lane_name, ver_no, create_time, update_time </sql>
|
||||||
|
|
||||||
|
<select id="selectByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from wagon_balance_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.portName != null and cond.portName != ''">
|
||||||
|
and port_name = #{cond.portName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.baudRate != null">
|
||||||
|
and baud_rate = #{cond.baudRate}
|
||||||
|
</if>
|
||||||
|
<if test="cond.dataBits != null">
|
||||||
|
and data_bits = #{cond.dataBits}
|
||||||
|
</if>
|
||||||
|
<if test="cond.parity != null">
|
||||||
|
and parity = #{cond.parity}
|
||||||
|
</if>
|
||||||
|
<if test="cond.stopBits != null">
|
||||||
|
and stop_bits = #{cond.stopBits}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByCond" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from wagon_balance_config
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="cond.id != null">
|
||||||
|
and id = #{cond.id}
|
||||||
|
</if>
|
||||||
|
<if test="cond.portName != null and cond.portName != ''">
|
||||||
|
and port_name = #{cond.portName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.baudRate != null">
|
||||||
|
and baud_rate = #{cond.baudRate}
|
||||||
|
</if>
|
||||||
|
<if test="cond.dataBits != null">
|
||||||
|
and data_bits = #{cond.dataBits}
|
||||||
|
</if>
|
||||||
|
<if test="cond.parity != null">
|
||||||
|
and parity = #{cond.parity}
|
||||||
|
</if>
|
||||||
|
<if test="cond.stopBits != null">
|
||||||
|
and stop_bits = #{cond.stopBits}
|
||||||
|
</if>
|
||||||
|
<if test="cond.laneName != null and cond.laneName != ''">
|
||||||
|
and lane_name = #{cond.laneName}
|
||||||
|
</if>
|
||||||
|
<if test="cond.verNo != null and cond.verNo != ''">
|
||||||
|
and ver_no = #{cond.verNo}
|
||||||
|
</if>
|
||||||
|
<if test="cond.createTime != null and cond.createTime != ''">
|
||||||
|
and create_time = #{cond.createTime}
|
||||||
|
</if>
|
||||||
|
<if test="cond.updateTime != null and cond.updateTime != ''">
|
||||||
|
and update_time = #{cond.updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--查询单个-->
|
||||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMapEx">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from wagon_balance_config
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--统计总行数-->
|
||||||
|
<select id="selectCountByCond" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from wagon_balance_config
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="portName != null and portName != ''">
|
||||||
|
and port_name = #{portName}
|
||||||
|
</if>
|
||||||
|
<if test="baudRate != null">
|
||||||
|
and baud_rate = #{baudRate}
|
||||||
|
</if>
|
||||||
|
<if test="dataBits != null">
|
||||||
|
and data_bits = #{dataBits}
|
||||||
|
</if>
|
||||||
|
<if test="parity != null">
|
||||||
|
and parity = #{parity}
|
||||||
|
</if>
|
||||||
|
<if test="stopBits != null">
|
||||||
|
and stop_bits = #{stopBits}
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
and lane_name = #{laneName}
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
and ver_no = #{verNo}
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
and create_time = #{createTime}
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
and update_time = #{updateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into wagon_balance_config(id, port_name, baud_rate, data_bits, parity, stop_bits, lane_name, ver_no,
|
||||||
|
create_time, update_time)
|
||||||
|
values (#{id}, #{portName}, #{baudRate}, #{dataBits}, #{parity}, #{stopBits}, #{laneName}, #{verNo},
|
||||||
|
#{createTime}, #{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertSelective" keyProperty="id" useGeneratedKeys="true">
|
||||||
|
insert into wagon_balance_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="portName != null">
|
||||||
|
port_name,
|
||||||
|
</if>
|
||||||
|
<if test="baudRate != null">
|
||||||
|
baud_rate,
|
||||||
|
</if>
|
||||||
|
<if test="dataBits != null">
|
||||||
|
data_bits,
|
||||||
|
</if>
|
||||||
|
<if test="parity != null">
|
||||||
|
parity,
|
||||||
|
</if>
|
||||||
|
<if test="stopBits != null">
|
||||||
|
stop_bits,
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
lane_name,
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
ver_no,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
<if test="portName != null">
|
||||||
|
#{portName},
|
||||||
|
</if>
|
||||||
|
<if test="baudRate != null">
|
||||||
|
#{baudRate},
|
||||||
|
</if>
|
||||||
|
<if test="dataBits != null">
|
||||||
|
#{dataBits},
|
||||||
|
</if>
|
||||||
|
<if test="parity != null">
|
||||||
|
#{parity},
|
||||||
|
</if>
|
||||||
|
<if test="stopBits != null">
|
||||||
|
#{stopBits},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null">
|
||||||
|
#{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null">
|
||||||
|
#{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKey">
|
||||||
|
update wagon_balance_config
|
||||||
|
<set>
|
||||||
|
id = #{id},
|
||||||
|
port_name = #{portName},
|
||||||
|
baud_rate = #{baudRate},
|
||||||
|
data_bits = #{dataBits},
|
||||||
|
parity = #{parity},
|
||||||
|
stop_bits = #{stopBits},
|
||||||
|
lane_name = #{laneName},
|
||||||
|
ver_no = #{verNo},
|
||||||
|
create_time = #{createTime},
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update wagon_balance_config
|
||||||
|
<set>
|
||||||
|
<if test="id != null">
|
||||||
|
id = #{id},
|
||||||
|
</if>
|
||||||
|
<if test="portName != null and portName != ''">
|
||||||
|
port_name = #{portName},
|
||||||
|
</if>
|
||||||
|
<if test="baudRate != null">
|
||||||
|
baud_rate = #{baudRate},
|
||||||
|
</if>
|
||||||
|
<if test="dataBits != null">
|
||||||
|
data_bits = #{dataBits},
|
||||||
|
</if>
|
||||||
|
<if test="parity != null">
|
||||||
|
parity = #{parity},
|
||||||
|
</if>
|
||||||
|
<if test="stopBits != null">
|
||||||
|
stop_bits = #{stopBits},
|
||||||
|
</if>
|
||||||
|
<if test="laneName != null and laneName != ''">
|
||||||
|
lane_name = #{laneName},
|
||||||
|
</if>
|
||||||
|
<if test="verNo != null and verNo != ''">
|
||||||
|
ver_no = #{verNo},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null and createTime != ''">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--通过主键删除-->
|
||||||
|
<delete id="deleteByPrimaryKey">
|
||||||
|
delete
|
||||||
|
from wagon_balance_config
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue