推荐有礼

This commit is contained in:
齐天大圣 2024-02-28 16:45:03 +08:00
parent 9126fc46aa
commit a913357d69
15 changed files with 317 additions and 127 deletions

View File

@ -8,7 +8,7 @@
</div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="活动图片" prop="activePictureUrl">
<!-- <el-form-item label="活动图片" prop="activePictureUrl">
<el-upload
:action="uploadAction"
list-type="picture-card"
@ -24,7 +24,7 @@
/>
<i v-if="!this.ruleForm.activePictureUrl" class="el-icon-plus"></i>
</el-upload>
</el-form-item>
</el-form-item>-->
<el-form-item label="邀请人获得" prop="inviterGiftType">
<el-checkbox-group v-model="ruleForm.inviterGiftType" >
<el-checkbox v-for="city in Typelist" :label="city.type" :key="city.type">{{city.text}}</el-checkbox>
@ -243,7 +243,7 @@
</div>
</div>
<el-form-item label="分享标题" prop="title">
<!-- <el-form-item label="分享标题" prop="title">
<el-input v-model="ruleForm.title"></el-input>
</el-form-item>
<el-form-item label="分享图片" prop="titleUrl">
@ -262,13 +262,13 @@
/>
<i v-if="!this.ruleForm.titleUrl" class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="邀请二维码" prop="invitationCodeType">
</el-form-item>-->
<!-- <el-form-item label="邀请二维码" prop="invitationCodeType">
<el-radio-group v-model="ruleForm.invitationCodeType">
<el-radio label="0">小程序码</el-radio>
<el-radio label="1">参数二维码</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item>-->
<!-- <el-form-item label="奖励显示" prop="rewardDisplay">
<el-radio-group v-model="ruleForm.rewardDisplay">
<el-radio label="0">优惠券总额</el-radio>
@ -598,9 +598,9 @@ export default {
form: {},
//
rules: {
activePictureUrl: [
/*activePictureUrl: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
],*/
inviterGiftType: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
@ -610,9 +610,6 @@ export default {
growthValue: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
title: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
invitationCodeType:[
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],

View File

@ -172,7 +172,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
}
}
}
activeConsumptionVO.setDuihuanTotaled(youhuiTed);
activeConsumptionVO.setYouhuiTotaled(youhuiTed);
activeConsumptionVO.setDuihuanTotaled(duihuanTed);
return activeConsumptionVO;
}).collect(Collectors.toList());

View File

