Commit 480ec261 by 吕明尚

用户信息增加次卡,月卡,订单表增加次卡,月卡id

parent 4b7ff02e
......@@ -81,6 +81,12 @@ public class SOrder extends BaseEntity
@Excel(name = "优惠券金额")
private BigDecimal couponPrice;
@Excel(name = "次卡ID")
private Long secondaryCardId;
@Excel(name = "月卡ID")
private Long monthlyCardId;
@Excel(name = "订单总价")
private BigDecimal totalPrice;
......
......@@ -5,6 +5,8 @@ import share.system.domain.ConsumerMember;
import share.system.domain.ConsumerWallet;
import share.system.domain.SConsumer;
import java.util.List;
/**
* @className: share.system.domain.vo.SConsumerVo
* @description: 会员
......@@ -40,4 +42,8 @@ public class SConsumerVo extends SConsumer {
private MemberConfigVo memberConfig;
private List<ConsumerMonthlyCardVo> monthlyCardList;
private List<ConsumerSecondaryCardVo> secondaryCardList;
}
......@@ -61,5 +61,5 @@ public interface ConsumerMonthlyCardMapper extends BaseMapper<ConsumerMonthlyCar
*/
public int deleteConsumerMonthlyCardByIds(Long[] ids);
ConsumerMonthlyCardVo selectByConsumerId(ConsumerMonthlyCardVo consumerMemberVo);
List<ConsumerMonthlyCardVo> selectByConsumerId(ConsumerMonthlyCardVo consumerMemberVo);
}
......@@ -61,5 +61,5 @@ public interface ConsumerMonthlyCardService extends IService<ConsumerMonthlyCard
*/
public int deleteConsumerMonthlyCardById(Long id);
ConsumerMonthlyCardVo selectByConsumerId();
List<ConsumerMonthlyCardVo> selectByConsumerId();
}
......@@ -95,7 +95,7 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
}
@Override
public ConsumerMonthlyCardVo selectByConsumerId() {
public List<ConsumerMonthlyCardVo> selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
ConsumerMonthlyCardVo vo = new ConsumerMonthlyCardVo();
vo.setConsumerId(info.getId());
......
......@@ -22,9 +22,7 @@ import share.common.utils.BaseUtil;
import share.common.utils.DateUtil;
import share.common.utils.DateUtils;
import share.system.domain.*;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.MemberConfigVo;
import share.system.domain.vo.SConsumerVo;
import share.system.domain.vo.*;
import share.system.mapper.SConsumerMapper;
import share.system.mapper.SStoreConsumerMapper;
import share.system.request.RegisterThirdSConsumerRequest;
......@@ -60,6 +58,10 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
private MemberConfigService memberConfigService;
@Autowired
private MemberProgressLogService memberProgressLogService;
@Autowired
private ConsumerSecondaryCardService consumerSecondaryCardService;
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
/**
* 查询会员用户
......@@ -188,6 +190,9 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
@Override
public SConsumerVo getSConsumer() {
SConsumer currentUser = getInfo();
if (ObjectUtil.isNull(currentUser)) {
throw new BaseException("您的登录已过期,请先登录");
}
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(currentUser.getId());
sConsumerCoupon.setUseStatus(ConsumerCouponUseStatusEnum.WAIT_USE.getCode());
......@@ -199,6 +204,8 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
BeanUtils.copyProperties(currentUser, vo);
ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, currentUser.getId()));
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, currentUser.getId()));
List<ConsumerSecondaryCardVo> consumerSecondaryCardVos = consumerSecondaryCardService.selectByConsumerId();
List<ConsumerMonthlyCardVo> consumerMonthlyCardVo = consumerMonthlyCardService.selectByConsumerId();
if (ObjectUtil.isNotEmpty(consumerMember)) {
vo.setConsumerMember(consumerMember);
MemberConfig memberConfig = memberConfigService.getById(consumerMember.getMemberConfigId());
......@@ -253,9 +260,11 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
} else {
vo.setIsManage(true);
}
if (ObjectUtil.isNull(currentUser)) {
throw new BaseException("您的登录已过期,请先登录");
if (!CollectionUtils.isEmpty(consumerSecondaryCardVos)) {
vo.setSecondaryCardList(consumerSecondaryCardVos);
}
if (!CollectionUtils.isEmpty(consumerMonthlyCardVo)) {
vo.setMonthlyCardList(consumerMonthlyCardVo);
}
return vo;
}
......
......@@ -93,8 +93,7 @@
c.remark
from s_consumer_monthly_card c
join s_consumer c2 on c.consumer_id = c2.id
where c.is_delete = 0
and c.consumer_id = #{consumerId}
where c.consumer_id = #{consumerId}
</select>
<insert id="insertConsumerMonthlyCard" parameterType="ConsumerMonthlyCard" useGeneratedKeys="true" keyProperty="id">
......
......@@ -98,8 +98,7 @@
c.remark
from s_consumer_secondary_card c
join s_consumer m on c.consumer_id = m.id
where c.is_delete = 0
and c.consumer_id = #{consumerId}
where c.consumer_id = #{consumerId}
</select>
<insert id="insertConsumerSecondaryCard" parameterType="ConsumerSecondaryCard" useGeneratedKeys="true"
......
......@@ -21,6 +21,8 @@
<result property="packPrice" column="pack_price"/>
<result property="couponId" column="coupon_id"/>
<result property="couponPrice" column="coupon_price"/>
<result property="secondaryCardId" column="secondary_card_id"/>
<result property="monthlyCardId" column="monthly_card_id"/>
<result property="totalPrice" column="total_price"/>
<result property="duration" column="duration"/>
<result property="balance" column="balance"/>
......@@ -63,6 +65,8 @@
pack_price,
coupon_id,
coupon_price,
secondary_card_id,
monthly_card_id,
total_price,
pay_price,
duration,
......@@ -106,6 +110,8 @@
pack_price,
coupon_id,
coupon_price,
secondary_card_id,
monthly_card_id,
total_price,
pay_price,
duration,
......@@ -149,6 +155,8 @@
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
......@@ -230,6 +238,8 @@
s.pack_price,
s.coupon_id,
s.coupon_price,
s.secondary_card_id,
s.monthly_card_id,
s.total_price,
s.pay_price,
s.discount_ratio,
......@@ -278,6 +288,8 @@
s.pack_price,
s.coupon_id,
s.coupon_price,
s.secondary_card_id,
s.monthly_card_id,
s.total_price,
s.pay_price,
s.discount_ratio,
......@@ -339,6 +351,8 @@
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
......@@ -401,6 +415,8 @@
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
......@@ -480,6 +496,8 @@
<if test="discountRatio != null and discountRatio != ''">discount_ratio,</if>
<if test="duration != null and duration != ''">duration,</if>
<if test="balance != null and balance != '' ">balance,</if>
<if test="secondaryCardId != null and secondaryCardId != ''">secondary_card_id,</if>
<if test="monthlyCardId != null and monthlyCardId != ''">monthly_card_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null">#{orderNo},</if>
......@@ -517,6 +535,8 @@
<if test="discountRatio != null">#{discountRatio},</if>
<if test="duration != null">#{duration},</if>
<if test="balance != null">#{balance},</if>
<if test="secondaryCardId != null">#{secondary_card_id},</if>
<if test="monthlyCardId != null">#{monthly_card_id},</if>
</trim>
</insert>
......@@ -559,6 +579,8 @@
<if test="discountRatio != null">discount_ratio = #{discountRatio},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="balance != null">balance = #{balance},</if>
<if test="monthlyCardId != null">monthly_card_id = #{monthlyCardId},</if>
<if test="secondaryCardId != null">secondary_card_id = #{secondaryCardId},</if>
</trim>
where id = #{id}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment