Commit Graph
2 Commits
Author SHA1 Message Date
雨天 a837a1bd96 fix(小程序入库): 报告绑定不阻断入库并复用同一报告行
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
自审发现四处问题:
- 绑定环节任何异常都可能把入库变成失败 → 整体 try/catch,只进 report_bindings
- 一份报告挂多行时各行分别入库会建出重复报告 → 同文件+类型+编号复用
  已有报告行,只补关联(经真库验证:1 条报告 + 2 条关联)
- 归属断言移出事务,避免共享连接下在事务内做 legacy key 反查
- 小屏下报告弹层 scroll-view 只有 max-height 不滚动、底部按钮可能被裁
  → 固定高度 + 弹层可滚动
2026-10-21 18:52:28 +08:00
雨天 791071cb16 feat(小程序入库): 上传批次报告随入库绑定
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
「待审核」卡片加「上传报告」:文件进 quality-reports 桶后走新增的只解析
接口(复用 quality.report.meta + productNamesMatch,不写表),返回报告品名
与待入库行的匹配建议;勾选后报告挂在行上(按行 key、增量 setData,
重识别不丢)。

入库时随行提交 reports;服务端在 bulkStockInbound 提交成功后按
inventory_id 建报告行(status=30 + match_source=manual),逐份 SAVEPOINT。
绑定失败不阻断入库,返回 report_bindings 让小程序提示去 Web 补挂。
2026-10-21 18:44:51 +08:00