This commit is contained in:
齐天大圣 2024-03-07 17:51:27 +08:00
parent b89782be6f
commit 9edf510ca1
2 changed files with 36 additions and 0 deletions

View File

@ -36,6 +36,7 @@ public class ActiveNewlywedsChild extends Model<ActiveNewlywedsChild> {
private String giftCardType;
//券详情
private String giftCardDetail;
private String instruction;
//生效日期类型 0 12
private String timeType;
//券有效期

View File

@ -19,9 +19,13 @@ 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.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.service.AccountService;
@ -57,6 +61,11 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private AccountService accountService;
@Resource
private CardFavorableMapper cardFavorableMapper;
@Resource
private CardExchangeMapper cardExchangeMapper;
/**
*
* @param activeNewlywedsDTO
@ -267,6 +276,23 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
//优惠券
if (activeNewlywedsChild.getActiveGift().equals("1")){
CardFavorable cardFavorable = cardFavorableMapper.selectById(activeNewlywedsChild.getVouchersId());
if (ObjectUtils.isNotEmpty(cardFavorable)){
activeNewlywedsChild.setGiftCardName(cardFavorable.getName());
activeNewlywedsChild.setGiftCardDetail(cardFavorable.getCardDetail());
if (ObjectUtils.isNotEmpty(cardFavorable.getValidityZero())){
activeNewlywedsChild.setValidityZero(cardFavorable.getValidityZero());
}
if (ObjectUtils.isNotEmpty(cardFavorable.getValidityOne())){
activeNewlywedsChild.setValidityOne(cardFavorable.getValidityOne());
}
if (ObjectUtils.isNotEmpty(cardFavorable.getValidityTwo())){
activeNewlywedsChild.setValidityTwo(cardFavorable.getValidityTwo());
}
activeNewlywedsChild.setInstruction(cardFavorable.getInstruction());
activeNewlywedsChildService.updateById(activeNewlywedsChild);
}
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeNewlywedsChild.getVouchersId());
@ -280,6 +306,15 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
}
//兑换券
if (activeNewlywedsChild.getActiveGift().equals("2")){
//兑换券
CardExchange cardExchange = cardExchangeMapper.selectById(activeNewlywedsChild.getVouchersId());
if (ObjectUtils.isNotEmpty(cardExchange)) {
activeNewlywedsChild.setGiftCardName(cardExchange.getName());
activeNewlywedsChild.setGiftCardDetail(cardExchange.getCardDetail());
activeNewlywedsChild.setGiftCardTime(cardExchange.getValidity());
activeNewlywedsChild.setInstruction(cardExchange.getUseInstructions());
activeNewlywedsChildService.updateById(activeNewlywedsChild);
}
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeNewlywedsChild.getVouchersId());