Merge remote-tracking branch 'origin/test' into dev
# Conflicts: # order/AGENTS.md
This commit is contained in:
@@ -240,9 +240,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}`)
|
||||
@@ -678,8 +691,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,
|
||||
|
||||
Reference in New Issue
Block a user