liufumingren
e76a6e3fa4
fix(order): 奇门/openapi 查单与取消接口跨分表查单
新增 app/lib/order_lookup.js 共享辅助函数(preloadOrderModels/findOrderAcrossTables/
findOrderByCodeAcrossTables),按 current→dispatch→history→outsourced 顺序命中即停;
模型预取置于事务外(工厂首次获取可能执行 DDL 隐式提交),事务内查询支持透传行锁。
改造 4 处接口:
- qimen deliveryorder.query / openapi deliveryorder.query:跨表查单,
订单流转到配送/历史表后不再误报"未找到订单"(避免货主误判重推);
- qimen order.cancel / openapi order.cancel:跨表查找,命中非 current 表
且 status=cancel 时幂等返回取消成功,其余情况返回"未找到对应的订单"。
回归验证(真实网关,脚本在 test/ 不入库):
- openapi:query 命中 dispatch、cancel 幂等成功、不存在单号报错
- qimen:同 4 场景全部符合预期
2026-09-20 22:12:35 +08:00
..
2026-09-13 02:24:37 +08:00
2026-09-20 16:13:59 +08:00
2026-05-06 01:32:55 +08:00
2026-09-20 22:12:35 +08:00
2026-09-20 16:13:59 +08:00
2026-09-16 15:04:25 +08:00
2026-09-20 22:12:35 +08:00
2026-05-22 08:39:07 +08:00
2026-09-13 02:24:37 +08:00