Преглед на файлове

不同快递接口的修改

ajun преди 4 години
родител
ревизия
2b710fb608
променени са 4 файла, в които са добавени 9 реда и са изтрити 8 реда
  1. 2 0
      app/Services/PDDDeliveryService.php
  2. 1 3
      app/Services/SFDeliveryService.php
  3. 1 3
      app/Services/SFQHDDeliveryService.php
  4. 5 2
      app/Services/TBDeliveryService.php

+ 2 - 0
app/Services/PDDDeliveryService.php

@@ -62,9 +62,11 @@ class PDDDeliveryService implements DeliveryInterface
         if (!$item) return $item;
         if (!$item) return $item;
         $path = '';
         $path = '';
         $img = $this->getImage($item['base64'], $path);
         $img = $this->getImage($item['base64'], $path);
+        app(DeliveryService::class)->pushClearCache($path);
         $image = $this->draw($item['delivery'], $PrintTemplate, $img);
         $image = $this->draw($item['delivery'], $PrintTemplate, $img);
         $this->saveImage($image, $path);
         $this->saveImage($image, $path);
         $item['base64'] = $this->readImageBase64($path);
         $item['base64'] = $this->readImageBase64($path);
+        app(DeliveryService::class)->pushClearCache($path);
         return $item;
         return $item;
     }
     }
 }
 }

+ 1 - 3
app/Services/SFDeliveryService.php

@@ -2,12 +2,9 @@
 
 
 namespace App\Services;
 namespace App\Services;
 
 
-use App\OracleDocOrderDeliveryInfo;
-use App\OracleDOCOrderHeader;
 use App\OwnerLogisticPrintTemplate;
 use App\OwnerLogisticPrintTemplate;
 use App\Services\Interfaces\DeliveryInterface;
 use App\Services\Interfaces\DeliveryInterface;
 use App\Traits\DeliveryProcess;
 use App\Traits\DeliveryProcess;
-use App\Traits\DrawImage;
 use Illuminate\Database\Query\Builder;
 use Illuminate\Database\Query\Builder;
 use Illuminate\Support\Str;
 use Illuminate\Support\Str;
 
 
@@ -57,6 +54,7 @@ class SFDeliveryService implements DeliveryInterface
         $image = $this->draw($item['delivery'],$item,null);
         $image = $this->draw($item['delivery'],$item,null);
         $path = '';
         $path = '';
         $this->saveImage($image,$path);
         $this->saveImage($image,$path);
+        app(DeliveryService::class)->pushClearCache($path);
         return $this->readImageBase64($path);
         return $this->readImageBase64($path);
     }
     }
 
 

+ 1 - 3
app/Services/SFQHDDeliveryService.php

@@ -3,12 +3,10 @@
 namespace App\Services;
 namespace App\Services;
 
 
 
 
-use App\OracleDocOrderDeliveryInfo;
 use App\OracleDOCOrderHeader;
 use App\OracleDOCOrderHeader;
 use App\OwnerLogisticPrintTemplate;
 use App\OwnerLogisticPrintTemplate;
 use App\Services\Interfaces\DeliveryInterface;
 use App\Services\Interfaces\DeliveryInterface;
 use App\Traits\DeliveryProcess;
 use App\Traits\DeliveryProcess;
-use App\Traits\DrawImage;
 use Illuminate\Database\Query\Builder;
 use Illuminate\Database\Query\Builder;
 use Illuminate\Support\Str;
 use Illuminate\Support\Str;
 
 
@@ -22,7 +20,6 @@ class SFQHDDeliveryService implements DeliveryInterface
         $oracleDocOrderHeaders = OracleDOCOrderHeader::query()
         $oracleDocOrderHeaders = OracleDOCOrderHeader::query()
             ->whereIn('deliveryNo', $logistic_number)
             ->whereIn('deliveryNo', $logistic_number)
             ->whereIn('ConsigneeId', ["SFQHD",'SFSYQHD','SFTHQHD'])
             ->whereIn('ConsigneeId', ["SFQHD",'SFSYQHD','SFTHQHD'])
-//            ->where('SoStatus', '<>', '90')
             ->get();
             ->get();
 
 
         return$oracleDocOrderHeaders->map(function ($item) {
         return$oracleDocOrderHeaders->map(function ($item) {
@@ -52,6 +49,7 @@ class SFQHDDeliveryService implements DeliveryInterface
         $image = $this->draw($item['delivery'], $item, null);
         $image = $this->draw($item['delivery'], $item, null);
         $path = '';
         $path = '';
         $this->saveImage($image, $path);
         $this->saveImage($image, $path);
+        app(DeliveryService::class)->pushClearCache($path);
         return $this->readImageBase64($path);
         return $this->readImageBase64($path);
     }
     }
 
 

+ 5 - 2
app/Services/TBDeliveryService.php

@@ -47,9 +47,10 @@ class TBDeliveryService implements DeliveryInterface
         return $this->getDocOrderDeliveryInfo($item);
         return $this->getDocOrderDeliveryInfo($item);
     }
     }
 
 
-    function processing($item)
+    function processing(array &$item)
     {
     {
         $item['is_process'] = true;
         $item['is_process'] = true;
+
         $PrintTemplate = OwnerLogisticPrintTemplate::query()->with('printTemplate')->where('owner_id', function (Builder $query) use ($item) {
         $PrintTemplate = OwnerLogisticPrintTemplate::query()->with('printTemplate')->where('owner_id', function (Builder $query) use ($item) {
             $query->from('owners')->selectRaw('id')->where("code", $item['owner_code']);
             $query->from('owners')->selectRaw('id')->where("code", $item['owner_code']);
         })->where('logistic_id', function (Builder $query) use ($item) {
         })->where('logistic_id', function (Builder $query) use ($item) {
@@ -59,9 +60,11 @@ class TBDeliveryService implements DeliveryInterface
         if (!$item) return $item;
         if (!$item) return $item;
         $path = '';
         $path = '';
         $img = $this->getImage($item['base64'], $path);
         $img = $this->getImage($item['base64'], $path);
-        $image = $this->draw($item['delivery'], $PrintTemplate, $img);
+        app(DeliveryService::class)->pushClearCache($path);
+        $image = $this->draw($item['delivery'], $PrintTemplate->printTemplate, $img);
         $this->saveImage($image, $path);
         $this->saveImage($image, $path);
         $item['base64'] = $this->readImageBase64($path);
         $item['base64'] = $this->readImageBase64($path);
+        app(DeliveryService::class)->pushClearCache($path);
         return $item;
         return $item;
     }
     }