Browse Source

Merge remote-tracking branch 'origin/master'

zengjun 3 years ago
parent
commit
39ca62fd2a

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

@@ -12,6 +12,7 @@ use App\Waybill;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Hash;
+use Illuminate\Support\Facades\Http;
 
 class TestController extends Controller
 {
@@ -33,6 +34,11 @@ class TestController extends Controller
         }
     }
     public function test()
-    {}
+    {
+        $url = config('api.java.base').config('api.java.device.picking.getContainerOfWave');
+        $request = Http::get($url, ["container" => "1"]);
+        $result = $request->json();
+        dd($result);
+    }
 }
 

+ 13 - 0
app/Http/Controllers/api/thirdPart/haochuang/SortingController.php

@@ -19,6 +19,7 @@ use App\UserToken;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Hash;
+use Illuminate\Support\Facades\Http;
 use Illuminate\Support\Facades\Validator;
 
 class SortingController extends Controller
@@ -63,6 +64,7 @@ class SortingController extends Controller
         $station_id = $request->input('station_id');
         $batch_id = $request->input('batch_id');
 
+        // 二次分拣拆分波次
         $childIndex = null;
         $arr = explode('-',$batch_id);
         if (count($arr)==2){
@@ -70,6 +72,17 @@ class SortingController extends Controller
             $childIndex = (int)$arr[1];
             $request->offsetSet("batch_id",$batch_id);
         }
+        // 容器号获取波次
+        if (strlen($batch_id) != 13 && substr($batch_id, 0, 1) != 'W') {
+            // 请求JAVA端获取对应波次号
+            $url = config('api.java.base').config('api.java.device.picking.getContainerOfWave');
+            $get = Http::get($url, ["container" => $batch_id]);
+            $result = $get->json();
+            if ($result != 200) {
+                return response()->json(['result'=>'failure','fail_info'=>$result["message"]])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
+            }
+            $request->offsetSet("batch_id",$result["data"]);
+        }
 
         $errors=$this->processValidator($request->all())->errors();
         if(count($errors)>0){

+ 6 - 0
config/api.php

@@ -95,10 +95,16 @@ return [
         'token' => 604800,
     ],
     'java'=>[
+        'base' => "https://api.baoshi56.com/",
         'wms'=>[
             'rejectedPushTask'=>[
                 'receivePush'=>env('WMS_REJECTED_PUSH_TASK', 'https://api.baoshi56.com/api/wms/rejectedPushTask/receiveUpdate'),
             ]
+        ],
+        "device" => [
+            "picking" => [
+                "getContainerOfWave" => "api/device/check/picking/getContainerOfWave",
+            ]
         ]
     ]
 ];

+ 12 - 8
resources/views/equipment/_detailInfo.blade.php

@@ -6,14 +6,14 @@
                 <div class="col-4 form-inline h-5 font-weight-bold">
                     设备编号:<input class="form-control" :class="error.code ? 'is-invalid' : ''" v-model="current.code"></input>
                 </div>
-                <div class="col-4">
+<!--                <div class="col-4">
                     <div class="form-inline h-50">
                         设备宽度/M:<input class="form-control form-control-sm" :class="error.width ? 'is-invalid' : ''" type="number" step="0.01" v-model="current.width"></input>
                     </div>
                     <div class="form-inline h-50 mt-1">
                         设备深度/M:<input class="form-control form-control-sm" :class="error.depth ? 'is-invalid' : ''" type="number" step="0.01" v-model="current.depth"></input>
                     </div>
-                </div>
+                </div>-->
                 <div class="col-4">
                     所属库区:
                     <select class="form-control form-control-sm" v-model="current.repository" :class="error.repositoryId ? 'is-invalid' : ''">
@@ -31,19 +31,23 @@
                 </div>
                 <div class="col-6 p-0" :style="[error.children ? {border: '2px red solid'} : '']">
                     <div v-for="(item,i) in flipChildren" class="row m-0" style="border-bottom: 1px #D3D3D3 solid;height: 70px">
-                        <div class="col-4">
-                            设备高度/M:<input class="form-control" min="0" type="number" step="0.01" :class="error['children['+i+'].height'] ? 'is-invalid' : ''" v-model="item.height"></input>
+                        <div class="col-3">
+                            高度/M:<input class="form-control" min="0" type="number" step="0.01" :class="error['children['+i+'].height'] ? 'is-invalid' : ''" v-model="item.height"></input>
                         </div>
-                        <div class="col-4">
-                            库行数<input class="form-control" min="0" :disabled="current.eqId!==undefined" type="number" step="1"
+                        <div class="col-3">
+                            库行数<input class="form-control" min="0" :disabled="current.eqId!==undefined" type="number" step="1"
                                         :style="[item.row ? {color:'red'} : '',item.row ? {fontWeight:'bold'} : '']"
                                         :class="error['children['+i+'].row'] ? 'is-invalid' : ''" v-model="item.row"></input>
                         </div>
-                        <div class="col-4">
-                            库列数<input class="form-control" min="0" :disabled="current.eqId!==undefined" type="number" step="1"
+                        <div class="col-3">
+                            库列数<input class="form-control" min="0" :disabled="current.eqId!==undefined" type="number" step="1"
                                         :style="[item.row ? {color:'red'} : '',item.row ? {fontWeight:'bold'} : '']"
                                         :class="error['children['+i+'].column'] ? 'is-invalid' : ''" v-model="item.column"></input>
                         </div>
+                        <div class="col-3">
+                            面积/M²<input class="form-control" min="0" type="number" step="1"
+                                        :class="error['children['+i+'].area'] ? 'is-invalid' : ''" v-model="item.area"></input>
+                        </div>
                     </div>
                 </div>
             </div>

