WMS_MAIN/methods/changes/warehouse.json

420 lines
36 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[
{
"version": "2026.09.23-warehouse-receiving-pending-notice-reliability",
"date": "2026-09-23",
"type": "updated",
"summary": "收货未入库提醒(receiving_pending_inbound)可靠性增强:修复 10 分钟宽限窗口内每 5 分钟一轮导致的重复执行/重复通知(Redis SET NX 抢锁判定修正 + 进程内兜底锁改为 app 级共享集合);逐货主群异常隔离(单群发送异常不中断其他货主群);货主收货群推送失败自动回退仓库客服群人工跟进(独立幂等键与文案前缀);pushSystemMessage 推送幂等去重(同 ext_id 已送达跳过重推)",
"methods": [
"notify.reply"
],
"notes": [
"定时任务锁修复:app/service/systems/receiving_pending_notice.js#acquireDailyLock 中 Redis SET NX 返回 null(键已存在)直接判定未抢到锁,不再落入进程内兜底(兜底仅用于 Redis 不可用/命令异常);进程内兜底锁由 service 实例级改为 app._receivingPendingDailyLocks 共享集合(getMemoryDailyLocks),跨轮次/跨实例生效;app/schedule/notice_receiving_pending_inbound.js 汇总日志补充 fallbackCount。修复 10 分钟宽限窗口内每 5 分钟一轮导致的重复执行/重复通知",
"逐群异常隔离:notifyWarehouse 对每个货主批次 try/catch(sendPendingNotice 内部同样隔离主推异常),单群发送异常只计失败并继续后续货主群,确保所有货主群的收货群均被通知,部分群失败不遗漏其他群",
"失败自动回退客服群:新增 sendCustomerServiceFallback——货主收货群主推失败(含异常)时自动回退仓库客服群人工跟进,文案前缀「通知货主【X】收货群推送失败,请人工跟进:」;幂等键独立为 receiving-pending-fallback:{仓库}:{货主}:{YYYYMMDD},与主推送互不影响;执行汇总(summary)新增 fallbackCount",
"推送幂等去重:app/service/systems/warehouseNotify.js#pushSystemMessage 中同 ext_id 且 push_status=2(已送达)直接返回成功并跳过推送;push_status=0/1/3 仍复用同一 wms_inbox_message 记录重推,防止重复轮次/多实例并发导致同一群重复收到相同通知",
"事件路由与协议不变:仍为 receiving_pending_inbound + notify.reply(type=system),固定订阅 store:receiving(未命中回退 warehouse:customer_service);主推送幂等键仍为 receiving-pending:{仓库}:{货主}:{YYYYMMDD};接口文档(methods/system.json 的 setting.warehouse 字段、methods/warehouse_notify.json 的 notify.reply 协议)无需变更",
"单测:test/app/service/systems/receiving_pending_notice.test.js 新增 5 个用例(推送失败同日不重发+回退计数、回退独立幂等键与失败前缀、逐群异常隔离、Redis SET NX null 判定、app 级进程内锁跨实例共享),全部通过;npx eslint 无告警"
],
"module": "receiving"
},
{
"version": "2026-09-15-warehouse-02",
"date": "2026-09-15",
"type": "changed",
"module": "receiving",
"summary": "收货未入库提醒出站文案改为「短语 + 换行 + 明细(一行一条)」:短语可在仓库设置自定义并插入变量,明细不再拼接在短语同一行,末尾不再追加句号",
"methods": [
"notify.reply"
],
"notes": [
"文案结构(app/service/systems/receiving_pending_notice.js#buildContent):第 1 行 = 短语(模板渲染后),其后换行逐行输出明细(「序号.单号 货主:xx 数量:xx 创建时间:xx 状态:xx」,货主群版不展示货主/数量),最多 20 行,超出补「…… 其余 N 单未列出」,最后一行「快速查看:/详情查看:<链接>」",
"短语来源:仓库设置 subject_config.receiving_pending_inbound_notice.notice_template(仓库/客服群)/ store_notice_template(货主群),留空回退默认短语",
"支持变量:{warehouse}/{warehouse_id}/{store}/{store_id}/{count}/{min_hours}/{max_hours}/{date}/{numbers};未识别的占位符原样保留(便于发现拼写错误),变量渲染不影响未知变量",
"推送协议与路由不变:仍为 notify.reply(type=system)+ 固定订阅 receiving_pending_inbound(store:receiving,未命中回退 warehouse:customer_service)",
"单测:test/app/service/systems/receiving_pending_notice.test.js(11 用例)全部通过;npx eslint 无告警"
]
},
{
"version": "2026-09-15-warehouse-01",
"date": "2026-09-15",
"type": "added",
"module": "receiving",
"summary": "新增收货未入库提醒事件 receiving_pending_inbound:定时扫描「创建超时且未完成入库」的收货单,绑定货主的推货主收货群(未配群回退仓库客服群),未绑定货主的推仓库客服群;仓库设置新增 receiving_pending_inbound_notice(是否通知/提醒时间/超时区间,默认关闭)",
"methods": [
"notify.reply"
],
"notes": [
"事件码注册:app/model/notification_webhook.js 新增 receiving_pending_inbound(name=收货未入库超时提醒,business=receiving);notice/index.js DEFAULT_REGISTERED_EVENT_CODES 同步登记",
"固定群订阅(app/service/systems/notice/index.js#FIXED_GROUP_SUBSCRIPTIONS):receiving_pending_inbound = [store:receiving,fallbackTargets=[warehouse:customer_service]];无货主时 store 目标被跳过,回退链命中仓库客服群,内容走仓库版文案",
"推送协议不变:复用 notify.reply(type=system、content、ext_id、group_id、group_name、timestamp),出站消息落 wms_inbox_message(ext_id 含 receiving-pending:{warehouseId}:{storeId}:{YYYYMMDD})",
"触发通道:app/schedule/notice_receiving_pending_inbound.js(interval 5m、type=worker、进程内防重入)→ app/service/systems/receiving_pending_notice.js#execute;按仓库 subject_config.receiving_pending_inbound_notice.notice_time(默认 08:30,宽限 10 分钟)执行,Redis 当日锁保证一天一次",
"扫描口径:wms_receiving 中 warehouse_id=仓库、is_deleted=0、status<>cancelled、created_at 在 (now-max_hours, now-min_hours] 区间,且(status=receiving 或 storage_status<>all);按 store_id 聚合,每批最多列 20 行(超出提示剩余单数)",
"仓库设置字段:wms_store.subject_config.receiving_pending_inbound_notice = { enabled(默认 false), notice_time(默认 08:30), min_hours(默认 24), max_hours(默认 48,须大于 min_hours) };setting.warehouse.getSettings/saveSettings 文档见 methods/system.json(change 2026.09.15-warehouse-pending-receiving-notice)",
"单测:test/app/service/systems/receiving_pending_notice.test.js(9 用例)全部通过;npx eslint 无告警"
]
},
{
"version": "2026.08.01-warehouse-01",
"date": "2026-08-01",
"type": "added",
"summary": "新增 /warehouse 仓库开放 API 入口,支持仓库级外部适配器 HMAC-SHA256 签名鉴权调用,首批上线 index.ping 心跳 + store.list 货主列表",
"methods": [
"index.ping",
"store.list"
],
"notes": [
"POST /warehouse 为新增入口,独立于 /openapi(货主级),鉴权使用 interface_type_id=3 的仓库 API 应用(由 apiApp 模块管理)。",
"签名算法与 /openapi 完全一致:query 参数字典序 + body 拼接 → HMAC-SHA256 → hex。",
"时间戳 ±10 分钟有效期,Redis 缓存 API 应用配置 300 秒(缓存前缀 warehouse:api-app)。",
"无需 StoreWarehouse 合约关联,直接通过 api_app.warehouse_id 确定仓库上下文。",
"index.ping:无需 body 参数,返回 warehouse_id / app_key / server_time / status。",
"store.list:分页查询当前仓库下已授权的货主,通过 wms_store_warehouse 关联 wms_store,仅返回 auth_status=2 + store.status=1 + warehouse_use_status=1 的记录。",
"api_sign.js 改造:getApiAppConfigByAppKey 新增 interfaceTypeId 参数(默认 2 保持向后兼容),warehouse 入口传 3,查询增加 interface_type_id 条件并返回 warehouse_id。"
],
"module": "warehouse"
},
{
"version": "2026.08.03-warehouse-01",
"date": "2026-08-03",
"type": "added",
"summary": "新增仓库开放 API 站内信模块 inbox.push,支持外部系统将消息推入仓库站内信,WMS 异步转发到目标渠道(IM/API/webhook)",
"methods": [
"inbox.push"
],
"notes": [
"POST /warehouse?method=inbox.push,interface_type_id=3(仓库侧),使用 MD5 签名鉴权",
"warehouse_id 由验签后上下文注入,禁止外部传入(安全边界)",
"ext_id 格式:api:{appKey}:{requestId},用于幂等去重",
"target_url 仅允许 https://,禁止内网 IP(SSRF 防护)",
"推送 body 大小限制 64KB",
"异步推送使用 setImmediate,不阻塞响应;失败指数退避重试(30s→60s→120s,最多3次)",
"路由到 app/service/warehouseMethods/inbox.push → app/service/inbox/receiver.receive"
],
"module": "inbox"
},
{
"version": "2026-08-06",
"date": "2026-08-06",
"summary": "inbox.push 文档同步代码现状:移除废弃参数 sourceChannel/targetChannel/storeId,补齐缺失参数 groupId/groupName/userId/userName/content,更新错误码与描述",
"methods": [
"inbox.push"
],
"notes": [
"移除 sourceChannel / targetChannel / storeId 参数(代码中不存在)",
"补齐 groupId / groupName / userId / userName / content 参数",
"移除 targetChannel/targetUrl 相关错误码",
"新增 parent_id 校验、消息体 64KB 限制错误码",
"ext_id 自动组合为 api:{appKey}:{requestId}"
]
},
{
"version": "2026-08-07",
"date": "2026-08-07",
"summary": "inbox.push: source_type 硬编码为 api,移除 sourceType 入参(仓库 API 入站来源固定为 api,无需外部传入)",
"methods": [
"inbox.push"
],
"notes": [
"source_type 从 body.sourceType || 'api' 改为硬编码 'api'",
"文档移除 sourceType 参数,description 补注 source_type 固定为 api"
]
},
{
"version": "2026-08-14-warehouse-01",
"date": "2026-08-14",
"type": "changed",
"summary": "inbox.push 新增 sendTime 参数与历史消息过滤:外部补推的历史消息不再触发 AI 自动处理(防止误建工单)",
"methods": [
"inbox.push"
],
"notes": [
"inbox.push 新增可选参数 sendTime:消息原始发送时间(毫秒/秒时间戳或 ISO 字符串),由 warehouseMethods/inbox.js parseSendTime 统一规范化为毫秒",
"send_time 统一存入 wms_inbox_message.flags.send_time(毫秒),flags.send_time 与 sendTime 参数等价",
"processor.handleApiMessage 新增历史消息过滤:flags.skipAi=true 或 send_time 距今超过 config.inbox.historyMessageMaxAgeMs(默认 10 分钟)→ 跳过绑群与 AI 处理,不自动回复、不创建工单",
"未传 sendTime 的消息按实时消息处理,保持向后兼容",
"过滤点位于屏蔽检查之后、绑群码识别之前,仅拦截自动处理链路"
],
"module": "inbox"
},
{
"version": "2026-08-16-warehouse-01",
"date": "2026-08-16",
"type": "changed",
"summary": "统一通知系统接入仓库接口消息推送通道:收货完成/驳回/审核通知不再依赖 wms_notification_webhook 配置,按固定群订阅直接推送到仓库收货群与货主收货群",
"methods": [
"notify.reply"
],
"notes": [
"新增 app/service/systems/warehouseNotify.js:仓库接口出站推送服务(MD5 签名 + wms_api_app.callback_url + wms_warehouse_log 日志),供统一通知复用",
"notice/index.js 新增 FIXED_GROUP_SUBSCRIPTIONS 固定订阅:receiving_completed / receiving_rejected / receiving_reviewed → warehouse:receiving + store:receiving(群类型定义见 inbox/groups.js GROUP_TYPES)",
"notice.send 支持 channel 路由:warehouse|group=走仓库接口通道(不查 webhook 配置)、webhook=默认订阅配置、both=双通道",
"receiving.js 三处通知(sendCompletionNotice/sendReviewNotice/rejectReceiving)已传 channel=warehouse,业务链路不再依赖 wms_notification_webhook 表",
"推送复用 notify.reply,data.type=system,data 仅携带 content(通知正文)与 ext_id(业务单号,幂等),接收方只处理 content",
"货主收货群匹配需要 store_id(来自收货单 receiving.store_id);无 store_id 或未配置群时仅推仓库收货群或静默跳过,不影响业务主流程"
],
"module": "warehouse"
},
{
"version": "2026-08-16-warehouse-02",
"date": "2026-08-16",
"type": "changed",
"summary": "统一通知全面迁移仓库接口通道:移除对 wms_notification_webhook 表的读取,全部事件默认经 wms_api_app 配置按固定群订阅推送",
"methods": [
"notify.reply"
],
"notes": [
"notice.send 默认 channel 由 webhook 改为 warehouse:全部通知统一走仓库接口消息推送(wms_api_app.callback_url + 固定群订阅)",
"findMatchedWebhooks 移除 NotificationWebhook.findAll 数据库查询,webhook 通道仅支持调用方显式传入 hooks(channel=webhook 时)",
"FIXED_GROUP_SUBSCRIPTIONS 补齐全部事件:order_cancel_intercepted→warehouse:exception、order_sync_completed→store:after_sales(货主售后群,文案为每行一个订单:订单xx 姓名:xx 电话:xx 运单号:xx)、store_warehouse_print_quantity_adjusted→store:finance、storage_transfer_completed→warehouse:production、wave_strategy_quick_scan_failed→warehouse:exception",
"resolveSubjectConfig 增加 ctx.service 防御判断,兼容单元测试与最小上下文",
"test/app/service/systems/notice.test.js 适配新通道:webhook 行为用例改为显式 channel=webhook + hooks 入参,全部 12 用例通过"
],
"module": "warehouse"
},
{
"version": "2026-08-17-warehouse-01",
"date": "2026-08-17",
"type": "changed",
"summary": "订单同步通知去抖合并:订单同步完成后不再逐单立即通知,等待 3 分钟无新同步后按「仓库:货主」维度合并为一条消息统一推送到货主售后群",
"methods": [
"notify.reply"
],
"notes": [
"order_async.js 新增合并队列:每次同步成功后把订单(单号/姓名/电话/运单号)写入 Redis(order_sync_notice:list:{warehouseId}:{storeId}),到期时间记录在 order_sync_notice:queue ZSET(最后一次同步 + 3 分钟)",
"新增定时任务 app/schedule/order_sync_notice_flush.js(每 30s,worker):扫描到期成员,加锁后原子 RENAME 取出列表,合并为「订单同步完成(共 N 单)+ 每单一行」的单条消息推送",
"发送失败重试:条目放回队列,2 分钟后重试,最多 5 次后放弃并记录错误日志;单条消息最多列 30 单,超出尾部提示「……其余 N 单未列出」",
"Redis 不可用或入队失败时回退为逐单立即通知(保持原有行为),订单同步流程不受影响",
"新增 test/app/service/systems/order_async.noticeDebounce.test.js:5 个用例覆盖入队不立即发、窗口内不冲刷、到期合并单条推送、多订单合并、发送失败重试"
],
"module": "order"
},
{
"version": "2026-08-17-warehouse-02",
"date": "2026-08-17",
"type": "removed",
"summary": "移除移库完成群通知:库存移库(transferLocation 按记录移库 / transferByProduct 按商品移库)完成后不再推送「移库操作完成/按商品移库操作完成」通知",
"methods": [
"notify.reply"
],
"notes": [
"app/service/systems/storage/inventory.js 删除 transferLocation 与 transferByProduct 事务提交后的 notice.send 调用,移库业务本身不受影响",
"事件码 storage_transfer_completed 仍保留注册:app/schedule/notice_stock_remaining.js 库存余量每日提醒复用该事件码,固定群映射 warehouse:production 不变"
],
"module": "storage"
},
{
"version": "2026-08-17-warehouse-03",
"date": "2026-08-17",
"type": "changed",
"summary": "拦截通知无对应快递群时降级转发仓库异常群:拦截工单创建后若运单快递无售后群(或无快递接口),统一转发异常群并在内容前缀标记失败,与货主群缺失降级行为一致",
"methods": [
"notify.reply"
],
"notes": [
"app/service/systems/afterSale.js createInterceptWorkOrdersAndNotify:按快递分组通知售后群时,无群/无接口的运单收集后统一推送到仓库异常群(group_type=warehouse + sub_type=exception + is_blocked=0)",
"降级内容格式:通知快递【快递名】失败\\n{快递名 运单号...}\\n拦截(前缀与货主群缺失降级的「通知货主【X】失败」一致)",
"仅成功通知快递群的工单升级 pending_feedback;降级到异常群的工单保持 pending,等待人工跟进"
],
"module": "after_sale"
},
{
"version": "2026-08-17-warehouse-04",
"date": "2026-08-17",
"type": "changed",
"summary": "收货完成/驳回不再通知货主:receiving_completed 与 receiving_rejected 固定订阅由「仓库收货群+货主收货群」改为仅仓库收货群,货主端快速查看链接不再生成",
"methods": [
"notify.reply"
],
"notes": [
"notice/index.js FIXED_GROUP_SUBSCRIPTIONS:receiving_completed 与 receiving_rejected 均移除 store:receiving 目标,仅保留 warehouse:receiving",
"storage/receiving.js 完成通知移除 storeContent(货主侧 /storage/receiving_owner 链接),只生成仓库侧快速查看链接",
"receiving_reviewed 仍保持双群通知不变",
"e2e 用例 receiving_completed / receiving_rejected expectGroups 调整为仅 g_wh_receiving_debug_001"
],
"module": "receiving"
},
{
"version": "2026-08-17-warehouse-05",
"date": "2026-08-17",
"type": "changed",
"summary": "收货审核通知货主群三级回退:审核明细文件优先推货主收货群,无收货群推货主售后群,均无则降级仓库异常群",
"methods": [
"notify.reply"
],
"notes": [
"FIXED_GROUP_SUBSCRIPTIONS.receiving_reviewed 的 store 目标新增 fallbackTargets(store:after_sales),主目标查询时 fallback 不参与,命中主目标则不推 fallback 群",
"sendToWarehouseChannel 支持 store 目标回退链:主目标未匹配时按 fallbackTargets 顺序逐级查找,命中即停止并视为货主群推送(使用 storeContent/storeId 关联)",
"回退链全部未匹配时沿用原有异常群降级(前缀「通知货主【X】失败」)",
"e2e 新增 receiving_reviewed_fallback_after_sales(货主 1000241,无收货群→售后群)与 receiving_reviewed_fallback_exception(货主 1000282,无收货群无售后群→异常群)两个用例"
],
"module": "receiving"
},
{
"version": "2026-08-17-warehouse-06",
"date": "2026-08-17",
"type": "added",
"summary": "新增收货单创建/首次绑定货主通知(receiving_store_bound):提醒货主收货进行中并确认车牌号/快递单号,路由与审核一致(货主收货群→售后群→异常群)",
"methods": [
"notify.reply"
],
"notes": [
"新事件码 receiving_store_bound 注册(notification_webhook.js AVAILABLE_EVENTS 与 notice/index.js DEFAULT_REGISTERED_EVENT_CODES)",
"FIXED_GROUP_SUBSCRIPTIONS.receiving_store_bound:仅货主侧目标 store:receiving + fallbackTargets store:after_sales(回退链复用 sendToWarehouseChannel 通用逻辑)",
"storage/receiving.js 新增 sendStoreBoundNotice:内容「收货单号:Rxx 正在收货 / 请确认是否已填写车牌号或快递单号」+ 货主端快速查看链接(storeContent)",
"触发点:create(创建时已绑定货主)、bindStore(首次绑定)、updateReceivingStats(商品匹配后自动绑定),失败均不影响主流程",
"e2e 新增 receiving_store_bound(货主 1000000 → 货主收货群)与 receiving_store_bound_fallback_after_sales(货主 1000241 → 售后群)"
],
"module": "receiving"
},
{
"version": "2026-08-17-warehouse-07",
"date": "2026-08-17",
"type": "changed",
"summary": "补回 inbox 权限到操作角色:客服组主管/员工、仓库组主管/员工补齐消息和自动回复/群列表/消息记录页面与 inbox.* API 权限;上线时需执行 script/backfill-inbox-permissions.cjs",
"methods": [],
"notes": [
"新增 script/backfill-inbox-permissions.cjs:按角色合并 inbox 权限 ID(491~503、531 共 14 项,含页面 492/493/494),支持 --dry-run / --role-ids",
"permissions='*' 的全量角色(超级管理员/经理/仓库管理员/货主管理员)自动跳过,原本即拥有",
"dev 库已回填:26 仓库组-主管、27 仓库组-员工、28 客服组-主管、30 客服组-员工"
],
"module": "permission"
},
{
"version": "2026-08-17-warehouse-08",
"date": "2026-08-17",
"type": "fixed",
"summary": "修复 receiving_store_bound 通知文案不感知车牌/快递单号:创建收货单时已填车牌仍提示「请确认是否已填写车牌号或快递单号」,改为已填写时展示已登记信息、未填写才提示补充",
"methods": [
"notify.reply"
],
"notes": [
"sendStoreBoundNotice 根据 receiving.license_plate / receiving.tracking_number 动态生成第三行:已填车牌显示「车牌号:X 已登记」、已填快递单号显示「快递单号:X 已登记」、均未填才显示「请确认是否已填写车牌号或快递单号,未填写请及时补充」",
"三个触发点(create/bindStore/updateReceivingStats)的 receiving 快照均补充 license_plate / tracking_number 字段",
"背景:R20682003 创建时已写入车牌粤EH22E2,但通知为固定提醒文案导致货主误以为车牌未生效"
],
"module": "receiving"
},
{
"version": "2026-08-26-warehouse-01",
"date": "2026-08-26",
"type": "changed",
"summary": "调整 receiving_store_bound 通知模板:不再向货主发送「请确认是否已填写车牌号或快递单号,未填写请及时补充」提示,车牌号/快递单号未登记时展示「车牌号:无 / 快递单号:无」",
"methods": [
"notify.reply"
],
"notes": [
"storage/receiving.js sendStoreBoundNotice:车牌号/快递单号两行始终输出,已登记显示「车牌号:X 已登记」「快递单号:X 已登记」,未登记显示「车牌号:无」「快递单号:无」",
"notification_webhook.js AVAILABLE_EVENTS.receiving_store_bound 描述同步更新:展示车牌号/快递单号登记状态",
"背景:车牌号/快递单号由仓库侧登记,货主端无法填写,「请确认/及时补充」提示对货主无意义,改为直接展示登记状态"
],
"module": "receiving"
},
{
"version": "2026-08-26-warehouse-02",
"date": "2026-08-26",
"type": "added",
"summary": "新增收货完成未匹配商品货主通知(receiving_store_unmatched):收货单提交完成时存在未匹配商品明细,通知货主核实是否为新商品未推送资料",
"methods": [
"notify.reply"
],
"notes": [
"新事件码 receiving_store_unmatched 注册(notification_webhook.js AVAILABLE_EVENTS 与 notice/index.js DEFAULT_REGISTERED_EVENT_CODES)",
"FIXED_GROUP_SUBSCRIPTIONS.receiving_store_unmatched:仅货主侧目标 store:receiving + fallbackTargets store:after_sales(与 receiving_store_bound 一致)",
"storage/receiving.js 新增 sendStoreUnmatchedNotice:内容「收货单号:xxx 提交完成收货,有未匹配商品资料 / 条码:1.xxx,2.xxx / 核实是否是新商品未推送资料 / 详情以及收货图片查看:货主端 receiving_owner 链接 / 如果没有账户请联系人工客服开通」",
"触发点:completeReceiving 事务提交后,unmatchedDetails 非空且已绑定货主时发送,失败不影响主流程"
],
"module": "receiving"
},
{
"version": "2026-08-26-warehouse-03",
"date": "2026-08-26",
"type": "changed",
"summary": "审核通过通知(receiving_reviewed)改为返回 Excel 审核明细下载链接,Excel 生成失败时回退正文展示全部明细(item_code 反查 stock_store)",
"methods": [
"notify.reply"
],
"notes": [
"storage/receiving.js 新增 resolveReviewDetailItemCodeMap:批量反查 wms_stock_store(stock_id=明细 system_product_id,delete_at 为空),返回 system_product_id → item_code 映射",
"sendReviewNotice 内容改为「收货单号:Rxx 完成收货审核 / 审核明细下载:Excel链接 / 请及时提交入库单入库」,标题改为完成收货审核;Excel 生成失败时回退正文展示全部明细(1.商品编码 名称 数量)",
"reviewReceiving 调整为先生成 Excel 再发一次通知(成功带下载链接,失败回退文字),替代原「先文字后文件」两次发送",
"item_code 反查不到时回退明细条码,仍无则显示未知编码"
],
"module": "receiving"
},
{
"version": "2026-08-28-warehouse-01",
"date": "2026-08-28",
"type": "fixed",
"summary": "审核明细 Excel 文件名去中文(审核明细_ → receiving_review_),通知正文修正为「请及时提交入库单入库,入库单务必备注Rxx」,不再额外拼接明细文件行",
"methods": [
"notify.reply"
],
"notes": [
"storage/receiving.js reviewReceiving:Excel 上传文件名改为 receiving_review_{单号}.xlsx,URL 不再含中文,无需转码",
"sendReviewNotice:messageType 固定 text、不再传 url/fileName/mimeType,避免 notice 层追加「明细文件:文件名 链接」行;下载链接直接内嵌正文「审核明细下载:url」",
"正文末尾改为「请及时提交入库单入库,入库单务必备注Rxx」,接收方只处理 content 字段,链接以文本形式可见"
],
"module": "receiving"
},
{
"version": "2026-08-28-warehouse-02",
"date": "2026-08-28",
"type": "fixed",
"summary": "审核明细商品编码反查增加兜底:无对应 wms_stock_store 时回退取 wms_stock_warehouse.item_code,避免部分商品无货主资料时编码缺失",
"methods": [
"notify.reply"
],
"notes": [
"storage/receiving.js resolveReviewDetailItemCodeMap:先按 stock_id 反查 wms_stock_store.item_code,未命中的 system_product_id 兜底查 wms_stock_warehouse(deleted_at 为空)取 item_code",
"两段反查均独立 try/catch,失败仅记日志不阻断审核通知主流程"
],
"module": "receiving"
},
{
"version": "2026-08-28-warehouse-03",
"date": "2026-08-28",
"type": "fixed",
"summary": "notice 群推送链路补齐 ext_data 透传:查群带回群扩展数据,pushSystemMessage 落库与推送均携带,对齐 pushSystemNotification 已有方式",
"methods": [
"notify.reply"
],
"notes": [
"systems/notice/index.js findSubscribedGroups 返回群对象新增 ext_data 字段(取 inbox_group.ext_data)",
"sendToWarehouseChannel 调 pushSystemMessage 时新增 extData=group.ext_data || null",
"systems/warehouseNotify.js pushSystemMessage 新增 extData 入参:wms_inbox_message outbound 行 ext_data 落库,notify.reply 推送体 data.ext_data 透传(与 processor.writeOutboundReply 一致)"
],
"module": "receiving"
},
{
"version": "2026-08-28-warehouse-04",
"date": "2026-08-28",
"type": "fixed",
"summary": "修复通知消息幂等键吞消息:ext_id 加入事件维度,同一业务单不同事件各落一条 outbound 消息",
"methods": [
"notify.reply"
],
"notes": [
"systems/notice/index.js sendToWarehouseChannel:extId 改为 businessId:event(同一收货单的创建/完成/审核事件各落一条 outbound 消息,不再被 sys:notice:{businessId}:{groupId} 幂等复用)",
"findSubscribedGroups 查询增加 ORDER BY id ASC,保证取群顺序稳定",
"systems/warehouseNotify.js:uniqueExtId 超过 VARCHAR(128) 时降级 md5 哈希兜底",
"线上案例:R20691023 审核消息因与「正在收货」共用 ext_id 被幂等吞掉,消息表无审核记录"
],
"module": "receiving"
},
{
"version": "2026-08-28-warehouse-05",
"date": "2026-08-28",
"type": "added",
"summary": "收货单创建/首次绑定货主通知(receiving_store_bound)新增收货人行:优先取 creator_snapshot 创建人姓名,回退当前操作人,无值显示无",
"methods": [
"notify.reply"
],
"notes": [
"storage/receiving.js 新增 resolveReceivingCreatorName:解析 creator_snapshot(字符串 JSON 或对象)取 name/employees_name/real_name,回退 ctx.user.employees_name",
"sendStoreBoundNotice 模板在车牌/快递行后增加「收货人:姓名/无」,修复线上显示「收货人:{}」的空对象问题",
"三个触发点(create/bindStore/updateReceivingStats)的 receiving 快照均补充 creator_snapshot 字段"
],
"module": "receiving"
}
]