Compare commits
4 Commits
fbd4e14f1b
...
9e6ca618aa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9e6ca618aa | ||
![]() |
61aa8f5175 | ||
![]() |
ac483aee69 | ||
![]() |
920f67828c |
@ -46,11 +46,11 @@
|
||||
<div class="wrap-boxs">
|
||||
<div class="k_" id="k_1">
|
||||
<div class="size_" >活跃油站汇总数/合作油站汇总数</div>
|
||||
<div class="title_">{{ orderStatistics.storeId?orderStatistics.storeId:0 }}/{{orderStatistics.sumOil}}</div>
|
||||
<div class="title_">{{ orderStatistics.allOrderStoreId?orderStatistics.allOrderStoreId:0 }}/{{orderStatistics.totalCount}}</div>
|
||||
</div>
|
||||
<div class="k_" id="k_2">
|
||||
<div class="size_" >交易金额汇总数(元)/交易笔数</div>
|
||||
<div class="title_">{{ orderStatistics.payMoney?orderStatistics.payMoney:0 }}/{{orderStatistics.count}}</div>
|
||||
<div class="title_">{{ orderStatistics.totalPayMoney?orderStatistics.totalPayMoney:0 }}/{{orderStatistics.totalTransactionCount}}</div>
|
||||
</div>
|
||||
<div class="k_" id="k_3">
|
||||
<div class="size_">退款金额(元)/退款笔数</div>
|
||||
@ -58,7 +58,7 @@
|
||||
</div>
|
||||
<div class="k_" id="k_4">
|
||||
<div class="size_">新增油站数</div>
|
||||
<div class="title_">{{ orderStatistics.sumOil?orderStatistics.sumOil:0 }}</div>
|
||||
<div class="title_">{{ orderStatistics.totalCount?orderStatistics.totalCount:0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -69,7 +69,7 @@
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" width="50" align="center" label="序号"/>
|
||||
<el-table-column prop="storeName" align="center" label="机构名称"></el-table-column>
|
||||
<el-table-column prop="parentName" align="center" label="所属机构"></el-table-column>
|
||||
<el-table-column prop="deptName" align="center" label="所属机构"></el-table-column>
|
||||
<el-table-column prop="payMoney" align="center" label="累计交易金额(元)">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.payMoney|| 0}}</span>
|
||||
|
@ -85,7 +85,8 @@ public class CardCouponUserServiceImpl extends ServiceImpl<CardCouponUserMapper,
|
||||
**/
|
||||
@Override
|
||||
public List<CardCouponVO> selectAllList(Integer storeId, Integer userId, Date nowDate) {
|
||||
return cardCouponUserMapper.selectAllList(storeId, userId, DateUtil.formatDate(nowDate));
|
||||
String s = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
|
||||
return cardCouponUserMapper.selectAllList(storeId, userId, s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,6 +33,9 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
|
||||
Map<String, Object> getFenxiByDailiBydata(@Param("order") AllOrderInfo allOrderInfo);
|
||||
|
||||
Map<String, Object> getFenxiByDailiTypeBydata(@Param("order") AllOrderInfo allOrderInfo);
|
||||
|
||||
String getAllOrderInfoCountByStoreId(@Param("order") AllOrderInfo allOrderInfo);
|
||||
|
||||
List<AllOrderInfoVo> getFenxiByDaili2ByData(@Param("order") AllOrderInfo allOrderInfo);
|
||||
String sumPayMoney(@Param("allOrderInfo") AllOrderInfo allOrderInfo);
|
||||
|
||||
|
@ -599,32 +599,44 @@
|
||||
group by store_id
|
||||
</select>
|
||||
<select id="getFenxiByDailiType" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
|
||||
SELECT
|
||||
store_id storeId,
|
||||
SUM(pay_money) payMoney,
|
||||
|
||||
select
|
||||
d.dept_name AS deptName,
|
||||
s.name AS storeName,
|
||||
SUM(COALESCE(a.pay_money, 0)) AS payMoney,
|
||||
count(*) count,
|
||||
sum(CASE WHEN pay_type = 'WECHAT' THEN pay_money ELSE 0 END) wechatMoney,
|
||||
sum(CASE WHEN pay_type = 'CASH' THEN pay_money ELSE 0 END) cashMoney,
|
||||
sum(CASE WHEN pay_type = 'balance' THEN pay_money ELSE 0 END) balanceMoney,
|
||||
sum(CASE WHEN pay_type = 'ALIPAY' THEN pay_money ELSE 0 END) alipayMoney,
|
||||
sum(CASE WHEN status = 'refund' THEN pay_money ELSE 0 END) refMoney,
|
||||
count(CASE WHEN status = 'refund' THEN 1 ELSE NULL END) refCount
|
||||
from all_order_info
|
||||
<where>
|
||||
<if test="order.storeIds != null">
|
||||
store_id in
|
||||
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
group by store_id
|
||||
sum( CASE WHEN a.pay_type = 'WECHAT' THEN a.pay_money ELSE 0 END ) wechatMoney,
|
||||
sum( CASE WHEN a.pay_type = 'CASH' THEN a.pay_money ELSE 0 END ) cashMoney,
|
||||
sum( CASE WHEN a.pay_type = 'balance' THEN a.pay_money ELSE 0 END ) balanceMoney,
|
||||
sum( CASE WHEN a.pay_type = 'ALIPAY' THEN a.pay_money ELSE 0 END ) alipayMoney,
|
||||
sum( CASE WHEN a.STATUS = 'refund' THEN a.pay_money ELSE 0 END ) refMoney,
|
||||
count( CASE WHEN a.STATUS = 'refund' THEN 1 ELSE NULL END ) refCount
|
||||
|
||||
from mt_store s
|
||||
LEFT JOIN all_order_info a on s.id=a.store_id
|
||||
LEFT JOIN sys_dept d on d.dept_id = s.contract_dept_id
|
||||
where
|
||||
<if test="order.storeIds != null">
|
||||
s.id in
|
||||
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and s.if_delete = '0'
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and (a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d'))
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and ( a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') )
|
||||
</if>
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and (s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d'))
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and ( s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') )
|
||||
</if>
|
||||
GROUP BY s.id
|
||||
ORDER BY payMoney DESC
|
||||
</select>
|
||||
<select id="getFenxiByDaili2" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
|
||||
SELECT payment_channel paymentChannel,
|
||||
@ -693,31 +705,42 @@
|
||||
group by store_id
|
||||
</select>
|
||||
<select id="getFenxiByDailiTypeBydata" resultType="java.util.Map">
|
||||
select
|
||||
count( DISTINCT store_id ) storeId,
|
||||
SELECT
|
||||
-- 总条数,因为连表去重
|
||||
COUNT(DISTINCT s.id) AS totalCount,
|
||||
-- 交易总金额
|
||||
SUM( pay_money ) payMoney,
|
||||
SUM(COALESCE(a.pay_money, 0)) AS totalPayMoney,
|
||||
-- 交易笔数
|
||||
count(*) count,
|
||||
COUNT(a.id) AS totalTransactionCount,
|
||||
-- 退款金额
|
||||
sum( CASE WHEN STATUS = 'refund' THEN pay_money ELSE 0 END ) refMoney,
|
||||
SUM(CASE WHEN a.status = 'refund' THEN a.pay_money ELSE 0 END) AS refMoney,
|
||||
-- 退款笔数
|
||||
count( CASE WHEN STATUS = 'refund' THEN 1 ELSE NULL END ) refCount
|
||||
from all_order_info
|
||||
<where>
|
||||
<if test="order.storeIds != null">
|
||||
store_id in
|
||||
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
COUNT(CASE WHEN a.status = 'refund' THEN 1 ELSE NULL END) AS refCount
|
||||
FROM
|
||||
mt_store s
|
||||
LEFT JOIN
|
||||
all_order_info a ON s.id = a.store_id
|
||||
WHERE
|
||||
<if test="order.storeIds != null">
|
||||
s.id in
|
||||
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and s.if_delete = '0'
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and (a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d'))
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and ( a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') )
|
||||
</if>
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and (s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d'))
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and ( s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d') )
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@ -786,6 +809,23 @@
|
||||
where info.id = #{orderId}
|
||||
</select>
|
||||
|
||||
<select id="getAllOrderInfoCountByStoreId" resultType="java.lang.String">
|
||||
select count(DISTINCT store_id ) FROM all_order_info
|
||||
where
|
||||
<if test="order.storeIds != null">
|
||||
store_id in
|
||||
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- <where>-->
|
||||
<!-- store_id = #{order.storeId}-->
|
||||
<!-- <if test="order.params.beginTime != null and order.params.beginTime != ''"><!– 开始时间检索 –>-->
|
||||
|
@ -204,13 +204,12 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
|
||||
}
|
||||
List<Long> strings = sysDeptMapper.selectChildByDeptIdR(allOrderInfo.getDeptId());
|
||||
List<Long> longs = mtStoreMapper.queryStoresByDeptIdsR(strings);
|
||||
// 活跃油站(有订单数据的油站) 油站总数 交易总金额 退款总金额 新增油站数(油站总数)
|
||||
allOrderInfo.setStoreIds(longs);
|
||||
Map<String, Object> fenxiByDailiTypeBydata = allOrderInfoMapper.getFenxiByDailiTypeBydata(allOrderInfo);
|
||||
|
||||
SysDept sysDept = sysDeptMapper.selectOilNum(allOrderInfo.getDeptId());
|
||||
SysDept sysDept2 = sysDeptMapper.selectOilNum2(allOrderInfo);
|
||||
fenxiByDailiTypeBydata.put("sumOil", sysDept.getValidNum());
|
||||
fenxiByDailiTypeBydata.put("sumOil2", sysDept2.getValidNum());
|
||||
// 单独查询活跃的油站店铺
|
||||
String allOrderInfoCountByStoreId = allOrderInfoMapper.getAllOrderInfoCountByStoreId(allOrderInfo);
|
||||
fenxiByDailiTypeBydata.put("allOrderStoreId", allOrderInfoCountByStoreId);
|
||||
|
||||
return fenxiByDailiTypeBydata;
|
||||
}
|
||||
@ -331,15 +330,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
|
||||
List<Long> longs = mtStoreMapper.queryStoresByDeptIdsR(strings);
|
||||
allOrderInfo.setStoreIds(longs);
|
||||
IPage<AllOrderInfoVo> fenxiByDaili = allOrderInfoMapper.getFenxiByDailiType(page, allOrderInfo);
|
||||
for (AllOrderInfoVo record : fenxiByDaili.getRecords()) {
|
||||
MtStore mtStore = mtStoreMapper.selectById(record.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(mtStore)) {
|
||||
SysDept byId = deptService.getById(mtStore.getContractDeptId());
|
||||
SysDept byId2 = deptService.getById(byId.getParentId());
|
||||
record.setStoreName(byId.getDeptName());
|
||||
record.setParentName(byId2.getDeptName());
|
||||
}
|
||||
}
|
||||
return fenxiByDaili;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@ public class AllOrderInfoVo extends AllOrderInfo {
|
||||
private String orderStatus;
|
||||
private Double sumPayMoney;
|
||||
|
||||
// 机构名称
|
||||
private String deptName;
|
||||
//交易金额
|
||||
private String amount;
|
||||
private String wechatMoney;
|
||||
|
@ -2,16 +2,44 @@
|
||||
<!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.LJUserMapper">
|
||||
<sql id="selectUser">
|
||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,
|
||||
mi.storeId,mi.staffId,mi.inviterId,mub.chain_store_id from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
left join mt_invitation mi on mu.id = mi.userId
|
||||
select mu.*,
|
||||
mub.grade_id,
|
||||
mub.card_balance,
|
||||
mub.points,
|
||||
mub.consume_num,
|
||||
mub.growth_value,
|
||||
mub.refuel_money,
|
||||
mub.second_card,
|
||||
mub.fixing_level,
|
||||
mi.storeId,
|
||||
mi.staffId,
|
||||
mi.inviterId,
|
||||
mub.chain_store_id
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
left join mt_invitation mi on mu.id = mi.userId
|
||||
</sql>
|
||||
<sql id="selectUserAndBalance">
|
||||
select mu.*,mub.id balanceId,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,mub.create_time balCreateTime,mub.remark remark,mub.user_label_id userLabelId,
|
||||
mub.user_status,mub.store_id mubStoreId,mub.recharge_num,mub.used_amount,mub.used_points,mub.give_amount,mub.user_source
|
||||
select mu.*,
|
||||
mub.id balanceId,
|
||||
mub.grade_id,
|
||||
mub.card_balance,
|
||||
mub.points,
|
||||
mub.consume_num,
|
||||
mub.growth_value,
|
||||
mub.refuel_money,
|
||||
mub.second_card,
|
||||
mub.fixing_level,
|
||||
mub.create_time balCreateTime,
|
||||
mub.remark remark,
|
||||
mub.user_label_id userLabelId,
|
||||
mub.user_status,
|
||||
mub.store_id mubStoreId,
|
||||
mub.recharge_num,
|
||||
mub.used_amount,
|
||||
mub.used_points,
|
||||
mub.give_amount,
|
||||
mub.user_source
|
||||
FROM mt_user mu
|
||||
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
||||
</sql>
|
||||
@ -187,10 +215,10 @@
|
||||
<!-- 查询会员统计信息-->
|
||||
<select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
|
||||
select sum(${sumValue}) from
|
||||
(select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,mub.chain_store_id,mub.create_time balCreateTime
|
||||
FROM mt_user mu
|
||||
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id) t
|
||||
(select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,mub.chain_store_id,mub.create_time balCreateTime
|
||||
FROM mt_user mu
|
||||
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id) t
|
||||
<where>
|
||||
<if test="user.chainStoreId != null and user.chainStoreId != ''">
|
||||
and t.chain_store_id = #{user.chainStoreId}
|
||||
@ -266,7 +294,19 @@
|
||||
|
||||
<select id="selectAllInfoById" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,
|
||||
mub.id balanceId,
|
||||
mub.id balanceId,
|
||||
mub.card_balance cardBalance,
|
||||
mub.points,
|
||||
mub.growth_value growthValue,
|
||||
mub.refuel_money refuelMoney
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
where mu.id = #{userId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectAllInfoById2" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,
|
||||
mub.id balanceId,
|
||||
mub.card_balance cardBalance,
|
||||
mub.points,
|
||||
mub.growth_value growthValue,
|
||||
@ -274,26 +314,13 @@
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
where mu.id = #{userId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectAllInfoById2" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,
|
||||
mub.id balanceId,
|
||||
mub.card_balance cardBalance,
|
||||
mub.points,
|
||||
mub.growth_value growthValue,
|
||||
mub.refuel_money refuelMoney
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
where mu.id = #{userId} and mub.chain_store_id = #{chainStoreId}
|
||||
limit 1
|
||||
and mub.chain_store_id = #{chainStoreId} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllInfoById4Chain" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,
|
||||
mub.id balanceId,
|
||||
mub.id balanceId,
|
||||
mub.card_balance cardBalance,
|
||||
mub.points,
|
||||
mub.growth_value growthValue,
|
||||
@ -301,16 +328,15 @@
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
where mu.id = #{userId}
|
||||
and mub.chain_store_id = #{chainStoreId}
|
||||
limit 1
|
||||
and mub.chain_store_id = #{chainStoreId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getUserCountList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mug.`name` gradeName,mug.id gradeId
|
||||
select mug.`name` gradeName, mug.id gradeId
|
||||
from mt_user_balance mub
|
||||
left join mt_user_grade mug on mub.grade_id = mug.id
|
||||
where mug.id = #{gradeId}
|
||||
and mub.store_id = #{storeId}
|
||||
and mub.store_id = #{storeId}
|
||||
</select>
|
||||
|
||||
|
||||
@ -330,7 +356,7 @@
|
||||
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
||||
<where>
|
||||
mu.id = #{id}
|
||||
and mub.chain_store_id =#{chainStoreId}
|
||||
and mub.chain_store_id =#{chainStoreId}
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryUserList" resultType="com.fuint.business.userManager.vo.LJUserVo" parameterType="int">
|
||||
@ -340,7 +366,7 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="userNum" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
select count(*)
|
||||
from
|
||||
mt_user
|
||||
<where>
|
||||
@ -380,11 +406,15 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="userListByPhone" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,mub.chain_store_id from mt_user mu
|
||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,
|
||||
mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,mub.chain_store_id,
|
||||
gr.name AS gradeName
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
LEFT JOIN mt_user_grade gr on gr.id = mub.grade_id
|
||||
<where>
|
||||
mu.mobile like concat('%',#{mobile},'%') and
|
||||
mu.mobile like concat('%',#{mobile},'%') and
|
||||
mub.store_id = #{storeId} and mub.user_status = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
@ -479,6 +479,7 @@ public class PayCenterServiceImpl implements PayCenterService {
|
||||
couponVO.setCouponId(rule.getId());
|
||||
couponVO.setName(rule.getName());
|
||||
couponVO.setUseWithOther(rule.getUseWithOther());
|
||||
couponVO.setType(rule.getType());
|
||||
//计算优惠金额
|
||||
couponVO.setDisAmount(checkUtil.computeDisAmountCoupon(rule, oilAmount, oilLiter));
|
||||
rtnList.add(couponVO);
|
||||
|
@ -21,4 +21,6 @@ public class CouponVO implements Serializable {
|
||||
private String useWithOther;
|
||||
/** 优惠金额 */
|
||||
private Double disAmount;
|
||||
// 优惠卷类型
|
||||
private String type;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
<div style="font-weight: bold;margin-bottom: 2px">{{chooseVipUser.name||'匿名'}}</div>
|
||||
<div class="d-s">
|
||||
<span>{{chooseVipUser.mobile}}</span>
|
||||
<sapn style="margin: 0px 5px">普通会员</sapn>
|
||||
<span style="margin: 0px 5px">{{chooseVipUser.gradeName}}</span>
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
trigger="hover">
|
||||
@ -145,7 +145,7 @@
|
||||
<div class="card-title">{{ item.gunName }}</div>
|
||||
<div class="c-b-d">
|
||||
<img :src=item.img style="width: 16px;height: 16px">
|
||||
<div>{{ item.oilName }} {{ item.oilType + '罐' }}</div>
|
||||
<div>{{ item.tankName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -207,7 +207,10 @@
|
||||
<div class="stock_name">{{ item.stock }}</div>
|
||||
<div class="u-price_name">{{ item.retailPrice }}</div>
|
||||
<div class="u-price_name">{{ item.retailPrice }}</div>
|
||||
<div class="num_name"> <el-input-number v-model="goodsList[index].num" @change="handleCilone" :max="9999" size="mini" ></el-input-number></div>
|
||||
<div class="num_name">
|
||||
<el-input-number v-model="goodsList[index].num" @change="handleCilone(goodsList[index])" :max=item.stock size="mini" :min="1">
|
||||
</el-input-number>
|
||||
</div>
|
||||
<div class="orerate_name">
|
||||
<span style="color: red;cursor: pointer" @click="deleteGoods(item.id)">删除</span>
|
||||
</div>
|
||||
@ -807,6 +810,8 @@ export default {
|
||||
this.sendCoupon.mtUserId = this.chooseVipUser.id
|
||||
this.sendCoupon.fromType = "4"
|
||||
this.sendCoupon.cardCouponId = this.sendCoupon.id
|
||||
//优惠卷 初始化状态应该是未使用
|
||||
this.sendCoupon.status=null
|
||||
sendCouponFun(this.sendCoupon).then(
|
||||
res=>{
|
||||
this.$message.success("赠送成功")
|
||||
@ -814,8 +819,22 @@ export default {
|
||||
}
|
||||
)
|
||||
},
|
||||
handleCilone(value){
|
||||
console.log(value)
|
||||
handleCilone(obj){
|
||||
// 强制组件重新渲染 elementui 组件都是通过监听数据来重新渲染 数据层级太深了 需要手动强刷
|
||||
this.$forceUpdate();
|
||||
|
||||
this.goodsList = this.goodsList.map(
|
||||
item => {
|
||||
if (item.id == obj.id) {
|
||||
return { ...item, num: obj.num }
|
||||
|
||||
} else {
|
||||
return item
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
},
|
||||
/**
|
||||
* 获取优惠总金额
|
||||
@ -835,6 +854,7 @@ export default {
|
||||
* */
|
||||
handleChangeAct(value){
|
||||
this.chooseAct = this.activityList.filter(item=>item.id === value)[0]
|
||||
console.log("选中的活动",this.chooseAct);
|
||||
if(""!=this.chooseCouponId){
|
||||
//判断已选择的优惠券是否可以与其他活动共用
|
||||
if("0"==this.chooseCoupon.useWithOther){
|
||||
@ -851,6 +871,7 @@ export default {
|
||||
* */
|
||||
handleChangeCoupon(value){
|
||||
this.chooseCoupon = this.couponList.filter(item=>item.id === value)[0]
|
||||
console.log("选中的优惠券",this.chooseCoupon)
|
||||
if("0"==this.chooseCoupon.useWithOther){
|
||||
//本优惠券不能与其他活动一起用
|
||||
this.chooseAct = {}
|
||||
@ -1109,7 +1130,6 @@ export default {
|
||||
},
|
||||
// 立即结算
|
||||
async settlement(){
|
||||
|
||||
// 油品单价
|
||||
// 油号id
|
||||
// 油枪id
|
||||
@ -1136,42 +1156,37 @@ export default {
|
||||
this.payForm.oilActualPay = this.oilGunClearing.amount
|
||||
//商品实付金额
|
||||
this.payForm.goodsActualPay = this.getGoodsNum
|
||||
//找零金额
|
||||
|
||||
//油枪id
|
||||
this.payForm.oilGunId = this.oilGunClearing.id
|
||||
//活动营销优惠金额
|
||||
this.payForm.activeAmount = null
|
||||
this.payForm.activeAmount = this.chooseAct.disAmount
|
||||
//优惠卷类型
|
||||
this.payForm.couponType = null
|
||||
this.payForm.couponType = this.chooseCoupon.type
|
||||
//付款用户
|
||||
this.payForm.payUser = this.chooseVipUser
|
||||
//油品优惠金额
|
||||
this.payForm.oilDiscount = null;
|
||||
//商品优惠金额
|
||||
this.payForm.goodsDiscount = null;
|
||||
//员工id
|
||||
this.payForm.staffId = null;
|
||||
// //员工id
|
||||
// this.payForm.staffId = this.$store.getters.userId;
|
||||
//会员消费金额 (储值卡需要减少的金额)
|
||||
this.payForm.consumeAmount = null;
|
||||
this.payForm.consumeAmount = this.realAmount;
|
||||
//会员id
|
||||
this.payForm.userId = this.chooseVipUser.id
|
||||
//使用积分数量
|
||||
this.payForm.usePoint = null;
|
||||
//积分金额
|
||||
this.payForm.pointAmount = null;
|
||||
//终端 默认传PC
|
||||
this.payForm.terminal = "PC"
|
||||
//商品 ids
|
||||
// 将集合内 所有id 拼接 , 隔开 this.goodsList
|
||||
this.payForm.goodsIds = this.goodsList.map(item=>item.id).join(",")
|
||||
//购买商品的总数量
|
||||
this.payForm.goodsNum = this.getGoodsListNum()
|
||||
//购买商品的总数量 计算属性
|
||||
this.payForm.goodsNum = this.getGoodsListNum
|
||||
//油品 + 商品 的实付总额
|
||||
this.payForm.allAmount = null
|
||||
this.payForm.allAmount = this.realAmount
|
||||
//支付码 如果是现金 传现金 金额
|
||||
this.authCode=null
|
||||
|
||||
if (this.payForm.payType == "CASH"){
|
||||
this.authCode= this.realAmount
|
||||
}
|
||||
|
||||
this.payForm.realyPayBills = this.realAmount
|
||||
this.flag = 3
|
||||
@ -1286,6 +1301,7 @@ export default {
|
||||
//选择会员
|
||||
this.userInfo = true
|
||||
this.chooseVipUser = data
|
||||
console.log('会员',this.chooseVipUser)
|
||||
//选择会员,查询可用优惠活动和优惠券
|
||||
this.getActivity()
|
||||
this.getCoupon()
|
||||
|
@ -64,7 +64,9 @@ export default {
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
// alert('submit!')
|
||||
|
||||
console.log(`ruleForm.amount 的类型是:`, typeof this.ruleForm.amount);
|
||||
|
||||
this.$emit('fatherMethod', this.ruleForm.amount.toFixed(2))
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
@ -95,7 +97,7 @@ export default {
|
||||
<div>{{ goodsItem.oilPrice }}元/L</div>
|
||||
</div>
|
||||
<el-form-item prop="amount" label="" class="item10086">
|
||||
<el-input v-model="ruleForm.amount" placeholder="请输入加油金额">
|
||||
<el-input v-model.number="ruleForm.amount" placeholder="请输入加油金额" >
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
Loading…
Reference in New Issue
Block a user