90 Commits

Author SHA1 Message Date
liufumingren
df8173cecd feat: 新增 stock.transaction 商品流水导出 + keyword 商品搜索
- systems/stock_transaction.js: 新增 exportList() 异步导出 Excel(上限50000条)
  - 新增 _resolveKeywordToStockIds() 关键词→stock_id 解析
  - queryList/exportList 支持 keyword 模糊搜索(按 item_code/item_name/goods_code/barcode/SKU ID)
- systemMethods/stock/transaction.js:
  - 新增 export/exportStore/exportTaskProgress 异步导出方法
  - list/storeList/export/exportStore 全部透传 keyword
  - storeList 新增 warehouse_id/stock_id 单数兼容
- methods/system.json + changes/system.json: 新增3个method文档
2026-07-17 01:48:12 +08:00
liufumingren
3e813c4975 fix: 将 storage.report 模块迁移至 stock.report,修正语义错误
库存报表属于 stock(商品库存)域而非 storage(库位存储)域。

变更:
- systemMethods/storage/report.js → systemMethods/stock/report.js
- 类名 StorageReportMethodService → StockReportMethodService
- 缓存键 storage_report_export_ → stock_report_export_
- 日志前缀 [storage.report] → [stock.report]
- methods/system.json: module + 5 method 名同步更新
- methods/changes/system.json: 追加迁移记录
- systems/storage/entry.js: 注释引用修正

旧文件直接删除,不保留兼容(旧 method 名为语义错误)。
2026-07-17 00:30:54 +08:00
liufumingren
391ab87112 fix(order_express): 包材批量绑定适配 current+dispatch 双表查询
修复波次团购包材批量绑定只查 current 表导致 dispatch 表订单遗漏的问题:
- bindExpressPackageMaterialByWaybill: 波次检测改为 current→dispatch 双表遍历
- _bindWavePackageMaterialByBusinessKey: 波次订单查询改为双表合并去重
- _getStoreName / _getWaveSysLogisticsName: 货主/物流名查询改为双表遍历
- _upsertPackageMaterialItemRelation: items_hash 查询改为双表遍历
- _updateSingleOrderWeight: items_weight 读取改为双表遍历
2026-07-16 20:19:03 +08:00
liufumingren
16d5f18fa1 feat(openapi): interface_type_id=2 强制合约注入 + 全链路 store_id 防护
核心改动:
- openapi.js: 新增 resolveOpenapiContract 强制合约解析(required:true JOIN),
  dispatchOpenapiMethod 统一注入上下文(setInfo)
- 5个 openapiMethods: 移除重复 resolveAppInfo, 统一使用 this.getInfo()
- deliveryorder/entryorder/stockout: findByPk(itemId) 后增加 store_id 一致性校验

安全修复:
- 修复 itemId 路径跨货主越权漏洞(FindByPk 无 store_id 过滤)
- deliveryorder/inventory/singleitem 查询补全 store_id 过滤
- 合约缺失返回 403 而非穿透业务层

测试覆盖: 9方法×3层防护(合约/注入/过滤)全部通过集成测试
2026-07-15 00:10:40 +08:00
liufumingren
fddd142427 fix: custom_barcode 唯一约束改为仓库级别,修复 batchUpdateSpaceInfo 等条码检查跨仓库问题 2026-07-10 18:10:11 +08:00
liufumingren
a1f5c5d532 fix(storeWarehouse): list 查询使用 OR 两边匹配,兼容新旧签约数据
- serializeRelation: 根据 currentSubject.id 匹配 store_id/warehouse_id 判定对方主体

- listForStore/listForWarehouse: 使用 store_id/warehouse_id OR 查询替代 buildListWhereByStoreId

- remask/use_status: 基于实际所在侧判定而非 isWarehouse 角色

- 修复仓库用户看不到签约货主方信息的问题
2026-07-09 11:54:53 +08:00
liufumingren
6d58d7ff1f docs: 仓储报表微调 + methods 接口文档同步更新
- storage/report: 报表逻辑微调

- methods/system.json: storeWarehouse 系列接口文档更新

- methods/changes/system.json: 新增 2026.07.08/07.09 变更记录
2026-07-09 03:36:19 +08:00
liufumingren
ca5c8a269e feat: 推单二级校验 + 快递分配异步化 + 打印 stock_id 直读
- delivery_order: 新增 auth_status=2 + warehouse_use_status=1 二级签约校验

- express: createWaybillCodePipeline 支持 awaitTasks/onBatchComplete 选项

- pendingOrder: allocateExpressCode 异步进度缓存 + cancelAllocateStorage 拣货完成前置校验

- order_print: 新增 wms_picking.stock_id→wms_stock_warehouse 直读路径,消除 order_items 强依赖
2026-07-09 03:36:15 +08:00
liufumingren
b9ead1fba2 refactor(storeWarehouse): 签约体系重构 — 统一主体维度、移除角色校验、list 拆分
- sign: 统一当前主体→store_id(货主方/消费方),对方→warehouse_id(仓库方/提供方)

