增加规则判断

This commit is contained in:
wuweihua
2026-10-16 14:05:50 +08:00
parent b54cb1b018
commit 9824e05919
@@ -35,7 +35,7 @@ import com.bms.common.utils.uuid.IdUtils;
import com.bms.customer.customerinfo.domain.BmsCustomer;
import com.bms.customer.customerinfo.mapper.BmsCustomerMapper;
import com.bms.system.mapper.SysUserMapper;
// import com.bms.system.service.IBmsBizRuleService;
import com.bms.system.service.IBmsBizRuleService;
import com.bms.price.domain.PrcIncomeBill;
import com.bms.price.domain.PrcIncomeBillFee;
import com.bms.price.domain.PrcOrderBill;
@@ -143,9 +143,8 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
@Autowired
private PrcRecalcBillPriceAsyncRunner recalcBillPriceAsyncRunner;
// TODO: reopen with three-side / biz weight rules
// @Autowired
// private IBmsBizRuleService bizRuleService;
@Autowired
private IBmsBizRuleService bizRuleService;
private static final int BATCH_ADD_FEE_MAX = 5000;
private static final int BATCH_ADD_FEE_PREVIEW_LIMIT = 20;
@@ -172,16 +171,15 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
PrcOrderBill existed = orderBillMapper.selectPrcOrderBillByOrderNo(request.getOrderNo());
BigDecimal systemWeight = request.getWeight();
BigDecimal calcWeight = resolveCalcWeight(existed, systemWeight);
// TODO: reopen three-side / biz weight rules later
// Manual charge_weight wins; otherwise apply active biz rules (e.g. three-side).
// if (!isManualChargeWeight(existed))
// {
// BigDecimal ruled = bizRuleService.resolveWeightByRule(request, systemWeight);
// if (ruled != null)
// {
// calcWeight = ruled;
// }
// }
if (!isManualChargeWeight(existed))
{
BigDecimal ruled = bizRuleService.resolveWeightByRule(request, systemWeight);
if (ruled != null)
{
calcWeight = ruled;
}
}
request.setWeight(calcWeight);
TmsPriceQuoteResult result = tmsPriceQuoteService.calculate(request);
persistBill(request, systemWeight, bizDate, result);