修改计费逻辑

This commit is contained in:
wuweihua
2026-09-24 18:02:45 +08:00
parent 1174dede01
commit 9292199ca1
3 changed files with 16 additions and 3 deletions
@@ -143,6 +143,7 @@ price.quote.weightInvalid=重量必须大于0
price.quote.bizDateInvalid=业务日期格式必须为yyyy-MM-dd
price.quote.fixedPackageNoDetails=套餐固定价格没有明细,使用产品默认价格
price.quote.noCustomerPackageOverride=没有客户套餐覆盖,使用产品默认运费/挂号费
price.quote.noCustomerPackage=客户未绑定套餐,无法试算
price.quote.quoteIdRequired=报价ID为空
price.quote.hitCustomerFixedPackageDetail=命中客户套餐固定价格明细
@@ -153,6 +154,7 @@ price.bill.notFound=计费记录不存在
price.bill.customerRequired=订单同步缺少有效客户
price.bill.alreadyInArBill=订单{0}已生成应收账单,作废后方可重新计费
price.bill.bizDateRequired=业务日期为空
price.bill.noCustomerPackage=客户未绑定套餐,无法计费
price.bill.fee.scIdRequired=附加费不能为空
price.bill.fee.surchargeNotFound=附加费配置不存在或已停用
price.bill.fee.notFound=费用明细不存在
@@ -56,8 +56,9 @@ import com.ruoyi.price.search.IBillSearchStore;
import com.ruoyi.price.service.ITmsPriceQuoteService;
/**
* Shared quote/bill calc: bound set + active version by bizDate, else product default.
* Quote persists prc_quote; bill path calls calculate() then persists prc_order_bill.
* Shared quote/bill calc: bound set + active version by bizDate.
* No customer package bind: quote and bill both fail hard (no PRODUCT_DEFAULT).
* Bill path: no persist; billing task marked FAILED (abnormal order).
*
* @author ruoyi
*/
@@ -307,6 +308,16 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
}
}
// No customer package bind: do not use PRODUCT_DEFAULT (quote and bill).
// Bill: no persist; billing task catches and writes success_status=FAILED.
if (binds == null || binds.isEmpty())
{
String msgKey = request instanceof TmsPriceBillRequest
? "price.bill.noCustomerPackage"
: "price.quote.noCustomerPackage";
throw new ServiceException(MessageUtils.message(msgKey));
}
TmsPriceQuoteResult fallback = buildDefault(request.getCustomerId(), base, productCode, productName, weight,
MessageUtils.message("price.quote.noCustomerPackageOverride"));
stampRequestMeta(request, fallback);
+1 -1
View File
@@ -7,7 +7,7 @@
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="客户" prop="customerCode">
<customer-select v-model="form.customerCode" value-key="customerCode" placeholder="请选择客户" />
<div class="form-hint">与套餐绑定客户一致;无套餐时走产品默认价</div>
<div class="form-hint">与套餐绑定客户一致;未绑定套餐时报错</div>
</el-form-item>
<el-form-item label="产品" prop="productCode">
<el-select