#
Junjie
2025-01-07 a6419abb1e5dc63f8957da5eb45c82d49b86cbc9
#
4个文件已修改
61 ■■■■ 已修改文件
pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NavigateMapData.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NavigateMapUtils.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -189,7 +189,7 @@
    </dependencies>
    <build>
        <finalName>tzskwcs</finalName>
        <finalName>wcs</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
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) {
                //过滤库位状态X
                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;
    }
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());
src/main/webapp/static/js/common.js
@@ -1,4 +1,4 @@
var baseUrl = "/tzskwcs";
var baseUrl = "/wcs";
// 赋值
function setVal(el, val) {