Prechádzať zdrojové kódy

表名修改:投资者账户->站点账户

skyline 1 rok pred
rodič
commit
444191b19c

+ 10 - 10
car-wash-service/src/main/java/com/kym/service/awoara/event/handle/OrderCloseEventHandler.java

@@ -24,15 +24,15 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
     private final WashOrderService washOrderService;
     private final WalletDetailService walletDetailService;
     private final AccountService accountService;
-    private final StationAccountService investorAccountService;
+    private final StationAccountService stationAccountService;
     private final SplitRecordService splitRecordService;
 
     public OrderCloseEventHandler(WashOrderService washOrderService, WalletDetailService walletDetailService,
-                                  AccountService accountService, StationAccountService investorAccountService, SplitRecordService splitRecordService) {
+                                  AccountService accountService, StationAccountService stationAccountService, SplitRecordService splitRecordService) {
         this.washOrderService = washOrderService;
         this.walletDetailService = walletDetailService;
         this.accountService = accountService;
-        this.investorAccountService = investorAccountService;
+        this.stationAccountService = stationAccountService;
         this.splitRecordService = splitRecordService;
     }
 
@@ -119,9 +119,9 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
      * @param washOrder
      */
     private void doLocalSplit(WashOrder washOrder) {
-        var stationAccount = investorAccountService.getStationAccount(washOrder.getStationId());
+        var stationAccount = stationAccountService.getStationAccount(washOrder.getStationId());
         var amount = (int) (washOrder.getAmount() * (0.3 - 0.1));
-        investorAccountService.lambdaUpdate()
+        stationAccountService.lambdaUpdate()
                 .setSql("frozen_amount = frozen_amount - {0}", amount)
                 .eq(StationAccount::getId, stationAccount.getId())
                 .update();
@@ -153,32 +153,32 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
      * @param stationId 用户归属的站点Id
      */
     private void doCrossSplit(WashOrder washOrder, String stationId) {
-        var investorAccount = investorAccountService.getStationAccount(washOrder.getStationId());
+        var investorAccount = stationAccountService.getStationAccount(washOrder.getStationId());
         var splitAmount = (int) (washOrder.getAmount() * (0.3 - 0.1));
         var localAmount = (int) (splitAmount * 0.7);
         var crossAmount = splitAmount - localAmount;
 
         // 当前消费站点收入(跨店消费,原充值站点要分订单的70%)
-        investorAccountService.lambdaUpdate()
+        stationAccountService.lambdaUpdate()
                 .setSql("balance = balance + {0}", crossAmount)
                 .eq(StationAccount::getId, investorAccount.getId())
                 .update();
 
 //        // 充值站点收入
-//        investorAccountService.lambdaUpdate()
+//        stationAccountService.lambdaUpdate()
 //                .setSql("balance = balance + {0}, frozen_amount = frozen_amount - {1}", localAmount, splitAmount)
 //                .eq(InvestorAccount::getId, investorAccount.getId())
 //                .update();
 //
 //        // 充值站点支出
-//        investorAccountService.lambdaUpdate()
+//        stationAccountService.lambdaUpdate()
 //                .setSql("balance = balance - {0}", crossAmount)
 //                .eq(InvestorAccount::getId, investorAccount.getId())
 //                .update();
 
         // 以上充值站点的两次操作进行合并
         // 充值站点收入
-        investorAccountService.lambdaUpdate()
+        stationAccountService.lambdaUpdate()
                 .setSql("balance = balance + {0}, frozen_amount = frozen_amount - {1}", localAmount - crossAmount, splitAmount)
                 .eq(StationAccount::getId, investorAccount.getId())
                 .update();

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

@@ -88,7 +88,7 @@ public class WxPayServiceImpl implements WxPayService {
     private final UserRechargeRightsService userRechargeRightsService;
 
     private final RechargeConfigService rechargeConfigService;
-    private final StationAccountService investorAccountService;
+    private final StationAccountService stationAccountService;
 
 
     /**
@@ -101,7 +101,7 @@ public class WxPayServiceImpl implements WxPayService {
                             PayLogService payLogService, AccountService accountService,
                             RefundLogService refundLogService,
                             ActivityService activityService, UserRechargeRightsService userRechargeRightsService,
-                            RechargeConfigService rechargeConfigService, StationAccountService investorAccountService) {
+                            RechargeConfigService rechargeConfigService, StationAccountService stationAccountService) {
         this.conf = conf;
         this.walletDetailService = walletDetailService;
         this.payLogService = payLogService;
@@ -110,7 +110,7 @@ public class WxPayServiceImpl implements WxPayService {
         this.activityService = activityService;
         this.userRechargeRightsService = userRechargeRightsService;
         this.rechargeConfigService = rechargeConfigService;
-        this.investorAccountService = investorAccountService;
+        this.stationAccountService = stationAccountService;
     }
 
     /**
@@ -345,7 +345,7 @@ public class WxPayServiceImpl implements WxPayService {
                 // 70%进入站点商户基本户,30%进入站点商户冻结户 todo 后面将比例进行配置化(需要考虑历史数据处理)
                 var stationBasicAmount = (int) (totalAmount * 0.7);
                 var stationFreezeAmount = totalAmount - stationBasicAmount;
-                investorAccountService.lambdaUpdate()
+                stationAccountService.lambdaUpdate()
                         .setSql("balance = (balance + %d), frozen_amount = (frozen_amount + %d)".formatted(stationBasicAmount, stationFreezeAmount))
                         .eq(StationAccount::getId, KymCache.INSTANCE.getInvestorAdminUserIdByStationId(stationId))
                         .update();