UserPayController.java
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.sunyo.energy.location.controller;
import com.sunyo.energy.location.controller.response.ResultJson;
import com.sunyo.energy.location.dao.LocationMapper;
import com.sunyo.energy.location.dao.USERSMapper;
import com.sunyo.energy.location.model.USERS;
import com.sunyo.energy.location.service.LocationService;
import com.sunyo.energy.location.service.WaterMeterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(description = "用户支付管理")
@RestController
@RequestMapping("/userPayOrder")
public class UserPayController {
@Autowired
private LocationService locationService;
@Autowired
private WaterMeterService waterMeterService;
@Autowired
private LocationMapper locationMapper;
@Autowired
private USERSMapper usersMapper;
@ApiOperation(value = "查看缴费房间")
@RequestMapping("/list")
public List userPayList(@RequestParam(value = "roomNumber", required = false) String roomNumber) {
return locationService.userPayList(roomNumber, 0);
}
@ApiOperation(value = "充值水费")
@PostMapping("/add")
public ResultJson payWater(@RequestParam(value = "payFees", required = false) String payFees,
@RequestParam(value = "wmId", required = false) String wmId) {
return waterMeterService.payWater(payFees, wmId);
}
@ApiOperation(value = "请求返回二维码")
@PostMapping("/qrCode")
public ResultJson qrCode(@RequestParam(value = "payFees", required = false) String payFees,
@RequestParam(value = "wmId", required = false) String wmId,
@RequestParam(value = "userId", required = false) String userId,
@RequestParam(value = "realName", required = false) String realName,
@RequestParam(value = "deviceId", required = false) String eeId) throws UnsupportedEncodingException {
ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName, eeId);
return resultJson;
}
@ApiOperation(value = "钉钉小程序请求水电返回数据")
@PostMapping("/mincData")
public List mincData(@RequestParam(value = "userName", required = false) String userName,
@RequestParam(value = "mobile", required = false) String mobile) {
USERS users = usersMapper.findRoomNumber(mobile);
if (!StringUtils.isEmpty(users.getUsername())){
List list = locationService.userPayList(users.getUsername(), users.getUserId());
return list;
}else {
return null;
}
}
}