|
|
2ff0f92f94
|
fix(stocktake): 修复盘点报告导出 500 错误
- 导出盘点报告时第1126行使用了 func.sum()/func.coalesce()
但文件未导入 sqlalchemy 的 func
- 改为 db.func.sum()/db.func.coalesce(),与文件内其他用法一致
|
2026-08-28 15:53:03 +08:00 |
|
|
|
8c10bb0903
|
feat: 盘点合并列表 — 服务端JOIN+DB分页,消除99999全量加载
## stock.py
- 新增 GET /draft/merged-list: UNION ALL三表+LEFT JOIN draft
数据库级 LIMIT/OFFSET 分页,不再加载全量到Python内存
- 参数: session_id, keyword, status_filter, page, pageSize
- 返回: list, total, total_scanned (已扫去重数)
## stock.ts
- 新增 getDraftMergedList() API函数
## stocktake/index.vue
- fetchInventoryList: 改用merged-list单次调用替代99999全量+find()
- resumeSession: limit 99999→1 先检查存在,再limit 500加载
|
2026-07-16 13:08:29 +08:00 |
|
|
|
c07f25b646
|
fix: Fail-Closed 字段级安全加固 — 堵住15+端点价格泄露
## stock.py
- _make_price_stripper(): 工厂函数,选单前缀自动剥离所有价格/成本字段
- _do_get_stock_list(permission_prefix): 每个item.to_dict()后剥离价格
- /all 端点: 非AI模式自动剥离价格字段
- /list 端点: permission_prefix='outbound_selection' 传递
## outbound.py
- /bom-match-stock: 返回前按stock_type剥离全部价格/成本字段
- /scan: result.pop('price', None)
## scrap.py
- /scan: result.pop('price', None)
- /records: 每条记录剥离 cost_at_scrap, total_loss
## transactions.py
- filter_item_by_permissions: 从空字典恢复完整20字段映射
- /borrow/stock-list: permission_prefix='op_borrow_apply' 传递
## buy.py / semi.py / product.py
- submit 成功响应剥离所有价格/成本字段(不泄露给前端)
## bom.py
- /base/list: 剥离 referencePrice
|
2026-07-16 11:26:05 +08:00 |
|
|
|
2556b77530
|
perf: 系统级性能优化与并发安全修复
## 并发安全修复 (4处)
- scrap.py: 报废执行添加 SELECT FOR UPDATE 悲观锁,消除 TOCTOU 竞态
- stock.py (adjust_stock): 盘点调整添加 for_update=True 行锁
- outbound_service.py: 低库存预警 SMTP 调用移到 commit 之后,避免长事务
- trans_service.py: execute_dispatch 按 (source_table, id) 排序 items,消除死锁风险
## N+1 查询优化 (2处)
- inventory_task.py: _prefetch_inventory_map 单条 UNION ALL+GROUP BY 替代循环内逐条查询(N*4次→2次)
- stock.py (export_stocktake): get_borrowed_qty 批量 GROUP BY 替代逐条 TransBorrow 查询(~18000次→1次)
## BOM 列表性能重构
- bom_service.py: get_bom_list 单条 GROUP BY+string_agg+分页,消除 N+1 循环查询
- bom_service.py: 新增 get_bom_summary (轻量 GROUP BY category+COUNT)
- bom.py: 新增 /api/v1/bom/summary 路由,/list 支持 category 过滤
## Odoo 基础信息懒加载
- base_service.py: 新增 get_odoo_summary (GROUP BY category+COUNT)
- base.py: 新增 /api/v1/inbound/base/odoo-summary 路由
- buyOdoo.vue: 懒加载分组架构 (fetchOdooSummary + loadGroupItems)
- material_base.ts: 新增 getOdooSummary API
## 前端 Bug 修复
- BomManage.vue: 懒加载分组 (fetchBomSummary + loadGroupItems + collapse)
- BomManage.vue: 适配新 API 格式 (res.data.items 替代 res.data)
- buyOdoo.vue: 移除 "点击展开加载" 文字
- Selection.vue + borrow/apply/index.vue: openBomSelect 适配新 API 格式
|
2026-07-15 17:37:57 +08:00 |
|
|
|
0651eb07fa
|
fix: 彻底解耦出库/借库权限联动 + 路由去硬编码roles + 补API权限保护
根因: 借库选单页面14处硬编码outbound_selection:operation, 导致两模块权限联动
修复:
- borrow/apply: 14处outbound_selection:operation→op_borrow_apply:operation
- stock.py: 拆分_do_get_stock_list裸逻辑, 出库/借库各绑独立权限码
- transactions: 新增/borrow/stock-list端点(@permission(op_borrow_apply))
- transaction.ts: 新增getBorrowStockList前端API函数
- outbound.py: 出库审批4端点改用独立outbound_approval权限码
- transactions.py: 借库审批3端点补@permission(op_borrow_approval)
- purchase.py: 采购管理7端点补@permission(inbound_buy)
- audit.py: 审计日志补@permission(system_audit)
- router: 清除全部6处硬编码roles, 交由动态权限树控制
|
2026-07-15 14:33:11 +08:00 |
|
|
|
c1092407ad
|
V3.50
|
2026-06-25 15:21:43 +08:00 |
|
|
|
cf55c94826
|
feat: 库存接口增加 ai_mode=true 极简返回模式,键名压缩为 n/s/c
|
2026-05-19 09:53:06 +08:00 |
|
|
|
183b93012e
|
4.28
|
2026-04-28 16:07:11 +08:00 |
|
|
|
e08eaff40a
|
feat(outbound): 库存列表按规格+库位聚合 + BOM明细类型修复
|
2026-04-28 09:23:59 +08:00 |
|
|
|
40e405becd
|
4.27
|
2026-04-27 16:33:54 +08:00 |
|
|
|
48f2011a38
|
fix: 盘点草稿已盘数量统计兼容字段名 quantity
|
2026-04-24 13:32:46 +08:00 |
|
|
|
996056d46a
|
fix: 修复库存盘点已盘数量卡在500的问题
|
2026-04-24 13:19:57 +08:00 |
|
|
|
a849e14b2c
|
refactor(orm): 将所有的批量 delete/update 重构为对象级操作,以确保触发 SQLAlchemy 审计事件
|
2026-04-20 15:43:48 +08:00 |
|
|
|
0d8f697df4
|
fix(stocktake): enforce session_id in resume, make missing generation idempotent, update UI to show SN, and fix excel time offset
|
2026-04-03 09:42:51 +08:00 |
|
|
|
43e1d0aa55
|
fix(stocktake): strictly isolate stocktake drafts by session_id in list and finish generation to prevent historical data mixing
|
2026-04-03 09:25:52 +08:00 |
|
|
|
6aec571775
|
fix(stocktake): resolve 500 error caused by missing batch or sn attributes using strict getattr fallback
|
2026-04-03 09:05:48 +08:00 |
|
|
|
c361d25ea0
|
fix(stocktake): display batch number in scanning dialog and fix empty uncounted items in Excel export
|
2026-04-02 19:06:19 +08:00 |
|
|
|
a52ced0375
|
fix(backend): resolve DetachedInstanceError in audit_log, add pessimistic locks for stock adjustments, and eliminate N+1 queries with eager loading
|
2026-04-02 18:44:12 +08:00 |
|
|
|
b2ce9d31f8
|
fix(stocktake): replace hardcoded 'admin' with actual current user in excel export
|
2026-03-27 09:04:13 +08:00 |
|
|
|
2a27f2e0df
|
feat(stocktake): implement strict blind stocktake logic with hidden system qty, editable count and status filters
|
2026-03-26 17:42:51 +08:00 |
|
|
|
c8810891d8
|
fix(api): globally replace invalid material_base/material_name attributes with correct base relationship
|
2026-03-26 17:14:26 +08:00 |
|
|
|
93dc375ba4
|
perf: replace client-side pagination with server-side pagination in stock selection dialog and fix duplicate variable in semi.vue
|
2026-03-23 14:52:01 +08:00 |
|
|
|
c5974ff05c
|
fix: relax permission requirement on stock list api to unblock outbound operations
|
2026-03-23 14:22:52 +08:00 |
|
|
|
7c9331d78a
|
perf: implement optimistic UI for scanner, disable auto-camera, and sort excel by SKU
|
2026-03-23 09:51:59 +08:00 |
|
|
|
53c198f363
|
feat: fix stocktake deletion bug, and add pagination, search, sorting to stocktake lists
|
2026-03-19 16:21:09 +08:00 |
|
|
|
b37049a4d7
|
feat: add generate-missing logic to identify unscanned stock as inventory loss
|
2026-03-19 15:34:54 +08:00 |
|
|
|
7867fc5e40
|
fix: resolve TypeError between float and Decimal in stocktake excel export
|
2026-03-19 11:47:31 +08:00 |
|
|
|
a32d4f6b65
|
fix: resolve 500 error on excel export by aligning headers and data row lengths for remark field
|
2026-03-19 11:41:53 +08:00 |
|
|
|
a19167e804
|
fix: add missing remark header to stocktake excel export
|
2026-03-19 11:36:48 +08:00 |
|
|
|
0bc0908b9b
|
fix: ensure remark field is properly parsed and saved to database during stocktake update
|
2026-03-19 11:27:40 +08:00 |
|
|
|
367dceef31
|
feat: add master summary sheet to stocktake excel export
|
2026-03-18 14:57:12 +08:00 |
|
|
|
f6153fc10d
|
feat: add unscanned items sheet to stocktake export and fix user real name mapping
|
2026-03-18 14:48:49 +08:00 |
|
|
|
a5f4d32306
|
fix: map correct user real name for stocktake excel export
|
2026-03-18 14:43:24 +08:00 |
|
|
|
41a4518911
|
fix: map correct database fields for spec and location in excel export
|
2026-03-18 14:37:09 +08:00 |
|
|
|
00781422eb
|
fix: correct excel export formatting (timezone, spec, user, location) and add auto-polling for collaborative stocktake
|
2026-03-18 14:22:01 +08:00 |
|
|
|
ac15ef74db
|
fix: resolve MaterialBase sku property error and add dynamic refresh after stock adjustment
|
2026-03-18 14:01:36 +08:00 |
|
|
|
33969b8336
|
fix: support stock adjustment for items without stocktake draft
|
2026-03-18 13:53:55 +08:00 |
|
|
|
e08012d9dd
|
fix: add missing imports for openpyxl and patch draft resolution in stock adjustment
|
2026-03-18 13:24:16 +08:00 |
|
|
|
49a66f9be3
|
fix: resolve 500 error in excel export and 404 in stock adjust
|
2026-03-18 11:46:38 +08:00 |
|
|
|
54ea476206
|
refactor: unify variance calculation and implement backend Excel export with borrowed assets sheet
|
2026-03-18 11:10:54 +08:00 |
|
|
|
332f928c78
|
refactor: simplify stocktake flow without DB schema changes and remove invalid field queries
|
2026-03-13 10:45:37 +08:00 |
|
|
|
13c7357b6f
|
fix: resolve sqlalchemy f405 type casting error on stocktake query
|
2026-03-13 10:33:17 +08:00 |
|
|
|
d61de5cfc9
|
fix: send correct numeric user_id to stocktake draft api to prevent 500 error
|
2026-03-13 10:25:17 +08:00 |
|
|
|
7e23141870
|
refactor: redesign stocktake flow to require manual discrepancy audit and individual adjustments
|
2026-03-13 09:59:01 +08:00 |
|
|
|
4b29912f6f
|
feat: add borrowed quantity column and update stocktake export formulas
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-28 11:55:19 +08:00 |
|
|
|
38f0bbe41d
|
feat: add RBAC for inventory stocktake module
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
|
2026-02-27 13:36:10 +08:00 |
|
|
|
387c8973d6
|
盘库盲盘以及导出excel实现
|
2026-02-06 14:30:14 +08:00 |
|
|
|
489e62e55b
|
摄像头逻辑进行修改,更改分辨率进行快速的读取识别
|
2026-02-06 11:28:48 +08:00 |
|
|
|
e027ebd4a9
|
盘库操作初设计
|
2026-02-06 10:16:37 +08:00 |
|