+ 56 - 19
resources/views/equipment/index.blade.php

@@ -323,16 +323,6 @@
             clientCoords:{},                                            //坐标系记录
             scale:100,                                                  //缩放值
             equipments:[                                                //备选设备池
-                {id:1,w:1.2,h:2.4,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
-                {id:2,w:1.2,h:2.4,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
-                {id:3,w:1.2,h:3.3,grid:3,layer:1,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
-                {id:4,w:1.2,h:3.3,grid:3,layer:2,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
-                {id:5,w:1.2,h:1.2,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
-                {id:6,w:1.2,h:2.4,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
-                {id:7,w:1.2,h:1.2,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
-                {id:8,w:1.2,h:3.3,grid:3,layer:4,color:"RGB(146,208,80)",describe:"4层高位货架,可设十二个标准托盘位"},
-                {id:9,w:1.2,h:2.4,grid:2,layer:2,color:"RGB(228,243,211)",describe:"叉车通道,可设四个标准托盘位"},
-                {id:10,w:1,h:2,grid:1,layer:4,color:"RGB(211,160,160)",describe:"小型货架"},
             ],
             currentEq:{                                                 //选中的设备
                 el:null,
@@ -365,11 +355,13 @@
             isShowRatio:undefined,//是否展示库位现存比例
         },
         mounted() {
-            this.initPage();
-            let content = document.getElementById("canvasApp");
-            content.onmousemove = (event)=>{
-                this.client = {x:event.clientX,y:event.clientY};
-            }
+            this._loadEquipmentCategory().then(()=>{
+                this.initPage();
+                let content = document.getElementById("canvasApp");
+                content.onmousemove = (event)=>{
+                    this.client = {x:event.clientX,y:event.clientY};
+                }
+            })
         },
         computed:{
             flipLayer(){
@@ -422,6 +414,54 @@
             };
         },
         methods:{
+            // 加载设备种类
+            _loadEquipmentCategory() {
+                return new Promise((resolve, reject)=>{
+                    $.ajax({
+                        url : this.baseUrl+"api/equipment/category",
+                        type : "GET",
+                        success : (res,status)=>{
+                            if(res.code != 200 || !res.data) {
+                                window.tempTip.show(res.message);
+                                return;
+                            }
+                            /*
+                            * {id:1,w:1.2,h:2.4,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
+                    {id:2,w:1.2,h:2.4,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
+                    {id:3,w:1.2,h:3.3,grid:3,layer:1,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
+                    {id:4,w:1.2,h:3.3,grid:3,layer:2,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
+                    {id:5,w:1.2,h:1.2,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
+                    {id:6,w:1.2,h:2.4,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
+                    {id:7,w:1.2,h:1.2,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
+                    {id:8,w:1.2,h:3.3,grid:3,layer:4,color:"RGB(146,208,80)",describe:"4层高位货架,可设十二个标准托盘位"},
+                    {id:9,w:1.2,h:2.4,grid:2,layer:2,color:"RGB(228,243,211)",describe:"叉车通道,可设四个标准托盘位"},
+                    {id:10,w:1,h:2,grid:1,layer:4,color:"RGB(211,160,160)",describe:"小型货架"},
+                            * */
+                            let equipments = [];
+                            if (res.data.length > 0) {
+                                res.data.forEach(category => {
+                                    let info = JSON.parse(category.info);
+                                    equipments.push({
+                                        "id":category.id,
+                                        "w":category.depth,
+                                        "h":category.width,
+                                        "grid":info.grid,
+                                        "layer":category.layer,
+                                        "color":info.color,
+                                        "describe":category.name,
+                                    });
+                                });
+                            }
+                            this.equipments = equipments;
+                            resolve();
+                        },
+                        error : (err,status)=>{
+                            window.tempTip.show("设备种类加载失败");
+                        },
+                        timeout:3000,
+                    })
+                });
+            },
             //仓库切换
             selectedWarehouse(warehouse){
                 this.isLoad = false;
@@ -447,8 +487,6 @@
                                         eqId:eq.id,
                                         exist:eq.exist,
                                         code:eq.code,
-                                        width:eq.width,
-                                        depth:eq.depth,
                                         repository:eq.repositoryId,
                                         x:coords.x,
                                         y:coords.y,
@@ -1111,11 +1149,10 @@
             _checkEquipmentData(equipment){
                 let error = {};
                 if (!equipment.code)error.code = "设备编号未填写";
-                if (!equipment.width)error.width = "设备宽度未填写";
-                if (!equipment.depth)error.depth = "设备深度未填写";
                 if (equipment.layer !== equipment.children.length)error.children = "设备绑定错误";
                 for (let i=0;i<equipment.layer;i++){
                     if (!equipment.children[i].height)error["children["+i+"].height"] = "设备高度不得为空"
+                    if (!equipment.children[i].area)error["children["+i+"].height"] = "设备折算面积不得为空"
                     if (!equipment.children[i].column && equipment.children[i].column!=0)error["children["+i+"].column"] = "库位列数不得为空"
                     if (!equipment.children[i].row && equipment.children[i].row!=0)error["children["+i+"].row"] = "库位行数不得为空"
                 }

+ 1 - 1
resources/views/maintenance/scanDevice/index.blade.php

@@ -51,7 +51,7 @@
                     if (env === 'local') {
                         url = 'http://127.0.0.1:8111'
                     } else if (env === 'production') {
-                        url = 'https://stat.baoshi56.com'
+                        url = 'https://api.baoshi56.com'
                     }
                     return url;
                 },