Просмотр исходного кода

Merge branch 'zzd'

# Conflicts:
#	app/Services/OrderPackageService.php
zhouzhendong 4 лет назад
Родитель
Сommit
34d1527e93

+ 10 - 7
app/Http/Controllers/TestController.php

@@ -224,13 +224,16 @@ class TestController extends Controller
     }
     public function test()
     {
-
-        $a = memory_get_usage();
-        $tmp = str_repeat('http://blog.huachen.me/', 4000);
-        $b = memory_get_usage();
-        dump($b-$a);
-        dd(Notification::send(User::query()->where("name","zhouzhendong")->get(),
-            new RoutineNotification(SeeLog::query()->first()->toArray())));
+        $ForeignHaiRoboticsService = new ForeignHaiRoboticsService();
+        $stationService = new StationService();
+        $station = Station::query()->find(14);
+        $station->materialBox = MaterialBox::query()->where("code","IDE0002482")->first();
+
+        /** @var StationTaskMaterialBox $stationTaskMaterialBox */
+        $stationTaskMaterialBox = app("StorageService")->createWarehousingTask($stationService->getStation_byType('立库')["id"],$station->materialBox->id);
+        app("CacheShelfService")->lightUp($station->code,'3','0',['title'=>"等待机器人拿走,请勿操作"]);
+        Cache::forever("CACHE_SHELF_OCCUPANCY_{$station->id}",true);
+        dd($ForeignHaiRoboticsService->putBinToStore_fromCacheShelf($stationTaskMaterialBox, $station));
         $user = Auth::user();
         $remark = "zengjunlj";
         $ownerName = 'zengjunlj' ?? '';

+ 1 - 2
app/Jobs/HandleExceptionWaybill.php

@@ -8,11 +8,10 @@ use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Foundation\Bus\Dispatchable;
 use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Queue\SerializesModels;
 
 class HandleExceptionWaybill implements ShouldQueue
 {
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+    use Dispatchable, InteractsWithQueue, Queueable;
 
     /** @var Waybill|\stdClass */
     protected $waybill;

+ 12 - 12
app/Services/OrderPackageService.php

@@ -285,8 +285,8 @@ class OrderPackageService
         $update_params = [];
         $update_params[] = ['id', 'sent_at'];
         foreach ($packages as $package) {
-            if ($package->sent_at && !isset($map[$package->logistic_number])) continue;
-            list($allocation, $orderHeader) = $map[$package->logistic_number];
+            if ($package->sent_at || !isset($map[$package->logistic_number])) continue;
+            list($allocation,$orderHeader) = $map[$package->logistic_number];
             try {
                 $checktime = $allocation->checktime;
             } catch (\Exception $e) {
@@ -294,7 +294,7 @@ class OrderPackageService
             }
             if ($checktime) {
                 //EDISENDFLAG
-                $this->checkingAndProcess($package, $allocation->orderlineno, $orderHeader); //检查和处理揽收
+                $this->checkingAndProcess($package,$allocation->orderlineno,$orderHeader); //检查和处理揽收
                 $update_params[] = [
                     'id' => $package->id,
                     'sent_at' => $checktime,
@@ -315,18 +315,18 @@ class OrderPackageService
     {
         //校验快递商 订单状态 复核标记 揽收标记
         $package->loadMissing("order.logistic");
-        if ($package->collecting_status == '1' || !$package->logistic_number) return;
-        if (strpos($package->order->logistic->code ?? '', 'ZTO') === false) return;
+        if ($package->collecting_status == '1' || !$package->logistic_number)return;
+        if (strpos($package->order->logistic->code ?? '','ZTO') === false)return;
         $statusMapping = array_flip(Order::STATUS);
-        if (($statusMapping[$package->order->wms_status] ?? 90) == 90) {
-            Log::warning("自动揽收跳出", ["status" => $package->order->wms_status]);
+        if (($statusMapping[$package->order->wms_status] ?? 90) == 90){
+            Log::warning("自动揽收跳出",["status"=>$package->order->wms_status]);
             return;
         }
-        if ($orderHeader->edisendflag != 'Y' && !app("OrderService")->manualBack($orderHeader->orderno)) {
-            Log::warning("揽收回传失败", ["status" => $orderHeader->orderno]);
+        /*if ($orderHeader->edisendflag!='Y' && !app("OrderService")->manualBack($orderHeader->orderno)){
+            Log::warning("揽收回传失败",["status"=>$orderHeader->orderno]);
             return;
-        }
-        dispatch(new PackageCollectingAllocation($package, $lineNo));
+        }*/
+        dispatch(new PackageCollectingAllocation($package,$lineNo));
     }
 
     /**
@@ -340,7 +340,7 @@ class OrderPackageService
             $actAllocationDetails = $orderHeader->actAllocationDetails;
             foreach ($actAllocationDetails as $actAllocationDetail) {
                 $logistic_number = $actAllocationDetail->picktotraceid;
-                $map[$logistic_number] = [$actAllocationDetail, $orderHeader];
+                $map[$logistic_number] = [$actAllocationDetail,$orderHeader];
             }
         }
         return $map;