This commit is contained in:
zhaohengkun 2024-10-11 17:22:12 +08:00
parent ac483aee69
commit 61aa8f5175
4 changed files with 72 additions and 38 deletions

View File

@ -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

View File

@ -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>

View File

@ -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);

View File

@ -21,4 +21,6 @@ public class CouponVO implements Serializable {
private String useWithOther;
/** 优惠金额 */
private Double disAmount;
// 优惠卷类型
private String type;
}