Commit Graph
374 Commits
Author SHA1 Message Date
Ubuntu 59dcfd578c 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
真机事故(2026-10-22 dev 体验账号 BR003):主系统导入单 ORD_WEB_20261022_BR002_0009
(我方 ORD_API_20261022_BR003_0001,青豆米/青黄瓜/青笋)三行显示「自采」,
但订单一直停在 20 待分配、采购/自采表 0 行。根因:
- 该分公司当时没有采购员(purchaser_users=0,也无采购分配默认);
- ensureSelfPurchaseForImportedOrder 先把行标 INTERNAL(自采),再逐行 createPurchaseOrderForItem;
  后者因 resolvePurchaserForNewPurchaseOrder 返回 unavailable 直接 return false(无日志);
- created=0 时调用方不打日志 ⇒ 行已标自采、采购单没有、状态推进判「尚有未履约明细」⇒ 永卡 20。

修复(最小改动,只作用于主系统导入单的「无抵扣默认自采」这一条路径):
1) createPurchaseOrderForItem 新增 allowMissingPurchaser(默认 false,其它调用方行为逐字不变):
   无可用采购员时按自由池建单(purchaser_code/name 为空,采购员后续认领),并打 warn;
2) ensureSelfPurchaseForImportedOrder 传 allowMissingPurchaser: true;
3) 行命中但 created=0 时打 warn(以前完全静默,只能手调函数排查)。

真机修复:对该卡单重跑自采收口 → 新建 3 张自采单;状态 20→30 待备货
(steps=分配已纠正为待备货;尚有 3 个采购单未完成)。注:修复时该分公司已有采购员 PUR001 体验版,
故这 3 张单正常带上采购员;「无采购员⇒自由池」分支由代码+契约测试保证。

验证:新增契约测试 3/3;typecheck 通过;后端全量 3 failed / 579 passed
(18 failed / 4144 passed,红均为既有 mainSystemReturnCancel/opsGuardHardening/routeLayerBoundary)。
设计文档 docs/design/20261022-主系统导入单无采购员按自由池建自采单.md。未部署。
2026-10-22 14:24:31 +08:00
雨天 e77ed7ebfe 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
无分类不再硬编码映射蔬菜及食用菌(原来会给出 62% 的蔬菜推荐);官方库检索改为商品名/去规格名/分类名分项取最高分合并,避免拼接稀释命中;前端加请求代际守卫,过期响应不写回。税率 0% 属分类生鲜标记口径,未改。
2026-10-22 13:01:43 +08:00
雨天 a255c4eccf 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
单里已有该商品只改价格,保留单位/成本价/加价率/历史名称快照;没有则新增一行。append-items 改走 applyQuoteSheetEditAndRequestDeliveryReview,价格类变更与报价单页编辑一样发起配送商销售价确认;前端不再传 cost_price 避免清零,旧入口已删除。
2026-10-22 12:44:11 +08:00
雨天 7c514f48b3 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
复用一个已有推荐接口:服务端仍只把官方库检索的 top 15 税码候选与本分公司分类预筛 top 20 交给模型,一次调用返回税码/分类/规格;分类与税码都按序号回查,AI 造不出编码。前端只在字段为空且用户未手改时回填,防覆盖防循环;无 LLM 时降级为原规则引擎。
2026-10-22 12:27:48 +08:00
Ubuntu a81579b9a1 docs(主系统对接): 同步「绑定回读默认启用/生产预检」到 env 模板、部署手册与设计文档
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
- server/.env.example:MAIN_SYSTEM_BINDING_SYNC_URL 新语义(填 URL / off / 留空:开发测试默认标准端点、生产不启用)
- docs/manual/02:环境变量表同步,并注明回读会按「全量快照权威优先」自动解绑主系统已不存在的绑定
- 设计文档补 §4.1「生产部署前预检」(只读核对生产快照与镜像完全匹配 ⇒ 首轮回读 applied=2/unbound=0,
  不会误删线上绑定)与清理后最终态验证数字

