11 Commits

Author SHA1 Message Date
liufumingren
1571de341c feat(storage): 新增收货未入库提醒定时任务(货主/客服群通知,短语可配置)
- 新增 app/service/systems/receiving_pending_notice.js:扫描「创建时间超过 min_hours 且不足 max_hours 仍未完成入库」的收货单(wms_receiving 未作废、is_deleted=0,且 status=receiving 或 storage_status<>all),
  按货主聚合成一条消息;未绑定货主的单独一批
- 新增 app/schedule/notice_receiving_pending_inbound.js:每 5 分钟单 worker 检查,按各仓库配置的提醒时间(默认 08:30,宽限 10 分钟覆盖调度抖动)执行,
  进程内防重入 + Redis 当日锁 receiving_pending_notice🔒{warehouseId}:{YYYYMMDD}(NX/EX 24h,执行异常释放锁允许窗口内重试),保证每仓库每天只提醒一次
- 仓库设置新增字段 wms_store.subject_config.receiving_pending_inbound_notice:
  enabled(是否通知收货未入库,flag,默认 0 关闭)/ notice_time(提醒时间 HH:mm,默认 08:30)/ min_hours(超时下限,默认 24)/ max_hours(超时上限,默认 48,须大于 min_hours)
  / notice_template(仓库客服群通知短语)/ store_notice_template(货主群通知短语)
- 通知短语可配置并支持变量替换:{warehouse} {warehouse_id} {store} {store_id} {count} {min_hours} {max_hours} {date} {numbers};
  未识别占位符原样保留,留空回退默认短语,最长 500 字符(超长 400)
- 消息结构统一为「短语 + 换行 + 明细(一行一条,最多 20 行,超出提示剩余单数)+ 快速查看/详情查看链接」,不再在结尾追加句号
- 新增通知事件 receiving_pending_inbound(notification_webhook 事件注册 + notice DEFAULT_REGISTERED_EVENT_CODES)与固定群订阅:
  store:receiving,fallbackTargets=warehouse:customer_service —— 有货主推货主收货群,无货主或货主未配收货群时推仓库客服群(出站仍走 notify.reply,落 wms_inbox_message)
- 文档:methods/system.json 的 setting.warehouse.getSettings/saveSettings 补充该配置字段(版本 0.3.129 -> 0.3.131),
  变更记录新增 2026.09.15-warehouse-pending-receiving-notice / -notice-template(system)、2026-09-15-warehouse-01 / -02(warehouse,事件注册与文案结构);
  AI_METHOD_ROUTING.md 同步刷新(新服务 14 个方法)
- 单测 test/app/service/systems/receiving_pending_notice.test.js(11 用例:开关关闭/未命中提醒时间不执行、超时窗口查询条件、货主群通知、无货主回退客服群、
  当日只提醒一次、推送失败不重复、扫描异常释放锁重试、行数截断、非法配置回退默认、短语变量替换与明细逐行、未识别占位符保留)全部通过;npx eslint 无告警

同时提交上一轮未提交的 camera/PTZ 改动(app/lib/ptz_client.js 新增、systems/camera.js 与 systemMethods/camera.js:PTZ 下发给打印服务时请求体统一携带 cameraId),
其文档与路由清单改动与本提交共用 methods/system.json 等文件,无法按行安全拆分,故合并为一次提交。
2026-09-15 23:49:34 +08:00
liufumingren
b5e5d4d588 feat(storeWarehouse,report,notice,order): 签约导出与代开户备注兜底、报表meta下线、入库完成通知与编码规范化
- storeWarehouse: 货主签约列表异步导出 export/exportTaskProgress(26列中文表头Excel+进度回写);openAccount 代开户未传 store_remask(或传空)时默认取公司全称前50字符填充,保证货主名称在列表/导出中始终有值

- report: 下线 report.meta(破坏性),窗口参数改由 definition.typeList、勾选字段经 definition.list 提供;报表投递目标货主状态放宽为 1/2(正常/审核中);reportDelivery 实体展示名称兼容下划线/驼峰并优雅回退 ID

- notice/order: 入库单完成通知货主(entry_order_completed,固定订阅回退链:收货组→售后组→仓库异常群);入库明细 itemId 规范化(非法值降级按 item_code 精确/归一化条码匹配,剥离中文后缀,多命中报错防错配);库存预警定时任务与 webhook 模型调整

- storage: 快捷直入/入库单基本信息等相关小改(inbound_direct_log、storage/entry、storage/inventory)

- docs: methods/system 0.3.62→0.3.63、openapi/qimen 同步,AI_METHOD_ROUTING 与 report-config-guide 同步,methods/changes/*.json 补变更记录
2026-08-31 17:17:48 +08:00
liufumingren
fbd9ac2326 feat(receiving): 收货单通知模板调整(车牌/快递单号未登记显示无)并新增完成时未匹配商品货主通知 2026-08-26 17:22:52 +08:00
liufumingren
591a69d35e fix(notice): 收货通知群路由细化与奇门取消拦截转快递群
- receiving_completed/rejected 只通知仓库收货群,不再通知货主(货主端链接不再生成)
- receiving_reviewed 货主侧三级回退:货主收货群→货主售后群→仓库异常群(sendToWarehouseChannel 支持 fallbackTargets 回退链)
- 新增 receiving_store_bound:收货单创建/首次绑定货主时提醒货主填写车牌号/快递单号,路由同三级回退
- qimen order.cancel 两个拦截分支仅限有运单时创建拦截工单并通知对应快递群,与正常货主发起拦截一致
- 新增 script/backfill-inbox-permissions.cjs:客服/仓库组主管员工回填 inbox 页面与 API 权限(已执行 dev 与线上)
2026-08-17 22:10:47 +08:00
liufumingren
9c2b254206 1
Co-authored-by: Copilot <copilot@github.com>
2026-05-11 08:44:27 +08:00
liufumingren
5ce689d771 1
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 19:20:31 +08:00
liufumingren
0ffe290a21 chore: commit all current workspace changes 2026-04-27 16:09:26 +08:00
liufumingren
622869787a feat: sync workspace changes 2026-04-17 19:21:57 +08:00
liufumingren
3d824a3a1d chore: sync lint and service fixes 2026-04-09 01:36:49 +08:00
liufumingren
e590808062 feat: update receiving notification and report flow 2026-04-05 21:45:18 +08:00
liufumingren
920d201c0e feat: refine setting role/account/permission auth and tests 2026-04-05 09:03:50 +08:00