Commit 7eddb268 by 吕明尚

修改使用优惠券和钱包的计算

parent 31c4f90f
......@@ -1963,16 +1963,18 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse.setDuration(new BigDecimal(0));
priceResponse.setRemainingDuration(new BigDecimal(0));
if (priceResponse.getPayFee().compareTo(new BigDecimal(0)) > 0) {
if (consumerWallet.getBalance().compareTo(priceResponse.getPayFee()) >= 0) {
priceResponse.setBalance(priceResponse.getPayFee());
priceResponse.setRemainingBalance(consumerWallet.getBalance().subtract(priceResponse.getPayFee()));
totalFee = new BigDecimal(0);
} else if (consumerWallet.getBalance().compareTo(priceResponse.getPayFee()) < 0) {
priceResponse.setBalance(consumerWallet.getBalance());
totalFee = priceResponse.getPayFee().subtract(consumerWallet.getBalance());
if (ObjectUtil.isNotEmpty(consumerWallet)) {
if (consumerWallet.getBalance().compareTo(priceResponse.getPayFee()) >= 0) {
priceResponse.setBalance(priceResponse.getPayFee());
priceResponse.setRemainingBalance(consumerWallet.getBalance().subtract(priceResponse.getPayFee()));
totalFee = new BigDecimal(0);
} else if (consumerWallet.getBalance().compareTo(priceResponse.getPayFee()) < 0) {
priceResponse.setBalance(consumerWallet.getBalance());
totalFee = priceResponse.getPayFee().subtract(consumerWallet.getBalance());
}
priceResponse.setPayFee(totalFee);
}
priceResponse.setPayFee(totalFee);
if (ObjectUtil.isNotEmpty(consumerMember)) {
MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>().eq(MemberConfig::getId, consumerMember.getMemberConfigId()));
//总金额乘以折扣比例除以100
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment