| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.acs.common.constant.RedisConstant; |
| | | import com.zy.acs.common.utils.GsonUtils; |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.exception.CoolException; |
| | |
| | | // return codeList.stream().map(SortCodeDto::getCode).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public void modifyDynamicMatrix(Integer lev, List<String> codeList, String vehicle) { |
| | | this.modifyDynamicMatrix(lev, codeList, vehicle, false); |
| | | public void modifyDynamicMatrix(Integer lev, List<String> codeDataList, String vehicle) { |
| | | this.modifyDynamicMatrix(lev, codeDataList, vehicle, false); |
| | | } |
| | | |
| | | public synchronized void modifyDynamicMatrix(Integer lev, List<String> codeList, String vehicle, boolean reset) { |
| | | public synchronized void modifyDynamicMatrix(Integer lev, List<String> codeDataList, String vehicle, boolean reset) { |
| | | if (Cools.isEmpty(vehicle)) { |
| | | return; |
| | | } |
| | | lev = Optional.ofNullable(lev).orElse(MAP_DEFAULT_LEV); |
| | | DynamicNode[][] dynamicMatrix = getDynamicMatrix(lev); |
| | | |
| | | if (!reset) { |
| | | if (Cools.isEmpty(codeList, vehicle)) { |
| | | return; |
| | | } |
| | | // long time = System.currentTimeMillis() / 1000; |
| | | int serial = 1; |
| | | for (String code : codeList) { |
| | | int[] node = getCodeMatrixIdx(lev, code); |
| | | dynamicMatrix[node[0]][node[1]] = new DynamicNode(vehicle, serial); |
| | | for (String codeData : codeDataList) { |
| | | int[] codeMatrixIdx = getCodeMatrixIdx(lev, codeData); |
| | | dynamicMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]] = new DynamicNode(vehicle, serial); |
| | | serial++; |
| | | } |
| | | } else { |
| | | if (Cools.isEmpty(vehicle)) { |
| | | return; |
| | | } |
| | | for (int i = 0; i < dynamicMatrix.length; i++) { |
| | | for (int j = 0; j < dynamicMatrix[i].length; j++) { |
| | | DynamicNode dynamicNode = dynamicMatrix[i][j]; |
| | |
| | | setDynamicMatrix(lev, dynamicMatrix); |
| | | } |
| | | |
| | | public void clearDynamicMatrixByCodeList(Integer lev, List<String> codeList) { |
| | | this.modifyDynamicMatrix(lev, codeList, DynamicNodeType.ACCESS.val); |
| | | public void clearDynamicMatrixByCodeList(Integer lev, List<String> codeDataList) { |
| | | this.modifyDynamicMatrix(lev, codeDataList, DynamicNodeType.ACCESS.val); |
| | | } |
| | | |
| | | public int[][] filterMapData(int[][] mapMatrix, Integer lev, List<String> lockNodes) { |