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

库外箱入库亮灯允许入库

Zhouzhendong 4 лет назад
Родитель
Сommit
68fda220c5

+ 1 - 0
app/Http/Controllers/StorageController.php

@@ -394,6 +394,7 @@ sql;
             $box = MaterialBox::query()->where("code",$box)->first();
             if (!$station || !$box)$this->error("库位或料箱未在WAS记录");
             $station->update(["material_box_id"=>$box->id]);
+            app("CacheShelfService")->lightUp($station->code);
             DB::commit();
             $this->success();
         }catch (\Exception $e){

+ 1 - 1
app/Services/CacheShelfService.php

@@ -52,7 +52,7 @@ class   CacheShelfService
         $station = Station::query()->with('materialBox')->where('code', $locCode)->first();
         if (Cache::has("CACHE_SHELF_OCCUPANCY_{$station->id}")){
             //缓存存在 不允许灭灯 灭了再点开
-            app("CacheShelfService")->lightUp($station->code,'3','0',["title"=>"库位预定,禁止操作"]);
+            app("CacheShelfService")->lightUp($station->code,'3','0',["title"=>"机器人取箱中,禁止操作"]);
             return ['success' => true];
         }
         //站存在 站为缓存架

+ 4 - 0
app/Services/StorageService.php

@@ -74,13 +74,17 @@ class StorageService
                                 $options["detail01"] = $tasks[0]->bar_code;
                                 $options["detail02"] = "";
                                 $options["detail03"] = "";
+                                $amount = 0;
                                 foreach ($tasks as $task){
                                     if (mb_strlen($options["detail02"])>20){
                                         $options["detail03"] .= $task->bin_number."号-".$task->amount."件,";
                                     }else $options["detail02"] .= $task->bin_number."号-".$task->amount."件,";
+                                    $amount += $task->amount;
                                 }
                                 $options["detail02"] = rtrim($options["detail02"],",");
                                 $options["detail03"] = rtrim($options["detail03"],",");
+                                $options["qty02"] = $amount;
+                                $options["uomDesc02"] = '件';
                             }else{
                                 $task = $tasks[0];
                                 $options["detail01"] = $task->materialBox->code ?? '';