门禁:6 通过 / 3 既有红(迁移顺序/env 登记/ai-cost 故意红)/ 1 未执行(检查器连不上本地库)。
2026-10-22 10:23:09 +08:00
Ubuntu cbbb5bf204 fix(主系统对接): 绑定回读开发/测试默认启用 + 候选 token 回退(让快照权威优先真正生效)
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
真机 dev 验证"绑定快照权威优先"时发现:`MAIN_SYSTEM_BINDING_SYNC_URL` 从未配置
⇒ 回读通道根本没运行,上一提交的快照对账在 dev/生产都等于死代码;且换 token 只取
"最近一条 active 绑定",命中已解绑的残留绑定时直接 403,整轮回读永远跑不起来。

修复:
1) 启用方式:显式配置 URL ⇒ 用配置值;显式 `off` ⇒ 关闭;未配置 + 非生产 ⇒ 默认走主系统
   已交付标准端点 `GET {BASE_URL}/api/supplier/integration-bindings`;未配置 + 生产 ⇒ 仍跳过
   (生产启用需显式配置,避免部署默认值意外改写线上绑定)。
2) 换 token 改为逐个候选(镜像 active 绑定 → 分公司手工登记 → 台账)尝试,跳过残留 403。
3) 同步更新 config 注释/设计文档/README。

真机验证(dev,实际执行):
- sync 结果 checked=6 / applied=2 / unbound=3 / unboundMissing=3,
  日志「主系统快照里已无此绑定,自动解绑:BR003/SUP10226949、BR003/SUP37831443、BR002/SUP35143228」;
- 之后按绑定拉取只覆盖真正绑定的 SUP37831443,不再拉 SUP35143228。
- 单测 20/20(新增"残留 token 失败继续用下一候选"用例);typecheck 通过;
  后端全量 3 failed / 575 passed(18 failed / 4128 passed,红均为既有)。未部署。
2026-10-22 09:59:55 +08:00
Ubuntu a3d0371f4f 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
上游真机事故(2026-10-22):
1) 主系统压根没给供应商 SUP35143228 绑定任何接入编码,我方却把它的「精瘦肉」备货行拉进本地订单。
   根因:绑定回读只处理"快照里出现的行",快照里**不存在**的 active 绑定从不清理(当初怕分页误删),
   手工/历史残留/其它 client 推来的绑定可以一直 active 并驱动拉货。
2) 同一分公司一条历史残留绑定换 token 403,pullPreparationsForBranch 直接整轮 unavailable ⇒
   该分公司其它正常供应商的单也进不来。

修复:
① applyBindingSnapshot 增加"全量快照对账":快照非空时,我方 active 绑定中快照里不存在的
   (source main_push/main_pull/manual)⇒ 自动解绑 + 日志 + unboundMissing 计数;
   空快照不动(防端点抖动清空),backfill 迁移行不动。绑定权威回到主系统。
② pullPreparationsForBranch 单个 supplier 失败不再 abort 整轮:跳过 + failures 回报,其余照常;
   全部失败才 unavailable。退货/删单跟随遇到 failures 整轮不做判定(缺行≠退货,防红冲真单);
   导入路径不拿残缺 active 集合给跟随层;预览接口返回 failed_supplier_codes。
③ 无迁移、无前端文案;解绑走既有 unbindBinding(唯一写入口)。

验证:新增单测 4 例(快照残留解绑 + 部分失败/全部失败/未绑定)全过;typecheck 通过;
后端全量 3 failed / 575 passed(18 failed / 4126 passed,红均为既有
mainSystemReturnCancel/opsGuardHardening/routeLayerBoundary),未新增失败。
设计文档 docs/design/20261022-绑定快照权威优先与拉取容错.md。未部署。
2026-10-22 09:52:37 +08:00
Ubuntu 5817d50146 fix(主系统对接): 来源不一致的推送改返回 503,不再对主系统静默"成功"
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
上游真机反馈:修复后 dev 主系统用测试 client 推的单全被守卫拒绝,而守卫当时返回
200 {ignored:true} ⇒ 主系统投递记录显示 success、以为送达,我们这边没有任何数据。
这类"主系统认为成功、实际未处理"正是要消除的静默丢单。

改为:来源不一致时写入失败台账 + 首次通知(原有逻辑保留),并返回
503 {retryable:true, reason:'push_client_mismatch'} + Retry-After:120,
让主系统投递记录如实失败、按其契约重试/告警;我方拉取对账继续兜底。

