From b0f56b27f575fd1127ea6a90817c36fbe48386bf Mon Sep 17 00:00:00 2001 From: lunanting Date: Fri, 25 Sep 2026 14:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E9=80=80=E7=9C=8B=E6=9D=BF=E9=A6=96?= =?UTF-8?q?=E4=BB=93=E6=94=B9=E4=B8=BA=E5=B4=94=E6=A1=A5=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E4=BB=93=EF=BC=88=E6=95=B0=E6=8D=AE=E6=BA=90=EF=BC=9A=E5=B4=94?= =?UTF-8?q?=E6=A1=A5=E5=B7=A5=E5=8E=82=E5=AE=A2=E9=80=80=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E4=BB=93=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按 2026-09-25 业务口径,第一张子看板由「横林二仓客退数据监控」改为 「崔桥工厂仓客退数据监控」,取数仓位同步改为聚水潭「崔桥工厂客退临时上架仓」。 - 仓库配置:简尚-崔桥工厂仓 wms_co_id=15038426,客退位 customize_qty_1 - key 由 henglin2 改为 cuiqiao,同步改路由 / 侧边栏 / 路由映射 / 权限条目 - 旧路径 returns-inventory/henlin2* 保留为重定向,避免历史链接 404 - 核销看板(returnMonitorService)仍指向横林二仓,前端入口已下线,本次未动 副本取证:该仓客退位当前只有 2 编码 / 2 件(退货单有量:ERP 3115 条 + 奇门 1812 条),属「客退上架库存未同步进副本」,页面需靠导入功能补数据。 --- backend/src/api/returnStockWarning.js | 2 +- backend/src/index.js | 4 +- backend/src/jobs/returnMonitorJob.js | 2 +- .../services/returnStockWarehouseRegistry.js | 43 ++++++++++++------- frontend/src/api/returnMonitor.js | 2 +- frontend/src/api/returnStockWarning.js | 2 +- frontend/src/config/sidebarNavigation.js | 2 +- frontend/src/constants/sidebarPages.js | 2 +- frontend/src/layouts/BasicLayout.jsx | 6 +-- .../pages/ReturnsInventoryWarning/Monitor.jsx | 4 +- .../ReturnsInventoryWarning/StockWarning.jsx | 2 +- .../ReturnsInventoryWarning/warehouses.js | 19 ++++---- frontend/src/router/index.jsx | 18 +++++--- 13 files changed, 64 insertions(+), 44 deletions(-) diff --git a/backend/src/api/returnStockWarning.js b/backend/src/api/returnStockWarning.js index 613a83a..7863427 100644 --- a/backend/src/api/returnStockWarning.js +++ b/backend/src/api/returnStockWarning.js @@ -25,7 +25,7 @@ const resolveScope = (value) => (['imported', 'replica'].includes(String(value)) /** * GET /api/return-stock-warning/list —— 退货库存预警列表(客退数据监控,按仓库出数) - * warehouse: 仓库标识 henlin2 / subei / suining / shandong / henan(缺省 = 横林二仓) + * warehouse: 仓库标识 cuiqiao / subei / suining / shandong / henan(缺省 = 崔桥工厂仓) */ router.get('/list', async (req, res, next) => { try { diff --git a/backend/src/index.js b/backend/src/index.js index 7ee85f3..26d6bab 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -665,9 +665,9 @@ async function startServer(options = {}) { cubejsApp.use('/api/mkh-bom', authMiddleware, mkhBomRoutes); cubejsApp.use('/api/daily-inventory', authMiddleware, dailyInventoryRoutes); cubejsApp.use('/api/return-inventory-warning', authMiddleware, returnInventoryWarningRoutes); - // 横林二仓客退:退货入库核销 + 每日库存监控 + // 崔桥工厂仓客退:退货入库核销 + 每日库存监控 cubejsApp.use('/api/return-monitor', authMiddleware, returnMonitorRoutes); - // 横林二仓客退:退货库存预警(箱及仓位库存 · 客退临时上架仓) + // 崔桥工厂仓客退:退货库存预警(箱及仓位库存 · 崔桥工厂客退临时上架仓) cubejsApp.use('/api/return-stock-warning', authMiddleware, returnStockWarningRoutes); // ===================== diff --git a/backend/src/jobs/returnMonitorJob.js b/backend/src/jobs/returnMonitorJob.js index 8c40465..2c640ad 100644 --- a/backend/src/jobs/returnMonitorJob.js +++ b/backend/src/jobs/returnMonitorJob.js @@ -28,7 +28,7 @@ function startReturnMonitorScheduler() { cron.schedule(JOB_CRON, () => { runReturnMonitorCompare('cron').catch(() => {}); }, { timezone: TIMEZONE }); - console.log(`[Scheduler] 横林二仓客退库龄核销任务已注册: ${JOB_CRON} (${TIMEZONE})`); + console.log(`[Scheduler] 崔桥工厂仓客退库龄核销任务已注册: ${JOB_CRON} (${TIMEZONE})`); } module.exports = { startReturnMonitorScheduler, runReturnMonitorCompare }; diff --git a/backend/src/services/returnStockWarehouseRegistry.js b/backend/src/services/returnStockWarehouseRegistry.js index dda3178..ab3a110 100644 --- a/backend/src/services/returnStockWarehouseRegistry.js +++ b/backend/src/services/returnStockWarehouseRegistry.js @@ -14,13 +14,21 @@ * · returnBinName = 用户口径的聚水潭仓位名,写进页面/导出的「数据来源」,便于核对; * · returnSlot = 副本里真正取数的那一列,必须与上面的仓位名一一对应。 * - * 仓位名 → 库存位 对照(2026-09-17 实测,条件 ISNULL(col,0) > 0): - * 箱及仓位库存 · 简尚-横林二仓 · 客退临时上架仓 customize_qty_1 1274 编码 / 3271 件 - * 箱及仓位库存 · 简尚-新苏北仓 · 新苏北客退上架仓 customize_qty_1 83 编码 / 317 件 - * 箱及仓位库存 · 简尚-睢宁仓 · 睢宁客退上架仓 customize_qty_1 46 编码 / 173 件 - * 箱及仓位库存 · 简尚-山东青岗集仓 · 青岗集客退上架仓 customize_qty_2 324 编码 / 625 件 + * 仓位名 → 库存位 对照(2026-09-25 复测,条件 ISNULL(col,0) > 0): + * 箱及仓位库存 · 简尚-崔桥工厂仓 · 崔桥工厂客退临时上架仓 customize_qty_1 2 编码 / 2 件 ⚠ + * 箱及仓位库存 · 简尚-新苏北仓 · 新苏北客退上架仓 customize_qty_1 75 编码 / 362 件 + * 箱及仓位库存 · 简尚-睢宁仓 · 睢宁客退上架仓 customize_qty_1 98 编码 / 243 件 + * 箱及仓位库存 · 简尚-山东青岗集仓 · 青岗集客退上架仓 customize_qty_2 403 编码 / 912 件 * 箱及仓位库存 · 简尚-河南洛宁仓 · 河南洛宁客退上架仓 三位全为 0(无数据) * + * ⚠ 崔桥工厂仓(15038426)是 2026-09-25 用户指定替换横林二仓的。复测结论: + * 副本里该仓客退位只有 2 编码 / 2 件,但退货单量很大(ERP 售后单 3,115 条 + + * 奇门退款单 1,812 条,warehouse='简尚-崔桥工厂仓销退仓')——即「退货有,客退上架库存 + * 没同步进副本」。全库 218 张表里没有任何「销退仓 / 客退仓 / 上架仓」命名的独立仓 + * (jst_warehouseInfo 里 name 含「退」的为 0),销退仓只是退货单据里的 warehouse 文本值。 + * 所以崔桥这张看板在当前副本下**必然近乎空白**,要出数只能:① 让 IT 把该仓客退上架仓 + * 的库存同步进 jst_inventoryInfo 的自定义库存位;② 用页面「导入」上传聚水潭导出文件。 + * * ⚠ 副本里**没有任何仓位维度**(2026-09-17 复核:218 张表 / 5,496 个字段中,列名含 * bin / box / position / location / shelf / slot 的为 0 个;jst_sku.bin、jst_sku.other_bin、 * jst_returnAndRefundItem.box_id、jst_packInventoryInfo.bin 四个疑似字段 100% 为空)。 @@ -37,20 +45,23 @@ const RETURN_SLOT_COLUMNS = ['customize_qty_1', 'customize_qty_2', 'customize_qt const WAREHOUSE_LIST = [ { - key: 'henlin2', - // 页面标题 / 侧边栏名称 - title: '横林二仓客退数据监控', - shortName: '横林二仓', + key: 'cuiqiao', + // 页面标题 / 侧边栏名称(2026-09-25 用户指定:原「横林二仓客退数据监控」改为崔桥工厂仓) + title: '崔桥工厂仓客退数据监控', + shortName: '崔桥工厂仓', // 仓库主表 jst_warehouseInfo.wms_co_id - wmsCoId: 15033302, - warehouseName: '简尚-横林二仓', + wmsCoId: 15038426, + warehouseName: '简尚-崔桥工厂仓', // 退货单(售后单 / 奇门退款单)里的销退仓名称,仅 firstInbound 口径用到 - returnWarehouseDb: '简尚-横林二仓销退仓', - // 聚水潭「箱及仓位库存」里对应的仓位名(页面/导出的「数据来源」直接显示它) - returnBinName: '客退临时上架仓', + returnWarehouseDb: '简尚-崔桥工厂仓销退仓', + // 聚水潭「箱及仓位库存」里对应的仓位名(2026-09-25 用户指定,页面/导出直接显示它) + returnBinName: '崔桥工厂客退临时上架仓', // 客退临时上架仓占用的自定义库存位 returnSlot: 'customize_qty_1', - // 该仓当天是否有客退在库数据(2026-09-17 实测);空仓时页面给提示 + // ⚠ 2026-09-25 实测:该仓在副本 jst_inventoryInfo 里客退位只有 2 个编码 / 2 件 + //(qty 总库存 92,818 件;return_qty / c2 / c3 / sale_refund_qty 全为 0)。 + // 退货单是有的(ERP 售后单 3,115 条 + 奇门退款单 1,812 条), + // 说明是「客退上架仓」这一仓位没同步进副本,不是业务上没有退货。 hasReturnStock: true, }, { @@ -106,7 +117,7 @@ const WAREHOUSE_LIST = [ }, ]; -const DEFAULT_WAREHOUSE_KEY = 'henlin2'; +const DEFAULT_WAREHOUSE_KEY = 'cuiqiao'; const WAREHOUSE_MAP = new Map(WAREHOUSE_LIST.map((item) => [item.key, item])); diff --git a/frontend/src/api/returnMonitor.js b/frontend/src/api/returnMonitor.js index 43b4113..65f45cd 100644 --- a/frontend/src/api/returnMonitor.js +++ b/frontend/src/api/returnMonitor.js @@ -2,7 +2,7 @@ import request from './request'; const LONG_TIMEOUT_MS = 10 * 60 * 1000; -// 横林二仓客退:退货入库核销 + 每日库存监控看板 +// 崔桥工厂仓客退:退货入库核销 + 每日库存监控看板 export const getReturnMonitorDashboard = (params = {}) => request.get( '/api/return-monitor/dashboard', { params, timeout: LONG_TIMEOUT_MS } diff --git a/frontend/src/api/returnStockWarning.js b/frontend/src/api/returnStockWarning.js index 86eff31..f345030 100644 --- a/frontend/src/api/returnStockWarning.js +++ b/frontend/src/api/returnStockWarning.js @@ -3,7 +3,7 @@ import request from './request'; const LONG_TIMEOUT_MS = 10 * 60 * 1000; // 客退数据监控(箱及仓位库存 · 客退临时上架仓) -// params.warehouse: henlin2 / subei / suining / shandong / henan(缺省 = 横林二仓) +// params.warehouse: cuiqiao / subei / suining / shandong / henan(缺省 = 崔桥工厂仓) export const getReturnStockWarningList = (params = {}) => request.get( '/api/return-stock-warning/list', { params, timeout: LONG_TIMEOUT_MS } diff --git a/frontend/src/config/sidebarNavigation.js b/frontend/src/config/sidebarNavigation.js index e6ac086..52e71ee 100644 --- a/frontend/src/config/sidebarNavigation.js +++ b/frontend/src/config/sidebarNavigation.js @@ -21,7 +21,7 @@ export const DEFAULT_SIDEBAR_CONFIG = { { key: 'returns-inventory', type: 'group', label: '退货库存监控', icon: 'inbox', visible: true, order: 75, defaultExpanded: true, children: [ - { key: 'returns-inventory-henlin2', label: '横林二仓客退数据监控', icon: 'table', routeKey: 'returns-inventory-henlin2', visible: true, order: 10 }, + { key: 'returns-inventory-cuiqiao', label: '崔桥工厂仓客退数据监控', icon: 'table', routeKey: 'returns-inventory-cuiqiao', visible: true, order: 10 }, { key: 'returns-inventory-subei', label: '苏北客退数据监控', icon: 'table', routeKey: 'returns-inventory-subei', visible: true, order: 20 }, { key: 'returns-inventory-suining', label: '睢宁客退数据监控', icon: 'table', routeKey: 'returns-inventory-suining', visible: true, order: 30 }, { key: 'returns-inventory-shandong', label: '山东客退数据监控', icon: 'table', routeKey: 'returns-inventory-shandong', visible: true, order: 40 }, diff --git a/frontend/src/constants/sidebarPages.js b/frontend/src/constants/sidebarPages.js index f6df6b6..30a8803 100644 --- a/frontend/src/constants/sidebarPages.js +++ b/frontend/src/constants/sidebarPages.js @@ -5,7 +5,7 @@ export const SIDEBAR_PAGES = [ { pageKey: 'dashboard_preview', path: '/planning/dev-style-preview', name: '仪表盘', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, { pageKey: 'settings', path: '/settings', name: '系统设置', category: 'system', defaultRoles: DEFAULT_SYSTEM_ROLES }, { pageKey: 'daily_inventory', path: '/planning/operation/daily-inventory', name: '每日进销存', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, - { pageKey: 'returns_inventory_henlin2', path: '/planning/operation/returns-inventory/henlin2', name: '横林二仓客退数据监控', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, + { pageKey: 'returns_inventory_cuiqiao', path: '/planning/operation/returns-inventory/cuiqiao', name: '崔桥工厂仓客退数据监控', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, { pageKey: 'returns_inventory_subei', path: '/planning/operation/returns-inventory/subei', name: '苏北客退数据监控', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, { pageKey: 'returns_inventory_suining', path: '/planning/operation/returns-inventory/suining', name: '睢宁客退数据监控', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, { pageKey: 'returns_inventory_shandong', path: '/planning/operation/returns-inventory/shandong', name: '山东客退数据监控', category: 'planning', defaultRoles: DEFAULT_PLANNING_ROLES }, diff --git a/frontend/src/layouts/BasicLayout.jsx b/frontend/src/layouts/BasicLayout.jsx index ab110ba..25f86b9 100644 --- a/frontend/src/layouts/BasicLayout.jsx +++ b/frontend/src/layouts/BasicLayout.jsx @@ -81,9 +81,9 @@ const SIDEBAR_ROUTE_MAP = { }, 'promotion-module': { path: '/planning/operation/promotion-module' }, 'product-monitoring': { path: '/planning/operation/product-monitoring' }, - 'returns-inventory-henlin2': { - path: '/planning/operation/returns-inventory/henlin2', - activePath: '/planning/operation/returns-inventory/henlin2', + 'returns-inventory-cuiqiao': { + path: '/planning/operation/returns-inventory/cuiqiao', + activePath: '/planning/operation/returns-inventory/cuiqiao', matchMode: 'prefix', }, 'returns-inventory-subei': { diff --git a/frontend/src/pages/ReturnsInventoryWarning/Monitor.jsx b/frontend/src/pages/ReturnsInventoryWarning/Monitor.jsx index 1d21a45..5977ffd 100644 --- a/frontend/src/pages/ReturnsInventoryWarning/Monitor.jsx +++ b/frontend/src/pages/ReturnsInventoryWarning/Monitor.jsx @@ -7,7 +7,7 @@ import './monitor.css'; /** * 客退数据监控(按仓库出数) * - * 同一个页面支撑 5 张看板:横林二仓 / 苏北 / 睢宁 / 山东 / 河南。 + * 同一个页面支撑 5 张看板:崔桥工厂仓 / 苏北 / 睢宁 / 山东 / 河南。 * 结构完全一致,差异只有「取哪个仓」——由路由传入的 warehouseKey 决定, * 页面本身不拼任何仓库相关的 SQL 或口径。 * @@ -31,7 +31,7 @@ const Monitor = ({ warehouseKey }) => { {warehouse.hasReturnStock && warehouse.returnSlot !== 'customize_qty_1' ? (

注:该仓位在业务库里占用的是 {warehouse.returnSlot} - (横林二仓 / 苏北 / 睢宁用的是 customize_qty_1),页面已按这个位取数。 + (崔桥工厂仓 / 苏北 / 睢宁用的是 customize_qty_1),页面已按这个位取数。

) : null} {!warehouse.hasReturnStock ? ( diff --git a/frontend/src/pages/ReturnsInventoryWarning/StockWarning.jsx b/frontend/src/pages/ReturnsInventoryWarning/StockWarning.jsx index 279e508..5562e09 100644 --- a/frontend/src/pages/ReturnsInventoryWarning/StockWarning.jsx +++ b/frontend/src/pages/ReturnsInventoryWarning/StockWarning.jsx @@ -381,7 +381,7 @@ const COLUMNS = [ /** * 客退数据监控主表(按仓库出数) * warehouse: 仓库标识 henlin2 / subei / suining / shandong / henan, - * 透传给列表 / 导出 / 导入 / 清除导入四个接口;缺省走后端默认仓(横林二仓) + * 透传给列表 / 导出 / 导入 / 清除导入四个接口;缺省走后端默认仓(崔桥工厂仓) */ const StockWarning = ({ warehouse }) => { // 前端只用来定文案(导出文件名 / 空态提示),取数与口径一律以后端返回为准 diff --git a/frontend/src/pages/ReturnsInventoryWarning/warehouses.js b/frontend/src/pages/ReturnsInventoryWarning/warehouses.js index 9af8c32..86ee366 100644 --- a/frontend/src/pages/ReturnsInventoryWarning/warehouses.js +++ b/frontend/src/pages/ReturnsInventoryWarning/warehouses.js @@ -5,20 +5,21 @@ * 这里只负责「路由 → 仓库标识 → 页面标题/描述」的映射,不改动任何口径。 * * 各仓的「客退上架仓」在聚水潭里的仓位名不同,占用的自定义库存位也不同 - * (横林/苏北/睢宁 = customize_qty_1,山东 = customize_qty_2),文案里要如实写出来, - * 否则看数据的人会对不上聚水潭。仓位名以用户 2026-09-17 口径为准。 + * (崔桥/苏北/睢宁 = customize_qty_1,山东 = customize_qty_2),文案里要如实写出来, + * 否则看数据的人会对不上聚水潭。仓位名以用户口径为准(2026-09-25 起首仓改为崔桥工厂仓)。 */ -export const DEFAULT_WAREHOUSE_KEY = 'henlin2'; +export const DEFAULT_WAREHOUSE_KEY = 'cuiqiao'; export const WAREHOUSES = [ { - key: 'henlin2', - title: '横林二仓客退数据监控', - shortName: '横林二仓', - warehouseName: '简尚-横林二仓', - returnBinName: '客退临时上架仓', + key: 'cuiqiao', + title: '崔桥工厂仓客退数据监控', + shortName: '崔桥工厂仓', + warehouseName: '简尚-崔桥工厂仓', + returnBinName: '崔桥工厂客退临时上架仓', returnSlot: 'customize_qty_1', + // 2026-09-25 实测:副本里该仓客退位只有 2 编码 / 2 件(退货单有量,库存没同步) hasReturnStock: true, }, { @@ -62,7 +63,7 @@ export const WAREHOUSES = [ const WAREHOUSE_MAP = new Map(WAREHOUSES.map((item) => [item.key, item])); -/** 取仓库配置,非法 key 回落到默认仓(横林二仓) */ +/** 取仓库配置,非法 key 回落到默认仓(崔桥工厂仓) */ export const resolveWarehouseConfig = (key) => ( WAREHOUSE_MAP.get(String(key || '').trim()) || WAREHOUSE_MAP.get(DEFAULT_WAREHOUSE_KEY) ); diff --git a/frontend/src/router/index.jsx b/frontend/src/router/index.jsx index 5b297d6..c20985e 100644 --- a/frontend/src/router/index.jsx +++ b/frontend/src/router/index.jsx @@ -120,8 +120,8 @@ const router = createBrowserRouter([ // 客退数据监控(5 张看板共用同一个页面,靠 warehouseKey 区分取哪个仓; // 单一「退货库存预警」视图,原 明细/超期/汇总/差异 四个页签已下线) { - path: 'planning/operation/returns-inventory/henlin2', - element: renderLazyComponent(ReturnsInventoryMonitor, { warehouseKey: 'henlin2' }), + path: 'planning/operation/returns-inventory/cuiqiao', + element: renderLazyComponent(ReturnsInventoryMonitor, { warehouseKey: 'cuiqiao' }), }, { path: 'planning/operation/returns-inventory/subei', @@ -140,17 +140,25 @@ const router = createBrowserRouter([ element: renderLazyComponent(ReturnsInventoryMonitor, { warehouseKey: 'henan' }), }, // 历史路径(子看板 / 页签形态)→ 统一回到主看板 + { + path: 'planning/operation/returns-inventory/henlin2', + element: , + }, { path: 'planning/operation/returns-inventory/henlin2/monitor', - element: , + element: , }, { path: 'planning/operation/returns-inventory/henlin2/inbound', - element: , + element: , }, { path: 'planning/operation/returns-inventory/henlin2/stock', - element: , + element: , + }, + { + path: 'planning/operation/returns-inventory/cuiqiao/monitor', + element: , }, { path: 'planning/operation/store-checkup', element: }, { path: 'planning/operation/review-analysis', element: }, -- 2.47.2