feat : catering

This commit is contained in:
2025-03-13 15:08:26 +08:00
parent d461790c2f
commit 3aa241350c
10 changed files with 530 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ namespace App\Service\Admin\Catering\Print;
use App\Exception\ErrException;
use App\Lib\Print\YlyBasicsLib;
use App\Model\Printer;
use Hyperf\Di\Annotation\Inject;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
@@ -45,13 +46,18 @@ class YlyPrintService implements PrintOrderInterface
*/
private string $content;
/**
* @var YlyBasicsLib
*/
#[Inject]
protected YlyBasicsLib $ylyBasicsLib;
/**
* @var Printer
*/
#[Inject]
protected Printer $printerModel;
/**
* @return void
* @throws ContainerExceptionInterface
@@ -60,7 +66,7 @@ class YlyPrintService implements PrintOrderInterface
public function handle(): void
{
//todo 加入打印机验证 orderOptionCateringLogModel
$printInfo = $this->orderOptionCateringLogModel->where('id',$this->printId)->first();
$printInfo = $this->printerModel->where('id',$this->printId)->first();
if (empty($printInfo)) throw new ErrException('打印机不存在-1');