正在显示
60 个修改的文件
包含
92 行增加
和
4447 行删除
@@ -5,7 +5,7 @@ docker: | @@ -5,7 +5,7 @@ docker: | ||
5 | server: | 5 | server: |
6 | ip: 192.168.1.63 | 6 | ip: 192.168.1.63 |
7 | server: | 7 | server: |
8 | - port: 10004 | 8 | + port: 10005 |
9 | # servlet: | 9 | # servlet: |
10 | # context-path: ${SERVER_CONTEXTPATH:} | 10 | # context-path: ${SERVER_CONTEXTPATH:} |
11 | spring: | 11 | spring: |
@@ -37,7 +37,7 @@ spring: | @@ -37,7 +37,7 @@ spring: | ||
37 | static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,classpath:/public/,file:${web.upload-path} | 37 | static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,classpath:/public/,file:${web.upload-path} |
38 | 38 | ||
39 | application: | 39 | application: |
40 | - name: EMPT-LOCATION | 40 | + name: EMPT-LOCATION-TIMED-TASK |
41 | 41 | ||
42 | jackson: | 42 | jackson: |
43 | serialization: | 43 | serialization: |
@@ -151,23 +151,6 @@ logging: | @@ -151,23 +151,6 @@ logging: | ||
151 | jwt: | 151 | jwt: |
152 | max-alive: 300 | 152 | max-alive: 300 |
153 | 153 | ||
154 | -#自定义配置 | ||
155 | -custom: | ||
156 | - #进港放行回执读取目录 | ||
157 | - receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/20191104 | ||
158 | - #回执解析成功后的备份目录 | ||
159 | - receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success | ||
160 | - #解析错误报文的备份目录 | ||
161 | - errBakDir: /Users/mrz/Downloads/rdp_temp/logs/error | ||
162 | - #回执转发目录 | ||
163 | - transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit | ||
164 | - #匹配技术回执正则 | ||
165 | - delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml | ||
166 | -devops: | ||
167 | - dir: | ||
168 | - singlewindow-tcs-recept: D:\TCSSingleWindow\recive | ||
169 | - tianbo-tcs-recept: D:\Data\Receive | ||
170 | - cfps-subscribe-dir: D:\系统部署\imf_Warehouse_reader\xmlFromImf | ||
171 | #10079 | 154 | #10079 |
172 | eeid: | 155 | eeid: |
173 | ipAddress: 192.168.50.23 | 156 | ipAddress: 192.168.50.23 |
@@ -182,26 +165,5 @@ eeUrl: | @@ -182,26 +165,5 @@ eeUrl: | ||
182 | #获取设备跟公寓信息 | 165 | #获取设备跟公寓信息 |
183 | # getRoomAndDeviceUrl: "http://10.5.10.102:8000/api/emcs/getRoomAndDevice" | 166 | # getRoomAndDeviceUrl: "http://10.5.10.102:8000/api/emcs/getRoomAndDevice" |
184 | getRoomAndDeviceUrl: "http://192.168.1.7:18080/api/emcs/getRoomAndDevice" | 167 | getRoomAndDeviceUrl: "http://192.168.1.7:18080/api/emcs/getRoomAndDevice" |
185 | -payInfo: | ||
186 | - #商户代码 | ||
187 | - merchantid: "105001453995827" | ||
188 | - #商户柜台代码 | ||
189 | - posid: "031575220" | ||
190 | - #分行代码 | ||
191 | - branchid: "410000000" | ||
192 | - #交易码 | ||
193 | - txcode: "530550" | ||
194 | - #应柜台的公钥后30位 | ||
195 | - pub32tr2: "8578d1cd9340dba556126a71020111" | ||
196 | 168 | ||
197 | -# #商户代码 | ||
198 | -# merchantid: "105000045820502" | ||
199 | -# #商户柜台代码 | ||
200 | -# posid: "049347762" | ||
201 | -# #分行代码 | ||
202 | -# branchid: "410000000" | ||
203 | -# #交易码 | ||
204 | -# txcode: "530550" | ||
205 | -# #应柜台的公钥后30位 | ||
206 | -# pub32tr2: "1c99bca545a2baf6bed0637b020111" | ||
207 | 169 |
1 | { | 1 | { |
2 | - "AttachStdin" : true, | ||
3 | - "OpenStdin" : true, | ||
4 | - "Image" : "", | ||
5 | - "Volumes" : { }, | ||
6 | - "ExposedPorts" : { }, | ||
7 | - "HostConfig" : { | ||
8 | - "Binds" : [ ], | ||
9 | - "NetworkMode" : "host" | 2 | + "AttachStdin": true, |
3 | + "OpenStdin": true, | ||
4 | + "Image": "", | ||
5 | + "Volumes": {}, | ||
6 | + "ExposedPorts": {}, | ||
7 | + "HostConfig": { | ||
8 | + "Binds": [], | ||
9 | + "NetworkMode": "host" | ||
10 | }, | 10 | }, |
11 | - "_comment" : "" | 11 | + "_comment": "" |
12 | } | 12 | } |
src/META-INF/MANIFEST.MF
0 → 100644
1 | +Manifest-Version: 1.0 | ||
2 | +Main-Class: com.sunyo.energy.location.BootApplication | ||
3 | +Class-Path: rxnetty-servo-0.4.9.jar xstream-1.4.11.1.jar spring-cloud-st | ||
4 | + arter-netflix-archaius-2.1.5.BUILD-SNAPSHOT.jar commons-codec-1.13.jar | ||
5 | + spring-aop-5.2.0.RELEASE.jar spring-context-5.2.0.RELEASE.jar spring-cl | ||
6 | + oud-netflix-archaius-2.1.5.BUILD-SNAPSHOT.jar fastjson-1.2.28.jar ribbo | ||
7 | + n-core-2.3.0.jar json-lib-2.4-jdk15.jar xpp3_min-1.1.4c.jar log4j-api-2 | ||
8 | + .12.1.jar spring-boot-starter-tomcat-2.2.0.BUILD-SNAPSHOT.jar jackson-c | ||
9 | + ore-2.10.0.jar netflix-statistics-0.1.1.jar spring-cloud-starter-2.1.5. | ||
10 | + BUILD-SNAPSHOT.jar commons-httpclient-3.1.jar snakeyaml-1.25.jar ribbon | ||
11 | + -loadbalancer-2.3.0.jar slf4j-api-1.7.28.jar jersey-apache-client4-1.19 | ||
12 | + .1.jar springfox-swagger2-2.9.2.jar tomcat-embed-el-9.0.27.jar eureka-c | ||
13 | + lient-1.9.13.jar logback-core-1.2.3.jar aopalliance-1.0.jar springfox-s | ||
14 | + chema-2.9.2.jar jakarta.annotation-api-1.3.5.jar spring-plugin-metadata | ||
15 | + -1.2.0.RELEASE.jar attoparser-2.0.5.RELEASE.jar jakarta.validation-api- | ||
16 | + 2.0.1.jar HikariCP-3.4.1.jar httpcore-4.4.12.jar spring-boot-starter-va | ||
17 | + lidation-2.2.0.BUILD-SNAPSHOT.jar eureka-core-1.9.13.jar thymeleaf-3.0. | ||
18 | + 11.RELEASE.jar ribbon-transport-2.3.0.jar spring-tx-5.2.0.RELEASE.jar s | ||
19 | + wagger-annotations-1.5.20.jar spring-beans-5.2.0.RELEASE.jar druid-1.1. | ||
20 | + 9.jar springfox-spring-web-2.9.2.jar spring-boot-starter-websocket-2.2. | ||
21 | + 0.BUILD-SNAPSHOT.jar lombok-1.18.10.jar ribbon-eureka-2.3.0.jar jackson | ||
22 | + -datatype-jsr310-2.10.0.jar spring-security-crypto-5.2.0.RELEASE.jar st | ||
23 | + ringtemplate-3.2.1.jar jackson-datatype-jdk8-2.10.0.jar joda-time-2.10. | ||
24 | + 4.jar hutool-log-5.2.5.jar commons-jxpath-1.3.jar spring-cloud-netflix- | ||
25 | + eureka-client-2.1.5.BUILD-SNAPSHOT.jar jsqlparser-1.0.jar commons-confi | ||
26 | + guration-1.8.jar HdrHistogram-2.1.9.jar antlr-runtime-3.4.jar guava-20. | ||
27 | + 0.jar logback-classic-1.2.3.jar spring-cloud-starter-netflix-eureka-cli | ||
28 | + ent-2.1.5.BUILD-SNAPSHOT.jar spring-boot-starter-web-2.2.0.BUILD-SNAPSH | ||
29 | + OT.jar swagger-models-1.5.20.jar jsr311-api-1.1.1.jar spring-boot-start | ||
30 | + er-jdbc-2.2.0.BUILD-20191016.163441-713.jar netflix-infix-0.3.0.jar bcp | ||
31 | + rov-jdk15on-1.64.jar mybatis-3.4.6.jar spring-cloud-context-2.1.5.BUILD | ||
32 | + -SNAPSHOT.jar netflix-eventbus-0.3.0.jar hystrix-core-1.5.18.jar xmlpul | ||
33 | + l-1.1.3.1.jar commons-math-2.2.jar spring-boot-2.2.0.BUILD-SNAPSHOT.jar | ||
34 | + aspectjweaver-1.9.4.jar thymeleaf-extras-java8time-3.0.4.RELEASE.jar s | ||
35 | + pring-websocket-5.2.0.RELEASE.jar thymeleaf-spring5-3.0.11.RELEASE.jar | ||
36 | + jboss-logging-3.4.1.Final.jar spring-boot-starter-aop-2.2.0.BUILD-SNAPS | ||
37 | + HOT.jar spring-boot-starter-2.2.0.BUILD-SNAPSHOT.jar ribbon-2.3.0.jar s | ||
38 | + pring-cloud-commons-2.1.5.BUILD-SNAPSHOT.jar json-20190722.jar spring-c | ||
39 | + loud-starter-netflix-ribbon-2.1.5.BUILD-SNAPSHOT.jar spring-messaging-5 | ||
40 | + .2.0.RELEASE.jar javax.inject-1.jar byte-buddy-1.10.1.jar spring-cloud- | ||
41 | + netflix-ribbon-2.1.5.BUILD-SNAPSHOT.jar log4j-to-slf4j-2.12.1.jar sprin | ||
42 | + g-security-rsa-1.0.9.RELEASE.jar mybatis-spring-2.0.3.jar commons-lang- | ||
43 | + 2.5.jar stax-api-1.0.1.jar springfox-swagger-common-2.9.2.jar spring-co | ||
44 | + re-5.2.0.RELEASE.jar commons-logging-1.0.4.jar ezmorph-1.0.6.jar jersey | ||
45 | + -client-1.19.1.jar spring-jdbc-5.2.0.RELEASE.jar jettison-1.3.7.jar map | ||
46 | + struct-1.2.0.Final.jar spring-cloud-netflix-hystrix-2.1.5.BUILD-SNAPSHO | ||
47 | + T.jar jackson-databind-2.10.0.jar stax2-api-4.2.jar spring-web-5.2.0.RE | ||
48 | + LEASE.jar spring-boot-starter-json-2.2.0.BUILD-SNAPSHOT.jar hutool-core | ||
49 | + -5.2.5.jar ribbon-httpclient-2.3.0.jar spring-boot-autoconfigure-2.2.0. | ||
50 | + BUILD-SNAPSHOT.jar spring-jcl-5.2.0.RELEASE.jar gson-2.8.6.jar spring-p | ||
51 | + lugin-core-1.2.0.RELEASE.jar woodstox-core-5.2.1.jar tomcat-embed-webso | ||
52 | + cket-9.0.27.jar pagehelper-spring-boot-starter-1.2.5.jar spring-boot-st | ||
53 | + arter-thymeleaf-2.2.0.BUILD-SNAPSHOT.jar archaius-core-0.7.6.jar spring | ||
54 | + -expression-5.2.0.RELEASE.jar hibernate-validator-6.0.17.Final.jar myba | ||
55 | + tis-spring-boot-starter-2.1.1.jar spring-webmvc-5.2.0.RELEASE.jar rxnet | ||
56 | + ty-0.4.9.jar guice-4.1.0.jar springfox-spi-2.9.2.jar jersey-core-1.19.1 | ||
57 | + .jar rxjava-1.3.8.jar classmate-1.5.0.jar commons-collections-3.2.1.jar | ||
58 | + rxnetty-contexts-0.4.9.jar tomcat-embed-core-9.0.27.jar jackson-annota | ||
59 | + tions-2.10.0.jar pagehelper-5.1.4.jar pagehelper-spring-boot-autoconfig | ||
60 | + ure-1.2.5.jar jul-to-slf4j-1.7.28.jar netflix-commons-util-0.3.0.jar se | ||
61 | + rvo-core-0.12.21.jar spring-boot-starter-logging-2.2.0.BUILD-SNAPSHOT.j | ||
62 | + ar httpclient-4.5.12.jar springfox-swagger-ui-2.9.2.jar mybatis-spring- | ||
63 | + boot-autoconfigure-2.1.1.jar unbescape-1.1.6.RELEASE.jar springfox-core | ||
64 | + -2.9.2.jar bcpkix-jdk15on-1.64.jar antlr-2.7.7.jar commons-beanutils-1. | ||
65 | + 8.0.jar mysql-connector-java-8.0.18.jar jackson-module-parameter-names- | ||
66 | + 2.10.0.jar | ||
67 | + |
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | -import com.github.pagehelper.PageInfo; | ||
4 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
5 | -import com.sunyo.energy.location.model.ElectricityInfo; | ||
6 | -import com.sunyo.energy.location.service.EeInfoService; | ||
7 | -import io.swagger.annotations.ApiOperation; | ||
8 | -import org.springframework.beans.factory.annotation.Autowired; | ||
9 | -import org.springframework.stereotype.Component; | ||
10 | -import org.springframework.stereotype.Controller; | ||
11 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | -import org.springframework.web.bind.annotation.RequestParam; | ||
13 | -import org.springframework.web.bind.annotation.ResponseBody; | ||
14 | -import sun.jvm.hotspot.debugger.Page; | ||
15 | - | ||
16 | -import java.util.List; | ||
17 | - | ||
18 | -/** | ||
19 | - * @author shenhailong | ||
20 | - * <p> | ||
21 | - * 2020/6/5/10:44 | ||
22 | - */ | ||
23 | -@RequestMapping(value = "/eeInfo") | ||
24 | -@Component | ||
25 | -public class EeInfoController { | ||
26 | - | ||
27 | - @Autowired | ||
28 | - EeInfoService eeInfoService; | ||
29 | - | ||
30 | - @ApiOperation(value = "查询电表充值失败信息") | ||
31 | - @RequestMapping("/list") | ||
32 | - @ResponseBody | ||
33 | - public PageInfo<ElectricityInfo> list(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize, | ||
34 | - @RequestParam(value = "pageNum", required = false, defaultValue = "5") int pageNum, | ||
35 | - @RequestParam(value = "deviceId", required = false) String deviceId) { | ||
36 | - | ||
37 | - PageInfo<ElectricityInfo> eeInfo = eeInfoService.getEeInfo(pageSize, pageNum, deviceId); | ||
38 | - | ||
39 | - return eeInfo; | ||
40 | - | ||
41 | - } | ||
42 | - | ||
43 | -} |
src/main/java/com/sunyo/energy/location/controller/ElectricityParameterController.java
已删除
100644 → 0
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
4 | -import com.sunyo.energy.location.model.ElectricityBalanceThree; | ||
5 | -import com.sunyo.energy.location.model.ElectricityMeter; | ||
6 | -import com.sunyo.energy.location.model.WaterElectricityParameter; | ||
7 | -import com.sunyo.energy.location.service.ElectricityMeterService; | ||
8 | -import com.sunyo.energy.location.service.WaterElectricityParameterService; | ||
9 | -import io.swagger.annotations.ApiOperation; | ||
10 | -import org.springframework.beans.factory.annotation.Autowired; | ||
11 | -import org.springframework.beans.factory.annotation.Value; | ||
12 | -import org.springframework.stereotype.Controller; | ||
13 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
14 | -import org.springframework.web.bind.annotation.RequestParam; | ||
15 | -import org.springframework.web.bind.annotation.ResponseBody; | ||
16 | - | ||
17 | -@RequestMapping("/electricity_meter") | ||
18 | -@Controller | ||
19 | -public class ElectricityParameterController { | ||
20 | - | ||
21 | - @Autowired | ||
22 | - private WaterElectricityParameterService waterElectricityParameterService; | ||
23 | - | ||
24 | - /** | ||
25 | - * 电表处理远程访问 返回值信息 | ||
26 | - */ | ||
27 | - @Autowired | ||
28 | - ElectricityMeterService electricityMeterService; | ||
29 | - | ||
30 | - @ApiOperation(value = "电表参数配置") | ||
31 | - @RequestMapping("/add") | ||
32 | - @ResponseBody | ||
33 | - public ResultJson eetParam(ResultJson resultJson, WaterElectricityParameter waterElectricityParameter) { | ||
34 | - | ||
35 | - try { | ||
36 | - if (waterElectricityParameterService.countOne(waterElectricityParameter.getEeId()) > 0) { | ||
37 | - resultJson.setCode("200"); | ||
38 | - return resultJson; | ||
39 | - } else { | ||
40 | - int i = waterElectricityParameterService.insertSelective(waterElectricityParameter); | ||
41 | - | ||
42 | - if (i > 0) { | ||
43 | - resultJson.setCode("200"); | ||
44 | - resultJson.setMsg("添加成功"); | ||
45 | - return resultJson; | ||
46 | - } else { | ||
47 | - resultJson.setCode("500"); | ||
48 | - resultJson.setMsg("网络异常"); | ||
49 | - return resultJson; | ||
50 | - } | ||
51 | - } | ||
52 | - } catch (Exception e) { | ||
53 | - e.printStackTrace(); | ||
54 | - resultJson.setCode("500"); | ||
55 | - resultJson.setMsg("网络异常"); | ||
56 | - return resultJson; | ||
57 | - } | ||
58 | - | ||
59 | - } | ||
60 | - | ||
61 | - @ApiOperation(value = "电表参数查询") | ||
62 | - @RequestMapping("/getEEModel") | ||
63 | - @ResponseBody | ||
64 | - public WaterElectricityParameter getEEModel(@RequestParam(value = "eeId", required = false) String eeId) { | ||
65 | - WaterElectricityParameter oneElectricity = waterElectricityParameterService.findOneElectricity(eeId); | ||
66 | - System.out.println("111"); | ||
67 | - return oneElectricity; | ||
68 | - | ||
69 | - } | ||
70 | - | ||
71 | - @ApiOperation(value = "电表参数编辑") | ||
72 | - @RequestMapping("/edit") | ||
73 | - @ResponseBody | ||
74 | - public ResultJson edit(ResultJson resultJson, WaterElectricityParameter waterElectricityParameter) { | ||
75 | - | ||
76 | - try { | ||
77 | - if (waterElectricityParameterService.updateByPrimaryKeySelective(waterElectricityParameter) > 0) { | ||
78 | - resultJson.setCode("200"); | ||
79 | - return resultJson; | ||
80 | - } else { | ||
81 | - resultJson.setCode("500"); | ||
82 | - resultJson.setMsg("网络异常"); | ||
83 | - return resultJson; | ||
84 | - } | ||
85 | - } catch (Exception e) { | ||
86 | - e.printStackTrace(); | ||
87 | - resultJson.setCode("500"); | ||
88 | - resultJson.setMsg("网络异常"); | ||
89 | - return resultJson; | ||
90 | - } | ||
91 | - } | ||
92 | - | ||
93 | - /** | ||
94 | - * 获取电表实施数据 | ||
95 | - * | ||
96 | - * @param eeId | ||
97 | - * @return | ||
98 | - */ | ||
99 | - @ApiOperation(value = "电表实时信息查询") | ||
100 | - @RequestMapping(value = "/getEnergyInfoForRealTime") | ||
101 | - @ResponseBody | ||
102 | - public ElectricityMeter getEnergyInfoForRealTime(@RequestParam(value = "eeId", required = false) String eeId) { | ||
103 | - | ||
104 | - try { | ||
105 | - ElectricityMeter energyInfoForRealTime = electricityMeterService.getEnergyInfoForRealTime(eeId); | ||
106 | - return energyInfoForRealTime; | ||
107 | - } catch (Exception e) { | ||
108 | - e.printStackTrace(); | ||
109 | - return null; | ||
110 | - } | ||
111 | - } | ||
112 | - | ||
113 | -} |
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | - | ||
4 | -import com.github.pagehelper.Page; | ||
5 | -import com.github.pagehelper.PageHelper; | ||
6 | -import com.github.pagehelper.PageInfo; | ||
7 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
8 | -import com.sunyo.energy.location.dao.LocationMapper; | ||
9 | -import com.sunyo.energy.location.model.Location; | ||
10 | -import io.swagger.annotations.ApiOperation; | ||
11 | -import org.apache.ibatis.annotations.Param; | ||
12 | -import org.springframework.beans.factory.annotation.Autowired; | ||
13 | -import org.springframework.util.StringUtils; | ||
14 | -import org.springframework.web.bind.annotation.*; | ||
15 | - | ||
16 | -import java.util.HashMap; | ||
17 | -import java.util.List; | ||
18 | -import java.util.Map; | ||
19 | - | ||
20 | -@RestController | ||
21 | -@RequestMapping("/location") | ||
22 | -public class LocationController { | ||
23 | - | ||
24 | - @Autowired | ||
25 | - private LocationMapper locationMapper; | ||
26 | - | ||
27 | - @ApiOperation(value = "查询楼层") | ||
28 | - @RequestMapping(value = "/list", method = RequestMethod.GET) | ||
29 | - public ResultJson startActivityDemo(@RequestParam(value = "pageNum", required = false, defaultValue = "1") | ||
30 | - int pageNum, | ||
31 | - @RequestParam(value = "pageSize", required = false, defaultValue = "5") | ||
32 | - int pageSize, | ||
33 | - @RequestParam(value = "processName", required = false) | ||
34 | - String adrname, | ||
35 | - @RequestParam(value = "parent", required = false) | ||
36 | - int parent) { | ||
37 | - Page<Location> page = PageHelper.startPage(pageNum, pageSize); | ||
38 | - List<Location> list = null; | ||
39 | - if (StringUtils.isEmpty(adrname)) { | ||
40 | - list = locationMapper.selectAll(parent); | ||
41 | - if (parent == 0) { | ||
42 | - Location location = list.get(0); | ||
43 | - List<Location> locationsList = locationMapper.selectAll(location.getId()); | ||
44 | - for (Location loc : list) { | ||
45 | - loc.setChildren(locationsList); | ||
46 | - } | ||
47 | - } | ||
48 | - | ||
49 | - } else { | ||
50 | - list = locationMapper.selectAllAdrName(adrname); | ||
51 | - } | ||
52 | - | ||
53 | - PageInfo<Location> result = new PageInfo<Location>(list); | ||
54 | - return new ResultJson("200", "success", result); | ||
55 | - } | ||
56 | - | ||
57 | - @ApiOperation(value = "新增楼层") | ||
58 | - @PostMapping(value = "/add") | ||
59 | - public ResultJson addLocation(@RequestParam("adrName") String adrName, | ||
60 | - @RequestParam("parent") Integer parent, | ||
61 | - @RequestParam("type") Integer type) { | ||
62 | - | ||
63 | - ResultJson resultJson = new ResultJson(); | ||
64 | - Location location = new Location(); | ||
65 | - Map map = new HashMap(); | ||
66 | - map.put("adrName", adrName); | ||
67 | - map.put("parent", parent); | ||
68 | - if (locationMapper.countAdrName(map) > 0) { | ||
69 | - resultJson.setCode("201"); | ||
70 | - } else { | ||
71 | - | ||
72 | - location.setParent(parent); | ||
73 | - location.setType(type); | ||
74 | - location.setAdrname(adrName); | ||
75 | - | ||
76 | - if (locationMapper.insertSelective(location) > 0) { | ||
77 | - resultJson.setCode("200"); | ||
78 | - } else { | ||
79 | - resultJson.setCode("202"); | ||
80 | - } | ||
81 | - } | ||
82 | - | ||
83 | - return resultJson; | ||
84 | - } | ||
85 | - | ||
86 | - @ApiOperation(value = "删除楼层") | ||
87 | - @DeleteMapping(value = "/del") | ||
88 | - public ResultJson delLocation(@RequestBody Location location) { | ||
89 | - | ||
90 | - ResultJson resultJson = new ResultJson(); | ||
91 | - | ||
92 | - if (locationMapper.countParent(location.getId()) > 0) { | ||
93 | - resultJson.setCode("201"); | ||
94 | - return resultJson; | ||
95 | - } else { | ||
96 | - | ||
97 | - if (locationMapper.deleteByPrimaryKey(location.getId()) > 0) { | ||
98 | - resultJson.setCode("200"); | ||
99 | - return resultJson; | ||
100 | - } else { | ||
101 | - resultJson.setCode("201"); | ||
102 | - return resultJson; | ||
103 | - } | ||
104 | - } | ||
105 | - } | ||
106 | - | ||
107 | - @ApiOperation(value = "修改楼层") | ||
108 | - @PutMapping(value = "/edit") | ||
109 | - public ResultJson editLocation(@RequestBody Location location) { | ||
110 | - | ||
111 | - ResultJson resultJson = new ResultJson(); | ||
112 | - | ||
113 | - if (locationMapper.updateByPrimaryKeySelective(location) > 0) { | ||
114 | - resultJson.setCode("200"); | ||
115 | - } else { | ||
116 | - resultJson.setCode("201"); | ||
117 | - } | ||
118 | - | ||
119 | - return resultJson; | ||
120 | - } | ||
121 | -} |
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | -import com.github.pagehelper.PageInfo; | ||
4 | -import com.google.gson.internal.$Gson$Preconditions; | ||
5 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
6 | -import com.sunyo.energy.location.dao.LocationMapper; | ||
7 | -import com.sunyo.energy.location.dao.PayRecordsMapper; | ||
8 | -import com.sunyo.energy.location.model.Location; | ||
9 | -import com.sunyo.energy.location.model.PayRecords; | ||
10 | -import com.sunyo.energy.location.service.ElectricityMeterService; | ||
11 | -import com.sunyo.energy.location.service.PayOrderService; | ||
12 | -import com.sunyo.energy.location.service.WaterMeterService; | ||
13 | -import io.swagger.annotations.Api; | ||
14 | -import io.swagger.annotations.ApiOperation; | ||
15 | -import io.swagger.models.auth.In; | ||
16 | -import org.springframework.beans.factory.annotation.Autowired; | ||
17 | -import org.springframework.util.StringUtils; | ||
18 | -import org.springframework.web.bind.annotation.*; | ||
19 | - | ||
20 | -/** | ||
21 | - * Created by XYH on 2019/12/16. | ||
22 | - * 订单查询,新增,更新,删除 | ||
23 | - */ | ||
24 | -@Api(description = "订单管理") | ||
25 | -@RestController | ||
26 | -@RequestMapping("/order") | ||
27 | -public class PayOrderController { | ||
28 | - | ||
29 | - @Autowired | ||
30 | - PayOrderService payOrderService; | ||
31 | - | ||
32 | - @Autowired | ||
33 | - PayRecordsMapper payRecordsMapper; | ||
34 | - | ||
35 | - @Autowired | ||
36 | - ElectricityMeterService electricityMeterService; | ||
37 | - | ||
38 | - @Autowired | ||
39 | - private WaterMeterService waterMeterService; | ||
40 | - | ||
41 | - @Autowired | ||
42 | - private LocationMapper locationMapper; | ||
43 | - | ||
44 | - @ApiOperation(value = "查询缴费订单") | ||
45 | - @RequestMapping("/list") | ||
46 | - public PageInfo<PayRecords> getOrder(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize, | ||
47 | - @RequestParam(value = "pageNum", required = false, defaultValue = "5") int pageNum, | ||
48 | - @RequestParam(value = "orderNumber", required = false) String orderNumber, | ||
49 | - @RequestParam(value = "payTime", required = false) String payTime, | ||
50 | - @RequestParam(value = "username", required = false) String username, | ||
51 | - @RequestParam(value = "payType", required = false) String payType) { | ||
52 | - PageInfo<PayRecords> order = payOrderService.getOrder(pageSize, pageNum, orderNumber, payTime, username, payType); | ||
53 | - return order; | ||
54 | - } | ||
55 | - | ||
56 | - | ||
57 | - @ApiOperation(value = "新增缴费订单") | ||
58 | - @PostMapping("/add") | ||
59 | - public ResultJson addOrder(@RequestBody PayRecords records) { | ||
60 | - int mgs = 0; | ||
61 | - int result = payOrderService.addOrder(records); | ||
62 | - if (result > 0) { | ||
63 | - mgs = 1; | ||
64 | - } | ||
65 | - return mgs == 1 ? new ResultJson("200", "新增订单成功") : new ResultJson("500", "新增订单失败"); | ||
66 | - } | ||
67 | - | ||
68 | - | ||
69 | - @ApiOperation(value = "更新缴费订单") | ||
70 | - @PutMapping("/edi") | ||
71 | - public ResultJson ediOrder(@RequestBody PayRecords records) { | ||
72 | - int mgs = 0; | ||
73 | - int result = payOrderService.ediOrder(records); | ||
74 | - if (result > 0) { | ||
75 | - mgs = 1; | ||
76 | - } | ||
77 | - return mgs == 1 ? new ResultJson("200", "订单信息更新成功") : new ResultJson("500", "订单信息更新失败"); | ||
78 | - } | ||
79 | - | ||
80 | - | ||
81 | - @ApiOperation(value = "删除缴费订单") | ||
82 | - @DeleteMapping("/del") | ||
83 | - public ResultJson delOrder(@RequestBody PayRecords payRecords) { | ||
84 | - int mgs = 0; | ||
85 | - int result = payOrderService.delOrder(payRecords); | ||
86 | - if (result > 0) { | ||
87 | - mgs = 1; | ||
88 | - } | ||
89 | - return mgs == 1 ? new ResultJson("200", "订单信息移出成功") : new ResultJson("500", "订单信息删除失败"); | ||
90 | - } | ||
91 | - | ||
92 | - @ApiOperation(value = "处理失败订单充值信息") | ||
93 | - @PostMapping("/defeatedOrder") | ||
94 | - public ResultJson defeatedOrder(@RequestBody PayRecords payRecords){ | ||
95 | - | ||
96 | - /** | ||
97 | - * 查询水电表编号 | ||
98 | - */ | ||
99 | - Location location = locationMapper.waterId_eleId(payRecords.getPaylocationname()); | ||
100 | - /** | ||
101 | - * 支付状态 充值状态满足条件进入否则不操作 | ||
102 | - */ | ||
103 | - if (payRecords.getPaystatus() == true && "0".equals(payRecords.getReamke3())){ | ||
104 | - /** | ||
105 | - * true 为电 false 为水 | ||
106 | - */ | ||
107 | - if (payRecords.getPaytype()){ | ||
108 | - int i = electricityMeterService.rechargeDevices(location.getEeid(), String.valueOf(payRecords.getPayfees()), | ||
109 | - "0", payRecords.getOrdernumber()); | ||
110 | - if (i == 1){ | ||
111 | - payRecords.setReamke3("1"); | ||
112 | - int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
113 | - return i1 == 1? new ResultJson("200", "电费充值成功"): new ResultJson("201", "电费充值失败"); | ||
114 | - }else { | ||
115 | - return new ResultJson("201", "电费充值失败"); | ||
116 | - } | ||
117 | - }else { | ||
118 | - ResultJson resultJson = waterMeterService.payWater(String.valueOf(payRecords.getPayfees()), location.getWmid()); | ||
119 | - | ||
120 | - if ("200".equals(resultJson.getCode())){ | ||
121 | - payRecords.setReamke3("1"); | ||
122 | - int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
123 | - return i1 == 1? new ResultJson("200", "水费充值成功"): new ResultJson("201", "水费充值失败"); | ||
124 | - }else { | ||
125 | - resultJson.setCode("201"); | ||
126 | - return resultJson; | ||
127 | - } | ||
128 | - } | ||
129 | - }else { | ||
130 | - | ||
131 | - return new ResultJson("201", "充值失败"); | ||
132 | - } | ||
133 | - } | ||
134 | - | ||
135 | -} |
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | -import com.alibaba.fastjson.JSONObject; | ||
4 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
5 | -import com.sunyo.energy.location.dao.PayRecordsMapper; | ||
6 | -import com.sunyo.energy.location.dao.PayResponseMapper; | ||
7 | -import com.sunyo.energy.location.model.PayRecords; | ||
8 | -import com.sunyo.energy.location.model.PayResponse; | ||
9 | -import com.sunyo.energy.location.service.ElectricityMeterService; | ||
10 | -import com.sunyo.energy.location.service.WaterMeterService; | ||
11 | -import com.sunyo.energy.location.websocket.WebSocketServer; | ||
12 | -import io.swagger.annotations.ApiOperation; | ||
13 | -import lombok.extern.slf4j.Slf4j; | ||
14 | -import org.springframework.beans.factory.annotation.Autowired; | ||
15 | -import org.springframework.stereotype.Controller; | ||
16 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
17 | -import org.springframework.web.bind.annotation.RequestParam; | ||
18 | -import org.springframework.web.bind.annotation.ResponseBody; | ||
19 | - | ||
20 | -import java.io.IOException; | ||
21 | -import java.math.BigDecimal; | ||
22 | -import java.util.Date; | ||
23 | -import java.util.UUID; | ||
24 | - | ||
25 | -@Slf4j | ||
26 | -@RequestMapping("/payCode") | ||
27 | -public class PayRseponeController { | ||
28 | - | ||
29 | - | ||
30 | - @Autowired | ||
31 | - private PayResponseMapper payResponseMapperl; | ||
32 | - | ||
33 | - @Autowired | ||
34 | - private WaterMeterService waterMeterService; | ||
35 | - | ||
36 | - @Autowired | ||
37 | - private PayRecordsMapper payRecordsMapper; | ||
38 | - | ||
39 | - @Autowired | ||
40 | - ElectricityMeterService electricityMeterService; | ||
41 | - | ||
42 | - /** | ||
43 | - * 接受字段 | ||
44 | - * | ||
45 | - * @param POSID 商户柜台代码 | ||
46 | - * @param BRANCHID 分行代码 | ||
47 | - * @param ORDERID 定单号 | ||
48 | - * @param PAYMENT 付款金额 | ||
49 | - * @param CURCODE 币种 | ||
50 | - * @param REMARK1 备注一 | ||
51 | - * @param REMARK2 备注二 | ||
52 | - * @param ACC_TYPE 账户类型 | ||
53 | - * @param SUCCESS 成功标志 | ||
54 | - * @param TYPE 接口类型 | ||
55 | - * @param REFERER Referer信息 | ||
56 | - * @param CLIENTIP 客户端IP | ||
57 | - * @param ACCDATE 系统记账日期 | ||
58 | - * @param USRMSG 支付账户信息 | ||
59 | - * @param USRINFO 客户加密信息 | ||
60 | - * @param PAYTYPE 支付方式 | ||
61 | - * @param SIGN 数字签名 | ||
62 | - */ | ||
63 | - @RequestMapping(value = "/payResponse") | ||
64 | - @ApiOperation(value = "支付回执是否成功") | ||
65 | - @ResponseBody | ||
66 | - public ResultJson payCodeRsepone(@RequestParam(value = "POSID", required = false) String POSID, | ||
67 | - @RequestParam(value = "BRANCHID", required = false) String BRANCHID, | ||
68 | - @RequestParam(value = "ORDERID", required = false) String ORDERID, | ||
69 | - @RequestParam(value = "PAYMENT", required = false) String PAYMENT, | ||
70 | - @RequestParam(value = "CURCODE", required = false) String CURCODE, | ||
71 | - @RequestParam(value = "REMARK1", required = false) String REMARK1, | ||
72 | - @RequestParam(value = "REMARK2", required = false) String REMARK2, | ||
73 | - @RequestParam(value = "ACC_TYPE", required = false) String ACC_TYPE, | ||
74 | - @RequestParam(value = "SUCCESS", required = false) String SUCCESS, | ||
75 | - @RequestParam(value = "TYPE", required = false) String TYPE, | ||
76 | - @RequestParam(value = "REFERER", required = false) String REFERER, | ||
77 | - @RequestParam(value = "CLIENTIP", required = false) String CLIENTIP, | ||
78 | - @RequestParam(value = "ACCDATE", required = false) String ACCDATE, | ||
79 | - @RequestParam(value = "USRMSG", required = false) String USRMSG, | ||
80 | - @RequestParam(value = "USRINFO", required = false) String USRINFO, | ||
81 | - @RequestParam(value = "PAYTYPE", required = false) String PAYTYPE, | ||
82 | - @RequestParam(value = "SIGN", required = false) String SIGN){ | ||
83 | - | ||
84 | - PayResponse payResponse = new PayResponse(); | ||
85 | - payResponse.setId(UUID.randomUUID().toString()); | ||
86 | - payResponse.setPosid(POSID); | ||
87 | - payResponse.setBranchid(BRANCHID); | ||
88 | - payResponse.setOrderid(ORDERID); | ||
89 | - payResponse.setPayment(new BigDecimal(PAYMENT)); | ||
90 | - payResponse.setCurcode(CURCODE); | ||
91 | - payResponse.setRemark1(REMARK1); | ||
92 | - payResponse.setRemark2(REMARK2); | ||
93 | - payResponse.setAccType(ACC_TYPE); | ||
94 | - payResponse.setSuccess(SUCCESS); | ||
95 | - payResponse.setType(TYPE); | ||
96 | - payResponse.setReferer(REFERER); | ||
97 | - payResponse.setClientip(CLIENTIP); | ||
98 | - payResponse.setAccdate(new Date()); | ||
99 | - payResponse.setUsrmsg(USRMSG); | ||
100 | - payResponse.setUsrinfo(USRINFO); | ||
101 | - payResponse.setPaytype(PAYTYPE); | ||
102 | - payResponse.setSign(SIGN); | ||
103 | - try { | ||
104 | - int msg = 0; | ||
105 | - int i = payResponseMapperl.insertSelective(payResponse); | ||
106 | - if (i > 0) { | ||
107 | - msg = 1; | ||
108 | - PayRecords payRecords = new PayRecords(); | ||
109 | - // 支付类型 | ||
110 | - if (!"".equals(ACC_TYPE)) { | ||
111 | - if ("WX".equals(ACC_TYPE)) { | ||
112 | - payRecords.setPayfesstype(false); | ||
113 | - } else { | ||
114 | - payRecords.setPayfesstype(true); | ||
115 | - } | ||
116 | - | ||
117 | - } | ||
118 | - if ("Y".equals(SUCCESS)) { | ||
119 | - payRecords.setOrdernumber(ORDERID); | ||
120 | - payRecords.setReamke3("1"); | ||
121 | - } else { | ||
122 | - payRecords.setOrdernumber(ORDERID); | ||
123 | - payRecords.setReamke3("0"); | ||
124 | - } | ||
125 | - | ||
126 | - // 查询是水还是电 | ||
127 | - boolean selectType = payRecordsMapper.selectType(ORDERID); | ||
128 | - if (selectType) { | ||
129 | - // 查询该订单设备编号 | ||
130 | - String eeId = payRecordsMapper.findOrderNumber(ORDERID); | ||
131 | - if (!"".equals(eeId)) { | ||
132 | - // 通知充值电费 | ||
133 | - int eeResult = electricityMeterService.rechargeDevices(eeId, PAYMENT, "0", ORDERID); | ||
134 | - if (eeResult > 0) { | ||
135 | - // 修改订单状态 | ||
136 | - int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
137 | - if (i1 > 0) { | ||
138 | - WebSocketServer webSocketServer = new WebSocketServer(); | ||
139 | - JSONObject jsonObject = new JSONObject(); | ||
140 | - jsonObject.put("orderNumber", ORDERID); | ||
141 | - jsonObject.put("success", "Y"); | ||
142 | - webSocketServer.broadcast(jsonObject.toJSONString()); | ||
143 | - } else { | ||
144 | - WebSocketServer webSocketServer = new WebSocketServer(); | ||
145 | - JSONObject jsonObject = new JSONObject(); | ||
146 | - jsonObject.put("orderNumber", ORDERID); | ||
147 | - jsonObject.put("success", "N"); | ||
148 | - webSocketServer.broadcast(jsonObject.toJSONString()); | ||
149 | - } | ||
150 | - } else { | ||
151 | - WebSocketServer webSocketServer = new WebSocketServer(); | ||
152 | - JSONObject jsonObject = new JSONObject(); | ||
153 | - jsonObject.put("orderNumber", ORDERID); | ||
154 | - jsonObject.put("success", "S"); | ||
155 | - webSocketServer.broadcast(jsonObject.toJSONString()); | ||
156 | - } | ||
157 | - } | ||
158 | - } else { | ||
159 | - // 查询该订单设备编号 | ||
160 | - String wmId = payRecordsMapper.findOrderNumber(ORDERID); | ||
161 | - // 通知充值水费 | ||
162 | - if (!"".equals(wmId)) { | ||
163 | - ResultJson resultJson = waterMeterService.payWater(PAYMENT, wmId); | ||
164 | - if ("200".equals(resultJson.getCode())) { | ||
165 | - // 修改订单状态 | ||
166 | - int i1 = payRecordsMapper.updateByPrimaryKey(payRecords); | ||
167 | - if (i1 > 0) { | ||
168 | - WebSocketServer webSocketServer = new WebSocketServer(); | ||
169 | - JSONObject jsonObject = new JSONObject(); | ||
170 | - jsonObject.put("orderNumber", ORDERID); | ||
171 | - jsonObject.put("success", "Y"); | ||
172 | - webSocketServer.broadcast(jsonObject.toJSONString()); | ||
173 | - } else { | ||
174 | - WebSocketServer webSocketServer = new WebSocketServer(); | ||
175 | - JSONObject jsonObject = new JSONObject(); | ||
176 | - jsonObject.put("orderNumber", ORDERID); | ||
177 | - jsonObject.put("success", "N"); | ||
178 | - webSocketServer.broadcast(jsonObject.toJSONString()); | ||
179 | - } | ||
180 | - } else { | ||
181 | - WebSocketServer webSocketServer = new WebSocketServer(); | ||
182 | - JSONObject jsonObject = new JSONObject(); | ||
183 | - jsonObject.put("orderNumber", ORDERID); | ||
184 | - jsonObject.put("success", "N"); | ||
185 | - webSocketServer.broadcast(jsonObject.toJSONString()); | ||
186 | - } | ||
187 | - } | ||
188 | - } | ||
189 | - | ||
190 | - } | ||
191 | - return i == 1 ? new ResultJson("200", "支付回执信息接受成功") : new ResultJson("500", "支付回执信息接受失败"); | ||
192 | - }catch (Exception e){ | ||
193 | - e.printStackTrace(); | ||
194 | - log.info("系统异常--------------------"); | ||
195 | - return null; | ||
196 | - } | ||
197 | - | ||
198 | - } | ||
199 | - | ||
200 | -} |
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
4 | -import com.sunyo.energy.location.dao.LocationMapper; | ||
5 | -import com.sunyo.energy.location.service.LocationService; | ||
6 | -import com.sunyo.energy.location.service.WaterMeterService; | ||
7 | -import io.swagger.annotations.Api; | ||
8 | -import io.swagger.annotations.ApiOperation; | ||
9 | -import org.springframework.beans.factory.annotation.Autowired; | ||
10 | -import org.springframework.web.bind.annotation.PostMapping; | ||
11 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | -import org.springframework.web.bind.annotation.RequestParam; | ||
13 | -import org.springframework.web.bind.annotation.RestController; | ||
14 | - | ||
15 | -import java.io.UnsupportedEncodingException; | ||
16 | -import java.util.HashMap; | ||
17 | -import java.util.List; | ||
18 | -import java.util.Map; | ||
19 | - | ||
20 | -@Api(description = "用户支付管理") | ||
21 | -@RestController | ||
22 | -@RequestMapping("/userPayOrder") | ||
23 | -public class UserPayController { | ||
24 | - | ||
25 | - @Autowired | ||
26 | - private LocationService locationService; | ||
27 | - | ||
28 | - @Autowired | ||
29 | - private WaterMeterService waterMeterService; | ||
30 | - | ||
31 | - @Autowired | ||
32 | - private LocationMapper locationMapper; | ||
33 | - | ||
34 | - @ApiOperation(value = "查看缴费房间") | ||
35 | - @RequestMapping("/list") | ||
36 | - public List userPayList(@RequestParam(value = "roomNumber", required = false) String roomNumber) { | ||
37 | - | ||
38 | - return locationService.userPayList(roomNumber); | ||
39 | - } | ||
40 | - | ||
41 | - @ApiOperation(value = "充值水费") | ||
42 | - @PostMapping("/add") | ||
43 | - public ResultJson payWater(@RequestParam(value = "payFees", required = false) String payFees, | ||
44 | - @RequestParam(value = "wmId", required = false) String wmId) { | ||
45 | - | ||
46 | - return waterMeterService.payWater(payFees, wmId); | ||
47 | - } | ||
48 | - | ||
49 | - @ApiOperation(value = "请求返回二维码") | ||
50 | - @PostMapping("/qrCode") | ||
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 { | ||
56 | - | ||
57 | - ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName, eeId); | ||
58 | - return resultJson; | ||
59 | - } | ||
60 | - | ||
61 | - @ApiOperation(value = "钉钉小程序请求水电返回数据") | ||
62 | - @PostMapping("/mincData") | ||
63 | - public Map<String, Object> mincData(@RequestParam(value = "loginName", required = false) String loginName) { | ||
64 | - | ||
65 | - Map<String, Object> map = new HashMap<>(); | ||
66 | - /** | ||
67 | - * 查询该账号所绑定的水电编号 | ||
68 | - */ | ||
69 | - | ||
70 | - | ||
71 | - return map; | ||
72 | - } | ||
73 | - | ||
74 | -} |
1 | -package com.sunyo.energy.location.controller; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
4 | -import com.sunyo.energy.location.model.WaterMeter; | ||
5 | -import com.sunyo.energy.location.service.WaterMeterService; | ||
6 | -import io.swagger.annotations.ApiOperation; | ||
7 | -import org.springframework.beans.factory.annotation.Autowired; | ||
8 | -import org.springframework.stereotype.Controller; | ||
9 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
10 | -import org.springframework.web.bind.annotation.RequestParam; | ||
11 | -import org.springframework.web.bind.annotation.ResponseBody; | ||
12 | - | ||
13 | -@Controller | ||
14 | -@RequestMapping("/water_meter") | ||
15 | -public class WaterMeterController { | ||
16 | - | ||
17 | - @Autowired | ||
18 | - private WaterMeterService waterMeterService; | ||
19 | - | ||
20 | - | ||
21 | - @ApiOperation(value = "水表单个实施信息查询") | ||
22 | - @RequestMapping("/findRealTime") | ||
23 | - @ResponseBody | ||
24 | - public WaterMeter findRealTime(@RequestParam(value = "wmId", required = false) String wmId) { | ||
25 | - | ||
26 | - return waterMeterService.findRealTime(wmId); | ||
27 | - } | ||
28 | - | ||
29 | - @ApiOperation(value = "查询所有水表编号") | ||
30 | - @RequestMapping("/waterMeterAll") | ||
31 | - @ResponseBody | ||
32 | - public ResultJson waterMeterAll(@RequestParam(value = "wmId", required = false) String wmId) { | ||
33 | - | ||
34 | - return waterMeterService.waterMeterAll(wmId); | ||
35 | - } | ||
36 | - | ||
37 | - | ||
38 | - @RequestMapping("/realTime") | ||
39 | - @ResponseBody | ||
40 | - public int realTime() { | ||
41 | - | ||
42 | - return waterMeterService.realTime(); | ||
43 | - } | ||
44 | - | ||
45 | - | ||
46 | -} |
src/main/java/com/sunyo/energy/location/controller/response/RestControllerResponseAdvice.java
已删除
100644 → 0
1 | -package com.sunyo.energy.location.controller.response; | ||
2 | - | ||
3 | -import com.alibaba.fastjson.JSON; | ||
4 | -import org.springframework.core.MethodParameter; | ||
5 | -import org.springframework.http.MediaType; | ||
6 | -import org.springframework.http.converter.HttpMessageConverter; | ||
7 | -import org.springframework.http.server.ServerHttpRequest; | ||
8 | -import org.springframework.http.server.ServerHttpResponse; | ||
9 | -import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; | ||
10 | - | ||
11 | -/** | ||
12 | - * 统一拦截response接口返回数据 | ||
13 | - */ | ||
14 | -//@ControllerAdvice | ||
15 | -public class RestControllerResponseAdvice implements ResponseBodyAdvice<Object> { | ||
16 | - | ||
17 | - /** | ||
18 | - * //判断支持的类型,因为我们定义的BaseResponseVo 里面的data可能是任何类型,这里就不判断统一放过 | ||
19 | - * 如果你想对执行的返回体进行操作,可将上方的Object换成你自己的类型 | ||
20 | - * | ||
21 | - * @param returnType | ||
22 | - * @param converterType | ||
23 | - * @return | ||
24 | - */ | ||
25 | - @Override | ||
26 | - public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) { | ||
27 | - return true; | ||
28 | - } | ||
29 | - | ||
30 | - @Override | ||
31 | - public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) { | ||
32 | - // 对body进行封装处理 | ||
33 | - if (body instanceof String) { | ||
34 | - String msg = (String) body; | ||
35 | - ResultJson resultJson = new ResultJson("-1", msg); | ||
36 | - // 因为在controller层中返回的是String类型,这边如果换成ResultJson的话,会导致StringMessageConverter方法类型转换异常,所以这边将对象转成字符串 | ||
37 | - return JSON.toJSONString(resultJson); | ||
38 | - } else if (body instanceof Object) { | ||
39 | - Object data = (Object) body; | ||
40 | - ResultJson resultJson = new ResultJson(data); | ||
41 | - return resultJson; | ||
42 | - } | ||
43 | - | ||
44 | - return body; | ||
45 | - } | ||
46 | -} |
1 | -package com.sunyo.energy.location.controller.response; | ||
2 | - | ||
3 | -import lombok.Data; | ||
4 | - | ||
5 | -import java.io.Serializable; | ||
6 | - | ||
7 | -@Data | ||
8 | -public class ResultJson<T> implements Serializable { | ||
9 | - private static final long serialVersionUID = 1L; | ||
10 | - | ||
11 | - // 状态码 正确为200 | ||
12 | - private String code = "200"; | ||
13 | - // 描述 | ||
14 | - private String msg = ""; | ||
15 | - | ||
16 | - private String error; | ||
17 | - // 返回对象 | ||
18 | - private T data; | ||
19 | - //返回的JWT | ||
20 | - private String jwtToken; | ||
21 | - | ||
22 | - public ResultJson() { | ||
23 | - } | ||
24 | - | ||
25 | - public ResultJson(String code) { | ||
26 | - this.code = code; | ||
27 | - } | ||
28 | - | ||
29 | - public ResultJson(String code, String msg) { | ||
30 | - this.code = code; | ||
31 | - this.msg = msg; | ||
32 | - } | ||
33 | - | ||
34 | - public ResultJson(T data) { | ||
35 | - this.data = data; | ||
36 | - } | ||
37 | - | ||
38 | - public ResultJson(String code, String msg, T data) { | ||
39 | - this.code = code; | ||
40 | - this.msg = msg; | ||
41 | - this.data = data; | ||
42 | - } | ||
43 | -} |
1 | -package com.sunyo.energy.location.dao; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.model.Location; | ||
4 | -import io.swagger.models.auth.In; | ||
5 | -import org.apache.ibatis.annotations.Param; | ||
6 | - | ||
7 | -import java.util.List; | ||
8 | -import java.util.Map; | ||
9 | - | ||
10 | -public interface LocationMapper { | ||
11 | - int deleteByPrimaryKey(Integer id); | ||
12 | - | ||
13 | - int insert(Location record); | ||
14 | - | ||
15 | - int insertSelective(Location record); | ||
16 | - | ||
17 | - List<Location> selectByPrimaryKey(Integer id); | ||
18 | - | ||
19 | - List<Location> selectAll(Integer id); | ||
20 | - | ||
21 | - List<Location> selectAllAdrName(String adrName); | ||
22 | - | ||
23 | - Location waterId_eleId(String adrName); | ||
24 | - | ||
25 | - int updateByPrimaryKeySelective(Location record); | ||
26 | - | ||
27 | - int updateByPrimaryKey(Location record); | ||
28 | - | ||
29 | - Map<String, Object> userPayList(String roomNumber); | ||
30 | - | ||
31 | - String selectRoomNumber(String roomNumber); | ||
32 | - | ||
33 | - String selectRoomNumberElectricity(String roomNumber); | ||
34 | - | ||
35 | - int countAdrName(Map<String, Object> map); | ||
36 | - | ||
37 | - int countParent(Integer id); | ||
38 | - | ||
39 | - String findWmId(String roomNumber); | ||
40 | - | ||
41 | - String eeId(String roomNumber); | ||
42 | - | ||
43 | - int editEeId(@Param(value = "name") String name, | ||
44 | - @Param(value = "deviceId") String deviceId); | ||
45 | - | ||
46 | -} |
1 | -package com.sunyo.energy.location.dao; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.model.PayResponse; | ||
4 | - | ||
5 | -public interface PayResponseMapper { | ||
6 | - int deleteByPrimaryKey(String id); | ||
7 | - | ||
8 | - int insert(PayResponse record); | ||
9 | - | ||
10 | - int insertSelective(PayResponse record); | ||
11 | - | ||
12 | - PayResponse selectByPrimaryKey(String id); | ||
13 | - | ||
14 | - int updateByPrimaryKeySelective(PayResponse record); | ||
15 | - | ||
16 | - int updateByPrimaryKey(PayResponse record); | ||
17 | -} |
1 | -package com.sunyo.energy.location.dao; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.model.USERS; | ||
4 | - | ||
5 | -public interface USERSMapper { | ||
6 | - int deleteByPrimaryKey(Integer userId); | ||
7 | - | ||
8 | - int insert(USERS record); | ||
9 | - | ||
10 | - int insertSelective(USERS record); | ||
11 | - | ||
12 | - USERS selectByPrimaryKey(Integer userId); | ||
13 | - | ||
14 | - int updateByPrimaryKeySelective(USERS record); | ||
15 | - | ||
16 | - int updateByPrimaryKey(USERS record); | ||
17 | -} |
1 | -package com.sunyo.energy.location.dao; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.model.WaterElectricityParameter; | ||
4 | - | ||
5 | -import java.util.List; | ||
6 | - | ||
7 | -public interface WaterElectricityParameterMapper { | ||
8 | - int deleteByPrimaryKey(Integer id); | ||
9 | - | ||
10 | - int insert(WaterElectricityParameter record); | ||
11 | - | ||
12 | - int insertSelective(WaterElectricityParameter record); | ||
13 | - | ||
14 | - WaterElectricityParameter selectByPrimaryKey(Integer id); | ||
15 | - | ||
16 | - int updateByPrimaryKeySelective(WaterElectricityParameter record); | ||
17 | - | ||
18 | - int updateByPrimaryKey(WaterElectricityParameter record); | ||
19 | - | ||
20 | - int countOne(String eeId); | ||
21 | - | ||
22 | - WaterElectricityParameter findOneElectricity(String eeId); | ||
23 | - | ||
24 | - | ||
25 | -} |
1 | -package com.sunyo.energy.location.dao; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.model.WaterMeter; | ||
4 | -import org.apache.ibatis.annotations.Param; | ||
5 | - | ||
6 | -import java.util.List; | ||
7 | - | ||
8 | -public interface WaterMeterMapper { | ||
9 | - | ||
10 | - List<WaterMeter> waterMeterAll(String wmId); | ||
11 | - | ||
12 | - int insert(WaterMeter record); | ||
13 | - | ||
14 | - int insertSelective(WaterMeter record); | ||
15 | - | ||
16 | - List<WaterMeter> selectAll(); | ||
17 | - | ||
18 | - String findOneWmSacc(String wmId); | ||
19 | - | ||
20 | - int update(@Param(value = "wmId") String wmId, | ||
21 | - @Param(value = "allSacc") String allSacc); | ||
22 | -} |
1 | -package com.sunyo.energy.location.demopay; | ||
2 | - | ||
3 | - | ||
4 | -import java.io.IOException; | ||
5 | -import java.util.Iterator; | ||
6 | -import java.util.Map; | ||
7 | - | ||
8 | -import org.apache.commons.httpclient.HttpClient; | ||
9 | -import org.apache.commons.httpclient.HttpException; | ||
10 | -import org.apache.commons.httpclient.HttpStatus; | ||
11 | -import org.apache.commons.httpclient.NameValuePair; | ||
12 | -import org.apache.commons.httpclient.methods.GetMethod; | ||
13 | -import org.apache.commons.httpclient.methods.PostMethod; | ||
14 | -import org.apache.commons.httpclient.params.HttpMethodParams; | ||
15 | -import org.apache.commons.logging.Log; | ||
16 | -import org.apache.commons.logging.LogFactory; | ||
17 | - | ||
18 | -public class HttpClientUtil { | ||
19 | - | ||
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 | - } | ||
132 | -} |
1 | -package com.sunyo.energy.location.demopay; | ||
2 | - | ||
3 | -import java.io.*; | ||
4 | -import java.security.*; | ||
5 | - | ||
6 | -public class MD5 { | ||
7 | - | ||
8 | - public static String md5Str(String str) { | ||
9 | - if (str == null) return ""; | ||
10 | - return md5Str(str, 0); | ||
11 | - } | ||
12 | - | ||
13 | - | ||
14 | - /** | ||
15 | - * ������ϢժҪ�� | ||
16 | - * | ||
17 | - * @param data ����ժҪ�����ݡ� | ||
18 | - * @param offset ����ƫ�Ƶ�ַ�� | ||
19 | - * @param length ���ݳ��ȡ� | ||
20 | - * @return ժҪ�����(16�ֽ�) | ||
21 | - */ | ||
22 | - public static String md5Str(String str, int offset) { | ||
23 | - try { | ||
24 | - MessageDigest md5 = MessageDigest.getInstance("MD5"); | ||
25 | - byte[] b = str.getBytes("UTF8"); | ||
26 | - md5.update(b, offset, b.length); | ||
27 | - return byteArrayToHexString(md5.digest()); | ||
28 | - } catch (NoSuchAlgorithmException ex) { | ||
29 | - ex.printStackTrace(); | ||
30 | - return null; | ||
31 | - } catch (UnsupportedEncodingException ex) { | ||
32 | - ex.printStackTrace(); | ||
33 | - return null; | ||
34 | - } | ||
35 | - } | ||
36 | - | ||
37 | - /** | ||
38 | - * @param b byte[] | ||
39 | - * @return String | ||
40 | - */ | ||
41 | - public static String byteArrayToHexString(byte[] b) { | ||
42 | - String result = ""; | ||
43 | - for (int i = 0; i < b.length; i++) { | ||
44 | - result += byteToHexString(b[i]); | ||
45 | - } | ||
46 | - return result; | ||
47 | - } | ||
48 | - | ||
49 | - private static String[] hexDigits = | ||
50 | - { | ||
51 | - "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", | ||
52 | - "c", "d", "e", "f"}; | ||
53 | - | ||
54 | - /** | ||
55 | - * ���ֽ�ת��Ϊ��Ӧ��16�������� | ||
56 | - * | ||
57 | - * @param b byte | ||
58 | - * @return String | ||
59 | - */ | ||
60 | - public static String byteToHexString(byte b) { | ||
61 | - int n = b; | ||
62 | - if (n < 0) { | ||
63 | - n = 256 + n; | ||
64 | - } | ||
65 | - int d1 = n / 16; | ||
66 | - int d2 = n % 16; | ||
67 | - return hexDigits[d1] + hexDigits[d2]; | ||
68 | - } | ||
69 | - | ||
70 | - public static void main(String[] args) { | ||
71 | - System.out.println(byteToHexString((byte) -99)); | ||
72 | - String str = | ||
73 | - "eeeeeeeeeeeeeewrw213123122222222222222222222222213123213213213erwer"; | ||
74 | - String ened = MD5.md5Str(str); | ||
75 | - System.out.println(ened.length()); | ||
76 | - System.out.println(ened); | ||
77 | - } | ||
78 | -} | ||
79 | - |
1 | -package com.sunyo.energy.location.demopay; | ||
2 | - | ||
3 | -import java.io.UnsupportedEncodingException; | ||
4 | -import java.net.URLDecoder; | ||
5 | -import java.util.HashMap; | ||
6 | -import java.util.Map; | ||
7 | - | ||
8 | -import com.google.gson.Gson; | ||
9 | -import net.sf.json.JSONObject; | ||
10 | -import org.springframework.beans.factory.annotation.Value; | ||
11 | -import org.springframework.stereotype.Controller; | ||
12 | - | ||
13 | -public class QrDemo { | ||
14 | - | ||
15 | - | ||
16 | - private String MERCHANTIDS; | ||
17 | - | ||
18 | - private String POSIDS; | ||
19 | - | ||
20 | - private String BRANCHIDS; | ||
21 | - | ||
22 | - | ||
23 | - private String TXCODES; | ||
24 | - | ||
25 | - | ||
26 | - private String PUB32TR2S; | ||
27 | - | ||
28 | - public QrDemo(String MERCHANTIDS, String POSIDS, String BRANCHIDS, String TXCODES, String PUB32TR2S) { | ||
29 | - this.MERCHANTIDS = MERCHANTIDS; | ||
30 | - this.POSIDS = POSIDS; | ||
31 | - this.BRANCHIDS = BRANCHIDS; | ||
32 | - this.TXCODES = TXCODES; | ||
33 | - this.PUB32TR2S = PUB32TR2S; | ||
34 | - } | ||
35 | - | ||
36 | - | ||
37 | - public String orUrl(String orderId, String payMent) throws UnsupportedEncodingException { | ||
38 | - String bankURL = "https://ibsbjstar.ccb.com.cn/CCBIS/ccbMain"; | ||
39 | - /** | ||
40 | - * 商户代码 | ||
41 | - */ | ||
42 | - String MERCHANTID = MERCHANTIDS; | ||
43 | - /** | ||
44 | - * 商户柜台代码 | ||
45 | - */ | ||
46 | - String POSID = POSIDS; | ||
47 | - /** | ||
48 | - * 分行代码 | ||
49 | - */ | ||
50 | - String BRANCHID = BRANCHIDS; | ||
51 | - /** | ||
52 | - * 货币种类 01 人民币 只支持人民币 | ||
53 | - */ | ||
54 | - String CURCODE = "01"; | ||
55 | - /** | ||
56 | - * 交易码 | ||
57 | - */ | ||
58 | - String TXCODE = TXCODES; | ||
59 | - String REMARK1 = ""; | ||
60 | - String REMARK2 = ""; | ||
61 | - /** | ||
62 | - * 返回类型 | ||
63 | - */ | ||
64 | - String RETURNTYPE = "3"; | ||
65 | - String TIMEOUT = ""; | ||
66 | - /** | ||
67 | - * 应柜台的公钥后30位 | ||
68 | - */ | ||
69 | - String PUB32TR2 = PUB32TR2S; | ||
70 | - | ||
71 | - StringBuffer tmp = new StringBuffer(); | ||
72 | - tmp.append("MERCHANTID="); | ||
73 | - tmp.append(MERCHANTID); | ||
74 | - tmp.append("&POSID="); | ||
75 | - tmp.append(POSID); | ||
76 | - tmp.append("&BRANCHID="); | ||
77 | - tmp.append(BRANCHID); | ||
78 | - tmp.append("&ORDERID="); | ||
79 | - tmp.append(orderId); | ||
80 | - tmp.append("&PAYMENT="); | ||
81 | - tmp.append(payMent); | ||
82 | - tmp.append("&CURCODE="); | ||
83 | - tmp.append(CURCODE); | ||
84 | - tmp.append("&TXCODE="); | ||
85 | - tmp.append(TXCODE); | ||
86 | - tmp.append("&REMARK1="); | ||
87 | - tmp.append(REMARK1); | ||
88 | - tmp.append("&REMARK2="); | ||
89 | - tmp.append(REMARK2); | ||
90 | - tmp.append("&RETURNTYPE="); | ||
91 | - tmp.append(RETURNTYPE); | ||
92 | - tmp.append("&TIMEOUT="); | ||
93 | - tmp.append(TIMEOUT); | ||
94 | - tmp.append("&PUB="); | ||
95 | - tmp.append(PUB32TR2); | ||
96 | - | ||
97 | - Map map = new HashMap(); | ||
98 | - map.put("CCB_IBSVersion", "V6"); | ||
99 | - map.put("MERCHANTID", MERCHANTID); | ||
100 | - map.put("BRANCHID", BRANCHID); | ||
101 | - map.put("POSID", POSID); | ||
102 | - map.put("ORDERID", orderId); | ||
103 | - map.put("PAYMENT", payMent); | ||
104 | - map.put("CURCODE", CURCODE); | ||
105 | - map.put("TXCODE", TXCODE); | ||
106 | - map.put("REMARK1", REMARK1); | ||
107 | - map.put("REMARK2", REMARK2); | ||
108 | - map.put("RETURNTYPE", RETURNTYPE); | ||
109 | - map.put("TIMEOUT", TIMEOUT); | ||
110 | - map.put("MAC", MD5.md5Str(tmp.toString())); | ||
111 | - | ||
112 | - String ret = HttpClientUtil.httpPost(bankURL, map); | ||
113 | - | ||
114 | - Gson gson = new Gson(); | ||
115 | - QrURLDemo qrurl = (QrURLDemo) gson.fromJson(ret, QrURLDemo.class); | ||
116 | - String rets = HttpClientUtil.httpGet(qrurl.getPAYURL(), "UTF-8"); | ||
117 | - JSONObject jsonObject = JSONObject.fromObject(rets); | ||
118 | - String qrurl1 = URLDecoder.decode(jsonObject.get("QRURL").toString(), "UTF-8"); | ||
119 | - return qrurl1; | ||
120 | - } | ||
121 | -} |
1 | -package com.sunyo.energy.location.demopay; | ||
2 | - | ||
3 | -public class QrORURLDemo { | ||
4 | - | ||
5 | - private String SUCCESS; | ||
6 | - private String ORYURL; | ||
7 | - | ||
8 | - public String getSUCCESS() { | ||
9 | - return SUCCESS; | ||
10 | - } | ||
11 | - | ||
12 | - public void setSUCCESS(String success) { | ||
13 | - SUCCESS = success; | ||
14 | - } | ||
15 | - | ||
16 | - public String getORYURL() { | ||
17 | - return ORYURL; | ||
18 | - } | ||
19 | - | ||
20 | - public void setORYURL(String ORYURL) { | ||
21 | - this.ORYURL = ORYURL; | ||
22 | - } | ||
23 | -} |
1 | -package com.sunyo.energy.location.demopay; | ||
2 | - | ||
3 | -public class QrURLDemo { | ||
4 | - | ||
5 | - private String SUCCESS; | ||
6 | - private String PAYURL; | ||
7 | - | ||
8 | - public String getSUCCESS() { | ||
9 | - return SUCCESS; | ||
10 | - } | ||
11 | - | ||
12 | - public void setSUCCESS(String success) { | ||
13 | - SUCCESS = success; | ||
14 | - } | ||
15 | - | ||
16 | - public String getPAYURL() { | ||
17 | - return PAYURL; | ||
18 | - } | ||
19 | - | ||
20 | - public void setPAYURL(String payurl) { | ||
21 | - PAYURL = payurl; | ||
22 | - } | ||
23 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import lombok.Data; | ||
4 | - | ||
5 | -/** | ||
6 | - * 获取电表余额/实时数据3 | ||
7 | - */ | ||
8 | -@Data | ||
9 | -public class ElectricityBalanceThree { | ||
10 | - | ||
11 | - private Integer deviceId; | ||
12 | - | ||
13 | - private Number totalEnergy; | ||
14 | - | ||
15 | - private Number tipEnergy; | ||
16 | - | ||
17 | - private Number peakEnergy; | ||
18 | - | ||
19 | - private Number valleyEnergy; | ||
20 | - | ||
21 | - private Number flatEnergy; | ||
22 | - | ||
23 | - private Number balance; | ||
24 | - | ||
25 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import lombok.Data; | ||
4 | - | ||
5 | -import java.util.List; | ||
6 | - | ||
7 | -/** | ||
8 | - * 获取设备实施通电状态 2 | ||
9 | - */ | ||
10 | -@Data | ||
11 | -public class ElectricityDeviceOnAndOffTwo { | ||
12 | - | ||
13 | - private Number actionTime; | ||
14 | - | ||
15 | - private List<ElectricityDeviceOnAndOffThree> datas; | ||
16 | - | ||
17 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import java.math.BigDecimal; | ||
4 | -import java.util.Date; | ||
5 | - | ||
6 | -public class ElectricityMeter { | ||
7 | - private String deviceId; | ||
8 | - | ||
9 | - private BigDecimal totalEnergy; | ||
10 | - | ||
11 | - private BigDecimal tipEnergy; | ||
12 | - | ||
13 | - private BigDecimal peakEnergy; | ||
14 | - | ||
15 | - private BigDecimal valleyEnergy; | ||
16 | - | ||
17 | - private BigDecimal flatEnergy; | ||
18 | - | ||
19 | - private BigDecimal balance; | ||
20 | - | ||
21 | - private Date actime; | ||
22 | - | ||
23 | - private Date updatetime; | ||
24 | - | ||
25 | - private String reamke1; | ||
26 | - | ||
27 | - private String reamke2; | ||
28 | - | ||
29 | - public String getDeviceId() { | ||
30 | - return deviceId; | ||
31 | - } | ||
32 | - | ||
33 | - public void setDeviceId(String deviceId) { | ||
34 | - this.deviceId = deviceId == null ? null : deviceId.trim(); | ||
35 | - } | ||
36 | - | ||
37 | - public BigDecimal getTotalEnergy() { | ||
38 | - return totalEnergy; | ||
39 | - } | ||
40 | - | ||
41 | - public void setTotalEnergy(BigDecimal totalEnergy) { | ||
42 | - this.totalEnergy = totalEnergy; | ||
43 | - } | ||
44 | - | ||
45 | - public BigDecimal getTipEnergy() { | ||
46 | - return tipEnergy; | ||
47 | - } | ||
48 | - | ||
49 | - public void setTipEnergy(BigDecimal tipEnergy) { | ||
50 | - this.tipEnergy = tipEnergy; | ||
51 | - } | ||
52 | - | ||
53 | - public BigDecimal getPeakEnergy() { | ||
54 | - return peakEnergy; | ||
55 | - } | ||
56 | - | ||
57 | - public void setPeakEnergy(BigDecimal peakEnergy) { | ||
58 | - this.peakEnergy = peakEnergy; | ||
59 | - } | ||
60 | - | ||
61 | - public BigDecimal getValleyEnergy() { | ||
62 | - return valleyEnergy; | ||
63 | - } | ||
64 | - | ||
65 | - public void setValleyEnergy(BigDecimal valleyEnergy) { | ||
66 | - this.valleyEnergy = valleyEnergy; | ||
67 | - } | ||
68 | - | ||
69 | - public BigDecimal getFlatEnergy() { | ||
70 | - return flatEnergy; | ||
71 | - } | ||
72 | - | ||
73 | - public void setFlatEnergy(BigDecimal flatEnergy) { | ||
74 | - this.flatEnergy = flatEnergy; | ||
75 | - } | ||
76 | - | ||
77 | - public BigDecimal getBalance() { | ||
78 | - return balance; | ||
79 | - } | ||
80 | - | ||
81 | - public void setBalance(BigDecimal balance) { | ||
82 | - this.balance = balance; | ||
83 | - } | ||
84 | - | ||
85 | - public Date getActime() { | ||
86 | - return actime; | ||
87 | - } | ||
88 | - | ||
89 | - public void setActime(Date actime) { | ||
90 | - this.actime = actime; | ||
91 | - } | ||
92 | - | ||
93 | - public Date getUpdatetime() { | ||
94 | - return updatetime; | ||
95 | - } | ||
96 | - | ||
97 | - public void setUpdatetime(Date updatetime) { | ||
98 | - this.updatetime = updatetime; | ||
99 | - } | ||
100 | - | ||
101 | - public String getReamke1() { | ||
102 | - return reamke1; | ||
103 | - } | ||
104 | - | ||
105 | - public void setReamke1(String reamke1) { | ||
106 | - this.reamke1 = reamke1 == null ? null : reamke1.trim(); | ||
107 | - } | ||
108 | - | ||
109 | - public String getReamke2() { | ||
110 | - return reamke2; | ||
111 | - } | ||
112 | - | ||
113 | - public void setReamke2(String reamke2) { | ||
114 | - this.reamke2 = reamke2 == null ? null : reamke2.trim(); | ||
115 | - } | ||
116 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import lombok.Data; | ||
4 | - | ||
5 | -/** | ||
6 | - * 获取房间与楼层信息 3 | ||
7 | - */ | ||
8 | -@Data | ||
9 | -public class ElectricityRoomDeviceThree { | ||
10 | - | ||
11 | - // 房间id | ||
12 | - private Integer roomId; | ||
13 | - // 房间名称 | ||
14 | - private String roomName; | ||
15 | - // 设备id | ||
16 | - private String deviceId; | ||
17 | - // 设备名称 | ||
18 | - private String deviceName; | ||
19 | - // 安装时间 | ||
20 | - private String startDate; | ||
21 | - | ||
22 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import lombok.Data; | ||
4 | - | ||
5 | -import java.util.List; | ||
6 | - | ||
7 | -@Data | ||
8 | -public class Location { | ||
9 | - private Integer id; | ||
10 | - | ||
11 | - private String adrname; | ||
12 | - | ||
13 | - private String eeid; | ||
14 | - | ||
15 | - private String wmid; | ||
16 | - | ||
17 | - private Integer parent; | ||
18 | - | ||
19 | - private Integer type; | ||
20 | - | ||
21 | - private List<Location> children; | ||
22 | - | ||
23 | - public Integer getId() { | ||
24 | - return id; | ||
25 | - } | ||
26 | - | ||
27 | - public void setId(Integer id) { | ||
28 | - this.id = id; | ||
29 | - } | ||
30 | - | ||
31 | - public String getAdrname() { | ||
32 | - return adrname; | ||
33 | - } | ||
34 | - | ||
35 | - public void setAdrname(String adrname) { | ||
36 | - this.adrname = adrname == null ? null : adrname.trim(); | ||
37 | - } | ||
38 | - | ||
39 | - public Integer getParent() { | ||
40 | - return parent; | ||
41 | - } | ||
42 | - | ||
43 | - public void setParent(Integer parent) { | ||
44 | - this.parent = parent; | ||
45 | - } | ||
46 | - | ||
47 | - | ||
48 | - public String getEeid() { | ||
49 | - return eeid; | ||
50 | - } | ||
51 | - | ||
52 | - public void setEeid(String eeid) { | ||
53 | - this.eeid = eeid; | ||
54 | - } | ||
55 | - | ||
56 | - public String getWmid() { | ||
57 | - return wmid; | ||
58 | - } | ||
59 | - | ||
60 | - public void setWmid(String wmid) { | ||
61 | - this.wmid = wmid; | ||
62 | - } | ||
63 | - | ||
64 | - public Integer getType() { | ||
65 | - return type; | ||
66 | - } | ||
67 | - | ||
68 | - public void setType(Integer type) { | ||
69 | - this.type = type; | ||
70 | - } | ||
71 | - | ||
72 | - public List<Location> getChildren() { | ||
73 | - return children; | ||
74 | - } | ||
75 | - | ||
76 | - public void setChildren(List<Location> children) { | ||
77 | - this.children = children; | ||
78 | - } | ||
79 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import java.math.BigDecimal; | ||
4 | -import java.util.Date; | ||
5 | - | ||
6 | -public class PayResponse { | ||
7 | - private String id; | ||
8 | - | ||
9 | - private String posid; | ||
10 | - | ||
11 | - private String branchid; | ||
12 | - | ||
13 | - private String orderid; | ||
14 | - | ||
15 | - private BigDecimal payment; | ||
16 | - | ||
17 | - private String curcode; | ||
18 | - | ||
19 | - private String remark1; | ||
20 | - | ||
21 | - private String remark2; | ||
22 | - | ||
23 | - private String accType; | ||
24 | - | ||
25 | - private String success; | ||
26 | - | ||
27 | - private String type; | ||
28 | - | ||
29 | - private String referer; | ||
30 | - | ||
31 | - private String clientip; | ||
32 | - | ||
33 | - private Date accdate; | ||
34 | - | ||
35 | - private String usrmsg; | ||
36 | - | ||
37 | - private String usrinfo; | ||
38 | - | ||
39 | - private String paytype; | ||
40 | - | ||
41 | - private String sign; | ||
42 | - | ||
43 | - public String getId() { | ||
44 | - return id; | ||
45 | - } | ||
46 | - | ||
47 | - public void setId(String id) { | ||
48 | - this.id = id == null ? null : id.trim(); | ||
49 | - } | ||
50 | - | ||
51 | - public String getPosid() { | ||
52 | - return posid; | ||
53 | - } | ||
54 | - | ||
55 | - public void setPosid(String posid) { | ||
56 | - this.posid = posid == null ? null : posid.trim(); | ||
57 | - } | ||
58 | - | ||
59 | - public String getBranchid() { | ||
60 | - return branchid; | ||
61 | - } | ||
62 | - | ||
63 | - public void setBranchid(String branchid) { | ||
64 | - this.branchid = branchid == null ? null : branchid.trim(); | ||
65 | - } | ||
66 | - | ||
67 | - public String getOrderid() { | ||
68 | - return orderid; | ||
69 | - } | ||
70 | - | ||
71 | - public void setOrderid(String orderid) { | ||
72 | - this.orderid = orderid == null ? null : orderid.trim(); | ||
73 | - } | ||
74 | - | ||
75 | - public BigDecimal getPayment() { | ||
76 | - return payment; | ||
77 | - } | ||
78 | - | ||
79 | - public void setPayment(BigDecimal payment) { | ||
80 | - this.payment = payment; | ||
81 | - } | ||
82 | - | ||
83 | - public String getCurcode() { | ||
84 | - return curcode; | ||
85 | - } | ||
86 | - | ||
87 | - public void setCurcode(String curcode) { | ||
88 | - this.curcode = curcode == null ? null : curcode.trim(); | ||
89 | - } | ||
90 | - | ||
91 | - public String getRemark1() { | ||
92 | - return remark1; | ||
93 | - } | ||
94 | - | ||
95 | - public void setRemark1(String remark1) { | ||
96 | - this.remark1 = remark1 == null ? null : remark1.trim(); | ||
97 | - } | ||
98 | - | ||
99 | - public String getRemark2() { | ||
100 | - return remark2; | ||
101 | - } | ||
102 | - | ||
103 | - public void setRemark2(String remark2) { | ||
104 | - this.remark2 = remark2 == null ? null : remark2.trim(); | ||
105 | - } | ||
106 | - | ||
107 | - public String getAccType() { | ||
108 | - return accType; | ||
109 | - } | ||
110 | - | ||
111 | - public void setAccType(String accType) { | ||
112 | - this.accType = accType == null ? null : accType.trim(); | ||
113 | - } | ||
114 | - | ||
115 | - public String getSuccess() { | ||
116 | - return success; | ||
117 | - } | ||
118 | - | ||
119 | - public void setSuccess(String success) { | ||
120 | - this.success = success == null ? null : success.trim(); | ||
121 | - } | ||
122 | - | ||
123 | - public String getType() { | ||
124 | - return type; | ||
125 | - } | ||
126 | - | ||
127 | - public void setType(String type) { | ||
128 | - this.type = type == null ? null : type.trim(); | ||
129 | - } | ||
130 | - | ||
131 | - public String getReferer() { | ||
132 | - return referer; | ||
133 | - } | ||
134 | - | ||
135 | - public void setReferer(String referer) { | ||
136 | - this.referer = referer == null ? null : referer.trim(); | ||
137 | - } | ||
138 | - | ||
139 | - public String getClientip() { | ||
140 | - return clientip; | ||
141 | - } | ||
142 | - | ||
143 | - public void setClientip(String clientip) { | ||
144 | - this.clientip = clientip == null ? null : clientip.trim(); | ||
145 | - } | ||
146 | - | ||
147 | - public Date getAccdate() { | ||
148 | - return accdate; | ||
149 | - } | ||
150 | - | ||
151 | - public void setAccdate(Date accdate) { | ||
152 | - this.accdate = accdate; | ||
153 | - } | ||
154 | - | ||
155 | - public String getUsrmsg() { | ||
156 | - return usrmsg; | ||
157 | - } | ||
158 | - | ||
159 | - public void setUsrmsg(String usrmsg) { | ||
160 | - this.usrmsg = usrmsg == null ? null : usrmsg.trim(); | ||
161 | - } | ||
162 | - | ||
163 | - public String getUsrinfo() { | ||
164 | - return usrinfo; | ||
165 | - } | ||
166 | - | ||
167 | - public void setUsrinfo(String usrinfo) { | ||
168 | - this.usrinfo = usrinfo == null ? null : usrinfo.trim(); | ||
169 | - } | ||
170 | - | ||
171 | - public String getPaytype() { | ||
172 | - return paytype; | ||
173 | - } | ||
174 | - | ||
175 | - public void setPaytype(String paytype) { | ||
176 | - this.paytype = paytype == null ? null : paytype.trim(); | ||
177 | - } | ||
178 | - | ||
179 | - public String getSign() { | ||
180 | - return sign; | ||
181 | - } | ||
182 | - | ||
183 | - public void setSign(String sign) { | ||
184 | - this.sign = sign == null ? null : sign.trim(); | ||
185 | - } | ||
186 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import java.util.Date; | ||
4 | - | ||
5 | -public class USERS { | ||
6 | - private Integer userId; | ||
7 | - | ||
8 | - private String username; | ||
9 | - | ||
10 | - private String password; | ||
11 | - | ||
12 | - private Date birthday; | ||
13 | - | ||
14 | - private String sex; | ||
15 | - | ||
16 | - private String address; | ||
17 | - | ||
18 | - private Boolean state; | ||
19 | - | ||
20 | - private String mobilephone; | ||
21 | - | ||
22 | - private Date creattime; | ||
23 | - | ||
24 | - private Date updatetime; | ||
25 | - | ||
26 | - private String userface; | ||
27 | - | ||
28 | - private String realname; | ||
29 | - | ||
30 | - private String email; | ||
31 | - | ||
32 | - private Integer age; | ||
33 | - | ||
34 | - private Integer companyId; | ||
35 | - | ||
36 | - public Integer getUserId() { | ||
37 | - return userId; | ||
38 | - } | ||
39 | - | ||
40 | - public void setUserId(Integer userId) { | ||
41 | - this.userId = userId; | ||
42 | - } | ||
43 | - | ||
44 | - public String getUsername() { | ||
45 | - return username; | ||
46 | - } | ||
47 | - | ||
48 | - public void setUsername(String username) { | ||
49 | - this.username = username == null ? null : username.trim(); | ||
50 | - } | ||
51 | - | ||
52 | - public String getPassword() { | ||
53 | - return password; | ||
54 | - } | ||
55 | - | ||
56 | - public void setPassword(String password) { | ||
57 | - this.password = password == null ? null : password.trim(); | ||
58 | - } | ||
59 | - | ||
60 | - public Date getBirthday() { | ||
61 | - return birthday; | ||
62 | - } | ||
63 | - | ||
64 | - public void setBirthday(Date birthday) { | ||
65 | - this.birthday = birthday; | ||
66 | - } | ||
67 | - | ||
68 | - public String getSex() { | ||
69 | - return sex; | ||
70 | - } | ||
71 | - | ||
72 | - public void setSex(String sex) { | ||
73 | - this.sex = sex == null ? null : sex.trim(); | ||
74 | - } | ||
75 | - | ||
76 | - public String getAddress() { | ||
77 | - return address; | ||
78 | - } | ||
79 | - | ||
80 | - public void setAddress(String address) { | ||
81 | - this.address = address == null ? null : address.trim(); | ||
82 | - } | ||
83 | - | ||
84 | - public Boolean getState() { | ||
85 | - return state; | ||
86 | - } | ||
87 | - | ||
88 | - public void setState(Boolean state) { | ||
89 | - this.state = state; | ||
90 | - } | ||
91 | - | ||
92 | - public String getMobilephone() { | ||
93 | - return mobilephone; | ||
94 | - } | ||
95 | - | ||
96 | - public void setMobilephone(String mobilephone) { | ||
97 | - this.mobilephone = mobilephone == null ? null : mobilephone.trim(); | ||
98 | - } | ||
99 | - | ||
100 | - public Date getCreattime() { | ||
101 | - return creattime; | ||
102 | - } | ||
103 | - | ||
104 | - public void setCreattime(Date creattime) { | ||
105 | - this.creattime = creattime; | ||
106 | - } | ||
107 | - | ||
108 | - public Date getUpdatetime() { | ||
109 | - return updatetime; | ||
110 | - } | ||
111 | - | ||
112 | - public void setUpdatetime(Date updatetime) { | ||
113 | - this.updatetime = updatetime; | ||
114 | - } | ||
115 | - | ||
116 | - public String getUserface() { | ||
117 | - return userface; | ||
118 | - } | ||
119 | - | ||
120 | - public void setUserface(String userface) { | ||
121 | - this.userface = userface == null ? null : userface.trim(); | ||
122 | - } | ||
123 | - | ||
124 | - public String getRealname() { | ||
125 | - return realname; | ||
126 | - } | ||
127 | - | ||
128 | - public void setRealname(String realname) { | ||
129 | - this.realname = realname == null ? null : realname.trim(); | ||
130 | - } | ||
131 | - | ||
132 | - public String getEmail() { | ||
133 | - return email; | ||
134 | - } | ||
135 | - | ||
136 | - public void setEmail(String email) { | ||
137 | - this.email = email == null ? null : email.trim(); | ||
138 | - } | ||
139 | - | ||
140 | - public Integer getAge() { | ||
141 | - return age; | ||
142 | - } | ||
143 | - | ||
144 | - public void setAge(Integer age) { | ||
145 | - this.age = age; | ||
146 | - } | ||
147 | - | ||
148 | - public Integer getCompanyId() { | ||
149 | - return companyId; | ||
150 | - } | ||
151 | - | ||
152 | - public void setCompanyId(Integer companyId) { | ||
153 | - this.companyId = companyId; | ||
154 | - } | ||
155 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import java.util.Date; | ||
4 | - | ||
5 | -public class WaterElectricityParameter { | ||
6 | - private Integer id; | ||
7 | - | ||
8 | - private Boolean prepaid; | ||
9 | - | ||
10 | - private Boolean warningtrip; | ||
11 | - | ||
12 | - private Long warningthreshold; | ||
13 | - | ||
14 | - private Boolean overdraft; | ||
15 | - | ||
16 | - private Long overdraftthreshold; | ||
17 | - | ||
18 | - private Boolean waterload; | ||
19 | - | ||
20 | - private Long water; | ||
21 | - | ||
22 | - private Long power; | ||
23 | - | ||
24 | - private String powerfactor; | ||
25 | - | ||
26 | - private Boolean free; | ||
27 | - | ||
28 | - private Long freeelectricitylimit; | ||
29 | - | ||
30 | - private String freewater; | ||
31 | - | ||
32 | - private String wmId; | ||
33 | - | ||
34 | - private Date creattime; | ||
35 | - | ||
36 | - private String eeId; | ||
37 | - | ||
38 | - private String reamke2; | ||
39 | - | ||
40 | - private String reamke3; | ||
41 | - | ||
42 | - public Integer getId() { | ||
43 | - return id; | ||
44 | - } | ||
45 | - | ||
46 | - public void setId(Integer id) { | ||
47 | - this.id = id; | ||
48 | - } | ||
49 | - | ||
50 | - public Boolean getPrepaid() { | ||
51 | - return prepaid; | ||
52 | - } | ||
53 | - | ||
54 | - public void setPrepaid(Boolean prepaid) { | ||
55 | - this.prepaid = prepaid; | ||
56 | - } | ||
57 | - | ||
58 | - public Boolean getWarningtrip() { | ||
59 | - return warningtrip; | ||
60 | - } | ||
61 | - | ||
62 | - public void setWarningtrip(Boolean warningtrip) { | ||
63 | - this.warningtrip = warningtrip; | ||
64 | - } | ||
65 | - | ||
66 | - public Long getWarningthreshold() { | ||
67 | - return warningthreshold; | ||
68 | - } | ||
69 | - | ||
70 | - public void setWarningthreshold(Long warningthreshold) { | ||
71 | - this.warningthreshold = warningthreshold; | ||
72 | - } | ||
73 | - | ||
74 | - public Boolean getOverdraft() { | ||
75 | - return overdraft; | ||
76 | - } | ||
77 | - | ||
78 | - public void setOverdraft(Boolean overdraft) { | ||
79 | - this.overdraft = overdraft; | ||
80 | - } | ||
81 | - | ||
82 | - public Long getOverdraftthreshold() { | ||
83 | - return overdraftthreshold; | ||
84 | - } | ||
85 | - | ||
86 | - public void setOverdraftthreshold(Long overdraftthreshold) { | ||
87 | - this.overdraftthreshold = overdraftthreshold; | ||
88 | - } | ||
89 | - | ||
90 | - public Boolean getWaterload() { | ||
91 | - return waterload; | ||
92 | - } | ||
93 | - | ||
94 | - public void setWaterload(Boolean waterload) { | ||
95 | - this.waterload = waterload; | ||
96 | - } | ||
97 | - | ||
98 | - public Long getWater() { | ||
99 | - return water; | ||
100 | - } | ||
101 | - | ||
102 | - public void setWater(Long water) { | ||
103 | - this.water = water; | ||
104 | - } | ||
105 | - | ||
106 | - public Long getPower() { | ||
107 | - return power; | ||
108 | - } | ||
109 | - | ||
110 | - public void setPower(Long power) { | ||
111 | - this.power = power; | ||
112 | - } | ||
113 | - | ||
114 | - public String getPowerfactor() { | ||
115 | - return powerfactor; | ||
116 | - } | ||
117 | - | ||
118 | - public void setPowerfactor(String powerfactor) { | ||
119 | - this.powerfactor = powerfactor == null ? null : powerfactor.trim(); | ||
120 | - } | ||
121 | - | ||
122 | - public Boolean getFree() { | ||
123 | - return free; | ||
124 | - } | ||
125 | - | ||
126 | - public void setFree(Boolean free) { | ||
127 | - this.free = free; | ||
128 | - } | ||
129 | - | ||
130 | - public Long getFreeelectricitylimit() { | ||
131 | - return freeelectricitylimit; | ||
132 | - } | ||
133 | - | ||
134 | - public void setFreeelectricitylimit(Long freeelectricitylimit) { | ||
135 | - this.freeelectricitylimit = freeelectricitylimit; | ||
136 | - } | ||
137 | - | ||
138 | - public String getFreewater() { | ||
139 | - return freewater; | ||
140 | - } | ||
141 | - | ||
142 | - public void setFreewater(String freewater) { | ||
143 | - this.freewater = freewater == null ? null : freewater.trim(); | ||
144 | - } | ||
145 | - | ||
146 | - public String getWmId() { | ||
147 | - return wmId; | ||
148 | - } | ||
149 | - | ||
150 | - public void setWmId(String wmId) { | ||
151 | - this.wmId = wmId == null ? null : wmId.trim(); | ||
152 | - } | ||
153 | - | ||
154 | - public Date getCreattime() { | ||
155 | - return creattime; | ||
156 | - } | ||
157 | - | ||
158 | - public void setCreattime(Date creattime) { | ||
159 | - this.creattime = creattime; | ||
160 | - } | ||
161 | - | ||
162 | - public String getEeId() { | ||
163 | - return eeId; | ||
164 | - } | ||
165 | - | ||
166 | - public void setEeId(String eeId) { | ||
167 | - this.eeId = eeId == null ? null : eeId.trim(); | ||
168 | - } | ||
169 | - | ||
170 | - public String getReamke2() { | ||
171 | - return reamke2; | ||
172 | - } | ||
173 | - | ||
174 | - public void setReamke2(String reamke2) { | ||
175 | - this.reamke2 = reamke2 == null ? null : reamke2.trim(); | ||
176 | - } | ||
177 | - | ||
178 | - public String getReamke3() { | ||
179 | - return reamke3; | ||
180 | - } | ||
181 | - | ||
182 | - public void setReamke3(String reamke3) { | ||
183 | - this.reamke3 = reamke3 == null ? null : reamke3.trim(); | ||
184 | - } | ||
185 | -} |
1 | -package com.sunyo.energy.location.model; | ||
2 | - | ||
3 | -import java.util.Date; | ||
4 | - | ||
5 | -public class WaterMeter { | ||
6 | - private String wmId; | ||
7 | - | ||
8 | - private String wmSacc; | ||
9 | - | ||
10 | - private String wmLacc; | ||
11 | - | ||
12 | - private String wmRdtime; | ||
13 | - | ||
14 | - private String wmFmstate; | ||
15 | - | ||
16 | - private String wmErrmessage; | ||
17 | - | ||
18 | - private String wmVoltage; | ||
19 | - | ||
20 | - private String wmSignalpower; | ||
21 | - | ||
22 | - private Date creattime; | ||
23 | - | ||
24 | - private Date updatetime; | ||
25 | - | ||
26 | - private String reamke1; | ||
27 | - | ||
28 | - private String reamke2; | ||
29 | - | ||
30 | - private String reamke3; | ||
31 | - | ||
32 | - private String reamke4; | ||
33 | - | ||
34 | - public String getWmId() { | ||
35 | - return wmId; | ||
36 | - } | ||
37 | - | ||
38 | - public void setWmId(String wmId) { | ||
39 | - this.wmId = wmId == null ? null : wmId.trim(); | ||
40 | - } | ||
41 | - | ||
42 | - public String getWmSacc() { | ||
43 | - return wmSacc; | ||
44 | - } | ||
45 | - | ||
46 | - public void setWmSacc(String wmSacc) { | ||
47 | - this.wmSacc = wmSacc == null ? null : wmSacc.trim(); | ||
48 | - } | ||
49 | - | ||
50 | - public String getWmLacc() { | ||
51 | - return wmLacc; | ||
52 | - } | ||
53 | - | ||
54 | - public void setWmLacc(String wmLacc) { | ||
55 | - this.wmLacc = wmLacc == null ? null : wmLacc.trim(); | ||
56 | - } | ||
57 | - | ||
58 | - public String getWmRdtime() { | ||
59 | - return wmRdtime; | ||
60 | - } | ||
61 | - | ||
62 | - public void setWmRdtime(String wmRdtime) { | ||
63 | - this.wmRdtime = wmRdtime == null ? null : wmRdtime.trim(); | ||
64 | - } | ||
65 | - | ||
66 | - public String getWmFmstate() { | ||
67 | - return wmFmstate; | ||
68 | - } | ||
69 | - | ||
70 | - public void setWmFmstate(String wmFmstate) { | ||
71 | - this.wmFmstate = wmFmstate == null ? null : wmFmstate.trim(); | ||
72 | - } | ||
73 | - | ||
74 | - public String getWmErrmessage() { | ||
75 | - return wmErrmessage; | ||
76 | - } | ||
77 | - | ||
78 | - public void setWmErrmessage(String wmErrmessage) { | ||
79 | - this.wmErrmessage = wmErrmessage == null ? null : wmErrmessage.trim(); | ||
80 | - } | ||
81 | - | ||
82 | - public String getWmVoltage() { | ||
83 | - return wmVoltage; | ||
84 | - } | ||
85 | - | ||
86 | - public void setWmVoltage(String wmVoltage) { | ||
87 | - this.wmVoltage = wmVoltage == null ? null : wmVoltage.trim(); | ||
88 | - } | ||
89 | - | ||
90 | - public String getWmSignalpower() { | ||
91 | - return wmSignalpower; | ||
92 | - } | ||
93 | - | ||
94 | - public void setWmSignalpower(String wmSignalpower) { | ||
95 | - this.wmSignalpower = wmSignalpower == null ? null : wmSignalpower.trim(); | ||
96 | - } | ||
97 | - | ||
98 | - public Date getCreattime() { | ||
99 | - return creattime; | ||
100 | - } | ||
101 | - | ||
102 | - public void setCreattime(Date creattime) { | ||
103 | - this.creattime = creattime; | ||
104 | - } | ||
105 | - | ||
106 | - public Date getUpdatetime() { | ||
107 | - return updatetime; | ||
108 | - } | ||
109 | - | ||
110 | - public void setUpdatetime(Date updatetime) { | ||
111 | - this.updatetime = updatetime; | ||
112 | - } | ||
113 | - | ||
114 | - public String getReamke1() { | ||
115 | - return reamke1; | ||
116 | - } | ||
117 | - | ||
118 | - public void setReamke1(String reamke1) { | ||
119 | - this.reamke1 = reamke1 == null ? null : reamke1.trim(); | ||
120 | - } | ||
121 | - | ||
122 | - public String getReamke2() { | ||
123 | - return reamke2; | ||
124 | - } | ||
125 | - | ||
126 | - public void setReamke2(String reamke2) { | ||
127 | - this.reamke2 = reamke2 == null ? null : reamke2.trim(); | ||
128 | - } | ||
129 | - | ||
130 | - public String getReamke3() { | ||
131 | - return reamke3; | ||
132 | - } | ||
133 | - | ||
134 | - public void setReamke3(String reamke3) { | ||
135 | - this.reamke3 = reamke3 == null ? null : reamke3.trim(); | ||
136 | - } | ||
137 | - | ||
138 | - public String getReamke4() { | ||
139 | - return reamke4; | ||
140 | - } | ||
141 | - | ||
142 | - public void setReamke4(String reamke4) { | ||
143 | - this.reamke4 = reamke4 == null ? null : reamke4.trim(); | ||
144 | - } | ||
145 | -} |
1 | -package com.sunyo.energy.location.service; | ||
2 | - | ||
3 | -import com.github.pagehelper.PageInfo; | ||
4 | -import com.sunyo.energy.location.model.ElectricityInfo; | ||
5 | -import com.sunyo.energy.location.model.PayRecords; | ||
6 | - | ||
7 | -import java.util.List; | ||
8 | - | ||
9 | -/** | ||
10 | - * @author shenhailong | ||
11 | - * <p> | ||
12 | - * 2020/6/5/10:45 | ||
13 | - */ | ||
14 | -public interface EeInfoService { | ||
15 | - | ||
16 | - int deleteByPrimaryKey(String orderNumber); | ||
17 | - | ||
18 | - int insert(ElectricityInfo record); | ||
19 | - | ||
20 | - int insertSelective(ElectricityInfo record); | ||
21 | - | ||
22 | - ElectricityInfo selectByPrimaryKey(String orderNumber); | ||
23 | - | ||
24 | - PageInfo<ElectricityInfo> getEeInfo(int pageSize, int pageNum, String deviceId); | ||
25 | - | ||
26 | - int updateByPrimaryKeySelective(ElectricityInfo record); | ||
27 | - | ||
28 | - int updateByPrimaryKey(ElectricityInfo record); | ||
29 | - | ||
30 | -} |
1 | package com.sunyo.energy.location.service; | 1 | package com.sunyo.energy.location.service; |
2 | 2 | ||
3 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
4 | -import com.sunyo.energy.location.model.ElectricityBalanceThree; | ||
5 | -import com.sunyo.energy.location.model.ElectricityMeter; | ||
6 | 3 | ||
7 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
8 | import java.util.Map; | 5 | import java.util.Map; |
@@ -13,22 +10,6 @@ import java.util.Map; | @@ -13,22 +10,6 @@ import java.util.Map; | ||
13 | * 2020/5/25/16:12 | 10 | * 2020/5/25/16:12 |
14 | */ | 11 | */ |
15 | public interface ElectricityMeterService { | 12 | public interface ElectricityMeterService { |
16 | - /** | ||
17 | - * 获取电表实时数据 | ||
18 | - * | ||
19 | - * @param deviceId | ||
20 | - * @return | ||
21 | - */ | ||
22 | - ElectricityMeter getEnergyInfoForRealTime(String deviceId) throws Exception; | ||
23 | 13 | ||
24 | - /** | ||
25 | - * 电表充值接口 | ||
26 | - * | ||
27 | - * @param deviceId | ||
28 | - * @param money | ||
29 | - * @param actionType | ||
30 | - * @return | ||
31 | - */ | ||
32 | - int rechargeDevices(String deviceId, String money, String actionType, String orderNumber); | ||
33 | 14 | ||
34 | } | 15 | } |
1 | -package com.sunyo.energy.location.service; | ||
2 | - | ||
3 | -import com.github.pagehelper.PageInfo; | ||
4 | -import com.sunyo.energy.location.model.PayRecords; | ||
5 | - | ||
6 | -/** | ||
7 | - * Created by XYH on 2019/12/16. | ||
8 | - */ | ||
9 | -public interface PayOrderService { | ||
10 | - PageInfo<PayRecords> getOrder(int pageSize, int pageNum, String orderNumber, String payTime, String username, String payType); | ||
11 | - | ||
12 | - int addOrder(PayRecords payRecords); | ||
13 | - | ||
14 | - int ediOrder(PayRecords payRecords); | ||
15 | - | ||
16 | - int delOrder(PayRecords payRecords); | ||
17 | -} |
src/main/java/com/sunyo/energy/location/service/WaterElectricityParameterService.java
已删除
100644 → 0
1 | -package com.sunyo.energy.location.service; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.model.WaterElectricityParameter; | ||
4 | - | ||
5 | -import java.util.List; | ||
6 | - | ||
7 | -public interface WaterElectricityParameterService { | ||
8 | - | ||
9 | - int insertSelective(WaterElectricityParameter record); | ||
10 | - | ||
11 | - int updateByPrimaryKeySelective(WaterElectricityParameter record); | ||
12 | - | ||
13 | - int countOne(String eeId); | ||
14 | - | ||
15 | - WaterElectricityParameter findOneElectricity(String eeId); | ||
16 | - | ||
17 | - | ||
18 | -} |
1 | -package com.sunyo.energy.location.service; | ||
2 | - | ||
3 | - | ||
4 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
5 | -import com.sunyo.energy.location.model.WaterMeter; | ||
6 | - | ||
7 | -import java.io.UnsupportedEncodingException; | ||
8 | - | ||
9 | -public interface WaterMeterService { | ||
10 | - | ||
11 | - int realTime(); | ||
12 | - | ||
13 | - WaterMeter findRealTime(String wmId); | ||
14 | - | ||
15 | - ResultJson payWater(String payFees, String wmId); | ||
16 | - | ||
17 | - ResultJson waterMeterAll(String wmId); | ||
18 | - | ||
19 | - /** | ||
20 | - * 请求返回二维码 | ||
21 | - */ | ||
22 | - ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException; | ||
23 | - | ||
24 | - | ||
25 | -} |
1 | -package com.sunyo.energy.location.service.imp; | ||
2 | - | ||
3 | -import com.github.pagehelper.Page; | ||
4 | -import com.github.pagehelper.PageHelper; | ||
5 | -import com.github.pagehelper.PageInfo; | ||
6 | -import com.sunyo.energy.location.dao.ElectricityInfoMapper; | ||
7 | -import com.sunyo.energy.location.model.ElectricityInfo; | ||
8 | -import com.sunyo.energy.location.model.PayRecords; | ||
9 | -import com.sunyo.energy.location.service.EeInfoService; | ||
10 | -import org.springframework.beans.factory.annotation.Autowired; | ||
11 | -import org.springframework.stereotype.Service; | ||
12 | -import org.springframework.util.StringUtils; | ||
13 | - | ||
14 | -import java.util.List; | ||
15 | - | ||
16 | -/** | ||
17 | - * @author shenhailong | ||
18 | - * <p> | ||
19 | - * 2020/6/5/10:45 | ||
20 | - */ | ||
21 | -@Service | ||
22 | -public class EeInfoServiceImpl implements EeInfoService { | ||
23 | - | ||
24 | - @Autowired | ||
25 | - ElectricityInfoMapper electricityInfoMapper; | ||
26 | - | ||
27 | - @Override | ||
28 | - public int deleteByPrimaryKey(String orderNumber) { | ||
29 | - return 0; | ||
30 | - } | ||
31 | - | ||
32 | - @Override | ||
33 | - public int insert(ElectricityInfo record) { | ||
34 | - return 0; | ||
35 | - } | ||
36 | - | ||
37 | - @Override | ||
38 | - public int insertSelective(ElectricityInfo record) { | ||
39 | - return 0; | ||
40 | - } | ||
41 | - | ||
42 | - @Override | ||
43 | - public ElectricityInfo selectByPrimaryKey(String orderNumber) { | ||
44 | - return null; | ||
45 | - } | ||
46 | - | ||
47 | - @Override | ||
48 | - public PageInfo<ElectricityInfo> getEeInfo(int pageSize, int pageNum, String deviceId) { | ||
49 | - | ||
50 | - PageHelper.startPage(pageNum, pageSize); | ||
51 | - List<ElectricityInfo> list = electricityInfoMapper.selectAll(deviceId); | ||
52 | - PageInfo<ElectricityInfo> result = new PageInfo<>(list); | ||
53 | - | ||
54 | - return result; | ||
55 | - } | ||
56 | - | ||
57 | - | ||
58 | - @Override | ||
59 | - public int updateByPrimaryKeySelective(ElectricityInfo record) { | ||
60 | - return 0; | ||
61 | - } | ||
62 | - | ||
63 | - @Override | ||
64 | - public int updateByPrimaryKey(ElectricityInfo record) { | ||
65 | - return 0; | ||
66 | - } | ||
67 | -} |
@@ -5,15 +5,11 @@ import com.sunyo.energy.location.dao.*; | @@ -5,15 +5,11 @@ import com.sunyo.energy.location.dao.*; | ||
5 | import com.sunyo.energy.location.model.*; | 5 | import com.sunyo.energy.location.model.*; |
6 | import com.sunyo.energy.location.service.ElectricityMeterService; | 6 | import com.sunyo.energy.location.service.ElectricityMeterService; |
7 | import com.sunyo.energy.location.utils.HttpsUtils; | 7 | import com.sunyo.energy.location.utils.HttpsUtils; |
8 | -import com.sunyo.energy.location.utils.Md5Utils; | ||
9 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.beans.factory.annotation.Value; | 10 | import org.springframework.beans.factory.annotation.Value; |
12 | import org.springframework.scheduling.annotation.Scheduled; | 11 | import org.springframework.scheduling.annotation.Scheduled; |
13 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
14 | - | ||
15 | -import java.math.BigDecimal; | ||
16 | -import java.math.RoundingMode; | ||
17 | import java.util.HashMap; | 13 | import java.util.HashMap; |
18 | import java.util.List; | 14 | import java.util.List; |
19 | import java.util.Map; | 15 | import java.util.Map; |
@@ -28,125 +24,18 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | @@ -28,125 +24,18 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | ||
28 | @Autowired | 24 | @Autowired |
29 | PayRecordsMapper payRecordsMapper; | 25 | PayRecordsMapper payRecordsMapper; |
30 | 26 | ||
31 | - @Autowired | ||
32 | - LocationMapper locationMapper; | ||
33 | - | ||
34 | - @Autowired | ||
35 | - USERSMapper usersMapper; | ||
36 | - | ||
37 | - | ||
38 | - /** | ||
39 | - * 获取电表实时数据/余额 | ||
40 | - */ | ||
41 | - @Value("${eeUrl.electricityBanlanceUrl}") | ||
42 | - private String electricityBanlanceUrl; | ||
43 | - | ||
44 | - /** | ||
45 | - * 电表充值接口读取配置文件ip地址 | ||
46 | - */ | ||
47 | - @Value("${eeid.ipAddress}") | ||
48 | - private String ipAddress; | ||
49 | /** | 27 | /** |
50 | * 电表充值接口地址 | 28 | * 电表充值接口地址 |
51 | */ | 29 | */ |
52 | @Value("${eeUrl.rechargeDevicesUrl}") | 30 | @Value("${eeUrl.rechargeDevicesUrl}") |
53 | private String rechargeDevicesUrl; | 31 | private String rechargeDevicesUrl; |
54 | - /** | ||
55 | - * 获取设备跟公寓信息 | ||
56 | - */ | ||
57 | - @Value("${eeUrl.getRoomAndDeviceUrl}") | ||
58 | - private String getRoomAndDeviceUrl; | ||
59 | - | ||
60 | - /** | ||
61 | - * 实施获取电表数据 | ||
62 | - */ | ||
63 | - @Override | ||
64 | - public ElectricityMeter getEnergyInfoForRealTime(String deviceId) { | ||
65 | - try { | ||
66 | - if (!"".equals(deviceId)) { | ||
67 | - Map<String, Object> stringObjectMap = eeInfo(deviceId); | ||
68 | - String infoForRealTime = HttpsUtils.sendPost(electricityBanlanceUrl, stringObjectMap); | ||
69 | - ElectricityBalanceOne electricityBalanceOne = JSON.parseObject(infoForRealTime, ElectricityBalanceOne.class); | ||
70 | - List<ElectricityMeter> infoForRealTimeList = electricityBalanceOne.getData().getDatas(); | ||
71 | - for (ElectricityMeter electricityBalanceThree : infoForRealTimeList) { | ||
72 | - if (electricityBalanceThree != null) { | ||
73 | - return electricityBalanceThree; | ||
74 | - } | ||
75 | - } | ||
76 | - } | ||
77 | - return null; | ||
78 | - } catch (Exception e) { | ||
79 | - e.printStackTrace(); | ||
80 | - return null; | ||
81 | - } | ||
82 | - } | ||
83 | - | ||
84 | - /** | ||
85 | - * 电表充值 | ||
86 | - * | ||
87 | - * @param deviceId 设备编号 | ||
88 | - * @param money 充值金额 | ||
89 | - * @param actionType 充值类型 0 充值 1 扣费 | ||
90 | - * @param orderNumber 订单号 | ||
91 | - * @return | ||
92 | - */ | ||
93 | - @Override | ||
94 | - public int rechargeDevices(String deviceId, String money, String actionType, String orderNumber) { | ||
95 | - | ||
96 | - Map<String, Object> stringObjectMap = mapCommon(actionType, deviceId, money, ipAddress); | ||
97 | - // 设置secret值 设备id 跟金额 盐 需要进行加密 | ||
98 | - BigDecimal bigDecimal = new BigDecimal(money).setScale(2, RoundingMode.HALF_UP); | ||
99 | - String moneyString = String.valueOf(bigDecimal); | ||
100 | - String secret = Md5Utils.getMD5(deviceId + moneyString + "tiansu", true, 32); | ||
101 | - stringObjectMap.put("secret", secret); | ||
102 | - log.info("电表充值信息{}", stringObjectMap.toString()); | ||
103 | - try { | ||
104 | - String result = HttpsUtils.sendPost(rechargeDevicesUrl, stringObjectMap); | ||
105 | - log.info("电表充值反馈结果:{}", result); | ||
106 | - RechargeDevicesResult rechargeDevicesResult = JSON.parseObject(result, RechargeDevicesResult.class); | ||
107 | - List<RechargeDevicesResultData> data = rechargeDevicesResult.getData().getDatas(); | ||
108 | - Boolean message = null; | ||
109 | - for (RechargeDevicesResultData rechargeDevicesResultData : data) { | ||
110 | - message = rechargeDevicesResultData.getSuccess(); | ||
111 | - } | ||
112 | - if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true) { | ||
113 | - log.info("电表充值成功,充值额度:{}", money); | ||
114 | - return 1; | ||
115 | - } else { | ||
116 | - log.info("电表充值失败,充值额度:{}", money); | ||
117 | - /** | ||
118 | - * 插入临时表 电表接口充值因为硬件问题可能失败 | ||
119 | - */ | ||
120 | - ElectricityInfo electricityInfo = new ElectricityInfo(); | ||
121 | - electricityInfo.setOrderNumber(orderNumber); | ||
122 | - electricityInfo.setActionType(actionType); | ||
123 | - electricityInfo.setDeviceId(deviceId); | ||
124 | - electricityInfo.setMoney(new BigDecimal(money).setScale(2, RoundingMode.HALF_UP)); | ||
125 | - electricityInfo.setIpAddress(ipAddress); | ||
126 | - electricityInfo.setSecret(secret); | ||
127 | - int i = electricityInfoMapper.insertSelective(electricityInfo); | ||
128 | - log.info("插入电表临时表成功:{},插入数据{}", i, electricityInfo); | ||
129 | - return 0; | ||
130 | - } | ||
131 | - | ||
132 | - } catch (Exception e) { | ||
133 | - e.printStackTrace(); | ||
134 | - log.error("电表充值失败,充值额度:{}", money); | ||
135 | - return 0; | ||
136 | - } | ||
137 | - } | ||
138 | - | ||
139 | - public Map<String, Object> eeInfo(String deviceId) { | ||
140 | - Map<String, Object> datas = new HashMap<>(); | ||
141 | - datas.put("deviceId", deviceId); | ||
142 | - return datas; | ||
143 | - } | ||
144 | 32 | ||
145 | /** | 33 | /** |
146 | * 定时读取电表临时表 发起充值 | 34 | * 定时读取电表临时表 发起充值 |
147 | */ | 35 | */ |
148 | -// @Scheduled(fixedDelay = 30000) | 36 | + @Scheduled(fixedDelay = 30000) |
149 | public void electricityInfo() { | 37 | public void electricityInfo() { |
38 | + try { | ||
150 | List<ElectricityInfo> electricityInfos = electricityInfoMapper.selectAll(""); | 39 | List<ElectricityInfo> electricityInfos = electricityInfoMapper.selectAll(""); |
151 | if (electricityInfos.size() > 0) { | 40 | if (electricityInfos.size() > 0) { |
152 | for (ElectricityInfo electricityInfo : electricityInfos) { | 41 | for (ElectricityInfo electricityInfo : electricityInfos) { |
@@ -166,15 +55,16 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | @@ -166,15 +55,16 @@ public class ElectricityMeterServiceImp implements ElectricityMeterService { | ||
166 | message = rechargeDevicesResultData.getSuccess(); | 55 | message = rechargeDevicesResultData.getSuccess(); |
167 | } | 56 | } |
168 | if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true) { | 57 | if ("0".equals(rechargeDevicesResult.getErrcode()) && message == true) { |
169 | - payRecordsMapper.updateStatus(electricityInfo.getOrderNumber()); | ||
170 | - electricityInfo.setStatus("0"); | ||
171 | - electricityInfoMapper.updateByPrimaryKeySelective(electricityInfo); | 58 | + // 成功 删除该订单 |
59 | + electricityInfoMapper.deleteByPrimaryKey(electricityInfo.getOrderNumber()); | ||
172 | } | 60 | } |
173 | } | 61 | } |
174 | } | 62 | } |
175 | } | 63 | } |
176 | log.info("定时任务处理完成"); | 64 | log.info("定时任务处理完成"); |
177 | - | 65 | + }catch (Exception e){ |
66 | + e.printStackTrace(); | ||
67 | + } | ||
178 | } | 68 | } |
179 | 69 | ||
180 | public Map<String, Object> mapCommon(String actionType, String deviceId, String money, String ip_address) { | 70 | public Map<String, Object> mapCommon(String actionType, String deviceId, String money, String ip_address) { |
1 | -package com.sunyo.energy.location.service.imp; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.dao.LocationMapper; | ||
4 | -import com.sunyo.energy.location.model.ElectricityMeter; | ||
5 | -import com.sunyo.energy.location.model.WaterMeter; | ||
6 | -import com.sunyo.energy.location.service.ElectricityMeterService; | ||
7 | -import com.sunyo.energy.location.service.LocationService; | ||
8 | -import com.sunyo.energy.location.utils.AllUtils; | ||
9 | -import org.springframework.beans.factory.annotation.Autowired; | ||
10 | -import org.springframework.stereotype.Service; | ||
11 | -import org.springframework.util.StringUtils; | ||
12 | - | ||
13 | -import java.util.ArrayList; | ||
14 | -import java.util.HashMap; | ||
15 | -import java.util.List; | ||
16 | -import java.util.Map; | ||
17 | - | ||
18 | -@Service | ||
19 | -public class LocationServiceImp implements LocationService { | ||
20 | - | ||
21 | - @Autowired | ||
22 | - LocationMapper locationMapper; | ||
23 | - | ||
24 | - | ||
25 | - @Autowired | ||
26 | - ElectricityMeterService electricityMeterService; | ||
27 | - | ||
28 | - @Override | ||
29 | - public List userPayList(String roomNumber) { | ||
30 | - | ||
31 | - try { | ||
32 | - // 房间号如果为null 跳过 | ||
33 | - if (!StringUtils.isEmpty(roomNumber)) { | ||
34 | - List<Map<String, Object>> list = new ArrayList<>(); | ||
35 | - /** | ||
36 | - * 水费查询 | ||
37 | - */ | ||
38 | - // 查询房间号 水表本地查询list | ||
39 | - Map<String, Object> thisLocalityWaterMap = locationMapper.userPayList(roomNumber); | ||
40 | - Map<String, Object> distanceWaterMap = new HashMap<>(); | ||
41 | - // 是否为null 为null则去线上查询 | ||
42 | -// if (thisLocalityWaterMap != null) { | ||
43 | -// if (!StringUtils.isEmpty(thisLocalityWaterMap.get("wmSacc").toString()) && !StringUtils.isEmpty(thisLocalityWaterMap.get("wmLacc").toString())) { | ||
44 | -// // 计算剩余量 充值量 减去 消费量 参数1 减去 参数2 | ||
45 | -// String subtraction = AllUtils.nubmerSubtraction(thisLocalityWaterMap.get("wmSacc").toString(), thisLocalityWaterMap.get("wmLacc").toString()); | ||
46 | -// // 余量 | ||
47 | -// thisLocalityWaterMap.put("subtraction", subtraction); | ||
48 | -// } | ||
49 | -// list.add(thisLocalityWaterMap); | ||
50 | -// } else { | ||
51 | - // 查询该房间号的水表编号 | ||
52 | - String wmId = locationMapper.findWmId(roomNumber); | ||
53 | - if (!"".equals(wmId)) { | ||
54 | - Map<String, Object> waterMaps = new HashMap<>(); | ||
55 | - WaterMeterServiceImp waterMeterServiceImp = new WaterMeterServiceImp(); | ||
56 | - WaterMeter realTime = waterMeterServiceImp.findRealTime(wmId); | ||
57 | - String subtraction = AllUtils.nubmerSubtraction(realTime.getWmSacc(), realTime.getWmLacc()); | ||
58 | - distanceWaterMap.put("subtraction", subtraction); | ||
59 | - distanceWaterMap.put("wmSacc", realTime.getWmSacc()); | ||
60 | - distanceWaterMap.put("wmFmstate", realTime.getWmFmstate()); | ||
61 | - distanceWaterMap.put("wmLacc", realTime.getWmLacc()); | ||
62 | - distanceWaterMap.put("wmId", wmId); | ||
63 | - list.add(distanceWaterMap); | ||
64 | - } | ||
65 | -// } | ||
66 | - /** | ||
67 | - * 电费查询 通过房间号查询设备id | ||
68 | - */ | ||
69 | - String eeId = locationMapper.eeId(roomNumber); | ||
70 | - if (!"".equals(eeId)) { | ||
71 | - ElectricityMeter energyInfoForRealTime = electricityMeterService.getEnergyInfoForRealTime(eeId); | ||
72 | - Map<String, Object> eeMap = new HashMap<>(); | ||
73 | - if (energyInfoForRealTime != null) { | ||
74 | - eeMap.put("deviceId", energyInfoForRealTime.getDeviceId()); | ||
75 | - eeMap.put("balance", energyInfoForRealTime.getBalance()); | ||
76 | - eeMap.put("wmId", ""); | ||
77 | - list.add(eeMap); | ||
78 | - } | ||
79 | - } | ||
80 | - return list; | ||
81 | - } | ||
82 | - return null; | ||
83 | - } catch (Exception e) { | ||
84 | - e.printStackTrace(); | ||
85 | - return null; | ||
86 | - } | ||
87 | - } | ||
88 | - | ||
89 | - | ||
90 | -} |
1 | -package com.sunyo.energy.location.service.imp; | ||
2 | - | ||
3 | -import com.github.pagehelper.Page; | ||
4 | -import com.github.pagehelper.PageHelper; | ||
5 | -import com.github.pagehelper.PageInfo; | ||
6 | -import com.sunyo.energy.location.dao.PayRecordsMapper; | ||
7 | -import com.sunyo.energy.location.model.PayRecords; | ||
8 | -import com.sunyo.energy.location.service.PayOrderService; | ||
9 | -import org.springframework.beans.factory.annotation.Autowired; | ||
10 | -import org.springframework.stereotype.Service; | ||
11 | -import org.springframework.util.StringUtils; | ||
12 | - | ||
13 | -import java.util.ArrayList; | ||
14 | -import java.util.List; | ||
15 | - | ||
16 | -/** | ||
17 | - * Created by XYH on 2019/12/16. | ||
18 | - */ | ||
19 | -@Service | ||
20 | -public class PayOrderImpl implements PayOrderService { | ||
21 | - @Autowired | ||
22 | - PayRecordsMapper recordsMapper; | ||
23 | - | ||
24 | - | ||
25 | - @Override | ||
26 | - public PageInfo<PayRecords> getOrder(int pageSize, int pageNum, String orderNumber, String payTime, String username, String payType) { | ||
27 | - | ||
28 | - // 开始时间 | ||
29 | - String startTime = ""; | ||
30 | - // 结束时间 | ||
31 | - String endTime = ""; | ||
32 | - | ||
33 | - Page<PayRecords> page = PageHelper.startPage(pageNum, pageSize); | ||
34 | - | ||
35 | - if (!StringUtils.isEmpty(payTime) && !payTime.contains("undefined")) { | ||
36 | - String[] split = payTime.split(","); | ||
37 | - startTime = split[0].toString(); | ||
38 | - endTime = split[1].toString(); | ||
39 | - } | ||
40 | - List<PayRecords> list = new ArrayList<>(); | ||
41 | - if ("admin".equals(username)) { | ||
42 | - username = ""; | ||
43 | - list = recordsMapper.findAll(orderNumber, startTime, endTime, username, payType); | ||
44 | - } else { | ||
45 | - list = recordsMapper.findAll(orderNumber, startTime, endTime, username, payType); | ||
46 | - } | ||
47 | - | ||
48 | - | ||
49 | - PageInfo<PayRecords> result = new PageInfo<>(list); | ||
50 | - return result; | ||
51 | - } | ||
52 | - | ||
53 | - @Override | ||
54 | - public int addOrder(PayRecords payRecords) { | ||
55 | - return recordsMapper.insert(payRecords); | ||
56 | - } | ||
57 | - | ||
58 | - @Override | ||
59 | - public int ediOrder(PayRecords payRecords) { | ||
60 | - return recordsMapper.updateByPrimaryKey(payRecords); | ||
61 | - } | ||
62 | - | ||
63 | - @Override | ||
64 | - public int delOrder(PayRecords payRecords) { | ||
65 | - return recordsMapper.deleteByPrimaryKey(payRecords.getId()); | ||
66 | - } | ||
67 | -} |
src/main/java/com/sunyo/energy/location/service/imp/WaterElectricityParameterServiceImp.java
已删除
100644 → 0
1 | -package com.sunyo.energy.location.service.imp; | ||
2 | - | ||
3 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
4 | -import com.sunyo.energy.location.dao.WaterElectricityParameterMapper; | ||
5 | -import com.sunyo.energy.location.model.WaterElectricityParameter; | ||
6 | -import com.sunyo.energy.location.service.WaterElectricityParameterService; | ||
7 | -import org.springframework.beans.factory.annotation.Autowired; | ||
8 | -import org.springframework.stereotype.Service; | ||
9 | -import org.springframework.util.StringUtils; | ||
10 | - | ||
11 | -import java.util.Date; | ||
12 | -import java.util.List; | ||
13 | - | ||
14 | -@Service | ||
15 | -public class WaterElectricityParameterServiceImp implements WaterElectricityParameterService { | ||
16 | - | ||
17 | - @Autowired | ||
18 | - private WaterElectricityParameterMapper waterElectricityParameterMapper; | ||
19 | - | ||
20 | - @Override | ||
21 | - public int insertSelective(WaterElectricityParameter record) { | ||
22 | - | ||
23 | - | ||
24 | - record.setCreattime(new Date()); | ||
25 | - return waterElectricityParameterMapper.insertSelective(record); | ||
26 | - } | ||
27 | - | ||
28 | - @Override | ||
29 | - public int updateByPrimaryKeySelective(WaterElectricityParameter record) { | ||
30 | - | ||
31 | - return waterElectricityParameterMapper.updateByPrimaryKeySelective(record); | ||
32 | - } | ||
33 | - | ||
34 | - @Override | ||
35 | - public int countOne(String eeId) { | ||
36 | - return waterElectricityParameterMapper.countOne(eeId); | ||
37 | - } | ||
38 | - | ||
39 | - @Override | ||
40 | - public WaterElectricityParameter findOneElectricity(String eeId) { | ||
41 | - try { | ||
42 | - return waterElectricityParameterMapper.findOneElectricity(eeId); | ||
43 | - } catch (Exception e) { | ||
44 | - return null; | ||
45 | - } | ||
46 | - } | ||
47 | - | ||
48 | -} |
1 | -package com.sunyo.energy.location.service.imp; | ||
2 | - | ||
3 | -import com.alibaba.fastjson.JSON; | ||
4 | -import com.alibaba.fastjson.JSONArray; | ||
5 | -import com.sunyo.energy.location.controller.response.ResultJson; | ||
6 | -import com.sunyo.energy.location.dao.LocationMapper; | ||
7 | -import com.sunyo.energy.location.dao.PayRecordsMapper; | ||
8 | -import com.sunyo.energy.location.dao.WaterMeterMapper; | ||
9 | -import com.sunyo.energy.location.demopay.QrDemo; | ||
10 | -import com.sunyo.energy.location.model.PayRecords; | ||
11 | -import com.sunyo.energy.location.model.WaterMeter; | ||
12 | -import com.sunyo.energy.location.service.WaterMeterService; | ||
13 | -import com.sunyo.energy.location.utils.AllUtils; | ||
14 | -import com.sunyo.energy.location.utils.HttpsUtils; | ||
15 | -import org.springframework.beans.factory.annotation.Autowired; | ||
16 | -import org.springframework.beans.factory.annotation.Value; | ||
17 | -import org.springframework.scheduling.annotation.Scheduled; | ||
18 | -import org.springframework.stereotype.Service; | ||
19 | - | ||
20 | -import java.io.UnsupportedEncodingException; | ||
21 | -import java.math.BigDecimal; | ||
22 | -import java.util.Date; | ||
23 | -import java.util.HashMap; | ||
24 | -import java.util.List; | ||
25 | -import java.util.Map; | ||
26 | - | ||
27 | - | ||
28 | -@Service | ||
29 | -public class WaterMeterServiceImp implements WaterMeterService { | ||
30 | - | ||
31 | - @Autowired | ||
32 | - private WaterMeterMapper waterMeterMapper; | ||
33 | - | ||
34 | - @Autowired | ||
35 | - private PayRecordsMapper payRecordsMapper; | ||
36 | - | ||
37 | - @Autowired | ||
38 | - private LocationMapper locationMapper; | ||
39 | - | ||
40 | - @Value("${payInfo.merchantid}") | ||
41 | - private String MERCHANTIDS; | ||
42 | - | ||
43 | - @Value("${payInfo.posid}") | ||
44 | - private String POSIDS; | ||
45 | - | ||
46 | - @Value("${payInfo.branchid}") | ||
47 | - private String BRANCHIDS; | ||
48 | - | ||
49 | - @Value("${payInfo.txcode}") | ||
50 | - private String TXCODES; | ||
51 | - | ||
52 | - @Value("${payInfo.pub32tr2}") | ||
53 | - private String PUB32TR2S; | ||
54 | - /** | ||
55 | - * 查询所有水表 | ||
56 | - */ | ||
57 | - private static final String selectUrl = "http://123.56.159.203:8023/nowwmrd/getSelectNowwmrdbyMtId"; | ||
58 | - | ||
59 | - private static final String payUrl = "http://123.56.159.203:8023/mtfmset/allWMadd"; | ||
60 | - | ||
61 | - private static final String addUrl = "http://123.56.159.203:8023/nowwmrd/getSelectNowwmrdbyProjectID"; | ||
62 | - | ||
63 | - | ||
64 | - @Override | ||
65 | - @Scheduled(cron = "0 0 03 * * ?") | ||
66 | - public int realTime() { | ||
67 | - | ||
68 | - try { | ||
69 | - | ||
70 | - Map<String, Object> datas = new HashMap<>(); | ||
71 | - datas.put("ProjectID", "33-99-00-00-00-00-01"); | ||
72 | - // 远程调用 | ||
73 | - String s = HttpsUtils.httpRequest(addUrl, datas); | ||
74 | - JSONArray jsonArray = JSON.parseArray(s); | ||
75 | - for (Object jsonObject : jsonArray) { | ||
76 | - WaterMeter waterMeter = new WaterMeter(); | ||
77 | - Map<String, Object> map = (Map) jsonObject; | ||
78 | - if (!map.containsKey("state")) { | ||
79 | - waterMeter.setWmId(map.get("wm_id").toString()); | ||
80 | - waterMeter.setWmErrmessage(map.get("wm_errmessage").toString()); | ||
81 | - waterMeter.setWmFmstate(map.get("wm_fmstate").toString()); | ||
82 | - waterMeter.setWmSacc(map.get("wm_sacc").toString()); | ||
83 | - waterMeter.setWmLacc(map.get("wm_lacc").toString()); | ||
84 | - waterMeter.setWmRdtime(map.get("wm_rdtime").toString()); | ||
85 | - waterMeter.setWmSignalpower(map.get("wm_signalpower").toString()); | ||
86 | - waterMeter.setWmVoltage(map.get("wm_voltage").toString()); | ||
87 | - waterMeter.setCreattime(new Date()); | ||
88 | - waterMeter.setReamke1(map.get("wm_sacc").toString()); | ||
89 | - waterMeterMapper.insertSelective(waterMeter); | ||
90 | - } else { | ||
91 | - if ("0".equals(map.get("state").toString())) { | ||
92 | - return 1; | ||
93 | - } | ||
94 | - return 0; | ||
95 | - } | ||
96 | - } | ||
97 | - return 1; | ||
98 | - } catch (Exception e) { | ||
99 | - e.printStackTrace(); | ||
100 | - return 0; | ||
101 | - } | ||
102 | - } | ||
103 | - | ||
104 | - @Override | ||
105 | - public WaterMeter findRealTime(String wmId) { | ||
106 | - try { | ||
107 | - Map<String, Object> datas = new HashMap<>(); | ||
108 | - datas.put("MtId", wmId); | ||
109 | - | ||
110 | - String s = HttpsUtils.httpRequest(selectUrl, datas); | ||
111 | - JSONArray jsonArray = JSON.parseArray(s); | ||
112 | - WaterMeter waterMeter = new WaterMeter(); | ||
113 | - for (Object jsonObject : jsonArray) { | ||
114 | - | ||
115 | - Map<String, Object> map = (Map) jsonObject; | ||
116 | - if (!map.containsKey("state")) { | ||
117 | - waterMeter.setWmId(map.get("wm_id").toString()); | ||
118 | - waterMeter.setWmErrmessage(map.get("wm_errmessage").toString()); | ||
119 | - waterMeter.setWmFmstate(map.get("wm_fmstate").toString()); | ||
120 | - waterMeter.setWmSacc(map.get("wm_sacc").toString()); | ||
121 | - waterMeter.setWmLacc(map.get("wm_lacc").toString()); | ||
122 | - waterMeter.setWmRdtime(map.get("wm_rdtime").toString()); | ||
123 | - waterMeter.setWmSignalpower(map.get("wm_signalpower").toString()); | ||
124 | - waterMeter.setWmVoltage(map.get("wm_voltage").toString()); | ||
125 | - } | ||
126 | - } | ||
127 | - return waterMeter; | ||
128 | - } catch (Exception e) { | ||
129 | - e.printStackTrace(); | ||
130 | - return new WaterMeter(); | ||
131 | - } | ||
132 | - } | ||
133 | - | ||
134 | - /** | ||
135 | - * 水费充值 换算总水量 生成订单 | ||
136 | - * | ||
137 | - * @param payFees | ||
138 | - * @param wmId | ||
139 | - * @return | ||
140 | - */ | ||
141 | - @Override | ||
142 | - public ResultJson payWater(String payFees, String wmId) { | ||
143 | - | ||
144 | - ResultJson<Object> resultJson = new ResultJson<>(); | ||
145 | - try { | ||
146 | - // 得到请求接口 返回值 和总水量 | ||
147 | - Map<String, Object> map = allWater(payFees, wmId); | ||
148 | - Map hashMap = JSON.parseObject(map.get("status").toString(), HashMap.class); | ||
149 | - if ("0".equals(hashMap.get("state").toString())) { | ||
150 | - int update = waterMeterMapper.update(wmId, map.get("allSacc").toString()); | ||
151 | - resultJson.setCode("200"); | ||
152 | - } else { | ||
153 | - resultJson.setCode("203"); | ||
154 | - } | ||
155 | - return resultJson; | ||
156 | - } catch (Exception e) { | ||
157 | - e.printStackTrace(); | ||
158 | - resultJson.setCode("203"); | ||
159 | - return resultJson; | ||
160 | - } | ||
161 | - } | ||
162 | - | ||
163 | - @Override | ||
164 | - public ResultJson waterMeterAll(String wmId) { | ||
165 | - ResultJson<Object> resultJson = new ResultJson<>(); | ||
166 | - try { | ||
167 | - | ||
168 | - List<WaterMeter> waterMeterList = waterMeterMapper.waterMeterAll(wmId); | ||
169 | - | ||
170 | - return new ResultJson("200", "success", waterMeterList); | ||
171 | - } catch (Exception e) { | ||
172 | - e.printStackTrace(); | ||
173 | - resultJson.setCode("203"); | ||
174 | - return resultJson; | ||
175 | - } | ||
176 | - } | ||
177 | - | ||
178 | - // 请求返回二维码 | ||
179 | - @Override | ||
180 | - public ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException { | ||
181 | - ResultJson<Object> resultJson = new ResultJson<>(); | ||
182 | - QrDemo qrDemo = new QrDemo(MERCHANTIDS,POSIDS,BRANCHIDS,TXCODES,PUB32TR2S); | ||
183 | - // 成功生成水费订单 | ||
184 | - if (!"".equals(wmId)) { | ||
185 | - PayRecords payRecords = payRecords(payFees, wmId, userId, realName, ""); | ||
186 | - // 请求返回二维码lujing | ||
187 | - String url = qrDemo.orUrl(payRecords.getOrdernumber(), payFees); | ||
188 | - | ||
189 | - if (!"".equals(url)) { | ||
190 | - payRecords.setReamke2(url); | ||
191 | - // 返回map 包含订单号 二维码url | ||
192 | - Map<String, Object> map = new HashMap<>(); | ||
193 | - map.put("url", url); | ||
194 | - map.put("orderNumber", payRecords.getOrdernumber()); | ||
195 | - resultJson.setData(map); | ||
196 | - } | ||
197 | - int i = payRecordsMapper.insertSelective(payRecords); | ||
198 | - if (i > 0) { | ||
199 | - resultJson.setCode("200"); | ||
200 | - } | ||
201 | - } else { | ||
202 | - | ||
203 | - PayRecords payRecords = payRecords(payFees, "", userId, realName, eeId); | ||
204 | - // 请求返回二维码lujing | ||
205 | - String url = qrDemo.orUrl(payRecords.getOrdernumber(), payFees); | ||
206 | - | ||
207 | - if (!"".equals(url)) { | ||
208 | - payRecords.setReamke2(url); | ||
209 | - // 返回map 包含订单号 二维码url | ||
210 | - Map<String, Object> map = new HashMap<>(); | ||
211 | - map.put("url", url); | ||
212 | - map.put("orderNumber", payRecords.getOrdernumber()); | ||
213 | - resultJson.setData(map); | ||
214 | - } | ||
215 | - int i = payRecordsMapper.insertSelective(payRecords); | ||
216 | - if (i > 0) { | ||
217 | - resultJson.setCode("200"); | ||
218 | - } | ||
219 | - } | ||
220 | - | ||
221 | - return resultJson; | ||
222 | - } | ||
223 | - | ||
224 | - /** | ||
225 | - * 总水量 换算 | ||
226 | - * | ||
227 | - * @param payFees | ||
228 | - * @param wmId | ||
229 | - * @return | ||
230 | - * @throws Exception | ||
231 | - */ | ||
232 | - public Map<String, Object> allWater(String payFees, String wmId) throws Exception { | ||
233 | - | ||
234 | - // 充值最后立方水数值 | ||
235 | - String s = AllUtils.nubmerDivision(payFees); | ||
236 | - // 查询累计充值量 | ||
237 | - WaterMeter realTime = findRealTime(wmId); | ||
238 | - String allSacc = AllUtils.nubmerAdd(s, realTime.getWmSacc()); | ||
239 | - Map<String, Object> datas = new HashMap<>(); | ||
240 | - datas.put("MtId", wmId); | ||
241 | - datas.put("Add_sacc", allSacc); | ||
242 | - datas.put("Add_addmode", "2"); | ||
243 | - String status = HttpsUtils.httpRequest(payUrl, datas); | ||
244 | - datas.put("allSacc", allSacc); | ||
245 | - datas.put("status", status); | ||
246 | - | ||
247 | - return datas; | ||
248 | - } | ||
249 | - | ||
250 | - /** | ||
251 | - * 订单生成 | ||
252 | - * | ||
253 | - * @param payFees | ||
254 | - * @param wmId | ||
255 | - * @param userId | ||
256 | - * @param realName | ||
257 | - * @return | ||
258 | - */ | ||
259 | - public PayRecords payRecords(String payFees, String wmId, String userId, String realName, String eeId) { | ||
260 | - | ||
261 | - PayRecords payRecords = new PayRecords(); | ||
262 | - payRecords.setOrdernumber(AllUtils.getOrderIdByTime()); | ||
263 | - payRecords.setPayfees(new BigDecimal(payFees)); | ||
264 | - payRecords.setPaystatus(false); | ||
265 | - if (!"".equals(wmId)) { | ||
266 | - payRecords.setPaytype(false); | ||
267 | - payRecords.setPaytypeaddress(wmId); | ||
268 | - String roomNumber = locationMapper.selectRoomNumber(wmId); | ||
269 | - payRecords.setPaylocationname(roomNumber); | ||
270 | - } else { | ||
271 | - payRecords.setPaytype(true); | ||
272 | - payRecords.setPaytypeaddress(eeId); | ||
273 | - String roomNumber = locationMapper.selectRoomNumberElectricity(eeId); | ||
274 | - payRecords.setPaylocationname(roomNumber); | ||
275 | - } | ||
276 | - payRecords.setReamke1("0"); | ||
277 | - payRecords.setPayuserid(Integer.valueOf(userId)); | ||
278 | - payRecords.setPaytime(new Date()); | ||
279 | - payRecords.setPayusername(realName); | ||
280 | - | ||
281 | - | ||
282 | - return payRecords; | ||
283 | - } | ||
284 | -} |
1 | -package com.sunyo.energy.location.utils; | ||
2 | - | ||
3 | -import java.math.BigDecimal; | ||
4 | -import java.math.RoundingMode; | ||
5 | -import java.text.SimpleDateFormat; | ||
6 | -import java.util.Date; | ||
7 | -import java.util.Random; | ||
8 | - | ||
9 | -public class AllUtils { | ||
10 | - | ||
11 | - // 数字相减 参数1 减去 参数2 | ||
12 | - public static String nubmerSubtraction(String sacc, String lacc) { | ||
13 | - | ||
14 | - BigDecimal saccBigDecimal = new BigDecimal(sacc); | ||
15 | - BigDecimal laccBigDecimal = new BigDecimal(lacc); | ||
16 | - | ||
17 | - String surplus = saccBigDecimal.subtract(laccBigDecimal).toString(); | ||
18 | - | ||
19 | - return surplus; | ||
20 | - | ||
21 | - } | ||
22 | - | ||
23 | - // 数字相除 参数1 除以参数2 | ||
24 | - public static String nubmerDivision(String payFees) { | ||
25 | - | ||
26 | - // 单价 | ||
27 | - String unitprice = PropertiesLoader.getUnitPrice("unitprice"); | ||
28 | - BigDecimal payFessDecimal = new BigDecimal(payFees); | ||
29 | - BigDecimal unitpriceDecimal = new BigDecimal(unitprice); | ||
30 | - | ||
31 | - String s = payFessDecimal.divide(unitpriceDecimal, 2, RoundingMode.HALF_UP).toString(); | ||
32 | - return s; | ||
33 | - | ||
34 | - } | ||
35 | - | ||
36 | - | ||
37 | - //数字相加 参数1加参数2 | ||
38 | - public static String nubmerAdd(String oneWmSacc, String s) { | ||
39 | - | ||
40 | - BigDecimal bigDecimal = new BigDecimal(oneWmSacc); | ||
41 | - BigDecimal bigDecimal1 = new BigDecimal(s); | ||
42 | - String s1 = bigDecimal.add(bigDecimal1).toString(); | ||
43 | - return s1; | ||
44 | - } | ||
45 | - | ||
46 | - | ||
47 | - // 订单号生成 时间加随机数 | ||
48 | - public static String getOrderIdByTime() { | ||
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); | ||
55 | - } | ||
56 | - return merchantId + result; | ||
57 | - } | ||
58 | - | ||
59 | - | ||
60 | -} |
1 | -package com.sunyo.energy.location.utils; | ||
2 | - | ||
3 | -import sun.misc.BASE64Encoder; | ||
4 | - | ||
5 | -import java.security.MessageDigest; | ||
6 | - | ||
7 | -/** | ||
8 | - * @author shenhailong | ||
9 | - * <p> | ||
10 | - * 2020/6/2/17:30 | ||
11 | - */ | ||
12 | -public class Md5Utils { | ||
13 | - | ||
14 | - /** | ||
15 | - * 通用加密方法 | ||
16 | - * | ||
17 | - * @param str 需要加密的字符串 | ||
18 | - * @param isUpper 字母大小写(false为小写,true为大写) | ||
19 | - * @param bit 加密的位数(16,32,64) | ||
20 | - * @return | ||
21 | - */ | ||
22 | - public static String getMD5(String str, boolean isUpper, Integer bit) { | ||
23 | - String md5 = null; | ||
24 | - try { | ||
25 | - // 创建加密对象 | ||
26 | - MessageDigest md = MessageDigest.getInstance("md5"); | ||
27 | - if (bit == 64) { | ||
28 | - BASE64Encoder bw = new BASE64Encoder(); | ||
29 | - md5 = bw.encode(md.digest(str.getBytes("utf-8"))); | ||
30 | - } else { | ||
31 | - // 计算MD5函数 | ||
32 | - md.update(str.getBytes()); | ||
33 | - byte b[] = md.digest(); | ||
34 | - int i; | ||
35 | - StringBuilder sb = new StringBuilder(); | ||
36 | - for (byte aB : b) { | ||
37 | - i = aB; | ||
38 | - if (i < 0) { | ||
39 | - i += 256; | ||
40 | - } | ||
41 | - if (i < 16) { | ||
42 | - sb.append("0"); | ||
43 | - } | ||
44 | - sb.append(Integer.toHexString(i)); | ||
45 | - } | ||
46 | - md5 = sb.toString(); | ||
47 | - if (bit == 16) { | ||
48 | - //截取32位md5为16位 | ||
49 | - md5 = md5.substring(8, 24); | ||
50 | - if (isUpper) { | ||
51 | - md5 = md5.toUpperCase(); | ||
52 | - } | ||
53 | - return md5; | ||
54 | - } | ||
55 | - } | ||
56 | - //转换成大写 | ||
57 | - if (isUpper) { | ||
58 | - md5 = md5.toUpperCase(); | ||
59 | - } | ||
60 | - } catch (Exception e) { | ||
61 | - e.printStackTrace(); | ||
62 | - } | ||
63 | - return md5; | ||
64 | - } | ||
65 | - | ||
66 | -} |
1 | -package com.sunyo.energy.location.websocket; | ||
2 | - | ||
3 | -import java.nio.charset.Charset; | ||
4 | -import java.util.ArrayList; | ||
5 | -import java.util.List; | ||
6 | - | ||
7 | -import org.springframework.boot.autoconfigure.http.HttpMessageConverters; | ||
8 | -import org.springframework.context.annotation.Bean; | ||
9 | -import org.springframework.context.annotation.Configuration; | ||
10 | -import org.springframework.http.MediaType; | ||
11 | -import org.springframework.http.converter.StringHttpMessageConverter; | ||
12 | - | ||
13 | -import com.alibaba.fastjson.support.config.FastJsonConfig; | ||
14 | -import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; | ||
15 | - | ||
16 | -/** | ||
17 | - * 添加fastjson的转换 | ||
18 | - */ | ||
19 | -@Configuration | ||
20 | -public class FastjsonConverter { | ||
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 | - } | ||
51 | -} |
1 | -package com.sunyo.energy.location.websocket; | ||
2 | - | ||
3 | -import org.springframework.context.annotation.Bean; | ||
4 | -import org.springframework.context.annotation.Configuration; | ||
5 | -import org.springframework.web.socket.server.standard.ServerEndpointExporter; | ||
6 | - | ||
7 | -@Configuration | ||
8 | -public class WebSocketConfig { | ||
9 | - | ||
10 | - @Bean | ||
11 | - public ServerEndpointExporter serverEndpointExporter() { | ||
12 | - return new ServerEndpointExporter(); | ||
13 | - } | ||
14 | - | ||
15 | -} |
1 | -package com.sunyo.energy.location.websocket; | ||
2 | - | ||
3 | - | ||
4 | -import com.alibaba.fastjson.JSON; | ||
5 | -import com.alibaba.fastjson.JSONObject; | ||
6 | -import org.apache.commons.lang.StringUtils; | ||
7 | -import cn.hutool.log.Log; | ||
8 | -import cn.hutool.log.LogFactory; | ||
9 | -import org.springframework.stereotype.Component; | ||
10 | - | ||
11 | -import javax.websocket.*; | ||
12 | -import javax.websocket.server.PathParam; | ||
13 | -import javax.websocket.server.ServerEndpoint; | ||
14 | -import java.io.IOException; | ||
15 | -import java.util.concurrent.ConcurrentHashMap; | ||
16 | - | ||
17 | - | ||
18 | -/** | ||
19 | - * WebSocketServer | ||
20 | - * | ||
21 | - * @author zhengkai.blog.csdn.net | ||
22 | - */ | ||
23 | -@ServerEndpoint("/imserver") | ||
24 | -@Component | ||
25 | -public class WebSocketServer { | ||
26 | - | ||
27 | - static Log log = LogFactory.get(WebSocketServer.class); | ||
28 | - /** | ||
29 | - * 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 | ||
30 | - */ | ||
31 | - private static int onlineCount = 0; | ||
32 | - /** | ||
33 | - * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 | ||
34 | - */ | ||
35 | - private static ConcurrentHashMap<String, WebSocketServer> webSocketMap = new ConcurrentHashMap<>(); | ||
36 | - /** | ||
37 | - * 与某个客户端的连接会话,需要通过它来给客户端发送数据 | ||
38 | - */ | ||
39 | - private Session session; | ||
40 | - /** | ||
41 | - * 接收userId | ||
42 | - */ | ||
43 | - private String orderNum = ""; | ||
44 | - | ||
45 | - /** | ||
46 | - * 连接建立成功调用的方法 | ||
47 | - */ | ||
48 | - @OnOpen | ||
49 | - public void onOpen(Session session) { | ||
50 | - this.session = session; | ||
51 | - this.orderNum = orderNum; | ||
52 | - if (webSocketMap.containsKey(orderNum)) { | ||
53 | - webSocketMap.remove(orderNum); | ||
54 | - webSocketMap.put(orderNum, this); | ||
55 | - //加入set中 | ||
56 | - } else { | ||
57 | - webSocketMap.put(orderNum, this); | ||
58 | - //加入set中 | ||
59 | - addOnlineCount(); | ||
60 | - //在线数加1 | ||
61 | - } | ||
62 | - | ||
63 | - log.info("用户连接:" + orderNum + ",当前在线人数为:" + getOnlineCount()); | ||
64 | - | ||
65 | - try { | ||
66 | - sendMessage("连接成功"); | ||
67 | - } catch (IOException e) { | ||
68 | - log.error("用户:" + orderNum + ",网络异常!!!!!!"); | ||
69 | - } | ||
70 | - } | ||
71 | - | ||
72 | - /** | ||
73 | - * 连接关闭调用的方法 | ||
74 | - */ | ||
75 | - @OnClose | ||
76 | - public void onClose() { | ||
77 | - if (webSocketMap.containsKey(orderNum)) { | ||
78 | - webSocketMap.remove(orderNum); | ||
79 | - //从set中删除 | ||
80 | - subOnlineCount(); | ||
81 | - } | ||
82 | - log.info("用户退出:" + orderNum + ",当前在线人数为:" + getOnlineCount()); | ||
83 | - } | ||
84 | - | ||
85 | - /** | ||
86 | - * 收到客户端消息后调用的方法 | ||
87 | - * | ||
88 | - * @param message 客户端发送过来的消息*/ | ||
89 | -// @OnMessage | ||
90 | -// public void onMessage(String message, Session session) { | ||
91 | -// log.info("用户消息:"+orderNum+",报文:"+message); | ||
92 | -// //可以群发消息 | ||
93 | -// //消息保存到数据库、redis | ||
94 | -// if(StringUtils.isNotBlank(message)){ | ||
95 | -// try { | ||
96 | -//// //解析发送的报文 | ||
97 | -//// JSONObject jsonObject = JSON.parseObject(message); | ||
98 | -//// //追加发送人(防止串改) | ||
99 | -//// jsonObject.put("fromOrderNum",this.orderNum); | ||
100 | -//// String toUserId=jsonObject.getString("toUserId"); | ||
101 | -//// //传送给对应toUserId用户的websocket | ||
102 | -//// if(StringUtils.isNotBlank(toUserId)&&webSocketMap.containsKey(toUserId)){ | ||
103 | -//// webSocketMap.get(toUserId).sendMessage(jsonObject.toJSONString()); | ||
104 | -//// }else{ | ||
105 | -//// log.error("请求的userId:"+toUserId+"不在该服务器上"); | ||
106 | -//// //否则不在这个服务器上,发送到mysql或者redis | ||
107 | -//// } | ||
108 | -// }catch (Exception e){ | ||
109 | -// e.printStackTrace(); | ||
110 | -// } | ||
111 | -// } | ||
112 | -// } | ||
113 | - | ||
114 | - /** | ||
115 | - * 群发消息 | ||
116 | - * | ||
117 | - * @param content 要广播的内容 | ||
118 | - */ | ||
119 | - public void broadcast(String content) { | ||
120 | - for (ConcurrentHashMap.Entry<String, WebSocketServer> entry : webSocketMap.entrySet()) { | ||
121 | - WebSocketServer webSocketServerE = entry.getValue(); | ||
122 | - try { | ||
123 | - webSocketServerE.sendMessage(content); | ||
124 | - } catch (IOException e) { | ||
125 | - e.printStackTrace(); | ||
126 | - } | ||
127 | - | ||
128 | - System.out.println(entry.getKey() + ":" + entry.getValue()); | ||
129 | - } | ||
130 | - } | ||
131 | - | ||
132 | - /** | ||
133 | - * @param session | ||
134 | - * @param error | ||
135 | - */ | ||
136 | - @OnError | ||
137 | - public void onError(Session session, Throwable error) { | ||
138 | - log.error("用户错误:" + this.orderNum + ",原因:" + error.getMessage()); | ||
139 | - error.printStackTrace(); | ||
140 | - } | ||
141 | - | ||
142 | - /** | ||
143 | - * 实现服务器主动推送 | ||
144 | - */ | ||
145 | - public void sendMessage(String message) throws IOException { | ||
146 | - this.session.getBasicRemote().sendText(message); | ||
147 | - } | ||
148 | - | ||
149 | - | ||
150 | - /** | ||
151 | - * 发送自定义消息 | ||
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)) { | ||
156 | - webSocketMap.get(orderNum).sendMessage(message); | ||
157 | - } else { | ||
158 | - log.error("用户" + orderNum + ",不在线!"); | ||
159 | - } | ||
160 | - } | ||
161 | - | ||
162 | - public static synchronized int getOnlineCount() { | ||
163 | - return onlineCount; | ||
164 | - } | ||
165 | - | ||
166 | - public static synchronized void addOnlineCount() { | ||
167 | - WebSocketServer.onlineCount++; | ||
168 | - } | ||
169 | - | ||
170 | - public static synchronized void subOnlineCount() { | ||
171 | - WebSocketServer.onlineCount--; | ||
172 | - } | ||
173 | -} |
@@ -4,7 +4,8 @@ | @@ -4,7 +4,8 @@ | ||
4 | "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> | 4 | "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> |
5 | <generatorConfiguration> | 5 | <generatorConfiguration> |
6 | <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> | 6 | <!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包--> |
7 | - <classPathEntry location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/> | 7 | + <classPathEntry |
8 | + location="/Users/shenhailong/.m2/repository/mysql/mysql-connector-java/5.1.30/mysql-connector-java-5.1.30.jar"/> | ||
8 | <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>--> | 9 | <!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>--> |
9 | <context id="DB2Tables" targetRuntime="MyBatis3"> | 10 | <context id="DB2Tables" targetRuntime="MyBatis3"> |
10 | <commentGenerator> | 11 | <commentGenerator> |
@@ -41,10 +42,13 @@ | @@ -41,10 +42,13 @@ | ||
41 | <property name="enableSubPackages" value="true"/> | 42 | <property name="enableSubPackages" value="true"/> |
42 | </sqlMapGenerator> | 43 | </sqlMapGenerator> |
43 | <!-- 生成DAO的包名和位置--> | 44 | <!-- 生成DAO的包名和位置--> |
44 | - <javaClientGenerator type="XMLMAPPER" targetPackage="com.sunyo.energy.location.dao" targetProject="src/main/java"> | 45 | + <javaClientGenerator type="XMLMAPPER" targetPackage="com.sunyo.energy.location.dao" |
46 | + targetProject="src/main/java"> | ||
45 | <property name="enableSubPackages" value="true"/> | 47 | <property name="enableSubPackages" value="true"/> |
46 | </javaClientGenerator> | 48 | </javaClientGenerator> |
47 | <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> | 49 | <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> |
48 | - <table tableName="pay_response" domainObjectName="PayResponse" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="true"></table> | 50 | + <table tableName="electricity_info" domainObjectName="ElectricityInfo" enableCountByExample="false" |
51 | + enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" | ||
52 | + selectByExampleQueryId="true"></table> | ||
49 | </context> | 53 | </context> |
50 | </generatorConfiguration> | 54 | </generatorConfiguration> |
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" > | ||
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 | ||
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> | ||
32 | - | ||
33 | - <select id="selectAllAdrName" resultMap="BaseResultMap" parameterType="java.lang.String"> | ||
34 | - select | ||
35 | - * | ||
36 | - from location | ||
37 | - where | ||
38 | - adrName = #{adrname, jdbcType=VARCHAR} | ||
39 | - </select> | ||
40 | - | ||
41 | - <select id="waterId_eleId" resultMap="BaseResultMap" parameterType="string"> | ||
42 | - select * from location where adrName = #{adrname, jdbcType=VARCHAR} | ||
43 | - </select> | ||
44 | - | ||
45 | - <select id="userPayList" resultType="java.util.HashMap"> | ||
46 | - select | ||
47 | - wm.wm_id as wmId, wm.wm_fmstate as wmFmstate, | ||
48 | - wm.wm_lacc as wmLacc, wm.wm_sacc as wmSacc | ||
49 | - from | ||
50 | - location lon | ||
51 | - left join | ||
52 | - water_meter wm on lon.wm_id = wm.wm_id | ||
53 | - where | ||
54 | - lon.adrName=#{value,jdbcType=VARCHAR} | ||
55 | - </select> | ||
56 | - | ||
57 | - <select id="selectRoomNumber" parameterType="java.lang.String" resultType="java.lang.String"> | ||
58 | - select | ||
59 | - adrName | ||
60 | - from | ||
61 | - location | ||
62 | - where | ||
63 | - wm_id = #{value, jdbcType=VARCHAR} | ||
64 | - </select> | ||
65 | - | ||
66 | - <select id="selectRoomNumberElectricity" parameterType="java.lang.String" resultType="java.lang.String"> | ||
67 | - select | ||
68 | - adrName | ||
69 | - from | ||
70 | - location | ||
71 | - where | ||
72 | - ee_id = #{value, jdbcType=VARCHAR} | ||
73 | - </select> | ||
74 | - | ||
75 | - <select id="countAdrName" resultType="int" parameterType="map"> | ||
76 | - select count(adrName) from location where adrName = #{adrName, jdbcType=VARCHAR} and parent = #{parent, jdbcType=VARCHAR} | ||
77 | - </select> | ||
78 | - | ||
79 | - <select id="countParent" parameterType="int" resultType="int"> | ||
80 | - select count(parent) from location where parent = #{value} | ||
81 | - </select> | ||
82 | - | ||
83 | - <select id="findWmId" parameterType="string" resultType="string"> | ||
84 | - select wm_id from location where adrname = #{value} | ||
85 | - </select> | ||
86 | - | ||
87 | - <select id="eeId" parameterType="string" resultType="string"> | ||
88 | - select ee_id from location where adrname = #{value} | ||
89 | - </select> | ||
90 | - | ||
91 | - <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | ||
92 | - delete from location | ||
93 | - where id = #{id,jdbcType=INTEGER} | ||
94 | - </delete> | ||
95 | - <insert id="insert" parameterType="com.sunyo.energy.location.model.Location"> | ||
96 | - insert into location (id, adrName, parent, | ||
97 | - type) | ||
98 | - values (#{id,jdbcType=INTEGER}, #{adrname,jdbcType=VARCHAR}, #{parent,jdbcType=INTEGER}, | ||
99 | - #{type,jdbcType=INTEGER}) | ||
100 | - </insert> | ||
101 | - <insert id="insertSelective" parameterType="com.sunyo.energy.location.model.Location"> | ||
102 | - insert into location | ||
103 | - <trim prefix="(" suffix=")" suffixOverrides=","> | ||
104 | - <if test="id != null"> | ||
105 | - id, | ||
106 | - </if> | ||
107 | - <if test="adrname != null"> | ||
108 | - adrName, | ||
109 | - </if> | ||
110 | - <if test="parent != null"> | ||
111 | - parent, | ||
112 | - </if> | ||
113 | - <if test="type != null"> | ||
114 | - type, | ||
115 | - </if> | ||
116 | - </trim> | ||
117 | - <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
118 | - <if test="id != null"> | ||
119 | - #{id,jdbcType=INTEGER}, | ||
120 | - </if> | ||
121 | - <if test="adrname != null"> | ||
122 | - #{adrname,jdbcType=VARCHAR}, | ||
123 | - </if> | ||
124 | - <if test="parent != null"> | ||
125 | - #{parent,jdbcType=INTEGER}, | ||
126 | - </if> | ||
127 | - <if test="type != null"> | ||
128 | - #{type,jdbcType=INTEGER}, | ||
129 | - </if> | ||
130 | - </trim> | ||
131 | - </insert> | ||
132 | - <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.Location"> | ||
133 | - update location | ||
134 | - <set> | ||
135 | - <if test="adrname != null"> | ||
136 | - adrName = #{adrname,jdbcType=VARCHAR}, | ||
137 | - </if> | ||
138 | - <if test="parent != null"> | ||
139 | - parent = #{parent,jdbcType=INTEGER}, | ||
140 | - </if> | ||
141 | - <if test="type != null"> | ||
142 | - type = #{type,jdbcType=INTEGER}, | ||
143 | - </if> | ||
144 | - <if test="wmid != null"> | ||
145 | - wm_id = #{wmid,jdbcType=VARCHAR}, | ||
146 | - </if> | ||
147 | - <if test="eeid != null"> | ||
148 | - ee_id = #{eeid,jdbcType=VARCHAR} | ||
149 | - </if> | ||
150 | - </set> | ||
151 | - where id = #{id,jdbcType=INTEGER} | ||
152 | - </update> | ||
153 | - <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.Location"> | ||
154 | - update location | ||
155 | - set adrName = #{adrname,jdbcType=VARCHAR}, | ||
156 | - parent = #{parent,jdbcType=INTEGER}, | ||
157 | - type = #{type,jdbcType=INTEGER} | ||
158 | - where id = #{id,jdbcType=INTEGER} | ||
159 | - </update> | ||
160 | - | ||
161 | - <update id="editEeId" parameterType="string"> | ||
162 | - update location | ||
163 | - set ee_id = #{deviceId,jdbcType=VARCHAR} | ||
164 | - where adrName = #{name,jdbcType=INTEGER} | ||
165 | - </update> | ||
166 | -</mapper> |
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" > | ||
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, | ||
26 | - TYPE, REFERER, CLIENTIP, ACCDATE, USRMSG, USRINFO, PAYTYPE, SIGN | ||
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"> | ||
35 | - delete from pay_response | ||
36 | - where ID = #{id,jdbcType=VARCHAR} | ||
37 | - </delete> | ||
38 | - <insert id="insert" parameterType="com.sunyo.energy.location.model.PayResponse"> | ||
39 | - insert into pay_response (ID, POSID, BRANCHID, | ||
40 | - ORDERID, PAYMENT, CURCODE, | ||
41 | - REMARK1, REMARK2, ACC_TYPE, | ||
42 | - SUCCESS, TYPE, REFERER, | ||
43 | - CLIENTIP, ACCDATE, USRMSG, | ||
44 | - USRINFO, PAYTYPE, SIGN | ||
45 | - ) | ||
46 | - values (#{id,jdbcType=VARCHAR}, #{posid,jdbcType=VARCHAR}, #{branchid,jdbcType=VARCHAR}, | ||
47 | - #{orderid,jdbcType=VARCHAR}, #{payment,jdbcType=DECIMAL}, #{curcode,jdbcType=VARCHAR}, | ||
48 | - #{remark1,jdbcType=VARCHAR}, #{remark2,jdbcType=VARCHAR}, #{accType,jdbcType=VARCHAR}, | ||
49 | - #{success,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{referer,jdbcType=VARCHAR}, | ||
50 | - #{clientip,jdbcType=VARCHAR}, #{accdate,jdbcType=TIMESTAMP}, #{usrmsg,jdbcType=VARCHAR}, | ||
51 | - #{usrinfo,jdbcType=VARCHAR}, #{paytype,jdbcType=VARCHAR}, #{sign,jdbcType=VARCHAR} | ||
52 | - ) | ||
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"> | ||
227 | - update pay_response | ||
228 | - set POSID = #{posid,jdbcType=VARCHAR}, | ||
229 | - BRANCHID = #{branchid,jdbcType=VARCHAR}, | ||
230 | - ORDERID = #{orderid,jdbcType=VARCHAR}, | ||
231 | - PAYMENT = #{payment,jdbcType=DECIMAL}, | ||
232 | - CURCODE = #{curcode,jdbcType=VARCHAR}, | ||
233 | - REMARK1 = #{remark1,jdbcType=VARCHAR}, | ||
234 | - REMARK2 = #{remark2,jdbcType=VARCHAR}, | ||
235 | - ACC_TYPE = #{accType,jdbcType=VARCHAR}, | ||
236 | - SUCCESS = #{success,jdbcType=VARCHAR}, | ||
237 | - TYPE = #{type,jdbcType=VARCHAR}, | ||
238 | - REFERER = #{referer,jdbcType=VARCHAR}, | ||
239 | - CLIENTIP = #{clientip,jdbcType=VARCHAR}, | ||
240 | - ACCDATE = #{accdate,jdbcType=TIMESTAMP}, | ||
241 | - USRMSG = #{usrmsg,jdbcType=VARCHAR}, | ||
242 | - USRINFO = #{usrinfo,jdbcType=VARCHAR}, | ||
243 | - PAYTYPE = #{paytype,jdbcType=VARCHAR}, | ||
244 | - SIGN = #{sign,jdbcType=VARCHAR} | ||
245 | - where ID = #{id,jdbcType=VARCHAR} | ||
246 | - </update> | ||
247 | -</mapper> |
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" > | ||
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, | ||
23 | - updateTime, userFace, realName, email, age, company_id | ||
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"> | ||
32 | - delete from users | ||
33 | - where user_id = #{userId,jdbcType=INTEGER} | ||
34 | - </delete> | ||
35 | - <insert id="insert" parameterType="com.sunyo.energy.location.model.USERS"> | ||
36 | - insert into users (user_id, username, password, | ||
37 | - birthday, sex, address, | ||
38 | - state, mobilePhone, creatTime, | ||
39 | - updateTime, userFace, realName, | ||
40 | - email, age, company_id | ||
41 | - ) | ||
42 | - values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, | ||
43 | - #{birthday,jdbcType=TIMESTAMP}, #{sex,jdbcType=CHAR}, #{address,jdbcType=VARCHAR}, | ||
44 | - #{state,jdbcType=BIT}, #{mobilephone,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP}, | ||
45 | - #{updatetime,jdbcType=TIMESTAMP}, #{userface,jdbcType=VARCHAR}, #{realname,jdbcType=VARCHAR}, | ||
46 | - #{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER} | ||
47 | - ) | ||
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"> | ||
195 | - update users | ||
196 | - set username = #{username,jdbcType=VARCHAR}, | ||
197 | - password = #{password,jdbcType=VARCHAR}, | ||
198 | - birthday = #{birthday,jdbcType=TIMESTAMP}, | ||
199 | - sex = #{sex,jdbcType=CHAR}, | ||
200 | - address = #{address,jdbcType=VARCHAR}, | ||
201 | - state = #{state,jdbcType=BIT}, | ||
202 | - mobilePhone = #{mobilephone,jdbcType=VARCHAR}, | ||
203 | - creatTime = #{creattime,jdbcType=TIMESTAMP}, | ||
204 | - updateTime = #{updatetime,jdbcType=TIMESTAMP}, | ||
205 | - userFace = #{userface,jdbcType=VARCHAR}, | ||
206 | - realName = #{realname,jdbcType=VARCHAR}, | ||
207 | - email = #{email,jdbcType=VARCHAR}, | ||
208 | - age = #{age,jdbcType=INTEGER}, | ||
209 | - company_id = #{companyId,jdbcType=INTEGER} | ||
210 | - where user_id = #{userId,jdbcType=INTEGER} | ||
211 | - </update> | ||
212 | -</mapper> |
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" > | ||
3 | -<mapper namespace="com.sunyo.energy.location.dao.WaterElectricityParameterMapper"> | ||
4 | - <resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.WaterElectricityParameter"> | ||
5 | - <id column="id" property="id" jdbcType="INTEGER"/> | ||
6 | - <result column="prepaid" property="prepaid" jdbcType="BIT"/> | ||
7 | - <result column="warningTrip" property="warningtrip" jdbcType="BIT"/> | ||
8 | - <result column="warningThreshold" property="warningthreshold" jdbcType="DECIMAL"/> | ||
9 | - <result column="overdraft" property="overdraft" jdbcType="BIT"/> | ||
10 | - <result column="overdraftThreshold" property="overdraftthreshold" jdbcType="DECIMAL"/> | ||
11 | - <result column="waterLoad" property="waterload" jdbcType="BIT"/> | ||
12 | - <result column="water" property="water" jdbcType="DECIMAL"/> | ||
13 | - <result column="power" property="power" jdbcType="DECIMAL"/> | ||
14 | - <result column="powerFactor" property="powerfactor" jdbcType="VARCHAR"/> | ||
15 | - <result column="free" property="free" jdbcType="BIT"/> | ||
16 | - <result column="freeElectricityLimit" property="freeelectricitylimit" jdbcType="DECIMAL"/> | ||
17 | - <result column="freeWater" property="freewater" jdbcType="VARCHAR"/> | ||
18 | - <result column="wm_id" property="wmId" jdbcType="VARCHAR"/> | ||
19 | - <result column="creatTime" property="creattime" jdbcType="TIMESTAMP"/> | ||
20 | - <result column="ee_id" property="eeId" jdbcType="VARCHAR"/> | ||
21 | - <result column="reamke2" property="reamke2" jdbcType="VARCHAR"/> | ||
22 | - <result column="reamke3" property="reamke3" jdbcType="VARCHAR"/> | ||
23 | - </resultMap> | ||
24 | - <sql id="Base_Column_List"> | ||
25 | - id, prepaid, warningTrip, warningThreshold, overdraft, overdraftThreshold, waterLoad, | ||
26 | - water, power, powerFactor, free, freeElectricityLimit, freeWater, wm_id, creatTime, | ||
27 | - ee_id, reamke2, reamke3 | ||
28 | - </sql> | ||
29 | - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> | ||
30 | - select | ||
31 | - <include refid="Base_Column_List"/> | ||
32 | - from water_electricity_parameter | ||
33 | - where id = #{id,jdbcType=INTEGER} | ||
34 | - </select> | ||
35 | - | ||
36 | - <select id="countOne" parameterType="java.lang.String" resultType="int"> | ||
37 | - select count(*) from water_electricity_parameter where ee_id=#{value, jdbcType=VARCHAR} | ||
38 | - </select> | ||
39 | - <select id="findOneElectricity" resultMap="BaseResultMap" parameterType="java.lang.String"> | ||
40 | - select | ||
41 | - <include refid="Base_Column_List"/> | ||
42 | - from water_electricity_parameter where ee_id = #{value,jdbcType=VARCHAR} | ||
43 | - </select> | ||
44 | - | ||
45 | - <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | ||
46 | - delete from water_electricity_parameter | ||
47 | - where id = #{id,jdbcType=INTEGER} | ||
48 | - </delete> | ||
49 | - <insert id="insert" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter"> | ||
50 | - insert into water_electricity_parameter (id, prepaid, warningTrip, | ||
51 | - warningThreshold, overdraft, overdraftThreshold, | ||
52 | - waterLoad, water, power, | ||
53 | - powerFactor, free, freeElectricityLimit, | ||
54 | - freeWater, wm_id, creatTime, | ||
55 | - ee_id, reamke2, reamke3 | ||
56 | - ) | ||
57 | - values (#{id,jdbcType=INTEGER}, #{prepaid,jdbcType=BIT}, #{warningtrip,jdbcType=BIT}, | ||
58 | - #{warningthreshold,jdbcType=DECIMAL}, #{overdraft,jdbcType=BIT}, #{overdraftthreshold,jdbcType=DECIMAL}, | ||
59 | - #{waterload,jdbcType=BIT}, #{water,jdbcType=DECIMAL}, #{power,jdbcType=DECIMAL}, | ||
60 | - #{powerfactor,jdbcType=VARCHAR}, #{free,jdbcType=BIT}, #{freeelectricitylimit,jdbcType=DECIMAL}, | ||
61 | - #{freewater,jdbcType=VARCHAR}, #{wmId,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP}, | ||
62 | - #{eeId,jdbcType=VARCHAR}, #{reamke2,jdbcType=VARCHAR}, #{reamke3,jdbcType=VARCHAR} | ||
63 | - ) | ||
64 | - </insert> | ||
65 | - <insert id="insertSelective" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter"> | ||
66 | - insert into water_electricity_parameter | ||
67 | - <trim prefix="(" suffix=")" suffixOverrides=","> | ||
68 | - <if test="id != null"> | ||
69 | - id, | ||
70 | - </if> | ||
71 | - <if test="prepaid != null"> | ||
72 | - prepaid, | ||
73 | - </if> | ||
74 | - <if test="warningtrip != null"> | ||
75 | - warningTrip, | ||
76 | - </if> | ||
77 | - <if test="warningthreshold != null"> | ||
78 | - warningThreshold, | ||
79 | - </if> | ||
80 | - <if test="overdraft != null"> | ||
81 | - overdraft, | ||
82 | - </if> | ||
83 | - <if test="overdraftthreshold != null"> | ||
84 | - overdraftThreshold, | ||
85 | - </if> | ||
86 | - <if test="waterload != null"> | ||
87 | - waterLoad, | ||
88 | - </if> | ||
89 | - <if test="water != null"> | ||
90 | - water, | ||
91 | - </if> | ||
92 | - <if test="power != null"> | ||
93 | - power, | ||
94 | - </if> | ||
95 | - <if test="powerfactor != null"> | ||
96 | - powerFactor, | ||
97 | - </if> | ||
98 | - <if test="free != null"> | ||
99 | - free, | ||
100 | - </if> | ||
101 | - <if test="freeelectricitylimit != null"> | ||
102 | - freeElectricityLimit, | ||
103 | - </if> | ||
104 | - <if test="freewater != null"> | ||
105 | - freeWater, | ||
106 | - </if> | ||
107 | - <if test="wmId != null"> | ||
108 | - wm_id, | ||
109 | - </if> | ||
110 | - <if test="creattime != null"> | ||
111 | - creatTime, | ||
112 | - </if> | ||
113 | - <if test="eeId != null"> | ||
114 | - ee_id, | ||
115 | - </if> | ||
116 | - <if test="reamke2 != null"> | ||
117 | - reamke2, | ||
118 | - </if> | ||
119 | - <if test="reamke3 != null"> | ||
120 | - reamke3, | ||
121 | - </if> | ||
122 | - </trim> | ||
123 | - <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
124 | - <if test="id != null"> | ||
125 | - #{id,jdbcType=INTEGER}, | ||
126 | - </if> | ||
127 | - <if test="prepaid != null"> | ||
128 | - #{prepaid,jdbcType=BIT}, | ||
129 | - </if> | ||
130 | - <if test="warningtrip != null"> | ||
131 | - #{warningtrip,jdbcType=BIT}, | ||
132 | - </if> | ||
133 | - <if test="warningthreshold != null"> | ||
134 | - #{warningthreshold,jdbcType=DECIMAL}, | ||
135 | - </if> | ||
136 | - <if test="overdraft != null"> | ||
137 | - #{overdraft,jdbcType=BIT}, | ||
138 | - </if> | ||
139 | - <if test="overdraftthreshold != null"> | ||
140 | - #{overdraftthreshold,jdbcType=DECIMAL}, | ||
141 | - </if> | ||
142 | - <if test="waterload != null"> | ||
143 | - #{waterload,jdbcType=BIT}, | ||
144 | - </if> | ||
145 | - <if test="water != null"> | ||
146 | - #{water,jdbcType=DECIMAL}, | ||
147 | - </if> | ||
148 | - <if test="power != null"> | ||
149 | - #{power,jdbcType=DECIMAL}, | ||
150 | - </if> | ||
151 | - <if test="powerfactor != null"> | ||
152 | - #{powerfactor,jdbcType=VARCHAR}, | ||
153 | - </if> | ||
154 | - <if test="free != null"> | ||
155 | - #{free,jdbcType=BIT}, | ||
156 | - </if> | ||
157 | - <if test="freeelectricitylimit != null"> | ||
158 | - #{freeelectricitylimit,jdbcType=DECIMAL}, | ||
159 | - </if> | ||
160 | - <if test="freewater != null"> | ||
161 | - #{freewater,jdbcType=VARCHAR}, | ||
162 | - </if> | ||
163 | - <if test="wmId != null"> | ||
164 | - #{wmId,jdbcType=VARCHAR}, | ||
165 | - </if> | ||
166 | - <if test="creattime != null"> | ||
167 | - #{creattime,jdbcType=TIMESTAMP}, | ||
168 | - </if> | ||
169 | - <if test="eeId != null"> | ||
170 | - #{eeId,jdbcType=VARCHAR}, | ||
171 | - </if> | ||
172 | - <if test="reamke2 != null"> | ||
173 | - #{reamke2,jdbcType=VARCHAR}, | ||
174 | - </if> | ||
175 | - <if test="reamke3 != null"> | ||
176 | - #{reamke3,jdbcType=VARCHAR}, | ||
177 | - </if> | ||
178 | - </trim> | ||
179 | - </insert> | ||
180 | - <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter"> | ||
181 | - update water_electricity_parameter | ||
182 | - <set> | ||
183 | - <if test="prepaid != null"> | ||
184 | - prepaid = #{prepaid,jdbcType=BIT}, | ||
185 | - </if> | ||
186 | - <if test="warningtrip != null"> | ||
187 | - warningTrip = #{warningtrip,jdbcType=BIT}, | ||
188 | - </if> | ||
189 | - <if test="warningthreshold != null"> | ||
190 | - warningThreshold = #{warningthreshold,jdbcType=DECIMAL}, | ||
191 | - </if> | ||
192 | - <if test="overdraft != null"> | ||
193 | - overdraft = #{overdraft,jdbcType=BIT}, | ||
194 | - </if> | ||
195 | - <if test="overdraftthreshold != null"> | ||
196 | - overdraftThreshold = #{overdraftthreshold,jdbcType=DECIMAL}, | ||
197 | - </if> | ||
198 | - <if test="waterload != null"> | ||
199 | - waterLoad = #{waterload,jdbcType=BIT}, | ||
200 | - </if> | ||
201 | - <if test="water != null"> | ||
202 | - water = #{water,jdbcType=DECIMAL}, | ||
203 | - </if> | ||
204 | - <if test="power != null"> | ||
205 | - power = #{power,jdbcType=DECIMAL}, | ||
206 | - </if> | ||
207 | - <if test="powerfactor != null"> | ||
208 | - powerFactor = #{powerfactor,jdbcType=VARCHAR}, | ||
209 | - </if> | ||
210 | - <if test="free != null"> | ||
211 | - free = #{free,jdbcType=BIT}, | ||
212 | - </if> | ||
213 | - <if test="freeelectricitylimit != null"> | ||
214 | - freeElectricityLimit = #{freeelectricitylimit,jdbcType=DECIMAL}, | ||
215 | - </if> | ||
216 | - <if test="freewater != null"> | ||
217 | - freeWater = #{freewater,jdbcType=VARCHAR}, | ||
218 | - </if> | ||
219 | - <if test="wmId != null"> | ||
220 | - wm_id = #{wmId,jdbcType=VARCHAR}, | ||
221 | - </if> | ||
222 | - <if test="creattime != null"> | ||
223 | - creatTime = #{creattime,jdbcType=TIMESTAMP}, | ||
224 | - </if> | ||
225 | - <if test="eeId != null"> | ||
226 | - ee_id = #{eeId,jdbcType=VARCHAR}, | ||
227 | - </if> | ||
228 | - <if test="reamke2 != null"> | ||
229 | - reamke2 = #{reamke2,jdbcType=VARCHAR}, | ||
230 | - </if> | ||
231 | - <if test="reamke3 != null"> | ||
232 | - reamke3 = #{reamke3,jdbcType=VARCHAR}, | ||
233 | - </if> | ||
234 | - </set> | ||
235 | - where ee_id = #{eeId,jdbcType=INTEGER} | ||
236 | - </update> | ||
237 | - <update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.WaterElectricityParameter"> | ||
238 | - update water_electricity_parameter | ||
239 | - set prepaid = #{prepaid,jdbcType=BIT}, | ||
240 | - warningTrip = #{warningtrip,jdbcType=BIT}, | ||
241 | - warningThreshold = #{warningthreshold,jdbcType=DECIMAL}, | ||
242 | - overdraft = #{overdraft,jdbcType=BIT}, | ||
243 | - overdraftThreshold = #{overdraftthreshold,jdbcType=DECIMAL}, | ||
244 | - waterLoad = #{waterload,jdbcType=BIT}, | ||
245 | - water = #{water,jdbcType=DECIMAL}, | ||
246 | - power = #{power,jdbcType=DECIMAL}, | ||
247 | - powerFactor = #{powerfactor,jdbcType=VARCHAR}, | ||
248 | - free = #{free,jdbcType=BIT}, | ||
249 | - freeElectricityLimit = #{freeelectricitylimit,jdbcType=DECIMAL}, | ||
250 | - freeWater = #{freewater,jdbcType=VARCHAR}, | ||
251 | - wm_id = #{wmId,jdbcType=VARCHAR}, | ||
252 | - creatTime = #{creattime,jdbcType=TIMESTAMP}, | ||
253 | - ee_id = #{eeId,jdbcType=VARCHAR}, | ||
254 | - reamke2 = #{reamke2,jdbcType=VARCHAR}, | ||
255 | - reamke3 = #{reamke3,jdbcType=VARCHAR} | ||
256 | - where id = #{id,jdbcType=INTEGER} | ||
257 | - </update> | ||
258 | -</mapper> |
-
请 注册 或 登录 后发表评论