This commit is contained in:
zhaohengkun 2024-10-08 18:25:21 +08:00
parent cbc9fc0ae2
commit 7c0e63f067
6 changed files with 46 additions and 16 deletions

View File

@ -39,14 +39,14 @@
<!-- <div class="size_">会员总余额</div>-->
<!-- <div class="title_">&#45;&#45;</div>-->
<!-- </div>-->
<!-- <div class="k_" id="k_5">-->
<!-- <div class="size_">累计囤油卡余额</div>-->
<!-- <div class="title_">&#45;&#45;</div>-->
<!-- </div>-->
<div class="k_" id="k_6">
<div class="size_">累计礼品卡余额</div>
<div class="title_">{{orderStatistics.cardGift || 0}}</div>
<div class="k_" id="k_5">
<div class="size_">累计囤油卡剩余油量L</div>
<div class="title_">{{orderStatistics.fuelAmount || 0}}</div>
</div>
<!-- <div class="k_" id="k_6">-->
<!-- <div class="size_">累计礼品卡余额</div>-->
<!-- <div class="title_">{{orderStatistics.cardGift || 0}}</div>-->
<!-- </div>-->
<div class="k_" id="k_7">
<div class="size_">储值卡总余额 </div>
<div class="title_">{{orderStatistics.balanceSum || 0}}</div>
@ -69,8 +69,8 @@
<el-table-column prop="countNum" align="center" label="累计充值次数" > </el-table-column>
<el-table-column prop="leijiMoney" align="center" label="累计消费金额(元)" > </el-table-column>
<el-table-column prop="leijiNum" align="center" label="累计消费笔数" > </el-table-column>
<!-- <el-table-column prop="createTime" align="center" label="囤油卡余额" > </el-table-column>-->
<!-- <el-table-column prop="createTime" align="center" label="电子礼品卡余额" > </el-table-column>-->
<el-table-column prop="fuelAmount" align="center" label="囤油卡剩余油量L" > </el-table-column>
<el-table-column prop="cardBalance" align="center" label="储值卡余额" >
<template v-slot="scope">
{{ formatBalance(scope.row.cardBalance) }}

View File

@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.userManager.mapper.MtUserFuelMapper">
<select id="selectSumFuelAmountByMtUserId" resultType="java.math.BigDecimal">
SELECT COALESCE(SUM(fuel_amount), 0)
FROM mt_user_fuel
where mt_user_id = #{mtUserId}
</select>
<select id="selectSumFuelAmountByStoreIds" resultType="java.math.BigDecimal">
SELECT SUM(fuel_amount) FROM mt_user_fuel
where store_id in
<foreach collection="storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

View File

@ -246,7 +246,7 @@
<if test="integralOrders.id != null">
and io.id = #{integralOrders.id}
</if>
<if test="integralOrders.paymentType != null">
<if test="integralOrders.paymentType != null and integralOrders.paymentType != ''">
and io.payment_type = #{integralOrders.paymentType}
</if>
<if test="integralOrders.userId != null">
@ -262,7 +262,7 @@
<if test="integralOrders.status != null and integralOrders.status != ''">
and io.status = #{integralOrders.status}
</if>
<if test="integralOrders.orderType != null">
<if test="integralOrders.orderType != null and integralOrders.orderType != ''">
and io.order_type = #{integralOrders.orderType}
</if>
<if test="integralOrders.processingResult != null and integralOrders.processingResult != ''">

View File

@ -2,6 +2,11 @@ package com.fuint.business.userManager.mapper;
import com.fuint.business.userManager.entity.MtUserFuel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.userManager.vo.UserBalanceVo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* <p>
@ -13,4 +18,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface MtUserFuelMapper extends BaseMapper<MtUserFuel> {
BigDecimal selectSumFuelAmountByMtUserId(@Param("mtUserId") Integer mtUserId);
BigDecimal selectSumFuelAmountByStoreIds(@Param("storeIds") List<Long> storeIds);
}

View File

@ -92,6 +92,7 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
MtUserFuelMapper mtUserFuelMapper;
@Override
public IPage<UserBalanceVo> listByZt(Page page, UserBalanceVo user) {
if (ObjectUtil.isEmpty(user.getDeptId())) {
@ -131,7 +132,9 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
record.setCountNum(leiJiInfo.get("s2c").toString());
record.setLeijiMoneyRef(leiJiInfo.get("s3").toString());
record.setLeijiNumRef(leiJiInfo.get("s3c").toString());
// 囤油卡余额查询
BigDecimal bigDecimal = mtUserFuelMapper.selectSumFuelAmountByMtUserId(user.getMtUserId());
record.setFuelAmount(bigDecimal);
}
}
@ -150,10 +153,12 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
user.setStoreIds(longs);
// 会员总数 sumnum 累计储值卡余额 balanceSum
Map<String, Object> dataByZt = userBalanceMapper.getDataByZt(user);
// 累计总消费金额 累计总充值金额 店铺统计的时候 要把注销的会员去掉
// 累计总消费金额 累计总充值金额 包含注销一起计算
Map<String, Object> leiJiInfo = allOrderInfoMapper.getShuJuVipInfo(user);
// 累计礼品卡余额
String cardGift = allOrderInfoMapper.getCardGift(user);
// 累计囤油量余额
BigDecimal bigDecimal = mtUserFuelMapper.selectSumFuelAmountByStoreIds(user.getStoreIds());
dataByZt.put("fuelAmount", bigDecimal);
if (ObjectUtil.isEmpty(dataByZt)) {
dataByZt = new HashMap<>();
@ -166,7 +171,6 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
}
dataByZt.put("tongjMoney", ObjectUtil.isNotEmpty(leiJiInfo.get("tongjMoney")) ? leiJiInfo.get("tongjMoney") : "0");
dataByZt.put("tongjXfMoney", ObjectUtil.isNotEmpty(leiJiInfo.get("tongjXfMoney")) ? leiJiInfo.get("tongjXfMoney") : "0");
dataByZt.put("cardGift", ObjectUtil.isNotEmpty(cardGift) ? cardGift : "0");
return dataByZt;
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.fuint.business.userManager.entity.UserBalance;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
@ -37,6 +38,8 @@ public class UserBalanceVo extends UserBalance {
public String amount;
public String countNum;
// 囤油卡油量
public BigDecimal fuelAmount;
public String leijiMoney;
public String leijiNum;