This commit is contained in:
2026-10-21 21:30:24 +08:00
parent 234216b3eb
commit 5356a8c898
28 changed files with 1543 additions and 45 deletions
@@ -56,6 +56,13 @@ async function resolveListedBusiness(context, base, resource, customerId, label)
return longId(row?.id) ? { businessId: id(row.id), businessNo: row.orderNo, customerId } : null
}
export function selectCurrentInboundPlan(plans, pda, marker) {
if (!pda || pda.marker !== marker || !longId(pda.customerId)) return null
const ids = new Set(rows(pda.generatedPlanIds).map(id))
return rows(plans).find(item => ids.has(id(item?.planId || item?.id))
&& id(item?.customerId) === id(pda.customerId) && item?.planNo) || null
}
async function resolveFixtures(context) {
const business = context.createdResources?.phase4OverseasBusiness
const merchantCustomerId = id(context.createdResources?.merchantQualificationFixture?.tenantId
@@ -76,7 +83,7 @@ async function resolveFixtures(context) {
if (longId(inboundCustomerId)) {
const listed = await overseas(context, 'GET', '查询本轮客户海外入仓计划',
`/api/platform/v1/last-leg/inbound-plans?page=1&size=200&customerId=${encodeURIComponent(inboundCustomerId)}`)
const plan = rows(listed.data).find((item) => longId(item?.planId || item?.id) && item?.planNo)
const plan = selectCurrentInboundPlan(listed.data, pda, context.marker)
context.assert(MODULE, '海外入仓费用关联真实计划', listed.response,
Boolean(plan) && longId(plan?.planId || plan?.id),
`planId=${id(plan?.planId || plan?.id) || 'missing'}, planNo=${plan?.planNo || 'missing'}; ${trace(listed.response)}`, OPTIONS)