فهرست منبع

关闭一个异常同步任务,德邦回传时同步修改分配单号

Zhouzhendong 4 سال پیش
والد
کامیت
8b69b3b19a
2فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 1 1
      app/Console/Kernel.php
  2. 12 1
      app/Services/WaybillService.php

+ 1 - 1
app/Console/Kernel.php

@@ -64,7 +64,7 @@ class  Kernel extends ConsoleKernel
         $schedule->command('LogExpireDelete')->dailyAt('00:01');
         $schedule->command('InventoryDailyLoggingOwner')->dailyAt('08:00');
         $schedule->command('FluxOrderFix')->hourlyAt(1);
-        $schedule->command('WASSyncWMSOrderInformation')->everyMinute();
+        //$schedule->command('WASSyncWMSOrderInformation')->everyMinute();
         $schedule->command('syncLogCacheTask')->everyMinute();
         $schedule->command('createOwnerReport')->monthlyOn(1);
         $schedule->command('createOwnerBillReport')->monthlyOn(1);

+ 12 - 1
app/Services/WaybillService.php

@@ -17,6 +17,7 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
 use Ramsey\Uuid\Uuid;
 use App\Traits\ServiceAppAop;
 
@@ -362,7 +363,17 @@ class WaybillService
         $w->wms_bill_number = $waybill->wms_bill_number;
         $w->waybill_number  = $waybill->carrier_bill;
         $controller = new WaybillController();
-        return $controller->accomplishToWMS($w);
+        if ($controller->accomplishToWMS($w)){
+            $sql = <<<SQL
+UPDATE ACT_ALLOCATION_DETAILS SET PICKTOTRACEID = ?,DROPID = ? WHERE ORDERNO = ? AND  PICKTOTRACEID = ? AND DROPID = ?
+SQL;
+            $updateRow = DB::connection("oracle")->update($sql,[
+                $waybill->carrier_bill,$waybill->carrier_bill,$waybill->wms_bill_number,$waybill->wms_bill_number,$waybill->wms_bill_number
+            ]);
+            if ($updateRow!=1)Log::warning("德邦单号修改分配失败",["param"=>$w,"row"=>$updateRow]);
+            return true;
+        }
+        return false;
     }
 
     /**