作者 shenhailong

建行回调 websocket 通信分支

正在显示 43 个修改的文件 包含 1635 行增加2103 行删除

要显示太多修改。

为保证性能只显示 43 of 43+ 个文件。

... ... @@ -14,14 +14,14 @@ spring:
mvc:
#静态资源,设置上传文件的访问,
static-path-pattern: /**
# view:
# suffix: .html
## prefix: /templates/
# view:
# suffix: .html
## prefix: /templates/
thymeleaf:
cache: false
mode: LEGACYHTML5
activiti:
# 检查bpmn文件
# 检查bpmn文件
check-process-definitions: false
#创建任务流表,创建完成后关闭,每次应用启动不检查Activiti数据表是否存在及版本号是否匹配,提升应用启动速度
database-schema-update: true
... ... @@ -37,7 +37,7 @@ spring:
static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,classpath:/public/,file:${web.upload-path}
application:
name: EMPT-LOCATION
name: EMPT-LOCATION-WEBSOCKET
jackson:
serialization:
... ... @@ -51,8 +51,8 @@ spring:
default-property-inclusion: always
cloud:
#eureka主机名,会在控制页面中显示
#DEV环境关闭注册。
#eureka主机名,会在控制页面中显示
#DEV环境关闭注册。
features:
enabled: true
discovery:
... ... @@ -62,45 +62,45 @@ spring:
enabled: true
datasource:
type: com.alibaba.druid.pool.DruidDataSource
#oracle
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
# username: CGONMS
# password: vmvnv1v2
#spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
#url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true
url: jdbc:mysql://118.31.66.166:3306/EMPT?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://192.168.1.7:10098/empt?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
# username: shl
username: 110
# password: vmvnv1v2VV
password: QAHqCJf2kFYCLirM
driver-class-name: com.mysql.cj.jdbc.Driver
max-idle: 20
max-wait: 10000
min-idle: 5
initial-size: 5
#配置初始化大小/最小/最大
druid:
initial-size: 1
min-idle: 1
#最大并发连接数
max-active: 40
#获取连接等待超时时间
max-wait: 60000
#一个连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
#间隔多久进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis: 60000
#mysql
validation-query: SELECT 1 FROM DUAL
#oracle
# validation-query: SELECT 'x' FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
default-auto-commit: true
type: com.alibaba.druid.pool.DruidDataSource
#oracle
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
# username: CGONMS
# password: vmvnv1v2
#spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
#url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true
url: jdbc:mysql://118.31.66.166:3306/EMPT?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://192.168.1.7:10098/empt?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai
# username: shl
username: 110
# password: vmvnv1v2VV
password: QAHqCJf2kFYCLirM
driver-class-name: com.mysql.cj.jdbc.Driver
max-idle: 20
max-wait: 10000
min-idle: 5
initial-size: 5
#配置初始化大小/最小/最大
druid:
initial-size: 1
min-idle: 1
#最大并发连接数
max-active: 40
#获取连接等待超时时间
max-wait: 60000
#一个连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
#间隔多久进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis: 60000
#mysql
validation-query: SELECT 1 FROM DUAL
#oracle
# validation-query: SELECT 'x' FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
default-auto-commit: true
eureka:
instance:
... ... @@ -114,7 +114,7 @@ eureka:
client:
#eureka注册中心服务器地址
service-url:
# defaultZone: http://127.0.0.1:12345/eureka/
# defaultZone: http://127.0.0.1:12345/eureka/
defaultZone: http://192.168.1.53:12345/eureka/
registry-fetch-interval-seconds: 30
... ... @@ -141,11 +141,11 @@ logging:
path: ./logs/
name: system.log
config: config/logback-dev.xml
#转移到logback配置文件中
#level:
#转移到logback配置文件中
#level:
#org.apache.tomcat: info
#com.tianbo.warehouse.dao: DEBUG
#org.springframework.security: trace
#org.springframework.security: trace
#日志配置,输出到文本,
#Java Web Token 时效时间,单位秒
jwt:
... ... @@ -174,12 +174,12 @@ eeid:
#电表所需要接口
eeUrl:
#电表充值路径
rechargeDevicesUrl: "http://10.5.10.102:8000/api/emcs/rechargeDevices"
# rechargeDevicesUrl: "http://192.168.1.7:18080/api/emcs/rechargeDevices"
# rechargeDevicesUrl: "http://10.5.10.102:8000/api/emcs/rechargeDevices"
rechargeDevicesUrl: "http://192.168.1.7:18080/api/emcs/rechargeDevices"
#获取电表实时数据/余额
electricityBanlanceUrl: "http://10.5.10.102:8000/api/emcs/getEnergyInfoForRealTime"
# electricityBanlanceUrl: "http://192.168.1.7:18080/api/emcs/getEnergyInfoForRealTime"
# electricityBanlanceUrl: "http://10.5.10.102:8000/api/emcs/getEnergyInfoForRealTime"
electricityBanlanceUrl: "http://192.168.1.7:18080/api/emcs/getEnergyInfoForRealTime"
#获取设备跟公寓信息
getRoomAndDeviceUrl: "http://10.5.10.102:8000/api/emcs/getRoomAndDevice"
# getRoomAndDeviceUrl: "http://192.168.1.7:18080/api/emcs/getRoomAndDevice"
# getRoomAndDeviceUrl: "http://10.5.10.102:8000/api/emcs/getRoomAndDevice"
getRoomAndDeviceUrl: "http://192.168.1.7:18080/api/emcs/getRoomAndDevice"
... ...
... ... @@ -4,21 +4,24 @@
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="./logs" />
<property name="log.path" value="./logs"/>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--输出到控制台-->
... ... @@ -197,40 +200,40 @@
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--<logger name="com.tianbo.analysis" level="trace">-->
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="TRACE_FILE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="TRACE_FILE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--</logger>-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="org.springframework" level="info"/>
<logger name="org.apache.tomcat" level="info" />
<logger name="com.sunyo.energy.location.dao" level="DEBUG" />
<logger name="org.apache.tomcat" level="info"/>
<logger name="com.sunyo.energy.location.dao" level="DEBUG"/>
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="TRACE_FILE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
<appender-ref ref="CONSOLE"/>
<appender-ref ref="TRACE_FILE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!--生产环境:输出到文件-->
<springProfile name="pro">
<logger name="org.springframework.boot" level="INFO"/>
<logger name="com.sunyo.energy.location.dao" level="DEBUG" />
<logger name="com.sunyo.energy.location.dao" level="DEBUG"/>
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="ERROR_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="TRACE_FILE" />
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="TRACE_FILE"/>
</root>
</springProfile>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sunyo.energy</groupId>
<artifactId>location</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>order</name>
<description>工单系统</description>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sunyo.energy</groupId>
<artifactId>location</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>order</name>
<description>工单系统</description>
<properties>
<java.version>1.8</java.version>
<druid.version>1.1.9</druid.version>
<spring-cloud.version>Greenwich.BUILD-SNAPSHOT</spring-cloud.version>
<lombok_sersion>1.18.6</lombok_sersion>
<fastjson_version>1.2.28</fastjson_version>
<swagger2_version>2.9.2</swagger2_version>
</properties>
<properties>
<java.version>1.8</java.version>
<druid.version>1.1.9</druid.version>
<spring-cloud.version>Greenwich.BUILD-SNAPSHOT</spring-cloud.version>
<lombok_sersion>1.18.6</lombok_sersion>
<fastjson_version>1.2.28</fastjson_version>
<swagger2_version>2.9.2</swagger2_version>
</properties>
<dependencies>
<dependencies>
<!--水电缴费支付需要包-->
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
<!--水电缴费支付需要包-->
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<!--websocket 依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-log -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-log</artifactId>
<version>5.2.5</version>
</dependency>
<!--websocket 依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-log -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-log</artifactId>
<version>5.2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<!--clound-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!--数据库-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson_version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<!--分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<!--clound-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!--数据库-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson_version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<!--分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!--集成swagger2,下面两个spring的配置解决springboot包 与swagger2的包冲突问题,生产部署的时候记得要去掉此swagger2的配置,开发环境开启-->
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>1.2.0.RELEASE</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
<version>1.2.0.RELEASE</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger2_version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2_version}</version>
<!--2.9.2集成的是M1的这两个包,跟现在用的Greenwich.BUILD-SNAPSHOT的版本的SPRING boot2的版本包有冲突。去掉-->
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--集成swagger2-->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- mybatis generator 自动生成代码插件 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
</plugin>
<!--Generate java code by xsd file-->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<configuration>
<schemaDirectory>src/main/resources/xsd</schemaDirectory>
<generateDirectory>src/main/java</generateDirectory>
<packageLevelAnnotations>false</packageLevelAnnotations>
<noFileHeader>true</noFileHeader>
<episode>false</episode>
<locale>en</locale>
</configuration>
<executions>
<execution>
<id>xsd1-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaIncludes>
<include>DecMessage_ImportSave1.xsd</include>
</schemaIncludes>
<generatePackage>com.sunyo.customer.order.xsd1</generatePackage>
</configuration>
</execution>
</executions>
</plugin>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!--集成swagger2,下面两个spring的配置解决springboot包 与swagger2的包冲突问题,生产部署的时候记得要去掉此swagger2的配置,开发环境开启-->
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>1.2.0.RELEASE</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
<version>1.2.0.RELEASE</version><!--$NO-MVN-MAN-VER$-->
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger2_version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2_version}</version>
<!--2.9.2集成的是M1的这两个包,跟现在用的Greenwich.BUILD-SNAPSHOT的版本的SPRING boot2的版本包有冲突。去掉-->
<exclusions>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-metadata</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--集成swagger2-->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- mybatis generator 自动生成代码插件 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
</plugin>
<!--Generate java code by xsd file-->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<configuration>
<schemaDirectory>src/main/resources/xsd</schemaDirectory>
<generateDirectory>src/main/java</generateDirectory>
<packageLevelAnnotations>false</packageLevelAnnotations>
<noFileHeader>true</noFileHeader>
<episode>false</episode>
<locale>en</locale>
</configuration>
<executions>
<execution>
<id>xsd1-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaIncludes>
<include>DecMessage_ImportSave1.xsd</include>
</schemaIncludes>
<generatePackage>com.sunyo.customer.order.xsd1</generatePackage>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>gen-webadmin</id>
<phase>package</phase>
<configuration>
<tasks>
<copy todir="docker" file="target/${project.artifactId}-${project.version}.${project.packaging}" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>gen-webadmin</id>
<phase>package</phase>
<configuration>
<tasks>
<copy todir="docker"
file="target/${project.artifactId}-${project.version}.${project.packaging}"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</plugins>
</build>
</project>
... ...
... ... @@ -12,8 +12,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
//@ComponentScan("com.sunyo.energy.location")
public class BootApplication {
public static void main(String[] args) {
SpringApplication.run(BootApplication.class, args);
}
public static void main(String[] args) {
SpringApplication.run(BootApplication.class, args);
}
}
... ...
... ... @@ -25,6 +25,7 @@ public class Swagger2 {
.paths(PathSelectors.any())
.build();
}
//构建 api文档的详细信息函数,注意这里的注解引用的是哪个
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
... ...
package com.sunyo.energy.location.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.ElectricityInfo;
import com.sunyo.energy.location.service.EeInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import sun.jvm.hotspot.debugger.Page;
import java.util.List;
/**
* @author shenhailong
* <p>
* 2020/6/5/10:44
*/
@RequestMapping(value = "/eeInfo")
@Component
public class EeInfoController {
@Autowired
EeInfoService eeInfoService;
@ApiOperation(value = "查询电表充值失败信息")
@RequestMapping("/list")
@ResponseBody
public PageInfo<ElectricityInfo> list(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize,
@RequestParam(value = "pageNum", required = false, defaultValue = "5") int pageNum,
@RequestParam(value = "deviceId", required = false) String deviceId){
PageInfo<ElectricityInfo> eeInfo = eeInfoService.getEeInfo(pageSize, pageNum, deviceId);
return eeInfo;
}
}
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.ElectricityBalanceThree;
import com.sunyo.energy.location.model.ElectricityMeter;
import com.sunyo.energy.location.model.WaterElectricityParameter;
import com.sunyo.energy.location.service.ElectricityMeterService;
import com.sunyo.energy.location.service.WaterElectricityParameterService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@RequestMapping("/electricity_meter")
@Controller
public class ElectricityParameterController {
@Autowired
private WaterElectricityParameterService waterElectricityParameterService;
/**
* 电表处理远程访问 返回值信息
*/
@Autowired
ElectricityMeterService electricityMeterService;
@ApiOperation(value = "电表参数配置")
@RequestMapping("/add")
@ResponseBody
public ResultJson eetParam(ResultJson resultJson, WaterElectricityParameter waterElectricityParameter){
try {
if (waterElectricityParameterService.countOne(waterElectricityParameter.getEeId())>0){
resultJson.setCode("200");
return resultJson;
}else {
int i = waterElectricityParameterService.insertSelective(waterElectricityParameter);
if (i>0){
resultJson.setCode("200");
resultJson.setMsg("添加成功");
return resultJson;
}else {
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}
}catch (Exception e){
e.printStackTrace();
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}
@ApiOperation(value = "电表参数查询")
@RequestMapping("/getEEModel")
@ResponseBody
public WaterElectricityParameter getEEModel(@RequestParam(value = "eeId", required = false) String eeId){
WaterElectricityParameter oneElectricity = waterElectricityParameterService.findOneElectricity(eeId);
System.out.println("111");
return oneElectricity;
}
@ApiOperation(value = "电表参数编辑")
@RequestMapping("/edit")
@ResponseBody
public ResultJson edit(ResultJson resultJson, WaterElectricityParameter waterElectricityParameter){
try {
if (waterElectricityParameterService.updateByPrimaryKeySelective(waterElectricityParameter)>0){
resultJson.setCode("200");
return resultJson;
}else {
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}catch (Exception e){
e.printStackTrace();
resultJson.setCode("500");
resultJson.setMsg("网络异常");
return resultJson;
}
}
/**
* 获取电表实施数据
* @param eeId
* @return
*/
@ApiOperation(value = "电表实时信息查询")
@RequestMapping(value = "/getEnergyInfoForRealTime")
@ResponseBody
public ElectricityMeter getEnergyInfoForRealTime(@RequestParam(value = "eeId", required = false) String eeId){
try {
ElectricityMeter energyInfoForRealTime = electricityMeterService.getEnergyInfoForRealTime(eeId);
return energyInfoForRealTime;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
}
package com.sunyo.energy.location.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.dao.LocationMapper;
import com.sunyo.energy.location.model.Location;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/location")
public class LocationController {
@Autowired
private LocationMapper locationMapper;
@ApiOperation(value = "查询楼层")
@RequestMapping(value="/list",method= RequestMethod.GET)
public ResultJson startActivityDemo(@RequestParam(value = "pageNum",required = false,defaultValue = "1")
int pageNum,
@RequestParam(value = "pageSize",required = false,defaultValue = "5")
int pageSize,
@RequestParam(value = "processName", required = false)
String adrname,
@RequestParam(value = "parent", required = false)
int parent){
Page<Location> page = PageHelper.startPage(pageNum,pageSize);
List<Location> list = null;
if (StringUtils.isEmpty(adrname)) {
list = locationMapper.selectAll(parent);
if (parent == 0){
Location location = list.get(0);
List<Location> locationsList = locationMapper.selectAll(location.getId());
for (Location loc: list){
loc.setChildren(locationsList);
}
}
}else {
list= locationMapper.selectAllAdrName(adrname);
}
PageInfo<Location> result = new PageInfo<Location>(list);
return new ResultJson("200","success",result);
}
@ApiOperation(value = "新增楼层")
@PostMapping(value = "/add")
public ResultJson addLocation(@RequestParam("adrName") String adrName,
@RequestParam("parent") Integer parent,
@RequestParam("type") Integer type){
ResultJson resultJson = new ResultJson();
Location location = new Location();
Map map = new HashMap();
map.put("adrName", adrName);
map.put("parent", parent);
if (locationMapper.countAdrName(map) > 0){
resultJson.setCode("201");
} else {
location.setParent(parent);
location.setType(type);
location.setAdrname(adrName);
if (locationMapper.insertSelective(location)>0){
resultJson.setCode("200");
}else {
resultJson.setCode("202");
}
}
return resultJson;
}
@ApiOperation(value = "删除楼层")
@DeleteMapping(value = "/del")
public ResultJson delLocation(@RequestBody Location location){
ResultJson resultJson = new ResultJson();
if (locationMapper.countParent(location.getId()) > 0) {
resultJson.setCode("201");
return resultJson;
}else {
if (locationMapper.deleteByPrimaryKey(location.getId())>0){
resultJson.setCode("200");
return resultJson;
}else {
resultJson.setCode("201");
return resultJson;
}
}
}
@ApiOperation(value = "修改楼层")
@PutMapping(value = "/edit")
public ResultJson editLocation(@RequestBody Location location){
ResultJson resultJson = new ResultJson();
if (locationMapper.updateByPrimaryKeySelective(location)>0){
resultJson.setCode("200");
}else {
resultJson.setCode("201");
}
return resultJson;
}
}
package com.sunyo.energy.location.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.PayRecords;
import com.sunyo.energy.location.service.PayOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* Created by XYH on 2019/12/16.
* 订单查询,新增,更新,删除
*/
@Api(description = "订单管理")
@RestController
@RequestMapping("/order")
public class PayOrderController {
@Autowired
PayOrderService payOrderService;
@ApiOperation(value = "查询缴费订单")
@RequestMapping("/list")
public PageInfo<PayRecords> getOrder(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize,
@RequestParam(value = "pageNum", required = false, defaultValue = "5") int pageNum,
@RequestParam(value = "orderNumber",required = false) String orderNumber,
@RequestParam(value = "payTime", required = false) String payTime ){
PageInfo<PayRecords> order = payOrderService.getOrder(pageSize, pageNum, orderNumber, payTime);
return order;
}
@ApiOperation(value = "新增缴费订单")
@PostMapping("/add")
public ResultJson addOrder(@RequestBody PayRecords records){
int mgs=0;
int result=payOrderService.addOrder(records);
if(result>0){
mgs=1;
}
return mgs==1?new ResultJson("200","新增订单成功"):new ResultJson("500","新增订单失败");
}
@ApiOperation(value = "更新缴费订单")
@PutMapping("/edi")
public ResultJson ediOrder(@RequestBody PayRecords records){
int mgs=0;
int result=payOrderService.ediOrder(records);
if(result>0){
mgs=1;
}
return mgs==1? new ResultJson("200","订单信息更新成功"):new ResultJson("500","订单信息更新失败");
}
@ApiOperation(value = "删除缴费订单")
@DeleteMapping("/del")
public ResultJson delOrder(@RequestBody PayRecords payRecords){
int mgs=0;
int result=payOrderService.delOrder(payRecords);
if(result>0){
mgs=1;
}
return mgs==1? new ResultJson("200","订单信息移出成功"):new ResultJson("500","订单信息删除失败");
}
}
... ... @@ -11,7 +11,6 @@ import com.sunyo.energy.location.service.WaterMeterService;
import com.sunyo.energy.location.websocket.WebSocketServer;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
... ... @@ -21,7 +20,7 @@ import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;
@Controller
@RequestMapping("/payCode")
public class PayRseponeController {
... ... @@ -40,23 +39,24 @@ public class PayRseponeController {
/**
* 接受字段
* @param POSID 商户柜台代码
*
* @param POSID 商户柜台代码
* @param BRANCHID 分行代码
* @param ORDERID 定单号
* @param PAYMENT 付款金额
* @param CURCODE 币种
* @param REMARK1 备注一
* @param REMARK2 备注二
* @param ORDERID 定单号
* @param PAYMENT 付款金额
* @param CURCODE 币种
* @param REMARK1 备注一
* @param REMARK2 备注二
* @param ACC_TYPE 账户类型
* @param SUCCESS 成功标志
* @param TYPE 接口类型
* @param SUCCESS 成功标志
* @param TYPE 接口类型
* @param REFERER Referer信息
* @param CLIENTIP 客户端IP
* @param CLIENTIP 客户端IP
* @param ACCDATE 系统记账日期
* @param USRMSG 支付账户信息
* @param USRMSG 支付账户信息
* @param USRINFO 客户加密信息
* @param PAYTYPE 支付方式
* @param SIGN 数字签名
* @param SIGN 数字签名
*/
@RequestMapping(value = "/payResponse")
@ApiOperation(value = "支付回执是否成功")
... ... @@ -98,53 +98,53 @@ public class PayRseponeController {
payResponse.setUsrinfo(USRINFO);
payResponse.setPaytype(PAYTYPE);
payResponse.setSign(SIGN);
int msg =0;
int msg = 0;
int i = payResponseMapperl.insertSelective(payResponse);
if (i>0){
msg =1;
if (i > 0) {
msg = 1;
PayRecords payRecords = new PayRecords();
// 支付类型
if (!"".equals(ACC_TYPE)){
if ("WX".equals(ACC_TYPE)){
if (!"".equals(ACC_TYPE)) {
if ("WX".equals(ACC_TYPE)) {
payRecords.setPayfesstype(false);
}else {
} else {
payRecords.setPayfesstype(true);
}
}
if ("Y".equals(SUCCESS)){
if ("Y".equals(SUCCESS)) {
payRecords.setOrdernumber(ORDERID);
payRecords.setReamke3("1");
}else {
} else {
payRecords.setOrdernumber(ORDERID);
payRecords.setReamke3("0");
}
// 查询是水还是电
boolean selectType = payRecordsMapper.selectType(ORDERID);
if (selectType){
if (selectType) {
// 查询该订单设备编号
String eeId = payRecordsMapper.findOrderNumber(ORDERID);
if (!"".equals(eeId)){
if (!"".equals(eeId)) {
// 通知充值电费
int eeResult = electricityMeterService.rechargeDevices(eeId, PAYMENT, "0", ORDERID);
if (eeResult > 0){
if (eeResult > 0) {
// 修改订单状态
int i1 = payRecordsMapper.updateByPrimaryKey(payRecords);
if (i1>0){
if (i1 > 0) {
WebSocketServer webSocketServer = new WebSocketServer();
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderNumber", ORDERID);
jsonObject.put("success", "Y");
webSocketServer.broadcast(jsonObject.toJSONString());
}else {
} else {
WebSocketServer webSocketServer = new WebSocketServer();
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderNumber", ORDERID);
jsonObject.put("success", "N");
webSocketServer.broadcast(jsonObject.toJSONString());
}
}else {
} else {
WebSocketServer webSocketServer = new WebSocketServer();
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderNumber", ORDERID);
... ... @@ -152,29 +152,29 @@ public class PayRseponeController {
webSocketServer.broadcast(jsonObject.toJSONString());
}
}
}else {
} else {
// 查询该订单设备编号
String wmId = payRecordsMapper.findOrderNumber(ORDERID);
// 通知充值水费
if (!"".equals(wmId)){
if (!"".equals(wmId)) {
ResultJson resultJson = waterMeterService.payWater(PAYMENT, wmId);
if ("200".equals(resultJson.getCode())){
if ("200".equals(resultJson.getCode())) {
// 修改订单状态
int i1 = payRecordsMapper.updateByPrimaryKey(payRecords);
if (i1>0){
if (i1 > 0) {
WebSocketServer webSocketServer = new WebSocketServer();
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderNumber", ORDERID);
jsonObject.put("success", "Y");
webSocketServer.broadcast(jsonObject.toJSONString());
}else {
} else {
WebSocketServer webSocketServer = new WebSocketServer();
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderNumber", ORDERID);
jsonObject.put("success", "N");
webSocketServer.broadcast(jsonObject.toJSONString());
}
}else {
} else {
WebSocketServer webSocketServer = new WebSocketServer();
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderNumber", ORDERID);
... ... @@ -185,7 +185,7 @@ public class PayRseponeController {
}
}
return i==1? new ResultJson("200","支付回执信息接受成功"):new ResultJson("500","支付回执信息接受失败");
return i == 1 ? new ResultJson("200", "支付回执信息接受成功") : new ResultJson("500", "支付回执信息接受失败");
}
}
... ...
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.dao.LocationMapper;
import com.sunyo.energy.location.service.LocationService;
import com.sunyo.energy.location.service.WaterMeterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(description = "用户支付管理")
@RestController
@RequestMapping("/userPayOrder")
public class UserPayController {
@Autowired
private LocationService locationService;
@Autowired
private WaterMeterService waterMeterService;
@Autowired
private LocationMapper locationMapper;
@ApiOperation(value = "查看缴费房间")
@RequestMapping("/list")
public List userPayList(@RequestParam(value = "roomNumber", required = false) String roomNumber ){
return locationService.userPayList(roomNumber);
}
@ApiOperation(value = "充值水费")
@PostMapping("/add")
public ResultJson payWater(@RequestParam(value = "payFees", required = false) String payFees,
@RequestParam(value = "wmId", required = false) String wmId){
return waterMeterService.payWater(payFees, wmId);
}
@ApiOperation(value = "请求返回二维码")
@PostMapping("/qrCode")
public ResultJson qrCode(@RequestParam(value = "payFees", required = false) String payFees,
@RequestParam(value = "wmId", required = false) String wmId,
@RequestParam(value = "userId", required = false) String userId,
@RequestParam(value = "realName", required = false) String realName,
@RequestParam(value = "deviceId", required = false) String eeId) throws UnsupportedEncodingException {
ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName, eeId);
return resultJson;
}
@ApiOperation(value = "钉钉小程序请求水电返回数据")
@PostMapping("/mincData")
public Map<String, Object> mincData(@RequestParam(value = "loginName", required = false) String loginName){
Map<String, Object> map = new HashMap<>();
/**
* 查询该账号所绑定的水电编号
*/
return map;
}
}
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.model.WaterMeter;
import com.sunyo.energy.location.service.WaterMeterService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/water_meter")
public class WaterMeterController {
@Autowired
private WaterMeterService waterMeterService;
@ApiOperation(value = "水表单个实施信息查询")
@RequestMapping("/findRealTime")
@ResponseBody
public WaterMeter findRealTime(@RequestParam(value = "wmId", required = false) String wmId){
return waterMeterService.findRealTime(wmId);
}
@ApiOperation(value = "查询所有水表编号")
@RequestMapping("/waterMeterAll")
@ResponseBody
public ResultJson waterMeterAll(@RequestParam(value = "wmId", required = false) String wmId){
return waterMeterService.waterMeterAll(wmId);
}
@RequestMapping("/realTime")
@ResponseBody
public int realTime(){
return waterMeterService.realTime();
}
}
... ... @@ -12,22 +12,23 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
* 统一拦截response接口返回数据
*/
//@ControllerAdvice
public class RestControllerResponseAdvice implements ResponseBodyAdvice<Object> {
public class RestControllerResponseAdvice implements ResponseBodyAdvice<Object> {
/**
* //判断支持的类型,因为我们定义的BaseResponseVo 里面的data可能是任何类型,这里就不判断统一放过
* 如果你想对执行的返回体进行操作,可将上方的Object换成你自己的类型
*
* @param returnType
* @param converterType
* @return
*/
@Override
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType){
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
return true;
}
@Override
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response){
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {
// 对body进行封装处理
if (body instanceof String) {
String msg = (String) body;
... ...
... ... @@ -5,7 +5,7 @@ import lombok.Data;
import java.io.Serializable;
@Data
public class ResultJson<T> implements Serializable{
public class ResultJson<T> implements Serializable {
private static final long serialVersionUID = 1L;
// 状态码 正确为200
... ...
... ... @@ -20,7 +20,8 @@ public interface PayRecordsMapper {
List<PayRecords> findAll(@Param(value = "orderNumber") String orderNumber,
@Param(value = "startTime") String startTime,
@Param(value = "endTime") String endTime);
@Param(value = "endTime") String endTime,
@Param(value = "username") String username);
String findOrderNumber(String orderId);
... ...
... ... @@ -18,115 +18,115 @@ import org.apache.commons.logging.LogFactory;
public class HttpClientUtil {
public static String httpReader(String url, String code){
System.out.println("GetPage:"+url);
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
String result = null;
try {
client.executeMethod(method);
int status = method.getStatusCode();
if (status == HttpStatus.SC_OK) {
result = method.getResponseBodyAsString();
} else {
System.out.println("Method failed: " + method.getStatusLine());
}
} catch (HttpException e) {
// �����������쳣��������Э�鲻�Ի��߷��ص�����������
System.out.println("Please check your provided http address!");
e.printStackTrace();
} catch (IOException e) {
// ���������쳣
System.out.println("���������쳣��");
e.printStackTrace();
} finally{
// �ͷ�����
if(method!=null)method.releaseConnection();
method = null;
client = null;
}
return result;
}
public static String httpGet(String url,String code) {
System.out.println("GetPage:"+url);
String content = null;
HttpClient httpClient = new HttpClient();
//����header
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2");
GetMethod method = new GetMethod(url);
try {
int statusCode = httpClient.executeMethod(method);
System.out.println("httpClientUtils::statusCode="+statusCode);
System.out.println(method.getStatusLine());
content = new String(method.getResponseBody(), code);
} catch (Exception e) {
System.out.println("time out");
e.printStackTrace();
} finally {
if(method!=null)method.releaseConnection();
method = null;
httpClient = null;
}
return content;
}
public static String httpPost(String url, Map paramMap, String code) {
System.out.println("GetPage:"+url);
String content = null;
if (url == null || url.trim().length() == 0 || paramMap == null
|| paramMap.isEmpty())
return null;
HttpClient httpClient = new HttpClient();
//����header
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2");//
//��������
//httpClient.getHostConfiguration().setProxy("128.128.176.74", 808);
PostMethod method = new PostMethod(url);
Iterator it = paramMap.keySet().iterator();
while (it.hasNext()) {
String key = it.next() + "";
Object o = paramMap.get(key);
if (o != null && o instanceof String) {
method.addParameter(new NameValuePair(key, o.toString()));
}
if (o != null && o instanceof String[]) {
String[] s = (String[]) o;
if (s != null)
for (int i = 0; i < s.length; i++) {
method.addParameter(new NameValuePair(key, s[i]));
}
}
}
try {
int statusCode = httpClient.executeMethod(method);
System.out.println("httpClientUtils::statusCode="+statusCode);
System.out.println(method.getStatusLine());
content = new String(method.getResponseBody(), code);
} catch (Exception e) {
System.out.println("time out");
e.printStackTrace();
} finally {
if(method!=null)method.releaseConnection();
method = null;
httpClient = null;
}
return content;
}
public static String httpPost(String url, Map paramMap) {
//���룺UTF-8
return HttpClientUtil.httpPost(url, paramMap, "UTF-8");
}
public static String httpReader(String url, String code) {
System.out.println("GetPage:" + url);
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
String result = null;
try {
client.executeMethod(method);
int status = method.getStatusCode();
if (status == HttpStatus.SC_OK) {
result = method.getResponseBodyAsString();
} else {
System.out.println("Method failed: " + method.getStatusLine());
}
} catch (HttpException e) {
// �����������쳣��������Э�鲻�Ի��߷��ص�����������
System.out.println("Please check your provided http address!");
e.printStackTrace();
} catch (IOException e) {
// ���������쳣
System.out.println("���������쳣��");
e.printStackTrace();
} finally {
// �ͷ�����
if (method != null) method.releaseConnection();
method = null;
client = null;
}
return result;
}
public static String httpGet(String url, String code) {
System.out.println("GetPage:" + url);
String content = null;
HttpClient httpClient = new HttpClient();
//����header
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT, "Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2");
GetMethod method = new GetMethod(url);
try {
int statusCode = httpClient.executeMethod(method);
System.out.println("httpClientUtils::statusCode=" + statusCode);
System.out.println(method.getStatusLine());
content = new String(method.getResponseBody(), code);
} catch (Exception e) {
System.out.println("time out");
e.printStackTrace();
} finally {
if (method != null) method.releaseConnection();
method = null;
httpClient = null;
}
return content;
}
public static String httpPost(String url, Map paramMap, String code) {
System.out.println("GetPage:" + url);
String content = null;
if (url == null || url.trim().length() == 0 || paramMap == null
|| paramMap.isEmpty())
return null;
HttpClient httpClient = new HttpClient();
//����header
httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT, "Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.2) Gecko/20090803 Fedora/3.5.2-2.fc11 Firefox/3.5.2");//
//��������
//httpClient.getHostConfiguration().setProxy("128.128.176.74", 808);
PostMethod method = new PostMethod(url);
Iterator it = paramMap.keySet().iterator();
while (it.hasNext()) {
String key = it.next() + "";
Object o = paramMap.get(key);
if (o != null && o instanceof String) {
method.addParameter(new NameValuePair(key, o.toString()));
}
if (o != null && o instanceof String[]) {
String[] s = (String[]) o;
if (s != null)
for (int i = 0; i < s.length; i++) {
method.addParameter(new NameValuePair(key, s[i]));
}
}
}
try {
int statusCode = httpClient.executeMethod(method);
System.out.println("httpClientUtils::statusCode=" + statusCode);
System.out.println(method.getStatusLine());
content = new String(method.getResponseBody(), code);
} catch (Exception e) {
System.out.println("time out");
e.printStackTrace();
} finally {
if (method != null) method.releaseConnection();
method = null;
httpClient = null;
}
return content;
}
public static String httpPost(String url, Map paramMap) {
//���룺UTF-8
return HttpClientUtil.httpPost(url, paramMap, "UTF-8");
}
}
... ...
... ... @@ -3,75 +3,63 @@ package com.sunyo.energy.location.demopay;
import java.io.*;
import java.security.*;
public class MD5
public class MD5 {
{
public static String md5Str(String str)
{
if (str == null)return "";
public static String md5Str(String str) {
if (str == null) return "";
return md5Str(str, 0);
}
/**
* ������ϢժҪ��
* @param data ����ժҪ�����ݡ�
*
* @param data ����ժҪ�����ݡ�
* @param offset ����ƫ�Ƶ�ַ��
* @param length ���ݳ��ȡ�
* @return ժҪ�����(16�ֽ�)
*/
public static String md5Str(String str, int offset)
{
try
{
public static String md5Str(String str, int offset) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
byte[] b = str.getBytes("UTF8");
md5.update(b, offset, b.length);
return byteArrayToHexString(md5.digest());
}
catch (NoSuchAlgorithmException ex)
{
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
return null;
}
catch (UnsupportedEncodingException ex)
{
} catch (UnsupportedEncodingException ex) {
ex.printStackTrace();
return null;
}
}
/**
*
* @param b byte[]
* @return String
*/
public static String byteArrayToHexString(byte[] b)
{
public static String byteArrayToHexString(byte[] b) {
String result = "";
for (int i = 0; i < b.length; i++)
{
for (int i = 0; i < b.length; i++) {
result += byteToHexString(b[i]);
}
return result;
}
private static String[] hexDigits =
{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b",
"c", "d", "e", "f"};
{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b",
"c", "d", "e", "f"};
/**
* ���ֽ�ת��Ϊ��Ӧ��16��������
*
* @param b byte
* @return String
*/
public static String byteToHexString(byte b)
{
public static String byteToHexString(byte b) {
int n = b;
if (n < 0)
{
if (n < 0) {
n = 256 + n;
}
int d1 = n / 16;
... ... @@ -79,11 +67,10 @@ public class MD5
return hexDigits[d1] + hexDigits[d2];
}
public static void main(String[] args)
{
System.out.println(byteToHexString((byte)-99));
public static void main(String[] args) {
System.out.println(byteToHexString((byte) -99));
String str =
"eeeeeeeeeeeeeewrw213123122222222222222222222222213123213213213erwer";
"eeeeeeeeeeeeeewrw213123122222222222222222222222213123213213213erwer";
String ened = MD5.md5Str(str);
System.out.println(ened.length());
System.out.println(ened);
... ...
... ... @@ -16,92 +16,92 @@ import springfox.documentation.spring.web.json.Json;
public class QrDemo {
public static String orUrl(String orderId, String payMent) throws UnsupportedEncodingException {
String bankURL="https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain";
/**
* 商户代码
*/
String MERCHANTID = "105000045820502";
public static String orUrl(String orderId, String payMent) throws UnsupportedEncodingException {
String bankURL = "https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain";
/**
* 商户代码
*/
String MERCHANTID = "105000045820502";
// String MERCHANTID = "105001453995827";
/**
* 商户柜台代码
*/
String POSID = "049347762";
/**
* 商户柜台代码
*/
String POSID = "049347762";
// String POSID = "031575220";
/**
* 分行代码
*/
/**
* 分行代码
*/
// String BRANCHID = "410803805";
String BRANCHID = "410000000";
/**
* 货币种类 01 人民币 只支持人民币
*/
String CURCODE="01";
/**
* 交易码
*/
String TXCODE = "530550";
String REMARK1 = "";
String REMARK2 = "";
/**
* 返回类型
*/
String RETURNTYPE="3";
String TIMEOUT = "";
/**
* 应柜台的公钥后30位
*/
String PUB32TR2= "57b3055539f4925efaf9dacb020111";
String BRANCHID = "410000000";
/**
* 货币种类 01 人民币 只支持人民币
*/
String CURCODE = "01";
/**
* 交易码
*/
String TXCODE = "530550";
String REMARK1 = "";
String REMARK2 = "";
/**
* 返回类型
*/
String RETURNTYPE = "3";
String TIMEOUT = "";
/**
* 应柜台的公钥后30位
*/
String PUB32TR2 = "57b3055539f4925efaf9dacb020111";
// String PUB32TR2= "8578d1cd9340dba556126a71020111";
StringBuffer tmp = new StringBuffer(); //ÑéÇ©×Ö¶Î
tmp.append("MERCHANTID=");
tmp.append(MERCHANTID);
tmp.append("&POSID=");
tmp.append(POSID);
tmp.append("&BRANCHID=");
tmp.append(BRANCHID);
tmp.append("&ORDERID=");
tmp.append(orderId);
tmp.append("&PAYMENT=");
tmp.append(payMent);
tmp.append("&CURCODE=");
tmp.append(CURCODE);
tmp.append("&TXCODE=");
tmp.append(TXCODE);
tmp.append("&REMARK1=");
tmp.append(REMARK1);
tmp.append("&REMARK2=");
tmp.append(REMARK2);
tmp.append("&RETURNTYPE=");
tmp.append(RETURNTYPE);
tmp.append("&TIMEOUT=");
tmp.append(TIMEOUT);
tmp.append("&PUB=");
tmp.append(PUB32TR2);
StringBuffer tmp = new StringBuffer(); //ÑéÇ©×Ö¶Î
tmp.append("MERCHANTID=");
tmp.append(MERCHANTID);
tmp.append("&POSID=");
tmp.append(POSID);
tmp.append("&BRANCHID=");
tmp.append(BRANCHID);
tmp.append("&ORDERID=");
tmp.append(orderId);
tmp.append("&PAYMENT=");
tmp.append(payMent);
tmp.append("&CURCODE=");
tmp.append(CURCODE);
tmp.append("&TXCODE=");
tmp.append(TXCODE);
tmp.append("&REMARK1=");
tmp.append(REMARK1);
tmp.append("&REMARK2=");
tmp.append(REMARK2);
tmp.append("&RETURNTYPE=");
tmp.append(RETURNTYPE);
tmp.append("&TIMEOUT=");
tmp.append(TIMEOUT);
tmp.append("&PUB=");
tmp.append(PUB32TR2);
Map map = new HashMap();
map.put("CCB_IBSVersion","V6"); //±ØÊäÏî
map.put("MERCHANTID",MERCHANTID);
map.put("BRANCHID",BRANCHID);
map.put("POSID",POSID);
map.put("ORDERID",orderId);
map.put("PAYMENT",payMent);
map.put("CURCODE",CURCODE);
map.put("TXCODE",TXCODE);
map.put("REMARK1",REMARK1);
map.put("REMARK2",REMARK2);
map.put("RETURNTYPE",RETURNTYPE);
map.put("TIMEOUT",TIMEOUT);
map.put("MAC",MD5.md5Str(tmp.toString()));
Map map = new HashMap();
map.put("CCB_IBSVersion", "V6"); //±ØÊäÏî
map.put("MERCHANTID", MERCHANTID);
map.put("BRANCHID", BRANCHID);
map.put("POSID", POSID);
map.put("ORDERID", orderId);
map.put("PAYMENT", payMent);
map.put("CURCODE", CURCODE);
map.put("TXCODE", TXCODE);
map.put("REMARK1", REMARK1);
map.put("REMARK2", REMARK2);
map.put("RETURNTYPE", RETURNTYPE);
map.put("TIMEOUT", TIMEOUT);
map.put("MAC", MD5.md5Str(tmp.toString()));
String ret = HttpClientUtil.httpPost(bankURL, map);
String ret = HttpClientUtil.httpPost(bankURL, map);
Gson gson = new Gson();
QrURLDemo qrurl = (QrURLDemo) gson.fromJson(ret, QrURLDemo.class);
String rets = HttpClientUtil.httpGet(qrurl.getPAYURL(), "UTF-8");
JSONObject jsonObject = JSONObject.fromObject(rets);
String qrurl1 = URLDecoder.decode(jsonObject.get("QRURL").toString(), "UTF-8");
return qrurl1;
}
Gson gson = new Gson();
QrURLDemo qrurl = (QrURLDemo) gson.fromJson(ret, QrURLDemo.class);
String rets = HttpClientUtil.httpGet(qrurl.getPAYURL(), "UTF-8");
JSONObject jsonObject = JSONObject.fromObject(rets);
String qrurl1 = URLDecoder.decode(jsonObject.get("QRURL").toString(), "UTF-8");
return qrurl1;
}
}
... ...
... ... @@ -8,6 +8,7 @@ public class QrORURLDemo {
public String getSUCCESS() {
return SUCCESS;
}
public void setSUCCESS(String success) {
SUCCESS = success;
}
... ...
... ... @@ -2,21 +2,22 @@ package com.sunyo.energy.location.demopay;
public class QrURLDemo {
private String SUCCESS;
private String PAYURL;
private String SUCCESS;
private String PAYURL;
public String getSUCCESS() {
return SUCCESS;
}
public String getSUCCESS() {
return SUCCESS;
}
public void setSUCCESS(String success) {
SUCCESS = success;
}
public void setSUCCESS(String success) {
SUCCESS = success;
}
public String getPAYURL() {
return PAYURL;
}
public void setPAYURL(String payurl) {
PAYURL = payurl;
}
public String getPAYURL() {
return PAYURL;
}
public void setPAYURL(String payurl) {
PAYURL = payurl;
}
}
... ...
... ... @@ -15,9 +15,4 @@ public class ElectricityRoomDeviceOne {
private ElectricityRoomDeviceTwo data;
}
... ...
... ... @@ -12,7 +12,7 @@ public class PayRecords {
private Integer payuserid;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date paytime;
private Integer paylocationid;
... ... @@ -63,7 +63,7 @@ public class PayRecords {
this.payuserid = payuserid;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
public Date getPaytime() {
return paytime;
}
... ...
... ... @@ -23,6 +23,7 @@ public interface ElectricityMeterService {
/**
* 电表充值接口
*
* @param deviceId
* @param money
* @param actionType
... ...
package com.sunyo.energy.location.service;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.model.PayRecords;
import com.github.pagehelper.PageInfo;
import com.sunyo.energy.location.model.PayRecords;
/**
* Created by XYH on 2019/12/16.
*/
public interface PayOrderService {
PageInfo<PayRecords> getOrder(int pageSize, int pageNum, String orderNumber, String payTime);
PageInfo<PayRecords> getOrder(int pageSize, int pageNum, String orderNumber, String payTime, String username);
int addOrder(PayRecords payRecords);
... ...
... ... @@ -18,7 +18,7 @@ public interface WaterMeterService {
/**
* 请求返回二维码
*/
*/
ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException;
... ...
... ... @@ -47,7 +47,7 @@ public class EeInfoServiceImpl implements EeInfoService {
@Override
public PageInfo<ElectricityInfo> getEeInfo(int pageSize, int pageNum, String deviceId) {
PageHelper.startPage(pageNum,pageSize);
PageHelper.startPage(pageNum, pageSize);
List<ElectricityInfo> list = electricityInfoMapper.selectAll(deviceId);
PageInfo<ElectricityInfo> result = new PageInfo<>(list);
... ...
... ... @@ -35,10 +35,9 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
USERSMapper usersMapper;
/**
* 获取电表实时数据/余额
*/
*/
@Value("${eeUrl.electricityBanlanceUrl}")
private String electricityBanlanceUrl;
... ... @@ -62,21 +61,21 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
* 实施获取电表数据
*/
@Override
public ElectricityMeter getEnergyInfoForRealTime(String deviceId){
public ElectricityMeter getEnergyInfoForRealTime(String deviceId) {
try {
if(!"".equals(deviceId)){
if (!"".equals(deviceId)) {
Map<String, Object> stringObjectMap = eeInfo(deviceId);
String infoForRealTime = HttpsUtils.sendPost(electricityBanlanceUrl, stringObjectMap);
ElectricityBalanceOne electricityBalanceOne = JSON.parseObject(infoForRealTime, ElectricityBalanceOne.class);
List<ElectricityMeter> infoForRealTimeList = electricityBalanceOne.getData().getDatas();
for (ElectricityMeter electricityBalanceThree: infoForRealTimeList){
if (electricityBalanceThree != null){
for (ElectricityMeter electricityBalanceThree : infoForRealTimeList) {
if (electricityBalanceThree != null) {
return electricityBalanceThree;
}
}
}
return null;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
return null;
}
... ... @@ -84,10 +83,11 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
/**
* 电表充值
* @param deviceId 设备编号
* @param money 充值金额
*
* @param deviceId 设备编号
* @param money 充值金额
* @param actionType 充值类型 0 充值 1 扣费
* @param orderNumber 订单号
* @param orderNumber 订单号
* @return
*/
@Override
... ... @@ -99,24 +99,24 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
String moneyString = String.valueOf(bigDecimal);
String secret = Md5Utils.getMD5(deviceId + moneyString + "tiansu", true, 32);
stringObjectMap.put("secret", secret);
log.info("电表充值信息{}",stringObjectMap.toString());
log.info("电表充值信息{}", stringObjectMap.toString());
try {
String result = HttpsUtils.sendPost(rechargeDevicesUrl, stringObjectMap);
log.info("电表充值反馈结果:{}",result);
log.info("电表充值反馈结果:{}", result);
RechargeDevicesResult rechargeDevicesResult = JSON.parseObject(result, RechargeDevicesResult.class);
List<RechargeDevicesResultData> data = rechargeDevicesResult.getData().getDatas();
Boolean message = null;
for (RechargeDevicesResultData rechargeDevicesResultData : data){
for (RechargeDevicesResultData rechargeDevicesResultData : data) {
message = rechargeDevicesResultData.getSuccess();
}
if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true){
log.info("电表充值成功,充值额度:{}",money);
if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true) {
log.info("电表充值成功,充值额度:{}", money);
return 1;
}else {
} else {
log.info("电表充值失败,充值额度:{}", money);
/**
* 插入临时表 电表接口充值因为硬件问题可能失败
*/
*/
ElectricityInfo electricityInfo = new ElectricityInfo();
electricityInfo.setOrderNumber(orderNumber);
electricityInfo.setActionType(actionType);
... ... @@ -129,14 +129,14 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
return 0;
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
log.error("电表充值失败,充值额度:{}",money);
log.error("电表充值失败,充值额度:{}", money);
return 0;
}
}
public Map<String, Object> eeInfo(String deviceId){
public Map<String, Object> eeInfo(String deviceId) {
Map<String, Object> datas = new HashMap<>();
datas.put("deviceId", deviceId);
return datas;
... ... @@ -145,11 +145,11 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
/**
* 定时读取电表临时表 发起充值
*/
@Scheduled(fixedDelay = 30000)
public void electricityInfo(){
// @Scheduled(fixedDelay = 30000)
public void electricityInfo() {
List<ElectricityInfo> electricityInfos = electricityInfoMapper.selectAll("");
if (electricityInfos.size() > 0){
for (ElectricityInfo electricityInfo: electricityInfos){
if (electricityInfos.size() > 0) {
for (ElectricityInfo electricityInfo : electricityInfos) {
Map<String, Object> stringObjectMap = mapCommon(electricityInfo.getActionType(),
electricityInfo.getDeviceId(),
String.valueOf(electricityInfo.getMoney()),
... ... @@ -159,13 +159,13 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
log.info("电表临时表充值请求信息:{}", electricityInfo.toString());
log.info("电表临时表充值返回信息:{}", result);
RechargeDevicesResult rechargeDevicesResult = JSON.parseObject(result, RechargeDevicesResult.class);
if(rechargeDevicesResult.getData()!= null){
if (rechargeDevicesResult.getData() != null) {
List<RechargeDevicesResultData> data = rechargeDevicesResult.getData().getDatas();
Boolean message = null;
for (RechargeDevicesResultData rechargeDevicesResultData : data){
for (RechargeDevicesResultData rechargeDevicesResultData : data) {
message = rechargeDevicesResultData.getSuccess();
}
if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true){
if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true) {
payRecordsMapper.updateStatus(electricityInfo.getOrderNumber());
electricityInfo.setStatus("0");
electricityInfoMapper.updateByPrimaryKeySelective(electricityInfo);
... ... @@ -173,9 +173,11 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
}
}
}
log.info("定时任务处理完成");
}
public Map<String, Object> mapCommon( String actionType, String deviceId, String money, String ip_address){
public Map<String, Object> mapCommon(String actionType, String deviceId, String money, String ip_address) {
Map<String, Object> map = new HashMap<>();
map.put("actionType", actionType);
map.put("deviceId", deviceId);
... ... @@ -184,22 +186,4 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService {
return map;
}
/**
* 批量添加用户
*/
// @Scheduled(fixedDelay = 10000)
public void loginName() throws Exception {
Map<String, Object> stringObjectMap = new HashMap<>();
String s = HttpsUtils.sendPostHttpRequest("http://192.168.1.7:18080/api/emcs/getRoomAndDevice", "");
List<ElectricityRoomDeviceThree> datas = JSON.parseObject(s, ElectricityRoomDeviceOne.class).getData().getDatas();
for (ElectricityRoomDeviceThree electricityRoomDeviceThree: datas){
USERS users = new USERS();
users.setUserId(electricityRoomDeviceThree.getRoomId());
users.setUsername(electricityRoomDeviceThree.getRoomName());
users.setPassword(Md5Utils.getMD5("ZZAIRPORT20200631@EMPT", true, 32));
usersMapper.insertSelective(users);
}
}
}
... ...
... ... @@ -30,7 +30,7 @@ public class LocationServiceImp implements LocationService {
try {
// 房间号如果为null 跳过
if (!StringUtils.isEmpty(roomNumber)){
if (!StringUtils.isEmpty(roomNumber)) {
List<Map<String, Object>> list = new ArrayList<>();
/**
* 水费查询
... ... @@ -39,26 +39,26 @@ public class LocationServiceImp implements LocationService {
Map<String, Object> thisLocalityWaterMap = locationMapper.userPayList(roomNumber);
Map<String, Object> distanceWaterMap = new HashMap<>();
// 是否为null 为null则去线上查询
if (thisLocalityWaterMap != null){
if (!StringUtils.isEmpty(thisLocalityWaterMap.get("wmSacc").toString()) && !StringUtils.isEmpty( thisLocalityWaterMap.get("wmLacc").toString())){
if (thisLocalityWaterMap != null) {
if (!StringUtils.isEmpty(thisLocalityWaterMap.get("wmSacc").toString()) && !StringUtils.isEmpty(thisLocalityWaterMap.get("wmLacc").toString())) {
// 计算剩余量 充值量 减去 消费量 参数1 减去 参数2
String subtraction = AllUtils.nubmerSubtraction(thisLocalityWaterMap.get("wmSacc").toString(), thisLocalityWaterMap.get("wmLacc").toString());
// 余量
thisLocalityWaterMap.put("subtraction", subtraction);
}
list.add(thisLocalityWaterMap);
}else {
} else {
// 查询该房间号的水表编号
String wmId = locationMapper.findWmId(roomNumber);
if (!"".equals(wmId) && "" != wmId){
Map<String,Object> waterMaps = new HashMap<>();
if (!"".equals(wmId) && "" != wmId) {
Map<String, Object> waterMaps = new HashMap<>();
WaterMeterServiceImp waterMeterServiceImp = new WaterMeterServiceImp();
WaterMeter realTime = waterMeterServiceImp.findRealTime(wmId);
String subtraction = AllUtils.nubmerSubtraction(realTime.getWmSacc(), realTime.getWmLacc());
distanceWaterMap.put("subtraction", subtraction);
distanceWaterMap.put("wmSacc",realTime.getWmSacc());
distanceWaterMap.put("wmFmstate",realTime.getWmFmstate());
distanceWaterMap.put("wmLacc",realTime.getWmLacc());
distanceWaterMap.put("wmSacc", realTime.getWmSacc());
distanceWaterMap.put("wmFmstate", realTime.getWmFmstate());
distanceWaterMap.put("wmLacc", realTime.getWmLacc());
distanceWaterMap.put("wmId", wmId);
list.add(distanceWaterMap);
}
... ... @@ -67,10 +67,10 @@ public class LocationServiceImp implements LocationService {
* 电费查询 通过房间号查询设备id
*/
String eeId = locationMapper.eeId(roomNumber);
if (!"".equals(eeId)){
if (!"".equals(eeId)) {
ElectricityMeter energyInfoForRealTime = electricityMeterService.getEnergyInfoForRealTime(eeId);
Map<String, Object> eeMap = new HashMap<>();
if (energyInfoForRealTime != null){
if (energyInfoForRealTime != null) {
eeMap.put("deviceId", energyInfoForRealTime.getDeviceId());
eeMap.put("balance", energyInfoForRealTime.getBalance());
eeMap.put("wmId", "");
... ... @@ -80,13 +80,11 @@ public class LocationServiceImp implements LocationService {
return list;
}
return null;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
... ...
... ... @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
... ... @@ -22,22 +23,28 @@ public class PayOrderImpl implements PayOrderService {
@Override
public PageInfo<PayRecords> getOrder(int pageSize, int pageNum, String orderNumber, String payTime) {
public PageInfo<PayRecords> getOrder(int pageSize, int pageNum, String orderNumber, String payTime, String username) {
// 开始时间
String startTime = "";
// 结束时间
String endTime = "";
Page<PayRecords> page = PageHelper.startPage(pageNum,pageSize);
Page<PayRecords> page = PageHelper.startPage(pageNum, pageSize);
if (!StringUtils.isEmpty(payTime) && !payTime.contains("undefined")){
if (!StringUtils.isEmpty(payTime) && !payTime.contains("undefined")) {
String[] split = payTime.split(",");
startTime = split[0].toString();
endTime = split[1].toString();
}
List<PayRecords> list = new ArrayList<>();
if ("admin".equals(username)) {
username = "";
list = recordsMapper.findAll(orderNumber, startTime, endTime, username);
} else {
list = recordsMapper.findAll(orderNumber, startTime, endTime, username);
}
List<PayRecords> list = recordsMapper.findAll(orderNumber, startTime, endTime);
PageInfo<PayRecords> result = new PageInfo<>(list);
return result;
... ...
... ... @@ -40,7 +40,7 @@ public class WaterElectricityParameterServiceImp implements WaterElectricityPara
public WaterElectricityParameter findOneElectricity(String eeId) {
try {
return waterElectricityParameterMapper.findOneElectricity(eeId);
}catch (Exception e){
} catch (Exception e) {
return null;
}
}
... ...
... ... @@ -15,6 +15,7 @@ import com.sunyo.energy.location.utils.HttpsUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.Date;
... ... @@ -36,7 +37,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
private LocationMapper locationMapper;
/**
* 查询所有水表
*/
*/
private static final String selectUrl = "http://123.56.159.203:8023/nowwmrd/getSelectNowwmrdbyMtId";
private static final String payUrl = "http://123.56.159.203:8023/mtfmset/allWMadd";
... ... @@ -45,7 +46,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
@Override
@Scheduled(cron = "0 0 03 * * ?" )
@Scheduled(cron = "0 0 03 * * ?")
public int realTime() {
try {
... ... @@ -55,10 +56,10 @@ public class WaterMeterServiceImp implements WaterMeterService {
// 远程调用
String s = HttpsUtils.httpRequest(addUrl, datas);
JSONArray jsonArray = JSON.parseArray(s);
for (Object jsonObject:jsonArray){
WaterMeter waterMeter= new WaterMeter();
Map<String,Object> map = (Map)jsonObject;
if (!map.containsKey("state")){
for (Object jsonObject : jsonArray) {
WaterMeter waterMeter = new WaterMeter();
Map<String, Object> map = (Map) jsonObject;
if (!map.containsKey("state")) {
waterMeter.setWmId(map.get("wm_id").toString());
waterMeter.setWmErrmessage(map.get("wm_errmessage").toString());
waterMeter.setWmFmstate(map.get("wm_fmstate").toString());
... ... @@ -70,15 +71,15 @@ public class WaterMeterServiceImp implements WaterMeterService {
waterMeter.setCreattime(new Date());
waterMeter.setReamke1(map.get("wm_sacc").toString());
waterMeterMapper.insertSelective(waterMeter);
}else {
if ("0".equals(map.get("state").toString())){
} else {
if ("0".equals(map.get("state").toString())) {
return 1;
}
return 0;
}
}
return 1;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
return 0;
}
... ... @@ -92,11 +93,11 @@ public class WaterMeterServiceImp implements WaterMeterService {
String s = HttpsUtils.httpRequest(selectUrl, datas);
JSONArray jsonArray = JSON.parseArray(s);
WaterMeter waterMeter= new WaterMeter();
for (Object jsonObject:jsonArray){
WaterMeter waterMeter = new WaterMeter();
for (Object jsonObject : jsonArray) {
Map<String,Object> map = (Map)jsonObject;
if (!map.containsKey("state")){
Map<String, Object> map = (Map) jsonObject;
if (!map.containsKey("state")) {
waterMeter.setWmId(map.get("wm_id").toString());
waterMeter.setWmErrmessage(map.get("wm_errmessage").toString());
waterMeter.setWmFmstate(map.get("wm_fmstate").toString());
... ... @@ -108,7 +109,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
}
}
return waterMeter;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
return new WaterMeter();
}
... ... @@ -116,6 +117,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
/**
* 水费充值 换算总水量 生成订单
*
* @param payFees
* @param wmId
* @return
... ... @@ -128,14 +130,14 @@ public class WaterMeterServiceImp implements WaterMeterService {
// 得到请求接口 返回值 和总水量
Map<String, Object> map = allWater(payFees, wmId);
Map hashMap = JSON.parseObject(map.get("status").toString(), HashMap.class);
if ("0".equals(hashMap.get("state").toString())){
if ("0".equals(hashMap.get("state").toString())) {
int update = waterMeterMapper.update(wmId, map.get("allSacc").toString());
resultJson.setCode("200");
}else {
} else {
resultJson.setCode("203");
}
return resultJson;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
resultJson.setCode("203");
return resultJson;
... ... @@ -149,8 +151,8 @@ public class WaterMeterServiceImp implements WaterMeterService {
List<WaterMeter> waterMeterList = waterMeterMapper.waterMeterAll(wmId);
return new ResultJson("200","success", waterMeterList);
}catch (Exception e){
return new ResultJson("200", "success", waterMeterList);
} catch (Exception e) {
e.printStackTrace();
resultJson.setCode("203");
return resultJson;
... ... @@ -162,39 +164,39 @@ public class WaterMeterServiceImp implements WaterMeterService {
public ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException {
ResultJson<Object> resultJson = new ResultJson<>();
// 成功生成水费订单
if (!"".equals(wmId)){
if (!"".equals(wmId)) {
PayRecords payRecords = payRecords(payFees, wmId, userId, realName, "");
// 请求返回二维码lujing
String url = QrDemo.orUrl(payRecords.getOrdernumber(), payFees);
if(!"".equals(url)){
if (!"".equals(url)) {
payRecords.setReamke2(url);
// 返回map 包含订单号 二维码url
Map<String, Object> map = new HashMap<>();
map.put("url",url);
map.put("url", url);
map.put("orderNumber", payRecords.getOrdernumber());
resultJson.setData(map);
}
int i = payRecordsMapper.insertSelective(payRecords);
if(i>0){
if (i > 0) {
resultJson.setCode("200");
}
}else {
} else {
PayRecords payRecords = payRecords(payFees, "", userId, realName, eeId);
// 请求返回二维码lujing
String url = QrDemo.orUrl(payRecords.getOrdernumber(), payFees);
if(!"".equals(url)){
if (!"".equals(url)) {
payRecords.setReamke2(url);
// 返回map 包含订单号 二维码url
Map<String, Object> map = new HashMap<>();
map.put("url",url);
map.put("url", url);
map.put("orderNumber", payRecords.getOrdernumber());
resultJson.setData(map);
}
int i = payRecordsMapper.insertSelective(payRecords);
if(i>0){
if (i > 0) {
resultJson.setCode("200");
}
}
... ... @@ -204,6 +206,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
/**
* 总水量 换算
*
* @param payFees
* @param wmId
* @return
... ... @@ -223,32 +226,33 @@ public class WaterMeterServiceImp implements WaterMeterService {
datas.put("Add_addmode", "2");
String status = HttpsUtils.httpRequest(payUrl, datas);
datas.put("allSacc",allSacc);
datas.put("status",status);
datas.put("allSacc", allSacc);
datas.put("status", status);
return datas;
}
/**
* 订单生成
*
* @param payFees
* @param wmId
* @param userId
* @param realName
* @return
*/
public PayRecords payRecords(String payFees, String wmId, String userId, String realName, String eeId){
public PayRecords payRecords(String payFees, String wmId, String userId, String realName, String eeId) {
PayRecords payRecords = new PayRecords();
payRecords.setOrdernumber(AllUtils.getOrderIdByTime());
payRecords.setPayfees(new BigDecimal(payFees));
payRecords.setPaystatus(false);
if (!"".equals(wmId)){
if (!"".equals(wmId)) {
payRecords.setPaytype(false);
payRecords.setPaytypeaddress(wmId);
String roomNumber = locationMapper.selectRoomNumber(wmId);
payRecords.setPaylocationname(roomNumber);
}else {
} else {
payRecords.setPaytype(true);
payRecords.setPaytypeaddress(eeId);
String roomNumber = locationMapper.selectRoomNumberElectricity(eeId);
... ...
... ... @@ -9,7 +9,7 @@ import java.util.Random;
public class AllUtils {
// 数字相减 参数1 减去 参数2
public static String nubmerSubtraction(String sacc, String lacc){
public static String nubmerSubtraction(String sacc, String lacc) {
BigDecimal saccBigDecimal = new BigDecimal(sacc);
BigDecimal laccBigDecimal = new BigDecimal(lacc);
... ... @@ -21,7 +21,7 @@ public class AllUtils {
}
// 数字相除 参数1 除以参数2
public static String nubmerDivision(String payFees){
public static String nubmerDivision(String payFees) {
// 单价
String unitprice = PropertiesLoader.getUnitPrice("unitprice");
... ... @@ -35,7 +35,7 @@ public class AllUtils {
//数字相加 参数1加参数2
public static String nubmerAdd(String oneWmSacc, String s){
public static String nubmerAdd(String oneWmSacc, String s) {
BigDecimal bigDecimal = new BigDecimal(oneWmSacc);
BigDecimal bigDecimal1 = new BigDecimal(s);
... ... @@ -47,13 +47,13 @@ public class AllUtils {
// 订单号生成 时间加随机数
public static String getOrderIdByTime() {
// 商户码
String merchantId ="105001453995827";
String result="";
Random random=new Random();
for(int i=0;i<3;i++){
result+=random.nextInt(10);
String merchantId = "105001453995827";
String result = "";
Random random = new Random();
for (int i = 0; i < 3; i++) {
result += random.nextInt(10);
}
return merchantId+result;
return merchantId + result;
}
... ...
... ... @@ -151,10 +151,8 @@ public class HttpsUtils {
/**
* 发送POST请求
*
* @param url
* 目的地址
* @param parameters
* 请求参数,Map类型。
* @param url 目的地址
* @param parameters 请求参数,Map类型。
* @return 远程响应结果
*/
public static String sendPost(String url, Map<String, Object> parameters) {
... ...
... ... @@ -13,6 +13,7 @@ public class Md5Utils {
/**
* 通用加密方法
*
* @param str 需要加密的字符串
* @param isUpper 字母大小写(false为小写,true为大写)
* @param bit 加密的位数(16,32,64)
... ...
... ... @@ -9,11 +9,10 @@ import java.util.Properties;
/**
* @description roperties属性文件加载
* @author gerry.zhang
* @date 2014-5-29
* @version 1.0
*
* @description roperties属性文件加载
* @date 2014-5-29
*/
public class PropertiesLoader {
... ... @@ -24,15 +23,16 @@ public class PropertiesLoader {
/**
* load properties文件
*
* @param propertyFile
* @return
*/
public static Properties loadProperty(String propertyFile){
InputStream in=PropertiesLoader.class.getResourceAsStream(propertyFile);
public static Properties loadProperty(String propertyFile) {
InputStream in = PropertiesLoader.class.getResourceAsStream(propertyFile);
Properties properties = new Properties();
try{
try {
properties.load(in);
}catch(Exception e){
} catch (Exception e) {
logger.error("解析文件失败:文件名={}", propertyFile, e);
}
return properties;
... ... @@ -45,13 +45,10 @@ public class PropertiesLoader {
}
public static String get(String key,String propertyFile){
public static String get(String key, String propertyFile) {
Properties properties = loadProperty(propertyFile);
return (String) properties.get(key);
}
}
... ...
... ... @@ -19,33 +19,33 @@ import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
@Configuration
public class FastjsonConverter {
@Bean
public HttpMessageConverters customConverters() {
// 定义一个转换消息的对象
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
// 添加fastjson的配置信息 比如 :是否要格式化返回的json数据
FastJsonConfig fastJsonConfig = new FastJsonConfig();
//fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
List<MediaType> fastMediaTypes = new ArrayList<MediaType>();
// 处理中文乱码问题1
// 处理中文乱码问题2
fastJsonConfig.setCharset(Charset.forName("UTF-8"));
fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
//fastMediaTypes.add(MediaType.valueOf("text/plain;charset=UTF-8"));
//fastMediaTypes.add(MediaType.valueOf("text/html;charset=UTF-8"));
fastConverter.setSupportedMediaTypes(fastMediaTypes);
// 在转换器中添加配置信息
fastConverter.setFastJsonConfig(fastJsonConfig);
StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
stringConverter.setDefaultCharset(Charset.forName("UTF-8"));
stringConverter.setSupportedMediaTypes(fastMediaTypes);
// 将转换器添加到converters中
return new HttpMessageConverters(stringConverter,fastConverter);
}
@Bean
public HttpMessageConverters customConverters() {
// 定义一个转换消息的对象
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
// 添加fastjson的配置信息 比如 :是否要格式化返回的json数据
FastJsonConfig fastJsonConfig = new FastJsonConfig();
//fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
List<MediaType> fastMediaTypes = new ArrayList<MediaType>();
// 处理中文乱码问题1
// 处理中文乱码问题2
fastJsonConfig.setCharset(Charset.forName("UTF-8"));
fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
//fastMediaTypes.add(MediaType.valueOf("text/plain;charset=UTF-8"));
//fastMediaTypes.add(MediaType.valueOf("text/html;charset=UTF-8"));
fastConverter.setSupportedMediaTypes(fastMediaTypes);
// 在转换器中添加配置信息
fastConverter.setFastJsonConfig(fastJsonConfig);
StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
stringConverter.setDefaultCharset(Charset.forName("UTF-8"));
stringConverter.setSupportedMediaTypes(fastMediaTypes);
// 将转换器添加到converters中
return new HttpMessageConverters(stringConverter, fastConverter);
}
}
\ No newline at end of file
... ...
... ... @@ -17,45 +17,55 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* WebSocketServer
*
* @author zhengkai.blog.csdn.net
*/
@ServerEndpoint("/imserver")
@Component
public class WebSocketServer {
static Log log= LogFactory.get(WebSocketServer.class);
/**静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。*/
static Log log = LogFactory.get(WebSocketServer.class);
/**
* 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
*/
private static int onlineCount = 0;
/**concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。*/
private static ConcurrentHashMap<String,WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
/**与某个客户端的连接会话,需要通过它来给客户端发送数据*/
/**
* concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
*/
private static ConcurrentHashMap<String, WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
/**
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
*/
private Session session;
/**接收userId*/
private String orderNum="";
/**
* 接收userId
*/
private String orderNum = "";
/**
* 连接建立成功调用的方法*/
* 连接建立成功调用的方法
*/
@OnOpen
public void onOpen(Session session) {
this.session = session;
this.orderNum=orderNum;
if(webSocketMap.containsKey(orderNum)){
this.orderNum = orderNum;
if (webSocketMap.containsKey(orderNum)) {
webSocketMap.remove(orderNum);
webSocketMap.put(orderNum,this);
webSocketMap.put(orderNum, this);
//加入set中
}else{
webSocketMap.put(orderNum,this);
} else {
webSocketMap.put(orderNum, this);
//加入set中
addOnlineCount();
//在线数加1
}
log.info("用户连接:"+orderNum+",当前在线人数为:" + getOnlineCount());
log.info("用户连接:" + orderNum + ",当前在线人数为:" + getOnlineCount());
try {
sendMessage("连接成功");
} catch (IOException e) {
log.error("用户:"+orderNum+",网络异常!!!!!!");
log.error("用户:" + orderNum + ",网络异常!!!!!!");
}
}
... ... @@ -64,12 +74,12 @@ public class WebSocketServer {
*/
@OnClose
public void onClose() {
if(webSocketMap.containsKey(orderNum)){
if (webSocketMap.containsKey(orderNum)) {
webSocketMap.remove(orderNum);
//从set中删除
subOnlineCount();
}
log.info("用户退出:"+orderNum+",当前在线人数为:" + getOnlineCount());
log.info("用户退出:" + orderNum + ",当前在线人数为:" + getOnlineCount());
}
/**
... ... @@ -103,14 +113,15 @@ public class WebSocketServer {
/**
* 群发消息
*
* @param content 要广播的内容
*/
public void broadcast(String content){
for (ConcurrentHashMap.Entry<String,WebSocketServer> entry : webSocketMap.entrySet()) {
WebSocketServer webSocketServerE= entry.getValue();
public void broadcast(String content) {
for (ConcurrentHashMap.Entry<String, WebSocketServer> entry : webSocketMap.entrySet()) {
WebSocketServer webSocketServerE = entry.getValue();
try {
webSocketServerE.sendMessage(content);
}catch (IOException e){
} catch (IOException e) {
e.printStackTrace();
}
... ... @@ -119,15 +130,15 @@ public class WebSocketServer {
}
/**
*
* @param session
* @param error
*/
@OnError
public void onError(Session session, Throwable error) {
log.error("用户错误:"+this.orderNum+",原因:"+error.getMessage());
log.error("用户错误:" + this.orderNum + ",原因:" + error.getMessage());
error.printStackTrace();
}
/**
* 实现服务器主动推送
*/
... ... @@ -138,13 +149,13 @@ public class WebSocketServer {
/**
* 发送自定义消息
* */
public static void sendInfo(String message,@PathParam("orderNum") String orderNum) throws IOException {
log.info("发送消息到:"+orderNum+",报文:"+message);
if(StringUtils.isNotBlank(orderNum)&&webSocketMap.containsKey(orderNum)){
*/
public static void sendInfo(String message, @PathParam("orderNum") String orderNum) throws IOException {
log.info("发送消息到:" + orderNum + ",报文:" + message);
if (StringUtils.isNotBlank(orderNum) && webSocketMap.containsKey(orderNum)) {
webSocketMap.get(orderNum).sendMessage(message);
}else{
log.error("用户"+orderNum+",不在线!");
} else {
log.error("用户" + orderNum + ",不在线!");
}
}
... ...
... ... @@ -4,9 +4,10 @@
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
<classPathEntry location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/>
<classPathEntry
location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/>
<!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
... ... @@ -14,14 +15,14 @@
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://118.31.66.166:3306/EMPT"
userId="110"
password="QAHqCJf2kFYCLirM">
connectionURL="jdbc:mysql://118.31.66.166:3306/EMPT"
userId="110"
password="QAHqCJf2kFYCLirM">
</jdbcConnection>
<!--<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"-->
<!--connectionURL="jdbc:oracle:thin:@192.168.1.253:1522:ORCLL"-->
<!--userId="CGOASM"-->
<!--password="vmvnv1v2">-->
<!--connectionURL="jdbc:oracle:thin:@192.168.1.253:1522:ORCLL"-->
<!--userId="CGOASM"-->
<!--password="vmvnv1v2">-->
<!--</jdbcConnection>-->
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
NUMERIC 类型解析为java.math.BigDecimal -->
... ... @@ -41,10 +42,13 @@
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.sunyo.energy.location.dao" targetProject="src/main/java">
<javaClientGenerator type="XMLMAPPER" targetPackage="com.sunyo.energy.location.dao"
targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="pay_response" domainObjectName="PayResponse" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="true"></table>
<table tableName="electricity_info" domainObjectName="ElectricityInfo" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="true"></table>
</context>
</generatorConfiguration>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.ElectricityInfoMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.ElectricityInfo" >
<id column="order_number" property="orderNumber" jdbcType="VARCHAR" />
<result column="action_type" property="actionType" jdbcType="VARCHAR" />
<result column="device_id" property="deviceId" jdbcType="VARCHAR" />
<result column="money" property="money" jdbcType="DECIMAL" />
<result column="ip_address" property="ipAddress" jdbcType="VARCHAR" />
<result column="secret" property="secret" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="VARCHAR" />
<result column="opert_time" property="opertTime" jdbcType="TIMESTAMP" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="info_status" property="infoStatus" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<mapper namespace="com.sunyo.energy.location.dao.ElectricityInfoMapper">
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.ElectricityInfo">
<id column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
<result column="action_type" property="actionType" jdbcType="VARCHAR"/>
<result column="device_id" property="deviceId" jdbcType="VARCHAR"/>
<result column="money" property="money" jdbcType="DECIMAL"/>
<result column="ip_address" property="ipAddress" jdbcType="VARCHAR"/>
<result column="secret" property="secret" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="VARCHAR"/>
<result column="opert_time" property="opertTime" jdbcType="TIMESTAMP"/>
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP"/>
<result column="info_status" property="infoStatus" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
order_number, action_type, device_id, money, ip_address, secret, status, opert_time,
edit_time, info_status
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from electricity_info
where order_number = #{orderNumber,jdbcType=VARCHAR}
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from electricity_info
where order_number = #{orderNumber,jdbcType=VARCHAR}
</select>
<select id="selectAll" resultMap="BaseResultMap" parameterType="string">
select
<include refid="Base_Column_List" />
from electricity_info
where status = '1'
<if test="deviceId != null and deviceId != ''" >
and device_id = #{deviceId, jdbcType=VARCHAR}
</if>
order by opert_time desc
</select>
<select id="selectAll" resultMap="BaseResultMap" parameterType="string">
select
<include refid="Base_Column_List"/>
from electricity_info
where status = '1'
<if test="deviceId != null and deviceId != ''">
and device_id = #{deviceId, jdbcType=VARCHAR}
</if>
order by opert_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from electricity_info
where order_number = #{orderNumber,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.ElectricityInfo" >
<insert id="insert" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
insert into electricity_info (order_number, action_type, device_id,
money, ip_address, secret,
status, opert_time, edit_time,
... ... @@ -49,107 +49,107 @@
#{status,jdbcType=VARCHAR}, #{opertTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP},
#{infoStatus,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.ElectricityInfo" >
insert into electricity_info
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="orderNumber != null" >
order_number,
</if>
<if test="actionType != null" >
action_type,
</if>
<if test="deviceId != null" >
device_id,
</if>
<if test="money != null" >
money,
</if>
<if test="ipAddress != null" >
ip_address,
</if>
<if test="secret != null" >
secret,
</if>
<if test="status != null" >
status,
</if>
<if test="opertTime != null" >
opert_time,
</if>
<if test="editTime != null" >
edit_time,
</if>
<if test="infoStatus != null" >
info_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="orderNumber != null" >
#{orderNumber,jdbcType=VARCHAR},
</if>
<if test="actionType != null" >
#{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceId != null" >
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="money != null" >
#{money,jdbcType=DECIMAL},
</if>
<if test="ipAddress != null" >
#{ipAddress,jdbcType=VARCHAR},
</if>
<if test="secret != null" >
#{secret,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=VARCHAR},
</if>
<if test="opertTime != null" >
#{opertTime,jdbcType=TIMESTAMP},
</if>
<if test="editTime != null" >
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="infoStatus != null" >
#{infoStatus,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.ElectricityInfo" >
update electricity_info
<set >
<if test="actionType != null" >
action_type = #{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceId != null" >
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="money != null" >
money = #{money,jdbcType=DECIMAL},
</if>
<if test="ipAddress != null" >
ip_address = #{ipAddress,jdbcType=VARCHAR},
</if>
<if test="secret != null" >
secret = #{secret,jdbcType=VARCHAR},
</if>
<if test="status != null" >
status = #{status,jdbcType=VARCHAR},
</if>
<if test="opertTime != null" >
opert_time = #{opertTime,jdbcType=TIMESTAMP},
</if>
<if test="editTime != null" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="infoStatus != null" >
info_status = #{infoStatus,jdbcType=VARCHAR},
</if>
</set>
where order_number = #{orderNumber,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.ElectricityInfo" >
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
insert into electricity_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNumber != null">
order_number,
</if>
<if test="actionType != null">
action_type,
</if>
<if test="deviceId != null">
device_id,
</if>
<if test="money != null">
money,
</if>
<if test="ipAddress != null">
ip_address,
</if>
<if test="secret != null">
secret,
</if>
<if test="status != null">
status,
</if>
<if test="opertTime != null">
opert_time,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="infoStatus != null">
info_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNumber != null">
#{orderNumber,jdbcType=VARCHAR},
</if>
<if test="actionType != null">
#{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceId != null">
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="money != null">
#{money,jdbcType=DECIMAL},
</if>
<if test="ipAddress != null">
#{ipAddress,jdbcType=VARCHAR},
</if>
<if test="secret != null">
#{secret,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="opertTime != null">
#{opertTime,jdbcType=TIMESTAMP},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="infoStatus != null">
#{infoStatus,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
update electricity_info
<set>
<if test="actionType != null">
action_type = #{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceId != null">
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="money != null">
money = #{money,jdbcType=DECIMAL},
</if>
<if test="ipAddress != null">
ip_address = #{ipAddress,jdbcType=VARCHAR},
</if>
<if test="secret != null">
secret = #{secret,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="opertTime != null">
opert_time = #{opertTime,jdbcType=TIMESTAMP},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="infoStatus != null">
info_status = #{infoStatus,jdbcType=VARCHAR},
</if>
</set>
where order_number = #{orderNumber,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
update electricity_info
set action_type = #{actionType,jdbcType=VARCHAR},
device_id = #{deviceId,jdbcType=VARCHAR},
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.LocationMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.Location" >
<id column="id" property="id" jdbcType="INTEGER" />
<id column="wm_id" property="wmid" jdbcType="VARCHAR" />
<id column="ee_id" property="eeid" jdbcType="VARCHAR" />
<result column="adrName" property="adrname" jdbcType="VARCHAR" />
<result column="parent" property="parent" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
<!-- <collection property="children" select="selectAll" column="id"></collection>-->
</resultMap>
<sql id="Base_Column_List" >
<mapper namespace="com.sunyo.energy.location.dao.LocationMapper">
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.Location">
<id column="id" property="id" jdbcType="INTEGER"/>
<id column="wm_id" property="wmid" jdbcType="VARCHAR"/>
<id column="ee_id" property="eeid" jdbcType="VARCHAR"/>
<result column="adrName" property="adrname" jdbcType="VARCHAR"/>
<result column="parent" property="parent" jdbcType="INTEGER"/>
<result column="type" property="type" jdbcType="INTEGER"/>
<!-- <collection property="children" select="selectAll" column="id"></collection>-->
</resultMap>
<sql id="Base_Column_List">
id, adrName, parent, type, wm_id, ee_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from location
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
*
from location
where
parent = #{id,jdbcType=INTEGER}
<!--<if test="_adrname != '' and _adrname != null " >-->
<!--or adrName = #{adrname, jdbcType=VARCHAR}-->
<!--</if>-->
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from location
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
*
from location
where
parent = #{id,jdbcType=INTEGER}
<!--<if test="_adrname != '' and _adrname != null " >-->
<!--or adrName = #{adrname, jdbcType=VARCHAR}-->
<!--</if>-->
</select>
<select id="selectAllAdrName" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="selectAllAdrName" resultMap="BaseResultMap" parameterType="java.lang.String">
select
*
from location
... ... @@ -38,7 +38,7 @@
adrName = #{adrname, jdbcType=VARCHAR}
</select>
<select id="userPayList" resultType="java.util.HashMap">
<select id="userPayList" resultType="java.util.HashMap">
select
wm.wm_id as wmId, wm.wm_fmstate as wmFmstate,
wm.wm_lacc as wmLacc, wm.wm_sacc as wmSacc
... ... @@ -50,7 +50,7 @@
lon.adrName=#{value,jdbcType=VARCHAR}
</select>
<select id="selectRoomNumber" parameterType="java.lang.String" resultType="java.lang.String">
<select id="selectRoomNumber" parameterType="java.lang.String" resultType="java.lang.String">
select
adrName
from
... ... @@ -59,7 +59,7 @@
wm_id = #{value, jdbcType=VARCHAR}
</select>
<select id="selectRoomNumberElectricity" parameterType="java.lang.String" resultType="java.lang.String">
<select id="selectRoomNumberElectricity" parameterType="java.lang.String" resultType="java.lang.String">
select
adrName
from
... ... @@ -68,85 +68,85 @@
ee_id = #{value, jdbcType=VARCHAR}
</select>
<select id="countAdrName" resultType="int" parameterType="map">
<select id="countAdrName" resultType="int" parameterType="map">
select count(adrName) from location where adrName = #{adrName, jdbcType=VARCHAR} and parent = #{parent, jdbcType=VARCHAR}
</select>
<select id="countParent" parameterType="int" resultType="int">
<select id="countParent" parameterType="int" resultType="int">
select count(parent) from location where parent = #{value}
</select>
<select id="findWmId" parameterType="string" resultType="string">
<select id="findWmId" parameterType="string" resultType="string">
select wm_id from location where adrname = #{value}
</select>
<select id="eeId" parameterType="string" resultType="string">
<select id="eeId" parameterType="string" resultType="string">
select ee_id from location where adrname = #{value}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from location
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.Location" >
<insert id="insert" parameterType="com.sunyo.energy.location.model.Location">
insert into location (id, adrName, parent,
type)
values (#{id,jdbcType=INTEGER}, #{adrname,jdbcType=VARCHAR}, #{parent,jdbcType=INTEGER},
#{type,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.Location" >
insert into location
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="adrname != null" >
adrName,
</if>
<if test="parent != null" >
parent,
</if>
<if test="type != null" >
type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="adrname != null" >
#{adrname,jdbcType=VARCHAR},
</if>
<if test="parent != null" >
#{parent,jdbcType=INTEGER},
</if>
<if test="type != null" >
#{type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.Location" >
update location
<set >
<if test="adrname != null" >
adrName = #{adrname,jdbcType=VARCHAR},
</if>
<if test="parent != null" >
parent = #{parent,jdbcType=INTEGER},
</if>
<if test="type != null" >
type = #{type,jdbcType=INTEGER},
</if>
<if test="wmid != null" >
wm_id = #{wmid,jdbcType=VARCHAR},
</if>
<if test="eeid != null" >
ee_id = #{eeid,jdbcType=VARCHAR}
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.Location" >
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.Location">
insert into location
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="adrname != null">
adrName,
</if>
<if test="parent != null">
parent,
</if>
<if test="type != null">
type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="adrname != null">
#{adrname,jdbcType=VARCHAR},
</if>
<if test="parent != null">
#{parent,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.Location">
update location
<set>
<if test="adrname != null">
adrName = #{adrname,jdbcType=VARCHAR},
</if>
<if test="parent != null">
parent = #{parent,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="wmid != null">
wm_id = #{wmid,jdbcType=VARCHAR},
</if>
<if test="eeid != null">
ee_id = #{eeid,jdbcType=VARCHAR}
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.Location">
update location
set adrName = #{adrname,jdbcType=VARCHAR},
parent = #{parent,jdbcType=INTEGER},
... ... @@ -154,7 +154,7 @@
where id = #{id,jdbcType=INTEGER}
</update>
<update id="editEeId" parameterType="string">
<update id="editEeId" parameterType="string">
update location
set ee_id = #{deviceId,jdbcType=VARCHAR}
where adrName = #{name,jdbcType=INTEGER}
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.PayRecordsMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayRecords" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="payFees" property="payfees" jdbcType="DECIMAL" />
<result column="payUserId" property="payuserid" jdbcType="INTEGER" />
<result column="payTime" property="paytime" jdbcType="TIMESTAMP" />
<result column="payLocationId" property="paylocationid" jdbcType="INTEGER" />
<result column="payStatus" property="paystatus" jdbcType="BIT" />
<result column="payType" property="paytype" jdbcType="BIT" />
<result column="payFessType" property="payfesstype" jdbcType="BIT" />
<result column="orderNumber" property="ordernumber" jdbcType="VARCHAR" />
<result column="reamke1" property="reamke1" jdbcType="VARCHAR" />
<result column="reamke2" property="reamke2" jdbcType="VARCHAR" />
<result column="reamke3" property="reamke3" jdbcType="VARCHAR" />
<result column="reamke4" property="reamke4" jdbcType="VARCHAR" />
<result column="payUserName" property="payusername" jdbcType="VARCHAR" />
<result column="payLocationName" property="paylocationname" jdbcType="VARCHAR" />
<result column="payTypeAddress" property="paytypeaddress" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<mapper namespace="com.sunyo.energy.location.dao.PayRecordsMapper">
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayRecords">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="payFees" property="payfees" jdbcType="DECIMAL"/>
<result column="payUserId" property="payuserid" jdbcType="INTEGER"/>
<result column="payTime" property="paytime" jdbcType="TIMESTAMP"/>
<result column="payLocationId" property="paylocationid" jdbcType="INTEGER"/>
<result column="payStatus" property="paystatus" jdbcType="BIT"/>
<result column="payType" property="paytype" jdbcType="BIT"/>
<result column="payFessType" property="payfesstype" jdbcType="BIT"/>
<result column="orderNumber" property="ordernumber" jdbcType="VARCHAR"/>
<result column="reamke1" property="reamke1" jdbcType="VARCHAR"/>
<result column="reamke2" property="reamke2" jdbcType="VARCHAR"/>
<result column="reamke3" property="reamke3" jdbcType="VARCHAR"/>
<result column="reamke4" property="reamke4" jdbcType="VARCHAR"/>
<result column="payUserName" property="payusername" jdbcType="VARCHAR"/>
<result column="payLocationName" property="paylocationname" jdbcType="VARCHAR"/>
<result column="payTypeAddress" property="paytypeaddress" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, payFees, payUserId, payTime, payLocationId, payStatus, payType, payFessType,
orderNumber, reamke1, reamke2, reamke3, reamke4, payUserName, payLocationName, payTypeAddress
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from pay_records
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from pay_records
where id = #{id,jdbcType=INTEGER}
</select>
<select id="findAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pay_records
where reamke1 = '0'
<if test="orderNumber != '' and orderNumber != null">
and orderNumber = #{orderNumber,jdbcType=VARCHAR}
</if>
<if test="startTime != '' and startTime != null">
and payTime &gt; #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != '' and endTime != null">
and payTime &lt; #{endTime,jdbcType=VARCHAR}
</if>
order by payTime desc
</select>
<select id="findAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from pay_records
where reamke1 = '0'
<if test="orderNumber != '' and orderNumber != null">
and orderNumber = #{orderNumber,jdbcType=VARCHAR}
</if>
<if test="startTime != '' and startTime != null">
and payTime &gt; #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != '' and endTime != null">
and payTime &lt; #{endTime,jdbcType=VARCHAR}
</if>
<if test="username != '' and username != null">
and payUserName = #{username,jdbcType=VARCHAR}
</if>
order by payTime desc
</select>
<select id="findOrderNumber" parameterType="string" resultType="string">
<select id="findOrderNumber" parameterType="string" resultType="string">
select distinct payTypeAddress from pay_records where orderNumber = #{value, jdbcType=VARCHAR}
</select>
<select id="selectType" parameterType="string" resultType="boolean">
<select id="selectType" parameterType="string" resultType="boolean">
select distinct payType from pay_records where orderNumber = #{value, jdbcType=VARCHAR}
</select>
<update id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<update id="deleteByPrimaryKey" parameterType="java.lang.Integer">
UPDATE pay_records
SET reamke1 = '1'
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateStatus" parameterType="string">
<update id="updateStatus" parameterType="string">
update pay_records
set payStatus = 1
where orderNumber = #{value, jdbcType=VARCHAR}
</update>
<insert id="insert" parameterType="com.sunyo.energy.location.model.PayRecords" >
<insert id="insert" parameterType="com.sunyo.energy.location.model.PayRecords">
insert into pay_records (id, payFees, payUserId,
payTime, payLocationId, payStatus,
payType, payFessType, orderNumber,
... ... @@ -81,180 +84,180 @@
#{reamke4,jdbcType=VARCHAR}, #{payusername,jdbcType=VARCHAR}, #{paylocationname,jdbcType=VARCHAR},
#{paytypeaddress,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayRecords" >
insert into pay_records
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="payfees != null" >
payFees,
</if>
<if test="payuserid != null" >
payUserId,
</if>
<if test="paytime != null" >
payTime,
</if>
<if test="paylocationid != null" >
payLocationId,
</if>
<if test="paystatus != null" >
payStatus,
</if>
<if test="paytype != null" >
payType,
</if>
<if test="payfesstype != null" >
payFessType,
</if>
<if test="ordernumber != null" >
orderNumber,
</if>
<if test="reamke1 != null" >
reamke1,
</if>
<if test="reamke2 != null" >
reamke2,
</if>
<if test="reamke3 != null" >
reamke3,
</if>
<if test="reamke4 != null" >
reamke4,
</if>
<if test="payusername != null" >
payUserName,
</if>
<if test="paylocationname != null" >
payLocationName,
</if>
<if test="paytypeaddress != null" >
payTypeAddress,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="payfees != null" >
#{payfees,jdbcType=DECIMAL},
</if>
<if test="payuserid != null" >
#{payuserid,jdbcType=INTEGER},
</if>
<if test="paytime != null" >
#{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null" >
#{paylocationid,jdbcType=INTEGER},
</if>
<if test="paystatus != null" >
#{paystatus,jdbcType=BIT},
</if>
<if test="paytype != null" >
#{paytype,jdbcType=BIT},
</if>
<if test="payfesstype != null" >
#{payfesstype,jdbcType=BIT},
</if>
<if test="ordernumber != null" >
#{ordernumber,jdbcType=VARCHAR},
</if>
<if test="reamke1 != null" >
#{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
#{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
#{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null" >
#{reamke4,jdbcType=VARCHAR},
</if>
<if test="payusername != null" >
#{payusername,jdbcType=VARCHAR},
</if>
<if test="paylocationname != null" >
#{paylocationname,jdbcType=VARCHAR},
</if>
<if test="paytypeaddress != null" >
#{paytypeaddress,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayRecords" >
update pay_records
<set >
<if test="payfees != null" >
payFees = #{payfees,jdbcType=DECIMAL},
</if>
<if test="payuserid != null" >
payUserId = #{payuserid,jdbcType=INTEGER},
</if>
<if test="paytime != null" >
payTime = #{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null" >
payLocationId = #{paylocationid,jdbcType=INTEGER},
</if>
<if test="paystatus != null" >
payStatus = #{paystatus,jdbcType=BIT},
</if>
<if test="paytype != null" >
payType = #{paytype,jdbcType=BIT},
</if>
<if test="payfesstype != null" >
payFessType = #{payfesstype,jdbcType=BIT},
</if>
<if test="ordernumber != null" >
orderNumber = #{ordernumber,jdbcType=VARCHAR},
</if>
<if test="reamke1 != null" >
reamke1 = #{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null" >
reamke2 = #{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null" >
reamke3 = #{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null" >
reamke4 = #{reamke4,jdbcType=VARCHAR},
</if>
<if test="payusername != null" >
payUserName = #{payusername,jdbcType=VARCHAR},
</if>
<if test="paylocationname != null" >
payLocationName = #{paylocationname,jdbcType=VARCHAR},
</if>
<if test="paytypeaddress != null" >
payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<!-- <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords" >-->
<!-- update pay_records-->
<!-- set payFees = #{payfees,jdbcType=DECIMAL},-->
<!-- payUserId = #{payuserid,jdbcType=INTEGER},-->
<!-- payTime = #{paytime,jdbcType=TIMESTAMP},-->
<!-- payLocationId = #{paylocationid,jdbcType=INTEGER},-->
<!-- payStatus = #{paystatus,jdbcType=BIT},-->
<!-- payType = #{paytype,jdbcType=BIT},-->
<!-- payFessType = #{payfesstype,jdbcType=BIT},-->
<!-- orderNumber = #{ordernumber,jdbcType=VARCHAR},-->
<!-- reamke1 = #{reamke1,jdbcType=VARCHAR},-->
<!-- reamke2 = #{reamke2,jdbcType=VARCHAR},-->
<!-- reamke3 = #{reamke3,jdbcType=VARCHAR},-->
<!-- reamke4 = #{reamke4,jdbcType=VARCHAR},-->
<!-- payUserName = #{payusername,jdbcType=VARCHAR},-->
<!-- payLocationName = #{paylocationname,jdbcType=VARCHAR},-->
<!-- payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR}-->
<!-- where id = #{id,jdbcType=INTEGER}-->
<!-- </update>-->
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords" >
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayRecords">
insert into pay_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="payfees != null">
payFees,
</if>
<if test="payuserid != null">
payUserId,
</if>
<if test="paytime != null">
payTime,
</if>
<if test="paylocationid != null">
payLocationId,
</if>
<if test="paystatus != null">
payStatus,
</if>
<if test="paytype != null">
payType,
</if>
<if test="payfesstype != null">
payFessType,
</if>
<if test="ordernumber != null">
orderNumber,
</if>
<if test="reamke1 != null">
reamke1,
</if>
<if test="reamke2 != null">
reamke2,
</if>
<if test="reamke3 != null">
reamke3,
</if>
<if test="reamke4 != null">
reamke4,
</if>
<if test="payusername != null">
payUserName,
</if>
<if test="paylocationname != null">
payLocationName,
</if>
<if test="paytypeaddress != null">
payTypeAddress,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="payfees != null">
#{payfees,jdbcType=DECIMAL},
</if>
<if test="payuserid != null">
#{payuserid,jdbcType=INTEGER},
</if>
<if test="paytime != null">
#{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null">
#{paylocationid,jdbcType=INTEGER},
</if>
<if test="paystatus != null">
#{paystatus,jdbcType=BIT},
</if>
<if test="paytype != null">
#{paytype,jdbcType=BIT},
</if>
<if test="payfesstype != null">
#{payfesstype,jdbcType=BIT},
</if>
<if test="ordernumber != null">
#{ordernumber,jdbcType=VARCHAR},
</if>
<if test="reamke1 != null">
#{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null">
#{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null">
#{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null">
#{reamke4,jdbcType=VARCHAR},
</if>
<if test="payusername != null">
#{payusername,jdbcType=VARCHAR},
</if>
<if test="paylocationname != null">
#{paylocationname,jdbcType=VARCHAR},
</if>
<if test="paytypeaddress != null">
#{paytypeaddress,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayRecords">
update pay_records
<set>
<if test="payfees != null">
payFees = #{payfees,jdbcType=DECIMAL},
</if>
<if test="payuserid != null">
payUserId = #{payuserid,jdbcType=INTEGER},
</if>
<if test="paytime != null">
payTime = #{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null">
payLocationId = #{paylocationid,jdbcType=INTEGER},
</if>
<if test="paystatus != null">
payStatus = #{paystatus,jdbcType=BIT},
</if>
<if test="paytype != null">
payType = #{paytype,jdbcType=BIT},
</if>
<if test="payfesstype != null">
payFessType = #{payfesstype,jdbcType=BIT},
</if>
<if test="ordernumber != null">
orderNumber = #{ordernumber,jdbcType=VARCHAR},
</if>
<if test="reamke1 != null">
reamke1 = #{reamke1,jdbcType=VARCHAR},
</if>
<if test="reamke2 != null">
reamke2 = #{reamke2,jdbcType=VARCHAR},
</if>
<if test="reamke3 != null">
reamke3 = #{reamke3,jdbcType=VARCHAR},
</if>
<if test="reamke4 != null">
reamke4 = #{reamke4,jdbcType=VARCHAR},
</if>
<if test="payusername != null">
payUserName = #{payusername,jdbcType=VARCHAR},
</if>
<if test="paylocationname != null">
payLocationName = #{paylocationname,jdbcType=VARCHAR},
</if>
<if test="paytypeaddress != null">
payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<!-- <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords" >-->
<!-- update pay_records-->
<!-- set payFees = #{payfees,jdbcType=DECIMAL},-->
<!-- payUserId = #{payuserid,jdbcType=INTEGER},-->
<!-- payTime = #{paytime,jdbcType=TIMESTAMP},-->
<!-- payLocationId = #{paylocationid,jdbcType=INTEGER},-->
<!-- payStatus = #{paystatus,jdbcType=BIT},-->
<!-- payType = #{paytype,jdbcType=BIT},-->
<!-- payFessType = #{payfesstype,jdbcType=BIT},-->
<!-- orderNumber = #{ordernumber,jdbcType=VARCHAR},-->
<!-- reamke1 = #{reamke1,jdbcType=VARCHAR},-->
<!-- reamke2 = #{reamke2,jdbcType=VARCHAR},-->
<!-- reamke3 = #{reamke3,jdbcType=VARCHAR},-->
<!-- reamke4 = #{reamke4,jdbcType=VARCHAR},-->
<!-- payUserName = #{payusername,jdbcType=VARCHAR},-->
<!-- payLocationName = #{paylocationname,jdbcType=VARCHAR},-->
<!-- payTypeAddress = #{paytypeaddress,jdbcType=VARCHAR}-->
<!-- where id = #{id,jdbcType=INTEGER}-->
<!-- </update>-->
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayRecords">
update pay_records
set
payStatus = 1,
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.PayResponseMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayResponse" >
<id column="ID" property="id" jdbcType="VARCHAR" />
<result column="POSID" property="posid" jdbcType="VARCHAR" />
<result column="BRANCHID" property="branchid" jdbcType="VARCHAR" />
<result column="ORDERID" property="orderid" jdbcType="VARCHAR" />
<result column="PAYMENT" property="payment" jdbcType="DECIMAL" />
<result column="CURCODE" property="curcode" jdbcType="VARCHAR" />
<result column="REMARK1" property="remark1" jdbcType="VARCHAR" />
<result column="REMARK2" property="remark2" jdbcType="VARCHAR" />
<result column="ACC_TYPE" property="accType" jdbcType="VARCHAR" />
<result column="SUCCESS" property="success" jdbcType="VARCHAR" />
<result column="TYPE" property="type" jdbcType="VARCHAR" />
<result column="REFERER" property="referer" jdbcType="VARCHAR" />
<result column="CLIENTIP" property="clientip" jdbcType="VARCHAR" />
<result column="ACCDATE" property="accdate" jdbcType="TIMESTAMP" />
<result column="USRMSG" property="usrmsg" jdbcType="VARCHAR" />
<result column="USRINFO" property="usrinfo" jdbcType="VARCHAR" />
<result column="PAYTYPE" property="paytype" jdbcType="VARCHAR" />
<result column="SIGN" property="sign" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<mapper namespace="com.sunyo.energy.location.dao.PayResponseMapper">
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.PayResponse">
<id column="ID" property="id" jdbcType="VARCHAR"/>
<result column="POSID" property="posid" jdbcType="VARCHAR"/>
<result column="BRANCHID" property="branchid" jdbcType="VARCHAR"/>
<result column="ORDERID" property="orderid" jdbcType="VARCHAR"/>
<result column="PAYMENT" property="payment" jdbcType="DECIMAL"/>
<result column="CURCODE" property="curcode" jdbcType="VARCHAR"/>
<result column="REMARK1" property="remark1" jdbcType="VARCHAR"/>
<result column="REMARK2" property="remark2" jdbcType="VARCHAR"/>
<result column="ACC_TYPE" property="accType" jdbcType="VARCHAR"/>
<result column="SUCCESS" property="success" jdbcType="VARCHAR"/>
<result column="TYPE" property="type" jdbcType="VARCHAR"/>
<result column="REFERER" property="referer" jdbcType="VARCHAR"/>
<result column="CLIENTIP" property="clientip" jdbcType="VARCHAR"/>
<result column="ACCDATE" property="accdate" jdbcType="TIMESTAMP"/>
<result column="USRMSG" property="usrmsg" jdbcType="VARCHAR"/>
<result column="USRINFO" property="usrinfo" jdbcType="VARCHAR"/>
<result column="PAYTYPE" property="paytype" jdbcType="VARCHAR"/>
<result column="SIGN" property="sign" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID, POSID, BRANCHID, ORDERID, PAYMENT, CURCODE, REMARK1, REMARK2, ACC_TYPE, SUCCESS,
TYPE, REFERER, CLIENTIP, ACCDATE, USRMSG, USRINFO, PAYTYPE, SIGN
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from pay_response
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from pay_response
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from pay_response
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.PayResponse" >
<insert id="insert" parameterType="com.sunyo.energy.location.model.PayResponse">
insert into pay_response (ID, POSID, BRANCHID,
ORDERID, PAYMENT, CURCODE,
REMARK1, REMARK2, ACC_TYPE,
... ... @@ -51,179 +51,179 @@
#{usrinfo,jdbcType=VARCHAR}, #{paytype,jdbcType=VARCHAR}, #{sign,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayResponse" >
insert into pay_response
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="posid != null" >
POSID,
</if>
<if test="branchid != null" >
BRANCHID,
</if>
<if test="orderid != null" >
ORDERID,
</if>
<if test="payment != null" >
PAYMENT,
</if>
<if test="curcode != null" >
CURCODE,
</if>
<if test="remark1 != null" >
REMARK1,
</if>
<if test="remark2 != null" >
REMARK2,
</if>
<if test="accType != null" >
ACC_TYPE,
</if>
<if test="success != null" >
SUCCESS,
</if>
<if test="type != null" >
TYPE,
</if>
<if test="referer != null" >
REFERER,
</if>
<if test="clientip != null" >
CLIENTIP,
</if>
<if test="accdate != null" >
ACCDATE,
</if>
<if test="usrmsg != null" >
USRMSG,
</if>
<if test="usrinfo != null" >
USRINFO,
</if>
<if test="paytype != null" >
PAYTYPE,
</if>
<if test="sign != null" >
SIGN,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="posid != null" >
#{posid,jdbcType=VARCHAR},
</if>
<if test="branchid != null" >
#{branchid,jdbcType=VARCHAR},
</if>
<if test="orderid != null" >
#{orderid,jdbcType=VARCHAR},
</if>
<if test="payment != null" >
#{payment,jdbcType=DECIMAL},
</if>
<if test="curcode != null" >
#{curcode,jdbcType=VARCHAR},
</if>
<if test="remark1 != null" >
#{remark1,jdbcType=VARCHAR},
</if>
<if test="remark2 != null" >
#{remark2,jdbcType=VARCHAR},
</if>
<if test="accType != null" >
#{accType,jdbcType=VARCHAR},
</if>
<if test="success != null" >
#{success,jdbcType=VARCHAR},
</if>
<if test="type != null" >
#{type,jdbcType=VARCHAR},
</if>
<if test="referer != null" >
#{referer,jdbcType=VARCHAR},
</if>
<if test="clientip != null" >
#{clientip,jdbcType=VARCHAR},
</if>
<if test="accdate != null" >
#{accdate,jdbcType=TIMESTAMP},
</if>
<if test="usrmsg != null" >
#{usrmsg,jdbcType=VARCHAR},
</if>
<if test="usrinfo != null" >
#{usrinfo,jdbcType=VARCHAR},
</if>
<if test="paytype != null" >
#{paytype,jdbcType=VARCHAR},
</if>
<if test="sign != null" >
#{sign,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayResponse" >
update pay_response
<set >
<if test="posid != null" >
POSID = #{posid,jdbcType=VARCHAR},
</if>
<if test="branchid != null" >
BRANCHID = #{branchid,jdbcType=VARCHAR},
</if>
<if test="orderid != null" >
ORDERID = #{orderid,jdbcType=VARCHAR},
</if>
<if test="payment != null" >
PAYMENT = #{payment,jdbcType=DECIMAL},
</if>
<if test="curcode != null" >
CURCODE = #{curcode,jdbcType=VARCHAR},
</if>
<if test="remark1 != null" >
REMARK1 = #{remark1,jdbcType=VARCHAR},
</if>
<if test="remark2 != null" >
REMARK2 = #{remark2,jdbcType=VARCHAR},
</if>
<if test="accType != null" >
ACC_TYPE = #{accType,jdbcType=VARCHAR},
</if>
<if test="success != null" >
SUCCESS = #{success,jdbcType=VARCHAR},
</if>
<if test="type != null" >
TYPE = #{type,jdbcType=VARCHAR},
</if>
<if test="referer != null" >
REFERER = #{referer,jdbcType=VARCHAR},
</if>
<if test="clientip != null" >
CLIENTIP = #{clientip,jdbcType=VARCHAR},
</if>
<if test="accdate != null" >
ACCDATE = #{accdate,jdbcType=TIMESTAMP},
</if>
<if test="usrmsg != null" >
USRMSG = #{usrmsg,jdbcType=VARCHAR},
</if>
<if test="usrinfo != null" >
USRINFO = #{usrinfo,jdbcType=VARCHAR},
</if>
<if test="paytype != null" >
PAYTYPE = #{paytype,jdbcType=VARCHAR},
</if>
<if test="sign != null" >
SIGN = #{sign,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayResponse" >
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.PayResponse">
insert into pay_response
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="posid != null">
POSID,
</if>
<if test="branchid != null">
BRANCHID,
</if>
<if test="orderid != null">
ORDERID,
</if>
<if test="payment != null">
PAYMENT,
</if>
<if test="curcode != null">
CURCODE,
</if>
<if test="remark1 != null">
REMARK1,
</if>
<if test="remark2 != null">
REMARK2,
</if>
<if test="accType != null">
ACC_TYPE,
</if>
<if test="success != null">
SUCCESS,
</if>
<if test="type != null">
TYPE,
</if>
<if test="referer != null">
REFERER,
</if>
<if test="clientip != null">
CLIENTIP,
</if>
<if test="accdate != null">
ACCDATE,
</if>
<if test="usrmsg != null">
USRMSG,
</if>
<if test="usrinfo != null">
USRINFO,
</if>
<if test="paytype != null">
PAYTYPE,
</if>
<if test="sign != null">
SIGN,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="posid != null">
#{posid,jdbcType=VARCHAR},
</if>
<if test="branchid != null">
#{branchid,jdbcType=VARCHAR},
</if>
<if test="orderid != null">
#{orderid,jdbcType=VARCHAR},
</if>
<if test="payment != null">
#{payment,jdbcType=DECIMAL},
</if>
<if test="curcode != null">
#{curcode,jdbcType=VARCHAR},
</if>
<if test="remark1 != null">
#{remark1,jdbcType=VARCHAR},
</if>
<if test="remark2 != null">
#{remark2,jdbcType=VARCHAR},
</if>
<if test="accType != null">
#{accType,jdbcType=VARCHAR},
</if>
<if test="success != null">
#{success,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="referer != null">
#{referer,jdbcType=VARCHAR},
</if>
<if test="clientip != null">
#{clientip,jdbcType=VARCHAR},
</if>
<if test="accdate != null">
#{accdate,jdbcType=TIMESTAMP},
</if>
<if test="usrmsg != null">
#{usrmsg,jdbcType=VARCHAR},
</if>
<if test="usrinfo != null">
#{usrinfo,jdbcType=VARCHAR},
</if>
<if test="paytype != null">
#{paytype,jdbcType=VARCHAR},
</if>
<if test="sign != null">
#{sign,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.PayResponse">
update pay_response
<set>
<if test="posid != null">
POSID = #{posid,jdbcType=VARCHAR},
</if>
<if test="branchid != null">
BRANCHID = #{branchid,jdbcType=VARCHAR},
</if>
<if test="orderid != null">
ORDERID = #{orderid,jdbcType=VARCHAR},
</if>
<if test="payment != null">
PAYMENT = #{payment,jdbcType=DECIMAL},
</if>
<if test="curcode != null">
CURCODE = #{curcode,jdbcType=VARCHAR},
</if>
<if test="remark1 != null">
REMARK1 = #{remark1,jdbcType=VARCHAR},
</if>
<if test="remark2 != null">
REMARK2 = #{remark2,jdbcType=VARCHAR},
</if>
<if test="accType != null">
ACC_TYPE = #{accType,jdbcType=VARCHAR},
</if>
<if test="success != null">
SUCCESS = #{success,jdbcType=VARCHAR},
</if>
<if test="type != null">
TYPE = #{type,jdbcType=VARCHAR},
</if>
<if test="referer != null">
REFERER = #{referer,jdbcType=VARCHAR},
</if>
<if test="clientip != null">
CLIENTIP = #{clientip,jdbcType=VARCHAR},
</if>
<if test="accdate != null">
ACCDATE = #{accdate,jdbcType=TIMESTAMP},
</if>
<if test="usrmsg != null">
USRMSG = #{usrmsg,jdbcType=VARCHAR},
</if>
<if test="usrinfo != null">
USRINFO = #{usrinfo,jdbcType=VARCHAR},
</if>
<if test="paytype != null">
PAYTYPE = #{paytype,jdbcType=VARCHAR},
</if>
<if test="sign != null">
SIGN = #{sign,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.PayResponse">
update pay_response
set POSID = #{posid,jdbcType=VARCHAR},
BRANCHID = #{branchid,jdbcType=VARCHAR},
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.sunyo.energy.location.dao.USERSMapper" >
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.USERS" >
<id column="user_id" property="userId" jdbcType="INTEGER" />
<result column="username" property="username" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="birthday" property="birthday" jdbcType="TIMESTAMP" />
<result column="sex" property="sex" jdbcType="CHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="BIT" />
<result column="mobilePhone" property="mobilephone" jdbcType="VARCHAR" />
<result column="creatTime" property="creattime" jdbcType="TIMESTAMP" />
<result column="updateTime" property="updatetime" jdbcType="TIMESTAMP" />
<result column="userFace" property="userface" jdbcType="VARCHAR" />
<result column="realName" property="realname" jdbcType="VARCHAR" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="age" property="age" jdbcType="INTEGER" />
<result column="company_id" property="companyId" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
<mapper namespace="com.sunyo.energy.location.dao.USERSMapper">
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.USERS">
<id column="user_id" property="userId" jdbcType="INTEGER"/>
<result column="username" property="username" jdbcType="VARCHAR"/>
<result column="password" property="password" jdbcType="VARCHAR"/>
<result column="birthday" property="birthday" jdbcType="TIMESTAMP"/>
<result column="sex" property="sex" jdbcType="CHAR"/>
<result column="address" property="address" jdbcType="VARCHAR"/>
<result column="state" property="state" jdbcType="BIT"/>
<result column="mobilePhone" property="mobilephone" jdbcType="VARCHAR"/>
<result column="creatTime" property="creattime" jdbcType="TIMESTAMP"/>
<result column="updateTime" property="updatetime" jdbcType="TIMESTAMP"/>
<result column="userFace" property="userface" jdbcType="VARCHAR"/>
<result column="realName" property="realname" jdbcType="VARCHAR"/>
<result column="email" property="email" jdbcType="VARCHAR"/>
<result column="age" property="age" jdbcType="INTEGER"/>
<result column="company_id" property="companyId" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
user_id, username, password, birthday, sex, address, state, mobilePhone, creatTime,
updateTime, userFace, realName, email, age, company_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from users
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from users
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from users
where user_id = #{userId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.USERS" >
<insert id="insert" parameterType="com.sunyo.energy.location.model.USERS">
insert into users (user_id, username, password,
birthday, sex, address,
state, mobilePhone, creatTime,
... ... @@ -46,152 +46,152 @@
#{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.USERS" >
insert into users
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="userId != null" >
user_id,
</if>
<if test="username != null" >
username,
</if>
<if test="password != null" >
password,
</if>
<if test="birthday != null" >
birthday,
</if>
<if test="sex != null" >
sex,
</if>
<if test="address != null" >
address,
</if>
<if test="state != null" >
state,
</if>
<if test="mobilephone != null" >
mobilePhone,
</if>
<if test="creattime != null" >
creatTime,
</if>
<if test="updatetime != null" >
updateTime,
</if>
<if test="userface != null" >
userFace,
</if>
<if test="realname != null" >
realName,
</if>
<if test="email != null" >
email,
</if>
<if test="age != null" >
age,
</if>
<if test="companyId != null" >
company_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="userId != null" >
#{userId,jdbcType=INTEGER},
</if>
<if test="username != null" >
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null" >
#{password,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
#{birthday,jdbcType=TIMESTAMP},
</if>
<if test="sex != null" >
#{sex,jdbcType=CHAR},
</if>
<if test="address != null" >
#{address,jdbcType=VARCHAR},
</if>
<if test="state != null" >
#{state,jdbcType=BIT},
</if>
<if test="mobilephone != null" >
#{mobilephone,jdbcType=VARCHAR},
</if>
<if test="creattime != null" >
#{creattime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null" >
#{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="userface != null" >
#{userface,jdbcType=VARCHAR},
</if>
<if test="realname != null" >
#{realname,jdbcType=VARCHAR},
</if>
<if test="email != null" >
#{email,jdbcType=VARCHAR},
</if>
<if test="age != null" >
#{age,jdbcType=INTEGER},
</if>
<if test="companyId != null" >
#{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.USERS" >
update users
<set >
<if test="username != null" >
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null" >
password = #{password,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
birthday = #{birthday,jdbcType=TIMESTAMP},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=CHAR},
</if>
<if test="address != null" >
address = #{address,jdbcType=VARCHAR},
</if>
<if test="state != null" >
state = #{state,jdbcType=BIT},
</if>
<if test="mobilephone != null" >
mobilePhone = #{mobilephone,jdbcType=VARCHAR},
</if>
<if test="creattime != null" >
creatTime = #{creattime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null" >
updateTime = #{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="userface != null" >
userFace = #{userface,jdbcType=VARCHAR},
</if>
<if test="realname != null" >
realName = #{realname,jdbcType=VARCHAR},
</if>
<if test="email != null" >
email = #{email,jdbcType=VARCHAR},
</if>
<if test="age != null" >
age = #{age,jdbcType=INTEGER},
</if>
<if test="companyId != null" >
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set>
where user_id = #{userId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.USERS" >
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.USERS">
insert into users
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="sex != null">
sex,
</if>
<if test="address != null">
address,
</if>
<if test="state != null">
state,
</if>
<if test="mobilephone != null">
mobilePhone,
</if>
<if test="creattime != null">
creatTime,
</if>
<if test="updatetime != null">
updateTime,
</if>
<if test="userface != null">
userFace,
</if>
<if test="realname != null">
realName,
</if>
<if test="email != null">
email,
</if>
<if test="age != null">
age,
</if>
<if test="companyId != null">
company_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
#{birthday,jdbcType=TIMESTAMP},
</if>
<if test="sex != null">
#{sex,jdbcType=CHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=BIT},
</if>
<if test="mobilephone != null">
#{mobilephone,jdbcType=VARCHAR},
</if>
<if test="creattime != null">
#{creattime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
#{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="userface != null">
#{userface,jdbcType=VARCHAR},
</if>
<if test="realname != null">
#{realname,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="age != null">
#{age,jdbcType=INTEGER},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.USERS">
update users
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
birthday = #{birthday,jdbcType=TIMESTAMP},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=CHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="state != null">
state = #{state,jdbcType=BIT},
</if>
<if test="mobilephone != null">
mobilePhone = #{mobilephone,jdbcType=VARCHAR},
</if>
<if test="creattime != null">
creatTime = #{creattime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
updateTime = #{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="userface != null">
userFace = #{userface,jdbcType=VARCHAR},
</if>
<if test="realname != null">
realName = #{realname,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="age != null">
age = #{age,jdbcType=INTEGER},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set>
where user_id = #{userId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.USERS">
update users
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
... ...