作者 shenhailong

全部提交一下

正在显示 42 个修改的文件 包含 1689 行增加1691 行删除

要显示太多修改。

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

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