|
|
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 |
|
|
|
4b1a86a870
|
fix: 对齐field_to_perm与sys_element权限码 + 税率6% + 含税总价反算
- buy/semi/product: 数量字段映射对齐sys_element实际注册码(qty_inbound/qty_stock/qty_available)
- 数据库: 补全buy(9)+semi(10)+product(13)缺失权限码
- deploy_production.sql: 同步更新
- buy.vue: 税率新增6%选项, 价格联动以含税为主输入, 税率变化保持最后编辑价格不变
- buy.vue: 新增含税总价可输入反算功能
|
2026-07-15 15:03:37 +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 |
|
|
|
e1417d740a
|
feat: 全模块公司隔离 + crossDomain权限码动态跨域控制
- get_current_company_filter: 新增_has_cross_domain_permission, 权限码替代硬编码
- 补全11个Service的get_current_company_filter调用(semi/product/service/outbound/bom/trans/scrap/summary)
- base/search修复: search_material此前无隔离, 已补全
- get_current_company_filter兜底: JWT缺company_name时返回__NO_COMPANY__防止放行
- permission.py: _get_operator_company补全返回值, 修复权限页保存逻辑
- 新增crossDomain迁移脚本, element_type=element挂system_mgmt下
|
2026-07-15 11:11:40 +08:00 |
|
|
|
8f468a0a39
|
fix: 修复全局字段权限导致数据显示为空的问题
根因: /permissions/role/<role_code> 接口要求 system_permission,
非管理员角色无法获取自身权限 → 权限数组为空 → 前后端字段全被过滤
修复:
- permission.py: 查自己角色不再需要 system_permission, 解除权限死锁
- 5个 inbound API: 恢复完整 field_to_perm 映射, 每个字段均可独立权限管控
- 补齐遗漏字段(qty_inbound/qty_stock/qty_available/request_id/request_no)
- buy.vue: 入库表单价格字段加入 hasFormFieldPermission 守卫
|
2026-07-14 16:09:41 +08:00 |
|
|
|
760f78e016
|
feat: 添加参考价格列 + 修复公司筛选跨域问题 + CLIP模型持久化
## 新增功能
- material_base 表新增 reference_price 列(NUMERIC(10,2))
- 基础信息 list.vue / buyOdoo.vue 页面增加「参考价格」列展示和编辑
- 新增 material_list:referencePrice 权限元素,支持按角色控制可见性
## Bug 修复
- 入库三页面(buy/product/semi)公司筛选:非超管用户 company=ALL 不再传给旧版后端
- 基础信息两页面(list/buyOdoo):buyOdoo 增加 v-if=isSuperAdmin 与 list.vue 行为统一
- company=ALL 默认值在各页面 getList/fetchData 中自动过滤,兼容旧版后端
## 运维优化
- docker-compose.prod.yml 增加 models_prod 卷挂载,CLIP模型持久化免重复上传
- deploy_code.sh 增加 models_prod 目录检查与模型文件存在性告警
|
2026-07-13 17:30:52 +08:00 |
|
|
|
4f5965db02
|
feat: JWT多租户数据权限隔离 & 主管系统管理权限 & 含税单价补齐
## 多租户公司数据隔离
- 新增 get_current_company_filter() 工具函数 (decorators.py)
SUPER_ADMIN: 可传company_name参数过滤或传ALL看全量
其他角色: 强制隔离到JWT中的company_name
- 重构 base_service.py / buy_service.py: 用集中式函数替换内联公司过滤
- SysRolePermission 表新增 company_name 字段,支持同角色不同公司权限
- get_user_permissions() 新增 company_name 参数,查公司定制+全局模板权限
- permission.py API 新增 @permission_required 拦截 + 公司过滤
- 19个API/service文件传递 company_name 到权限查询
## 主管系统管理权限
- delete_user() 允许SUPERVISOR删除同公司用户 (原仅SUPER_ADMIN)
- get_all_users() 新增 company_name 参数过滤
- 用户列表/权限分配 API 应用 get_current_company_filter()
- 前端 UserCreate.vue: 超管可见公司下拉框,主管隐藏部门字段
## 前端多租户适配
- material/list.vue / buy.vue: 公司下拉框仅超管可见,默认ALL
- UserCreate.vue: 新增搜索栏公司筛选,部门字段按角色显隐
- auth.ts: getUserList() 支持 params 参数
## Bug修复: 含税单价字段补齐
- buy.vue: 表格列/高级筛选/排序/权限映射新增 post_tax_unit_price
- buy_service.py: allowed_fields/sort_field_map 新增 post_tax_unit_price
|
2026-07-13 15:12:22 +08:00 |
|
|
|
c1092407ad
|
V3.50
|
2026-06-25 15:21:43 +08:00 |
|
|
|
8a2da1ac1e
|
半成品/成品入库:BOM 编号下拉按父件规格联动过滤(前后端双端改造)
- 后端 /inbound/{semi,product}/search-bom 增加 parent_spec 可选参数,Service 层在 MaterialBase.spec_model 上加等值过滤
|
2026-06-04 16:01:48 +08:00 |
|
|
|
bac670ef7a
|
基础信息页:计量单位改 el-select(下拉历史+手动输入);表单排版重排为 4 行(类别占满行);类别末级英文后缀自动填规格型号
|
2026-06-04 13:22:51 +08:00 |
|
|
|
cf55c94826
|
feat: 库存接口增加 ai_mode=true 极简返回模式,键名压缩为 n/s/c
|
2026-05-19 09:53:06 +08:00 |
|
|
|
259f3a7e0d
|
4.29扫码获取库位小工具接口
|
2026-04-29 15:40:43 +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 |
|
|
|
477da7c434
|
fix-security-correct-field-permission-mapping-and-403-denial
|
2026-04-14 15:37:39 +08:00 |
|
|
|
ae05f3bb75
|
fix-security-field-permission-matching
|
2026-04-14 15:09:15 +08:00 |
|
|
|
ae1fd1afd4
|
fix-security-permission-codes
|
2026-04-14 14:49:53 +08:00 |
|
|
|
c7ac092be4
|
feat(material): add global floating helper to track latest specification codes with smart grouping
|
2026-04-13 08:28:27 +08:00 |
|
|
|
41b5118ecd
|
feat(repair): implement backend CRUD services and API routes with RBAC permissions for repair module
|
2026-04-08 18:34:48 +08:00 |
|
|
|
4a4baa2f8f
|
fix: sort warehouse tree by name, fix tree batch delete cascade, and implement safe history location autofill
|
2026-04-08 17:32:00 +08:00 |
|
|
|
6d80c90b66
|
feat: add 'not contains' operator, implement inbound record export, and verify export filter rules
|
2026-04-07 17:23:00 +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 |
|
|
|
7421ef3231
|
fix(api): expose real 500 error stack trace and fix missing func import
|
2026-03-25 10:56:31 +08:00 |
|
|
|
ac7774e0e3
|
fix(api): gracefully handle integrity error on inbound record deletion
|
2026-03-25 10:48:43 +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 |
|
|
|
032479fe38
|
fix: capture and persist target object names for delete, outbound, and borrow operations in audit logs
|
2026-03-20 15:47:13 +08:00 |
|
|
|
b08bbba718
|
fix: enforce Beijing Time (UTC+8) globally by replacing datetime.utcnow
|
2026-03-20 15:23:20 +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 |
|
|
|
878d11af28
|
fix: reset stock quantity color and enforce location validation for all inbound operations
|
2026-03-18 17:04:23 +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 |
|