This commit is contained in:
2026-09-09 13:51:14 +08:00
parent 41924a438c
commit 08a1f1e5e2
4 changed files with 52 additions and 3 deletions
@@ -97,7 +97,15 @@ export async function getDeliveryOrder(deliveryNo: string, customerId: string) {
const response = await overseasHttp.get<ApiEnvelope<DeliveryOrderDetail>, ApiEnvelope<DeliveryOrderDetail>>(
`/platform/v1/last-leg/delivery-orders/${encodeURIComponent(deliveryNo)}`, { params: { customerId, page: 1, size: 200 } },
)
return unwrapApiResponse(response)
const detail = unwrapApiResponse(response)
// Java Long values are serialized as decimal strings, including the version.
const rawVersion: unknown = detail.order.version
const version = typeof rawVersion === 'string' && /^(0|[1-9]\d*)$/.test(rawVersion)
? Number(rawVersion) : rawVersion
if (typeof version !== 'number' || !Number.isSafeInteger(version) || version < 0) {
throw new Error('派送单缺少有效版本,请刷新后重试')
}
return { ...detail, order: { ...detail.order, version } }
}
export async function listDeliveryReturnInboundOptions(deliveryNo: string, customerId: string) {