Ubuntu
|
7d21720e92
|
feat(主系统退回/售后): 退回台账轮询兜底 + webhook 失败逐行日志 + 覆盖残值清扫排除退回行 + 批次报告候选排序兜底
|
2026-10-23 17:07:12 +08:00 |
|
雨天
|
308afff5ad
|
独立加工:修小程序成品申报与批次继承
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
- 小程序「开始加工」不再被「待完成到货验收」拦住(独立加工没有验收行)
- 成品搜索框补 data 声明并加 || '' 兜底,改为打开即载入候选 + 本地优先过滤
- 成品批次继承原料的生产日期/保质期原文/有效期/产地,入库后仍可在库存管理修改
- 两个继承开关默认勾选,选中态改绿色实心勾(小程序自绘,Web 用 accent)
- 新增两篇设计文档并同步索引
|
2026-10-23 17:04:20 +08:00 |
|
Ubuntu
|
54746831d5
|
fix(独立加工): 成品/退料批次号改用任务 uuid 前缀——核查发现删单后 task_code 重用会撞 inventory 唯一键
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-23 16:17:32 +08:00 |
|
Ubuntu
|
899a363ead
|
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-23 16:13:19 +08:00 |
|
Ubuntu
|
8c8a9a9f54
|
fix(库存流水): 加工入库(processing_in)补中文标签与入库配色(三语),溯源页流水标签同步
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-23 16:06:42 +08:00 |
|
Ubuntu
|
325162dd86
|
fix(db): 空闲连接被掐断不再杀死进程——Pool 注册 error 监听(真机事故:Connection terminated unexpectedly 导致 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-23 16:01:27 +08:00 |
|
Ubuntu
|
1375160b8e
|
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-23 15:45:05 +08:00 |
|
Ubuntu
|
b62a123a83
|
feat(独立加工): 后端 P0——多行原料 + 多行成品回仓(processing_in) + 损耗自动差额可覆盖 + 成品成本默认均分可设置 + 报告继承(批次只复制关联/检验复制引用) + 请求号幂等;真库跑通
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-23 15:30:29 +08:00 |
|
Ubuntu
|
aa28ccecb7
|
feat(选择抵扣商品): 被抵扣批次可就地改入库成本价(复用 applyBatchCostChangeApi,备注选填);关闭弹窗后若有改动自动刷新订单明细
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-23 13:50:38 +08:00 |
|
Ubuntu
|
a6b339e71f
|
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-23 13:38:27 +08:00 |
|
Ubuntu
|
5ca5f5bf63
|
fix(主系统导入): 追加补行的行也走「无库存抵扣⇒默认自采」收口(复用既有 ensureSelfPurchaseForImportedOrder,防两份口径)+ 真库验证
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-23 10:19:01 +08:00 |
|
Ubuntu
|
0bb3d47caf
|
feat(自采列表): 完成口径与实收交数对齐主系统 2026-10-10 裁决(对齐 20261014-self-purchase-completed-scope)
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
开发者:实收数量改了保存后仍是计划量;要求先看配送系统自采「点击确认完成」设计后对齐。
主系统仓库 docs/design/20261014-self-purchase-completed-scope.md(已实施,开发者 8 条裁决)
为唯一权威;本次只读参考主系统、未修改主系统仓库。
根因(供应商系统仍是旧的「方案 C」):
- /purchase/complete 不透传 actual_qty,purchaseOperationService 在 status=20 强制清空实收
⇒ 采购侧交数永远不落库(列表保存后被计划量覆盖);
- 列表「已完成」口径仍 >=30:采购员点完成后(20)行还在「进行中」、KPI 不对;
- 验收「绝不自动下调」守卫未放开,交数一旦落库会挡住验收(历史卡单风险);
- 前端实收列无可编辑/回车提交/折叠行分摊,一键完成仅当前页。
对齐后的口径(与主系统一致):
1) 进行中 = 10/32,已完成 = 20/30(列表 Tab、KPI、分配池/改挂范围同步);
2) 完成自采(10/32→20)恢复写入采购侧「交数」实收(COALESCE 保留既有;直送豁免保留);
3) 最终权威仍是验收过磅:未入库(<30)允许下调覆盖;「绝不自动下调」只在已入库(>=30)生效;
4) 前端:实收列可编辑(10/20/32;30 只读)、回车才提交、改实收即完成(被拒退化为草稿保存);
合单折叠行按子单计划量比例分摊;行内完成直连(未匹配商品库行仍开弹窗补资料);
工具栏绿色「一键完成」= 当前筛选跨页全部 10/32 行 → 20,未填实收按计划量补齐、
串行、不弹二次确认、失败累计不中断;实收数量参与表脚/日分类小计合计。
后端改动:purchaseOrderQueryService(4 处谓词)、purchasePurchaserAssignService(3 处)、
purchaseOperationService(撤销 20 边实收丢弃)、inspectionComplianceService(守卫加 >=30)、
purchaseAmendService(preserveActualQtyWhenInbound)、purchaseRoutes(complete 透传 actual_qty +
amend-actual 口径)、mobilePurchaseRoutes(status 20 透传实收)。
前端改动:PurchaseManagement(上述交互)、新增 purchaseGroupQtySplit(分摊纯函数,与小程序同口径)、
purchaseListTableTotals(实收合计)、i18n completeAll=一键完成。
测试:
- 后端新增 purchaseCompletedScope 4/4、preInboundActualQtyOverride 3/3;更新 selfPurchaseActualQtySingleWriter、
mpAdminPurchaseTodayScope、purchaseAmendCostWriteback;全量 3 failed / 582 passed
(18 failed / 4160 passed,失败集合与改前一致:mainSystemReturnCancel/opsGuardHardening/routeLayerBoundary);
- 前端 purchaseGroupQtySplit 7/7、purchaseListTableTotals 10/10、purchaseListWebList.contract 15/15;
全量 4 failed / 234 passed(4 failed / 1331 passed,4 个失败文件与改前一致,本次未新增);
- npm run typecheck 通过;设计门禁与之前一致(3 项既有红,未新增)。
设计文档 docs/design/20261022-自采列表完成口径与实收交数(对齐主系统20261014).md。未部署。
|
2026-10-22 18:36:58 +08:00 |
|
雨天
|
5202b241f1
|
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
「二荆条」「粉条」「油条」里的条/根/只曾被当成数量单位,导致「小白菜 苹果 二荆条」整串不拆。禁用字只保留数字/标点/货币,另以纯数量片段规则排除 2斤/两斤/根;补三条单测。
|
2026-10-22 17:48:19 +08:00 |
|
Ubuntu
|
1867e69fac
|
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
承接上一提交(98f458a,移植主系统 93d33142 的"每段精确命中商品库才拆"):真机输入
「土豆 白菜 西红柿」仍只有 1 行。实测定位:
- ARK 模型返回 {"items":[]}(共享提示词规定"只输出有明确数量+单位的采购项",无数量清单被丢弃);
- 随后走本地兜底 extractItemsFromTextLocally,它只按换行/中文标点拆 ⇒ 整串成为 1 行;
- 土豆/白菜/西红柿都不在本地商品库/客户别名 ⇒ 主系统那条严格规则不拆。
- 按建议先试提示词方案(order.parse.text 加"纯商品名清单例外"):真实 ARK 调用仍返回
{"items":[]} ⇒ 提示词不可靠,已回退(不留冲突指令),改以确定性兜底为准。
实现(server/src/services/orderParseService.ts):
- 新增 looksLikePlainProductName:≤20 字、不含数字/数量单位/标点/价格、不含菜名烹饪词、含中文或字母;
- expandWhitespaceJoinedItems 增加第二判据:整串未精确命中客户商品库/别名/商品库(保护
"上海 青菜"这类已建档含空格商品名),且每个空格分段都像商品名 ⇒ 也拆行(数量1/单位个,
未命中行照常走界面未匹配提示)。
- 其它情况(带数量/单位、菜名/菜单词、已建档整串)保持原结果。
真机验证(dev API + 真实 ARK):输入「土豆 白菜 西红柿」→ 接口返回 3 行(土豆命中
DEMO-SKU-004 演示土豆;白菜/西红柿未匹配),日志 `[order-parse] 空格分隔名称(商品库未命中)
按纯名称兜底拆行`。单测 5/5;typecheck 通过;后端全量 3 failed / 580 passed
(18 failed / 4150 passed,红均为既有)。未部署。
|
2026-10-22 16:32:47 +08:00 |
|
Ubuntu
|
98f458a421
|
fix(录单解析): 空格分隔的多个商品名兜底拆行(对齐主系统 93d33142)
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
开发者反馈:录单输入「土豆 西红柿 白菜」这类只用空格分隔的多个商品名,被当成一个商品。
已只读核对主系统仓库提交 93d33142(fix(order-parse): 空格分隔且精确命中商品时拆行),
该提交只改后端 orderParseService;本仓库对应文件缺少这段兜底,现逐行移植(未修改主系统仓库)。
根因:前端 CustomerOrder.tsx 把文本原样传给 functions.invoke('parse-order-three-layer')
→ routes/functions.ts → parseOrderThreeLayer;后端本地拆条只按换行/中文标点,不按空格拆,
模型对纯空格文本也只返回一项 ⇒ 整串去四层匹配,匹配不上。
修复(server/src/services/orderParseService.ts):
1) 新增 isExactCatalogName:名称归一化后精确命中 客户别名/客户商品库/商品库;
2) 新增 expandWhitespaceJoinedItems:文本含空白且空格分段数 > 模型项数、且**每个分段都精确命中**
商品库时才拆行(各 quantity=1/unit=个,后续走四层匹配/价格);含空格商品名、带数量文本不拆;
3) fourLayerParse 增加 sourceText 入参并展开;parseOrderThreeLayer 传 text。
前端无需改动;语音/文本路径共用同一入口,图片路径与主系统一致(不传 text)。
验证:新增单测(移植自同提交)3/3 通过;typecheck 通过;后端全量 3 failed / 580 passed
(18 failed / 4148 passed,红均为既有 mainSystemReturnCancel/opsGuardHardening/routeLayerBoundary)。
设计文档 docs/design/20261022-录单空格分隔商品名兜底拆行(对齐主系统93d33142).md。未部署。
|
2026-10-22 16:22:09 +08:00 |
|
Ubuntu
|
06233ff0b0
|
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
上一提交(59dcfd5)修的是「主系统导入单无抵扣 ⇒ 默认自采」入口;代码复查发现**同类的第二个入口**:
`ensureSelfPurchaseForCoverGap`(库存部分抵扣后的缺口默认自采,在 reprocessOrderAllocation 内,
导入单提交也会经过)仍调用 createPurchaseOrderForItem 不传 allowMissingPurchaser ⇒ 分公司无采购员时
每行静默返回 false,而 `STOCK_COVER_SUPPLIER_SQL` 已把行标 INTERNAL ⇒ 同样留下
「界面自采、自采表无数据、订单卡 20 待分配」的半成品(与刚修复的事故同类,尚未在真机触发)。
修复:该入口也传 allowMissingPurchaser: true(无采购员按自由池建单);并在
「有行需转自采但 created=0」时打 warn(原先完全静默)。
验证:契约测试 4/4(新增部分抵扣分支断言);typecheck 通过;后端全量 3 failed / 579 passed
(18 failed / 4145 passed,红均为既有 mainSystemReturnCancel/opsGuardHardening/routeLayerBoundary)。
设计文档同步两处入口。未部署。
|
2026-10-22 15:13:25 +08:00 |
|
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
|
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 |
|
雨天
|
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 |
|