feat(consignment): 自动匹配改为进入待抢单前一次性匹配
1) 配置改为开启自动匹配 + 匹配订单生效时间,移除内部匹配等待与定时轮询;2) 所有进入待抢单的路径统一先自动匹配一次,未命中进大厅;3) 手动匹配仅允许待抢单;4) 新增迁移 160 回填配置并迁移存量 internal_matching。
This commit is contained in:
@@ -669,11 +669,8 @@ export async function settleOverdueWorkOrder(input: {
|
||||
}
|
||||
}
|
||||
|
||||
const targetStatus = isRematch
|
||||
? 'internal_matching'
|
||||
: input.policy === 'reopen'
|
||||
? 'open'
|
||||
: 'cancelled'
|
||||
// 重匹配不再进入内部匹配池:超时结算后先回到待抢单,由超时服务立即试一次自动匹配。
|
||||
const targetStatus = isRematch || input.policy === 'reopen' ? 'open' : 'cancelled'
|
||||
|
||||
await client.query(
|
||||
`
|
||||
@@ -686,8 +683,7 @@ export async function settleOverdueWorkOrder(input: {
|
||||
${CLEAR_DELIVERY_RESIDUE_SQL},
|
||||
published_at = CASE WHEN $1 = 'open' THEN $2 ELSE published_at END,
|
||||
hall_queued_at = CASE WHEN $1 = 'open' THEN $2 ELSE hall_queued_at END,
|
||||
-- 重新匹配由 startConsignmentRematch 补正式截止时间;这里先写 1 分钟兜底,
|
||||
-- 即使后续补写失败,超时任务也能把工单发回大厅,不会永久悬空。
|
||||
-- 重匹配也先回到 open,由超时服务立即尝试自动匹配;未命中就是待抢单。
|
||||
internal_match_deadline_at = CASE
|
||||
WHEN $1 = 'internal_matching' THEN ($2::timestamptz + INTERVAL '1 minute')
|
||||
ELSE internal_match_deadline_at END,
|
||||
|
||||
Reference in New Issue
Block a user