This commit is contained in:
zlwu committed 2026-07-25 09:37:24 +08:00
1 parent 2de86b0500
commit 7f4c9720e9
37 files changed
+33121 -28528

No files matched your search

@@ -0,0 +1,36 @@
# 生产产品类型表解耦 Implementation Plan
> **For agentic workers:** Execute task-by-task. Steps use checkbox syntax for tracking.
**Goal:** 生产侧产品类型改用 `biz_production_product_type`,中试继续用 `biz_cell_product_type`。
**Architecture:** 同结构新表 + 同 ID 种子拷贝;生产 API CRUD;前端三处下拉换接口;cell_product / process_route join 切新表。
**Tech Stack:** MySQL、FastAPI、SQLAlchemy、Vue 3、web-admin API 模块
---
### Task 1: SQL + Model
- [x] 创建 `docs/sql/patch_2026-07-24_production_product_type.sql`(建表 + 幂等拷贝)
- [x] 在 `models.py` 增加 `BizProductionProductType`
- [x] 在 `zkxw.sql` 追加表结构(与 patch 一致,便于全量基线)
### Task 2: Backend CRUD + API
- [x] 创建 `backend/app/crud/production_product_type.py`(对齐 output_type / cell product type)
- [x] 在 `production.py` 增加 `/production-product-types` CRUD 路由
### Task 3: Switch joins
- [x] `cell_product.py`:`BizCellProductType` → `BizProductionProductType`
- [x] `process_route.py`:outerjoin 切到新表
### Task 4: Frontend
- [x] `api/production.ts` 增加 fetch 封装
- [x] 三处 Vue 改用新 list API
### Task 5: Verify
- [x] 导入模型/路由可达;更新 graphify(backend + frontend)