|
@@ -85,16 +85,15 @@ public class PerformOrderServiceImpl implements IPerformOrderService {
|
|
|
//url
|
|
|
String url = URIUtil.fillUrlParams(cpPaybackUrl, map, false);
|
|
|
String resultStr;
|
|
|
- log.error("通知CP支付回调, url : {}", url);
|
|
|
try {
|
|
|
resultStr = restTemplate.getForObject(url, String.class);
|
|
|
} catch (Exception e) {
|
|
|
log.error("回调CP充值接口异常, orderInfo : {}, e : {}", JsonUtil.toString(orderInfo), e.getMessage());
|
|
|
throw new BaseException("回调CP充值接口异常");
|
|
|
}
|
|
|
- log.error("通知CP支付回调结果, resultStr : {}", resultStr);
|
|
|
PushCpResult pushCpResult = JsonUtil.toObj(resultStr, PushCpResult.class);
|
|
|
- boolean pushSuccess = Objects.equals(pushCpResult.getRet(), "200");
|
|
|
+ boolean pushSuccess = Objects.equals(pushCpResult.getResult(), PushCpResult.SUCCESS_CODE);
|
|
|
+ log.error("通知CP支付回调结果, url : {}, resultStr : {}, pushSuccess : {}", url, resultStr, pushSuccess);
|
|
|
//更新订单信息
|
|
|
orderService.update(new LambdaUpdateWrapper<Order>()
|
|
|
.set(Order::getCpNotifyCnt, orderInfo.getCpNotifyCnt() + 1)
|
|
@@ -104,18 +103,18 @@ public class PerformOrderServiceImpl implements IPerformOrderService {
|
|
|
.eq(Order::getOrderId, orderInfo.getOrderId())
|
|
|
);
|
|
|
//更新回调记录
|
|
|
- LogPayCp logPayCp = new LogPayCp();
|
|
|
- logPayCp.setOrderId(orderInfo.getOrderId());
|
|
|
- logPayCp.setCpOrderId(orderInfo.getCpOrderId());
|
|
|
- logPayCp.setStatus(orderInfo.getStatus());
|
|
|
- logPayCp.setCpStatus(pushSuccess ? CpStatusEnum.SUCCESS.getStatus() : CpStatusEnum.FAIL.getStatus());
|
|
|
- logPayCp.setCpPaybackUrl(cpPaybackUrl);
|
|
|
- logPayCp.setParams(JsonUtil.toString(map));
|
|
|
- logPayCp.setExt(orderInfo.getExt());
|
|
|
- logPayCp.setNotifyCnt(orderInfo.getCpNotifyCnt() + 1);
|
|
|
- logPayCp.setCreateTime(LocalDateTime.now());
|
|
|
- logPayCp.setUpdateTime(LocalDateTime.now());
|
|
|
- logPayCpService.save(logPayCp);
|
|
|
+ logPayCpService.save(LogPayCp.builder()
|
|
|
+ .orderId(orderInfo.getOrderId())
|
|
|
+ .cpOrderId(orderInfo.getCpOrderId())
|
|
|
+ .status(orderInfo.getStatus())
|
|
|
+ .cpStatus(pushSuccess ? CpStatusEnum.SUCCESS.getStatus() : CpStatusEnum.FAIL.getStatus())
|
|
|
+ .cpPaybackUrl(cpPaybackUrl)
|
|
|
+ .params(JsonUtil.toString(map))
|
|
|
+ .ext(orderInfo.getExt())
|
|
|
+ .notifyCnt(orderInfo.getCpNotifyCnt() + 1)
|
|
|
+ .createTime(LocalDateTime.now())
|
|
|
+ .updateTime(LocalDateTime.now())
|
|
|
+ .build());
|
|
|
log.info("充值回调CP----------end---------");
|
|
|
return pushSuccess;
|
|
|
}
|