42 Commits

Author SHA1 Message Date
liufumingren
9af7dcf8fb feat(storeWarehouse): 签约关系接口配置按货主开放接口落库且回调地址统一取配置
- storeWarehouse.store.saveApiConfig:新增 resolveContractApiInterfaceType,
  interface_type_id=3(OPEN_API_WAREHOUSE 仓库开放接口)自动映射为 2(OPEN_API 货主开放接口)落库,
  不再要求当前主体为仓库(货主可维护自身签约关系下的接口配置)
- callback_url 不再取入参(含 callbackUrl 别名),统一写入 config.openapi.defaultCallbackUrl(新增配置项,默认空)
- storeWarehouse.store.listApiConfig:interface_type_id 过滤同步映射(传 3 按 2 查询)
- 文档:methods/system.json 升级 0.3.350、methods/changes/system.json 变更记录、docs/openapi-callback-events.md 回调地址来源说明
- 测试:saveApiConfig 新增 4 条用例(3→2 落库、忽略入参回调地址、默认值未配置、货主主体可保存、缺失类型 404),listApiConfig 新增 1 条过滤映射用例

同时提交工作区其余在制品改动:
- waybill:移除 wms_order_express_trace 模型并新增 drop 迁移,轨迹查询/取号/打印链路调整
- order:订单 SN 编码(order_item_sn / order_item_sn_log / sn_code_rule、has_sn_item 回填迁移),pendingOrder/recheckOrder/wave/base 调整
- express_platform、order_async、order_export、order_storage_allocation、storage.report、stock_store 配套修复
- lib:新增 jd_client,调整 qimen_client、callback_functions 及配套测试

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-14 17:14:04 +08:00
liufumingren
7414a8f2a1 feat(express): 店铺快递列表补充快递产品类型
- getShopExpressList 按 sys_express_code 匹配 wms_express_product_type,补充 product_types: [{ name, code }]

- PDD 平台不补充该字段;产品类型读取异常时降级为空数组,不影响快递列表返回

- 补充单测;该测试文件原有 11 个失败为改动前既有失败(基线同样失败)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-27 03:08:58 +08:00
liufumingren
640ce501cb feat(user): 新增账号用户名/密码修改与自定义密码标记
- wms_account 新增 is_custom_password(TINYINT(1) NOT NULL DEFAULT 0),同步模型与迁移 20261025135000;开发库、生产库均已执行

- user.getAccountInfo 返回 is_custom_password,仍不返回 password_hash/salt/last_login_ip

- 新增 user.updateUsername:仅改当前账号,服务端重名校验并排除自己,重名返回 409,更新后清理用户缓存

- 新增 user.changePassword:is_custom_password=0 时旧密码可不传,修改后置 1;再次修改必须校验旧密码;已排除操作日志避免明文密码落库

- 单测覆盖 getAccountInfo/updateUsername/changePassword,20 通过;同步 AI_METHOD_ROUTING

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-27 03:08:51 +08:00
liufumingren
0e7545bd9a feat(user): 新增 user.getAccountInfo 账号级信息查询
- 新增 user.getAccountInfo:仅查询当前登录账号的 wms_account 信息

- 白名单返回 id/username/real_name/phone/email/status/last_login_at/created_at/updated_at,排除 password_hash、salt、last_login_ip

- 未登录返回 401,账号不存在返回 404;不接收账号ID,避免越权查询

- 同步 methods/system.json(0.3.304 → 0.3.305)、变更记录、AI_METHOD_ROUTING 与方法文档库表

- 新增单测 test/app/service/systemMethods/user.getAccountInfo.test.js(5 通过)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-25 13:43:26 +08:00
liufumingren
55f766f643 fix(stockout): 出库单确认按来源分流回传,运单号口径收敛为复数
- storage.stockout.confirm 出站回传改为按 source_type 分流(复用 order_async.js 既有分流实现):
  QM→奇门 taobao.qimen.stockout.confirm;API→OpenAPI 回调 stockout.confirm(appKey 按货主合约
  反查 wms_store_warehouse(auth_status=2) + wms_api_app(启用且 callback_url 非空));
  WMS 等内部来源无需外部通知、直接视为成功。修复此前 API 来源出库单被硬编码发往奇门、
  遭「-1 无法匹配货主」拒绝后无法确认(跳过出站同样走失败分支)的问题。
