From edd8ab14f72df3404b3a523e788eff2836238f3b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 16 十二月 2024 14:08:17 +0800
Subject: [PATCH] #

---
 zy-acs-manager/src/main/resources/cdaMatrix.txt                                       |  639 ++++++++++++++++++++++
 zy-acs-manager/src/main/java/com/zy/acs/manager/common/config/RedisProperties.java    |   96 +++
 zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java               |    3 
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java |  157 +++--
 zy-acs-manager/src/main/resources/agv.py                                              |  169 +++++
 zy-acs-manager/src/main/resources/codeMatrix.txt                                      |  639 ++++++++++++++++++++++
 6 files changed, 1,637 insertions(+), 66 deletions(-)

diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/common/config/RedisProperties.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/common/config/RedisProperties.java
new file mode 100644
index 0000000..7ec860d
--- /dev/null
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/common/config/RedisProperties.java
@@ -0,0 +1,96 @@
+package com.zy.acs.manager.common.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ * redis绯荤粺閰嶇疆
+ * Created by vincent on 2018/10/15
+ */
+@Configuration
+@ConfigurationProperties(prefix = "redis")
+public class RedisProperties {
+
+    public static String HOST_NAME;
+
+    static {
+        try {
+            HOST_NAME = InetAddress.getLocalHost().getHostName();
+        } catch (UnknownHostException e) {
+            System.err.println("find hostname err");
+        }
+    }
+
+    private String host;
+
+    private String password;
+
+    private int port;
+
+    private int min;
+
+    private int max;
+
+    private int timeout;
+
+    private int index;
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public int getMin() {
+        return min;
+    }
+
+    public void setMin(int min) {
+        this.min = min;
+    }
+
+    public int getMax() {
+        return max;
+    }
+
+    public void setMax(int max) {
+        this.max = max;
+    }
+
+    public int getTimeout() {
+        return timeout;
+    }
+
+    public void setTimeout(int timeout) {
+        this.timeout = timeout;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
+}
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java
index ca758b1..243f30f 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AvoidWaveCalculator.java
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zy.acs.common.utils.Utils;
 import com.zy.acs.framework.common.Cools;
+import com.zy.acs.manager.common.config.RedisProperties;
 import com.zy.acs.manager.common.utils.MapDataUtils;
 import com.zy.acs.manager.core.constant.MapDataConstant;
 import com.zy.acs.manager.core.service.astart.DynamicNodeType;
@@ -13,6 +14,7 @@
 import com.zy.acs.manager.manager.entity.AgvDetail;
 import com.zy.acs.manager.manager.entity.AgvModel;
 import com.zy.acs.manager.manager.entity.Code;
+import com.zy.acs.manager.manager.enums.AgvModelType;
 import com.zy.acs.manager.manager.service.AgvDetailService;
 import com.zy.acs.manager.manager.service.AgvModelService;
 import com.zy.acs.manager.manager.service.AgvService;
@@ -20,10 +22,16 @@
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.time.StopWatch;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -55,6 +63,8 @@
     private CodeService codeService;
     @Autowired
     private MapService mapService;
+    @Autowired
+    private RedisProperties redisProperties;
 
     @PostConstruct
     @SuppressWarnings("all")
@@ -89,78 +99,95 @@
                 return;
             }
 
