|
@@ -5,11 +5,17 @@ namespace App\Services;
|
|
|
|
|
|
|
|
use App\OracleDocOrderDeliveryInfo;
|
|
use App\OracleDocOrderDeliveryInfo;
|
|
|
use App\OracleDOCOrderHeader;
|
|
use App\OracleDOCOrderHeader;
|
|
|
|
|
+use App\OwnerLogisticPrintTemplate;
|
|
|
use App\Services\Interfaces\DeliveryInterface;
|
|
use App\Services\Interfaces\DeliveryInterface;
|
|
|
|
|
+use App\Traits\DrawImage;
|
|
|
|
|
+use Illuminate\Database\Query\Builder;
|
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
class SFQHDDeliveryService implements DeliveryInterface
|
|
class SFQHDDeliveryService implements DeliveryInterface
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+ use DrawImage;
|
|
|
|
|
+
|
|
|
function getDeliveryInfo($logistic_number): array
|
|
function getDeliveryInfo($logistic_number): array
|
|
|
{
|
|
{
|
|
|
return OracleDOCOrderHeader::query()->whereIn('deliveryNo',$logistic_number)->where('ConsigneeId',"SFQHD")->where('SoStatus', '<>','90')->get()->map(function($item){
|
|
return OracleDOCOrderHeader::query()->whereIn('deliveryNo',$logistic_number)->where('ConsigneeId',"SFQHD")->where('SoStatus', '<>','90')->get()->map(function($item){
|
|
@@ -23,7 +29,7 @@ class SFQHDDeliveryService implements DeliveryInterface
|
|
|
'logistic_code' => $item->userdefine1 ?? '',
|
|
'logistic_code' => $item->userdefine1 ?? '',
|
|
|
'logistic_number' => $item['deliveryno'],
|
|
'logistic_number' => $item['deliveryno'],
|
|
|
'delivery' => $this->getDelivery($item),
|
|
'delivery' => $this->getDelivery($item),
|
|
|
- 'base64' => null,
|
|
|
|
|
|
|
+ 'base64' => $this->getBase64($item),
|
|
|
];
|
|
];
|
|
|
})->toArray();
|
|
})->toArray();
|
|
|
}
|
|
}
|
|
@@ -32,7 +38,15 @@ class SFQHDDeliveryService implements DeliveryInterface
|
|
|
|
|
|
|
|
public function getBase64($item)
|
|
public function getBase64($item)
|
|
|
{
|
|
{
|
|
|
- return null;
|
|
|
|
|
|
|
+ $item = OwnerLogisticPrintTemplate::query()->with('printTemplate')->where('owner_id', function(Builder $query)use($item){
|
|
|
|
|
+ $query->from("owners")->where("code",$item['owner_code']);
|
|
|
|
|
+ })->where('logistic_id', function(Builder $query)use($item){
|
|
|
|
|
+ $query->from("logistic")->where("code",$item['logistic_code']);
|
|
|
|
|
+ })->first();
|
|
|
|
|
+ $image = $this->draw($item['delivery'],$item,null);
|
|
|
|
|
+ $path = '';
|
|
|
|
|
+ $this->saveImage($image,$path);
|
|
|
|
|
+ return $this->readImageBase64($path);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -43,10 +57,7 @@ class SFQHDDeliveryService implements DeliveryInterface
|
|
|
|
|
|
|
|
function processing(&$params)
|
|
function processing(&$params)
|
|
|
{
|
|
{
|
|
|
- foreach ($params as $param) {
|
|
|
|
|
- if($param['type'] != 'SFQHD') continue;
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function construct($param)
|
|
function construct($param)
|