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)){
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();