skyline 1 год назад
Родитель
Сommit
b3c5d38057

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

@@ -98,7 +98,7 @@
             :show-overflow-tooltip="!field.fixed&&field.width>150"
         >
           <template #default="{row}">
-            <template v-if="['rechargeAmount','totalMoney','refundAmount','balance','frozenAmount','payAmount','discountAmount','refundDiscountAmount'].includes(field.prop)">
+            <template v-if="['rechargeAmount','amount','refundAmount','balance','frozenAmount','amountReceivable','amountReceived','discountAmount','refundDiscountAmount'].includes(field.prop)">
               {{ u.fmt.fmtMoney(row[field.prop]) }}
             </template>
             <template v-else-if="'status'===field.prop">
@@ -109,7 +109,7 @@
                 <span>  <el-button link type="primary" @click="handleGotoRecharge(row)">{{row[field.prop]}} <SvgIcon name="ele-Link" class="hc"></SvgIcon></el-button></span>
               </div>
             </template>
-            <template v-else-if="'chargeTimes'===field.prop">
+            <template v-else-if="'washTimes'===field.prop">
               <div class="flex w100 flex-justify-around hp">
                 <span>  <el-button link type="primary" @click="handleGotoCharge(row)">{{row[field.prop]}} <SvgIcon name="ele-Link" class="hc"></SvgIcon></el-button></span>
               </div>
@@ -178,10 +178,10 @@ const state = reactive({
       {label: '充值金额', width: 90, prop: 'rechargeAmount', resizable: true},
       {label: '退款次数', width: 90, prop: 'refundTimes', resizable: true},
       {label: '退款金额', width: 90, prop: 'refundAmount', resizable: true},
-      {label: '充电次数', width: 90, prop: 'chargeTimes', resizable: true},
-      {label: '总电量/度', width: 100, prop: 'totalPower', resizable: true},
-      {label: '订单总额', width: 100, prop: 'totalMoney', resizable: true},
-      {label: '实付总额', width: 100, prop: 'payAmount', resizable: true},
+      {label: '洗车次数', width: 90, prop: 'washTimes', resizable: true},
+      {label: '消费总额', width: 100, prop: 'amount', resizable: true},
+      {label: '应付总额', width: 100, prop: 'amountReceivable', resizable: true},
+      {label: '实付总额', width: 100, prop: 'amountReceived', resizable: true},
       {label: '优惠总额', width: 100, prop: 'discountAmount', resizable: true},
       {label: '退款扣除优惠', width: 125, prop: 'refundDiscountAmount', resizable: true},
       // {

+ 13 - 4
car-wash-entity/src/main/java/com/kym/entity/vo/CustomUserVo.java

@@ -24,10 +24,19 @@ public class CustomUserVo {
     private LocalDateTime lastLoginTime;
     private int rechargeTimes;
     private int rechargeAmount;
-    private int chargeTimes;
-    private double totalPower;
-    private int totalMoney;
-    private int payAmount;
+    private int washTimes;
+    /**
+     * 消费总金额
+     */
+    private int amount;
+    /**
+     * 应付总额
+     */
+    private int amountReceivable;
+    /**
+     * 实付总额
+     */
+    private int amountReceived;
     private int discountAmount;
     private int balance;
     private int frozenAmount;

+ 29 - 9
car-wash-mapper/src/main/resources/mappers/UserMapper.xml

@@ -21,19 +21,19 @@
     </resultMap>
 
     <resultMap id="CustomUserMap" type="com.kym.entity.vo.CustomUserVo">
-        <id column="user_id" property="userId"/>
-        <id column="username" property="userName"/>
-        <id column="station_id" property="stationId"/>
+        <result column="user_id" property="userId"/>
+        <result column="username" property="userName"/>
+        <result column="station_id" property="stationId"/>
         <result column="mobile_phone" property="mobilePhone"/>
         <result column="status" property="status"/>
         <result column="register_time" property="registerTime"/>
         <result column="last_login_time" property="lastLoginTime"/>
         <result column="recharge_times" property="rechargeTimes"/>
         <result column="recharge_amount" property="rechargeAmount"/>
-        <result column="charge_times" property="chargeTimes"/>
-        <result column="total_power" property="totalPower"/>
-        <result column="total_money" property="totalMoney"/>
-        <result column="pay_amount" property="payAmount"/>
+        <result column="wash_times" property="washTimes"/>
+        <result column="amount" property="amount"/>
+        <result column="amount_receivable" property="amountReceivable"/>
+        <result column="amount_received" property="amountReceived"/>
         <result column="discount_amount" property="discountAmount"/>
     </resultMap>
 
@@ -55,7 +55,9 @@
             t1.`last_login_time`,
             t3.recharge_times,
             t3.recharge_amount,
-            t2.charge_times,
+            t2.wash_times,
+            t2.amount,
+            t2.amount_receivable,
             t2.amount_received,
             t2.discount_money
             FROM
@@ -63,7 +65,9 @@
             LEFT JOIN
             (SELECT
             user_id,
-            COUNT(IFNULL(1, 0)) charge_times,
+            COUNT(IFNULL(1, 0)) wash_times,
+            SUM(IFNULL(amount, 0)) amount,
+            SUM(IFNULL(amount_receivable, 0)) amount_receivable,
             SUM(IFNULL(amount_received, 0)) amount_received,
             SUM(IFNULL(discount_money, 0)) discount_money
             FROM
@@ -107,6 +111,8 @@
             t.recharge_times,
             t.recharge_amount,
             t1.wash_times,
+            t1.amount,
+            t1.amount_receivable,
             t1.amount_received,
             t1.discount_money
             FROM t_user `user`
@@ -140,6 +146,20 @@
             ) wash_times,
             SUM(
             CASE
+            WHEN o.`amount` > 0
+            THEN o.`amount`
+            ELSE 0
+            END
+            ) amount,
+            SUM(
+            CASE
+            WHEN o.`amount_receivable` > 0
+            THEN o.`amount_receivable`
+            ELSE 0
+            END
+            ) amount_receivable,
+            SUM(
+            CASE
             WHEN o.`amount_received` > 0
             THEN o.`amount_received`
             ELSE 0

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

@@ -72,6 +72,7 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
                     .setCloseType(orderInfo.getClose_type())
                     .setAmount(orderInfo.getAmount())
                     .setAmountReceivable(orderInfo.getAmount_receivable())
+                    .setAmountReceived(orderInfo.getAmount_received())
                     .setDiscountMoney(orderInfo.getDiscount_money())
                     .setDetail(orderInfo.getDetail())
                     .setEndTime(LocalDateTime.now())

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

@@ -259,7 +259,7 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
             params.setStationId(adminStationIds.get(0));
         }
         List<Long> userIds = lambdaQuery()
-                .eq(CommUtil.isNotEmptyAndNull(params.getMobilePhone()), User::getMobilePhone, params.getMobilePhone())
+                .eq(CommUtil.isNotEmptyAndNull(params.getMobilePhone()), User::getMobilePhone, params.getMobilePhone().replace(" ", ""))
                 .eq(CommUtil.isNotEmptyAndNull(params.getStationId()), User::getStationId, params.getStationId())
                 .eq(CommUtil.isNotEmptyAndNull(params.getStatus()), User::getStatus, params.getStatus())
                 .list().stream().map(User::getId)