ソースを参照

拍卖余额支付

licailing 3 年 前
コミット
947c6d26c7

+ 1 - 6
src/main/java/com/izouma/nineth/service/OrderPayService.java

@@ -427,12 +427,7 @@ public class OrderPayService {
         if (order.getStatus() != AuctionOrderStatus.NOT_PAID) {
             throw new BusinessException("订单状态错误");
         }
-        if (!Objects.equals(order.getUserId(), userId)) {
-            throw new BusinessException("订单不属于该用户");
-        }
-        if (!Objects.equals(userRepo.findTradeCode(userId), tradeCode)) {
-            throw new BusinessException("交易码错误");
-        }
+        checkTradeCode(userId, tradeCode, order.getUserId());
         BalanceRecord record = userBalanceService.balancePay(order.getUserId(), order.getTotalPrice(), orderId, "拍卖");
         auctionOrderService.notify(orderId, PayMethod.BALANCE, record.getId().toString());
     }

+ 1 - 1
src/main/java/com/izouma/nineth/web/OrderPayControllerV2.java

@@ -185,7 +185,7 @@ public class OrderPayControllerV2 {
         return orderPayService.payAuctionQuick(id);
     }
 
-    @RequestMapping(value = "/auction/balance", method = RequestMethod.GET)
+    @RequestMapping(value = "/auction/balance")
     public void payAuctionOrderBalance(@RequestParam Long id, @RequestParam String tradeCode) {
         orderPayService.payAuctionOrderBalance(id, SecurityUtils.getAuthenticatedUser().getId(), tradeCode);
     }