zy-acs-manager/src/main/java/com/zy/acs/manager/core/DemoController.java
@@ -108,11 +108,18 @@ // codeMatrixIdxList.add(codeMatrixIdx); // } List<int[]> codeMatrixIdxList = mapDataDispatcher.getCodeMatrixIdxList(null, path); // List<int[]> codeMatrixIdxList = mapDataDispatcher.getCodeMatrixIdxList(null, path); // System.out.println(codeMatrixIdxList.toString()); return R.ok().add(codeMatrixIdxList); // return R.ok().add(codeMatrixIdxList); for (String codeData : path) { Code code = codeService.getCacheByData(codeData); Code byId = codeService.getCacheById(code.getId()); } return R.ok(); } // @RequestMapping(value = "/system/route/generate", method = {RequestMethod.GET, RequestMethod.POST}) @@ -136,7 +143,7 @@ for (int i = 0; i < standbyFunStaList.size(); i++) { FuncSta funcSta = standbyFunStaList.get(i); Code code = codeService.getById(funcSta.getCode()); Code code = codeService.getCacheById(funcSta.getCode()); Agv agv = agvList.get(i); AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
@@ -104,7 +104,7 @@ case MOVE: Code endCode = null; if (!Cools.isEmpty(param.getEndCode())) { endCode = codeService.getById(param.getEndCode()); endCode = codeService.getCacheById(param.getEndCode()); } if (!Cools.isEmpty(param.getEndCodeStr())) { endCode = codeService.getCacheByData(param.getEndCodeStr()); zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java
@@ -84,7 +84,7 @@ if (null == agvDetail) { continue; } Long recentCode = agvDetail.getRecentCode(); if (null == recentCode) { continue; } Code code = codeService.getById(recentCode); Code code = codeService.getCacheById(recentCode); if (null == code) { continue; } MapWsAgvVo vo = new MapWsAgvVo(); zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/AllocateService.java
@@ -198,7 +198,7 @@ // distance // from AgvDetail agvDetail = agvDetailService.selectByAgvId(agvId); Code agvCurrCode = codeService.getById(agvDetail.getRecentCode()); Code agvCurrCode = codeService.getCacheById(agvDetail.getRecentCode()); Double[] fromPosition = new Double[]{agvCurrCode.getX(), agvCurrCode.getY()}; // to Code firstCode = null; @@ -207,20 +207,20 @@ case LOC_TO_LOC: case LOC_TO_STA: Loc oriLoc = locService.getById(task.getOriLoc()); firstCode = codeService.getById(oriLoc.getCode()); firstCode = codeService.getCacheById(oriLoc.getCode()); break; case STA_TO_LOC: case STA_TO_STA: Sta oriSta = staService.getById(task.getOriSta()); firstCode = codeService.getById(oriSta.getCode()); firstCode = codeService.getCacheById(oriSta.getCode()); break; case TO_CHARGE: case TO_STANDBY: case MOVE: firstCode = codeService.getById(task.getDestCode()); firstCode = codeService.getCacheById(task.getDestCode()); break; default: firstCode = codeService.getById(task.getDestCode()); firstCode = codeService.getCacheById(task.getDestCode()); break; } assert null != firstCode; zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/LaneService.java
@@ -131,7 +131,7 @@ for (Code code : codeList) { List<Long> adjacencyNode = routeService.getAdjacencyNode(code.getId()); this.adjacencyCodeMap.put(code.getData(), adjacencyNode.stream().map(node -> ( codeService.getById(node).getData() codeService.getCacheById(node).getData() )).collect(Collectors.toList())); } } zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -301,8 +301,8 @@ oriLoc = locService.getById(task.getOriLoc()); destLoc = locService.getById(task.getDestLoc()); startCode = codeService.getById(oriLoc.getCode()); endCode = codeService.getById(destLoc.getCode()); startCode = codeService.getCacheById(oriLoc.getCode()); endCode = codeService.getCacheById(destLoc.getCode()); TaskPosDto.packagePosGroup(groups, task, startCode, TaskPosDto.PosType.ORI_LOC, sameGroupXy); TaskPosDto.packagePosGroup(groups, task, endCode, TaskPosDto.PosType.DEST_LOC, sameGroupXy); @@ -311,8 +311,8 @@ oriLoc = locService.getById(task.getOriLoc()); destSta = staService.getById(task.getDestSta()); startCode = codeService.getById(oriLoc.getCode()); endCode = codeService.getById(destSta.getCode()); startCode = codeService.getCacheById(oriLoc.getCode()); endCode = codeService.getCacheById(destSta.getCode()); TaskPosDto.packagePosGroup(groups, task, startCode, TaskPosDto.PosType.ORI_LOC, sameGroupXy); TaskPosDto.packagePosGroup(groups, task, endCode, TaskPosDto.PosType.DEST_STA, sameGroupXy); @@ -321,8 +321,8 @@ oriSta = staService.getById(task.getOriSta()); destLoc = locService.getById(task.getDestLoc()); startCode = codeService.getById(oriSta.getCode()); endCode = codeService.getById(destLoc.getCode()); startCode = codeService.getCacheById(oriSta.getCode()); endCode = codeService.getCacheById(destLoc.getCode()); TaskPosDto.packagePosGroup(groups, task, startCode, TaskPosDto.PosType.ORI_STA, sameGroupXy); TaskPosDto.packagePosGroup(groups, task, endCode, TaskPosDto.PosType.DEST_LOC, sameGroupXy); @@ -331,8 +331,8 @@ oriSta = staService.getById(task.getOriSta()); destSta = staService.getById(task.getDestSta()); startCode = codeService.getById(oriSta.getCode()); endCode = codeService.getById(destSta.getCode()); startCode = codeService.getCacheById(oriSta.getCode()); endCode = codeService.getCacheById(destSta.getCode()); TaskPosDto.packagePosGroup(groups, task, startCode, TaskPosDto.PosType.ORI_STA, sameGroupXy); TaskPosDto.packagePosGroup(groups, task, endCode, TaskPosDto.PosType.DEST_STA, sameGroupXy); @@ -397,7 +397,7 @@ } // re-order by agv current position Code currCode = codeService.getById(agvDetail.getRecentCode()); Code currCode = codeService.getCacheById(agvDetail.getRecentCode()); Double[] currPosition = new Double[] {currCode.getX(), currCode.getY()}; List<List<TaskPosDto>> pickGroups = new ArrayList<>(); @@ -517,7 +517,7 @@ List<FuncSta> idleFunStaList = funcStaService.findInIdleStatus(FuncStaType.query(taskType), agvId); if (!Cools.isEmpty(idleFunStaList)) { FuncSta funcSta = funcStaService.checkoutClosestFunSta(agvDetail.getRecentCode(), idleFunStaList); endCode = codeService.getById(funcSta.getCode()); endCode = codeService.getCacheById(funcSta.getCode()); } if (null == endCode) { log.warn("AGV[{}] failed to search destination,there hadn't any idle funSta,TaskTypeType:{}", agvNo, taskType.toString()); @@ -666,7 +666,7 @@ List<Action> actionList = new ArrayList<>(); // start node Code lastCode = codeService.getById(agvDetail.getRecentCode()); Code lastCode = codeService.getCacheById(agvDetail.getRecentCode()); Double lastDirection = agvDetail.getAgvAngle(); if (!lastCode.getData().equals(pathList.get(0))) { throw new CoolException("AGV[" + agvNo + "]定位偏移..."); @@ -679,7 +679,7 @@ Task task = taskService.getById(segment.getTaskId()); // 节点条码 Code code = codeService.getById(segment.getEndNode()); Code code = codeService.getCacheById(segment.getEndNode()); // 需要走行 if (!lastCode.getData().equals(code.getData())) { zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MapService.java
@@ -117,7 +117,7 @@ return floydNavigateService.calculatePath(startIdx, endIdx).stream().map(path -> { Long codeId = floydNavigateService.getCodeId(path); Code code = codeService.getById(codeId); Code code = codeService.getCacheById(codeId); return code.getData(); }).collect(Collectors.toList()); } zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PatrolService.java
@@ -100,7 +100,7 @@ public Code getDestinationCode(String agvNo, AgvDetail agvDetail) { Integer maxAgvCountInLane = configService.getVal("maxAgvCountInLane", Integer.class); Code startCode = codeService.getById(agvDetail.getRecentCode()); Code startCode = codeService.getCacheById(agvDetail.getRecentCode()); List<String> notInCodeList = new ArrayList<>(); notInCodeList.add("00000301"); zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/TrafficService.java
@@ -133,8 +133,8 @@ } // checkout path Code startCode = codeService.getById(agvDetail.getRecentCode()); Code endCode = codeService.getById(endNode); Code startCode = codeService.getCacheById(agvDetail.getRecentCode()); Code endCode = codeService.getCacheById(endNode); long startTime = System.currentTimeMillis(); List<String> pathList = this.checkoutPath(agv, startCode, endCode, segment); // System.out.println("checkoutPath: " + (System.currentTimeMillis() - startTime)); @@ -309,7 +309,7 @@ // block vehicle info Long blockAgvId = agvService.getAgvId(blockAgvNo); String blockAgvCode = codeService.getById(agvDetailService.selectByAgvId(blockAgvId).getRecentCode()).getData(); String blockAgvCode = codeService.getCacheById(agvDetailService.selectMajorByAgvId(blockAgvId).getRecentCode()).getData(); // create new jam if already notify the avoid vehicle if (!Cools.isEmpty(jam.getAvoAgv(), jam.getAvoSeg()) && !blockAgvId.equals(jam.getAvoAgv())) { zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/ValidService.java
@@ -127,8 +127,8 @@ oriLoc = locService.getById(task.getOriLoc()); destLoc = locService.getById(task.getDestLoc()); startCode = codeService.getById(oriLoc.getCode()); endCode = codeService.getById(destLoc.getCode()); startCode = codeService.getCacheById(oriLoc.getCode()); endCode = codeService.getCacheById(destLoc.getCode()); if (null == startCode) { throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " hasn't been bound to a QrCode yet"); } @@ -145,8 +145,8 @@ oriLoc = locService.getById(task.getOriLoc()); destSta = staService.getById(task.getDestSta()); startCode = codeService.getById(oriLoc.getCode()); endCode = codeService.getById(destSta.getCode()); startCode = codeService.getCacheById(oriLoc.getCode()); endCode = codeService.getCacheById(destSta.getCode()); if (null == startCode) { throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " hasn't been bound to QrCode yet"); } @@ -163,8 +163,8 @@ oriSta = staService.getById(task.getOriSta()); destLoc = locService.getById(task.getDestLoc()); startCode = codeService.getById(oriSta.getCode()); endCode = codeService.getById(destLoc.getCode()); startCode = codeService.getCacheById(oriSta.getCode()); endCode = codeService.getCacheById(destLoc.getCode()); if (null == startCode) { throw new BusinessException("oriSta:" + oriSta.getStaNo() + " hasn't bound to QrCode yet"); } @@ -181,8 +181,8 @@ oriSta = staService.getById(task.getOriSta()); destSta = staService.getById(task.getDestSta()); startCode = codeService.getById(oriSta.getCode()); endCode = codeService.getById(destSta.getCode()); startCode = codeService.getCacheById(oriSta.getCode()); endCode = codeService.getCacheById(destSta.getCode()); if (null == startCode) { throw new BusinessException("oriSta:" + oriSta.getStaNo() + " hasn't been bound to a QrCode yet"); } zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/astart/MapDataDispatcher.java
@@ -364,9 +364,9 @@ return; } for (Route route : routeList) { Code startCode = codeService.getById(route.getStartCode()); Code startCode = codeService.getCacheById(route.getStartCode()); int[] startCodeIdx = getCodeMatrixIdx(lev, startCode.getData()); Code endCode = codeService.getById(route.getEndCode()); Code endCode = codeService.getCacheById(route.getEndCode()); int[] codeMatrixIdx = getCodeMatrixIdx(lev, endCode.getData()); String routeKey = RouteGenerator.generateRouteKey(startCode.getData(), endCode.getData()); zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/CodeController.java
@@ -56,7 +56,7 @@ @PreAuthorize("hasAuthority('manager:code:list')") @GetMapping("/code/{id}") public R get(@PathVariable("id") Long id) { return R.ok().add(codeService.getById(id)); return R.ok().add(codeService.getCacheById(id)); } @PreAuthorize("hasAuthority('manager:code:save')") zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/DigitalController.java
@@ -55,7 +55,7 @@ AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); if (null == agvDetail) { continue; } Code currCode = codeService.getById(agvDetail.getCode()); Code currCode = codeService.getCacheById(agvDetail.getCode()); if (null == currCode) { continue; } vo.synPosition(currCode.getX(), 0, currCode.getY()); zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/MapController.java
@@ -161,7 +161,7 @@ vo.setVol(String.valueOf(agvDetail.getVol())); vo.setSoc(String.valueOf(agvDetail.getSoc())); vo.setPos(agvDetail.getPos() != null && agvDetail.getPos() == 1); Code code = codeService.getById(agvDetail.getRecentCode()); Code code = codeService.getCacheById(agvDetail.getRecentCode()); if (null != code) { vo.setCode(code.getData()); } @@ -427,7 +427,7 @@ for (Agv agv : agvList) { AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); if (null == agvDetail) { continue; } Code currCode = codeService.getById(agvDetail.getCode()); Code currCode = codeService.getCacheById(agvDetail.getCode()); MapAgvDto agvDto = new MapAgvDto(); agvDto.setUuid(agv.getUuid()); agvDto.setCurrCode(currCode==null?null:currCode.getData()); zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/RouteController.java
@@ -87,8 +87,8 @@ return R.error("Save Fail"); } Code startCode = codeService.getById(route.getStartCode()); Code endCode = codeService.getById(route.getEndCode()); Code startCode = codeService.getCacheById(route.getStartCode()); Code endCode = codeService.getCacheById(route.getEndCode()); if (null == startCode || null == endCode) { return R.error("Save Fail"); zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/result/AgvResult.java
@@ -52,7 +52,7 @@ this.setSoc(String.valueOf(agvDetail.getSoc())); } if (null != agvDetail.getRecentCode()) { this.setCode(codeService.getById(agvDetail.getRecentCode()).getData()); this.setCode(codeService.getCacheById(agvDetail.getRecentCode()).getData()); } List<Task> tasks = taskService.selectInSts(agvDetail.getAgvId(), TaskStsType.WAITING, TaskStsType.ASSIGN, TaskStsType.PROGRESS); if (!Cools.isEmpty(tasks)) { zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/AgvServiceImpl.java
@@ -171,7 +171,7 @@ AgvDetail detail = agvDetailService.selectByAgvId(agv.getId()); VehicleDto dto = new VehicleDto(); dto.setVehicle(agv.getUuid()); dto.setPosCode(codeService.getById(detail.getRecentCode()).getData()); dto.setPosCode(codeService.getCacheById(detail.getRecentCode()).getData()); res.add(dto); } return res; zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java
@@ -146,7 +146,7 @@ } if (null != codeId) { Code currCode = codeService.getById(codeId); Code currCode = codeService.getCacheById(codeId); Double[] startPos = new Double[]{currCode.getX(), currCode.getY()}; // checkout one funSta which is the closest @@ -155,10 +155,10 @@ funcStaList.sort(new Comparator<FuncSta>() { @Override public int compare(FuncSta o1, FuncSta o2) { Code o1Code = codeService.getById(o1.getCode()); Code o1Code = codeService.getCacheById(o1.getCode()); int o1Distance = CommonUtil.calcDistance(startPos, new Double[]{o1Code.getX(), o1Code.getY()}); Code o2Code = codeService.getById(o2.getCode()); Code o2Code = codeService.getCacheById(o2.getCode()); int o2Distance = CommonUtil.calcDistance(startPos, new Double[]{o2Code.getX(), o2Code.getY()}); return o1Distance - o2Distance; zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java
@@ -70,7 +70,7 @@ Long recentCode = agvDetail.getRecentCode(); String currCode = null; if (null != recentCode) { currCode = codeService.getById(recentCode).getData(); currCode = codeService.getCacheById(recentCode).getData(); } // action ------------------------------- zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/RouteServiceImpl.java
@@ -57,10 +57,10 @@ List<String> neighborCodeList = new ArrayList<>(); for (Route route : this.list(new LambdaQueryWrapper<Route>().eq(Route::getStartCode, code))) { neighborCodeList.add(codeService.getById(route.getEndCode()).getData()); neighborCodeList.add(codeService.getCacheById(route.getEndCode()).getData()); } for (Route route : this.list(new LambdaQueryWrapper<Route>().eq(Route::getEndCode, code))) { neighborCodeList.add(codeService.getById(route.getStartCode()).getData()); neighborCodeList.add(codeService.getCacheById(route.getStartCode()).getData()); } return neighborCodeList; zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/TaskServiceImpl.java
@@ -139,7 +139,7 @@ if (null == codeId) { return null; } return laneService.search(codeService.getById(codeId).getData()); return laneService.search(codeService.getCacheById(codeId).getData()); } @Override @@ -162,7 +162,7 @@ if (null == codeId) { return null; } return laneService.search(codeService.getById(codeId).getData()); return laneService.search(codeService.getCacheById(codeId).getData()); } @Override