feat: add SQL Server database persistence for extracted material plan data

Add optional database persistence feature that automatically saves extracted
discrete material plan data to SQL Server. Users can enable this feature in
the settings tab.

Changes:
- Add enable_db_persistence flag to ExtractionConfig (default: disabled)
- Create DiscreteMaterialPlanDAO for database operations with REPLACE pattern
- Update progress tracking to include database persistence stage (90-100%)
- Add database persistence checkbox in settings UI
- Remove verbose logging checkbox from data extraction UI (config-only now)
- Update extraction workflow to save merged DataFrame to database

Progress weights adjusted:
- download: 65% -> 60%
- database: 10% (new stage)
- Other stages adjusted accordingly

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-06 12:18:15 +08:00
parent 3180ccacb8
commit 53a1e33e45
8 changed files with 394 additions and 24 deletions

View File

@@ -19,7 +19,7 @@ class ProgressInfo:
"""
stage: (
str # 阶段标识: 'login', 'query', 'download', 'logout', 'convert', 'complete'
str # 阶段标识: 'login', 'query', 'download', 'logout', 'convert', 'database', 'complete'
)
current: int # 当前进度值
total: int # 总量
@@ -48,9 +48,10 @@ class ProgressCalculator:
STAGE_WEIGHTS = {
"login": 5, # 登录: 0-5%
"query": 5, # 查询: 5-10%
"download": 65, # 下载: 10-75%
"logout": 5, # 注销: 75-80%
"convert": 15, # 转换: 80-95%
"download": 60, # 下载: 10-70%
"logout": 5, # 注销: 70-75%
"convert": 15, # 转换: 75-90%
"database": 10, # 数据库持久化: 90-100%
"complete": 5, # 完成: 95-100%
}