|
@@ -503,7 +503,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
}
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- void pollingCancelOrder(String orderNo) {
|
|
|
+ public void pollingCancelOrder(String orderNo) {
|
|
|
closeOrSuccessOrder(orderNo, "订单超时");
|
|
|
}
|
|
|
|
|
@@ -529,7 +529,7 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
Payment queryPaymentData = res.getData();
|
|
|
|
|
|
//支付成功
|
|
|
- if (res.getStatus() && TradeStatusEnum.succeeded.getCode().equals(queryPaymentData.getStatus())
|
|
|
+ if (res.getStatus() && TradeStatusEnum.succeeded.getCode().equals(queryPaymentData.getStatus().getCode())
|
|
|
&& (OrderStatusEnum.WAIT_PAY.equals(detail.getStatus()) || OrderStatusEnum.PAYING.equals(detail.getStatus()))) {
|
|
|
//订单已经完成,则完成订单
|
|
|
orderSuccess(detail);
|
|
@@ -538,15 +538,19 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
userOrderPayment.setStatus(TradeStatusEnum.succeeded);
|
|
|
userOrderPayment.setUpdateTime(new Date());
|
|
|
userOrderPayment.setArrivalTime(new Date());
|
|
|
- userOrderPayment.setBackPayAmt(
|
|
|
- new BigDecimal(queryPaymentData.getPayAmt()));
|
|
|
+ if (queryPaymentData.getPayAmt() != null) {
|
|
|
+ userOrderPayment.setBackPayAmt(new BigDecimal(queryPaymentData.getPayAmt()));
|
|
|
+ }
|
|
|
|
|
|
ExecutePaymentCallBack executePaymentCallBack = queryPaymentData.getExecutePaymentCallBack();
|
|
|
if (null != executePaymentCallBack) {
|
|
|
userOrderPayment.setArrivalTime(executePaymentCallBack.getTradeTime());
|
|
|
- userOrderPayment.setBackPayAmt(
|
|
|
- new BigDecimal(executePaymentCallBack.getPayAmt()));
|
|
|
- userOrderPayment.setFeeAmt(new BigDecimal(executePaymentCallBack.getFeeAmt()));
|
|
|
+ if (executePaymentCallBack.getPayAmt() != null) {
|
|
|
+ userOrderPayment.setBackPayAmt(
|
|
|
+ new BigDecimal(executePaymentCallBack.getPayAmt()));
|
|
|
+ userOrderPayment.setFeeAmt(new BigDecimal(executePaymentCallBack.getFeeAmt()));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
orderPaymentService.updateById(userOrderPayment);
|
|
|
} else {
|
|
@@ -606,15 +610,18 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
userOrderPayment.setStatus(TradeStatusEnum.succeeded);
|
|
|
userOrderPayment.setUpdateTime(new Date());
|
|
|
userOrderPayment.setArrivalTime(new Date());
|
|
|
- userOrderPayment.setBackPayAmt(
|
|
|
- new BigDecimal(queryPaymentData.getPayAmt()));
|
|
|
+ if (queryPaymentData.getPayAmt() != null) {
|
|
|
+ userOrderPayment.setBackPayAmt(new BigDecimal(queryPaymentData.getPayAmt()));
|
|
|
+ }
|
|
|
|
|
|
ExecutePaymentCallBack executePaymentCallBack = queryPaymentData.getExecutePaymentCallBack();
|
|
|
if (null != executePaymentCallBack) {
|
|
|
userOrderPayment.setArrivalTime(executePaymentCallBack.getTradeTime());
|
|
|
- userOrderPayment.setBackPayAmt(
|
|
|
- new BigDecimal(executePaymentCallBack.getPayAmt()));
|
|
|
- userOrderPayment.setFeeAmt(new BigDecimal(executePaymentCallBack.getFeeAmt()));
|
|
|
+
|
|
|
+ if (executePaymentCallBack.getPayAmt() != null) {
|
|
|
+ userOrderPayment.setBackPayAmt(new BigDecimal(executePaymentCallBack.getPayAmt()));
|
|
|
+ userOrderPayment.setFeeAmt(new BigDecimal(executePaymentCallBack.getFeeAmt()));
|
|
|
+ }
|
|
|
}
|
|
|
orderPaymentService.updateById(userOrderPayment);
|
|
|
return false;
|