fix(overseas): preserve shared overflow locations during pallet moves
This commit is contained in:
@@ -101,8 +101,11 @@ async function resolvePallet(context, token, palletCode, name = '扫码解析托
|
||||
async function resolvePublicLocation(context, fixture, sourceLocationCode) {
|
||||
const response = await context.requestOverseas('GET',
|
||||
`/api/platform/v1/warehouse-admin/${encodeURIComponent(fixture.overseasWarehouseId)}/locations?page=1&size=200`)
|
||||
const location = records(response?.body?.data).find((item) => ['STORAGE', 'NORMAL'].includes(item?.locationType)
|
||||
&& item?.status === 'IDLE' && item?.locationCode !== sourceLocationCode)
|
||||
const locations = records(response?.body?.data)
|
||||
const location = locations.find((item) => item?.locationType === 'SHARED_OVERFLOW'
|
||||
&& item?.locationCode === 'A0' && item?.status === 'ACTIVE' && item.locationCode !== sourceLocationCode)
|
||||
|| locations.find((item) => ['STORAGE', 'NORMAL'].includes(item?.locationType)
|
||||
&& item?.status === 'IDLE' && item?.locationCode !== sourceLocationCode)
|
||||
context.addStep(MODULE, '复用当前海外仓公共库位', response,
|
||||
success(response) && longId(id(location?.id)) && nonBlank(location?.locationCode),
|
||||
`locationId=${id(location?.id) || 'missing'}, locationCode=${location?.locationCode || 'missing'}; ${trace(response)}`, OPTIONS)
|
||||
@@ -546,10 +549,13 @@ async function verifyRelabel(context, token, merchantToken, fixture) {
|
||||
const reworked = await request(context, context.overseasToken, 'POST', 'P5平台复核退回REWORK', reviewPath, reworkBody)
|
||||
if (!success(reworked.response)) return false
|
||||
const reworkReplay = await request(context, context.overseasToken, 'POST', 'P5 REWORK同键重放', reviewPath, reworkBody)
|
||||
context.assert(MODULE, 'P5 REWORK重放保持PROCESSING', reworkReplay.response,
|
||||
reworkReplay.data?.taskStatus === 'PROCESSING' && Number(reworkReplay.data.relabelledPackages) === 0,
|
||||
context.assert(MODULE, 'P5 REWORK重放保持AVAILABLE等待重新认领', reworkReplay.response,
|
||||
reworkReplay.data?.taskStatus === 'AVAILABLE' && Number(reworkReplay.data.relabelledPackages) === 0,
|
||||
trace(reworkReplay.response), OPTIONS)
|
||||
detail = reworked.data
|
||||
const reclaimed = await request(context, token, 'POST', 'P5重新认领返工任务',
|
||||
`${pdaBase}/${encodeURIComponent(relabelNo)}/claim`, { idempotencyKey: key(context, 'RELABEL-REWORK-CLAIM') })
|
||||
if (!success(reclaimed.response) || reclaimed.data?.taskStatus !== 'PROCESSING') return false
|
||||
detail = reclaimed.data
|
||||
for (const redoItem of detail.items || []) {
|
||||
if (redoItem.operationType === 'CARTON_AND_SKU') {
|
||||
const carton = await request(context, token, 'POST', 'P5返工重新确认箱标阶段',
|
||||
|
||||
Reference in New Issue
Block a user