小程序支付bug

This commit is contained in:
齐天大圣 2024-06-05 15:18:27 +08:00
parent 15f571f44f
commit a89a6c5c27

View File

@ -170,11 +170,17 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setRechargeType("1"); cardValueOrders.setRechargeType("1");
cardValueOrders.setBidBalance(cardValue.getBidBalance()); cardValueOrders.setBidBalance(cardValue.getBidBalance());
cardValueOrders.setRechargeBalance(cardValue.getRechargeBalance()); cardValueOrders.setRechargeBalance(cardValue.getRechargeBalance());
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){ if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance()) && cardValueRecordDTO.getBalance() >= cardValue.getRechargeBalance()){
cardValueOrders.setGiftBalance(cardValue.getGiftBalance()); cardValueOrders.setGiftBalance(cardValue.getGiftBalance());
}
cardValueOrders.setPoints(cardValue.getPoints()); cardValueOrders.setPoints(cardValue.getPoints());
cardValueOrders.setGrowthValue(cardValue.getGrowthValue()); cardValueOrders.setGrowthValue(cardValue.getGrowthValue());
}else {
cardValueOrders.setGiftBalance(0.0);
cardValueOrders.setPoints(0);
cardValueOrders.setGrowthValue(0);
}
cardValueOrders.setAmount(cardValueRecordDTO.getBalance() + cardValueOrders.getGiftBalance());
cardValueOrders.setPayAmount(cardValueRecordDTO.getBalance());
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){ if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit()); cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
} }
@ -201,20 +207,6 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit()); cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
} }
} }
//查询储值卡信息
/* CardValueVO cardValue = cardValueService.getOneById(cardValueRecordDTO.getId());
cardValueOrders.setCardValueId(cardValue.getId());
cardValueOrders.setRechargeType("0");
cardValueOrders.setBidBalance(cardValue.getBidBalance());
cardValueOrders.setRechargeBalance(cardValue.getRechargeBalance());
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
cardValueOrders.setGiftBalance(cardValue.getGiftBalance());
}
cardValueOrders.setPoints(cardValue.getPoints());
cardValueOrders.setGrowthValue(cardValue.getGrowthValue());
if (ObjectUtils.isNotEmpty(cardValue.getFringeBenefit())){
cardValueOrders.setFringeBenefit(cardValue.getFringeBenefit());
}*/
//优惠券优惠金额 //优惠券优惠金额
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){ if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId()); CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId());
@ -258,14 +250,16 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setAmountCommission(cardValue.getAmountCommission()); cardValueOrders.setAmountCommission(cardValue.getAmountCommission());
} }
//订单金额 //订单金额
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){ if (!cardValueRecordDTO.getTypes().equals("1")
&& ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
//订单金额 //订单金额
BigDecimal add = BigDecimal.valueOf(cardValue.getRechargeBalance()).add(BigDecimal.valueOf(cardValue.getGiftBalance())); BigDecimal add = BigDecimal.valueOf(cardValue.getRechargeBalance()).add(BigDecimal.valueOf(cardValue.getGiftBalance()));
cardValueOrders.setAmount(add.doubleValue()); cardValueOrders.setAmount(add.doubleValue());
//支付金额 //支付金额
cardValueOrders.setPayAmount(cardValue.getRechargeBalance()); cardValueOrders.setPayAmount(cardValue.getRechargeBalance());
} }
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance()) && ObjectUtils.isNotEmpty(cardValueRecordDTO.getBalance())){ if (!cardValueRecordDTO.getTypes().equals("1")
&& ObjectUtils.isNotEmpty(cardValue.getGiftBalance()) && ObjectUtils.isNotEmpty(cardValueRecordDTO.getBalance())){
//订单金额 //订单金额
BigDecimal add = BigDecimal.valueOf(cardValue.getGiftBalance()); BigDecimal add = BigDecimal.valueOf(cardValue.getGiftBalance());
cardValueOrders.setAmount(add.doubleValue() + cardValueRecordDTO.getBalance()); cardValueOrders.setAmount(add.doubleValue() + cardValueRecordDTO.getBalance());
@ -282,7 +276,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueOrders.setCardRecordId(cardValueRecordDTO.getCardRecordId()); cardValueOrders.setCardRecordId(cardValueRecordDTO.getCardRecordId());
} }
//优惠金额 //优惠金额
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){ if (!cardValueRecordDTO.getTypes().equals("1")
&& ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
BigDecimal add = BigDecimal.valueOf(cardValue.getGiftBalance()).add(BigDecimal.valueOf(cardFavorableValue)); BigDecimal add = BigDecimal.valueOf(cardValue.getGiftBalance()).add(BigDecimal.valueOf(cardFavorableValue));
cardValueOrders.setDiscount(add.doubleValue()); cardValueOrders.setDiscount(add.doubleValue());
} }