From fc337ff44d42192fc911883ccd16750e788b4a88 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 18 Oct 2026 20:47:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8A=A5=E4=BB=B7=E5=8D=95):=20=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=B7=B2=E5=88=A0=E9=99=A4=E7=9A=84=E5=86=85=E9=83=A8?= =?UTF-8?q?=E6=94=B9=E4=BB=B7=E5=AE=A1=E6=A0=B8=E5=89=8D=E7=BD=AE=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=EF=BC=88=E5=90=A6=E5=88=99=20A=20=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E4=BC=9A=2042P01=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/services/quotePriceProposalService.ts | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/server/src/services/quotePriceProposalService.ts b/server/src/services/quotePriceProposalService.ts index 93a03f9..0075d4a 100644 --- a/server/src/services/quotePriceProposalService.ts +++ b/server/src/services/quotePriceProposalService.ts @@ -35,7 +35,7 @@ import { getMappingByDeliverySku, getSheetMappingStats } from './skuMappingServi * 纪律(前几轮踩过): * · 出站 HTTP **永远在事务之外**;B 审批路径**不调** `triggerQuoteCostSync`(由配送侧按 D3 落地); * · 台账 `main_system_quote_cost_pushes` 的唯一键/rearm 已存在 —— 本层**不重造推送、不直接写台账**; - * · `quote_sheet_change_requests`(内部改价审核)与 `quote_price_proposals`(对外传递)是**两层**,不合并; + * · 内部改价审核已删除(2026-10-18 用户裁定):改价一律走 `quote_price_proposals` 由对方审核; * A 发起只检查"内部是否有在途 pending"; * · 开关 `MAIN_SYSTEM_QUOTE_PRICE_PROPOSAL` 默认关 ⇒ 零出站、零写库(路由 503)。 * @@ -208,21 +208,6 @@ async function loadSheetItemRows(quoteSheetCode: string): Promise { return result.rows; } -/** 内部改价审核是否仍有在途 pending(A 发起的前置条件) */ -async function hasInternalReviewPending(branchCode: string, quoteSheetCode: string): Promise { - const result = await pool.query<{ status: string }>( - `SELECT status FROM quote_sheet_change_requests - WHERE branch_code = $1 AND quote_sheet_code = $2 - ORDER BY requested_at DESC - LIMIT 1`, - [branchCode, quoteSheetCode] - ); - const latest = result.rows[0]; - if (!latest) return false; - // 有在途 ⇒ 必须等内部审完;历史上只有被覆盖(superseded)而没有后继的行也视为未收口 - return latest.status === 'pending' || latest.status === 'superseded'; -} - async function findLocalByRemoteId( remoteProposalId: string ): Promise { @@ -322,9 +307,6 @@ export async function submitPriceProposal(input: { const sheet = await loadQuoteSheetForUpdate(input.quoteSheetCode, input.ctx, input.operatingBranchCode); const quoteSheetCode = String(sheet.quote_sheet_code); - if (await hasInternalReviewPending(branchCode, quoteSheetCode)) { - throw httpError(409, 'internal_review_pending', '该报价单还有未完成的内部改价审核,请先审完再提交配送商审核'); - } const existingPending = await findPendingLocal(branchCode, quoteSheetCode, 'to_delivery'); const customerRows = await pool.query<{ customer_code: string }>(