|
@@ -242,18 +242,25 @@ public class WxPayController {
|
|
|
public MessageResult parkingWxPay(@RequestBody Map<String,Object> map) {
|
|
|
MessageResult msgResult = new MessageResult<>();
|
|
|
try {
|
|
|
+ log.warn(map.toString());
|
|
|
+ if (StrUtil.isBlank(map.get("openId").toString())){
|
|
|
+ throw new Exception("openId不存在");
|
|
|
+ }
|
|
|
+ if (StrUtil.isBlank(map.get("id").toString())){
|
|
|
+ throw new Exception("订单不存在");
|
|
|
+ }
|
|
|
+
|
|
|
ParkingRecord parkingRecord = parkingRecordService.get(map.get("id").toString());
|
|
|
|
|
|
parkingRecord.setUpdateTime(new Date());
|
|
|
+ parkingRecord.setOpenId(map.get("openId").toString());
|
|
|
|
|
|
parkingRecordService.update(parkingRecord);
|
|
|
|
|
|
if (parkingRecord == null) {
|
|
|
throw new Exception("订单不存在");
|
|
|
}
|
|
|
- if (StrUtil.isBlank(parkingRecord.getOpenId())) {
|
|
|
- throw new Exception("openId不存在");
|
|
|
- }
|
|
|
+
|
|
|
if (parkingRecord.getPayAmount().compareTo(BigDecimal.ZERO) != 1) {
|
|
|
throw new Exception("金额有误");
|
|
|
}
|
|
@@ -321,6 +328,7 @@ public class WxPayController {
|
|
|
e.printStackTrace();
|
|
|
logger.error(e.getMessage(), e);
|
|
|
msgResult.setResult(false);
|
|
|
+ msgResult.setCode(400);
|
|
|
msgResult.setMessage(e.getMessage());
|
|
|
}
|
|
|
return msgResult;
|