|
|
3290f206c6
|
perf: 导出OOM修复(yield_per流式) + 采购模糊匹配安全防护
## base_service.py export_excel
- query.all()全量→yield_per(2000)分块流式读取
- all_rows[]内存收集→write_only=True直写Excel
- all_rows.sort()→ORDER BY数据库排序
- 删除~160行旧Excel样式/脱敏死代码
- 内存: 全量→2000行分块+输出流
## purchase_service.py
- 模糊匹配安全防护:
len(n.strip())>=2 过滤空格/单字符
.limit(500) 防全表返回
|
2026-07-16 13:08:45 +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 |
|
|
|
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 |
|
|
|
a11b7972c3
|
feat: 打通采购申请与入库的按单入库链路
后端变更:
- PurchaseRequest 新增 base_id 硬关联 MaterialBase,StockBuy 新增 request_id 关联采购单
- handle_inbound 支持 request_id 入参,入库后自动反写采购单状态为已完成
- 新增 get_approved_requests 接口,返回已审批未入库采购单列表(含物料信息+历史数据回退匹配)
- create_purchase_request 新增 name+spec_model 自动匹配 MaterialBase
- 新增 SQL 和 Alembic 数据库迁移脚本
前端变更:
- 入库表单新增"从采购单导入"弹窗,支持搜索/选中已审批采购单并一键填充物料和商务信息
- 单价/总价交叉推算,缺项自动补全
- 选中行蓝色高亮+点击整行选中,行级交互优化
|
2026-07-14 15:25:00 +08:00 |
|
|
|
a2f9a3e754
|
V3.54
|
2026-07-13 17:33:16 +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 |
|
|
|
ffafa635bb
|
feat: 将产品图/说明书备注字段从JSON数组中分离为独立数据库列
- 数据库新增 product_image_remark 和 manual_link_remark 两个TEXT列
- 备注文字不再与上传文件URL混存在 generalImage/generalManual JSON数组中
- 前端输入框改为textarea,绑定独立的备注字段
- 修复 handlePasteLink 忽略field参数的bug
- 新增 isInternalFile 辅助函数,用于区分上传文件与纯文本
- 同步修改 list.vue 和 buyOdoo.vue 两个页面
|
2026-07-10 10:52:23 +08:00 |
|
|
|
afe0f25415
|
物料类别隔离校验:buy 改黑名单 + semi/product 改精确路径匹配,消除子串包含Bug
|
2026-06-05 13:01:39 +08:00 |
|
|
|
ff5418afa3
|
入库模块:物料搜索点击无感修复 + 类别校验白名单准入制
前端(buy/semi/product/service.vue,4 文件):
修复物料搜索"点击已聚焦 input 时内容被清空"交互 bug。
el-select 在 filterable+remote 模式下点击已聚焦的 input 时,el-select 内部
会 emit query='' 触发 remote-method,绕过 handleMaterialDropdownVisible
入口保护,直接清空 searchKeyword 和 materialOptions,导致用户被迫重写。
新增两层防御实现"编辑无感":
1) handleMaterialDropdownVisible 入口拦截:已选过物料(form.base_id 有值)
时下拉打开直接 return,不请求默认列表
2) handleSearchMaterial 内部拦截:拦截 el-select 内部 emit 的空 query,
仅在 form.base_id 有值 + safeQuery 为空 + 列表非空时 return
后端(buy/semi/product_service.py,3 文件):
入库类别校验从黑名单改为白名单准入制,彻底杜绝"成品进半成品库"
等非法组合(d94b52b 黑名单方案"成品不能进采购库"已挡不住这种组合)。
- buy_service.py: 黑名单(禁半成品/成品进采购)→ 白名单(必须含"原材料")
- semi_service.py: 统一错误信息格式为"只有【半成品】才允许半成品入库!"
- product_service.py: 统一错误信息格式为"只有【成品】才允许成品入库!"
- 三处空 category 统一显示为"未分类"
配合前端已修复的 catch 块(e.response.data.msg 精准提取),后端新错误
信息可原样弹窗给用户。
|
2026-06-04 17:57:17 +08:00 |
|
|
|
d94b52bf73
|
入库模块:物料类别隔离硬性校验(写拦截,读放宽)
|
2026-06-04 17:19: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 |
|
|
|
fffee9d964
|
入库管理三页面类别搜索中间节点支持子级匹配(buy/semi/product 类别过滤改为 ilike 前缀,与基础信息页一致)
|
2026-06-04 11:31:44 +08:00 |
|
|
|
05aff2dd83
|
V3.36版本修改,基础信息列展示规则,分页数量修改,类别搜索修改
|
2026-05-29 11:23:05 +08:00 |
|
|
|
fb5b8d873b
|
版本变更V3.35将图像的处理统一更换到新表当中
|
2026-05-26 11:28:26 +08:00 |
|
|
|
682139bab8
|
版本变更V3.34将图像的处理统一更换到新表当中
|
2026-05-26 08:57:41 +08:00 |
|
|
|
567c3175f6
|
fix: 审计日志跳过向量字段,修复 numpy 数组比较异常;补全三大入库单更新向量提取,统一删除确认弹窗
|
2026-05-25 11:11:10 +08:00 |
|
|
|
1da4b454cd
|
feat: 新增物料/入库单实时 CLIP 向量提取(新建+更新),修复 I/O 延迟和路径解析静默失败
|
2026-05-25 10:04:32 +08:00 |
|
|
|
8c635d6afe
|
版本变更V3.31添加识图功能
|
2026-05-22 10:59:39 +08:00 |
|
|
|
75705d31c9
|
fix: 物料修改后级联清除 BOM 树缓存,防止信息不一致
|
2026-05-19 11:40:43 +08:00 |
|
|
|
d4bf7c5e99
|
feat(material): 物料列表接口返回预警邮箱字段,弹窗打开时可正确回显
|
2026-05-12 14:59:31 +08:00 |
|
|
|
259f3a7e0d
|
4.29扫码获取库位小工具接口
|
2026-04-29 15:40:43 +08:00 |
|
|
|
8291a89898
|
feat(backend): apply global cross-company data isolation logic across all inbound, outbound, and stock services
|
2026-04-17 09:57:00 +08:00 |
|
|
|
bd93a3d70b
|
feat: implement clean global cross-organization permission node and backend service isolation logic
|
2026-04-17 08:59:55 +08:00 |
|
|
|
477da7c434
|
fix-security-correct-field-permission-mapping-and-403-denial
|
2026-04-14 15:37:39 +08:00 |
|
|
|
0e8ddd0851
|
feat(security): implement strict row-level data isolation based on user company
|
2026-04-14 08:38:50 +08:00 |
|
|
|
6aa2142f01
|
refactor(material): implement contiguous sequence grouping for specs with count-based descending sort
|
2026-04-13 09:14:59 +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 |
|
|
|
454f9b1184
|
feat(scrap): integrate repair items into physical scrap scanning flow and lock manual status
|
2026-04-09 09:53:20 +08:00 |
|
|
|
f4d14f718d
|
refactor(repair): strictly gate 'Already Outbound' status to system-only trigger
|
2026-04-09 09:12:42 +08:00 |
|
|
|
48efbed46b
|
feat(repair): add quick status filters, mandatory validations, FIFO sorting, and hide actions on finished orders
|
2026-04-09 09:04:05 +08:00 |
|
|
|
3085d9f447
|
feat(repair): decouple material base, sync global sku sequence and add scan/print features
|
2026-04-08 19:36:14 +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 |
|
|
|
4df471add2
|
fix(inbound): correct date attributes for StockProduct and StockSemi in history location query
|
2026-04-08 17:45:29 +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 |
|
|
|
f612c47143
|
fix(filter): append 23:59:59 to end_date to resolve midnight truncation bug in date range queries
|
2026-04-07 17:39:14 +08:00 |
|
|
|
5ea2be58ae
|
fix(filter): globally apply not_contains operator parsing to all stock and inbound queries
|
2026-04-07 17:32:27 +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 |
|
|
|
30ab1c186c
|
fix: filter zero quantity items in inventory export and add batch/sn traceability to outbound record details
|
2026-04-07 16:41:53 +08:00 |
|
|
|
f9edb5f1f7
|
fix(api): fix AttributeError on inbound deletion by accessing base.name instead of material_name
|
2026-03-25 11:02:32 +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 |
|
|
|
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 |
|
|
|
6596ce2458
|
fix: move keyword search filter to outer query to fix outerjoin bypass bug in material list
|
2026-03-19 10:43:09 +08:00 |
|
|
|
11f5a1f51e
|
fix: patch validation bypass for mandatory inspection
|
2026-03-17 13:26:17 +08:00 |
|
|
|
c1c494893f
|
feat: implement dynamic inspection requirement logic based on material master data
|
2026-03-17 11:56:04 +08:00 |
|
|
|
dbe6997ca7
|
feat: add inventory descending as fallback sort for normal items and ensure list refresh after warning setup
|
2026-03-12 09:46:18 +08:00 |
|
|
|
58a519a62f
|
fix: refactor advanced filters to use WHERE for subquery columns and rewrite warning sort in pure order_by expressions
|
2026-03-12 09:40:10 +08:00 |
|
|
|
d8e86959b8
|
fix: 基础信息排序问题
|
2026-03-12 09:29:50 +08:00 |
|