Browse Source

refactor: WalletDetail TYPE_提现 重命名为 TYPE_退款 消除歧义

钱包流水 type=2 在业务上表示退款,与站点提现(WithdrawnRecord)是不同概念,
常量命名改为 TYPE_退款 避免混淆

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 2 days ago
parent
commit
a85a5feb5e

+ 2 - 2
car-wash-entity/src/main/java/com/kym/entity/WalletDetail.java

@@ -25,7 +25,7 @@ import java.time.LocalDateTime;
 public class WalletDetail extends BaseEntity implements Serializable {
 
     public static final int TYPE_充值 = 1;
-    public static final int TYPE_提现 = 2;
+    public static final int TYPE_退款 = 2;
     public static final int TYPE_消费 = 3;
 
 
@@ -42,7 +42,7 @@ public class WalletDetail extends BaseEntity implements Serializable {
     private Long userId;
 
     /**
-     * 交易类型:1-充值2-提现3-消费
+     * 交易类型:1-充值2-退款3-消费
      */
     private Integer type;
 

+ 2 - 2
car-wash-service/src/main/java/com/kym/service/wechat/impl/WxPayServiceImpl.java

@@ -623,7 +623,7 @@ public class WxPayServiceImpl implements WxPayService {
 
         // 钱包流水
         var walletDetail = new WalletDetail()
-                .setType(WalletDetail.TYPE_提现)
+                .setType(WalletDetail.TYPE_退款)
                 .setStatus(WalletDetail.STATUS_待确认)
                 .setUserId(refundLog.getUserId())
                 .setAmount(refundLog.getRefund())
@@ -720,7 +720,7 @@ public class WxPayServiceImpl implements WxPayService {
                         .eq(Account::getUserId, refundLog.getUserId()).update();
 
                 // 更新资金流水
-                var walletDetail = walletDetailService.getWalletDetailByOrderNo(refundNotification.getOutRefundNo(), WalletDetail.TYPE_提现);
+                var walletDetail = walletDetailService.getWalletDetailByOrderNo(refundNotification.getOutRefundNo(), WalletDetail.TYPE_退款);
                 walletDetailService.lambdaUpdate()
                         .set(WalletDetail::getStatus, WalletDetail.STATUS_已确认)
                         .set(WalletDetail::getTransactionId, refundNotification.getTransactionId())