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
@@ -465,9 +465,11 @@ export class TradeService {
operator: 'MOCK_PAY',
}),
});
await tx.orderDelivery.create({
data: { orderId: order.id, provider: 'MANUAL' },
});
if (order.deliveryType !== 'ON_SITE_PICKUP') {
await tx.orderDelivery.create({
data: { orderId: order.id, provider: 'MANUAL' },
});
}
});
await this.afterOrderPaid(order.id);
@@ -516,6 +518,12 @@ export class TradeService {
);
}
if (order.deliveryType === 'ON_SITE_PICKUP') {
// 现场取货:支付即完成,不建配送单、不推仓配
this.wechatOrderShipping.uploadForOrderSafe(orderId);
return;
}
const delivery = await this.prisma.orderDelivery.findUnique({ where: { orderId } });
if (!delivery) {
await this.prisma.orderDelivery.create({
@@ -523,12 +531,6 @@ export class TradeService {
});
}
if (order.deliveryType === 'ON_SITE_PICKUP') {
// 现场取货:支付后即向微信录入「用户自提」发货信息
this.wechatOrderShipping.uploadForOrderSafe(orderId);
return;
}
await this.fulfillmentService.dispatchAfterPay(orderId);
const refreshed = await this.prisma.order.findUnique({ where: { id: orderId } });
if (refreshed?.status === 'PENDING_SHIP') {
@@ -619,11 +621,13 @@ export class TradeService {
operator: 'WECHAT_PAY',
}),
});
const delivery = await tx.orderDelivery.findUnique({ where: { orderId: order.id } });
if (!delivery) {
await tx.orderDelivery.create({
data: { orderId: order.id, provider: 'MANUAL' },
});
if (order.deliveryType !== 'ON_SITE_PICKUP') {
const delivery = await tx.orderDelivery.findUnique({ where: { orderId: order.id } });
if (!delivery) {
await tx.orderDelivery.create({
data: { orderId: order.id, provider: 'MANUAL' },
});
}
}
});
@@ -2625,11 +2629,13 @@ export class TradeService {
operator,
}),
});
const delivery = await tx.orderDelivery.findUnique({ where: { orderId: order.id } });
if (!delivery) {
await tx.orderDelivery.create({
data: { orderId: order.id, provider: 'MANUAL' },
});
if (order.deliveryType !== 'ON_SITE_PICKUP') {
const delivery = await tx.orderDelivery.findUnique({ where: { orderId: order.id } });
if (!delivery) {
await tx.orderDelivery.create({
data: { orderId: order.id, provider: 'MANUAL' },
});
}
}
});