- storage.stockout.confirm 运单号校验与回传改为以复数 waybill_codes 为准(对齐奇门
  packages.package[].expressCode 多运单模型,不使用 deliveryOrder.expressCode);
  单数 waybill_code 已弃用,仅在复数缺失时回退单数兼容存量单;失败文案改为 (waybill_codes)。
- storage.stockout.updateExpress 以 waybill_codes 为准,单数 waybill_code 降级为镜像字段
  (传非空复数时镜像首个、传空数组/null 时同步置 NULL、同时传两列时复数优先);
  仅传单数的旧调用方行为不变。
- app/service/systems/order_async.js 新增 3 个可复用实例方法(buildStockoutConfirmRequest /
  notifyStockoutExternal / resolveOpenApiAppByStore),薄封装既有模块级实现,
  未改动原函数及其既有调用方。
- 新增回归测试:stockout.confirm.outbound.test.js(8 条,覆盖 API/QM/WMS 三路来源、多运单复数
  回传、存量单单数回退)、stockout.updateExpress.test.js(7 条,覆盖复数镜像与兼容行为)。
- 同步 methods/system.json 与 methods/changes/system.json(storage.stockout.confirm /
  storage.stockout.updateExpress)。
2026-09-15 15:40:39 +08:00
liufumingren
6701e661c5 feat(order): 拣货任务列表支持按拣货车编码 cart_code 查询 2026-09-10 23:52:43 +08:00
liufumingren
68dbf65c77 feat: 波次复核开始时间回写与统计/防覆盖修复
- 波次策略列表 order.wave.waveStrategyList 成功响应新增 info.order_count(当前查询条件下全部策略命中订单去重总数,新增 getWaveStrategyMatchedOrderCountTotal,与行级统计同口径,统计失败安全降级为 0)

- 拣货任务 wms_wave_pick_task.finish_time 防覆盖:两处写入改为 CASE WHEN finish_time IS NULL,只记第一次

- 波次复核开始时间:新增迁移 20260908120000(wms_wave_batch 新增 recheck_start_time 字段,已在开发/生产执行)、模型字段同步、scanOrder 各成功分支首次回写(新增 markWaveRecheckStart,仅 IS NULL 时写入,回写失败不影响扫描主流程)

- 同步 methods/system.json 与 methods/changes/system.json 接口文档及变更记录(docMeta.version 更新至 0.3.101)

- 新增 recheckOrder-scanOrder-recheckStartTime HTTP 行为验证脚本与验证报告
2026-09-08 16:36:57 +08:00
liufumingren
007babb6c6 fix(order): 订单详情兜底查询,配送表查空回退待处理表,待处理详情固定先查 dispatch 再兜底 current,避免表位流转后详情落空 2026-09-03 17:00:53 +08:00
liufumingren
d36a46c5ab fix(order): 取消波次增加拣货状态校验,拣货中/已完成波次禁止取消 2026-08-29 21:04:47 +08:00
liufumingren
232985a272 feat(wave): 策略命中数按同快递拆分统计与退回原因中文标签
- getWaveStrategyMatchedOrderCountFilteredMap 改收策略行并按 require_same_express 拆分计数,
  同快递策略按 items_hash+快递分组, 与抓取候选 SQL 口径一致, max_same_structure<=0 视为不设上限
- waveStrategyFallbackOrderList excluded_reason 改中文标签, 兼容 lock_status 归一化 Y/N 与原始值
2026-08-21 02:20:07 +08:00
liufumingren
943a20f582 fix(print): express 打印组件解析支持系统平台编码回退
- 淘宝 TB/天猫 TM/1688/TGC 等系统平台编码未在 wms_print_platform 直接匹配时,
  经 wms_platform.print_platform_id 回退解析 wms_print_platform.platform_name