-//            AgvModel agvModel = agvModelService.selectByType(AgvModelType.CTU_BOX_TRANSPORT_AGV.toString());    // can be optimized
-//
-//            Double avoidDistance = MapDataUtils.getVehicleWaveSafeDistance(agvModel.getDiameter(), MapDataConstant.MAX_DISTANCE_BETWEEN_ADJACENT_AGV_FACTOR);
-//
-//            long startTime = System.currentTimeMillis();
-//
-//            ProcessBuilder processBuilder = new ProcessBuilder("python"
-//                    , "D:\\tmp\\pyagv\\agv4.py"
-//                    , String.valueOf(avoidDistance)
-//            );
-//            processBuilder.redirectErrorStream(true);
-//
-//            try {
-//                Process process = processBuilder.start();
-//
-//                // 璇诲彇Python鑴氭湰鐨勮緭鍑�
-//                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
-//                String line;
-//                StringBuilder builder = new StringBuilder();
-//                while ((line = reader.readLine()) != null) {
-//                    builder.append(line);
-//                }
-//
-//                // 绛夊緟Python鑴氭湰鎵ц瀹屾垚
-//                int exitCode = process.waitFor();
-//                if (exitCode != 0) {
-//                    System.out.println("Python script exited with error code: " + exitCode);
-//                    return;
-//                }
-//                reader.close();
-//
-//                if (builder.length() <= 0) {
-//                    return;
-//                }
-//
-//                String result = builder.toString();
-//
-//                if (!Cools.isEmpty(result)) {
-//                    if (!"1".equals(result)) {
-//                        log.error("Fail python");
-//                    }
-//                }
-//            } catch (IOException | InterruptedException e) {
-//                e.printStackTrace();
-//            }
-//            log.error("python finish {}", System.currentTimeMillis() - startTime);
+            // python
+            AgvModel agvModel = agvModelService.selectByType(AgvModelType.CTU_BOX_TRANSPORT_AGV.toString());    // can be optimized
+            Double avoidDistance = MapDataUtils.getVehicleWaveSafeDistance(agvModel.getDiameter(), MapDataConstant.MAX_DISTANCE_BETWEEN_ADJACENT_AGV_FACTOR);
 
