update 判断保险金额

This commit is contained in:
Lemon
2025-09-09 09:59:59 +08:00
parent 74b2f93db3
commit 012e375300

View File

@@ -1950,8 +1950,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
// 校验订单支付金额,消费金额,退款金额
BigDecimal orderPayAmount = afterSettleOrderDTO.getOrderPayAmount(); // 支付金额
if (orderBasicInfo.getInsuranceAmount() != null) {
// 如果该笔订单保险金额不为空,则将支付金额 - 保险金额作为新的支付金额
if (orderBasicInfo.getInsuranceAmount().compareTo(BigDecimal.ZERO) > 0) {
// 如果该笔订单保险金额大于0,则将支付金额 - 保险金额作为新的支付金额
orderPayAmount = orderPayAmount.subtract(orderBasicInfo.getInsuranceAmount());
}
BigDecimal orderConsumeAmount = afterSettleOrderDTO.getOrderConsumeAmount(); // 消费金额
@@ -2248,8 +2248,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
return resultList;
}
// 如果保险金额不为空,新增一条分账信息
if (orderBasicInfo.getInsuranceAmount() != null) {
// 如果保险金额大于0,新增一条分账信息
if (orderBasicInfo.getInsuranceAmount().compareTo(BigDecimal.ZERO) > 0) {
SplitData insuranceSplit = new SplitData();
insuranceSplit.setMemberId(Constants.ZERO);
insuranceSplit.setAmount(String.valueOf(orderBasicInfo.getInsuranceAmount()));