fix(scripts): read container workbench payload

This commit is contained in:
2026-09-08 23:11:49 +08:00
parent 00990fedcc
commit 735b5abdcc
5 changed files with 19 additions and 6 deletions
@@ -259,7 +259,8 @@ export async function run(context) {
}
const containerDetailResponse = await context.request('GET', `${CONTAINERS}/domestic/${containerId}`)
const containerDetail = context.apiSuccess(MODULE, '回查货柜详情', containerDetailResponse, '', OPTIONS)
const containerWorkbench = context.apiSuccess(MODULE, '回查货柜详情', containerDetailResponse, '', OPTIONS)
const containerDetail = containerWorkbench?.container
context.assert(MODULE, '货柜详情保留候选货物路线约束', containerDetailResponse,
(!containerDetail?.destinationWarehouseCode || !candidate.destinationWarehouseCode
|| containerDetail.destinationWarehouseCode === candidate.destinationWarehouseCode)
@@ -399,7 +400,8 @@ export async function run(context) {
if (!unlinkedTaskAbsent) return
const simulationBeforeLinkResponse = await context.request('GET', `${CONTAINERS}/domestic/${containerId}`)
const simulationBeforeLink = context.apiSuccess(MODULE, '预装确认前读取模拟柜最新版本', simulationBeforeLinkResponse, '', OPTIONS)
const simulationWorkbench = context.apiSuccess(MODULE, '预装确认前读取模拟柜最新版本', simulationBeforeLinkResponse, '', OPTIONS)
const simulationBeforeLink = simulationWorkbench?.container
if (!Number.isInteger(Number(simulationBeforeLink?.version))) return
const bookingCreate = await request(context, 'POST', '/api/platform/v1/ocean-bookings',
@@ -590,7 +592,8 @@ export async function run(context) {
if (!taskId || !pickItem?.id) return
const releasedContainerResponse = await context.request('GET', `${CONTAINERS}/domestic/${containerId}`)
const releasedContainer = context.apiSuccess(MODULE, '任务生成后回查货柜运输版本', releasedContainerResponse, '', OPTIONS)
const releasedWorkbench = context.apiSuccess(MODULE, '任务生成后回查货柜运输版本', releasedContainerResponse, '', OPTIONS)
const releasedContainer = releasedWorkbench?.container
const stableIdentity = {
taskId, loadingPlanId: id(task.loadingPlanId), containerBookingId: id(task.containerBookingId),