补齐揽收单字段/并发戳与问题件处理人配置,扩展异常工作流与下单同步揽收出参;移除已收货状态并补充相关 SQL 脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
558 B
SQL
15 lines
558 B
SQL
-- 废弃订单状态 received(已收货):入库后直接进 pendingAllocation / pendingPayment,不再停留 received
|
||
-- 历史数据:已入库的归待排货;若已有应付且未支付则归待支付
|
||
|
||
UPDATE `t_order`
|
||
SET
|
||
`OrderStatus` = CASE
|
||
WHEN IFNULL(`IsPaid`, 0) > 0 THEN 'pendingShip'
|
||
WHEN IFNULL(`PayableAmount`, 0) > 0
|
||
AND (`AllocationPendingReason` IS NULL OR TRIM(`AllocationPendingReason`) = '')
|
||
THEN 'pendingPayment'
|
||
ELSE 'pendingAllocation'
|
||
END,
|
||
`UpdateTime` = NOW()
|
||
WHERE `OrderStatus` = 'received';
|