Pārlūkot izejas kodu

灯光改变,入库修复

Zhouzhendong 4 gadi atpakaļ
vecāks
revīzija
9ff026d621

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

@@ -141,9 +141,14 @@ class TestController extends Controller
     {
         return call_user_func([$this, $method], $request);
     }
-    public function test()
+    public function test1(){
+        $aa = [1,2,3];
+
+        $this->test1(...$aa);
+    }
+    public function test($a,$b,$c)
     {
-        dd();
+        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")

+ 37 - 1
app/Services/CacheShelfService.php

@@ -55,7 +55,7 @@ class   CacheShelfService
      */
     public function lightOffTask($locCode, $PTLAction): array
     {
-        $station = Station::query()->with(['pendingStationTask.stationTaskMaterialBoxes.materialBox','storage'=>function(Builder $query){
+        $station = Station::query()->with(['pendingStationTask.stationTaskMaterialBoxes.materialBox','storage'=>function($query){
             $query->whereNotNull("material_box_id")->orderByDesc("updated_at");
         }])->where('code', $locCode)->first();
         //站存在 站为缓存架2 站为蓝灯状态
@@ -216,6 +216,42 @@ class   CacheShelfService
         return json_decode($response->body());
     }
 
+    /**
+     * 站亮灯
+     *
+     * @param string $stationCode
+     * @param string $color             explain: 0-red 1-green 2-blue 3-yellow
+     * @param string $frequency         explain: 0-常亮 1-一次 2-两次 3-三次 4-四次 5-五次 (均为/秒)
+     * @param array $info
+     * @return bool
+     */
+    public function lightUp(string $stationCode, string $color = '1', string $frequency = '0',array $info = []):bool
+    {
+        $default = [
+            "detail01" => '',
+            "detail02" => "",
+            "detail03" => "",
+            "qrCode" => "",
+            "qty00" => "",
+            "qty01" => 0,
+            "qty02" => 0,
+            "title" => '',
+            "uomDesc01" => "",
+            "uomDesc02" => ""
+        ];
+        foreach ($info as $key=>$item)$default[$key] = $item;
+
+        $params = [
+            "areaCode" => "1004",
+            'locCode' => $stationCode,
+            'PTLAction' => 1,
+            'PTLSettings' => ['color' => $color, 'frequency'  => $frequency],
+            "displayInfo" => $default,
+        ];
+        $response = Http::post(config('api.haiq.storage.light'), $params);
+        return $response->status()==200;
+    }
+
     /**
      * 控制格口灭灯
      * @param $locCode

+ 6 - 1
app/Services/StorageService.php

@@ -79,7 +79,12 @@ class StorageService
                     case 7:
                         $task = TaskTransaction::query()->with("materialBox")->where("fm_station_id",$stationTaskMaterialBox->station_id)
                             ->where("status",0)->first();
-                        if ($task)app("CacheShelfService")->_stationCacheLightOn($stationTaskMaterialBox->station->code,$task->materialBox->code ?? '',"商品条码:{$task->bar_code}\r\n待上架数:{$task->amount}");
+                        if ($task)app("CacheShelfService")->lightUp($stationTaskMaterialBox->station->code,'1','0',[
+                            "title"=>$task->materialBox->code ?? '',
+                            "detail01"=>"ASN单号:{$task->doc_code}",
+                            "detail02"=>"商品条码:{$task->barCode}",
+                            "detail03"=>"上架数量:{$task->amount}",
+                        ]);
                         break;
                 }
             }

+ 1 - 0
resources/views/store/inStorage/halfChestStorage.blade.php

@@ -171,6 +171,7 @@
                         this.info.material_box_model_id = res.material_box_model_id;
                         this.info.commodity_id = res.commodity_id;
                         this.checkSign = true;
+                        if(!this.info.amount)this.info.amount = res.maximum;
                         return "该库位最大可上数为"+res.maximum;
                     });
                 },