This commit is contained in:
2026-10-22 14:37:59 +08:00
parent de96e47d74
commit 760bf8daa1
49 changed files with 2450 additions and 117 deletions
@@ -1,3 +1,5 @@
import { verifyUsTruckFulfillment } from './us-truck-fulfillment.mjs'
const MODULE = 'phase4-overseas-business'
const SCENARIO = 'phase4-overseas-business-write-lifecycle'
const OPTIONS = { scenario: SCENARIO, deploymentBlocker: true }
@@ -426,8 +428,10 @@ async function truckFlow(context, customerId) {
&& histories.some((item) => String(item?.remark || '').includes(context.marker)),
`status=${historySummary?.status || 'missing'}, historyCount=${histories.length}; ${trace(history.response)}`, OPTIONS)
Object.assign(registry.truck, { version: Number(historySummary?.version), finalStatus: historySummary?.status })
await verifyUsTruckFulfillment(context, registry.truck)
} finally {
await cancelMarkerOrder(context, registry.truck, base, ['PENDING_REVIEW', 'WAITING_INBOUND'], '卡车')
// 原单保留到履约完成;失败也保留现场,避免取消掩盖未知写入结果。
registry.truck.retained = true
}
}
@@ -497,11 +501,12 @@ async function looseboardFlow(context, customerId) {
records(pending.data).some(row => row.orderNo === orderNo && id(row.customerId) === customerId
&& Number(row.version) === Number(historySummary?.version)),
trace(pending.response), OPTIONS)
context.addCoverageGap(MODULE, 'looseboard-pool-fulfillment', '散板需求池接车至签收',
'本模块验证原单进入需求池、禁止手工跳状态及取消;接车、实收、装车、签收需本轮独立车次生产链,未以手工改状态代替。', 'fixture')
if (!context.options?.modules?.includes('phase5-overseas-fulfillment')) context.addCoverageGap(MODULE, 'looseboard-pool-fulfillment', '散板需求池接车至签收',
'本模块保留原单待接车;后续由 phase5-overseas-fulfillment 复用本轮原车完成实收与签收,单独执行本模块不代表全链完成。', 'fixture')
Object.assign(registry.looseboard, { version: Number(historySummary?.version), finalStatus: historySummary?.status })
} finally {
await cancelMarkerOrder(context, registry.looseboard, base, ['PENDING_ACCEPTANCE', 'DISPATCHED'], '散板')
// 后续用原单接入本轮车次,失败保留现场,不另建替代散板单。
registry.looseboard.retained = true
}
}