From 81e69b6e0b0b49060b76069316fafb6b3dd59912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Wed, 6 Mar 2024 15:55:55 +0800 Subject: [PATCH] bug --- .../impl/ActiveConsumptionServiceImpl.java | 4 +- .../cardValue/entity/CardValueChild.java | 1 + .../service/impl/CardValueServiceImpl.java | 41 +++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java index aed948d27..49dcd3f21 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java @@ -84,8 +84,6 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl { private String activeGift; //赠送卡券名称 private String giftCardName; + private String instruction; //生效日期类型 0 ,1,2 private String timeType; //券类型 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java index 76bf71055..1746aa3f2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueServiceImpl.java @@ -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 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)){