验证:typecheck 通过;dev API 实测 → 测试 client 推送返回 503,配置内 client 推送正常放行。
设计文档同步更新。未部署。
2026-10-22 09:46:20 +08:00
Ubuntu 44aead2acc fix(主系统对接): 绑定时间只记首次绑定,回读/推送刷新不再改写
2026-10-21 开发者看「分公司管理 → 绑定关系」时,两家供应商显示「绑定时间 19:19:17」,
误以为刚绑定;实际是每 15 分钟绑定回读的刷新时间(upsert 每次同步都写 bound_at=NOW()),
真实绑定时间早于该值,也误导了"主系统只绑 1 家、我们显示 2 家"的排查。

改法:UPSERT 冲突时按原行状态决定 bound_at——
- 原行 status='active' 且 branch_code 未变(同一绑定被回读/回调刷新)⇒ 保留原 bound_at;
- 原行已 unbound(解绑后再绑)或 branch_code 变了(改绑)⇒ 用本次新时间。
无迁移、无接口变更、无前端文案改动;历史已被刷掉的时间无法还原(需另行批准的存量回填)。

验证:branchAccessCode/branchBindingSync/bindingAutoPullGuard 三文件 46 用例全过;
typecheck 通过;后端全量 3 failed/574 passed(红均为既有)。见
docs/design/20261022-绑定时间只记首次绑定.md。未部署(生产发布需单独命令)。
2026-10-22 09:40:34 +08:00
Ubuntu 1735026df0 fix(主系统对接): 授权一致性防护——入站来源校验 + 导入前出站预检 + 出站被拒告警
背景(dev 真机事故 2026-10-22):自贡 BR002 的单被主系统里另一个测试 client
(devcore_race_client)推入,本地库存抵扣完成、批次报告也有,但出站换 token 403
(本系统配置的 erp client 在该供应商上没有带编码授权行)⇒ 报告/回写全部发不出去、
主系统毫无反应,且界面上没有任何痕迹。

三层防护(设计见 docs/design/20261022-主系统对接授权一致性防护.md):
1) 入站来源守卫:webhook 的 payload.client_id / X-Client-Id 必须等于本系统配置的对接
   client;不一致 ⇒ 整条忽略(不建任何数据)+ 失败台账(push_client_mismatch) + 首次通知;
   缺字段(老版本主系统)放行,行为不变;
2) 导入前「出站可用」预检:推送建单前先换一次对接 token;换不到 ⇒ 不建单(503 可重试,
   10 分钟拉取对账继续兜底)+ 台账(outbound_auth_forbidden) + 首次通知;集成开关未启用
   (本地/测试)保持旧行为;
3) 出站授权失败告警:token 层 401/403/404 统一落台账 + 通知,覆盖报告推送/回写/事实刷新。

顺带:导入成功(推送或拉取)后立即触发一次批次报告推送,15 分钟对账只作兜底。

验证:新增 16 个单测全过;typecheck 通过;后端全量 3 failed/574 passed(18 failed/4122
passed,红均为既有 mainSystemReturnCancel/opsGuardHardening/routeLayerBoundary);
dev API 真机验证来源不一致被忽略并落台账/通知、合法来源放行、403 产生「对接授权失效」通知;
设计门禁 6 通过/3 既有红(迁移顺序/env 登记/ai-cost 故意红)/1 未执行(检查器连不上本地库)。
未部署(生产发布需单独命令)。
2026-10-22 09:40:16 +08:00
Ubuntu ad36182a9e fix(报告推送/订单UI): 修复"立即推送"租户上下文竞态;移除全天下单控件;抵扣批次显示商品名
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
1) 批次报告"立即推送"偶发丢失(租户上下文收尾竞态报 42P01 被吞,只能等 15 分钟对账):
   - 连接归还前先排空请求级查询队列,再复位 search_path;
   - triggerReportPush 改独立租户上下文(isolate)运行,失败日志带分公司;
   - webhook 绑定后即时拉取改用新增的 runDetachedTenantTask(独立连接 + 结构化错误日志)。
2) 订单管理工具栏移除「全天下单」控件及配套状态/接口调用(后端下单时段配置未改)。
3) 「选择抵扣的库存商品」弹窗:实际抵扣批次前置库存商品名(SKU),名字取自候选列表。

