优化订单履约分流与后台筛选
This commit is contained in:
@@ -480,23 +480,29 @@ async function syncOpen91OrderAfterSendCallbackSuccess(
|
||||
}
|
||||
|
||||
const tasks = await listTasksByOrderId(order.id)
|
||||
if (tasks.length > 0) {
|
||||
await bindKuaishouIndustryVouchersToOrderTasks(order, tasks, {
|
||||
source,
|
||||
now: normalizeTimestampIso(new Date().toISOString()),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await retryOpen91Order(order.id)
|
||||
const synchronizedTasks = result.tasks.length > 0 ? result.tasks : tasks
|
||||
if (synchronizedTasks.length > 0) {
|
||||
await bindKuaishouIndustryVouchersToOrderTasks(order, synchronizedTasks, {
|
||||
source,
|
||||
now: normalizeTimestampIso(new Date().toISOString()),
|
||||
})
|
||||
}
|
||||
logIntegration('[kuaishou-industry/send-code]', '电子凭证发货回调成功后已触发 91 订单重试', {
|
||||
source,
|
||||
oid: normalizedOid,
|
||||
orderId: order.id,
|
||||
taskCount: result.tasks.length,
|
||||
previousTaskCount: tasks.length,
|
||||
})
|
||||
} catch (error) {
|
||||
if (tasks.length > 0) {
|
||||
await bindKuaishouIndustryVouchersToOrderTasks(order, tasks, {
|
||||
source,
|
||||
now: normalizeTimestampIso(new Date().toISOString()),
|
||||
})
|
||||
}
|
||||
if (isOpen91OrderAwaitingFulfillmentConfig(error)) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user