feat(fulfillment): 同城运费与路由修复,配送单展示商品用户地址

同城 MANUAL/ZZXFX 按小飞侠价规计费,路由查询回退仓配凭证;HQ 配送单补商品、用户和收货地址。门店核销回跳与小程序核销码一并带上。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-25 21:12:36 +08:00
parent 52a7d3789d
commit cc0c0a6ef8
44 changed files with 1029 additions and 218 deletions
@@ -90,22 +90,21 @@ export class FulfillmentProviderService {
};
}
/** 取第一个启用的小飞侠承运商配置(联调/兼容) */
/** 取第一个启用且凭证完整的小飞侠承运商配置(含 ZZXFX 等城市编码) */
async resolveDefaultXiaofeixiaConfig(): Promise<XiaofeixiaConfig | null> {
const row = await this.prisma.fulfillmentProvider.findFirst({
where: {
status: 'ACTIVE',
type: 'API',
code: { in: ['XFX', 'XIAOFEIXIA'] },
},
const rows = await this.prisma.fulfillmentProvider.findMany({
where: { status: 'ACTIVE', type: 'API' },
orderBy: { updatedAt: 'desc' },
});
if (!row?.configJson) return null;
try {
return await this.resolveXiaofeixiaConfig(row.id);
} catch {
return null;
for (const row of rows) {
if (!isXfxProviderCode(row.code) || !row.configJson) continue;
try {
return await this.resolveXiaofeixiaConfig(row.id);
} catch {
continue;
}
}
return null;
}
async create(input: CreateFulfillmentProviderInput) {