测试:releaseTenantSessionClient.ordering / reportPushTenantContextIsolation /
tenantContextDetachedTask.integration 共 8 用例通过;OrderItemCoverSkuModal +
orderManagement 共 138 用例通过;npm run typecheck 通过。
2026-10-21 19:21:20 +08:00
雨天 8213c17166 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
逐行本地校验后一次提交全部行;409 规格冲突确认后带 confirm_spec_conflict
重提(移动端路由本次补上该参数转发与 spec_conflicts 透传)。

失败行按 rowNumber 留在列表、成功行移除;报告随行绑定,绑定失败只提示
去 Web 补挂。逐行与一键共用 _submitInFlight 在途锁,防双击重复入库。
2026-10-21 19:15:00 +08:00
雨天 1de0c69ba5 feat(小程序录单): 散客单改走零售口径(对齐 Web)
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
问题:哨兵客户 __RETAIL__ 会出现在小程序客户列表,但小程序走普通下单
(服务层无 RETAIL 分支),而自动推进又显式排除散客 ⇒ 单子容易卡在流程里。

新增 POST /mobile/order-entry/retail-orders:录单角色 + 客户范围校验,
与 Web 同源调 submitRetailOrder(entryChannel=MP,不校验下单时间窗口)。

小程序选中散客后:不要求配送日期、不做预算校验、只允许已建档商品,
成功后提示到「订单管理」点「确认扣除并完结」;界面加「只扣库存」提示。
普通录单行为逐字不变。
2026-10-21 18:59:50 +08:00
雨天 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
雨天 e29caf5f7b 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
批次行原先只有「区域 · 入库 · 效期 · 可用」。后端早已返回 production_date、
loadBatchInfo 也已映射,但两个弹窗行构造器丢了该字段、模板也没渲染。

补上三处,并在「入库」后、「效期」前显示「生产」(空值 —,不拿入库日
顶替);batch-row-meta 由 nowrap+ellipsis 改为允许换行,否则多一段会把
尾部「可用」截掉。
2026-10-21 18:26:50 +08:00
雨天 8d90170953 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
库存「修改可用库存」弹窗里的「上传报告」不再打开页级匹配弹窗(解析商品名 →
猜候选批次 → 人工确认)。批次已确定,直接选类型/编号/文件上传绑定当前批次,
落库即已确认并写 match_source=manual 的关联行;OCR 仍跑一次只留元数据,
失败降级不阻断。

每份报告新增「编辑」(改类型/编号;换文件走删除 + 重新上传),删除入口保留。

顺带修掉 report_type 断层:页级上传前端早就在传、路由没转发、服务端硬编码
batch,选农残也存成批次。
2026-10-21 18:23:00 +08:00
雨天 8628874187 fix(存储): 租户分支根放行 SUP 编码,修上传报 Invalid file name
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
私有桶 key 形状白名单把租户分支根写死成主系统的 /^BR…$/,而本系统的
分公司编码是 SUP35143228 这类形状,于是 buildStorageObjectKey 直接抛
Invalid file name(库存→上传报告点「上传并解析」即弹这句英文)。

同一份 BR… 正则还重复写在归属判定与 stripStorageBranchPrefix 里,只改
一处会出现「上传成功但读/签名 403」。现收敛为唯一定义
TENANT_BRANCH_ROOT_RE = /^[A-Z0-9][A-Z0-9_-]{1,29}$/(branch_code 创建
时统一大写),三处使用点同口径;未知小写目录仍一律拒绝,层级上限、
穿越拒收、<branch>/ 前缀策略与存储布局均未动。
2026-10-21 15:51:55 +08:00
雨天 639abd2775 fix(库存): 生产日期留空不补今天并加列表筛选
独立入库没填生产日期时,原先用 COALESCE(…, 今天) 补成当天;现直接
写 NULL(效期推不出来也保持 NULL),覆盖 Web 批量、Excel 导入与
称台单行入库。验收/退回补送/财务三处同类默认值属冻结面,本轮未动。

