From a6419abb1e5dc63f8957da5eb45c82d49b86cbc9 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期二, 07 一月 2025 16:38:47 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/utils/NavigateMapUtils.java | 7 ++- src/main/java/com/zy/common/utils/NavigateMapData.java | 50 +++++++++++++++++++++++- src/main/webapp/static/js/common.js | 2 pom.xml | 2 4 files changed, 53 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 8445467..61127e4 100644 --- a/pom.xml +++ b/pom.xml @@ -189,7 +189,7 @@ </dependencies> <build> - <finalName>tzskwcs</finalName> + <finalName>wcs</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> diff --git a/src/main/java/com/zy/common/utils/NavigateMapData.java b/src/main/java/com/zy/common/utils/NavigateMapData.java index 66a14d2..98cc5a1 100644 --- a/src/main/java/com/zy/common/utils/NavigateMapData.java +++ b/src/main/java/com/zy/common/utils/NavigateMapData.java @@ -5,9 +5,18 @@ import com.zy.asrs.entity.BasMap; import com.zy.asrs.entity.LocMast; import com.zy.asrs.service.LocMastService; +import com.zy.asrs.utils.Utils; import com.zy.common.model.MapNode; import com.zy.common.model.enums.NavigationMapType; +import com.zy.core.cache.SlaveConnection; +import com.zy.core.enums.MapNodeType; import com.zy.core.enums.RedisKeyType; +import com.zy.core.enums.SlaveType; +import com.zy.core.model.ForkLiftSlave; +import com.zy.core.model.protocol.ForkLiftStaProtocol; +import com.zy.core.properties.SlaveProperties; +import com.zy.core.thread.ForkLiftThread; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Component; @@ -20,6 +29,9 @@ */ @Component public class NavigateMapData { + + @Autowired + private SlaveProperties slaveProperties; public int[][] getData(Integer lev, Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) { try { @@ -295,12 +307,12 @@ || locMast.getLocSts().equals("R") || locMast.getLocSts().equals("P") ) { - mapNode.setValue(-1);//绂佺敤鑺傜偣 + mapNode.setValue(MapNodeType.DISABLE.id);//绂佺敤鑺傜偣 } } else if (mapType == NavigationMapType.NORMAL.id) { //杩囨护搴撲綅鐘舵�乆 if (locMast.getLocSts().equals("X")) { - mapNode.setValue(-1);//绂佺敤鑺傜偣 + mapNode.setValue(MapNodeType.DISABLE.id);//绂佺敤鑺傜偣 } } @@ -316,7 +328,7 @@ int y = points[1]; List<MapNode> list = lists.get(x); MapNode mapNode = list.get(y); - mapNode.setValue(66);//璁剧疆涓鸿溅杈嗕唬鐮�66 + mapNode.setValue(MapNodeType.CAR.id);//璁剧疆涓鸿溅杈嗕唬鐮�66 //鏇存柊list list.set(y, mapNode); lists.set(x, list); @@ -343,6 +355,38 @@ } } + //鍔犺浇璐у弶鎻愬崌鏈烘斁璐х偣浣嶆暟鎹� + for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) { + ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId()); + if (forkLiftThread == null) { + continue; + } + + for (ForkLiftStaProtocol staProtocol : forkLiftThread.getForkLiftStaProtocols()) { + int row = Utils.getRow(staProtocol.getLocNo()); + int bay = Utils.getBay(staProtocol.getLocNo()); + + List<MapNode> list = lists.get(row); + MapNode mapNode = list.get(bay); + + if (mapType == NavigationMapType.DFX.id) { + //杞﹁締鏈夎揣 + if (staProtocol.getHasTray()) { + mapNode.setValue(MapNodeType.DISABLE.id); + } + }else { + if (staProtocol.getHasCar()) { + mapNode.setValue(MapNodeType.CAR.id); + } + } + + //鏇存柊list + list.set(bay, mapNode); + lists.set(row, list); + } + + } + return lists; } diff --git a/src/main/java/com/zy/common/utils/NavigateMapUtils.java b/src/main/java/com/zy/common/utils/NavigateMapUtils.java index d6f3cc3..1308af1 100644 --- a/src/main/java/com/zy/common/utils/NavigateMapUtils.java +++ b/src/main/java/com/zy/common/utils/NavigateMapUtils.java @@ -7,6 +7,7 @@ import com.zy.common.model.MapNode; import com.zy.common.model.NavigateNode; import com.zy.common.model.enums.NavigationMapType; +import com.zy.core.enums.MapNodeType; import com.zy.core.enums.RedisKeyType; import org.springframework.stereotype.Component; @@ -48,10 +49,10 @@ for (NavigateNode node : nodes) { List<MapNode> listX = listsHasShuttle.get(node.getX()); MapNode mapNode = listX.get(node.getY()); - if (mapNode.getValue() == -999) { + if (mapNode.getValue() == MapNodeType.LOCK.id) { return false;//璺緞琚攣瀹氳繃锛岀姝㈠啀娆¢攣瀹� } - if (mapNode.getValue() == 66) { + if (mapNode.getValue() == MapNodeType.CAR.id) { return false;//璺緞瀛樺湪灏忚溅锛岀姝㈤攣瀹� } } @@ -67,7 +68,7 @@ List<MapNode> listX = lists.get(node.getX()); MapNode mapNode = listX.get(node.getY()); if (lock) { - mapNode.setValue(-999);//绂佺敤搴撲綅 + mapNode.setValue(MapNodeType.LOCK.id);//绂佺敤搴撲綅 } else { //鑾峰彇鍘熷鑺傜偣鏁版嵁 List<MapNode> rows = realMap.get(node.getX()); diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js index d741ed9..2a45d7e 100644 --- a/src/main/webapp/static/js/common.js +++ b/src/main/webapp/static/js/common.js @@ -1,4 +1,4 @@ -var baseUrl = "/tzskwcs"; +var baseUrl = "/wcs"; // 璧嬪�� function setVal(el, val) { -- Gitblit v1.9.1