feat: add automatic database import after ERP data extraction

- Add DataImportService for reading Excel and importing to database
- Extend DiscreteMaterialPlanDAO with deleteBySourceNumbers and batchInsert
- Auto-trigger database write after successful Excel merge
- Support batch delete by SourceNumber and batch insert (1000/batch)
- Update ExtractorPage UI to show import results
- Fix SQL Server query to handle undefined recordset for DELETE/INSERT

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-03-04 11:26:54 +08:00
parent abe51d17fa
commit 63ea81e0d6
8 changed files with 887 additions and 5 deletions

View File

@@ -6,11 +6,25 @@ export interface ExtractorInput {
onProgress?: (message: string, progress: number) => void
}
/**
* Result of database import operation
*/
export interface ImportResult {
success: boolean
recordsRead: number
recordsDeleted: number
recordsImported: number
uniqueSourceNumbers: number
errors: string[]
}
export interface ExtractorResult {
downloadedFiles: string[]
mergedFile: string | null
recordCount: number
errors: string[]
/** Database import result (only populated if mergedFile was created) */
importResult?: ImportResult
}
export interface OrderInfo {