demand: TMS系统 - 客户账单管理 - 业务销账申请 - 理赔金额、折让金额、抵扣金额、其他金额不为0的不允许申请

This commit is contained in:
aike 2026-01-12 14:09:17 +08:00
parent 91adaeefba
commit e67e7a1d88

View File

@ -153,6 +153,22 @@ public class EmisWriteoffApplyServiceImpl extends EmisBaseService implements IEm
throw new EmisBizError("运单号 " + detail.getBillCode() + " 的账单应收金额为空");
}
// 检查结算账单的理赔金额、折让金额、抵扣金额、其他金额
if (detail.getEmisSettleBill() == null) {
throw new EmisBizError("运单号 " + detail.getBillCode() + " 的账单信息为空");
}
BigDecimal satisfyMoney = detail.getEmisSettleBill().getSatisfyMoney();
BigDecimal allowanceMoney = detail.getEmisSettleBill().getAllowanceMoney();
BigDecimal deductionMoney = detail.getEmisSettleBill().getDeductionMoney();
BigDecimal otherMoney = detail.getEmisSettleBill().getOtherMoney();
if ((satisfyMoney != null && satisfyMoney.compareTo(BigDecimal.ZERO) != 0) ||
(allowanceMoney != null && allowanceMoney.compareTo(BigDecimal.ZERO) != 0) ||
(deductionMoney != null && deductionMoney.compareTo(BigDecimal.ZERO) != 0) ||
(otherMoney != null && otherMoney.compareTo(BigDecimal.ZERO) != 0)) {
throw new EmisBizError(detail.getSettleBillNo() + " 存在理赔金额/折让金额/抵扣金额/其他金额,请联系财务处理");
}
// 验证:申请金额 + 已收金额 <= 账单应收金额
BigDecimal totalAmount = detail.getApplyMoney().add(receivedAmount);
if (totalAmount.compareTo(recMoney) > 0) {