Browse Source

信息提示修复

Zhouzhendong 4 năm trước cách đây
mục cha
commit
429dd4965c

+ 5 - 13
app/Http/Controllers/TestController.php

@@ -141,20 +141,12 @@ class TestController extends Controller
     {
         return call_user_func([$this, $method], $request);
     }
-    public function test1(){
-        $aa = [1,2,3];
-
-        $this->test1(...$aa);
-    }
-    public function test($a,$b,$c)
+    public function test()
     {
-        dd($a,$b,$c);
-        ini_set('max_execution_time', 0);
-        $orders = Order::query()->whereBetween("wms_edittime",["2021-06-01 00:00:00","2021-06-30 23:59:59"])
-            ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")
-                ->whereBetween("worked_at",["2021-06-01 00:00:00","2021-06-30 23:59:59"])
-                ->where("outer_table_name","orders"))->get();
-        foreach ($orders->chunk(50) as $or)dispatch(new OrderCreateInstantBill($or));
+        $station = Station::query()->with(['pendingStationTask.stationTaskMaterialBoxes.materialBox','storage'=>function($query){
+            $query->whereNotNull("material_box_id")->orderByDesc("updated_at");
+        }])->where('code', "HAIB2-02-02")->first();
+        dd(app("StorageService")->checkStorage($station));
     }
     public function orderCreateBill()
     {

+ 1 - 1
app/Services/CacheShelfService.php

@@ -62,7 +62,7 @@ class   CacheShelfService
         if ($station && $station->parent_id==7){
             if (!Storage::query()->where("station_id",$station->id)->whereNotNull("material_box_id")->first())return ['success' => false, 'errMsg' => "任务执行中,不允许灭灯"];
             if (!app("StorageService")->checkStorage($station)){
-                $this->stationLightUp($station->code,null,'0','1','上架任务失败');
+                $this->lightUp($station->code,'0','1',["title"=>"上架失败,联系管理员"]);
                 return ['success' => false,'errMsg' => '上架任务失败'];
             };
         }

+ 4 - 4
app/Services/StorageService.php

@@ -121,7 +121,7 @@ class StorageService
             ->where("status",0)->first();
         if (!$task)return;
         //蓝灯闪烁
-        if ($task->type == '入库' && $task->mark == 1)app("CacheShelfService")->stationLightUp($stationTaskMaterialBox->station->code,null,'2','2',"机器人取箱中,禁止操作");
+        if ($task->type == '入库' && $task->mark == 1)app("CacheShelfService")->lightUp($stationTaskMaterialBox->station->code,'2','2',["title"=>'机器人取箱中,禁止操作',]);
     }
 
     /**
@@ -362,12 +362,12 @@ sql;
                 if ($inv->locationid==$task->fmlocation){
                     $columns = '';
                     $values = '';
-                    DB::connection("oracle")->update(DB::raw("UPDATE inv_lot_loc_id SET qty = qty-? WHERE lotnum = ? AND locationid = ? AND traceid = ?"),[
-                        $amount,$inv->lotnum,$inv->locationid,$inv->traceid
+                    DB::connection("oracle")->update(DB::raw("UPDATE inv_lot_loc_id SET qty = qty-?,qtymvout = qtymvout-? WHERE lotnum = ? AND locationid = ? AND traceid = ?"),[
+                        $amount,$amount,$inv->lotnum,$inv->locationid,$inv->traceid
                     ]);
                     foreach ($inv as $key=>$val){
                         if (Str::upper($key)=='TRACEID') $val = "WAS".$task->fmid;
-                        if (Str::upper($key)=='QTY') $val = $amount;
+                        if (Str::upper($key)=='QTY' || Str::upper($key)=='QTYMVOUT') $val = $amount;
                         $columns .= $key.",";
                         $values .= $this->valFormat($val) .",";
                     }