Ver Fonte

分账修改,用户列表新增归属站点显示

skyline há 1 ano atrás
pai
commit
0eb5fccaee

+ 1 - 1
admin-web/src/views/admin/account/index.vue

@@ -157,7 +157,7 @@ const state = reactive({
     loading: false,
     columns: [
       {label: '用户ID',width: 200,  prop: 'userId', resizable: true, fixed: 'left'},
-      // {label: '用户名',width: 150,  prop: 'userName', resizable: true, fixed: 'left'},
+      {label: '归属站点',width: 200,  prop: 'stationName', resizable: true, fixed: 'left'},
       {label: '手机号', width: 120, prop: 'mobilePhone', resizable: true, fixed: 'left'},
       {label: '余额', width: 80, prop: 'balance', resizable: true, fixed: 'left'},
       {label: '冻结余额', width: 90, prop: 'frozenAmount', resizable: true, fixed: 'left'},

+ 2 - 0
car-wash-entity/src/main/java/com/kym/entity/vo/CustomUserVo.java

@@ -15,6 +15,8 @@ public class CustomUserVo {
     private Long userId;
     private String userName;
     private String mobilePhone;
+    private String stationId;
+    private String stationName;
     private Integer status;
     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime registerTime;

+ 6 - 3
car-wash-mapper/src/main/resources/mappers/UserMapper.xml

@@ -22,7 +22,8 @@
 
     <resultMap id="CustomUserMap" type="com.kym.entity.vo.CustomUserVo">
         <id column="user_id" property="userId"/>
-        <id column="user_name" property="userName"/>
+        <id column="username" property="userName"/>
+        <id column="station_id" property="stationId"/>
         <result column="mobile_phone" property="mobilePhone"/>
         <result column="status" property="status"/>
         <result column="register_time" property="registerTime"/>
@@ -46,7 +47,8 @@
         <if test="list!=null">
             SELECT
             t1.`id` user_id,
-            t1.`username` user_name,
+            t1.`username`,
+            t1.`station_id`,
             t1.`mobile_phone`,
             t1.`status`,
             t1.`create_time` register_time,
@@ -96,7 +98,8 @@
 
             SELECT
             user.`id` user_id,
-            user.`username` user_name,
+            user.`username`,
+            user.`station_id`,
             user.`mobile_phone`,
             user.`status`,
             user.`create_time` register_time,

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

@@ -68,17 +68,6 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
                         .eq(Account::getUserId, washOrder.getUserId()).update();
             }
 
-
-            // todo t_account减(上面已完成),t_investor_account冻结户减,t_investor_account商户加,t_split_record记录
-            // todo 需要判断是否跨网点,分开处理;跨网点结算比例是消费站点分订单额的30%,充值站点分70%
-            if (washOrder.getIsCross()) {
-                // 跨网点订单结算比例是消费站点分订单额的30%,充值站点分70%
-                doCrossSplit(washOrder, KymCache.INSTANCE.getInvestorAdminUserIdByUserId(washOrder.getUserId()));
-            } else {
-                // 不跨网点订单结算比例是消费站点分订单额的100%,消费金额*商家消费分润比例30%-消费金额*平台分润10%=消费金额*(商家消费分润比例-平台分润)
-                doLocalSplit(washOrder);
-            }
-
             washOrder
                     .setCloseType(orderInfo.getClose_type())
                     .setAmount(orderInfo.getAmount())
@@ -93,6 +82,19 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
                     .setPayStatus(WashOrder.PAY_STATUS_已支付);
             washOrderService.updateById(washOrder);
 
+
+            // todo t_account减(上面已完成),t_investor_account冻结户减,t_investor_account商户加,t_split_record记录
+            // todo 需要判断是否跨网点,分开处理;跨网点结算比例是消费站点分订单额的30%,充值站点分70%
+            if (washOrder.getIsCross()) {
+                // 跨网点订单结算比例是消费站点分订单额的30%,充值站点分70%
+                doCrossSplit(washOrder, KymCache.INSTANCE.getInvestorAdminUserIdByUserId(washOrder.getUserId()));
+            } else {
+                // 不跨网点订单结算比例是消费站点分订单额的100%,消费金额*商家消费分润比例30%-消费金额*平台分润10%=消费金额*(商家消费分润比例-平台分润)
+                doLocalSplit(washOrder);
+            }
+
+
+
             var walletDetail = new WalletDetail();
             walletDetail.setUserId(washOrder.getUserId());
             walletDetail.setType(WalletDetail.TYPE_消费);

+ 1 - 1
car-wash-service/src/main/java/com/kym/service/impl/InvestorAccountServiceImpl.java

@@ -20,6 +20,6 @@ public class InvestorAccountServiceImpl extends MyBaseServiceImpl<InvestorAccoun
 
     @Override
     public InvestorAccount getInvestorAccount(String stationId) {
-        return getById(KymCache.INSTANCE.getInvestorAdminUserIdByStationId(stationId));
+        return lambdaQuery().eq(InvestorAccount::getAdminUserId, KymCache.INSTANCE.getInvestorAdminUserIdByStationId(stationId)).one();
     }
 }

+ 1 - 0
car-wash-service/src/main/java/com/kym/service/impl/UserServiceImpl.java

@@ -277,6 +277,7 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
             vo.setRefundTimes(user2RefundTimes.getOrDefault(vo.getUserId(), 0L));
             vo.setRefundAmount(user2RefundAmount.getOrDefault(vo.getUserId(), 0));
             vo.setRefundDiscountAmount(user2RefundDiscountAmount.getOrDefault(vo.getUserId(), 0));
+            vo.setStationName(KymCache.INSTANCE.getStationNameById(vo.getStationId()));
         }).toList();
         page.setList(res);
         return page;