瀏覽代碼

解除出库限制,恢复海柔接口

Zhouzhendong 4 年之前
父節點
當前提交
c19e5e51b2

+ 5 - 6
app/Http/Controllers/StorageController.php

@@ -51,8 +51,7 @@ class StorageController extends Controller
         //此处嵌套三层事务 以最高层级为准
         DB::beginTransaction(); //总体事务 回滚WAS错误操作
         try{
-            //建立入库任务
-            if (!app("StorageService")->putWareHousing($fromLocation,$box->id))$this->error("错误库位或库位已被下达任务");
+            //if (!app("StorageService")->putWareHousing($fromLocation,$box->id))$this->error("错误库位或库位已被下达任务");
             //库存记录
             if (!app("StorageService")->enterWarehouse($station->id, $box->id, $item->commodity_id ?? null, $amount, $box->material_box_model_id))$this->error("库存异常");
 
@@ -127,13 +126,13 @@ class StorageController extends Controller
             $data .= "存在任务待处理,无法释放";
             $boxes = array_values($boxes);
             $station = Station::query()->select("id")->whereIn("code",$boxes);
-            //清除海柔信息,标记料箱为出库
-            DB::connection("mysql_haiRobotics")->table("ks_bin")->whereIn("ks_bin_space_code",$boxes)
-                ->where("status",1)->update([
+        }
+        //清除海柔信息,标记料箱为出库
+        DB::connection("mysql_haiRobotics")->table("ks_bin")->whereIn("ks_bin_space_code",$boxes)
+            ->where("status",1)->update([
                 "ks_bin_space_code" => null,"ks_bin_space_id"=>null,"orig_ks_bin_space_code"=>null,"orig_ks_bin_space_id"=>null,
                 "status"=>4,
             ]);
-        }
         $task = StationTask::query()->select("id")->where("status","!=",'完成')->whereIn("station_id",$station);
         StationTaskMaterialBox::query()->where("status","!=",'完成')->whereIn("station_task_id",$task)->update([
             "status" => "完成"

+ 1 - 1
app/Http/Controllers/TestController.php

@@ -144,7 +144,7 @@ class TestController extends Controller
     public function test1()
     {
         ini_set('max_execution_time',-1);
-        foreach (Order::query()->select("id")->where("wms_edittime",">=","2021-06-01 00:00:00")
+        foreach (Order::query()->where("wms_edittime",">=","2021-06-01 00:00:00")
                      ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")
                          ->where("created_at",">=",'2021-06-01 00:00:00')
                          ->where("outer_table_name","orders"))->get() as $order){

+ 1 - 0
app/Services/StorageService.php

@@ -3,6 +3,7 @@
 namespace App\Services;
 
 use App\CommodityMaterialBoxModel;
+use App\Log;
 use App\Station;
 use App\StationTask;
 use App\StationTaskMaterialBox;