This commit is contained in:
PQZ 2024-09-27 21:17:58 +08:00
parent 4b5137900f
commit 16fdfa62e4
2 changed files with 20 additions and 6 deletions

View File

@ -95,13 +95,16 @@ public class CustomerActiveServiceImpl extends ServiceImpl<CustomerActiveMapper,
/*2、活动关联卡券处理*/
if (GENERAL_YES.equals(active.getIsCoupon())) {
//注册有礼情况直接领取
if (GENERAL_YES.equals(active.getIsPack())) {
if ("zcyl".equals(active.getType())){
/*2.1 打包领取情况*/
List<MemberCoupon> couponList = active.getCouponList();
//转换卡券信息
customerCouponList = customerCouponService.transCoupon(active.getId(), customer.getId(), customer.getUserId(), couponList);
//转换日志信息
changeList = changeService.transChange(customer.getId(), customer.getUserId(), active.getName(), couponList);
}
} else {
/*2.2 非打包领取情况*/
//选中卡券校验

View File

@ -3,12 +3,15 @@ package cn.iocoder.yudao.module.custom.service.impl;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.custom.entity.CustomerBalance;
import cn.iocoder.yudao.module.custom.entity.CustomerCoupon;
import cn.iocoder.yudao.module.custom.mapper.CustomerBalanceMapper;
import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
import cn.iocoder.yudao.module.custom.service.CustomerCouponService;
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerBalanceSaveReqVO;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
import cn.iocoder.yudao.module.member.entity.ActiveRule;
import cn.iocoder.yudao.module.member.entity.MemberCoupon;
import cn.iocoder.yudao.module.member.service.ActiveMainService;
import cn.iocoder.yudao.module.member.vo.ActiveMainRespVO;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
@ -46,6 +49,9 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
@Resource
@Lazy
private ActiveMainService activeMainService;
@Resource
@Lazy
private CustomerCouponService customerCouponService;
@Override
@ -73,6 +79,11 @@ public class CustomerBalanceServiceImpl extends ServiceImpl<CustomerBalanceMappe
if (null != orderInfo.getActiveId()) {
//获取当前活动信息
ActiveMainRespVO active = activeMainService.getActiveMain(orderInfo.getActiveId(), true);
//查询关联卡券信息充值有礼
List<MemberCoupon> couponList = active.getCouponList();
//转换卡券信息
List<CustomerCoupon> customerCouponList = customerCouponService.transCoupon(active.getId(), customer.getId(), customer.getUserId(), couponList);
customerCouponService.saveBatch(customerCouponList);
balance = transBalance(customer, orderInfo.getPayMoney(), active.getRuleList());
} else {
balance = transBalance(customer, orderInfo.getPayMoney(), null);