Commit 1002f040 by 吕明尚

修改订单计算价格

parent 07225660
......@@ -3159,6 +3159,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse.setDiscount(BigDecimal.ZERO);
priceResponse.setMemberDiscount(new BigDecimal(0.00));
priceResponse.setTotalFeeNow(priceResponse.getTotalFee());
priceResponse.setMonthlyCardId(consumerMonthlyCard.getId());
priceResponse.setPayFee(BigDecimal.ZERO);
} else if (consumerMonthlyCard.getFreeDuration().compareTo(timeLong) < 0) {
priceResponse.setDuration(consumerMonthlyCard.getFreeDuration());
priceResponse.setRemainingDuration(new BigDecimal(0));
......@@ -3171,6 +3173,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal divide = remainingBalance;
divide = divide.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
priceResponse.setTotalFeeNow(divide);
priceResponse.setPayFee(remainingBalance);
priceResponse.setMonthlyCardId(consumerMonthlyCard.getId());
priceResponse.setMemberDiscount(remainingBalance.subtract(divide));
if (consumerWallet.getBalance().compareTo(divide) >= 0) {
priceResponse.setBalance(divide);
......@@ -3182,37 +3186,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
totalFee = divide.subtract(consumerWallet.getBalance());
}
}
// if (consumerMonthlyCard.getFreeDuration().compareTo(timeLong) >= 0) {
// priceResponse.setDuration(timeLong);
// priceResponse.setRemainingDuration(consumerMonthlyCard.getFreeDuration().subtract(timeLong));
// priceResponse.setDiscount(BigDecimal.ZERO);
// totalFee = new BigDecimal(0);
// priceResponse.setMemberDiscount(new BigDecimal(0.00));
//// priceResponse.setTotalFeeNow(priceResponse.getTotalFee());
// priceResponse.setPayFee(BigDecimal.ZERO);
// priceResponse.setMonthlyCardId(consumerMonthlyCard.getId());
// } else if (consumerMonthlyCard.getFreeDuration().compareTo(timeLong) < 0) {
// priceResponse.setDuration(consumerMonthlyCard.getFreeDuration());
// priceResponse.setRemainingDuration(new BigDecimal(0));
// BigDecimal remainingBalance = consumerMonthlyCard.getFreeDuration().multiply(room.getPrice());
// remainingBalance = totalFee.subtract(remainingBalance);
// priceResponse.setTotalFeeNow(remainingBalance);
// priceResponse.setMemberDiscount(totalFee.subtract(remainingBalance));
// totalFee = remainingBalance.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
// priceResponse.setTotalFeeNow(totalFee);
// priceResponse.setPayFee(remainingBalance);
// priceResponse.setMonthlyCardId(consumerMonthlyCard.getId());
// priceResponse.setMemberDiscount(remainingBalance.subtract(totalFee));
// }
// if (consumerWallet.getBalance().compareTo(BigDecimal.ZERO) > 0 && priceResponse.getTotalFeeNow().compareTo(BigDecimal.ZERO) > 0 &&consumerWallet.getBalance().compareTo(priceResponse.getTotalFeeNow()) >= 0) {
// priceResponse.setBalance(priceResponse.getTotalFeeNow());
// priceResponse.setRemainingBalance(consumerWallet.getBalance().subtract(priceResponse.getTotalFeeNow()));
// totalFee = new BigDecimal(0);
// } else if (consumerWallet.getBalance().compareTo(BigDecimal.ZERO) > 0 && priceResponse.getTotalFeeNow().compareTo(BigDecimal.ZERO) > 0 && consumerWallet.getBalance().compareTo(priceResponse.getTotalFeeNow()) < 0) {
// priceResponse.setBalance(consumerWallet.getBalance());
// priceResponse.setRemainingBalance(new BigDecimal(0));
// totalFee = priceResponse.getTotalFeeNow().subtract(consumerWallet.getBalance());
// }
return totalFee;
}
......
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