-            String[][] codeMatrix = mapDataDispatcher.getCodeMatrix(lev);
-            String[][] waveMatrix = mapDataDispatcher.initWaveMatrix(lev);
-//
-//            // lock path
-            DynamicNode[][] dynamicMatrix = mapDataDispatcher.getDynamicMatrix(lev);
-            for (int i = 0; i < dynamicMatrix.length; i++) {
-                for (int j = 0; j < dynamicMatrix[i].length; j++) {
-                    DynamicNode dynamicNode = dynamicMatrix[i][j];
-                    String vehicle = dynamicNode.getVehicle();
-                    if (!DynamicNodeType.ACCESS.val.equals(vehicle) && !DynamicNodeType.BLOCK.val.equals(vehicle)) {
-                        AgvModel agvModel = agvModelService.getById(agvService.selectByUuid(vehicle).getAgvModel());    // can be optimized
+            long startTime = System.currentTimeMillis();
 
-                        Double avoidDistance = MapDataUtils.getVehicleWaveSafeDistance(agvModel.getDiameter(), MapDataConstant.MAX_DISTANCE_BETWEEN_ADJACENT_AGV_FACTOR);
-                        List<NavigateNode> includeList = mapService.getWaveScopeByCode(lev, codeMatrix[i][j], avoidDistance);
+            Resource codeMatrixResource = new ClassPathResource("codeMatrix.txt");
+            Resource cdaMatrixResource = new ClassPathResource("cdaMatrix.txt");
 
-                        for (NavigateNode navigateNode : includeList) {
-                            String waveNode = waveMatrix[navigateNode.getX()][navigateNode.getY()]; // overlay
-                            waveMatrix[navigateNode.getX()][navigateNode.getY()] = MapDataUtils.generateWaveNode(waveNode, vehicle);
-                        }
+            File codeMatrixFile = codeMatrixResource.getFile();
+            File cdaMatrixFile = cdaMatrixResource.getFile();
+
+            String codeMatrixPath = codeMatrixFile.getAbsolutePath();
+            String cdaMatrixPath = cdaMatrixFile.getAbsolutePath();
+
+            Resource resource = new ClassPathResource("agv.py");
+            File file = resource.getFile();
+            ProcessBuilder processBuilder = new ProcessBuilder(
+                    "python"
+                    , file.getAbsolutePath()
+                    , String.valueOf(avoidDistance)
+                    , codeMatrixPath
+                    , cdaMatrixPath
+                    , redisProperties.getHost()
+                    , redisProperties.getPassword()
+                    , String.valueOf(redisProperties.getPort())
+                    , String.valueOf(redisProperties.getIndex())
+            );
+            processBuilder.redirectErrorStream(true);
+
+            try {
+                Process process = processBuilder.start();
+
+                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+                String line;
+                StringBuilder builder = new StringBuilder();
+                while ((line = reader.readLine()) != null) {
+                    builder.append(line);
+                }
+
+                int exitCode = process.waitFor();
+                if (exitCode != 0) {
+                    System.out.println("Python script exited with error code: " + exitCode);
+                    return;
+                }
+                reader.close();
+
+                if (builder.length() <= 0) {
+                    return;
+                }
+
+                String result = builder.toString();
+
+                if (!Cools.isEmpty(result)) {
+                    if (!"1".equals(result)) {
+                        log.error("Fail python");
                     }
                 }
+            } catch (IOException | InterruptedException e) {
+                e.printStackTrace();
             }
+            log.error("python finish {}", System.currentTimeMillis() - startTime);
 
-//            mapDataDispatcher.printMatrix(waveMatrix);
-            mapDataDispatcher.setWaveMatrix(lev, waveMatrix);
+            // java
+//            String[][] codeMatrix = mapDataDispatcher.getCodeMatrix(lev);
+//            String[][] waveMatrix = mapDataDispatcher.initWaveMatrix(lev);
+//
+//            // lock path
+//            DynamicNode[][] dynamicMatrix = mapDataDispatcher.getDynamicMatrix(lev);
+//            for (int i = 0; i < dynamicMatrix.length; i++) {
+//                for (int j = 0; j < dynamicMatrix[i].length; j++) {
+//                    DynamicNode dynamicNode = dynamicMatrix[i][j];
+//                    String vehicle = dynamicNode.getVehicle();
+//                    if (!DynamicNodeType.ACCESS.val.equals(vehicle) && !DynamicNodeType.BLOCK.val.equals(vehicle)) {
+//                        AgvModel agvModel = agvModelService.getById(agvService.selectByUuid(vehicle).getAgvModel());    // can be optimized
+//
+//                        Double avoidDistance = MapDataUtils.getVehicleWaveSafeDistance(agvModel.getDiameter(), MapDataConstant.MAX_DISTANCE_BETWEEN_ADJACENT_AGV_FACTOR);
+//                        List<NavigateNode> includeList = mapService.getWaveScopeByCode(lev, codeMatrix[i][j], avoidDistance);
+//
+//                        for (NavigateNode navigateNode : includeList) {
+//                            String waveNode = waveMatrix[navigateNode.getX()][navigateNode.getY()]; // overlay
+//                            waveMatrix[navigateNode.getX()][navigateNode.getY()] = MapDataUtils.generateWaveNode(waveNode, vehicle);
+//                        }
+//                    }
+//                }
+//            }
+//
+////            mapDataDispatcher.printMatrix(waveMatrix);
+//            mapDataDispatcher.setWaveMatrix(lev, waveMatrix);
 
         } catch (Exception e) {
 
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
index 7b3937e..5eeab25 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/fake/FakeProcessor.java
@@ -16,6 +16,7 @@
 import com.zy.acs.manager.system.service.ConfigService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -59,7 +60,7 @@
      * 4.AgvServiceImpl.judgeOnline
      * 5.
      */
-//    @Scheduled(cron = "0/1 * * * * ? ")
+    @Scheduled(cron = "0/1 * * * * ? ")
     public void process() {
         Boolean fakeSign = configService.getVal("fakeSign", Boolean.class);
         if (null == fakeSign || !fakeSign) {
diff --git a/zy-acs-manager/src/main/resources/agv.py b/zy-acs-manager/src/main/resources/agv.py
new file mode 100644
index 0000000..1b2669a
--- /dev/null
+++ b/zy-acs-manager/src/main/resources/agv.py
@@ -0,0 +1,169 @@
+import ast
+import sys
+
+import numpy as np
+import json
+import time
+import redis
+
+radiusLen = None
+
+#with open("./codeMatrix.txt", "r") as file:
+#    codeMatrix = np.array(json.loads(file.read()))
+
+#with open("./cdaMatrix.txt", "r") as file:
+#    data = json.loads(file.read())
+#    cdaMatrix = np.array(data)
+
+# 灏嗗瓧绗︿覆杞崲涓烘诞鐐瑰瀷鏁扮粍
+def convert_to_float_array(str_array):
+    if isinstance(str_array, str):
+        return np.array(ast.literal_eval(str_array), dtype=float)
+    return str_array
+
+def getWaveScopeByCode(x, y):
+    code = codeMatrix[x, y]
+    includeList = []
+    existNodes = set()
+    spreadWaveNode({"x": x, "y": y}, {"x": x, "y": y}, existNodes, includeList)
+    return includeList
+
+def spreadWaveNode(originNode, currNode, existNodes, includeList):
+    x, y = currNode['x'], currNode['y']
+    neighbors = [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]
+    for neighbor in neighbors:
+        extendNeighborNodes(originNode, {"x": neighbor[0], "y": neighbor[1]}, existNodes, includeList)
+
+def extendNeighborNodes(originNode, nextNode, existNodes, includeList):
+    x, y = nextNode['x'], nextNode['y']
+    if (x < 0 or x >= codeMatrix.shape[0] or y < 0 or y >= codeMatrix.shape[1]):
+        return
+
+    if (x, y) in existNodes:
+        return
+
+    existNodes.add((x, y))
+
+    nextNodeCodeData = codeMatrix[x, y]
+
+    if nextNodeCodeData == 'NONE':
+        spreadWaveNode(originNode, nextNode, existNodes, includeList)
+    else:
+        o1Cda = convert_to_float_array(cdaMatrix[originNode['x'], originNode['y']])
+        o2Cda = convert_to_float_array(cdaMatrix[x, y])
+
+        num1 = (o1Cda[0] - o2Cda[0]) ** 2
+        num2 = (o1Cda[1] - o2Cda[1]) ** 2
+        if num1 + num2 <= radiusLen ** 2:
+            includeList.append({"x": int(x), "y": int(y), "code": str(codeMatrix[x, y])})
+            spreadWaveNode(originNode, nextNode, existNodes, includeList)
+
+# 鎵惧埌鏌愪釜鍊煎搴旂殑 x, y 涓嬫爣
+def find_value_in_matrix(value):
+    indices = np.where(codeMatrix == value)
+    return list(zip(indices[0], indices[1]))
+
+def initWaveMatrix():
+    lev = 1
+    waveMatrix = np.empty_like(codeMatrix, dtype=object)
+
+    for x in range(codeMatrix.shape[0]):
+        for y in range(codeMatrix.shape[1]):
+            if codeMatrix[x][y] == 'NONE':
+                waveMatrix[x][y] = "-"
+            else:
+                waveMatrix[x][y] = '[]'
+
+    return waveMatrix
+
+# 浼樺寲鐗堟湰锛氫娇鐢ㄩ泦鍚堟潵鎻愰珮鎬ц兘
+def mergeWave(originWave, vehicle):
+    # 灏嗗瓧绗︿覆瑙f瀽涓洪泦鍚�
+    set_data = set(ast.literal_eval(originWave))
+    # 濡傛灉 vehicle 涓嶅湪闆嗗悎涓紝鍒欐坊鍔�
+    set_data.add(vehicle)
+    # 杩斿洖搴忓垪鍖栧悗鐨勫瓧绗︿覆
+    return json.dumps(list(set_data))
+
+# 灏� dynamicMatrix 杞崲涓� numpy 缁撴瀯鍖栨暟缁�
+def convert_to_structured_array(dynamicMatrix):
+    # 瀹氫箟缁撴瀯鍖栨暟缁勭殑 dtype
+    dtype = [('serial', int), ('vehicle', 'U2')]
+    # 灏嗗祵濂楃殑鍒楄〃杞崲涓虹粨鏋勫寲鏁扮粍
+    structured_array = np.array([tuple(d.values()) for row in dynamicMatrix for d in row], dtype=dtype)
+    # 閲嶅涓哄師濮嬬殑浜岀淮褰㈢姸
+    return structured_array.reshape(len(dynamicMatrix), -1)
+
+# 浣跨敤 numpy 鍔犻�熺殑浠g爜
+def process_dynamic_matrix(dynamicMatrix, codeMatrix):
+    # 灏� dynamicMatrix 杞崲涓虹粨鏋勫寲鏁扮粍
+    dynamicMatrix = convert_to_structured_array(dynamicMatrix)
+
+    # 鑾峰彇 dynamicMatrix 鐨勫舰鐘�
+    rows, cols = dynamicMatrix.shape
+
+    # 鍒涘缓涓�涓竷灏旀帺鐮侊紝鐢ㄤ簬绛涢�夊嚭 vehicle 涓嶄负 '0' 鍜� '-1' 鐨勫厓绱�
+    mask = (dynamicMatrix['vehicle'] != '0') & (dynamicMatrix['vehicle'] != '-1')
+
+    # 鑾峰彇婊¤冻鏉′欢鐨� x 鍜� y 鍧愭爣
+    x_indices, y_indices = np.where(mask)
+
+    # 閬嶅巻婊¤冻鏉′欢鐨勫潗鏍�
+    for x, y in zip(x_indices, y_indices):
+        # print(code)
+        data = dynamicMatrix[x][y]
+        vehicle = data['vehicle']
+        includeList = getWaveScopeByCode(x,y)
+        for include in includeList:
+            originWave = waveMatrix[include['x']][include['y']]
+            waveMatrix[include['x']][include['y']] = mergeWave(originWave, vehicle)
+
+radiusLenStr = sys.argv[1]
+radiusLen = float(radiusLenStr)
+
+codeMatrixPath = sys.argv[2]
+cdaMatrixPath = sys.argv[3]
+
+redisHost = sys.argv[4]
+redisPwd = sys.argv[5]
+redisPort = sys.argv[6]
+redisIdx = sys.argv[7]
+
+with open(codeMatrixPath, "r") as file:
+    codeMatrix = np.array(json.loads(file.read()))
+
+with open(cdaMatrixPath, "r") as file:
+    data = json.loads(file.read())
+    cdaMatrix = np.array(data)
+
+startTime = time.perf_counter()
+
+waveMatrix = initWaveMatrix()
+
+# 鍒涘缓涓�涓繛鎺ユ睜
+pool = redis.ConnectionPool(host=redisHost, port=int(redisPort), password=redisPwd, db=int(redisIdx))
+r = redis.Redis(connection_pool=pool)
+dynamicMatrixStr = r.get('KV.AGV_MAP_ASTAR_DYNAMIC_FLAG.1')
+
+dynamicMatrix = np.array(json.loads(dynamicMatrixStr))
+# # 浣跨敤 numpy 鍔犻�熺殑浠g爜
+process_dynamic_matrix(dynamicMatrix, codeMatrix)
+
+# for x in range(dynamicMatrix.shape[0]):
+#     for y in range(dynamicMatrix.shape[1]):
+#         data = dynamicMatrix[x, y]
+#         vehicle = data['vehicle']
+#         if vehicle != '0' and vehicle != '-1':
+#             getWaveScopeByCode(x, y)
+
+# 灏� numpy.ndarray 杞崲涓哄祵濂楀垪琛�
+waveMatrixList = waveMatrix.tolist()
+# 灏嗗祵濂楀垪琛ㄨ浆鎹负 JSON 瀛楃涓�
+waveMatrixJsonStr = json.dumps(waveMatrixList)
+
+r.set("KV.AGV_MAP_ASTAR_WAVE_FLAG.1",waveMatrixJsonStr)
+
+end = time.perf_counter()
+# print('绋嬪簭杩愯鏃堕棿涓�: %s Seconds' % (end - startTime))
+print("1")
+
diff --git a/zy-acs-manager/src/main/resources/cdaMatrix.txt b/zy-acs-manager/src/main/resources/cdaMatrix.txt
new file mode 100644
index 0000000..6aafc6e
--- /dev/null
+++ b/zy-acs-manager/src/main/resources/cdaMatrix.txt
@@ -0,0 +1,639 @@
+[
+    [
+        "-",
+        "-",
+        "[0.0,0.0]",
+        "[1235.0,0.0]",
+        "[2470.0,0.0]",
+        "[3705.0,0.0]",
+        "[4940.0,0.0]",
+        "[6175.0,0.0]",
+        "[7183.0,0.0]",
+        "[8191.0,0.0]",
+        "[9199.0,0.0]"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,918.0]",
+        "-",
+        "[2470.0,918.0]",
+        "-",
+        "[4940.0,918.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "[7183.0,1008.0]",
+        "-",
+        "[9199.0,1008.0]"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,1423.0]",
+        "-",
+        "[2470.0,1423.0]",
+        "-",
+        "[4940.0,1423.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,1928.0]",
+        "-",
+        "[2470.0,1928.0]",
+        "-",
+        "[4940.0,1928.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "[7183.0,2016.0]",
+        "[8191.0,2016.0]",
+        "[9199.0,2016.0]"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,2433.0]",
+        "-",
+        "[2470.0,2433.0]",
+        "-",
+        "[4940.0,2433.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,3098.0]",
+        "-",
+        "[2470.0,3098.0]",
+        "-",
+        "[4940.0,3098.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,3603.0]",
+        "-",
+        "[2470.0,3603.0]",
+        "-",
+        "[4940.0,3603.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,4108.0]",
+        "-",
+        "[2470.0,4108.0]",
+        "-",
+        "[4940.0,4108.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,4613.0]",
+        "-",
+        "[2470.0,4613.0]",
+        "-",
+        "[4940.0,4613.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,5531.5]",
+        "-",
+        "[2470.0,5531.5]",
+        "-",
+        "[4940.0,5531.5]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,6449.5]",
+        "[1235.0,6449.5]",
+        "[2470.0,6449.5]",
+        "[3705.0,6449.5]",
+        "[4940.0,6449.5]",
+        "[6175.0,6449.5]",
+        "[7183.0,6449.5]",
+        "[8191.0,6449.5]",
+        "[9199.0,6449.5]"
+    ],
+    [
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "[7183.0,7457.5]",
+        "-",
+        "[9199.0,7457.5]"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,7458.0]",
+        "-",
+        "[2470.0,7458.0]",
+        "-",
+        "[4940.0,7458.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,7963.0]",
+        "-",
+        "[2470.0,7963.0]",
+        "-",
+        "[4940.0,7963.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "-",
+        "[7183.0,8465.5]",
+        "[8191.0,8465.5]",
+        "[9199.0,8465.5]"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,8468.0]",
+        "-",
+        "[2470.0,8468.0]",
+        "-",
+        "[4940.0,8468.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,8973.0]",
+        "-",
+        "[2470.0,8973.0]",
+        "-",
+        "[4940.0,8973.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,9638.0]",
+        "-",
+        "[2470.0,9638.0]",
+        "-",
+        "[4940.0,9638.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,10143.0]",
+        "-",
+        "[2470.0,10143.0]",
+        "-",
+        "[4940.0,10143.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,10648.0]",
+        "-",
+        "[2470.0,10648.0]",
+        "-",
+        "[4940.0,10648.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,11153.0]",
+        "-",
+        "[2470.0,11153.0]",
+        "-",
+        "[4940.0,11153.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,11818.0]",
+        "-",
+        "[2470.0,11818.0]",
+        "-",
+        "[4940.0,11818.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,12323.0]",
+        "-",
+        "[2470.0,12323.0]",
+        "-",
+        "[4940.0,12323.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,12828.0]",
+        "-",
+        "[2470.0,12828.0]",
+        "-",
+        "[4940.0,12828.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,13333.0]",
+        "-",
+        "[2470.0,13333.0]",
+        "-",
+        "[4940.0,13333.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,14251.5]",
+        "-",
+        "[2470.0,14251.5]",
+        "-",
+        "[4940.0,14251.5]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,15169.5]",
+        "[1235.0,15169.5]",
+        "[2470.0,15169.5]",
+        "[3705.0,15169.5]",
+        "[4940.0,15169.5]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,16178.0]",
+        "-",
+        "[2470.0,16178.0]",
+        "-",
+        "[4940.0,16178.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,16683.0]",
+        "-",
+        "[2470.0,16683.0]",
+        "-",
+        "[4940.0,16683.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,17188.0]",
+        "-",
+        "[2470.0,17188.0]",
+        "-",
+        "[4940.0,17188.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,17693.0]",
+        "-",
+        "[2470.0,17693.0]",
+        "-",
+        "[4940.0,17693.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,18358.0]",
+        "-",
+        "[2470.0,18358.0]",
+        "-",
+        "[4940.0,18358.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,18863.0]",
+        "-",
+        "[2470.0,18863.0]",
+        "-",
+        "[4940.0,18863.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,19368.0]",
+        "-",
+        "[2470.0,19368.0]",
+        "-",
+        "[4940.0,19368.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,19873.0]",
+        "-",
+        "[2470.0,19873.0]",
+        "-",
+        "[4940.0,19873.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,20791.5]",
+        "-",
+        "[2470.0,20791.5]",
+        "-",
+        "[4940.0,20791.5]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,21709.5]",
+        "[1235.0,21709.5]",
+        "[2470.0,21709.5]",
+        "[3705.0,21709.5]",
+        "[4940.0,21709.5]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,22718.0]",
+        "-",
+        "[2470.0,22718.0]",
+        "-",
+        "[4940.0,22718.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,23223.0]",
+        "-",
+        "[2470.0,23223.0]",
+        "-",
+        "[4940.0,23223.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,23728.0]",
+        "-",
+        "[2470.0,23728.0]",
+        "-",
+        "[4940.0,23728.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,24233.0]",
+        "-",
+        "[2470.0,24233.0]",
+        "-",
+        "[4940.0,24233.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,24898.0]",
+        "-",
+        "[2470.0,24898.0]",
+        "-",
+        "[4940.0,24898.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,25403.0]",
+        "-",
+        "[2470.0,25403.0]",
+        "-",
+        "[4940.0,25403.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,25908.0]",
+        "-",
+        "[2470.0,25908.0]",
+        "-",
+        "[4940.0,25908.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,26413.0]",
+        "-",
+        "[2470.0,26413.0]",
+        "-",
+        "[4940.0,26413.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "-",
+        "-",
+        "[0.0,27331.0]",
+        "-",
+        "[2470.0,27331.0]",
+        "-",
+        "[4940.0,27331.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ],
+    [
+        "[-2243.0,28249.0]",
+        "[-1235.0,28249.0]",
+        "[0.0,28249.0]",
+        "[1235.0,28249.0]",
+        "[2470.0,28249.0]",
+        "[3705.0,28249.0]",
+        "[4940.0,28249.0]",
+        "-",
+        "-",
+        "-",
+        "-"
+    ]
+]
\ No newline at end of file
diff --git a/zy-acs-manager/src/main/resources/codeMatrix.txt b/zy-acs-manager/src/main/resources/codeMatrix.txt
new file mode 100644
index 0000000..dd3781c
--- /dev/null
+++ b/zy-acs-manager/src/main/resources/codeMatrix.txt
@@ -0,0 +1,639 @@
+[
+    [
+        "NONE",
+        "NONE",
+        "00000001",
+        "00000051",
+        "00000101",
+        "00000151",
+        "00000201",
+        "00000251",
+        "00000301",
+        "00000351",
+        "00000401"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000002",
+        "NONE",
+        "00000102",
+        "NONE",
+        "00000202",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "00000302",
+        "NONE",
+        "00000402"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000003",
+        "NONE",
+        "00000103",
+        "NONE",
+        "00000203",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000004",
+        "NONE",
+        "00000104",
+        "NONE",
+        "00000204",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "00000303",
+        "00000353",
+        "00000403"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000005",
+        "NONE",
+        "00000105",
+        "NONE",
+        "00000205",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000006",
+        "NONE",
+        "00000106",
+        "NONE",
+        "00000206",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000007",
+        "NONE",
+        "00000107",
+        "NONE",
+        "00000207",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000008",
+        "NONE",
+        "00000108",
+        "NONE",
+        "00000208",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000009",
+        "NONE",
+        "00000109",
+        "NONE",
+        "00000209",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000010",
+        "NONE",
+        "00000110",
+        "NONE",
+        "00000210",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000011",
+        "00000061",
+        "00000111",
+        "00000161",
+        "00000211",
+        "00000261",
+        "00000311",
+        "00000361",
+        "00000411"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "00000312",
+        "NONE",
+        "00000412"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000012",
+        "NONE",
+        "00000112",
+        "NONE",
+        "00000212",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000013",
+        "NONE",
+        "00000113",
+        "NONE",
+        "00000213",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE",
+        "00000313",
+        "00000363",
+        "00000413"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000014",
+        "NONE",
+        "00000114",
+        "NONE",
+        "00000214",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000015",
+        "NONE",
+        "00000115",
+        "NONE",
+        "00000215",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000016",
+        "NONE",
+        "00000116",
+        "NONE",
+        "00000216",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000017",
+        "NONE",
+        "00000117",
+        "NONE",
+        "00000217",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000018",
+        "NONE",
+        "00000118",
+        "NONE",
+        "00000218",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000019",
+        "NONE",
+        "00000119",
+        "NONE",
+        "00000219",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000020",
+        "NONE",
+        "00000120",
+        "NONE",
+        "00000220",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000021",
+        "NONE",
+        "00000121",
+        "NONE",
+        "00000221",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000022",
+        "NONE",
+        "00000122",
+        "NONE",
+        "00000222",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000023",
+        "NONE",
+        "00000123",
+        "NONE",
+        "00000223",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000024",
+        "NONE",
+        "00000124",
+        "NONE",
+        "00000224",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000025",
+        "00000075",
+        "00000125",
+        "00000175",
+        "00000225",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000026",
+        "NONE",
+        "00000126",
+        "NONE",
+        "00000226",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000027",
+        "NONE",
+        "00000127",
+        "NONE",
+        "00000227",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000028",
+        "NONE",
+        "00000128",
+        "NONE",
+        "00000228",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000029",
+        "NONE",
+        "00000129",
+        "NONE",
+        "00000229",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000030",
+        "NONE",
+        "00000130",
+        "NONE",
+        "00000230",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000031",
+        "NONE",
+        "00000131",
+        "NONE",
+        "00000231",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000032",
+        "NONE",
+        "00000132",
+        "NONE",
+        "00000232",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000033",
+        "NONE",
+        "00000133",
+        "NONE",
+        "00000233",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000034",
+        "NONE",
+        "00000134",
+        "NONE",
+        "00000234",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000035",
+        "00000085",
+        "00000135",
+        "00000185",
+        "00000235",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000036",
+        "NONE",
+        "00000136",
+        "NONE",
+        "00000236",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000037",
+        "NONE",
+        "00000137",
+        "NONE",
+        "00000237",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000038",
+        "NONE",
+        "00000138",
+        "NONE",
+        "00000238",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000039",
+        "NONE",
+        "00000139",
+        "NONE",
+        "00000239",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000040",
+        "NONE",
+        "00000140",
+        "NONE",
+        "00000240",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000041",
+        "NONE",
+        "00000141",
+        "NONE",
+        "00000241",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000042",
+        "NONE",
+        "00000142",
+        "NONE",
+        "00000242",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000043",
+        "NONE",
+        "00000143",
+        "NONE",
+        "00000243",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "NONE",
+        "NONE",
+        "00000044",
+        "NONE",
+        "00000144",
+        "NONE",
+        "00000244",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ],
+    [
+        "00000047",
+        "00000046",
+        "00000045",
+        "00000095",
+        "00000145",
+        "00000195",
+        "00000245",
+        "NONE",
+        "NONE",
+        "NONE",
+        "NONE"
+    ]
+]
\ No newline at end of file

--
Gitblit v1.9.1