|
@@ -765,24 +765,6 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- UserOrderPayment orderPayment = orderPaymentService.detailByOrderNo(userOrder.getOrderNo());
|
|
|
- if (null != orderPayment) {
|
|
|
- //更新付款单
|
|
|
- orderPayment.setStatus(TradeStatusEnum.failed);
|
|
|
- orderPayment.setPayFailMsg(StringUtil.isEmpty(reason) ? "交易取消" : reason);
|
|
|
- orderPayment.setUpdateTime(new Date());
|
|
|
- //发送支付关单请求
|
|
|
- HttpResponseResult<Map<String, Object>> responseResult = paymentSdk.closePayment(userOrder.getTransNo(), reason, "");
|
|
|
- if (!responseResult.getStatus()) {
|
|
|
- orderPayment.setCloseStatus(TradeStatusEnum.failed);
|
|
|
- orderPayment.setCloseFailMsg(responseResult.getMsg());
|
|
|
- orderPaymentService.updateById(orderPayment);
|
|
|
- return;
|
|
|
- } else {
|
|
|
- orderPayment.setCloseStatus(TradeStatusEnum.pending);
|
|
|
- orderPaymentService.updateById(orderPayment);
|
|
|
- }
|
|
|
- }
|
|
|
List<UserOrderDetailVo> orderDetailList = orderDetailService.getOrderDetilListByOrderNo(userOrder.getOrderNo());
|
|
|
for (UserOrderDetailVo orderDetailVo : orderDetailList) {
|
|
|
orderDetailVo.setUserId(userOrder.getUserId());
|
|
@@ -797,6 +779,26 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
userOrder.setStatus(orderStatus);
|
|
|
userOrder.setUpdateTime(new Date());
|
|
|
baseMapper.updateById(userOrder);
|
|
|
+
|
|
|
+
|
|
|
+ UserOrderPayment orderPayment = orderPaymentService.detailByOrderNo(userOrder.getOrderNo());
|
|
|
+ if (null != orderPayment) {
|
|
|
+ //更新付款单
|
|
|
+ orderPayment.setStatus(TradeStatusEnum.failed);
|
|
|
+ orderPayment.setPayFailMsg(StringUtil.isEmpty(reason) ? "交易取消" : reason);
|
|
|
+ orderPayment.setUpdateTime(new Date());
|
|
|
+ }
|
|
|
+ //发送支付关单请求
|
|
|
+ HttpResponseResult<Map<String, Object>> responseResult = paymentSdk.closePayment(userOrder.getTransNo(), reason, "");
|
|
|
+ if (!responseResult.getStatus()) {
|
|
|
+ orderPayment.setCloseStatus(TradeStatusEnum.failed);
|
|
|
+ orderPayment.setCloseFailMsg(responseResult.getMsg());
|
|
|
+ orderPaymentService.updateById(orderPayment);
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ orderPayment.setCloseStatus(TradeStatusEnum.pending);
|
|
|
+ orderPaymentService.updateById(orderPayment);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void orderSuccess(UserOrderVo detail) {
|