From 3411d1d78e7689703033e3bdb4d1520f3f67bc7b 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: Fri, 19 Jan 2024 11:04:41 +0800 Subject: [PATCH] bug --- .../impl/ActiveExchangeServiceImpl.java | 93 ++++++++++--------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index 817cd876c..fa6aaacff 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -458,21 +458,21 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { //折扣 if (CollectionUtils.isNotEmpty(activeDiscountVOList)){ for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) { - if (activeDiscountPayVO.getParticipationCondition().equals("0")){ + //if (activeDiscountPayVO.getParticipationCondition().equals("0")){ activeDiscountPayVO.setType("2"); activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount()); resList.add(activeDiscountPayVO); - } + //} } } //满减 if (CollectionUtils.isNotEmpty(activeFuletVOList)){ for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) { - if (activeDiscountPayVO.getParticipationCondition().equals("0")){ + //if (activeDiscountPayVO.getParticipationCondition().equals("0")){ activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount()); activeDiscountPayVO.setType("1"); resList.add(activeDiscountPayVO); - } + // } } } //优惠券 @@ -485,58 +485,48 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { } //折扣+优惠券 for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) { - for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { - if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ - ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); - BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); - activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); - double discountAmount = cardFavorableRecordVO.getDiscountAmount(); - BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount); - activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); - BigDecimal discount = activeDiscountPayVO1.getDiscount(); - activeDiscountPayVO1.setDiscount(bigDecimal.add(discount)); - - activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); - activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); - cardAndDisPays.add(activeDiscountPayVO1); - }else if( !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ - ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); - BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); - String[] split = cardFavorableRecordVO.getOilType().split(","); - if(paymentActiveDTO.getOilId().equals(split)){ + if (activeDiscountPayVO.getParticipationCondition().equals("0")){ + for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { + if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ + ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); + BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); double discountAmount = cardFavorableRecordVO.getDiscountAmount(); - activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount); + activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); BigDecimal discount = activeDiscountPayVO1.getDiscount(); activeDiscountPayVO1.setDiscount(bigDecimal.add(discount)); + activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); cardAndDisPays.add(activeDiscountPayVO1); + }else if( !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ + ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); + BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); + String[] split = cardFavorableRecordVO.getOilType().split(","); + if(paymentActiveDTO.getOilId().equals(split)){ + activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); + double discountAmount = cardFavorableRecordVO.getDiscountAmount(); + activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); + BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount); + BigDecimal discount = activeDiscountPayVO1.getDiscount(); + activeDiscountPayVO1.setDiscount(bigDecimal.add(discount)); + activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); + activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); + cardAndDisPays.add(activeDiscountPayVO1); + } } } - } + } + } //满减+优惠券 for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) { - for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { - if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ - ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); - BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); - activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); - double discountAmount = cardFavorableRecordVO.getDiscountAmount(); - activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); - BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount); - BigDecimal discount = activeDiscountPayVO1.getDiscount(); - activeDiscountPayVO1.setDiscount(bigDecimal.add(discount)); - activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); - activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); - cardAndComPays.add(activeDiscountPayVO1); - }else if (!cardFavorableRecordVO.getExclusiveFunction().equals("0")){ - ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); - BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); - String[] split = cardFavorableRecordVO.getOilType().split(","); - if(paymentActiveDTO.getOilId().equals(split)){ + if (activeDiscountPayVO.getParticipationCondition().equals("0")){ + for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { + if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ + ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); + BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); double discountAmount = cardFavorableRecordVO.getDiscountAmount(); activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); @@ -546,10 +536,24 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); cardAndComPays.add(activeDiscountPayVO1); + }else if (!cardFavorableRecordVO.getExclusiveFunction().equals("0")){ + ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); + BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); + String[] split = cardFavorableRecordVO.getOilType().split(","); + if(paymentActiveDTO.getOilId().equals(split)){ + activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); + double discountAmount = cardFavorableRecordVO.getDiscountAmount(); + activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); + BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount); + BigDecimal discount = activeDiscountPayVO1.getDiscount(); + activeDiscountPayVO1.setDiscount(bigDecimal.add(discount)); + activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); + activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); + cardAndComPays.add(activeDiscountPayVO1); + } } } } - } for (ActiveDiscountPayVO activeDiscountPayVO : resList) { double v = activeDiscountPayVO.getDiscount().doubleValue(); @@ -619,6 +623,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { } } } + //会员等级优惠 Integer oilId = paymentActiveDTO.getOilId();