- 移除 loadExpressPlatformComponents 调试 console.log,改走 ctx.logger.info
- 新增 TB 回退解析成功与无映射失败的单元测试
2026-08-18 23:59:11 +08:00
liufumingren
358fef0f71 chore: apply ESLint auto-fixes, JSDoc additions, and CRLF→LF normalization (no logic changes) 2026-08-08 20:28:18 +08:00
liufumingren
5378fcd137 refactor(print): 打印模块重构
- 新增 systems/order_print.js 订单打印业务层(getPrintDataByWaybillCodes 等)
- print.js 删除 retry 补偿相关代码(normalizeRetrySendPayload/getRetryEligibility)
- order/print.js 新增 getPrintDataByWaybillCodes 方法
- printer_data_builder.js 新增 appendExtraCustomLines + extraCustomLines 参数支持
- polo_api_client.js 添加调试缓存
- 删除 print_retry_compensation 定时任务测试
2026-08-01 03:44:53 +08:00
liufumingren
19f0449992 fix: 手工运单号防误删三层防护 + 操作日志businessId修正
1. hardDeleteWaybillAsyncOrderExpressRows 加 status:0 过滤,保护手工录入 status=1 记录
2. createWaybillCodePipeline 入口跳过 business_key=1 且已分配运单的订单
3. manualWaybill 操作日志 businessId 从仓库ID 修正为订单ID String(orderId)
4. 新增 14 个单元测试,全部通过
2026-07-07 17:06:43 +08:00
liufumingren
2817d17fc7 1 2026-07-06 00:33:12 +08:00
liufumingren
7854057244 chore: ESLint auto-fix formatting (JSDoc, spacing, quotes, line endings) 2026-07-04 23:30:32 +08:00
liufumingren
025184904a 1 2026-06-14 19:03:58 +08:00
liufumingren
0e50ff6671 1 2026-06-08 08:58:13 +08:00
liufumingren
99367e5043 1 2026-06-06 05:15:46 +08:00
liufumingren
4beefcd22c feat(print,docs,migrations): add notifyLock, order export, express fields and related docs
notifyLock method + logs

print.send logs

order export methods + docs

express model fields SPH/XHS/DW/JD + migration

platform_shop_id migration

notifyLock docs

order export docs
2026-05-30 17:30:17 +08:00
liufumingren
abf2c4d94a 1 2026-05-29 16:47:38 +08:00
liufumingren
dc4894cb6d 1 2026-05-25 17:08:56 +08:00
liufumingren
150e2977d4 修改快递接口配置,拼多多取号,未完成 2026-05-22 08:39:07 +08:00
liufumingren
8cf2c5befa 1 2026-05-20 16:31:29 +08:00
liufumingren
b629b59d4b fix(print): callback sync order print_status by order_ids 2026-05-20 04:55:16 +08:00
liufumingren
cd01be6fbd 收货部分更改 2026-05-17 21:51:46 +08:00
liufumingren
adb1a16599 1 2026-05-16 23:00:49 +08:00
liufumingren
9845a239e2 1 2026-05-16 02:44:53 +08:00
liufumingren
736ad34351 打印台管理变更 2026-05-14 15:57:51 +08:00
liufumingren
61c530c0cc 1 2026-05-14 04:00:07 +08:00
liufumingren
81785081a2 团购打印面单 2026-05-13 17:23:24 +08:00
liufumingren
0c3518e65d 1 2026-05-13 03:18:39 +08:00
liufumingren
9c2b254206 1
Co-authored-by: Copilot <copilot@github.com>
2026-05-11 08:44:27 +08:00
liufumingren
d711ba9c21 0506更新
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 17:53:54 +08:00
liufumingren
9b2cc5fc73 fix(receiving): 修复获取收货单时重复定义属性的问题 2026-05-06 01:32:55 +08:00
liufumingren
5ce689d771 1
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 19:20:31 +08:00
liufumingren
b7f980188f 1
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 17:43:54 +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
e73a311076 ok 2026-04-11 17:09:06 +08:00
liufumingren
57f1f44bae feat: sync wms updates 2026-04-09 15:45:14 +08:00
liufumingren
3d824a3a1d chore: sync lint and service fixes 2026-04-09 01:36:49 +08:00