This commit is contained in:
2026-09-03 11:47:32 +08:00
parent 246cbc115e
commit d8b59ecca5
11 changed files with 314 additions and 119 deletions
@@ -83,6 +83,7 @@ export interface UnifiedOrderCoLoadGroupSummary {
export interface UnifiedOrderResource {
orderId: number | string
orderVersion?: number | null
tenantId: number | string
orderNo: string | null
mainStatus: UnifiedOrderMainStatus
@@ -103,6 +104,7 @@ export interface UnifiedOrderResource {
inboundCode: string | null
expectedShipDate: string | null
totalPackageCount: number | null
estimatedVolumeCbm?: number | null
expectedVolumeCbm?: number | null
locationCodes: string | null
actualGrossWeightKg: number | null
@@ -362,6 +364,7 @@ export interface UpdateUnifiedOrderDeclarationRequest {
expectedVersion: number
customerRemark?: string | null
expectedArrivalAt?: string | null
estimatedVolumeCbm?: number | null
channelCode: string
channelName: string
cargoes: UnifiedOrderDeclarationCargo[]
@@ -384,6 +387,12 @@ export interface UpdateUnifiedOrderDeclarationResult {
changes: UnifiedOrderDeclarationChange[]
}
export interface UpdateUnifiedOrderPlanningRequest {
expectedVersion: number
expectedArrivalAt?: string | null
estimatedVolumeCbm?: number | null
}
function optionalText(value: string | null | undefined) {
const normalized = value?.trim()
return normalized || null
@@ -397,6 +406,7 @@ function normalizeRow(raw: UnifiedOrderResource): UnifiedOrderResource {
return {
...raw,
orderId: String(raw.orderId),
orderVersion: nullableInteger(raw.orderVersion),
tenantId: String(raw.tenantId),
customerId: id(raw.customerId),
channelCode: optionalText(raw.channelCode),
@@ -412,6 +422,7 @@ function normalizeRow(raw: UnifiedOrderResource): UnifiedOrderResource {
childCount: integer(raw.relation.childCount, 0),
} : null,
totalPackageCount: nullableInteger(raw.totalPackageCount),
estimatedVolumeCbm: numberValue(raw.estimatedVolumeCbm),
expectedVolumeCbm: numberValue(raw.expectedVolumeCbm),
channelChanged: Boolean(raw.channelChanged),
actualGrossWeightKg: numberValue(raw.actualGrossWeightKg),
@@ -492,6 +503,18 @@ export function updatePlatformUnifiedOrderDeclaration(
).then(unwrapApiResponse)
}
export function updatePlatformUnifiedOrderPlanning(
tenantId: string,
orderId: string,
request: UpdateUnifiedOrderPlanningRequest,
) {
return http.put<ApiEnvelope<UpdateUnifiedOrderDeclarationResult>, ApiEnvelope<UpdateUnifiedOrderDeclarationResult>>(
`${unifiedOrdersApiPath}/${orderId}/planning`,
request,
{ params: { tenantId } },
).then(unwrapApiResponse)
}
export function downloadPlatformProductImage(tenantId: string, fileId: string) {
return http.get<Blob, Blob>(
`/platform/v1/files/product-images/${encodeURIComponent(tenantId)}/${encodeURIComponent(fileId)}`,