Commit 5968d48e by 李东升

挺划算道闸云平台init初始化V1.0(详见help.md)

parents
# Created by .ignore support plugin (hsz.mobi)
### Maven template
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
mvnw
mvnw.cmd
.mvn
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar
### Eclipse template
.metadata
deploy/bin/!src/main/bin
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### SVN template
.svn/
.idea/
#忽略maven编译的target文件夹
target/
.mvn/
test
!/build/dev/*/*.tar.gz
!/build/release/*/*.tar.gz
!/.gitignore
!/deploy/lib/*
\ No newline at end of file
# 停划算道闸通用云平台
##### 目前代码中包含智慧安放小区易停易行的处理逻辑,包名统一为zhaf,之后可以抽离出来。
### 1 说明
#### 初始版本(只用到道闸方面提供的开闸接口,其他(类似请求费用,支付同步)全部我们平台自己实现)
### 1 完成功能
#### 请求费用、支付同步(支持场内付、出口付)、会员相关操作、人工收费开闸。
<?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>1.5.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.huaching.parking.local</groupId>
<artifactId>parking_local_general</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>parking_local_general</name>
<description>停划算通用的道闸接口规范服务</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>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.61</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<!--mysql依赖-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
<!--数据库连接池-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.17</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.10</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.13.Final</version>
</dependency>
<dependency>
<groupId>com.huaching</groupId>
<artifactId>ths-report-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--mybatis依赖-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
<!--AOP依赖,此依赖已包含AspectJ相关依赖包。-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<version>2.0.6.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
</archive>
<excludes>
<exclude>**/logback-spring.xml</exclude>
<exclude>**/init.sql</exclude>
<exclude>**/application.yml</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>${project.name}</finalName>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor><!--配置描述文件路径-->
</descriptors>
</configuration>
<executions>
<execution><!-- 配置执行器 -->
<id>make-assembly</id>
<phase>package</phase><!-- 绑定到package生命周期阶段上 -->
<goals>
<goal>single</goal><!-- 只运行一次 -->
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <compilerArgument>-parameters</compilerArgument>&lt;!&ndash;重点配置&ndash;&gt;-->
<!-- <source>1.8</source>&lt;!&ndash;重点配置&ndash;&gt;-->
<!-- <target>1.8</target>&lt;!&ndash;重点配置&ndash;&gt;-->
<!-- <encoding>UTF-8</encoding>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</build>
</project>
<assembly>
<id>release</id>
<formats>
<format>tar.gz</format><!--打包的文件格式,也可以有:war zip-->
</formats>
<!--tar.gz压缩包下是否生成和项目名相同的根目录-->
<includeBaseDirectory>true</includeBaseDirectory>
<dependencySets>
<dependencySet>
<!--是否把本项目添加到依赖文件夹下-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<!--将scope为runtime的依赖包打包-->
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
</includes>
<outputDirectory>config</outputDirectory>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
#!/bin/sh
basepath=$(dirname "$PWD")
APP_HOME=$basepath
#JDK所在路径
JAVA_HOME=/usr/lib/jvm/jre/bin/java
#JAVA_HOME=/usr/bin/java
#执行程序启动所使用的系统用户,考虑到安全,推荐不使用root帐号
RUNNING_USER=root
#需要启动的Java主程序(main方法类)
APP_MAINCLASS=com.huaching.parking.local.parking_local_general.ParkingLocalGeneralApplication
#拼凑完整的classpath参数,包括指定lib目录下所有的jar
CLASSPATH=$APP_HOME
for i in "$APP_HOME"/lib/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
for i in "$APP_HOME"/config/*; do
CLASSPATH="$CLASSPATH":"$i"
done
#java虚拟机启动参数
JAVA_OPTS="-ms512m -mx512m -Xmn60m"
###################################
#(函数)判断程序是否已启动
#
#说明:
#使用JDK自带的JPS命令及grep命令组合,准确查找pid
#jps 加 l 参数,表示显示java的完整包路径
#使用awk,分割出pid ($1部分),及Java程序名称($2部分)
###################################
#初始化psid变量(全局)
psid=0
checkpid() {
#javaps=`$JAVA_HOME/bin/jps -l | grep $APP_MAINCLASS`
javaps=`ps -ef|grep $APP_MAINCLASS | grep -v 'grep ' | awk '{print $2}'`
if [ -n "$javaps" ]; then
psid=$javaps
else
psid=0
fi
echo "check pid : $psid"
}
###################################
#(函数)启动程序
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则提示程序已启动
#3. 如果程序没有被启动,则执行启动命令行
#4. 启动命令执行后,再次调用checkpid函数
#5. 如果步骤4的结果能够确认程序的pid,则打印[OK],否则打印[Failed]
#注意:echo -n 表示打印字符后,不换行
#注意: "nohup 某命令 >/dev1/null 2>&1 &" 的用法
###################################
start() {
checkpid
if [ $psid -ne 0 ]; then
echo "================================"
echo "warn: $APP_MAINCLASS already started! (pid=$psid)"
echo "================================"
else
echo -n "Starting $APP_MAINCLASS ..."
echo $CLASSPATH
JAVA_CMD="$JAVA_HOME $JAVA_OPTS -Denv_home=$APP_HOME -Dlogging.config=$APP_HOME/config/logback-spring.xml -classpath $CLASSPATH $APP_MAINCLASS &"
su - $RUNNING_USER -c "$JAVA_CMD"
## checkpid
if [ $psid -ne 0 ]; then
echo "(pid=$psid) [OK]"
else
echo "[Failed]"
fi
fi
}
###################################
#(函数)停止程序
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则开始执行停止,否则,提示程序未运行
#3. 使用kill -9 pid命令进行强制杀死进程
#4. 执行kill命令行紧接其后,马上查看上一句命令的返回值: $?
#5. 如果步骤4的结果$?等于0,则打印[OK],否则打印[Failed]
#6. 为了防止java程序被启动多次,这里增加反复检查进程,反复杀死的处理(递归调用stop)。
#注意:echo -n 表示打印字符后,不换行
#注意: 在shell编程中,"$?" 表示上一句命令或者一个函数的返回值
###################################
stop() {
checkpid
if [ $psid -ne 0 ]; then
echo -n "Stopping $APP_MAINCLASS ...(pid=$psid) "
su - $RUNNING_USER -c "kill -9 $psid"
if [ $? -eq 0 ]; then
echo "[OK]"
else
echo "[Failed]"
fi
checkpid
if [ $psid -ne 0 ]; then
stop
fi
else
echo "================================"
echo "warn: $APP_MAINCLASS is not running"
echo "================================"
fi
}
stop1() {
## checkpid
if [ $psid -ne 0 ]; then
echo "================================"
echo "warn: $APP_MAINCLASS already started! (pid=$psid)"
echo "================================"
else
echo -n "Stopping $APP_MAINCLASS ...(pid=$psid) "
JAVA_CMD="$JAVA_HOME/bin/java $JAVA_OPTS -Dinstall.home=$APP_HOME -classpath $CLASSPATH $APP_MAINCLASS stop"
su - $RUNNING_USER -c "$JAVA_CMD"
## checkpid
fi
}
###################################
#(函数)检查程序运行状态
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则提示正在运行并表示出pid
#3. 否则,提示程序未运行
###################################
status() {
checkpid
if [ $psid -ne 0 ]; then
echo "$APP_MAINCLASS is running! (pid=$psid)"
else
echo "$APP_MAINCLASS is not running"
fi
}
###################################
#(函数)打印系统环境参数
###################################
info() {
echo "System Information:"
echo "****************************"
echo `head -n 1 /etc/issue`
echo `uname -a`
echo
echo "JAVA_HOME=$JAVA_HOME"
echo `$JAVA_HOME/bin/java -version`
echo
echo "APP_HOME=$APP_HOME"
echo "APP_MAINCLASS=$APP_MAINCLASS"
echo "****************************"
}
###################################
#读取脚本的第一个参数($1),进行判断
#参数取值范围:{start|stop|restart|status|info}
#如参数不在指定范围之内,则打印帮助信息
###################################
case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
'info')
info
;;
*)
echo "Usage: $0 {start|stop|restart|status|info}"
exit 1
esac
exit 0
@echo off
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
set ENV_PATH=.\
if "%OS%" == "Windows_NT" set ENV_PATH=%~dp0%
set log_dir=%ENV_PATH%\..\logs
set conf_dir=%ENV_PATH%\..\config
set logback_configurationFile=%conf_dir%\logback-spring.xml
set CLASSPATH=%conf_dir%
set CLASSPATH=%conf_dir%\..\lib\*;%CLASSPATH%
set JAVA_MEM_OPTS= -Xms128m -Xmx512m
set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8
set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9099,server=y,suspend=n
set CANAL_OPTS= -Denv_home="%log_dir%" -Dlogback.configurationFile="%logback_configurationFile%"
set JAVA_OPTS= %JAVA_MEM_OPTS% %JAVA_OPTS_EXT% %JAVA_DEBUG_OPT% %CANAL_OPTS%
set CMD_STR= java %JAVA_OPTS% -classpath "%CLASSPATH%" java %JAVA_OPTS% -classpath "%CLASSPATH%" com.huaching.parking.local.ParkingKTLocalApplication
echo start cmd : %CMD_STR%
java %JAVA_OPTS% -classpath "%CLASSPATH%" com.huaching.parking.local.parking_local_general.ParkingLocalGeneralApplication
\ No newline at end of file
package com.huaching.parking.local.parking_local_general;
import com.huaching.parking.transfer.config.EventConfiguration;
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.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableTransactionManagement
@ComponentScan(basePackages = {"com.huaching.parking.local.parking_local_general", "com.huaching.parking.transfer"})
@Import({EventConfiguration.class})
@MapperScan(basePackages = {"com.huaching.parking.local.parking_local_general.mapper.local", "com.huaching.parking.transfer.mapper"})
public class ParkingLocalGeneralApplication {
public static void main(String[] args) {
SpringApplication.run(ParkingLocalGeneralApplication.class, args);
}
}
package com.huaching.parking.local.parking_local_general;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* api接口管理 访问:ip:port/web name/swagger-ui.html
*
* @author admin
*/
@EnableSwagger2
@Configuration
public class Swagger2 {
@Bean
public Docket createRestApi() {
// ParameterBuilder tokenPar = new ParameterBuilder();
// List<Parameter> pars = new ArrayList<Parameter>();
// tokenPar.name("USER-TOKEN").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
// pars.add(tokenPar.build());
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.huaching.parking.local.parking_local_general.controller"))
.paths(PathSelectors.any())
.build();
// .globalOperationParameters(pars);
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("道闸云平台")
.description(" 道闸云平台 API")
.termsOfServiceUrl("道闸云平台")
.version("1.0")
.build();
}
}
package com.huaching.parking.local.parking_local_general.config.local;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* @program: parking_local_general
* @description: 全局异常处理类
* @author: lidongsheng
* @createData: 2020-04-20 18:20
* @updateAuthor: lidongsheng
* @updateData: 2020-04-20 18:20
* @updateContent: 全局异常处理类
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@RestControllerAdvice
public class ExceptionControllerAdvice {
/**
* 接口请求参数校验不通过
* @param e
* @return
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseResult MethodArgumentNotValidExceptionHandler(MethodArgumentNotValidException e) {
// 从异常对象中拿到ObjectError对象
ObjectError objectError = e.getBindingResult().getAllErrors().get(0);
// 然后提取错误提示信息进行返回
return ResponseResult.responseFail(ReasonCodeEnums.REQUEST_PARM_VALID_DEFEAT,objectError.getDefaultMessage());
}
}
package com.huaching.parking.local.parking_local_general.config.local;//package com.huaching.parking.local.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* @program: ths-web
* @description:
* @author: lidongsheng
* @createData: 2019-12-17 18:10
* @updateAuthor: lidongsheng
* @updateData: 2019-12-17 18:10
* @updateContent:
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2019. All rights reserved
* ************************************************
*/
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
package com.huaching.parking.local.parking_local_general.config.zhaf;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @program: parking_local_general
* @description:
* @author: lidongsheng
* @createData: 2020-04-17 18:44
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 18:44
* @updateContent:
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Component
@ConfigurationProperties(prefix = "dz")
public class DZConfig {
private static String address;
private static String user;
private static String pwd;
private static String key;
private static String parkCode;
private static String saveImgUrl;
public static String getSaveImgUrl() {
return saveImgUrl;
}
public static void setSaveImgUrl(String saveImgUrl) {
DZConfig.saveImgUrl = saveImgUrl;
}
public static String getAddress() {
return address;
}
public void setAddress(String address) {
DZConfig.address = address;
}
public static String getUser() {
return user;
}
public void setUser(String user) {
DZConfig.user = user;
}
public static String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
DZConfig.pwd = pwd;
}
public static String getKey() {
return key;
}
public void setKey(String key) {
DZConfig.key = key;
}
public static String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
DZConfig.parkCode = parkCode;
}
}
package com.huaching.parking.local.parking_local_general.config.zhaf;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpRequest;
import org.apache.http.NoHttpResponseException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.methods.HttpRequestWrapper;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.protocol.HttpContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.UnknownHostException;
/**
* @program: ths-scheduller
* @description: RestTemplate连接池调用
* @author: lidongsheng
* @createData: 2019-12-09 17:02
* @updateAuthor: lidongsheng
* @updateData: 2019-12-09 17:02
* @updateContent:
* @Version: 1.0.0
*/
@Configuration
public class RestTemplatePoolConfig {
@Autowired
private RestTemplateBuilder builder;
private static final Logger logger = LoggerFactory.getLogger(RestTemplatePoolConfig.class);
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate = builder.build();
restTemplate.setRequestFactory(clientHttpRequestFactory(3000, 3000, 10000));
return restTemplate;
}
/**
* 链接线程池管理,可以keep-alive不断开链接请求,这样速度会更快
* MaxTotal 连接池最大连接数
* DefaultMaxPerRoute 每个主机的并发
* ValidateAfterInactivity 可用空闲连接过期时间,重用空闲连接时会先检查是否空闲时间超过这个时间,如果超过,释放socket重新建立
*/
private HttpClient getHttpClient() {
PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
poolingConnectionManager.setMaxTotal(1000);
poolingConnectionManager.setDefaultMaxPerRoute(500);
poolingConnectionManager.setValidateAfterInactivity(30000);
/**
* 设置HTTP连接管理器,连接池相关配置管理
*/
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
httpClientBuilder.setConnectionManager(poolingConnectionManager);
httpClientBuilder.setRetryHandler((e, i, httpContext) -> {
HttpRequestWrapper httpRequestWrapper = (HttpRequestWrapper) httpContext.getAttribute("http.request");
if (i > 2) {
logger.error("【连接重试】 超过2次 放弃请求:" + httpRequestWrapper.getOriginal().toString());
return false;
}
logger.error("【连接重试】 第 {} 次重试请求 -> {}:", i, httpRequestWrapper.getOriginal().toString());
if (e instanceof NoHttpResponseException) {
//服务器没有响应,可能是服务器断开了连接,应该重试
logger.error("【连接重试】 服务器没有响应 重试:" + httpRequestWrapper.getOriginal().toString());
return true;
}
if (e instanceof SSLHandshakeException) {
// SSL握手异常
logger.error("【连接重试】 SSL握手异常 重试:" + httpRequestWrapper.getOriginal().toString());
return false;
}
if (e instanceof InterruptedIOException) {
//超时
logger.error("【连接重试】 超时 重试:" + httpRequestWrapper.getOriginal().toString());
return true;
}
if (e instanceof UnknownHostException) {
// 服务器不可达
logger.error("【连接重试】 服务器不可达 不重试:" + httpRequestWrapper.getOriginal().toString());
return false;
}
if (e instanceof ConnectTimeoutException) {
// 连接超时
logger.error("【连接重试】 连接超时 重试:" + httpRequestWrapper.getOriginal().toString());
return true;
}
if (e instanceof SSLException) {
logger.error("【连接重试】 SSLException 不重试:" + httpRequestWrapper.getOriginal().toString());
return false;
}
logger.error("未知IOException异常:" + e.getMessage());
HttpClientContext context = HttpClientContext.adapt(httpContext);
HttpRequest request = context.getRequest();
if (!(request instanceof HttpEntityEnclosingRequest)) {
logger.error("【连接重试】 请求不是关闭连接的请求 重试:" + httpRequestWrapper.getOriginal().toString());
//如果请求不是关闭连接的请求
return true;
}
logger.error("【连接重试】 不重试:" + httpRequestWrapper.getOriginal().toString());
return false;
});
return httpClientBuilder.build();
}
/**
* 客户端请求连接策略
*
* @param ConnectTimeout 指客户端和服务器建立连接的timeout,
* @param ReadTimeout 指客户端从服务器读取数据的timeout
* @param ConnectionRequestTimeout 指从连接池获取连接的timeout
* @return
*/
private ClientHttpRequestFactory clientHttpRequestFactory(int ConnectTimeout, int ReadTimeout, int ConnectionRequestTimeout) {
HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory();
clientHttpRequestFactory.setHttpClient(getHttpClient());
// 连接超时时间/毫秒
clientHttpRequestFactory.setConnectTimeout(ConnectTimeout);
// 读写超时时间/毫秒
clientHttpRequestFactory.setReadTimeout(ReadTimeout);
// 请求超时时间/毫秒
clientHttpRequestFactory.setConnectionRequestTimeout(ConnectionRequestTimeout);
return clientHttpRequestFactory;
}
}
package com.huaching.parking.local.parking_local_general.controller.local;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ManualCarOutDTO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.response.ThsChannelMeeageDTO;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.LocalCarInAndOutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @program: parking_local_general
* @description: 通道相关的controller
* @author: lidongsheng
* @createData: 2020-05-11 11:31
* @updateAuthor: lidongsheng
* @updateData: 2020-05-11 11:31
* @updateContent: 通道相关的controller
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Api(value = "云平台 通道相关操作接口controller")
@RestController
@RequestMapping(value = "/ths/request/channel")
public class ChannelController {
private static final Logger logger = LoggerFactory.getLogger(ChannelController.class);
@Autowired
private LocalCarInAndOutService localCarInAndOutService;
/**
* 根据车场编号和通道编号获得通道详细信息
*
* @return
*/
@ApiOperation(value = "人工收费(场内付填写carNo,出口填写channelCode或者carNo都行)")
@PostMapping("/manualCarOut")
@GeneralPrintLogAOP(value = "人工收费接口")
public ResponseResult manualCharge(@RequestBody ManualCarOutDTO manualCarOutDTO) {
return localCarInAndOutService.manualCharge(manualCarOutDTO);
}
}
package com.huaching.parking.local.parking_local_general.controller.local;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.local.dto.response.ThsChannelMeeageDTO;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.base.ChannelMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @program: parking_local_general
* @description: 停车场信息相关接口(下行)
* @author: lidongsheng
* @createData: 2020-04-17 11:41
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 11:41
* @updateContent: 请求controller
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Api(value = "云平台 停车场信息相关下行接口controller")
@RestController
@RequestMapping(value = "/ths/request/parkMessage")
public class ParkMessageController {
private static final Logger logger = LoggerFactory.getLogger(ParkMessageController.class);
@Autowired
private ChannelMessageService channelMessageService;
/**
* 根据车场编号和通道编号获得通道详细信息
*
* @return
*/
@ApiOperation(value = "根据车场编号和通道编号获得通道详细信接口")
@PostMapping("/getChannelMessage")
@GeneralPrintLogAOP(value = "根据车场编号和通道编号获得通道详细信接口", jsonSubs = {-1})
public ResponseResult getChannelMessage(@RequestBody String parkCode, @RequestBody String channelCode) {
logger.info("根据车场编号和通道编号获得通道详细信息 parkCode -> {} , channelCode -> {}", parkCode, channelCode);
ThsChannelMeeageDTO thsChannelMeeageDTO = ThsChannelMeeageDTO.poConvertToDto(channelMessageService.getChannelMessage(parkCode, channelCode));
if (thsChannelMeeageDTO != null) {
return ResponseResult.Builder.init().setData(JSON.toJSONString(thsChannelMeeageDTO)).build();
} else {
logger.error("根据车场编号和通道编号未查询到通道详细信息 parkCode -> {} , channelCode -> {}", parkCode, channelCode);
return ResponseResult.Builder.init().setFailMessage(ReasonCodeEnums.EMPTY_RESULT, "无此通道信息").build();
}
}
}
package com.huaching.parking.local.parking_local_general.controller.local;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ThsPaySyncDTO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.response.ThsRequestChargeDTO;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.PaymentChargesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* @program: parking_local_general
* @description: 费用支付相关接口(下行)
* @author: lidongsheng
* @createData: 2020-04-22 10:27
* @updateAuthor: lidongsheng
* @updateData: 2020-04-22 10:27
* @updateContent: 费用支付相关接口(下行)
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Api(value = "云平台 费用支付相关下行接口controller")
@RestController
@RequestMapping(value = "/ths/request/paymentCharges")
public class PaymentChargesController {
private static final Logger logger = LoggerFactory.getLogger(PaymentChargesController.class);
@Autowired
private PaymentChargesService paymentChargesService;
/**
* 根据车场编号和车牌号获得费用信息
*
* @return
*/
@ApiOperation(value = "根据车场编号和车牌号获得费用信息接口")
@PostMapping("/requestCharge")
@GeneralPrintLogAOP(value = "根据车场编号和车牌号获得费用信息接口", jsonSubs = {-1})
public ResponseResult requestCharge(String parkCode, String carNo) {
ThsRequestChargeDTO thsRequestChargeDTO = paymentChargesService.requestCharge(parkCode, carNo, null);
if (thsRequestChargeDTO.getCode() != 1) {
return ResponseResult.Builder.init().setData(thsRequestChargeDTO).build();
} else {
return ResponseResult.responseFail(ReasonCodeEnums.UNKNOWN, "请求费用失败");
}
}
/**
* 支付同步接口
*
* @return
*/
@ApiOperation(value = "支付同步接口")
@PostMapping("/paySync")
@GeneralPrintLogAOP(value = "支付同步接口")
public ResponseResult paySync(@RequestBody @Valid ThsPaySyncDTO thsPaySyncDTO) {
return paymentChargesService.paySync(thsPaySyncDTO);
}
}
package com.huaching.parking.local.parking_local_general.controller.local;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ThsCarInDTO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ThsCarOutDTO;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsCarAdvanceInOutRecordsPO;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.LocalCarInAndOutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* @program: parking_local_general
* @description: 接受所有本地的(例如科拓、红门、智慧安防小区等)上行接口controller
* @author: lidongsheng
* @createData: 2020-04-17 11:40
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 11:40
* @updateContent: 上报controller
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Api(value = "云平台 各个对接方统一上报接收controller")
@RestController
@RequestMapping(value = "/ths/report")
public class ReceiveReportController {
private Logger logger = LoggerFactory.getLogger(ReceiveReportController.class);
@Autowired
private LocalCarInAndOutService localCarInAndOutService;
/**
* 入场记录上报
*
* @return
*/
@ApiOperation(value = "各道闸入场上报接收接口")
@PostMapping("/carIn")
@GeneralPrintLogAOP(value = "各道闸入场上报接收接口")
public ResponseResult carIn(@RequestBody @Valid ThsCarInDTO thsCarInDTO) {
return localCarInAndOutService.carIn(thsCarInDTO);
}
/**
* 出场记录上报
*
* @return
*/
@ApiOperation(value = "各道闸出场上报接收接口")
@PostMapping("/carOut")
@GeneralPrintLogAOP(value = "各道闸出场上报接收接口")
public ResponseResult carOut(@RequestBody @Valid ThsCarOutDTO thsCarOutDTO) {
return localCarInAndOutService.carOut(thsCarOutDTO);
}
/**
* 预出入场记录上报
*
* @return
*/
@ApiOperation(value = "各道闸预出入场上报接收接口")
@PostMapping("/carAdvanceInOut")
@GeneralPrintLogAOP(value = "各道闸预出入场上报接收接口")
public ResponseResult carAdvanceInOut(@RequestBody @Valid ThsCarAdvanceInOutRecordsPO thsCarAdvanceInOutRecordsPO) {
return localCarInAndOutService.carAdvanceInOut(thsCarAdvanceInOutRecordsPO);
}
}
package com.huaching.parking.local.parking_local_general.controller.zhaf;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.zhaf.dto.BarriergateReportDTO;
import com.huaching.parking.local.parking_local_general.service.zhaf.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @program: parking_local_general
* @description: 智慧安防小区上报controller
* @author: lidongsheng
* @createData: 2020-04-14 13:36
* @updateAuthor: lidongsheng
* @updateData: 2020-04-14 13:36
* @updateContent: 智慧安防小区上报controller
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Api(value = "智慧安防 道闸上报接收controller")
@RestController
@RequestMapping(value ="/zhaf/report")
public class ReportController {
private static final Logger logger = LoggerFactory.getLogger(ReportController.class);
@Autowired
private ReportService reportService;
/**
* 道闸过车上报
* @return
*/
@ApiOperation(value="道闸过车上报controller")
@RequestMapping(value = "/barriergateReport", method = RequestMethod.POST)
public ResponseResult barriergateReport(@RequestBody BarriergateReportDTO barriergateReportDTO){
return reportService.barriergateReport(barriergateReportDTO);
}
public static void main(String[] args) {
logger.info("ssssssssssss");
}
}
package com.huaching.parking.local.parking_local_general.controller.zhaf;
import com.huaching.parking.local.parking_local_general.config.zhaf.DZConfig;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.zhaf.ResponseResultZHAF;
import com.huaching.parking.local.parking_local_general.domain.zhaf.dto.*;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.zhaf.RemoteRequestService;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import com.huaching.parking.local.parking_local_general.util.zhaf.Base64Utils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 下行接口controller
* @author: lidongsheng
* @createData: 2020-04-17 11:41
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 11:41
* @updateContent: 请求controller
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Api(value = "智慧安防 下行controller")
@RestController
@RequestMapping(value = "/zhaf/request")
public class RequestController {
private static final String SAVE_IMG_ROOT_URL = "barriergateReport/";
private static final Logger logger = LoggerFactory.getLogger(RequestController.class);
@Autowired
private RemoteRequestService remoteRequestService;
/**
* 注册设备
*
* @return
*/
@ApiOperation(value = "注册设备")
@RequestMapping(value = "/registerDevice", method = RequestMethod.POST)
public ResponseResultZHAF registerDevice(@RequestBody RegisterDeviceDTO registerDeviceDTO) {
return remoteRequestService.registerDevice(registerDeviceDTO);
}
/**
* 订阅数据
*
* @return
*/
@ApiOperation(value = "订阅数据")
@RequestMapping(value = "/subscription", method = RequestMethod.POST)
public ResponseResultZHAF subscription(@RequestBody SubscriptionDTO subscriptionDTO) {
return remoteRequestService.subscription(subscriptionDTO);
}
/**
* 订阅数据
*
* @return
*/
@ApiOperation(value = "删除订阅数据")
@RequestMapping(value = "/deleteSubscription", method = RequestMethod.POST)
public ResponseResultZHAF deleteSubscription(@RequestBody SubscriptionDTO subscriptionDTO) {
return remoteRequestService.deleteSubscription(subscriptionDTO);
}
/**
* 控制道闸
*
* @return
*/
@ApiOperation(value = "控制道闸")
@RequestMapping(value = "/controlBarrierGate", method = RequestMethod.POST)
@GeneralPrintLogAOP(value = "控制道闸", jsonSubs = {-1})
public ResponseResult controlBarrierGate(String deviceCode, Integer type) {
return remoteRequestService.controlBarrierGate(deviceCode, type);
}
/**
* 设备关联关系新增与修改(存在则修改,不存在则新增)
*
* @return
*/
@ApiOperation(value = "设备关联关系新增与修改(存在则修改,不存在则新增)")
@RequestMapping(value = "/bindDevice", method = RequestMethod.POST)
public ResponseResultZHAF bindDevice(@RequestBody BindDeviceDTO bindDeviceDTO) {
return remoteRequestService.bindDevice(bindDeviceDTO);
}
/**
* 删除设备
*
* @return
*/
@ApiOperation(value = "删除设备")
@RequestMapping(value = "/deleteDevice", method = RequestMethod.POST)
public ResponseResultZHAF deleteDevice(@RequestBody DeleteDeviceDTO deleteDeviceDTO) {
return remoteRequestService.deleteDevice(deleteDeviceDTO);
}
/**
* 控制抓拍机的开闸模式
*
* @return
*/
@ApiOperation(value = "控制抓拍机的开闸模式")
@RequestMapping(value = "/ctrlMode", method = RequestMethod.POST)
public ResponseResultZHAF ctrlMode(String deviceCode, Integer type) {
return remoteRequestService.ctrlMode(deviceCode, type);
}
/**
* base64转换为图片测试
*
* @return
*/
@ApiOperation(value = "saveImgBase64")
@RequestMapping(value = "/saveImgBase64", method = RequestMethod.POST)
public ResponseResult saveImgBase64(@RequestBody String imageStr) {
String date = DateUtils.dateFormatToString(new Date(), 3);
String saveUrl = DZConfig.getSaveImgUrl() + SAVE_IMG_ROOT_URL + date;
if (Base64Utils.GenerateImage(imageStr, saveUrl, System.currentTimeMillis() + ".jpg")) {
return ResponseResult.responseOK();
}
return ResponseResult.responseFail(ReasonCodeEnums.UNKNOWN, "转换错误");
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.huaching.parking.local.parking_local_general.domain;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import java.io.Serializable;
public class ResponseResult<T> implements Serializable {
public static final int ERROR = 0;
public static final int SUCCESS = 1;
private Integer completeCode;
private Integer reasonCode;
private String reasonMessage;
private T data;
/**
* 外部不要直接new对象
*/
private ResponseResult(Builder<T> builder) {
this.reasonCode = builder.reasonCode;
this.reasonMessage = builder.reasonMessage;
this.completeCode = builder.completeCode;
this.data = builder.data;
}
@Deprecated
public ResponseResult() {
}
public Integer getCompleteCode() {
return completeCode;
}
public Integer getReasonCode() {
return reasonCode;
}
public String getReasonMessage() {
return reasonMessage;
}
public T getData() {
return data;
}
@Deprecated
public ResponseResult<T> setCompleteCode(Integer completeCode) {
this.completeCode = completeCode;
return this;
}
@Deprecated
public ResponseResult<T> setReasonCode(Integer reasonCode) {
this.reasonCode = reasonCode;
return this;
}
@Deprecated
public ResponseResult<T> setReasonMessage(String reasonMessage) {
this.reasonMessage = reasonMessage;
return this;
}
@Deprecated
public ResponseResult<T> setData(T data) {
this.data = data;
return this;
}
@Override
public String toString() {
return "ResponseResult{" +
"completeCode=" + completeCode +
", reasonCode='" + reasonCode + '\'' +
", reasonMessage='" + reasonMessage + '\'' +
", data=" + (data == null ? "null" : data.toString()) +
'}';
}
public static ResponseResult responseFail(ReasonCodeEnums reasonCode, String msg) {
return ResponseResult.Builder.init().setFailMessage(reasonCode, msg).build();
}
public static ResponseResult responseFailPublic(Integer reasonCode, String msg) {
return ResponseResult.Builder.init().setFailMessage(reasonCode, msg).build();
}
public static ResponseResult responseOK() {
return ResponseResult.Builder.init().build();
}
public static class Builder<K> {
private Integer completeCode;
private Integer reasonCode;
private String reasonMessage;
private K data;
private Builder(int completeCode) {
this.completeCode = completeCode;
}
static public <K> Builder<K> init() {
return new Builder<>(SUCCESS);
}
public Builder<K> setCompleteCode(int code) {
this.completeCode = code;
return this;
}
public Builder<K> setReasonCode(Integer code) {
this.reasonCode = code;
return this;
}
public Builder<K> setReasonMessage(String msg) {
this.reasonMessage = msg;
return this;
}
public Builder<K> setFailMessage(ReasonCodeEnums reasonCode, String reasonMessage) {
this.reasonMessage = reasonMessage;
this.reasonCode = reasonCode.getCode();
this.completeCode = ERROR;
return this;
}
public Builder<K> setFailMessage(Integer reasonCode, String reasonMessage) {
this.reasonMessage = reasonMessage;
this.reasonCode = reasonCode;
this.completeCode = ERROR;
return this;
}
public Builder<K> setData(K k) {
this.data = k;
return this;
}
public ResponseResult<K> build() {
return new ResponseResult<>(this);
}
}
}
package com.huaching.parking.local.parking_local_general.domain.local.bo;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
/**
* @program: parking_local_general
* @description: 按照时间间隔计算费用
* @author: lidongsheng
* @createData: 2020-04-26 10:31
* @updateAuthor: lidongsheng
* @updateData: 2020-04-26 10:31
* @updateContent: 按照时间间隔计算费用
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ThsIntervalPayableMoney implements ThsRequestChargeAbstract{
private static final Logger logger = LoggerFactory.getLogger(ThsIntervalPayableMoney.class);
@Override
public Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime) {
String chargeDetails = thsChargingRulesPO.getChargeDetails();
return intervalPayableMoney(JSON.parseObject(chargeDetails, IntervalChargeDetail.class), inTime, thsChargingRulesPO.getFreeTime()
, thsChargingRulesPO.getMaxOneTimeMoney());
}
/**
* 按照间隔收费
*
* @param detail
* @param inTime 计费开始时间
* @param freeTime 免费时长(分钟)
* @param maxOneTimeMoney 一次停车的最高费用(单位分)
* @return
*/
public Integer intervalPayableMoney(IntervalChargeDetail detail, Date inTime,
Integer freeTime, Integer maxOneTimeMoney) {
inTime = DateUtils.getNextMinute(inTime, freeTime);
long sumMoney = 0;
switch (detail.frameType) {
//按照分钟收费
case 0:
long minute = DateUtils.subDate(inTime, new Date(), 2);
sumMoney = (minute / detail.intervalTime) * detail.money;
//按照小时收费
case 1:
long hour = DateUtils.subDate(inTime, new Date(), 3);
sumMoney = (hour / detail.intervalTime) * detail.money;
//按照固定收费
default:
sumMoney = (DateUtils.subDate(inTime, new Date(), 2) / detail.intervalTime) * detail.money;
}
sumMoney = sumMoney > maxOneTimeMoney ? maxOneTimeMoney : sumMoney;
return (int) sumMoney;
}
/**
* 按照间隔收费
* "frameType": 0 按分钟收费
* "frameType": 1 按小时收费
*/
static class IntervalChargeDetail {
private Integer money;
private Integer frameType;
//间隔时长
private Integer intervalTime;
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
public Integer getFrameType() {
return frameType;
}
public void setFrameType(Integer frameType) {
this.frameType = frameType;
}
public Integer getIntervalTime() {
return intervalTime;
}
public void setIntervalTime(Integer intervalTime) {
this.intervalTime = intervalTime;
}
}
}
package com.huaching.parking.local.parking_local_general.domain.local.bo;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 请求费用
* @author: lidongsheng
* @createData: 2020-04-26 10:28
* @updateAuthor: lidongsheng
* @updateData: 2020-04-26 10:28
* @updateContent: 请求费用
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public interface ThsRequestChargeAbstract {
Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime);
}
package com.huaching.parking.local.parking_local_general.domain.local.bo;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.service.local.MemberCarHelperService;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* @program: parking_local_general
* @description: 计算请求费用BO处理类
* @author: lidongsheng
* @createData: 2020-04-22 13:41
* @updateAuthor: lidongsheng
* @updateData: 2020-04-22 13:41
* @updateContent:
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Component
public class ThsRequestChargeBO {
private static final Logger logger = LoggerFactory.getLogger(ThsRequestChargeBO.class);
@Autowired
private MemberCarHelperService memberCarHelperService;
/**
* 计算费用
*
* @param thsChargingRulesPO
* @param inTime
* @return
*/
public Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, String carNo, Date inTime) {
String chargeDetails = thsChargingRulesPO.getChargeDetails();
logger.info("计算费用 parkCode -> {} , inTime -> {},chargeDetails -> {}", thsChargingRulesPO.getParkCode(), inTime, chargeDetails);
if (memberCarHelperService.vaildMember(thsChargingRulesPO.getParkCode(), carNo) != null) {
return 0;
}
ThsRequestChargeAbstract requestChargeAbstract = null;
switch (thsChargingRulesPO.getChargeType()) {
//按次收费
case 0:
logger.info("计算费用,按次收费 parkCode -> {} , inTime -> {}", thsChargingRulesPO.getParkCode(), inTime);
return (Integer) JSON.parseObject(chargeDetails).get("oneTimeMoney");
//按时段收费
case 1:
logger.info("计算费用,按时段收费 parkCode -> {} , inTime -> {}", thsChargingRulesPO.getParkCode(), inTime);
requestChargeAbstract = new ThsTimeFramePayableMoney();
break;
//按间隔收费
case 2:
logger.info("计算费用,按间隔收费 parkCode -> {} , inTime -> {}", thsChargingRulesPO.getParkCode(), inTime);
requestChargeAbstract = new ThsIntervalPayableMoney();
break;
}
return requestChargeAbstract.getPayableMoney(thsChargingRulesPO, inTime);
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto;
import net.bytebuddy.implementation.bind.annotation.Super;
/**
* @program: parking_local_general
* @description:
* @author: lidongsheng
* @createData: 2020-05-07 11:34
* @updateAuthor: lidongsheng
* @updateData: 2020-05-07 11:34
* @updateContent:
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public abstract class BaseDTO {
private int code = 1;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.request;
/**
* @program: parking_local_general
* @description: 人工开闸DTO
* @author: lidongsheng
* @createData: 2020-05-11 13:43
* @updateAuthor: lidongsheng
* @updateData: 2020-05-11 13:43
* @updateContent: 人工开闸DTO
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ManualCarOutDTO {
private String parkCode;
private String carNo;
private String channelNo;
private Integer payedMoney;
private String operatorUser;
private String remake;
public String getOperatorUser() {
return operatorUser;
}
public void setOperatorUser(String operatorUser) {
this.operatorUser = operatorUser;
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake;
}
public Integer getPayedMoney() {
return payedMoney;
}
public void setPayedMoney(Integer payedMoney) {
this.payedMoney = payedMoney;
}
public boolean isConstraint() {
return constraint;
}
public void setConstraint(boolean constraint) {
this.constraint = constraint;
}
/**
* true 强制开闸
* false 不强制开闸
*/
private boolean constraint;
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode;
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo;
}
public String getChannelNo() {
return channelNo;
}
public void setChannelNo(String channelNo) {
this.channelNo = channelNo;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.request;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsParkingRecordsPO;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 入场DTO
* 本地入场DTO,所有的入场上报记录都要转换为此DTO RequestDTO
* @author: lidongsheng
* @createData: 2020-04-17 13:17
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 13:17
* @updateContent: 入场上报DTO
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ThsCarInDTO {
/**
* 车场编号
*/
@NotNull(message = "parkCode 车场编号 不能为空")
private String parkCode;
/**
* 车牌号
*/
@NotNull(message = "carNo 车牌号 不能为空")
private String carNo;
/**
* 进场时间
*/
@NotNull(message = "inTime 进场时间 不能为空")
private Date inTime;
/**
* 进场的通道id
*/
@NotNull(message = "inChannelCode 进场的通道编号 不能为空")
private String inChannelCode;
/**
* 车辆类型:
* <p>
* 1 小型车
* <p>
* 2 大型车
* <p>
* 3 其他
* <p>
* 4 未识别
*/
private Integer carType;
/**
* 车辆颜色:
* <p>
* 0蓝色;1黄色;2白色;3黑色;4绿色
*/
private Integer carColor;
/**
* 入场车辆抓拍图片
*/
private String inImgUrl;
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode;
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo;
}
public Date getInTime() {
return inTime;
}
public void setInTime(Date inTime) {
this.inTime = inTime;
}
public String getInChannelCode() {
return inChannelCode;
}
public void setInChannelCode(String inChannelCode) {
this.inChannelCode = inChannelCode;
}
public Integer getCarType() {
return carType;
}
public void setCarType(Integer carType) {
this.carType = carType;
}
public Integer getCarColor() {
return carColor;
}
public void setCarColor(Integer carColor) {
this.carColor = carColor;
}
public String getInImgUrl() {
return inImgUrl;
}
public void setInImgUrl(String inImgUrl) {
this.inImgUrl = inImgUrl;
}
/**
* PO转换为DTO
*
* @param thsParkingRecordsPO
* @return
*/
public static ThsCarInDTO poConvertToDto(ThsParkingRecordsPO thsParkingRecordsPO) {
ThsCarInDTO thsCarInDTO = new ThsCarInDTO();
thsCarInDTO.setCarNo(thsParkingRecordsPO.getCarNo());
thsCarInDTO.setParkCode(thsParkingRecordsPO.getParkCode());
thsCarInDTO.setCarColor(thsParkingRecordsPO.getCarColor());
thsCarInDTO.setCarType(thsParkingRecordsPO.getCarType());
thsCarInDTO.setInChannelCode(thsParkingRecordsPO.getInChannelCode());
thsCarInDTO.setInTime(thsParkingRecordsPO.getInTime());
thsCarInDTO.setInImgUrl(thsParkingRecordsPO.getInImgUrl());
return thsCarInDTO;
}
/**
* DTO存在的数据转换为PO
*
* @param thsCarInDTO
* @return
*/
public static ThsParkingRecordsPO dtoConvertToPo(ThsCarInDTO thsCarInDTO) {
ThsParkingRecordsPO thsParkingRecordsPO = new ThsParkingRecordsPO();
thsParkingRecordsPO.setCarNo(thsCarInDTO.getCarNo());
thsParkingRecordsPO.setParkCode(thsCarInDTO.getParkCode());
thsParkingRecordsPO.setCarColor(thsCarInDTO.getCarColor());
thsParkingRecordsPO.setCarType(thsCarInDTO.getCarType());
thsParkingRecordsPO.setInChannelCode(thsCarInDTO.getInChannelCode());
thsParkingRecordsPO.setInTime(thsCarInDTO.getInTime());
thsParkingRecordsPO.setInImgUrl(thsCarInDTO.getInImgUrl());
thsParkingRecordsPO.setOnParkStatus(1);
thsParkingRecordsPO.setCreateTime(new Date());
thsParkingRecordsPO.setPayedMoney(0);
thsParkingRecordsPO.setTotalMoney(0);
thsParkingRecordsPO.setPayUpStatus(0);
return thsParkingRecordsPO;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.request;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsParkingRecordsPO;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 出场DTO
* 本地出场DTO,所有的出场上报记录都要转换为此DTO RequestDTO
* @author: lidongsheng
* @createData: 2020-04-17 13:17
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 13:17
* @updateContent: 入场上报DTO
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ThsCarOutDTO {
/**
* 车场编号
*/
@NotNull(message = "车场编号 不能为空")
private String parkCode;
/**
* 车牌号
*/
@NotNull(message = "车牌号 不能为空")
private String carNo;
/**
* 出场时间
*/
@NotNull(message = "出场时间 不能为空")
private Date outTime;
/**
* 出场的通道编号
*/
@NotNull(message = "出场的通道编号 不能为空")
private String outChannelCode;
/**
* 出场车辆抓拍图片
*/
private String outImgUrl;
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode;
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo;
}
public Date getOutTime() {
return outTime;
}
public void setOutTime(Date outTime) {
this.outTime = outTime;
}
public String getOutChannelCode() {
return outChannelCode;
}
public void setOutChannelCode(String outChannelCode) {
this.outChannelCode = outChannelCode;
}
public String getOutImgUrl() {
return outImgUrl;
}
public void setOutImgUrl(String outImgUrl) {
this.outImgUrl = outImgUrl;
}
/**
* PO转换为DTO
* @param thsParkingRecordsPO
* @return
*/
public static ThsCarOutDTO poConvertToDto(ThsParkingRecordsPO thsParkingRecordsPO){
ThsCarOutDTO thsCarOutDTO = new ThsCarOutDTO();
thsCarOutDTO.setCarNo(thsParkingRecordsPO.getCarNo());
thsCarOutDTO.setParkCode(thsParkingRecordsPO.getParkCode());
thsCarOutDTO.setOutTime(thsParkingRecordsPO.getOutTime());
thsCarOutDTO.setOutChannelCode(thsParkingRecordsPO.getOutChannelCode());
thsCarOutDTO.setOutImgUrl(thsParkingRecordsPO.getOutImgUrl());
return thsCarOutDTO;
}
/**
* DTO存在的数据转换为PO
* @param thsCarOutDTO
* @return
*/
public static ThsParkingRecordsPO dtoConvertToPo(ThsCarOutDTO thsCarOutDTO,ThsParkingRecordsPO thsParkingRecordsPO){
thsParkingRecordsPO.setOutTime(thsCarOutDTO.getOutTime());
thsParkingRecordsPO.setOutChannelCode(thsCarOutDTO.getOutChannelCode());
thsParkingRecordsPO.setOutImgUrl(thsCarOutDTO.getOutImgUrl());
thsParkingRecordsPO.setOnParkStatus(0);
thsParkingRecordsPO.setUpdateTime(new Date());
return thsParkingRecordsPO;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.request;
import com.huaching.parking.transfer.domain.dto.PlatformWhiteListSyncDto;
import java.util.Date;
public class ThsMemberCarDTO {
/**
* 车场id
*/
private String parkCode;
/**
* 会员车牌号
*/
private String carNo;
/**
* 会员开始时间
*/
private Date startDate;
/**
* 会员结束时间
*/
private Date endDate;
/**
* 会员卡类型
* 1 月租全免
* 2 权益时间 单位:秒
* 3 权益金额 单位:分
*/
private Integer carType;
/**
* 权益时间 单位:秒
*/
private Integer benefitsTime;
/**
* 权益金额 单位:分
*/
private Integer benefitsMoney;
/**
* 会员标识
*/
private String vipFlag;
/**
* 权益详情备注
*/
private String benefitsRemark;
/**
* 备注
*/
private String remake;
/**
* 会员姓名
*/
private String memberName;
/**
* 会员电话
*/
private String memberPhone;
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo == null ? null : carNo.trim();
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Integer getCarType() {
return carType;
}
public void setCarType(Integer carType) {
this.carType = carType;
}
public Integer getBenefitsTime() {
return benefitsTime;
}
public void setBenefitsTime(Integer benefitsTime) {
this.benefitsTime = benefitsTime;
}
public Integer getBenefitsMoney() {
return benefitsMoney;
}
public void setBenefitsMoney(Integer benefitsMoney) {
this.benefitsMoney = benefitsMoney;
}
public String getVipFlag() {
return vipFlag;
}
public void setVipFlag(String vipFlag) {
this.vipFlag = vipFlag == null ? null : vipFlag.trim();
}
public String getBenefitsRemark() {
return benefitsRemark;
}
public void setBenefitsRemark(String benefitsRemark) {
this.benefitsRemark = benefitsRemark == null ? null : benefitsRemark.trim();
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake == null ? null : remake.trim();
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName == null ? null : memberName.trim();
}
public String getMemberPhone() {
return memberPhone;
}
public void setMemberPhone(String memberPhone) {
this.memberPhone = memberPhone == null ? null : memberPhone.trim();
}
public static ThsMemberCarDTO dtoConvertToThis(PlatformWhiteListSyncDto dto){
ThsMemberCarDTO thsMemberCarDTO = new ThsMemberCarDTO();
thsMemberCarDTO.setParkCode(dto.getPlatformParkId().toString());
thsMemberCarDTO.setCarNo(dto.getCarNo());
thsMemberCarDTO.setStartDate(dto.getStartDate());
thsMemberCarDTO.setEndDate(dto.getEndDate());
thsMemberCarDTO.setMemberName(dto.getOwnerName());
thsMemberCarDTO.setMemberPhone(dto.getOwnerPhone());
thsMemberCarDTO.setCarType(1);
thsMemberCarDTO.setBenefitsMoney(0);
thsMemberCarDTO.setBenefitsTime(0);
return thsMemberCarDTO;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.dto.request;
import com.huaching.parking.transfer.domain.dto.PlatformPayChargeDto;
import com.huaching.parking.transfer.domain.dto.PlatformWhiteListSyncDto;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 支付同步DTO
* @author: lidongsheng
* @createData: 2020-04-27 14:36
* @updateAuthor: lidongsheng
* @updateData: 2020-04-27 14:36
* @updateContent: 支付同步DTO
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ThsPaySyncDTO {
/**
* 车场编号
*/
@NotNull(message = "parkCode 车场编号 不能为空")
private String parkCode;
/**
* 车牌号
*/
@NotNull(message = "carNo 车牌号 不能为空")
private String carNo;
/**
* 支付记录账单号
*/
private String orderNo;
/**
* 支付金额(单位:分)
*/
@NotNull(message = "payedMoney 支付金额 不能为空")
private Integer payedMoney;
/**
* 优惠金额
*/
private Integer couponMoney;
public Integer getCouponMoney() {
return couponMoney;
}
public void setCouponMoney(Integer couponMoney) {
this.couponMoney = couponMoney;
}
/**
* 应支付金额(单位:分)
*/
private Integer payableMoney;
/**
* 支付时间
*/
private Date payTime;
/**
* 支付类型:
* <p>
* 1:支付宝 2:微信 3:现金 4:其他
*/
private Integer payType;
/**
* 支付终端类型:
* <p>
* 11:支付宝小程序 12:支付宝生活号
* <p>
* 21: 微信小程序 22:微信公众号
* <p>
* 31:现金
*/
private Integer terminalType;
/**
* 操作人
*/
private String operatorUser;
/**
* 备注字段
*/
private String remake;
public String getOperatorUser() {
return operatorUser;
}
public void setOperatorUser(String operatorUser) {
this.operatorUser = operatorUser;
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public Integer getPayedMoney() {
return payedMoney;
}
public void setPayedMoney(Integer payedMoney) {
this.payedMoney = payedMoney;
}
public Integer getPayableMoney() {
return payableMoney;
}
public void setPayableMoney(Integer payableMoney) {
this.payableMoney = payableMoney;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public Integer getTerminalType() {
return terminalType;
}
public void setTerminalType(Integer terminalType) {
this.terminalType = terminalType;
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode;
}
public static ThsPaySyncDTO dtoConvertToThis(PlatformPayChargeDto dto) {
ThsPaySyncDTO paySyncDTO = new ThsPaySyncDTO();
paySyncDTO.setParkCode(dto.getPlatformParkId().toString());
paySyncDTO.setCarNo(dto.getCarNo());
paySyncDTO.setPayableMoney(new BigDecimal(dto.getReceivable() * 100).setScale(0, BigDecimal.ROUND_HALF_UP).intValue());
paySyncDTO.setPayedMoney(new BigDecimal(dto.getReceived() * 100).setScale(0, BigDecimal.ROUND_HALF_UP).intValue());
paySyncDTO.setPayTime(dto.getPayChargeTime());
paySyncDTO.setPayType(dto.getPayType());
paySyncDTO.setTerminalType(dto.getPayType());
paySyncDTO.setOperatorUser("oneself");
return paySyncDTO;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.response;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChannelMessagePO;
/**
* @program: parking_local_general
* @description: 查询通道信息 ResponseDTO
* @author: lidongsheng
* @createData: 2020-04-17 19:08
* @updateAuthor: lidongsheng
* @updateData: 2020-04-17 19:08
* @updateContent: 通道信息DTO
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ThsChannelMeeageDTO {
/**
* 通道编号
*/
private String channelCode;
/**
* 通道名称
*/
private String channelName;
/**
* 通道ip
*/
private String channelIp;
/**
* 方向:1进 2 出 3混合
*/
private Integer direction;
/**
* 控制类型:0 自动放行 1 平台接口控制
*/
private Integer control_type;
public String getChannelCode() {
return channelCode;
}
public void setChannelCode(String channelCode) {
this.channelCode = channelCode;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public String getChannelIp() {
return channelIp;
}
public void setChannelIp(String channelIp) {
this.channelIp = channelIp;
}
public Integer getDirection() {
return direction;
}
public void setDirection(Integer direction) {
this.direction = direction;
}
public Integer getControl_type() {
return control_type;
}
public void setControl_type(Integer control_type) {
this.control_type = control_type;
}
/**
* PO转换为DTO
*
* @param thsChannelMessagePO
* @return
*/
public static ThsChannelMeeageDTO poConvertToDto(ThsChannelMessagePO thsChannelMessagePO) {
if (thsChannelMessagePO == null) {
return null;
}
ThsChannelMeeageDTO thsChannelMeeageDTO = new ThsChannelMeeageDTO();
thsChannelMeeageDTO.setChannelCode(thsChannelMessagePO.getChannelCode());
thsChannelMeeageDTO.setChannelName(thsChannelMessagePO.getChannelName());
thsChannelMeeageDTO.setDirection(thsChannelMessagePO.getDirection());
thsChannelMeeageDTO.setChannelIp(thsChannelMessagePO.getChannelIp());
thsChannelMeeageDTO.setControl_type(thsChannelMessagePO.getControlType());
return thsChannelMeeageDTO;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.response;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.local.bo.ThsRequestChargeBO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.BaseDTO;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsParkingRecordsPO;
import com.huaching.parking.local.parking_local_general.service.local.PaymentChargesServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.UUID;
/**
* @program: parking_local_general
* @description: 请求费用返回DTO
* @author: lidongsheng
* @createData: 2020-04-22 14:11
* @updateAuthor: lidongsheng
* @updateData: 2020-04-22 14:11
* @updateContent: 请求费用信息DTO
* @Version: 1.0.0
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class ThsRequestChargeDTO extends BaseDTO {
private static final Logger logger = LoggerFactory.getLogger(ThsRequestChargeDTO.class);
private String parkCode;
private String carNo;
/**
* 进场时间
*/
private Date inTime;
public Date getOutTime() {
return outTime;
}
public void setOutTime(Date outTime) {
this.outTime = outTime;
}
/**
* 出场时间(出口付的时候会用到)
*/
private Date outTime;
/**
* 进场的通道编号
*/
private String inChannelCode;
/**
* 车辆在场状态: 0 已出场 1 在场
*/
private Integer onParkStatus;
/**
* 进场抓拍图片url
*/
private String inImgUrl;
/**
* 账单号
*/
private String orderNo;
/**
* 已支付金额
*/
private Integer payedMoney;
/**
* 应支付金额
*/
private Integer payableMoney;
/**
* 优惠金额
*/
private Integer couponMoney;
public String getErrMes() {
return errMes;
}
public void setErrMes(String errMes) {
this.errMes = errMes;
}
/**
* 错误信息
*/
private String errMes;
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode;
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo;
}
public Date getInTime() {
return inTime;
}
public void setInTime(Date inTime) {
this.inTime = inTime;
}
public String getInChannelCode() {
return inChannelCode;
}
public void setInChannelCode(String inChannelCode) {
this.inChannelCode = inChannelCode;
}
public Integer getOnParkStatus() {
return onParkStatus;
}
public void setOnParkStatus(Integer onParkStatus) {
this.onParkStatus = onParkStatus;
}
public String getInImgUrl() {
return inImgUrl;
}
public void setInImgUrl(String inImgUrl) {
this.inImgUrl = inImgUrl;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public Integer getPayedMoney() {
return payedMoney;
}
public void setPayedMoney(Integer payedMoney) {
this.payedMoney = payedMoney;
}
public Integer getPayableMoney() {
return payableMoney;
}
public void setPayableMoney(Integer payableMoney) {
this.payableMoney = payableMoney;
}
public Integer getCouponMoney() {
return couponMoney;
}
public void setCouponMoney(Integer couponMoney) {
this.couponMoney = couponMoney;
}
public static ThsRequestChargeDTO poConvertToDto(ThsParkingRecordsPO thsParkingRecordsPO, String orderNo, Integer payableMoney) {
logger.info("poConvertToDto 开始转换 po -> {} ,orderNo -> {}, payableMoney -> {}",
JSON.toJSONString(thsParkingRecordsPO), orderNo, payableMoney);
ThsRequestChargeDTO dto = new ThsRequestChargeDTO();
String parkCode = thsParkingRecordsPO.getParkCode();
String carNo = thsParkingRecordsPO.getCarNo();
dto.setParkCode(parkCode);
dto.setCarNo(carNo);
dto.setInChannelCode(thsParkingRecordsPO.getInChannelCode());
dto.setInTime(thsParkingRecordsPO.getInTime());
dto.setPayedMoney(thsParkingRecordsPO.getPayedMoney());
dto.setCouponMoney(thsParkingRecordsPO.getCouponMoney());
dto.setInImgUrl(thsParkingRecordsPO.getInImgUrl());
dto.setOnParkStatus(thsParkingRecordsPO.getOnParkStatus());
dto.setOrderNo(orderNo);
dto.setPayableMoney(payableMoney);
logger.info("poConvertToDto 转换完成 dto -> {}",
JSON.toJSONString(dto));
return dto;
}
/**
* 返回错误
*
* @param errorMsg 错误信息
* @return
*/
public static ThsRequestChargeDTO errorMsg(String errorMsg) {
ThsRequestChargeDTO requestChargeDTO = new ThsRequestChargeDTO();
requestChargeDTO.setCode(0);
requestChargeDTO.setMsg(errorMsg);
return requestChargeDTO;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsCarAdvanceInOutRecordsPO {
private Integer id;
/**
* 车场编号
*/
private String parkCode;
/**
* 车牌号
*/
private String carNo;
/**
* 进出时间
*/
private Date capTime;
/**
* 进出通道code
*/
private String capChannelCode;
/**
* 进出标识 1: 进 2: 出
*/
private Integer capFlag;
/**
* 抓拍图片url
*/
private String capImgUrl;
/**
* 状态:
* 0 开闸出场
* 1 费用未缴清依然在场
* 2 开闸失败
* 3 数据库更新出场记录失败
*/
private Integer status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo == null ? null : carNo.trim();
}
public Date getCapTime() {
return capTime;
}
public void setCapTime(Date capTime) {
this.capTime = capTime;
}
public String getCapChannelCode() {
return capChannelCode;
}
public void setCapChannelCode(String capChannelCode) {
this.capChannelCode = capChannelCode == null ? null : capChannelCode.trim();
}
public Integer getCapFlag() {
return capFlag;
}
public void setCapFlag(Integer capFlag) {
this.capFlag = capFlag;
}
public String getCapImgUrl() {
return capImgUrl;
}
public void setCapImgUrl(String capImgUrl) {
this.capImgUrl = capImgUrl == null ? null : capImgUrl.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsChannelMessagePO {
private Integer id;
/**
* 车场编号
*/
private String parkCode;
/**
* 通道编号
*/
private String channelCode;
/**
* 通道名称
*/
private String channelName;
/**
* 通道ip
*/
private String channelIp;
/**
* 方向:1进 2 出 3混合
*/
private Integer direction;
/**
* 记录创建时间
*/
private Date createTime;
/**
* 记录更新时间
*/
private Date updateTime;
/**
* 备注
*/
private String remake;
/**
* 状态 0 停用 1正常
*/
private Integer status;
/**
* 控制类型:0 自动放行 1 平台接口控制
*/
private Integer controlType;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getChannelCode() {
return channelCode;
}
public void setChannelCode(String channelCode) {
this.channelCode = channelCode == null ? null : channelCode.trim();
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName == null ? null : channelName.trim();
}
public String getChannelIp() {
return channelIp;
}
public void setChannelIp(String channelIp) {
this.channelIp = channelIp == null ? null : channelIp.trim();
}
public Integer getDirection() {
return direction;
}
public void setDirection(Integer direction) {
this.direction = direction;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake == null ? null : remake.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getControlType() {
return controlType;
}
public void setControlType(Integer controlType) {
this.controlType = controlType;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsChargingRules24OldPO {
private Integer id;
private Integer parkId;
private String name;
/**
* 类型 0: 24小时计算 1:0点重新计费
*/
private Byte type;
/**
* 最高封顶
*/
private Float max;
/**
* 免费时长(分钟)
*/
private Integer freeTime;
/**
* 一小时以内收费
*/
private Float h1;
/**
* 2小时以内收费
*/
private Float h2;
/**
* 3小时以内收费
*/
private Float h3;
/**
* 4小时以内收费
*/
private Float h4;
/**
* 5小时以内收费
*/
private Float h5;
/**
* 6小时以内收费
*/
private Float h6;
/**
* 7小时以内收费
*/
private Float h7;
/**
* 8小时以内收费
*/
private Float h8;
/**
* 9小时以内收费
*/
private Float h9;
/**
* 10小时以内收费
*/
private Float h10;
/**
* 11小时以内收费
*/
private Float h11;
/**
* 12小时以内收费
*/
private Float h12;
/**
* 13小时以内收费
*/
private Float h13;
/**
* 14小时以内收费
*/
private Float h14;
/**
* 15小时以内收费
*/
private Float h15;
/**
* 16小时以内收费
*/
private Float h16;
/**
* 17小时以内收费
*/
private Float h17;
/**
* 18小时以内收费
*/
private Float h18;
/**
* 19小时以内收费
*/
private Float h19;
/**
* 20小时以内收费
*/
private Float h20;
/**
* 21小时以内收费
*/
private Float h21;
/**
* 22小时以内收费
*/
private Float h22;
/**
* 23小时以内收费
*/
private Float h23;
/**
* 24小时以内收费
*/
private Float h24;
/**
* 备注
*/
private String remark;
/**
* 车场默认收费为0,新增会员卡收费规则1
*/
private Integer ismember;
private Date createTime;
private Date updateTime;
/**
* 启用标识 0、未启用 1、启用 2、删除
*/
private Short flag;
private Integer operatorId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getParkId() {
return parkId;
}
public void setParkId(Integer parkId) {
this.parkId = parkId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public Float getMax() {
return max;
}
public void setMax(Float max) {
this.max = max;
}
public Integer getFreeTime() {
return freeTime;
}
public void setFreeTime(Integer freeTime) {
this.freeTime = freeTime;
}
public Float getH1() {
return h1;
}
public void setH1(Float h1) {
this.h1 = h1;
}
public Float getH2() {
return h2;
}
public void setH2(Float h2) {
this.h2 = h2;
}
public Float getH3() {
return h3;
}
public void setH3(Float h3) {
this.h3 = h3;
}
public Float getH4() {
return h4;
}
public void setH4(Float h4) {
this.h4 = h4;
}
public Float getH5() {
return h5;
}
public void setH5(Float h5) {
this.h5 = h5;
}
public Float getH6() {
return h6;
}
public void setH6(Float h6) {
this.h6 = h6;
}
public Float getH7() {
return h7;
}
public void setH7(Float h7) {
this.h7 = h7;
}
public Float getH8() {
return h8;
}
public void setH8(Float h8) {
this.h8 = h8;
}
public Float getH9() {
return h9;
}
public void setH9(Float h9) {
this.h9 = h9;
}
public Float getH10() {
return h10;
}
public void setH10(Float h10) {
this.h10 = h10;
}
public Float getH11() {
return h11;
}
public void setH11(Float h11) {
this.h11 = h11;
}
public Float getH12() {
return h12;
}
public void setH12(Float h12) {
this.h12 = h12;
}
public Float getH13() {
return h13;
}
public void setH13(Float h13) {
this.h13 = h13;
}
public Float getH14() {
return h14;
}
public void setH14(Float h14) {
this.h14 = h14;
}
public Float getH15() {
return h15;
}
public void setH15(Float h15) {
this.h15 = h15;
}
public Float getH16() {
return h16;
}
public void setH16(Float h16) {
this.h16 = h16;
}
public Float getH17() {
return h17;
}
public void setH17(Float h17) {
this.h17 = h17;
}
public Float getH18() {
return h18;
}
public void setH18(Float h18) {
this.h18 = h18;
}
public Float getH19() {
return h19;
}
public void setH19(Float h19) {
this.h19 = h19;
}
public Float getH20() {
return h20;
}
public void setH20(Float h20) {
this.h20 = h20;
}
public Float getH21() {
return h21;
}
public void setH21(Float h21) {
this.h21 = h21;
}
public Float getH22() {
return h22;
}
public void setH22(Float h22) {
this.h22 = h22;
}
public Float getH23() {
return h23;
}
public void setH23(Float h23) {
this.h23 = h23;
}
public Float getH24() {
return h24;
}
public void setH24(Float h24) {
this.h24 = h24;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getIsmember() {
return ismember;
}
public void setIsmember(Integer ismember) {
this.ismember = ismember;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Short getFlag() {
return flag;
}
public void setFlag(Short flag) {
this.flag = flag;
}
public Integer getOperatorId() {
return operatorId;
}
public void setOperatorId(Integer operatorId) {
this.operatorId = operatorId;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsChargingRulesFeeOldPO {
private Integer id;
private Integer freeTime;
private Integer circleTime;
/**
* 单位 元
*/
private Float price;
private Integer carSpaceId;
private Integer parkId;
private Integer version;
private Date createtime;
private Date updatetime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getFreeTime() {
return freeTime;
}
public void setFreeTime(Integer freeTime) {
this.freeTime = freeTime;
}
public Integer getCircleTime() {
return circleTime;
}
public void setCircleTime(Integer circleTime) {
this.circleTime = circleTime;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public Integer getCarSpaceId() {
return carSpaceId;
}
public void setCarSpaceId(Integer carSpaceId) {
this.carSpaceId = carSpaceId;
}
public Integer getParkId() {
return parkId;
}
public void setParkId(Integer parkId) {
this.parkId = parkId;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsChargingRulesOldPO {
private Integer id;
private Integer parkId;
private String no;
private String name;
private Integer carType;
private Integer ruleType;
/**
* 1:次;2:时段
*/
private Integer chargeType;
/**
* 免费时间
*/
private Float freeTime;
/**
* 收费周期
*/
private Float cycleTime;
/**
* 1:全天;2:白天夜间;
*/
private Integer timeType;
/**
* 白天开始时间
*/
private String dayStartTime;
/**
* 白天结束时间
*/
private String dayEndTime;
/**
* 白天/全天 首时段
*/
private String dayFirstTime;
/**
* 白天/全天 首时段价钱
*/
private Float dayFirstTimePrice;
private Float dayRemainTimePrice;
/**
* 白天最高收费
*/
private Float dayMaximumAmount;
/**
* 夜晚开始时间
*/
private String nightStartTime;
/**
* 白天结束时间
*/
private String nightEndTime;
/**
* 夜间首段时间
*/
private String nightFirstTime;
private Float nightFirstTimePrice;
/**
* 夜晚剩余时间价格
*/
private Float nightRemainTimePrice;
/**
* 夜间最大金额
*/
private Float nightMaximumAmount;
private Float alldayMaximumAmount;
private Float dayTimesPrice;
private Float nightTimesPrice;
/**
* 夜间周期
*/
private Float nightCycleTime;
/**
* 车场默认收费为0,新增会员卡收费规则1
*/
private Integer ismember;
private Date createTime;
private Date updateTime;
/**
* 启用标识 0、未启用 1、启用 2、删除
*/
private Short flag;
private Integer operatorId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getParkId() {
return parkId;
}
public void setParkId(Integer parkId) {
this.parkId = parkId;
}
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no == null ? null : no.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Integer getCarType() {
return carType;
}
public void setCarType(Integer carType) {
this.carType = carType;
}
public Integer getRuleType() {
return ruleType;
}
public void setRuleType(Integer ruleType) {
this.ruleType = ruleType;
}
public Integer getChargeType() {
return chargeType;
}
public void setChargeType(Integer chargeType) {
this.chargeType = chargeType;
}
public Float getFreeTime() {
return freeTime;
}
public void setFreeTime(Float freeTime) {
this.freeTime = freeTime;
}
public Float getCycleTime() {
return cycleTime;
}
public void setCycleTime(Float cycleTime) {
this.cycleTime = cycleTime;
}
public Integer getTimeType() {
return timeType;
}
public void setTimeType(Integer timeType) {
this.timeType = timeType;
}
public String getDayStartTime() {
return dayStartTime;
}
public void setDayStartTime(String dayStartTime) {
this.dayStartTime = dayStartTime == null ? null : dayStartTime.trim();
}
public String getDayEndTime() {
return dayEndTime;
}
public void setDayEndTime(String dayEndTime) {
this.dayEndTime = dayEndTime == null ? null : dayEndTime.trim();
}
public String getDayFirstTime() {
return dayFirstTime;
}
public void setDayFirstTime(String dayFirstTime) {
this.dayFirstTime = dayFirstTime == null ? null : dayFirstTime.trim();
}
public Float getDayFirstTimePrice() {
return dayFirstTimePrice;
}
public void setDayFirstTimePrice(Float dayFirstTimePrice) {
this.dayFirstTimePrice = dayFirstTimePrice;
}
public Float getDayRemainTimePrice() {
return dayRemainTimePrice;
}
public void setDayRemainTimePrice(Float dayRemainTimePrice) {
this.dayRemainTimePrice = dayRemainTimePrice;
}
public Float getDayMaximumAmount() {
return dayMaximumAmount;
}
public void setDayMaximumAmount(Float dayMaximumAmount) {
this.dayMaximumAmount = dayMaximumAmount;
}
public String getNightStartTime() {
return nightStartTime;
}
public void setNightStartTime(String nightStartTime) {
this.nightStartTime = nightStartTime == null ? null : nightStartTime.trim();
}
public String getNightEndTime() {
return nightEndTime;
}
public void setNightEndTime(String nightEndTime) {
this.nightEndTime = nightEndTime == null ? null : nightEndTime.trim();
}
public String getNightFirstTime() {
return nightFirstTime;
}
public void setNightFirstTime(String nightFirstTime) {
this.nightFirstTime = nightFirstTime == null ? null : nightFirstTime.trim();
}
public Float getNightFirstTimePrice() {
return nightFirstTimePrice;
}
public void setNightFirstTimePrice(Float nightFirstTimePrice) {
this.nightFirstTimePrice = nightFirstTimePrice;
}
public Float getNightRemainTimePrice() {
return nightRemainTimePrice;
}
public void setNightRemainTimePrice(Float nightRemainTimePrice) {
this.nightRemainTimePrice = nightRemainTimePrice;
}
public Float getNightMaximumAmount() {
return nightMaximumAmount;
}
public void setNightMaximumAmount(Float nightMaximumAmount) {
this.nightMaximumAmount = nightMaximumAmount;
}
public Float getAlldayMaximumAmount() {
return alldayMaximumAmount;
}
public void setAlldayMaximumAmount(Float alldayMaximumAmount) {
this.alldayMaximumAmount = alldayMaximumAmount;
}
public Float getDayTimesPrice() {
return dayTimesPrice;
}
public void setDayTimesPrice(Float dayTimesPrice) {
this.dayTimesPrice = dayTimesPrice;
}
public Float getNightTimesPrice() {
return nightTimesPrice;
}
public void setNightTimesPrice(Float nightTimesPrice) {
this.nightTimesPrice = nightTimesPrice;
}
public Float getNightCycleTime() {
return nightCycleTime;
}
public void setNightCycleTime(Float nightCycleTime) {
this.nightCycleTime = nightCycleTime;
}
public Integer getIsmember() {
return ismember;
}
public void setIsmember(Integer ismember) {
this.ismember = ismember;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Short getFlag() {
return flag;
}
public void setFlag(Short flag) {
this.flag = flag;
}
public Integer getOperatorId() {
return operatorId;
}
public void setOperatorId(Integer operatorId) {
this.operatorId = operatorId;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsChargingRulesPO {
private Integer id;
/**
* 车场编号
*/
private String parkCode;
/**
* 计费类型(0 按次收费 1 按时段收费 2 按间隔收费 )
*/
private Integer chargeType;
/**
* 免费停车时长(分钟单位)
*/
private Integer freeTime;
/**
* 一次停车的最高费用(单位分),chargeType为0时不会有此参数
*/
private Integer maxOneTimeMoney;
/**
* 一天停车的最高费用(单位分),chargeType为0时不会有此参数
*/
private Integer maxOneDayMoney;
/**
* 计费规则详情,根据chargeType不同此字段内容也不同
*/
private String chargeDetails;
/**
* 创建时间
*/
private Date creatTime;
/**
* 更新时间
*/
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public Integer getChargeType() {
return chargeType;
}
public void setChargeType(Integer chargeType) {
this.chargeType = chargeType;
}
public Integer getFreeTime() {
return freeTime;
}
public void setFreeTime(Integer freeTime) {
this.freeTime = freeTime;
}
public Integer getMaxOneTimeMoney() {
return maxOneTimeMoney;
}
public void setMaxOneTimeMoney(Integer maxOneTimeMoney) {
this.maxOneTimeMoney = maxOneTimeMoney;
}
public Integer getMaxOneDayMoney() {
return maxOneDayMoney;
}
public void setMaxOneDayMoney(Integer maxOneDayMoney) {
this.maxOneDayMoney = maxOneDayMoney;
}
public String getChargeDetails() {
return chargeDetails;
}
public void setChargeDetails(String chargeDetails) {
this.chargeDetails = chargeDetails == null ? null : chargeDetails.trim();
}
public Date getCreatTime() {
return creatTime;
}
public void setCreatTime(Date creatTime) {
this.creatTime = creatTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsMemberCarPO {
private Integer id;
/**
* 车场id
*/
private String parkCode;
/**
* 会员车牌号
*/
private String carNo;
/**
* 会员卡id
*/
private String cardId;
/**
* 会员开始时间
*/
private Date startDate;
/**
* 会员结束时间
*/
private Date endDate;
/**
* 会员卡类型
* 1 月租全免
* 2 权益时间 单位:秒
* 3 权益金额 单位:分
*/
private Integer carType;
/**
* 权益时间 单位:秒
*/
private Integer benefitsTime;
/**
* 权益金额 单位:分
*/
private Integer benefitsMoney;
/**
* 会员标识
*/
private String vipFlag;
/**
* 权益详情备注
*/
private String benefitsRemark;
/**
* 记录创建时间
*/
private Date creatTime;
/**
* 记录更新时间
*/
private Date updateTime;
/**
* 备注
*/
private String remake;
/**
* 状态
*/
private Integer status;
/**
* 会员姓名
*/
private String memberName;
/**
* 会员电话
*/
private String memberPhone;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo == null ? null : carNo.trim();
}
public String getCardId() {
return cardId;
}
public void setCardId(String cardId) {
this.cardId = cardId == null ? null : cardId.trim();
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Integer getCarType() {
return carType;
}
public void setCarType(Integer carType) {
this.carType = carType;
}
public Integer getBenefitsTime() {
return benefitsTime;
}
public void setBenefitsTime(Integer benefitsTime) {
this.benefitsTime = benefitsTime;
}
public Integer getBenefitsMoney() {
return benefitsMoney;
}
public void setBenefitsMoney(Integer benefitsMoney) {
this.benefitsMoney = benefitsMoney;
}
public String getVipFlag() {
return vipFlag;
}
public void setVipFlag(String vipFlag) {
this.vipFlag = vipFlag == null ? null : vipFlag.trim();
}
public String getBenefitsRemark() {
return benefitsRemark;
}
public void setBenefitsRemark(String benefitsRemark) {
this.benefitsRemark = benefitsRemark == null ? null : benefitsRemark.trim();
}
public Date getCreatTime() {
return creatTime;
}
public void setCreatTime(Date creatTime) {
this.creatTime = creatTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake == null ? null : remake.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName == null ? null : memberName.trim();
}
public String getMemberPhone() {
return memberPhone;
}
public void setMemberPhone(String memberPhone) {
this.memberPhone = memberPhone == null ? null : memberPhone.trim();
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsParkMessagePO {
private Integer id;
/**
* 车场编号
*/
private String parkCode;
/**
* 车场名称
*/
private String name;
/**
* 车场位置
*/
private String address;
/**
* 位置 维度
*/
private Double latitude;
/**
* 位置 经度
*/
private Double longitude;
/**
* 总车位数
*/
private Integer totalSpace;
/**
* 剩余车位数
*/
private Integer redidueSpace;
/**
* 创建时间
*/
private Date creatTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 车场状态:0 停用 1正常
*/
private Integer status;
/**
* 车场免费状态 0 收费 1 免费
*/
private Integer freeStatus;
/**
* 车场收费类型:
*
* 0 正常收费
*
* 1 24小时
*
* 2 fee
*
* 3 免费
*/
private Integer chargeType;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Integer getTotalSpace() {
return totalSpace;
}
public void setTotalSpace(Integer totalSpace) {
this.totalSpace = totalSpace;
}
public Integer getRedidueSpace() {
return redidueSpace;
}
public void setRedidueSpace(Integer redidueSpace) {
this.redidueSpace = redidueSpace;
}
public Date getCreatTime() {
return creatTime;
}
public void setCreatTime(Date creatTime) {
this.creatTime = creatTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getFreeStatus() {
return freeStatus;
}
public void setFreeStatus(Integer freeStatus) {
this.freeStatus = freeStatus;
}
public Integer getChargeType() {
return chargeType;
}
public void setChargeType(Integer chargeType) {
this.chargeType = chargeType;
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsParkingRecordsPO {
private Integer id;
/**
* 车场编号
*/
private String parkCode;
/**
* 车牌号
*/
private String carNo;
/**
* 进场时间
*/
private Date inTime;
/**
* 出场时间
*/
private Date outTime;
/**
* 记录创建时间
*/
private Date createTime;
/**
* 记录更新时间
*/
private Date updateTime;
/**
* 进场的通道编号
*/
private String inChannelCode;
/**
* 出场的通道编号
*/
private String outChannelCode;
/**
* 已支付金额(单位:分)
*/
private Integer payedMoney;
/**
* 总金额
*/
private Integer totalMoney;
/**
* 总优惠金额
*/
private Integer couponMoney;
/**
* 车辆类型:
*
* 1 小型车
*
* 2 大型车
*
* 3 其他
*
* 4 未识别
*/
private Integer carType;
/**
* 车辆颜色:
*
* 0蓝色;1黄色;2白色;3黑色;4绿色
*/
private Integer carColor;
/**
* 车辆在场状态: 0 已出场 1 在场
*/
private Integer onParkStatus;
/**
* 费用全部缴清状态:0 未缴清 1 已缴清
*/
private Integer payUpStatus;
/**
* 进场抓拍图片url
*/
private String inImgUrl;
/**
* 出场抓拍图片url
*/
private String outImgUrl;
/**
* 备注
*/
private String remake;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo == null ? null : carNo.trim();
}
public Date getInTime() {
return inTime;
}
public void setInTime(Date inTime) {
this.inTime = inTime;
}
public Date getOutTime() {
return outTime;
}
public void setOutTime(Date outTime) {
this.outTime = outTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getInChannelCode() {
return inChannelCode;
}
public void setInChannelCode(String inChannelCode) {
this.inChannelCode = inChannelCode == null ? null : inChannelCode.trim();
}
public String getOutChannelCode() {
return outChannelCode;
}
public void setOutChannelCode(String outChannelCode) {
this.outChannelCode = outChannelCode == null ? null : outChannelCode.trim();
}
public Integer getPayedMoney() {
return payedMoney;
}
public void setPayedMoney(Integer payedMoney) {
this.payedMoney = payedMoney;
}
public Integer getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(Integer totalMoney) {
this.totalMoney = totalMoney;
}
public Integer getCouponMoney() {
return couponMoney;
}
public void setCouponMoney(Integer couponMoney) {
this.couponMoney = couponMoney;
}
public Integer getCarType() {
return carType;
}
public void setCarType(Integer carType) {
this.carType = carType;
}
public Integer getCarColor() {
return carColor;
}
public void setCarColor(Integer carColor) {
this.carColor = carColor;
}
public Integer getOnParkStatus() {
return onParkStatus;
}
public void setOnParkStatus(Integer onParkStatus) {
this.onParkStatus = onParkStatus;
}
public Integer getPayUpStatus() {
return payUpStatus;
}
public void setPayUpStatus(Integer payUpStatus) {
this.payUpStatus = payUpStatus;
}
public String getInImgUrl() {
return inImgUrl;
}
public void setInImgUrl(String inImgUrl) {
this.inImgUrl = inImgUrl == null ? null : inImgUrl.trim();
}
public String getOutImgUrl() {
return outImgUrl;
}
public void setOutImgUrl(String outImgUrl) {
this.outImgUrl = outImgUrl == null ? null : outImgUrl.trim();
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake == null ? null : remake.trim();
}
}
\ No newline at end of file
package com.huaching.parking.local.parking_local_general.domain.local.po;
import java.util.Date;
public class ThsPayOrderRecordsPO {
private Integer id;
/**
* 支付记录账单号
*/
private String orderNo;
/**
* 车场编号
*/
private String parkCode;
/**
* 车牌号
*/
private String carNo;
/**
* 关联的停车记录id
*/
private Integer parkingRecordsId;
/**
* 支付金额(单位:分)
*/
private Integer payedMoney;
/**
* 优惠金额
*/
private Integer couponMoney;
/**
* 应支付金额(单位:分)
*/
private Integer payableMoney;
/**
* 支付状态:0 未支付 1 已支付
*/
private Integer payStatus;
/**
* 支付时间
*/
private Date payTime;
/**
* 支付类型:
*
* 1:支付宝 2:微信 3:现金 4:其他
*/
private Integer payType;
/**
* 支付终端类型:
*
* 11:支付宝小程序 12:支付宝生活号
*
* 21: 微信小程序 22:微信公众号
*
* 31:现金
*/
private Integer terminalType;
/**
* 创建时间
*/
private Date creatTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 操作人
*/
private String operatorUser;
/**
* 备注字段
*/
private String remake;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo == null ? null : orderNo.trim();
}
public String getParkCode() {
return parkCode;
}
public void setParkCode(String parkCode) {
this.parkCode = parkCode == null ? null : parkCode.trim();
}
public String getCarNo() {
return carNo;
}
public void setCarNo(String carNo) {
this.carNo = carNo == null ? null : carNo.trim();
}
public Integer getParkingRecordsId() {
return parkingRecordsId;
}
public void setParkingRecordsId(Integer parkingRecordsId) {
this.parkingRecordsId = parkingRecordsId;
}
public Integer getPayedMoney() {
return payedMoney;
}
public void setPayedMoney(Integer payedMoney) {
this.payedMoney = payedMoney;
}
public Integer getCouponMoney() {
return couponMoney;
}
public void setCouponMoney(Integer couponMoney) {
this.couponMoney = couponMoney;
}
public Integer getPayableMoney() {
return payableMoney;
}
public void setPayableMoney(Integer payableMoney) {
this.payableMoney = payableMoney;
}
public Integer getPayStatus() {
return payStatus;
}
public void setPayStatus(Integer payStatus) {
this.payStatus = payStatus;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public Integer getTerminalType() {
return terminalType;
}
public void setTerminalType(Integer terminalType) {
this.terminalType = terminalType;
}
public Date getCreatTime() {
return creatTime;
}
public void setCreatTime(Date creatTime) {
this.creatTime = creatTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getOperatorUser() {
return operatorUser;
}
public void setOperatorUser(String operatorUser) {
this.operatorUser = operatorUser == null ? null : operatorUser.trim();
}
public String getRemake() {
return remake;
}
public void setRemake(String remake) {
this.remake = remake == null ? null : remake.trim();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment