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 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 validOrderNumbers = resolver.getValidOrderNumbers(mappings)
const warnings = resolver.getWarnings(mappings) const warnings = resolver.getWarnings(mappings)

View File

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

View File

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

View File

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