自动化立体仓库 - WCS系统
#
Junjie
2024-03-16 429bc159b230ed31092aed3b8c4893c20e52f5c6
src/main/java/com/zy/common/utils/NavigateMapData.java
@@ -11,6 +11,7 @@
import com.zy.common.model.enums.NavigationMapType;
import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.ShuttleTaskModeType;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Component;
import java.io.*;
@@ -41,9 +42,15 @@
    public int[][] getData(Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        try {
            String mapFilename = "map_" + lev + ".json";
            ClassPathResource classPathResource = new ClassPathResource(mapFilename);
            InputStream inputStream = classPathResource.getInputStream();
            byte[] buffer = new byte[inputStream.available()];
            inputStream.read(buffer);
            File file = File.createTempFile("prefix","suffix");
            try (OutputStream outStream = new FileOutputStream(file)) {
                outStream.write(buffer);
            }
            String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//获取文件路径
            File file = new File(fileName);
            StringBuffer stringBuffer = new StringBuffer();
            if (file.isFile() && file.exists()) {
                InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
@@ -120,9 +127,15 @@
    public List<List<MapNode>> getJsonData(Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        try {
            String mapFilename = "map_" + lev + ".json";
            ClassPathResource classPathResource = new ClassPathResource(mapFilename);
            InputStream inputStream = classPathResource.getInputStream();
            byte[] buffer = new byte[inputStream.available()];
            inputStream.read(buffer);
            File file = File.createTempFile("prefix","suffix");
            try (OutputStream outStream = new FileOutputStream(file)) {
                outStream.write(buffer);
            }
            String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//获取文件路径
            File file = new File(fileName);
            StringBuffer stringBuffer = new StringBuffer();
            if (file.isFile() && file.exists()) {
                InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
@@ -151,9 +164,15 @@
    public List<List<MapNode>> getJsonData(Integer lev, Integer mapType, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        try {
            String mapFilename = "map_" + lev + ".json";
            ClassPathResource classPathResource = new ClassPathResource(mapFilename);
            InputStream inputStream = classPathResource.getInputStream();
            byte[] buffer = new byte[inputStream.available()];
            inputStream.read(buffer);
            File file = File.createTempFile("prefix","suffix");
            try (OutputStream outStream = new FileOutputStream(file)) {
                outStream.write(buffer);
            }
            String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//获取文件路径
            File file = new File(fileName);
            StringBuffer stringBuffer = new StringBuffer();
            if (file.isFile() && file.exists()) {
                InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
@@ -234,7 +253,7 @@
                        || locMast.getLocSts().equals("D")
                        || locMast.getLocSts().equals("X")
                        || locMast.getLocSts().equals("R")
//                        || locMast.getLocSts().equals("P")
                        || locMast.getLocSts().equals("P")
                ) {
                    mapNode.setValue(-1);//禁用节点
                }