diff --git a/bms-back/ruoyi-admin/src/main/resources/i18n/messages.properties b/bms-back/ruoyi-admin/src/main/resources/i18n/messages.properties index 7e4b34e3..7a70d8cc 100644 --- a/bms-back/ruoyi-admin/src/main/resources/i18n/messages.properties +++ b/bms-back/ruoyi-admin/src/main/resources/i18n/messages.properties @@ -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=费用明细不存在 diff --git a/bms-back/ruoyi-system/src/main/java/com/ruoyi/price/service/impl/TmsPriceQuoteServiceImpl.java b/bms-back/ruoyi-system/src/main/java/com/ruoyi/price/service/impl/TmsPriceQuoteServiceImpl.java index 39772436..7659bb3a 100644 --- a/bms-back/ruoyi-system/src/main/java/com/ruoyi/price/service/impl/TmsPriceQuoteServiceImpl.java +++ b/bms-back/ruoyi-system/src/main/java/com/ruoyi/price/service/impl/TmsPriceQuoteServiceImpl.java @@ -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); diff --git a/bms-front/src/views/price/billing/quote.vue b/bms-front/src/views/price/billing/quote.vue index 20510ace..9f582d05 100644 --- a/bms-front/src/views/price/billing/quote.vue +++ b/bms-front/src/views/price/billing/quote.vue @@ -7,7 +7,7 @@ -
与套餐绑定客户一致;无套餐时走产品默认价
+
与套餐绑定客户一致;未绑定套餐时报错