fix(cleaner): preserve production IDs in operation history

The 总排号 field was always empty because getCleanerData() resolved
production IDs to order numbers before passing them to the cleaner,
losing the original inputs. Now originalInputs are carried through
the full chain so the resolver can properly set productionId.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-04-28 11:57:47 +08:00
parent 5ff99cdd0f
commit 98865f5d7e
4 changed files with 7 additions and 1 deletions

View File

@@ -66,7 +66,8 @@ export class CleanerApplicationService {
}
const resolver = new OrderNumberResolver(dbService)
const mappings = await resolver.resolve(input.orderNumbers)
const inputsToResolve = input.originalInputs?.length ? input.originalInputs : input.orderNumbers
const mappings = await resolver.resolve(inputsToResolve)
const validOrderNumbers = resolver.getValidOrderNumbers(mappings)
const warnings = resolver.getWarnings(mappings)

View File

@@ -236,6 +236,7 @@ export class ValidationApplicationService {
): Promise<{
success: boolean
orderNumbers?: string[]
originalInputs?: string[]
materialCodes?: string[]
error?: string
}> {
@@ -288,6 +289,7 @@ export class ValidationApplicationService {
return {
success: true,
orderNumbers,
originalInputs: sharedIds,
materialCodes
}
} catch (error) {

View File

@@ -13,6 +13,7 @@ export interface CleanerProgress {
export interface CleanerInput {
orderNumbers: string[]
originalInputs?: string[]
materialCodes: string[]
dryRun: boolean
headless?: boolean

View File

@@ -10,6 +10,7 @@ import type { CleanerExportItem, MaterialBatchChange } from './helpers'
interface CleanerDataPayload {
success?: boolean
orderNumbers?: string[]
originalInputs?: string[]
materialCodes?: string[]
}
@@ -147,6 +148,7 @@ export async function runCleanerExecution(params: {
const response = await window.electron.cleaner.runCleaner({
orderNumbers: orderNumberList,
originalInputs: cleanerData?.originalInputs,
materialCodes: materialCodeList,
dryRun: params.dryRun,
headless: params.headless,