chore(governance): block batch BMPA when sync-governance filters present

This commit is contained in:
萝卜
2026-03-16 22:54:19 +08:00
parent 68735ee914
commit d68d0523b1
3 changed files with 65 additions and 0 deletions

View File

@@ -80,6 +80,21 @@ class PlatformOrderToolsGuard
if ((string) ($filters['status'] ?? '') !== 'pending' || (string) ($filters['payment_status'] ?? '') !== 'unpaid') {
return '请先筛选「订单状态=待处理」且「支付状态=未支付」再执行批量 BMPA。';
}
// 互斥筛选阻断BMPA 面向“待处理+未支付”推进链路;若叠加同步治理筛选,语义会混乱,且可能误伤治理集合。
if ((string) ($filters['syncable_only'] ?? '') === '1') {
return '当前已勾选「只看可同步」:该集合语义为“已生效+未同步”,与 BMPA待处理+未支付)互斥。请先取消只看可同步后再执行。';
}
$hasSyncGovernanceFilters = ((string) ($filters['synced_only'] ?? '') === '1')
|| (trim((string) ($filters['sync_status'] ?? '')) !== '')
|| ((string) ($filters['fail_only'] ?? '') === '1')
|| (trim((string) ($filters['sync_error_keyword'] ?? '')) !== '');
if ($hasSyncGovernanceFilters) {
return '当前筛选包含「订阅同步治理」相关条件(同步状态/同步失败/失败原因等。BMPA 动作仅用于推进待处理未支付订单,请先清空同步治理筛选后再执行。';
}
if (((string) ($filters['reconcile_mismatch'] ?? '') === '1') || ((string) ($filters['refund_inconsistent'] ?? '') === '1')) {
return '当前集合包含「对账不一致/退款不一致」治理集合:建议先完成回执/退款治理后再批量推进。';
}