|
|
|
|
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
|
|
|
|
namespace App\Service\Admin\Catering\Print;
|
|
|
|
|
|
|
|
|
|
use App\Exception\ErrException;
|
|
|
|
|
use App\Lib\Log;
|
|
|
|
|
use App\Lib\Print\YlyBasicsLib;
|
|
|
|
|
use App\Model\Printer;
|
|
|
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
|
@@ -58,6 +59,12 @@ class YlyPrintService implements PrintOrderInterface
|
|
|
|
|
#[Inject]
|
|
|
|
|
protected Printer $printerModel;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var Log
|
|
|
|
|
*/
|
|
|
|
|
#[Inject]
|
|
|
|
|
private Log $log;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws ContainerExceptionInterface
|
|
|
|
|
@@ -108,9 +115,12 @@ class YlyPrintService implements PrintOrderInterface
|
|
|
|
|
empty($this->data['order_sno']) ||
|
|
|
|
|
empty($this->data['username']) ||
|
|
|
|
|
empty($this->data['mobile']) ||
|
|
|
|
|
empty($this->data['date']) ||
|
|
|
|
|
empty($this->data['heapsort'])
|
|
|
|
|
) throw new ErrException('打印数据丢失');
|
|
|
|
|
empty($this->data['date'])
|
|
|
|
|
// empty($this->data['heapsort'])
|
|
|
|
|
) {
|
|
|
|
|
$this->log->error('打印数据'.json_encode($this->data));
|
|
|
|
|
throw new ErrException('打印数据丢失');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -126,9 +136,6 @@ class YlyPrintService implements PrintOrderInterface
|
|
|
|
|
//设置宽度
|
|
|
|
|
$this->content .= "<PW>048</PW>";
|
|
|
|
|
|
|
|
|
|
$this->content .= "\n";
|
|
|
|
|
$this->content .= "\n";
|
|
|
|
|
|
|
|
|
|
//取餐号
|
|
|
|
|
$this->content .= "<FS3><CA>{$this->data['pickup_code']}</CA></FS3>\n";
|
|
|
|
|
|
|
|
|
|
@@ -190,7 +197,7 @@ class YlyPrintService implements PrintOrderInterface
|
|
|
|
|
$contentEdibleTimeTips = config('print.yly.content_edible_time_tips');
|
|
|
|
|
$this->content .= "<LR2>保质期,$contentEdibleTimeTips</LR2>";
|
|
|
|
|
|
|
|
|
|
$this->content .= "<FS3><CA>{$this->data['heapsort']}</CA></FS3>";
|
|
|
|
|
$this->content .= "<FS3><CA>{$this->data['pickup_code']}</CA></FS3>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -231,6 +238,8 @@ class YlyPrintService implements PrintOrderInterface
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws ContainerExceptionInterface
|
|
|
|
|
* @throws NotFoundExceptionInterface
|
|
|
|
|
*/
|
|
|
|
|
private function checkBoxLabelData(): void
|
|
|
|
|
{
|
|
|
|
|
@@ -244,7 +253,10 @@ class YlyPrintService implements PrintOrderInterface
|
|
|
|
|
empty($this->data['driver_name']) ||
|
|
|
|
|
empty($this->data['current_num']) ||
|
|
|
|
|
empty($this->data['date_text'])
|
|
|
|
|
) throw new ErrException('打印数据丢失');
|
|
|
|
|
) {
|
|
|
|
|
$this->log->error('打印数据'.json_encode($this->data));
|
|
|
|
|
throw new ErrException('打印数据丢失-01');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|