From a8329122a9fd9cde7598775db3a30c8366477767 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 27 Oct 2026 21:34:54 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(=E5=85=A5=E5=BA=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8):=20=E6=81=A2=E5=A4=8D=E9=9C=80=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E5=AD=97=E6=AE=B5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 70149fc7c02a9502985d4a42d32f2f8ae1901df7. --- server/src/services/inspectionQueryService.ts | 19 +------------- .../inspectionListNeedsProcessing.test.ts | 25 ------------------- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 server/tests/inspectionListNeedsProcessing.test.ts diff --git a/server/src/services/inspectionQueryService.ts b/server/src/services/inspectionQueryService.ts index b6bd0c6..78ca41b 100644 --- a/server/src/services/inspectionQueryService.ts +++ b/server/src/services/inspectionQueryService.ts @@ -194,9 +194,7 @@ export async function listInspectionsForManagement( LEFT JOIN skus sk ON sk.sku_code = i.sku_code LEFT JOIN suppliers sup ON sup.supplier_code = i.supplier_code LEFT JOIN LATERAL ( - SELECT oi2.item_name, oi2.category_code, oi2.unit, oi2.category_name, - oi2.processing_method AS line_processing_method, - oi2.processing_owner AS line_processing_owner + SELECT oi2.item_name, oi2.category_code, oi2.unit, oi2.category_name FROM order_items oi2 WHERE oi2.order_code = i.order_code AND (oi2.sku_code = i.sku_code OR i.sku_code IS NULL) @@ -310,19 +308,6 @@ export async function listInspectionsForManagement( demand_sheet.demand_material_qty, demand_sheet.demand_net_weight, demand_sheet.demand_loss_qty, - -- 入库列表「需加工」:订单行是仓内加工,或该订单+商品存在未完工加工需求单。 - -- 前端 InspectionManagement 已有徽标/筛选,缺的只是后端这个只读字段。 - (CASE - WHEN LOWER(TRIM(COALESCE(oi.line_processing_owner, ''))) IN - ('warehouse', 'warehouse_processing', '仓内加工') - AND COALESCE(NULLIF(TRIM(oi.line_processing_method), ''), '原材料') <> '原材料' - THEN TRUE - WHEN demand_sheet.demand_material_qty IS NOT NULL - OR demand_sheet.demand_net_weight IS NOT NULL - THEN TRUE - ELSE FALSE - END) AS needs_processing, - oi.line_processing_method AS processing_method, ${LAST_INBOUND_ZONE_SELECT}, ${inboundPriceSql} AS inbound_unit_price ${listFromSql} @@ -345,8 +330,6 @@ export async function listInspectionsForManagement( demand_material_qty: row.demand_material_qty == null ? null : Number(row.demand_material_qty), demand_net_weight: row.demand_net_weight == null ? null : Number(row.demand_net_weight), demand_loss_qty: row.demand_loss_qty == null ? null : Number(row.demand_loss_qty), - needs_processing: row.needs_processing === true, - processing_method: row.processing_method || null, })); return { diff --git a/server/tests/inspectionListNeedsProcessing.test.ts b/server/tests/inspectionListNeedsProcessing.test.ts deleted file mode 100644 index 13d1f8b..0000000 --- a/server/tests/inspectionListNeedsProcessing.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { readFileSync } from 'node:fs'; -import { describe, expect, it } from 'vitest'; - -const service = readFileSync(new URL('../src/services/inspectionQueryService.ts', import.meta.url), 'utf8'); -const page = readFileSync(new URL('../../src/pages/inspection/InspectionManagement.tsx', import.meta.url), 'utf8'); - -describe('入库列表「需加工」徽标字段', () => { - it('后端 LATERAL 取订单行加工字段并返回 needs_processing', () => { - expect(service).toContain('oi2.processing_method AS line_processing_method'); - expect(service).toContain('oi2.processing_owner AS line_processing_owner'); - expect(service).toContain('AS needs_processing'); - expect(service).toContain('AS processing_method'); - expect(service).toContain("LOWER(TRIM(COALESCE(oi.line_processing_owner, ''))) IN"); - expect(service).toContain('demand_sheet.demand_material_qty IS NOT NULL'); - expect(service).toContain('demand_sheet.demand_net_weight IS NOT NULL'); - expect(service).toContain('needs_processing: row.needs_processing === true'); - }); - - it('前端徽标、筛选与三语文案已存在', () => { - expect(page).toContain('needs_processing: Boolean(item.needs_processing)'); - expect(page).toContain('task.needs_processing'); - expect(page).toContain("t('inspection.needProcess')"); - expect(page).toContain("processingFilter === 'needs'"); - }); -});