diff --git a/app/service/systems/warehouse_panel.js b/app/service/systems/warehouse_panel.js index 0469fa5..9b5d1cb 100644 --- a/app/service/systems/warehouse_panel.js +++ b/app/service/systems/warehouse_panel.js @@ -493,7 +493,19 @@ class WarehousePanelService extends Service { )) AS cnt`, { warehouseId, start: todayStart, end: tomorrowStart } ), - model.PackTask.count({ where: { warehouse_id: warehouseId, status: 1 } }), + // 打包中订单数:订单表 pack_status='padding'(池内 + 配送表今日出库,与未打包/已打包同源订单表口径) + Promise.all([ + currentModel.count({ where: { ...pendingBase, pack_status: 'padding' } }), + dispatchModel.count({ + where: { + status: { [Op.ne]: 'cancel' }, + outbound_status: 'fin', + pack_status: 'padding', + delivery_time: todayRange, + dispatch_lane: { [Op.in]: [ 'm4', 'm5' ] }, + }, + }), + ]).then(([ currentCount, dispatchCount ]) => currentCount + dispatchCount), model.PackTask.count({ where: { warehouse_id: warehouseId, status: 3 } }), ]); diff --git a/methods/changes/system.json b/methods/changes/system.json index 777c9be..2f86016 100644 --- a/methods/changes/system.json +++ b/methods/changes/system.json @@ -1,4 +1,19 @@ [ + { + "version": "0.3.290", + "date": "2026-10-12", + "type": "updated", + "summary": "index.getWarehousePanelData 打包卡 doing 改订单表 pack_status=padding 订单数口径(0.3.289 → 0.3.290)", + "methods": [ + "index.getWarehousePanelData" + ], + "notes": [ + "变更内容:stageOverview 打包卡 doing 由「打包中任务数(wms_pack_task status=1 count)」改为「打包中订单数」——订单表 pack_status=padding(池内 pendingBase + 配送表今日出库 dispatchTodayBase 双表计数),与 fulfillment 未打包/已打包同源订单表口径。", + "数据说明:生产实测池内 padding=0;配送表今日出库存在 96 条 pack_status=padding 残留(订单已 outbound_status=fin 但出库未回填 pack_status,另有 8 条打包任务 status=1 挂起且关联订单均已出库),属历史数据问题,待出库回填逻辑修复。", + "代码依据:app/service/systems/warehouse_panel.js#queryStageOverview(packDoing 改 Promise.all 双表 count pack_status=padding);ESLint 0 错误。", + "文档变更范围:methods/system.json 的 module=index 分组仅更新 index.getWarehousePanelData 一条(response.data.description 与 notes 补 doing 口径);根版本 0.3.289 → 0.3.290、updatedAt 保持 2026-10-12;methods/changes/system.json 新增本条(插入数组首位);其余 method 未改动。" + ] + }, { "version": "0.3.289", "date": "2026-10-12", diff --git a/methods/system.json b/methods/system.json index 1becbd2..ca8e3a9 100644 --- a/methods/system.json +++ b/methods/system.json @@ -1,7 +1,7 @@ { "module": "system", "description": "系统接口标准入口,method 对应系统内置方法,全部使用 POST 请求,参数统一放在 body 内", - "version": "0.3.289", + "version": "0.3.290", "updatedAt": "2026-10-12", "headers": [ { @@ -2621,7 +2621,7 @@ "name": "data", "type": "object", "required": true, - "description": "面板数据对象;is_change=false 时为空对象(节约流量),is_change=true 时输出。已输出字段:title(仓库名)、fulfillment(订单履约链路 6 环节未/已 + total + items 末尾两项今日退件/今日拆包;各环节未/已均含配送表今日出库按环节状态拆分补数,打包环节已* 用订单状态存量口径(池内 pack_status=fin + 配送表今日出库 pack_status=fin,保证已复核≥已打包))、stageOverview(totalOrders/interceptOrders/stages 5 卡:receiving/shelf/pick/recheck/pack,pack 卡 today=今日已完成打包的真实订单数(status=2,不含打包中):散单任务数 + 团购波次 wms_order_wave_index 真实订单数(替代 pack_quantity 快照),doing/abnormal 为任务数)、b2b(orders/goods/sku)、groupPicking、scatterPicking(orders/goods/sku/wave/top5)、groupPacking、scatterPacking(各含 orders/goods/sku/wave/top5,按波次范围 wave_scope 区分:团购块 top 按打包台、散单块 top 按打包员)、trend(max/total/points 业务日 24 点:label 从仓库自然日开始时间(day_start_time)起到次日自然日开始时间,每点 { label, created_count }——created_count=业务日窗口内下单量(池内待处理 + 配送表今日出库订单按订单创建时间落桶,窗口即业务日 [自然日开始时间, 次日自然日开始时间):未到次日自然日开始时间时=今日自然日开始时间起,凌晨(已过零点)时=昨日自然日开始时间起)并按小时累计(最后一点=业务日内下单总量);total=今日总单量(与 fulfillment.total 同口径:待处理订单池 + 配送表今日出库))、weeklyEfficiency(days 7 天 intercept)" + "description": "面板数据对象;is_change=false 时为空对象(节约流量),is_change=true 时输出。已输出字段:title(仓库名)、fulfillment(订单履约链路 6 环节未/已 + total + items 末尾两项今日退件/今日拆包;各环节未/已均含配送表今日出库按环节状态拆分补数,打包环节已* 用订单状态存量口径(池内 pack_status=fin + 配送表今日出库 pack_status=fin,保证已复核≥已打包))、stageOverview(totalOrders/interceptOrders/stages 5 卡:receiving/shelf/pick/recheck/pack,pack 卡 today=今日已完成打包的真实订单数(status=2,不含打包中):散单任务数 + 团购波次 wms_order_wave_index 真实订单数(替代 pack_quantity 快照),doing=打包中订单数(订单表 pack_status=padding 池内+配送今日出库双表)、abnormal 为任务数)、b2b(orders/goods/sku)、groupPicking、scatterPicking(orders/goods/sku/wave/top5)、groupPacking、scatterPacking(各含 orders/goods/sku/wave/top5,按波次范围 wave_scope 区分:团购块 top 按打包台、散单块 top 按打包员)、trend(max/total/points 业务日 24 点:label 从仓库自然日开始时间(day_start_time)起到次日自然日开始时间,每点 { label, created_count }——created_count=业务日窗口内下单量(池内待处理 + 配送表今日出库订单按订单创建时间落桶,窗口即业务日 [自然日开始时间, 次日自然日开始时间):未到次日自然日开始时间时=今日自然日开始时间起,凌晨(已过零点)时=昨日自然日开始时间起)并按小时累计(最后一点=业务日内下单总量);total=今日总单量(与 fulfillment.total 同口径:待处理订单池 + 配送表今日出库))、weeklyEfficiency(days 7 天 intercept)" } ], "errors": [],