@ -39,6 +39,10 @@ public class ActiveNewlywedsVO {
private Integer points;
//赠送成长值
private Integer growthValue;
private Integer youhuiTotal;
private Integer duihuanTotal;
private Integer youhuiTotaled;
private Integer duihuanTotaled;
//自定义规则
private String remark;
//新人有礼卡券列表

View File

@ -10,6 +10,7 @@ import com.fuint.business.marketingActivity.activeNewlyweds.dto.ActiveNewlywedsD
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import java.io.Serializable;
import java.util.List;
/**
* 新人有礼活动(ActiveNewlyweds)表服务接口
@ -39,7 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @param id
* @return
*/
ActiveNewlywedsVO getOneById(Serializable id);
List<ActiveNewlywedsVO> getOneById(Serializable id);
ActiveNewlywedsVO getOneByStoreId(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);

View File

@ -18,6 +18,10 @@ import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecomme
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
@ -44,6 +48,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
private StoreService storeService;
@Resource
private ActiveNewlywedsChildService activeNewlywedsChildService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/**
*
* @param activeNewlywedsDTO
@ -54,13 +62,13 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
boolean save = false;
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
/*LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId);
ActiveNewlyweds one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){
activeNewlywedsDTO.setId(one.getId());
save = updateOneById(activeNewlywedsDTO);
}else {
}else {*/
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
activeNewlywedsDTO.setChainStoreId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
@ -80,7 +88,7 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return s;
}).collect(Collectors.toList());
save = activeNewlywedsChildService.saveBatch(list);
}
//}
/* //获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeNewlywedsDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
@ -151,36 +159,81 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
* @return
*/
@Override
public ActiveNewlywedsVO getOneById(Serializable id) {
public List<ActiveNewlywedsVO> getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
ArrayList<ActiveNewlywedsVO> activeNewlywedsVOS = new ArrayList<>();
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
//获取兑换物品信息
if (CollectionUtils.isNotEmpty(list)){
for (ActiveNewlyweds activeNewlyweds : list) {
int youhuiTed = 0;
int duihuanTed = 0;
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
//优惠券
if (activeNewlywedsChild.getActiveGift().equals("1")){
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeNewlywedsChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeNewlywedsVO.setYouhuiTotal(list.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
}
}
}
//兑换券
if (activeNewlywedsChild.getActiveGift().equals("2")){
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeNewlywedsChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeNewlywedsVO.setDuihuanTotal(list.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
}
}
}
}
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
activeNewlywedsVO.setYouhuiTotaled(youhuiTed);
activeNewlywedsVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
activeNewlywedsVOS.add(activeNewlywedsVO);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
activeNewlywedsVOS.add(activeNewlywedsVO);
}
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
activeNewlywedsVO.setDuihuanTotaled(youhuiTed);
activeNewlywedsVO.setDuihuanTotaled(duihuanTed);
activeNewlywedsVO.setDuihuanTotal(0);
activeNewlywedsVO.setDuihuanTotal(0);
activeNewlywedsVOS.add(activeNewlywedsVO);
}
}
return activeNewlywedsVO;
}
}
return activeNewlywedsVOS;
}
/**

View File

@ -30,6 +30,8 @@ public class ActiveRecommend extends Model<ActiveRecommend> {
private String activePictureUrl;
//邀请人获得 0优惠券 1兑换券 2成长值 3积分
private String inviterGiftType;
private String activeNewName;
private Integer activeNewId;
//赠送积分
private Integer points;
//赠送成长值

View File

@ -8,6 +8,7 @@ import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAp
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import java.io.Serializable;
import java.util.List;
/**
* 推荐有礼表(ActiveRecommend)表服务接口
@ -29,7 +30,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @param id
* @return
*/
ActiveRecommendVO getOneById(Serializable id);
List<ActiveRecommendVO> getOneById(Serializable id);
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption);
/**

View File

@ -12,6 +12,10 @@ import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecomm
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendAppletVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil;
@ -42,6 +46,10 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
private ActiveRecommendChildService activeRecommendChildService;
@Resource
private CardFavorableService cardFavorableService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
/**
* 新增数据
* @param activeRecommendDTO
@ -53,13 +61,13 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
boolean save = false;
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//根据店铺id查询
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
/* LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId);
ActiveRecommend one = getOne(lambdaQueryWrapper);
if (ObjectUtils.isNotEmpty(one)){
activeRecommendDTO.setId(one.getId());
save = updateOneById(activeRecommendDTO);
}else {
}else {*/
//获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
activeRecommendDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
@ -84,7 +92,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
}).collect(Collectors.toList());
save = activeRecommendChildService.saveBatch(list);
}
}
//}
return save;
}
@ -94,42 +102,86 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return
*/
@Override
public ActiveRecommendVO getOneById(Serializable id) {
public List<ActiveRecommendVO> getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
ArrayList<ActiveRecommendVO> activeRecommendVOS = new ArrayList<>();
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
List<ActiveRecommend> list = list(lambdaQueryWrapper);
for (ActiveRecommend activeRecommend : list) {
int youhuiTed = 0;
int duihuanTed = 0;
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeRecommend)){
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
//优惠券
if (activeRecommendChild.getActiveGift().equals("1")){
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeRecommendChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeRecommendVO.setYouhuiTotal(list.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
}
}
}
//兑换券
if (activeRecommendChild.getActiveGift().equals("2")){
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeRecommendChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeRecommendVO.setDuihuanTotal(list.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
}
}
}
}
BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
activeRecommendVO.setYouhuiTotaled(youhuiTed);
activeRecommendVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
activeRecommendVOS.add(activeRecommendVO);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVOS.add(activeRecommendVO);
}
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVO.setDuihuanTotaled(youhuiTed);
activeRecommendVO.setDuihuanTotaled(duihuanTed);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVOS.add(activeRecommendVO);
}
}
return activeRecommendVO;
}
return activeRecommendVOS;
}
/**
* 通过店铺id查询单条数据(小程序端)
* @param id
* @param activeConsumption
* @return
*/
@Override

