fix: restore phase five development acceptance chain

This commit is contained in:
2026-09-01 21:55:27 +08:00
parent 04e0111756
commit ad5e0812bf
35 changed files with 623 additions and 313 deletions
@@ -75,12 +75,16 @@ export function truckAppointmentPayload(context, suffix, identity, version = 0,
}
async function activeSupplier(context, category, suffix) {
const list = await request(context, 'GET', `/api/platform/v1/suppliers?tenantId=0&category=${category}&status=ACTIVE&page=1&size=100`)
const existing = records(data(list)).find((item) => item?.category === category && item?.status === 'ACTIVE')
const carrierFilter = category === 'BOOKING' ? '&carrierCode=MATSON' : ''
const list = await request(context, 'GET', `/api/platform/v1/suppliers?tenantId=0&category=${category}&status=ACTIVE${carrierFilter}&page=1&size=100`)
const existing = records(data(list)).find((item) => item?.category === category && item?.status === 'ACTIVE'
&& (category !== 'BOOKING' || item?.carrierCodes?.includes?.('MATSON')))
if (existing) return { supplierId: id(existing.id), supplierName: existing.name }
const created = await request(context, 'POST', '/api/platform/v1/suppliers?tenantId=0', {
name: `${category}-验收-${suffix}`, category, carrierCodes: category === 'BOOKING' ? ['MATSON'] : [],
region: '深圳', contactName: '验收联系人', phone: '13800000000', status: 'ACTIVE', remark: context.marker,
region: '深圳', legalRepresentative: '验收法人', contactName: '验收联系人', phone: '13800000000',
email: 'truck-acceptance@example.com', address: '深圳市验收地址', businessLicenseNo: `TRUCK-${suffix}`.slice(0, 64),
licenseFileId: null, status: 'ACTIVE', settlementPeriod: 'MONTHLY_30', remark: context.marker,
})
const value = data(created); const supplierId = id(value?.id || value)
context.apiSuccess(MODULE, `创建 ACTIVE ${category} 供应商`, created, '', OPTIONS)