This commit is contained in:
2026-09-04 12:18:36 +08:00
parent 566b07be62
commit b697e4c9f0
51 changed files with 1898 additions and 623 deletions
@@ -243,9 +243,22 @@ export async function run(context) {
inboundId, inboundDetailId: id(candidate.inboundDetailId), packageCount: 1,
expectedVersion: Number(foreignPlan?.version), operationId: `${context.marker}-other-channel-assign`.slice(0, 128),
})
context.addStep(MODULE, '两个真实有效渠道之间拒绝跨渠道装柜', foreignAssignResponse,
foreignAssignResponse.http === 200 && ['A0422', '422'].includes(codeOf(foreignAssignResponse)),
const foreignAssigned = foreignAssignResponse.body?.data
const foreignItem = Array.isArray(foreignAssigned?.items)
? foreignAssigned.items.find((item) => id(item.inboundId) === inboundId
&& id(item.inboundDetailId) === id(candidate.inboundDetailId))
: null
context.addStep(MODULE, '手工装柜允许两个真实有效渠道之间跨渠道分配', foreignAssignResponse,
foreignAssignResponse.http === 200 && codeOf(foreignAssignResponse) === '200' && Boolean(foreignItem?.id),
`primary=${channelCode}, foreign=${foreignChannel.channelCode}, HTTP=${foreignAssignResponse.http}, code=${codeOf(foreignAssignResponse)}`, OPTIONS)
if (foreignItem?.id) {
const foreignRemoveResponse = await request(context, 'DELETE',
`${SMART}/plans/${foreignPlan?.id}/items/${foreignItem.id}`, {
expectedPlanVersion: Number(foreignAssigned.version), expectedItemVersion: Number(foreignItem.version),
operationId: `${context.marker}-other-channel-remove`.slice(0, 128),
})
context.apiSuccess(MODULE, '跨渠道分配验收后释放入仓码供主流程继续', foreignRemoveResponse, '', OPTIONS)
}
}
const containerDetailResponse = await context.request('GET', `${CONTAINERS}/${containerId}`)
@@ -681,8 +694,7 @@ export async function run(context) {
const batchPath = `${PDA}/tasks/${taskId}/batch`
const batchItems = [{ itemId: id(pickItem.id), action: 'PICK', pickedPackageCount: 1,
finalPickedPackageCount: null, releaseMode: 'MANUAL', locationIds: [],
version: Number(pickItem.version), reason: null }]
finalPickedPackageCount: null, version: Number(pickItem.version), reason: null }]
const staleBatchResponse = await request(context, 'POST', batchPath, {
warehouseId, loadingPlanId: planId, containerBookingId: containerId,
expectedVersion: Number(task.version) + 1,