diff --git a/furniture-3d-system/src/app/api/intake/non-integrated/installation-order/route.ts b/furniture-3d-system/src/app/api/intake/non-integrated/installation-order/route.ts new file mode 100644 index 00000000..5668bcee --- /dev/null +++ b/furniture-3d-system/src/app/api/intake/non-integrated/installation-order/route.ts @@ -0,0 +1,49 @@ +import { NextRequest } from "next/server"; + +import { AppError, ErrorCode } from "@/server/core/errors"; +import { handleRequest, jsonError, jsonSuccess } from "@/server/core/response"; +import { intakeNonIntegratedProductService } from "@/server/services/intake-non-integrated-product.service"; + +export async function POST(request: NextRequest) { + return handleRequest( + request, + async ({ requestId, user }) => { + const body = (await request.json().catch(() => null)) as Record< + string, + unknown + > | null; + const productId = + typeof body?.productId === "string" ? body.productId.trim() : ""; + const fileIds = Array.isArray(body?.fileIds) + ? body.fileIds.filter( + (fileId): fileId is string => + typeof fileId === "string" && fileId.trim().length > 0, + ) + : []; + + if (!productId || fileIds.length === 0) { + return jsonError( + ErrorCode.VALIDATION_INVALID_FORMAT, + "产品或安装资料排序内容不正确", + 400, + requestId, + ); + } + + try { + const product = await intakeNonIntegratedProductService.reorderInstallationFiles( + productId, + fileIds, + user, + ); + return jsonSuccess({ product }, 200, requestId); + } catch (error) { + if (error instanceof AppError) { + return jsonError(error.code, error.message, error.statusCode, requestId); + } + throw error; + } + }, + { requireAuth: true }, + ); +} diff --git a/furniture-3d-system/src/app/api/supply-chain/category-config/group-tiers/import/route.ts b/furniture-3d-system/src/app/api/supply-chain/category-config/group-tiers/import/route.ts index 5f9b9a14..fe4d8de2 100644 --- a/furniture-3d-system/src/app/api/supply-chain/category-config/group-tiers/import/route.ts +++ b/furniture-3d-system/src/app/api/supply-chain/category-config/group-tiers/import/route.ts @@ -6,10 +6,14 @@ import { handleRequest, jsonError } from '@/server/core/response' import { supplyChainProductArchiveCategoryGroupTierService } from '@/server/services/supply-chain-product-archive-category-group-tier.service' const HEADER_MAP: Record = { + 一级类目: 'categoryL1', + 二级类目: 'categoryL2', 分类: 'categoryGroup', 规模标签: 'scaleLabel', + '业绩起点(元)': 'performanceStart', 业绩起点: 'performanceStart', 业绩终点: 'performanceEnd', + '日销起点(件/天)': 'dailySalesStart', 日销起点: 'dailySalesStart', 日销终点: 'dailySalesEnd', categoryGroup: 'categoryGroup', diff --git a/furniture-3d-system/src/app/intake/non-integrated/buildNonIntegratedSecondaryWorkspaceRenderers.tsx b/furniture-3d-system/src/app/intake/non-integrated/buildNonIntegratedSecondaryWorkspaceRenderers.tsx index fcd6e4a7..7b48724d 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/buildNonIntegratedSecondaryWorkspaceRenderers.tsx +++ b/furniture-3d-system/src/app/intake/non-integrated/buildNonIntegratedSecondaryWorkspaceRenderers.tsx @@ -231,6 +231,7 @@ export function buildNonIntegratedSecondaryWorkspaceRenderers({ isReadOnly: editability.isReadOnly, onPushDrawingSystemVersion: workspaceUploadActions.handlePushInstallationDrawingSystemVersion, + onReorderFiles: workspaceUploadActions.handleReorderInstallationFiles, selectedFileId: documentPresentation.effectiveSelectedWorkspaceFile?.id ?? "", archivePreviewPanel: renderArchivePreviewPanel(), diff --git a/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedApi.ts b/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedApi.ts index e70194b5..99cc9c6e 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedApi.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedApi.ts @@ -836,6 +836,21 @@ export async function pushInstallationFileToDrawingSystem(input: { }>(response); } +export async function reorderInstallationFiles( + productId: string, + fileIds: string[], +) { + const response = await fetchWithTimeout( + "/api/intake/non-integrated/installation-order", + { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ productId, fileIds }), + }, + ); + return readApiData<{ product: NonIntegratedProductRecord }>(response); +} + export async function uploadDetachedNonIntegratedFile( productId: string | undefined, file: File, diff --git a/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedStorage.ts b/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedStorage.ts index 5110ee8f..2c8f3983 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedStorage.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/core/nonIntegratedStorage.ts @@ -660,6 +660,7 @@ export type NonIntegratedUploadFile = { installDrawingId?: string; installAssetType?: string; installVersionLabel?: string; + installOrder?: number; installIsCurrentVersion?: boolean; installDrawingSyncStatus?: "not_applicable" | "pending" | "processing" | "succeeded" | "failed"; @@ -2027,6 +2028,10 @@ function normalizeUploadFile( installDrawingId: normalizeString(item.installDrawingId).toUpperCase(), installAssetType: normalizeString(item.installAssetType), installVersionLabel: normalizeString(item.installVersionLabel), + installOrder: + typeof item.installOrder === "number" && Number.isFinite(item.installOrder) + ? item.installOrder + : undefined, installIsCurrentVersion: typeof item.installIsCurrentVersion === "boolean" ? item.installIsCurrentVersion diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/InstallationFileCard.tsx b/furniture-3d-system/src/app/intake/non-integrated/workspaces/InstallationFileCard.tsx index 2e64fa59..f7e06d1d 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/workspaces/InstallationFileCard.tsx +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/InstallationFileCard.tsx @@ -1,5 +1,8 @@ "use client"; +import { useSortable } from "@dnd-kit/sortable"; +import { CSS } from "@dnd-kit/utilities"; +import { GripVertical } from "lucide-react"; import type { NonIntegratedUploadFile } from "../nonIntegratedStorage"; import { getUploadFileTypeLabel } from "./documents/uploadFilePreview"; @@ -10,6 +13,7 @@ type InstallationFileCardProps = { assetLabel: string; versionLabel: string; isActive: boolean; + isDragDisabled: boolean; onSelect: (fileId: string) => void; }; @@ -20,37 +24,64 @@ export function InstallationFileCard({ assetLabel, versionLabel, isActive, + isDragDisabled, onSelect, }: InstallationFileCardProps) { + const { + attributes, + listeners, + setNodeRef, + transform, + transition, + isDragging, + } = useSortable({ id: file.id, disabled: isDragDisabled }); const syncStatus = file.installDrawingSyncStatus; const fileDrawingId = file.installDrawingId || drawingId; return (
- + + +
{fileDrawingId && syncStatus !== "not_applicable" ? (

void; + onReorderFiles: (fileIds: string[]) => Promise; onSelectStyle: (styleKey: string) => void; onSelectAssetType: (assetType: InstallationAssetType) => void; onNoteChange: (value: string) => void; @@ -64,7 +78,6 @@ export function InstallationWorkspace({ selectedInstallationStyleEntry, activeInstallationStyleFiles, activeInstallationAssetType, - activeInstallationAssetFiles, activeInstallationVersionGroups, activeInstallationAssetLabel, noteLabel, @@ -74,11 +87,15 @@ export function InstallationWorkspace({ selectedFileId, archivePreviewPanel, onPushDrawingSystemVersion, + onReorderFiles, onSelectStyle, onSelectAssetType, onNoteChange, onSelectFile, }: InstallationWorkspaceProps) { + const sensors = useSensors( + useSensor(PointerSensor, { activationConstraint: { distance: 6 } }), + ); const installationAssetTypeSummaries = INSTALLATION_ASSET_TYPE_OPTIONS.map( (option) => { const files = activeInstallationStyleFiles.filter( @@ -100,10 +117,33 @@ export function InstallationWorkspace({ const isAssembledOnly = selectedInstallationStyleEntry?.installModeLabel === "整装"; + const handleDragEnd = (event: DragEndEvent) => { + if (isReadOnly || !event.over || event.active.id === event.over.id) return; + + const group = activeInstallationVersionGroups.find((candidate) => + candidate.files.some((file) => file.id === event.active.id), + ); + if (!group || !group.files.some((file) => file.id === event.over?.id)) { + return; + } + + const oldIndex = group.files.findIndex( + (file) => file.id === event.active.id, + ); + const newIndex = group.files.findIndex( + (file) => file.id === event.over?.id, + ); + if (oldIndex < 0 || newIndex < 0) return; + + void onReorderFiles( + arrayMove(group.files, oldIndex, newIndex).map((file) => file.id), + ).catch(() => undefined); + }; + return (

@@ -175,10 +215,6 @@ export function InstallationWorkspace({
-
- {selectedInstallationStyleEntry?.label ?? "安装资料"} · 当前{" "} - {activeInstallationAssetFiles.length} 份 -
{installationAssetTypeSummaries.map((option) => { const isActive = activeInstallationAssetType === option.key; @@ -214,41 +250,53 @@ export function InstallationWorkspace({

) : ( -
- {activeInstallationVersionGroups.map((group) => { - const styleKey = selectedInstallationStyleEntry?.key ?? ""; - const drawingId = - styleKey === INSTALLATION_SHARED_STYLE_KEY ? "" : styleKey; + +
+ {activeInstallationVersionGroups.map((group) => { + const styleKey = selectedInstallationStyleEntry?.key ?? ""; + const drawingId = + styleKey === INSTALLATION_SHARED_STYLE_KEY ? "" : styleKey; - return ( -
- + return ( +
+ -
- {group.files.map((file) => ( - - ))} + file.id)} + strategy={rectSortingStrategy} + > +
+ {group.files.map((file) => ( + + ))} +
+
-
- ); - })} -
+ ); + })} +
+
)}
diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/uploadMetadataHelpers.ts b/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/uploadMetadataHelpers.ts index ab136006..97b56fab 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/uploadMetadataHelpers.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/uploadMetadataHelpers.ts @@ -39,6 +39,7 @@ export type CreateUploadFileRecordOptions = { installDrawingId?: string; installAssetType?: InstallationAssetType; installVersionLabel?: string; + installOrder?: number; installIsCurrentVersion?: boolean; installDrawingSyncStatus?: "pending" | "processing" | "succeeded" | "failed"; packagingStyleKey?: string; @@ -84,6 +85,9 @@ export function buildUploadMetadataPayload( if (options.installVersionLabel) { metadata.installVersionLabel = options.installVersionLabel; } + if (typeof options.installOrder === "number" && Number.isFinite(options.installOrder)) { + metadata.installOrder = options.installOrder; + } if (typeof options.installIsCurrentVersion === "boolean") { metadata.installIsCurrentVersion = options.installIsCurrentVersion; } @@ -133,6 +137,7 @@ export function applyUploadFileCategoryMetadata( installDrawingSyncedAt: undefined, installAssetType: undefined, installVersionLabel: undefined, + installOrder: undefined, installIsCurrentVersion: undefined, packagingStyleKey: undefined, packagingAssetType: undefined, @@ -164,6 +169,7 @@ export function applyUploadFileCategoryMetadata( installDrawingSyncedAt: undefined, installAssetType: undefined, installVersionLabel: undefined, + installOrder: undefined, installIsCurrentVersion: undefined, packagingStyleKey: undefined, packagingAssetType: undefined, @@ -190,6 +196,7 @@ export function applyUploadFileCategoryMetadata( installAssetType: options?.installAssetType ?? file.installAssetType, installVersionLabel: options?.installVersionLabel ?? file.installVersionLabel, + installOrder: options?.installOrder ?? file.installOrder, installIsCurrentVersion: options?.installIsCurrentVersion ?? file.installIsCurrentVersion, installDrawingSyncStatus: @@ -220,6 +227,7 @@ export function applyUploadFileCategoryMetadata( installDrawingSyncedAt: undefined, installAssetType: undefined, installVersionLabel: undefined, + installOrder: undefined, installIsCurrentVersion: undefined, packagingStyleKey: options?.packagingStyleKey ?? file.packagingStyleKey, packagingAssetType: @@ -248,6 +256,7 @@ export function applyUploadFileCategoryMetadata( installDrawingSyncedAt: undefined, installAssetType: undefined, installVersionLabel: undefined, + installOrder: undefined, installIsCurrentVersion: undefined, packagingStyleKey: undefined, packagingAssetType: undefined, @@ -276,6 +285,7 @@ export function applyUploadFileCategoryMetadata( installDrawingSyncedAt: undefined, installAssetType: undefined, installVersionLabel: undefined, + installOrder: undefined, installIsCurrentVersion: undefined, packagingStyleKey: undefined, packagingAssetType: undefined, @@ -300,6 +310,7 @@ export function applyUploadFileCategoryMetadata( installStyleKey: undefined, installAssetType: undefined, installVersionLabel: undefined, + installOrder: undefined, installIsCurrentVersion: undefined, packagingStyleKey: undefined, packagingAssetType: undefined, diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/useWorkspaceFileUploadController.ts b/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/useWorkspaceFileUploadController.ts index 2fd25926..164988a6 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/useWorkspaceFileUploadController.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/documents/useWorkspaceFileUploadController.ts @@ -5,7 +5,10 @@ import { } from "react"; import type { NonIntegratedUploadFile } from "../../nonIntegratedStorage"; -import type { NonIntegratedUploadProgressHandler } from "../../nonIntegratedApi"; +import { + reorderInstallationFiles as persistInstallationFileOrder, + type NonIntegratedUploadProgressHandler, +} from "../../nonIntegratedApi"; import type { DocumentWorkspaceView } from "../../nonIntegratedDetailTypes"; import { DETECTION_WORKSPACE_CATEGORY, @@ -31,6 +34,7 @@ import { type InstallationAssetType, } from "../style-assets/styleFileHelpers"; import { useInstallationDrawingSystemPushController } from "./useInstallationDrawingSystemPushController"; +import { reorderInstallationFiles as applyInstallationFileOrder } from "../style-assets/installationFileOrdering"; import type { InstallationStyleEntry } from "../style-assets/styleWorkspaceEntries"; import { INSTALLATION_ASSET_TYPE_LABELS, @@ -226,6 +230,7 @@ export function useWorkspaceFileUploadController({ installDrawingId: targetDrawingId || undefined, installAssetType: targetAssetType, installVersionLabel: nextVersionLabel, + installOrder: index + 1, installIsCurrentVersion: true, installDrawingSyncStatus: targetDrawingId ? "pending" : undefined, }, @@ -328,11 +333,39 @@ export function useWorkspaceFileUploadController({ event.target.value = ""; } + async function handleReorderInstallationFiles(fileIds: string[]) { + if (isReadOnly || !sharedUploadProductId || fileIds.length === 0) return; + + let previousFiles: NonIntegratedUploadFile[] | null = null; + setUploadFiles((current) => { + previousFiles = current; + return applyInstallationFileOrder(current, fileIds); + }); + + try { + const result = await persistInstallationFileOrder( + sharedUploadProductId, + fileIds, + ); + setUploadFiles(result.product.uploadFiles); + setSaveMessage("安装资料顺序已保存。"); + setSaveMessageType("success"); + } catch (error) { + if (previousFiles) setUploadFiles(previousFiles); + setSaveMessage( + error instanceof Error ? error.message : "安装资料顺序保存失败", + ); + setSaveMessageType("error"); + throw error; + } + } + return { handleUploadDetectionQualityStandardFiles, handleUploadFilesChange, handleUploadFirstQualityFiles, handleUploadInstallationFiles, + handleReorderInstallationFiles, handlePushInstallationDrawingSystemVersion, }; } diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.test.ts b/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.test.ts index 1330b1af..e7166b90 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.test.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.test.ts @@ -1,5 +1,6 @@ import { pushInstallationFilesInOrder, + reorderInstallationFiles, sortInstallationFiles, } from "./installationFileOrdering"; @@ -47,4 +48,40 @@ describe("installation file ordering", () => { remainingCount: 2, }); }); + + it("keeps the manually saved order ahead of filename order", () => { + const files = [ + { id: "a", name: "1.jpg" }, + { id: "b", name: "2.jpg" }, + { id: "c", name: "3.jpg" }, + ]; + const reordered = reorderInstallationFiles(files, ["c", "a", "b"]); + + expect(sortInstallationFiles(reordered).map((file) => file.id)).toEqual([ + "c", + "a", + "b", + ]); + }); + + it("pushes files in the saved manual order", async () => { + const files = [ + { id: "a", name: "1.jpg", installOrder: 2 }, + { id: "b", name: "2.jpg", installOrder: 3 }, + { id: "c", name: "3.jpg", installOrder: 1 }, + ]; + const pushed: string[] = []; + + await pushInstallationFilesInOrder(files, { + onProcessing: () => undefined, + push: async (file) => { + pushed.push(file.id); + return file.id; + }, + onSucceeded: () => undefined, + onFailed: () => undefined, + }); + + expect(pushed).toEqual(["c", "a", "b"]); + }); }); diff --git a/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.ts b/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.ts index 791c540f..fa0b33ab 100644 --- a/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.ts +++ b/furniture-3d-system/src/app/intake/non-integrated/workspaces/style-assets/installationFileOrdering.ts @@ -5,12 +5,51 @@ const installationFileNameCollator = new Intl.Collator("zh-CN", { sensitivity: "base", }); -export function sortInstallationFiles>( +export function sortInstallationFiles< + T extends Pick & { + installOrder?: number; + }, +>( files: readonly T[], ) { - return [...files].sort((left, right) => - installationFileNameCollator.compare(left.name, right.name), + const hasCompleteManualOrder = + files.length > 0 && + files.every( + (file) => + typeof file.installOrder === "number" && + Number.isFinite(file.installOrder), + ); + + return [...files] + .map((file, index) => ({ file, index })) + .sort((left, right) => { + if (hasCompleteManualOrder) { + const orderDifference = + (left.file.installOrder ?? 0) - (right.file.installOrder ?? 0); + if (orderDifference !== 0) return orderDifference; + return left.index - right.index; + } + + return installationFileNameCollator.compare( + left.file.name, + right.file.name, + ); + }) + .map(({ file }) => file); +} + +export function reorderInstallationFiles( + files: readonly T[], + orderedIds: readonly string[], +) { + const orderById = new Map( + orderedIds.map((fileId, index) => [fileId, index + 1]), ); + + return files.map((file) => { + const order = orderById.get(file.id); + return order === undefined ? file : { ...file, installOrder: order }; + }); } type InstallationSyncStatus = NonIntegratedUploadFile["installDrawingSyncStatus"]; diff --git a/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts b/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts index 518004bc..d6c7c9e9 100644 --- a/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts +++ b/furniture-3d-system/src/server/services/intake-non-integrated-product.service.ts @@ -267,6 +267,7 @@ type AttachUploadFileMetadata = Partial< | 'installDrawingId' | 'installAssetType' | 'installVersionLabel' + | 'installOrder' | 'installIsCurrentVersion' | 'installDrawingSyncStatus' | 'installDrawingSyncTaskId' @@ -4356,6 +4357,9 @@ function pickUploadFileMetadata(input: AttachUploadFileInput): AttachUploadFileM ...(installDrawingSyncedAt ? { installDrawingSyncedAt } : {}), ...(installAssetType ? { installAssetType } : {}), ...(installVersionLabel ? { installVersionLabel } : {}), + ...(typeof input.installOrder === 'number' && Number.isFinite(input.installOrder) + ? { installOrder: input.installOrder } + : {}), ...(typeof input.installIsCurrentVersion === 'boolean' ? { installIsCurrentVersion: input.installIsCurrentVersion } : {}), @@ -8019,6 +8023,114 @@ class IntakeNonIntegratedProductService { } } + async reorderInstallationFiles( + productId: string, + orderedFileIds: string[], + user: AuthUser, + ) { + const existingRecord = await this.repository.findActiveById(productId) + if (!existingRecord) { + throw new AppError(ErrorCode.PRODUCT_NOT_FOUND, '非集成产品不存在') + } + + assertStockWorkspaceWriteCategory( + existingRecord, + INSTALLATION_WORKSPACE_CATEGORY, + user, + ) + await intakeNonIntegratedScopeService.assertCanWriteRecord( + existingRecord, + user, + INSTALLATION_WORKSPACE_CATEGORY, + ) + + const normalizedFileIds = Array.from( + new Set( + orderedFileIds + .map((fileId) => fileId.trim()) + .filter(Boolean), + ), + ) + if (normalizedFileIds.length === 0) { + throw new AppError( + ErrorCode.VALIDATION_REQUIRED_FIELD, + '缺少安装资料排序内容', + ) + } + + const saved = await this.repository.saveActiveWithLock( + productId, + (record) => { + const payload = isRecord(record.payload) ? record.payload : null + const uploadFiles = + payload && Array.isArray(payload.uploadFiles) + ? payload.uploadFiles + : null + if (!payload || !uploadFiles) { + throw new AppError( + ErrorCode.SYSTEM_INTERNAL, + '产品资料中的上传文件数据异常', + ) + } + + const uploadFileById = new Map( + uploadFiles.flatMap((candidate) => { + if (!isRecord(candidate) || typeof candidate.id !== 'string') { + return [] + } + return [[candidate.id, candidate] as const] + }), + ) + const targetFiles = normalizedFileIds.map((fileId) => { + const file = uploadFileById.get(fileId) + if (!file || file.category !== INSTALLATION_WORKSPACE_CATEGORY) { + throw new AppError( + ErrorCode.FILE_NOT_FOUND, + '排序的安装资料不存在', + ) + } + return file + }) + const targetIds = new Set(normalizedFileIds) + let targetIndex = 0 + const nextUploadFiles = uploadFiles.map((candidate) => { + if (!isRecord(candidate) || typeof candidate.id !== 'string') { + return candidate + } + if (!targetIds.has(candidate.id)) return candidate + const nextFile = targetFiles[targetIndex] + targetIndex += 1 + return { + ...nextFile, + installOrder: targetIndex, + } + }) + const nextPayload = { + ...payload, + uploadFiles: nextUploadFiles, + updatedAt: new Date().toISOString(), + } + + return { + data: { + payload: toJsonValue(nextPayload), + updatedBy: user.id, + }, + result: nextUploadFiles, + } + }, + ) + if (saved.status !== 'saved') { + throw new AppError(ErrorCode.PRODUCT_NOT_FOUND, '产品开发明细不存在') + } + + const product = await this.getById(productId, user) + if (!product) { + throw new AppError(ErrorCode.PRODUCT_NOT_FOUND, '产品开发明细不存在') + } + return product + } + async resolveUploadFileForPreview( productId: string, selector: SharedUploadFileSelector,