- getCounterparty: 移除 expectedRole 角色校验,仓库可签仓库、货主可签货主

- list: 拆分为 listForStore/listForWarehouse,warehouse 侧支持查询外部合作仓库

- 新增 buildListWhereByStoreId 统一按 store_id 维度构建查询条件

- 响应新增 counterparty_role / needs_my_confirm / has_qimen_config 字段
2026-07-09 03:36:09 +08:00
liufumingren
14a5f13ad5 feat(db): wms_store_warehouse 新增 initiator_subject_id,wms_picking 新增 stock_id 及联合索引
- wms_store_warehouse: 新增 initiator_subject_id 记录发起方主体ID

- wms_picking: 新增 stock_id 字段 + idx_wms_picking_warehouse_stock 联合索引 + 历史数据回填

- Model 层同步更新关联定义
2026-07-09 03:36:03 +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
88df30c862 refactor: 签约列表精简输出,仅保留 id/store_id/warehouse_id/counterparty_name/remask/use_status/auth_status/auth_end/print_quantity/policy_config/has_qimen_config 2026-07-06 22:41:52 +08:00
liufumingren
91d3a4f5b3 fix: counterparty_name 改为取 store 表 company_name 主体名称,不取 remask 备注名 2026-07-06 22:38:21 +08:00
liufumingren
72d759964d fix: use_status=0 被 || 跳过导致筛选和状态更新失效,改用 !== undefined 显式判断 2026-07-06 22:33:05 +08:00
liufumingren
2ff17a54dc fix: buildListWhere 货主侧查询按 store_use_status 过滤,仓库侧按 warehouse_use_status 2026-07-06 22:26:38 +08:00
liufumingren
c954a4bb26 fix: serializeRelation 补回 use_status 兼容字段,按当前主体身份取对应仓库/货主侧状态 2026-07-06 22:24:20 +08:00
liufumingren
d1818ae0bf fix: 修复 receiving.js 编码损坏导致语法错误(use_status → warehouse_use_status 重做) 2026-07-06 22:19:34 +08:00
liufumingren
76c52fa268 use_status 重命名为 warehouse_use_status,新增 store_use_status;仓库/货主侧独立控制签约使用状态,unbind 按身份分派字段 2026-07-06 22:12:23 +08:00
liufumingren
41ef9b40de 新增 storeWarehouse.warehouse.list API:仓库侧查询签约货主列表 2026-07-06 22:07:10 +08:00
liufumingren
4e20831386 dashboard 货主端自适应分支:storeStats/express_ratio/platform_distribution 按 store_type 区分仓库/货主查询,货主端跨仓汇总 2026-07-06 22:07:06 +08:00
liufumingren
9c6d984ebc 新增 stock.transaction.list API:商品出入库流水查询(仓库/货主侧自适应),含 system.json 文档注册 2026-07-06 22:07:02 +08:00
liufumingren
df1bd38601 商品流水增加锁定类目语义类型 2026-07-06 19:28:45 +08:00
liufumingren
897328a4f4 拣货拉取明细字段补充调整 2026-07-06 17:19:06 +08:00
liufumingren
7d92522c2f 库存报表导出增加新字段 2026-07-06 17:18:35 +08:00
liufumingren
525e222351 订单导出excel增加备注、买、卖家留言 2026-07-06 17:17:50 +08:00
liufumingren
70ad3153a1 创建订单原货主策略读取字段错误调整 2026-07-06 17:16:42 +08:00
liufumingren
276d76f65d 新增拣货状态字段输出 2026-07-06 17:15:29 +08:00
liufumingren
2817d17fc7 1 2026-07-06 00:33:12 +08:00
liufumingren
7f05b26db2 1 2026-07-04 21:40:31 +08:00
liufumingren
5d7964132e 1 2026-07-03 16:56:39 +08:00
liufumingren
478ad2ab0d 1 2026-07-03 16:10:46 +08:00
liufumingren
34273c166b 1 2026-07-02 22:08:47 +08:00
liufumingren
300c84c990 1 2026-07-02 22:08:38 +08:00
liufumingren
5ef99e3bed 1 2026-07-01 14:00:59 +08:00
liufumingren
e7fcd2549e 20260625 2026-06-25 02:01:59 +08:00
liufumingren
569a25390f 1 2026-06-24 07:36:43 +08:00
liufumingren
77435aeb79 1 2026-06-23 18:48:33 +08:00
liufumingren
d743e67b9d 1 2026-06-17 01:18:55 +08:00
liufumingren
025184904a 1 2026-06-14 19:03:58 +08:00
liufumingren
0b207a1c9c 1 2026-06-10 09:14:05 +08:00
liufumingren
43c60dd934 1 2026-06-09 14:12:02 +08:00
liufumingren
0e50ff6671 1 2026-06-08 08:58:13 +08:00
liufumingren
c2b5ffc319 1 2026-06-07 20:42:24 +08:00
liufumingren
eb100b056d 1 2026-06-07 01:52:06 +08:00
liufumingren
e6e65d9d65 1 2026-06-06 16:06:31 +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