liujc 1 рік тому
батько
коміт
7209d0d5a0

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

@@ -1201,6 +1201,7 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
             refundOrder.setRefundAmount(orderRefundBill.getRefundAmt());
             refundOrder.setOrderAmount(paymentOrder.getPaymentCashAmount());
             refundOrder.setReason(reason);
+            refundOrder.setTransNo(paymentOrder.getTransNo());
             refundOrder.setPaymentOrderNo(paymentOrder.getOrderNo());
             RefundResp refundResp = paymentServiceContext.getPaymentService(paymentOrder.getPaymentVendor()).refund(refundOrder);
             // 申请请求失败

+ 4 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentOrderServiceImpl.java

@@ -20,6 +20,8 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -173,7 +175,7 @@ public class UserPaymentOrderServiceImpl  implements UserPaymentOrderService {
 
         UserOrderPayment newestPayment = userOrderPaymentService.getNewestPayment(order.getTransNo(), userOrder.getOrderNo());
         if (newestPayment == null) {
-            return;
+            newestPayment = new UserOrderPayment();
         }
 
         newestPayment.setOrderNo(userOrder.getOrderNo());
@@ -201,7 +203,7 @@ public class UserPaymentOrderServiceImpl  implements UserPaymentOrderService {
                 break;
 
         }
-        userOrderPaymentService.updateById(newestPayment);
+        userOrderPaymentService.saveOrUpdate(newestPayment);
     }
 
     /**