fix: count deliveries awaiting customer signature
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -145,9 +145,9 @@ test('replacement trips come exclusively from linked delivery records', () => {
|
||||
assert.doesNotMatch(FLOW_STATS_SQL, /FROM vehicle_replacement|dv\.delivery_time|r\.arrival_time|vr\.replace_time/);
|
||||
});
|
||||
|
||||
test('completed delivery and replacement trips use vehicle status and exclude suspended subjects', () => {
|
||||
test('delivery and replacement trips include awaiting customer signature and exclude suspended subjects', () => {
|
||||
const [deliveries, returns] = FLOW_STATS_SQL.split('UNION ALL');
|
||||
assert.ok(deliveries.includes('AND dv.delivery_status IN (2,3,20)'));
|
||||
assert.ok(deliveries.includes('AND dv.delivery_status IN (2,3,5,20)'));
|
||||
assert.ok(deliveries.includes('AND (dts.status IS NULL OR dts.status <> 10)'));
|
||||
assert.doesNotMatch(deliveries, /dts\.status\s*(?:=|IN)|dv\.delivery_status IN \(2,3,5\)/);
|
||||
assert.ok(returns.includes('AND r.status IN (2,3,5)'));
|
||||
|
||||
@@ -239,7 +239,8 @@ export const FLOW_STATS_SQL = `
|
||||
WHERE dv.del_flag = '0'
|
||||
AND dv.vehicle_id IS NOT NULL
|
||||
AND dv.delivery_completion_processed_time IS NOT NULL
|
||||
AND dv.delivery_status IN (2,3,20)
|
||||
-- 待客户签章也计入交车闭环,日期仍按运维签章时间归属。
|
||||
AND dv.delivery_status IN (2,3,5,20)
|
||||
AND (dts.status IS NULL OR dts.status <> 10)
|
||||
AND dv.delivery_completion_processed_time >= ?
|
||||
AND dv.delivery_completion_processed_time < DATE_ADD(?, INTERVAL 1 DAY)
|
||||
|
||||
Reference in New Issue
Block a user