This commit is contained in:
齐天大圣 2024-03-06 15:55:55 +08:00
parent a97c077ee8
commit 81e69b6e0b
3 changed files with 43 additions and 3 deletions

View File

@ -84,8 +84,6 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
@Resource
private CardExchangeMapper cardExchangeMapper;
@Resource
private ILJStaffService ljStaffService;
/**
@ -255,8 +253,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
activeConsumptionChild.setGiftCardName(cardExchange.getName());
activeConsumptionChild.setGiftCardDetail(cardExchange.getCardDetail());
activeConsumptionChild.setGiftCardTime(cardExchange.getValidity());
activeConsumptionChildService.updateById(activeConsumptionChild);
activeConsumptionChild.setInstruction(cardExchange.getUseInstructions());
activeConsumptionChildService.updateById(activeConsumptionChild);
}
}
}

View File

@ -31,6 +31,7 @@ public class CardValueChild extends Model<CardValueChild> {
private String activeGift;
//赠送卡券名称
private String giftCardName;
private String instruction;
//生效日期类型 0 12
private String timeType;
//券类型

View File

@ -11,6 +11,10 @@ import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumpti
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscount;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeMapper;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper;
import com.fuint.business.marketingActivity.cardValue.dto.CardValueDTO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueChild;
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueMapper;
@ -52,6 +56,11 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
private StoreService storeService;
@Autowired
private LJUserGradeService userGradeService;
@Resource
private CardFavorableMapper cardFavorableMapper;
@Resource
private CardExchangeMapper cardExchangeMapper;
/**
* 分页查询所有数据
* @param page
@ -208,6 +217,38 @@ public class CardValueServiceImpl extends ServiceImpl<CardValueMapper, CardValue
queryWrapper.eq(CardValueChild::getCardValueId,id);
queryWrapper.orderByDesc(CardValueChild::getCreateTime);
List<CardValueChild> activeNewlywedsChildList = cardValueChildService.list(queryWrapper);
for (CardValueChild cardValueChild : activeNewlywedsChildList) {
//优惠券
if (cardValueChild.getActiveGift().equals("1")){
CardFavorable cardFavorable = cardFavorableMapper.selectById(cardValueChild.getVouchersId());
if (ObjectUtils.isNotEmpty(cardFavorable)){
cardValueChild.setGiftCardName(cardFavorable.getName());
cardValueChild.setGiftCardDetail(cardFavorable.getCardDetail());
if (ObjectUtils.isNotEmpty(cardFavorable.getValidityZero())){
cardValueChild.setValidityZero(cardFavorable.getValidityZero());
}
if (ObjectUtils.isNotEmpty(cardFavorable.getValidityOne())){
cardValueChild.setValidityOne(cardFavorable.getValidityOne());
}
if (ObjectUtils.isNotEmpty(cardFavorable.getValidityTwo())){
cardValueChild.setValidityTwo(cardFavorable.getValidityTwo());
}
cardValueChild.setInstruction(cardFavorable.getInstruction());
cardValueChildService.updateById(cardValueChild);
}
}
if (cardValueChild.getActiveGift().equals("2")){
//兑换券
CardExchange cardExchange = cardExchangeMapper.selectById(cardValueChild.getVouchersId());
if (ObjectUtils.isNotEmpty(cardExchange)) {
cardValueChild.setGiftCardName(cardExchange.getName());
cardValueChild.setGiftCardDetail(cardExchange.getCardDetail());
cardValueChild.setGiftCardTime(cardExchange.getValidity());
cardValueChild.setInstruction(cardExchange.getUseInstructions());
cardValueChildService.updateById(cardValueChild);
}
}
}
BeanUtils.copyProperties(cardValue,cardValueVO);
cardValueVO.setMembershipLevel(cardValue.getMembershipLevel().split(","));
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){