LD 5 лет назад
Родитель
Сommit
f7d0af2bdb

+ 33 - 52
app/Http/Controllers/api/thirdPart/haiq/StorageController.php

@@ -59,73 +59,25 @@ class StorageController
 
                 [
                 "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0000009",
+                "binCode"   => "IDE0005132",
                 "fromLocCode" => "",
                 "toLocCode" => "BIN-OUT1",
             ],
                 [
                 "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0000101",
+                "binCode"   => "IDE0005152",
                 "fromLocCode" => "",
                 "toLocCode" => "BIN-OUT1",
             ],
                 [
                 "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0000153",
+                "binCode"   => "IDE0000159",
                 "fromLocCode" => "",
                 "toLocCode" => "BIN-OUT1",
             ],
                 [
                 "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0000167",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0004462",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0004463",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0004954",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0004966",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0004968",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0005226",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0005227",
-                "fromLocCode" => "",
-                "toLocCode" => "BIN-OUT1",
-            ],
-                [
-                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
-                "binCode"   => "IDE0005256",
+                "binCode"   => "IDE0004951",
                 "fromLocCode" => "",
                 "toLocCode" => "BIN-OUT1",
             ],
@@ -342,4 +294,33 @@ class StorageController
         $this->service->excepted('海柔异常','',json_encode($request));
         return ['code'=>200,'errMsg'=>'','data'=>$request->all()];
     }
+    public function takeOutToULine(Request $request){
+        $codesTxt=$request->input('codes');
+        $codes=preg_split('/[\s,.,。]/',$codesTxt);
+        if(!$codes||count($codes)==0)return ['result'=>'请输入料箱号'];
+        $post = [
+            [
+            "taskMode"      => 2,
+            "bins"=>[
+            ],
+            "groupCode"     => 'g'.microtime(true),
+            "priority"      => 20,
+            "sequenceFlag"  => 1,
+        ]
+        ];
+        foreach ($codes as &$code){
+            $code=str_replace(['ide','IDE'],'',$code);
+            $code='IDE'.str_pad($code,7,'0',STR_PAD_LEFT);
+            $post[0]['bins'][]=[
+                "taskCode"  =>Uuid::uuid4().'|'.microtime(true),
+                "binCode"   => $code,
+                "fromLocCode" => "",
+                "toLocCode" => "BIN-OUT1",
+            ];
+        }
+        $response = Http::post(config('api.haiq.storage.moveBin'),$post);
+        $responseBody = $response->body();
+        $responseBody = strstr($responseBody,'200')?'请求出库料箱"'.implode(',',$codes).'"成功':$responseBody;
+        return ['result'=> $responseBody];
+    }
 }

+ 1 - 1
app/Services/BatchService.php

@@ -80,7 +80,7 @@ class BatchService
             $stationTaskMaterialBoxes_occupied = $this->stationTaskMaterialBoxService->getOccupied_byBatches($batches_shouldProcess); //按规则过滤需要的波次
             LogService::log(__METHOD__,'assignTasks','波次任务分配2b:'.json_encode($batches));
             if($stationTaskMaterialBoxes_occupied->isNotEmpty()) {
-                BatchTaskJob::dispatch($batches_shouldProcess)
+                BatchTaskJob::dispatch($batches_shouldProcess->toArray())
                     ->delay(now()->addMinutes(1));    //因为料箱被占用了,所以将任务推迟1分钟后尝试
                 return;
             }

+ 5 - 0
public/t.php

@@ -0,0 +1,5 @@
+<?php
+$codes=['sdf',33,'4'];
+$responseBody = 'sadfsdlfkj200,34324';
+$responseBody = strstr($responseBody,'200')?'取料箱'.implode(',',$codes).'成功':$responseBody;
+var_dump($responseBody);

+ 39 - 2
resources/views/station/monitor/show.blade.php

@@ -15,8 +15,12 @@
         <div class="card">
             <div class="card-body">
                 <div class="row border" style="opacity: 0.75">
-                    <div class="col-4 text-center h3 py-2 font-weight-bold text-info">宝时云仓</div>
-                    <div class="col text-center  h3 py-2 text-muted">智能分拣</div>
+                    <div class="col-4 text-center h3 py-2 font-weight-bold text-info position-relative">
+                        宝时云仓
+                    </div>
+                    <div class="col text-center  h3 py-2 text-muted">
+                        智能分拣
+                    </div>
                 </div>
                 <div class="row pt-3">
                     <div class="col-4">
@@ -150,6 +154,18 @@
                                              class="spot sixth-right-bottom" points="200,80 191.61,33.33 270.83,33.33 300,80"
                                              style="stroke:rgb(11,51,71);stroke-width:3;" />
                                 </svg>
+                                <div class="text-left">
+                                    <div >
+                                        <div class="btn btn-outline-info" @click="
+                                        (inputs.manuallyTakeBox.visible=true)
+                                        &&(inputs.manuallyTakeBox.text='')">手动出库</div>
+                                        <div class="position-relative bg-white" v-if="inputs.manuallyTakeBox.visible">
+                                <textarea  name="" id="" cols="30" rows="3" class="form-control" v-model="inputs.manuallyTakeBox.text"
+                                           placeholder="点选此处写入料箱号,可以省略IDE前缀和0,多个用空格分隔,例入:5121 156"></textarea>
+                                            <button class="btn btn-info btn-lg" @click="manuallyTakeBoxOut">出库</button>
+                                        </div>
+                                    </div>
+                                </div>
                             </div>
                         </div>
                     </div>
@@ -274,6 +290,12 @@
                 channelName : ".App\\Events\\BroadcastToStation",
                 error:"",
                 station:{!! $station??[] !!},
+                inputs:{
+                    manuallyTakeBox:{
+                        visible:false,
+                        text:'',
+                    }
+                },
                 grids:{
                     single:{status:'',},
                     half:{
@@ -314,6 +336,21 @@
                         this.station['current_station_task']=json;
                     });
                 },
+                manuallyTakeBoxOut(){
+                    let text = this.inputs.manuallyTakeBox.text.trim();
+                    if(!text){
+                        alert('请输入料箱号')
+                        return
+                    };
+                    axios.post('{{url('/api/thirdPart/haiq/storage/takeOutToULine')}}',{codes:text})
+                        .then(function(response){
+                            tempTip.okWindow(response.data.result,'确定')
+                        }).catch(function(err){
+                        tempTip.okWindow(err,'确定')
+                    }).finally(function(){
+                        this.inputs.manuallyTakeBox.text='';
+                    })
+                },
             },
             computed:{
                 task(){

+ 1 - 0
routes/api/thirdPart/haiq.php

@@ -19,6 +19,7 @@ Route::group(['prefix'=>'storage'],function(){
     Route::post('lightOff', "StorageController@lightOff");//移库
     Route::post('taskUpdate', "StorageController@taskUpdate");//移库
     Route::post('exception', "StorageController@exception");//移库
+    Route::post('takeOutToULine', "StorageController@takeOutToULine");//出库(基于料箱号往U型线出库)
 });
 Route::group(['prefix'=>'pickStation'],function(){
     Route::post('processed', "PickStationController@processed");//移库