优化
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user