增加了手机操作端

This commit is contained in:
wushumin
2026-05-15 14:01:36 +08:00
parent 9aac78b8da
commit dd56e0861b
107 changed files with 23547 additions and 346 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace app\queue\redis;
use app\support\MaterialBatchPackageService;
use support\Log;
use Webman\RedisQueue\Consumer;
class MaterialBatchPackageConsumer implements Consumer
{
public string $queue = MaterialBatchPackageService::QUEUE_NAME;
public string $connection = 'default';
public function consume($data): void
{
$batchId = (int)($data['batch_id'] ?? 0);
if ($batchId <= 0) {
return;
}
try {
(new MaterialBatchPackageService())->generateForBatchId($batchId);
} catch (\Throwable $e) {
Log::error('material batch package generation failed', [
'batch_id' => $batchId,
'message' => $e->getMessage(),
]);
throw $e;
}
}
}