refactor(batch): 重复投递阻断warning文案带出run_id短展示

This commit is contained in:
萝卜
2026-03-17 18:35:15 +08:00
parent e937946011
commit ca3c10486a

View File

@@ -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