优化
This commit is contained in:
@@ -17,7 +17,7 @@ test('retains all clickable container, loading-list and PDA workflow states thro
|
||||
assert.match(source, /\.\/orders\.mjs/)
|
||||
assert.match(source, /\.\/inbound-measurement\.mjs/)
|
||||
assert.doesNotMatch(source, /context\.request\('POST', CONTAINERS/)
|
||||
assert.match(source, /\['WAIT_SPLIT', 'INBOUNDED'\]\.includes/)
|
||||
assert.match(source, /summary\?\.processStatus === 'WAIT_SPLIT'/)
|
||||
const batch = source.slice(source.indexOf('async function pickAll'), source.indexOf('async function complete'))
|
||||
assert.doesNotMatch(batch, /containerNo:/)
|
||||
})
|
||||
|
||||
@@ -88,7 +88,7 @@ async function readInbound(context, fixture) {
|
||||
const value = context.apiSuccess(MODULE, '读取人工装柜独立入库单', response, '', OPTIONS)
|
||||
const warehouseId = id(value?.summary?.warehouseId)
|
||||
context.assert(MODULE, '人工装柜来源入库单可独立排柜', response,
|
||||
['WAIT_SPLIT', 'INBOUNDED'].includes(value?.summary?.processStatus)
|
||||
value?.summary?.processStatus === 'WAIT_SPLIT'
|
||||
&& value?.summary?.measureReviewStatus === 'APPROVED'
|
||||
&& Boolean(warehouseId),
|
||||
`inboundId=${fixture.inboundId}, status=${value?.summary?.processStatus || 'missing'}`, OPTIONS)
|
||||
|
||||
@@ -39,8 +39,8 @@ test('入库不可独立保留状态显式阻断', () => {
|
||||
assert.match(source, new RegExp(`${status}:`))
|
||||
}
|
||||
assert.match(source, /AutomaticInboundCompletionService 在同一调用内立即从 INBOUNDING 推进 WAIT_SPLIT/)
|
||||
assert.match(source, /processStatus=INBOUNDED/)
|
||||
assert.match(source, /查询存量 INBOUNDED 兼容样本/)
|
||||
assert.match(source, /processStatus=WAIT_SPLIT/)
|
||||
assert.match(source, /查询存量 WAIT_SPLIT 样本/)
|
||||
assert.match(source, /没有作废入库单 API/)
|
||||
assert.match(source, /context\.assert\(MODULE, `入库列表保留 \$\{status\}`/)
|
||||
})
|
||||
@@ -48,7 +48,7 @@ test('入库不可独立保留状态显式阻断', () => {
|
||||
test('统一订单声明合法可达状态并显式阻断废弃或无 API 状态', () => {
|
||||
assert.match(source, /result\.unifiedOrders\.PENDING_REVIEW/)
|
||||
assert.match(source, /result\.unifiedOrders\.WAIT_MEASURE/)
|
||||
for (const status of ['INBOUNDED', 'WAIT_SPLIT', 'LOADING', 'LOADED', 'DELIVERED']) {
|
||||
for (const status of ['WAIT_SPLIT', 'LOADING', 'LOADED', 'DELIVERED']) {
|
||||
assert.match(source, new RegExp(`'${status}'`))
|
||||
}
|
||||
assert.doesNotMatch(source, /WAIT_SPLIT 标记为历史废弃状态/)
|
||||
|
||||
@@ -15,10 +15,10 @@ const ORDER_TARGETS = [
|
||||
]
|
||||
const INBOUND_FILTER_STATUSES = [
|
||||
'WAIT_MEASURE', 'MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED', 'WAIT_PRICING',
|
||||
'FEE_CONFIRMING', 'INBOUNDING', 'INBOUNDED', 'VOIDED',
|
||||
'FEE_CONFIRMING', 'INBOUNDING', 'WAIT_SPLIT', 'VOIDED',
|
||||
]
|
||||
const UNIFIED_FILTER_STATUSES = [
|
||||
'PENDING_REVIEW', 'WAIT_MEASURE', 'INBOUNDED', 'WAIT_SPLIT', 'LOADING', 'LOADED', 'DELIVERED',
|
||||
'PENDING_REVIEW', 'WAIT_MEASURE', 'WAIT_SPLIT', 'LOADING', 'LOADED', 'DELIVERED',
|
||||
]
|
||||
|
||||
function id(value) { return value == null ? '' : String(value) }
|
||||
@@ -277,19 +277,19 @@ export async function run(context, matrix = context.createdResources.manualState
|
||||
}
|
||||
|
||||
const legacyResponse = await context.request('GET',
|
||||
`/api/platform/v1/inbounds?tenantId=${query(fixture.tenantId)}&processStatus=INBOUNDED&page=1&size=20`)
|
||||
const legacyPage = context.apiSuccess(MODULE, '查询存量 INBOUNDED 兼容样本', legacyResponse, '', OPTIONS)
|
||||
`/api/platform/v1/inbounds?tenantId=${query(fixture.tenantId)}&processStatus=WAIT_SPLIT&page=1&size=20`)
|
||||
const legacyPage = context.apiSuccess(MODULE, '查询存量 WAIT_SPLIT 样本', legacyResponse, '', OPTIONS)
|
||||
const legacyInbound = rows(legacyPage)[0]
|
||||
if (legacyInbound?.id && legacyInbound?.orderId) {
|
||||
const sample = { inboundId: id(legacyInbound.id), orderId: id(legacyInbound.orderId), tenantId: fixture.tenantId,
|
||||
status: 'INBOUNDED', inboundCode: legacyInbound.inboundCode || null }
|
||||
result.inbounds.INBOUNDED = sample
|
||||
result.unifiedOrders.INBOUNDED = sample
|
||||
matrix.pages.inbounds.fixtures.INBOUNDED = {
|
||||
id: sample.inboundId, status: 'INBOUNDED', detailPath: `/orders/${sample.orderId}`,
|
||||
status: 'WAIT_SPLIT', inboundCode: legacyInbound.inboundCode || null }
|
||||
result.inbounds.WAIT_SPLIT = sample
|
||||
result.unifiedOrders.WAIT_SPLIT = sample
|
||||
matrix.pages.inbounds.fixtures.WAIT_SPLIT = {
|
||||
id: sample.inboundId, status: 'WAIT_SPLIT', detailPath: `/orders/${sample.orderId}`,
|
||||
}
|
||||
matrix.pages.unifiedOrders.fixtures.INBOUNDED = {
|
||||
id: sample.orderId, status: 'INBOUNDED', detailPath: `/orders/${sample.orderId}`,
|
||||
matrix.pages.unifiedOrders.fixtures.WAIT_SPLIT = {
|
||||
id: sample.orderId, status: 'WAIT_SPLIT', detailPath: `/orders/${sample.orderId}`,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function run(context) {
|
||||
`tenantId=${tenantId}, inboundId=${inboundId}`, OPTIONS)
|
||||
const warehouseId = id(inbound?.summary?.warehouseId)
|
||||
context.assert(MODULE, '柜次候选入库单状态、测量和仓库门禁有效', inboundResponse,
|
||||
['WAIT_SPLIT', 'INBOUNDED'].includes(inbound?.summary?.processStatus)
|
||||
inbound?.summary?.processStatus === 'WAIT_SPLIT'
|
||||
&& inbound?.summary?.measureReviewStatus === 'APPROVED'
|
||||
&& Boolean(warehouseId),
|
||||
`status=${inbound?.summary?.processStatus || 'missing'}, review=${inbound?.summary?.measureReviewStatus || 'missing'}, warehouseId=${warehouseId || 'missing'}`, OPTIONS)
|
||||
|
||||
@@ -108,9 +108,9 @@ export async function run(context) {
|
||||
const initialStatus = initial?.summary?.processStatus
|
||||
const initialVersion = Number(initial?.summary?.version)
|
||||
context.assert(MODULE, '隔离入库单处于智能分柜门禁状态', initialResponse,
|
||||
['INBOUNDED', 'WAIT_SPLIT'].includes(initialStatus) && Number.isInteger(initialVersion),
|
||||
initialStatus === 'WAIT_SPLIT' && Number.isInteger(initialVersion),
|
||||
`status=${initialStatus || 'missing'}, version=${initial?.summary?.version ?? 'missing'}`, OPTIONS)
|
||||
if (!['INBOUNDED', 'WAIT_SPLIT'].includes(initialStatus) || !Number.isInteger(initialVersion)) return
|
||||
if (initialStatus !== 'WAIT_SPLIT' || !Number.isInteger(initialVersion)) return
|
||||
|
||||
const base = `/api/platform/v1/inbounds/${inboundId}`
|
||||
const suffix = context.marker.replace(/\D/g, '').slice(-10)
|
||||
@@ -168,7 +168,7 @@ export async function run(context) {
|
||||
const smartData = context.apiSuccess(MODULE, '智能分柜并生成预装清单', smart, `inboundId=${inboundId}`, OPTIONS)
|
||||
const planId = id(smartData?.preloadPlan?.id)
|
||||
context.assert(MODULE, '智能分柜预装计划 PENDING、版本和明细正确', smart,
|
||||
smartData?.mainStatus === 'INBOUNDED' && Boolean(planId) && smartData?.preloadPlan?.status === 'PENDING'
|
||||
smartData?.mainStatus === 'WAIT_SPLIT' && Boolean(planId) && smartData?.preloadPlan?.status === 'PENDING'
|
||||
&& Number(smartData?.preloadPlan?.version) === 0 && smartData?.preloadPlan?.items?.length === 1,
|
||||
`mainStatus=${smartData?.mainStatus || 'missing'}, planId=${planId || 'missing'}, status=${smartData?.preloadPlan?.status || 'missing'}`, OPTIONS)
|
||||
if (!planId) return
|
||||
|
||||
Reference in New Issue
Block a user