优化
This commit is contained in:
@@ -262,31 +262,47 @@ export async function run(context, matrix = context.createdResources.manualState
|
||||
id: waitMeasure.orderId, status: 'WAIT_MEASURE', detailPath: `/orders/${waitMeasure.orderId}`,
|
||||
}
|
||||
|
||||
for (const status of ['MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED', 'INBOUNDED']) {
|
||||
for (const status of ['MEASURING', 'MEASURE_PENDING', 'MEASURE_REJECTED', 'WAIT_SPLIT']) {
|
||||
const sample = await prepareInboundStatus(context, status)
|
||||
result.inbounds[status] = sample
|
||||
matrix.pages.inbounds.fixtures[status] = {
|
||||
id: sample.inboundId, status, detailPath: `/orders/${sample.orderId}`,
|
||||
}
|
||||
if (status === 'INBOUNDED') {
|
||||
result.unifiedOrders.INBOUNDED = sample
|
||||
matrix.pages.unifiedOrders.fixtures.INBOUNDED = {
|
||||
if (status === 'WAIT_SPLIT') {
|
||||
result.unifiedOrders.WAIT_SPLIT = sample
|
||||
matrix.pages.unifiedOrders.fixtures.WAIT_SPLIT = {
|
||||
id: sample.orderId, status, detailPath: `/orders/${sample.orderId}`,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
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}`,
|
||||
}
|
||||
matrix.pages.unifiedOrders.fixtures.INBOUNDED = {
|
||||
id: sample.orderId, status: 'INBOUNDED', detailPath: `/orders/${sample.orderId}`,
|
||||
}
|
||||
}
|
||||
|
||||
const blockers = {
|
||||
WAIT_PRICING: '当前审核通过 API 直接写 INBOUNDED;仅异常放行开关路径可写 WAIT_PRICING',
|
||||
WAIT_PRICING: '审核通过先进入 WAIT_PRICING,但自动计费与入库编排会继续推进,不能稳定停留',
|
||||
FEE_CONFIRMING: '需要先取得可匹配的真实计价快照并停在费用确认前',
|
||||
INBOUNDING: 'AutomaticInboundCompletionService 在同一调用内立即从 INBOUNDING 推进 INBOUNDED,无可暂停 API',
|
||||
INBOUNDING: 'AutomaticInboundCompletionService 在同一调用内立即从 INBOUNDING 推进 WAIT_SPLIT,无可暂停 API',
|
||||
VOIDED: 'InboundProcessStatus 声明了 VOIDED,但当前 Controller/Service 没有作废入库单 API',
|
||||
}
|
||||
for (const status of INBOUND_FILTER_STATUSES) if (!matrix.pages.inbounds.fixtures[status]) {
|
||||
context.assert(MODULE, `入库列表保留 ${status}`, null, false, blockers[status], OPTIONS)
|
||||
}
|
||||
const unifiedBlockers = {
|
||||
WAIT_SPLIT: '服务端已将 WAIT_SPLIT 标记为历史废弃状态,查询时统一归一为 INBOUNDED,不能再写入或返回',
|
||||
LOADING: '需要分柜、排柜及 PDA 专项独立样本',
|
||||
LOADED: '需要完成装柜证据和 PDA 门禁的专项独立样本',
|
||||
DELIVERED: '当前后端没有完成派送并写 DELIVERED 的公开业务 API',
|
||||
|
||||
Reference in New Issue
Block a user