View File

@ -42,6 +42,10 @@ public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
private String invitationCodeType;
//奖励显示 0优惠券 1成长值总额 2积分总额
private String rewardDisplay;
private Integer youhuiTotal;
private Integer duihuanTotal;
private Integer youhuiTotaled;
private Integer duihuanTotaled;
//活动规则
private String activeRule;
//活动状态 0进行中 1 待生效 2已结束

View File

@ -24,6 +24,7 @@ public class CardExchange extends Model<CardExchange> {
private Integer id;
//所属连锁店id
private Integer chainStorId;
private Integer giftId;
//所属店铺id
private Integer storeId;
//是否在线 0在线 1 下线

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
@ -11,6 +13,7 @@ import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.CryptoUtils;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -27,6 +30,8 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
@Resource
private StoreService storeService;
@Autowired
private LJGoodsService goodsService;
/**
* 新增数据
* @param cardExchange
@ -49,6 +54,9 @@ public class CardExchangeServiceImpl extends ServiceImpl<CardExchangeMapper, Car
cardExchange.setQrCodeLink(qr_code_link);
String secretKey = "sQPoC/1do9BZMkg8I5c09A==";
CryptoUtils.encryptSymmetrically(secretKey, null,cardExchange.getQrCodeLink(), CryptoUtils.Algorithm.Encryption.AES_ECB_PKCS5);
Integer giftId = cardExchange.getGiftId();
LJGoods ljGoods = goodsService.selectLJGoodsById(giftId);
cardExchange.setGiftName(ljGoods.getName());
return save(cardExchange);
}

View File

@ -12,6 +12,7 @@ public class CardValueRecordDTO extends CardValueRecord {
private String obtain;
private String authCode;
private Double realyPayBills;
private Double balance;
//付款类型 1.微信 2.支付宝
private String payType;
private String oilName;
@ -23,6 +24,7 @@ public class CardValueRecordDTO extends CardValueRecord {
private String appltType;
private String paymentType;
private String payStatus;
private String types;
// /**
// * 会员id

View File

@ -150,9 +150,19 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//会员信息
LJUserVo ljUserVo = ljUserMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
//员工信息
LJStaff ljStaff = mtStaffService.selectStaffById(cardValueRecordDTO.getMtStaffId());
LJStaff ljStaff = new LJStaff();
if(ObjectUtils.isNotEmpty(cardValueRecordDTO.getMtStaffId())){
ljStaff = mtStaffService.selectStaffById(cardValueRecordDTO.getMtStaffId());
}
CardValueVO cardValue = new CardValueVO();
//自定义
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getTypes()) && cardValueRecordDTO.getTypes().equals("1")){
cardValueOrders.setRechargeType("1");
cardValueOrders.setBidBalance(cardValueRecordDTO.getBalance());
cardValueOrders.setRechargeBalance(cardValueRecordDTO.getBalance());
}else {
//查询储值卡信息
CardValueVO cardValue = cardValueService.getOneById(cardValueRecordDTO.getId());
cardValue = cardValueService.getOneById(cardValueRecordDTO.getId());
cardValueOrders.setCardValueId(cardValue.getId());
cardValueOrders.setRechargeType("0");
cardValueOrders.setBidBalance(cardValue.getBidBalance());
@ -165,6 +175,21 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
}
}
//查询储值卡信息
/* CardValueVO cardValue = cardValueService.getOneById(cardValueRecordDTO.getId());
cardValueOrders.setCardValueId(cardValue.getId());
cardValueOrders.setRechargeType("0");
cardValueOrders.setBidBalance(cardValue.getBidBalance());
cardValueOrders.setRechargeBalance(cardValue.getRechargeBalance());
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
cardValueOrders.setGiftBalance(cardValue.getGiftBalance());
}
cardValueOrders.setPoints(cardValue.getPoints());
cardValueOrders.setGrowthValue(cardValue.getGrowthValue());
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
}*/
//优惠券优惠金额
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId());
@ -190,9 +215,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setName(ljUserVo.getName());
cardValueOrders.setMobile(ljUserVo.getMobile());
//员工信息
if (ObjectUtils.isNotEmpty(ljStaff)){
cardValueOrders.setStaffId(ljStaff.getId());
cardValueOrders.setRealName(ljStaff.getRealName());
cardValueOrders.setStaffMobile(ljStaff.getMobile());
}
//员工提成信息
if (ObjectUtils.isNotEmpty(cardValue.getRoyaltyType())){
cardValueOrders.setRoyaltyType(cardValue.getRoyaltyType());
@ -846,6 +873,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//查询储值卡对应的优惠券列表
List<CardFavorable> cardValueVouchers = getCardValueVouchers(cardValue);
//送优惠券兑换券
if (cardValueOrders.getRechargeType().equals("1")){
//会员等级充值送券
giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
}else {
if (CollectionUtils.isNotEmpty(cardValueVouchers)) {
for (CardFavorable cardValueVoucher : cardValueVouchers) {
if (ObjectUtils.isNotEmpty(cardValueVoucher)){
@ -914,6 +945,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//会员等级充值送券
giveCoupon(cardValueOrders.getMtUserId(),cardValueOrders.getStoreId(),ljUserVo,ljStaff);
}
//生成充值记录

View File

@ -30,8 +30,10 @@ import java.util.Map;
@Service
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
@Autowired
@Lazy
private ILJStoreService storeService;
@Autowired
@Lazy
private MtUserGradeChildService userGradeChildService;
@Override

View File

@ -3,22 +3,38 @@ package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.ChainStoreConfig;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.MtUserGradeChild;
import com.fuint.business.userManager.mapper.MtUserGradeChildMapper;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.MtUserGradeChildService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMapper,MtUserGradeChild> implements MtUserGradeChildService {
@Autowired
@Lazy
private LJUserService userService;
@Autowired
private ILJStoreService storeService;
@Autowired
@Lazy
private ChainStoreConfigService chainStoreConfigService;
@Resource
private LJUserGradeService ljUserGradeService;
@Override
public List<MtUserGradeChild> selectListByGradeId(Integer gradeId) {
@ -30,10 +46,23 @@ public class MtUserGradeChildServiceImpl extends ServiceImpl<MtUserGradeChildMap
@Override
public List<MtUserGradeChild> selectListByUserId(Integer userId,Integer storeId) {
LJUserVo userVo = userService.queryUserById(userId, storeId);
LJStore store = storeService.selectStoreById();
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")){
if (ObjectUtil.isNotEmpty(userVo.getGradeId())){
LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeById(userVo.getGradeId());
if (!ljUserGrade.getIfRechargeCoupon().equals("1")){
return new ArrayList<MtUserGradeChild>();
}
}else{
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_grade_id",userVo.getGradeId());
return baseMapper.selectList(queryWrapper);
}
}
return new ArrayList<MtUserGradeChild>();
}
@Override
public void deleteMtUserGradeChildByGradeId(Integer gradeId) {