From ca3c10486ac9f8bfc047e8ea6d4b1be7195f31da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 18:35:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor(batch):=20=E9=87=8D=E5=A4=8D=E6=8A=95?= =?UTF-8?q?=E9=80=92=E9=98=BB=E6=96=ADwarning=E6=96=87=E6=A1=88=E5=B8=A6?= =?UTF-8?q?=E5=87=BArun=5Fid=E7=9F=AD=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/PlatformOrderController.php | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 44d6272..7ec1df7 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -1632,9 +1632,19 @@ class PlatformOrderController extends Controller $existing = (string) (\App\Support\BatchDispatchLock::getExistingValue($lockKey) ?? ''); $existing = trim($existing); - $res = redirect()->back()->with('warning', '检测到刚刚已提交过同一批次的 BAS 任务(1 分钟内)。为避免重复投递,本次未再次提交。'); + $warningMsg = '检测到刚刚已提交过同一批次的 BAS 任务(1 分钟内)。为避免重复投递,本次未再次提交。'; + + // 若锁内已有 run_id(作为 value 存储),则在提示中带出 run_id(短展示)并给运营一个直达复盘入口。 + if ($existing !== '' && str_starts_with($existing, 'BAS')) { + $display = $existing; + if (strlen($display) > 16) { + $display = substr($display, 0, 6) . '…' . substr($display, -4); + } + $warningMsg = '检测到刚刚已提交过同一批次的 BAS 任务(1 分钟内,run_id=' . $display . ')。为避免重复投递,本次未再次提交。'; + } + + $res = redirect()->back()->with('warning', $warningMsg); - // 若锁内已有 run_id(作为 value 存储),则给运营一个直达复盘入口。 if ($existing !== '' && str_starts_with($existing, 'BAS')) { $res = $res ->with('warning_link_href', '/admin/platform-batches/show?type=bas&run_id=' . urlencode($existing)) @@ -1786,7 +1796,17 @@ class PlatformOrderController extends Controller $existing = (string) (\App\Support\BatchDispatchLock::getExistingValue($lockKey) ?? ''); $existing = trim($existing); - $res = redirect()->back()->with('warning', '检测到刚刚已提交过同一批次的 BMPA 任务(1 分钟内)。为避免重复投递,本次未再次提交。'); + $warningMsg = '检测到刚刚已提交过同一批次的 BMPA 任务(1 分钟内)。为避免重复投递,本次未再次提交。'; + + if ($existing !== '' && str_starts_with($existing, 'BMPA')) { + $display = $existing; + if (strlen($display) > 16) { + $display = substr($display, 0, 7) . '…' . substr($display, -4); + } + $warningMsg = '检测到刚刚已提交过同一批次的 BMPA 任务(1 分钟内,run_id=' . $display . ')。为避免重复投递,本次未再次提交。'; + } + + $res = redirect()->back()->with('warning', $warningMsg); if ($existing !== '' && str_starts_with($existing, 'BMPA')) { $res = $res