From 8abca3f5413d977f5b11ed74b12ee39cc8570851 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 22 八月 2023 13:20:03 +0800
Subject: [PATCH] #console

---
 src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java |   11 +++
 src/main/webapp/views/console.html                              |  102 ++--------------------------------
 src/main/webapp/static/css/console.css                          |    8 ++
 3 files changed, 24 insertions(+), 97 deletions(-)

diff --git a/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java b/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
index dcde899..c6d3533 100644
--- a/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
@@ -4,6 +4,7 @@
 import com.core.common.SpringUtils;
 import com.zy.asrs.entity.BasShuttle;
 import com.zy.asrs.service.BasShuttleService;
+import com.zy.asrs.utils.Utils;
 import com.zy.common.utils.NavigatePositionConvert;
 import com.zy.core.News;
 import com.zy.core.enums.ShuttleErrorCodeType;
@@ -161,6 +162,11 @@
      * 瀹為檯鍧愭爣xyz鍗曚綅mm
      */
     private NyShuttlePointClass coord;
+
+    /**
+     * WCS搴撲綅xyz
+     */
+    private NyShuttlePointClass wcsPoint;
 
     /**
      * 浠诲姟鐩殑搴撲綅xyztaskId(姝e湪鍔ㄤ綔鐨勪换鍔D)lastTaskId(鏈�鍚庝竴涓畬鎴愮殑浠诲姟ID)recentTaskId(鏀跺埌鐨勬渶鍚庝竴涓换鍔D)
@@ -398,6 +404,11 @@
         String locNo = NavigatePositionConvert.nyXyzToLocNo(point.getX(), point.getY(), point.getZ());
         this.point = point;
         this.currentLocNo = locNo;
+        NyShuttlePointClass wcsPoint = new NyShuttlePointClass();
+        wcsPoint.setX(Utils.getRow(locNo));
+        wcsPoint.setY(Utils.getBay(locNo));
+        wcsPoint.setZ(Utils.getLev(locNo));
+        this.wcsPoint = wcsPoint;
     }
 
     // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
diff --git a/src/main/webapp/static/css/console.css b/src/main/webapp/static/css/console.css
index fbd7c83..4b4ed29 100644
--- a/src/main/webapp/static/css/console.css
+++ b/src/main/webapp/static/css/console.css
@@ -733,11 +733,17 @@
 }
 
 .sxcar{
-	width: 70px;
+	width: 35px;
 	height: 35px;
 	background-image: url(../images/sxcar.png);
 	background-size: 100% 100%;
 	position: absolute;
 	top: 0;
 	left: 0;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	text-shadow: 2px 2px 4px #000000;
+	color: red;
+	font-size: 18px;
 }
\ No newline at end of file
diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html
index 906f732..8b09f68 100644
--- a/src/main/webapp/views/console.html
+++ b/src/main/webapp/views/console.html
@@ -31,7 +31,7 @@
                 <button class="floorBtn  btn-16" onclick="changFloor(this,10)" style="margin-top: 600px">10F</button>
             </div>
             <button class="floorBtn  btn-16" onclick="resetMap()" style="margin-top: 650px;font-size: 14px;">閲嶇疆鍦板浘</button>
-<!--            <button class="floorBtn  btn-16" onclick="testMove()" style="margin-top: 700px;font-size: 14px;">娴嬭瘯绉诲姩杞�</button>-->
+            <button class="floorBtn  btn-16" onclick="testMove()" style="margin-top: 700px;font-size: 14px;">娴嬭瘯绉诲姩杞�</button>
 
         <!-- 璐ф灦 + 鍫嗗灈鏈� + 鍏ュ簱绔欑偣 -->
         <div class="main-part" id="mapDataId">
@@ -499,12 +499,12 @@
                         '<span class="state-ss ' + shuttleStatusClass + '">' + item.protocolStatus$ + '</span></div>';
                     $("#shuttle-status-box").append(shuttleStatus)
 
-                    if(item.locNoLev != currentLev){
+                    if(item.wcsPoint.z != currentLev){
                         //鍥涘悜绌挎杞︽ゼ灞傚拰褰撳墠鍦板浘妤煎眰涓嶄竴鑷达紝鍒犻櫎璇ヨ溅杈�
                         $("#sxcar-" + item.shuttleNo).remove()
                     }else {
                         //绉诲姩鍥涘悜绌挎杞�
-                        moveCar(item.shuttleNo,item.locNoX,item.locNoY)
+                        moveCar(item.shuttleNo,item.wcsPoint.x,item.wcsPoint.y)
                     }
                 })
             }
@@ -537,8 +537,8 @@
             method: 'POST',
             success: function (res) {
                 res.data.forEach((item,index) => {
-                    if(lev == item.locNoLev){
-                        let carBox = '<div class="sxcar" id="sxcar-' + item.shuttleNo + '"></div>'
+                    if(lev == item.wcsPoint.z){
+                        let carBox = '<div class="sxcar" id="sxcar-' + item.shuttleNo + '">' + item.shuttleNo + '</div>'
                         $("#mapDataId").append(carBox)
                     }
                 })
@@ -558,7 +558,6 @@
             headers: {'token': localStorage.getItem('token')},
             success: (res) => {
                 let data = res.data
-                console.log(data)
                 mapData = data
                 let content = ""
                 data.forEach((rowData,index) => {
@@ -634,100 +633,11 @@
 
     function testMove() {
         getMap2TwoArr()//娴嬭瘯鍦板浘鏁版嵁杞崲鏄惁姝e父
-        let json = "[{\n" +
-            "\t\t\"x\": 5,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 6,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 7,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 8,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 9,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 10,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 11,\n" +
-            "\t\t\"y\": 5\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 11,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 12,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 13,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 14,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 15,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 16,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 17,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 18,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 19,\n" +
-            "\t\t\"y\": 6\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 19,\n" +
-            "\t\t\"y\": 7\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 19,\n" +
-            "\t\t\"y\": 8\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 20,\n" +
-            "\t\t\"y\": 8\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 21,\n" +
-            "\t\t\"y\": 8\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 22,\n" +
-            "\t\t\"y\": 8\n" +
-            "\t},\n" +
-            "\t{\n" +
-            "\t\t\"x\": 23,\n" +
-            "\t\t\"y\": 8\n" +
-            "\t}\n" +
-            "]";
+        let json = "[{\"x\":5,\"y\":5},{\"x\":6,\"y\":5},{\"x\":7,\"y\":5},{\"x\":8,\"y\":5},{\"x\":9,\"y\":5},{\"x\":10,\"y\":5},{\"x\":11,\"y\":5},{\"x\":11,\"y\":6},{\"x\":12,\"y\":6},{\"x\":13,\"y\":6},{\"x\":14,\"y\":6},{\"x\":15,\"y\":6},{\"x\":16,\"y\":6}]";
         json = JSON.parse(json)
         json.forEach((item,index) => {
             moveCar(1, item.x, item.y);
         })
-
     }
 
     /**

--
Gitblit v1.9.1