库存列表:生产日期可排序(空值排最后);工具栏加「入库时间」区间
筛选(默认不筛),口径为该批次最早一次入库流水,只认 YYYY-MM-DD。
2026-10-21 15:51:50 +08:00
Ubuntu 6f2ab60249 fix(分拣/标签): 商品名取档案当前名(skus→订单行→分拣行),快照另存 item_name_snapshot 留档;取值链抽成单一实现并与核货共用
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
2026-10-21 14:31:02 +08:00
Ubuntu f002d57a4f fix(报价单商品名): 统一档案当前名优先、历史快照仅兜底——详情另存 sku_name_snapshot 供审计;映射统计与报价提议 3 处查询同口径
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
2026-10-21 11:31:01 +08:00
Ubuntu e21dc4db62 fix(商品名): 核货与报价单统一取商品档案名——skus.sku_name → order_items.item_name → picking_items.item_name(单一实现+真库PREPARE与行为演练)
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
2026-10-21 11:12:11 +08:00
Ubuntu e2909a88fb feat(库存): 入库时间取该批次最早一次入库流水(stock_in/inspection_in),列表返回 inbound_at;撤销用创建时间兜底
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
2026-10-20 22:19:52 +08:00
Ubuntu dee4ee2e3c 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
2026-10-20 22:08:28 +08:00
Ubuntu 004cc7f337 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
2026-10-20 22:06:18 +08:00
Ubuntu ee6d691f1f Revert "feat(库存): 「删除批次」改为物理删除 inventory 行(留操作日志、保留流水;仍被未完结订单占用时 409 拒绝)"
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
This reverts commit 5fe80d572d.
2026-10-20 22:04:36 +08:00
Ubuntu 5fe80d572d feat(库存): 「删除批次」改为物理删除 inventory 行(留操作日志、保留流水;仍被未完结订单占用时 409 拒绝)
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
2026-10-20 22:02:03 +08:00
Ubuntu 2f31f6d62d fix(退回补送): 幂等键改为(分公司+退货码+SKU),去掉 order_code——主系统确认一码=一次退回事件;修同码跨订单重复建售后/补送单(实测同码换订单返回 duplicated)
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
2026-10-20 21:30:38 +08:00
Ubuntu b947c8258f fix(退回补送): 建补送单前复用同原单未完结补送单——修重复调用命中唯一索引报 500;实测同订单同退货码第2次返回 duplicated=true
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
2026-10-20 21:25:35 +08:00
Ubuntu 881d8f5211 fix(退回补送): 打通租户上下文/RLS/必填列——改用官方 acquireTenantSessionClient、补 branch_code 与 amount、显式 numeric 转换;本地端到端验证通过(退回→补送单已到45待分拣→原单折减→台账映射)
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
2026-10-20 17:31:51 +08:00
Ubuntu 54511665ed feat(退回对接): 退回通知复用既有 webhook(X-Signature)新增事件 preparations.returned——对方零新增凭据/端点,落售后+生成补送单
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
2026-10-20 17:13:09 +08:00
Ubuntu c4b3a547cf fix(退回对接): ingest 接口复用既有 supplier_integration 对接令牌鉴权,不再要求用户账号/权限——部署后主系统用现有凭据即可调用
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
2026-10-20 16:57:21 +08:00
Ubuntu 4c30bfde8b 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
2026-10-20 16:03:55 +08:00
Ubuntu b9be5b70cc feat(退回补送): 接通入口——主系统推送接口 POST /after-sales/returns/ingest + 台账 last_return_code 轮询兜底(挂到对账链路);对接契约写入设计文档
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
2026-10-20 15:57:20 +08:00
Ubuntu e284cbad04 feat(退回补送): 台账记录补送单指向(保留原单追溯)+ 回写优先取补送单并重置回写状态——补送完成即可按原 prep 重新回写主系统
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
2026-10-20 15:49:40 +08:00
Ubuntu 88fe717581 feat(退回补送): 退回货处置接口——重新入库(待检不可用)/丢弃(scrap) + 质量确认(合格转可用/不合格记废弃),方案B
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
2026-10-20 15:46:38 +08:00
Ubuntu 75e77ba67c feat(退回补送): 原单按实供量折减——order_items.returned_qty 累加 + orders 金额/重量按 (quantity-returned_qty) 重算(统计/结算自动按净供货,避免与补送单双计)
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
2026-10-20 15:42:08 +08:00
Ubuntu bdb4fbea98 feat(退回补送): 主系统退回即生成售后记录 + 补送单(普通订单 source=return_resupply,幂等,提交后复用既有分配/库存抵扣链路)
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
2026-10-20 15:37:02 +08:00
Ubuntu 87f8529625 feat(产地): 新增公开查询接口 GET /api/public/order-origin(主系统按订单号+SKU 问产地)
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
用户设计:不做主系统批次映射,改成主系统来问供应商。
- 入参 main_order_code + main_sku;用本地镜像 main_system_sku_mappings 换成我方 SKU
- 取该订单出库批次 picking_items.outbound_batches → inventory.origin(批次优先)→ skus.origin(兜底)
- 免鉴权;只返回 { origin },不泄漏 SKU/批次/订单等其它字段
- 查不到 / 异常一律 200 { origin: null },不 5xx、不影响调用方
- 冒烟:GET /api/public/order-origin?... 返回 200(本地无对应数据时为 null)
2026-10-20 13:23:30 +08:00
Ubuntu 5a54480bdc feat(产地): 上报带主系统订单号 + 主系统 SKU(可注入解析器)
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
- 供应商 SKU → 主系统 SKU:默认读本地只读镜像 main_system_sku_mappings(active),
  抽成可注入 resolveMainSku(测试用纯函数,避免依赖租户上下文)
