增加规则配置

This commit is contained in:
wuweihua
2026-10-16 13:40:03 +08:00
parent b3f79ffc4c
commit b54cb1b018
16 changed files with 1376 additions and 7 deletions
@@ -35,6 +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.price.domain.PrcIncomeBill;
import com.bms.price.domain.PrcIncomeBillFee;
import com.bms.price.domain.PrcOrderBill;
@@ -142,6 +143,10 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
@Autowired
private PrcRecalcBillPriceAsyncRunner recalcBillPriceAsyncRunner;
// TODO: reopen with three-side / biz weight rules
// @Autowired
// private IBmsBizRuleService bizRuleService;
private static final int BATCH_ADD_FEE_MAX = 5000;
private static final int BATCH_ADD_FEE_PREVIEW_LIMIT = 20;
private static final int CHARGE_WEIGHT_IMPORT_MAX = 5000;
@@ -167,6 +172,16 @@ 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;
// }
// }
request.setWeight(calcWeight);
TmsPriceQuoteResult result = tmsPriceQuoteService.calculate(request);
persistBill(request, systemWeight, bizDate, result);