This commit is contained in:
齐天大圣 2024-01-19 11:04:41 +08:00
parent f5805e7659
commit 3411d1d78e

View File

@ -458,21 +458,21 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
//折扣 //折扣
if (CollectionUtils.isNotEmpty(activeDiscountVOList)){ if (CollectionUtils.isNotEmpty(activeDiscountVOList)){
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) { for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
if (activeDiscountPayVO.getParticipationCondition().equals("0")){ //if (activeDiscountPayVO.getParticipationCondition().equals("0")){
activeDiscountPayVO.setType("2"); activeDiscountPayVO.setType("2");
activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount()); activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount());
resList.add(activeDiscountPayVO); resList.add(activeDiscountPayVO);
} //}
} }
} }
//满减 //满减
if (CollectionUtils.isNotEmpty(activeFuletVOList)){ if (CollectionUtils.isNotEmpty(activeFuletVOList)){
for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) { for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) {
if (activeDiscountPayVO.getParticipationCondition().equals("0")){ //if (activeDiscountPayVO.getParticipationCondition().equals("0")){
activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount()); activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount());
activeDiscountPayVO.setType("1"); activeDiscountPayVO.setType("1");
resList.add(activeDiscountPayVO); resList.add(activeDiscountPayVO);
} // }
} }
} }
//优惠券 //优惠券
@ -485,58 +485,48 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
} }
//折扣+优惠券 //折扣+优惠券
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) { for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { if (activeDiscountPayVO.getParticipationCondition().equals("0")){
if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1);
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)){
activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId());
double discountAmount = cardFavorableRecordVO.getDiscountAmount(); double discountAmount = cardFavorableRecordVO.getDiscountAmount();
activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount); BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount);
activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
BigDecimal discount = activeDiscountPayVO1.getDiscount(); BigDecimal discount = activeDiscountPayVO1.getDiscount();
activeDiscountPayVO1.setDiscount(bigDecimal.add(discount)); activeDiscountPayVO1.setDiscount(bigDecimal.add(discount));
activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName());
cardAndDisPays.add(activeDiscountPayVO1); 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 (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) {
for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) { if (activeDiscountPayVO.getParticipationCondition().equals("0")){
if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO(); if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1); ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1);
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)){
activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId()); activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId());
double discountAmount = cardFavorableRecordVO.getDiscountAmount(); double discountAmount = cardFavorableRecordVO.getDiscountAmount();
activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount()); activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
@ -546,10 +536,24 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount())); activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName()); activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName());
cardAndComPays.add(activeDiscountPayVO1); 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) { for (ActiveDiscountPayVO activeDiscountPayVO : resList) {
double v = activeDiscountPayVO.getDiscount().doubleValue(); double v = activeDiscountPayVO.getDiscount().doubleValue();
@ -619,6 +623,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
} }
} }
} }
//会员等级优惠 //会员等级优惠
Integer oilId = paymentActiveDTO.getOilId(); Integer oilId = paymentActiveDTO.getOilId();