- 未映射 ⇒ 跳过不上报(仅日志),不影响取货/到仓主流程
- preparations/status body 增 order_code + sku_code(主系统可据此直接定位订单行)
- 测试:16 passed(注入解析器后原两条用例恢复)
2026-10-20 13:13:14 +08:00
Ubuntu 7c86539eeb fix(报价单): 提交配送商审核按 SKU 去重合并——修同商品多行导致整单被拒「同一商品重复出现」(价不一致取最后一行并告警)
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
2026-10-20 12:48:57 +08:00
Ubuntu e0b55a8948 fix(履约推进): 推进前自动补「库存履约」行 + 履约/入库统计排除退货行——修全额库存抵扣单卡在待备货(订单已实测 30→45 待分拣)
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
2026-10-20 12:38:05 +08:00
Ubuntu d52415cb78 feat(库存): 后端新增「按批次查报告」「删除报告」接口 + 前端 API(库存修改弹窗编辑/删除报告的第一步)
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
2026-10-20 11:23:26 +08:00
Ubuntu 81b69e31a8 feat(库存): 列表列改名「存在报告」并显示该批次已绑定报告数量(后端返回 batch_report_count)
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
2026-10-20 11:02:32 +08:00
Ubuntu 2bce30150a feat(产地): 批次级产地可录入(inventory.origin)
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
第 2 步:修改可用库存 →「批次属性」新增产地输入,只影响本批次。
- 后端 UpdateInventoryBatchInput 增 batchOrigin(批次级写 inventory.origin,'' 清空,≤200 字)
- 路由透传 batch_origin;商品档案 origin 仍写 skus(默认值)
- 前端弹窗批次区新增「产地(本批次)」,三语文案
- typecheck 前后端各 0 错;库存单测未跑(下一步补)
2026-10-20 10:47:08 +08:00
Ubuntu 1264d0c039 fix(回写): C5 门禁恢复原始契约(无已审核价=不发价),修回归测试 —— 零价跳过保持不变
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
2026-10-20 10:26:59 +08:00
Ubuntu 0fd45f6ef8 feat(主系统单): 无库存抵扣/无厂商的商品默认落自采(标记 INTERNAL + 建自采采购单,仅主系统分配单,幂等)
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
2026-10-20 10:26:10 +08:00
雨天 ea58103df9 fix(delivery-note): 生产时间列移到备注之后
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
列序改为 编号/产品/单位/总数量/单价/金额/备注/生产时间;
列宽 130/150 对调,合计仍 920。
2026-10-20 10:09:51 +08:00
雨天 84b69c1b1b fix(delivery-note): 无生产时间数据时整列不渲染
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
后端未下发 batch_production_dates 或整单没有日期 ⇒ 退回原 7 列
版式(列宽恢复 70/300/70/110/110/130/130);部分行有日期时
才出该列,无日期的行留空。
2026-10-20 10:09:21 +08:00
雨天 2613b8f800 fix(delivery-note): 生产时间列移到金额之后
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
列序改为 编号/产品/单位/总数量/单价/金额/生产时间/备注;列宽合计仍 920。
2026-10-20 10:07:53 +08:00