| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | |
| | | request.setBody(body); |
| | | |
| | | NavigateNode startNode = nodes.get(0); |
| | | List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null); |
| | | for (NavigateNode node : nodes) { |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ()); |
| | |
| | | int yp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | int z = Integer.parseInt(String.valueOf(nyNode.get("z"))); |
| | | |
| | | List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null); |
| | | List<MapNode> mapNodes = mapData.get(node.getX()); |
| | | MapNode mapNode = mapNodes.get(node.getY()); |
| | | |
| | |
| | | |
| | | httpStandard.setRequest(request); |
| | | |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("qr_code_value", distCodeNum)); |
| | | if (locMast == null) { |
| | | throw new CoolException("库位信息不存在"); |
| | | } |
| | | Object object = redisUtil.get(RedisKeyType.LOC_MAP.key); |
| | | HashMap<String, String> locMap = (HashMap<String, String>) object; |
| | | String targetLocNo = locMap.get(distCodeNum); |
| | | |
| | | ShuttleCommand command = new ShuttleCommand(); |
| | | command.setShuttleNo(deviceConfig.getDeviceNo()); |
| | | command.setBody(JSON.toJSONString(httpStandard)); |
| | | command.setMode(ShuttleCommandModeType.MOVE.id); |
| | | command.setTargetLocNo(locMast.getLocNo()); |
| | | command.setTargetLocNo(targetLocNo); |
| | | command.setTaskNo(taskId); |
| | | return command; |
| | | } |
| | |
| | | request.setBody(body); |
| | | |
| | | NavigateNode startNode = nodes.get(0); |
| | | List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null); |
| | | for (NavigateNode node : nodes) { |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ()); |
| | |
| | | int yp = Integer.parseInt(String.valueOf(nyNode.get("x"))); |
| | | int z = Integer.parseInt(String.valueOf(nyNode.get("z"))); |
| | | |
| | | List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null); |
| | | List<MapNode> mapNodes = mapData.get(node.getX()); |
| | | MapNode mapNode = mapNodes.get(node.getY()); |
| | | |
| | |
| | | |
| | | httpStandard.setRequest(request); |
| | | |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("qr_code_value", distCodeNum)); |
| | | if (locMast == null) { |
| | | throw new CoolException("库位信息不存在"); |
| | | } |
| | | Object object = redisUtil.get(RedisKeyType.LOC_MAP.key); |
| | | HashMap<String, String> locMap = (HashMap<String, String>) object; |
| | | String targetLocNo = locMap.get(distCodeNum); |
| | | |
| | | ShuttleCommand command = new ShuttleCommand(); |
| | | command.setShuttleNo(deviceConfig.getDeviceNo()); |
| | | command.setBody(JSON.toJSONString(httpStandard)); |
| | | command.setMode(ShuttleCommandModeType.MOVE.id); |
| | | command.setTargetLocNo(locMast.getLocNo()); |
| | | command.setTargetLocNo(targetLocNo); |
| | | command.setTaskNo(taskId); |
| | | return command; |
| | | } |
| | |
| | | |
| | | //获取小车复位响应命令 |
| | | public ShuttleCommand getInitCommand(Integer taskNo, Integer code) { |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | NavigateMapData navigateMapData = SpringUtils.getBean(NavigateMapData.class); |
| | | NyShuttleHttpCommand httpStandard = getHttpStandard(deviceConfig.getDeviceNo(), taskNo); |
| | | NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest(); |
| | |
| | | map.put("z", lev); |
| | | |
| | | String mapStr = JSON.toJSONString(map); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("qr_code_value", mapStr)); |
| | | if (locMast == null) { |
| | | throw new CoolException("地址码不存在"); |
| | | } |
| | | |
| | | Object object = redisUtil.get(RedisKeyType.LOC_MAP.key); |
| | | HashMap<String, String> locMap = (HashMap<String, String>) object; |
| | | String targetLocNo = locMap.get(mapStr); |
| | | |
| | | List<List<MapNode>> mapData = navigateMapData.getJsonData(lev, NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null); |
| | | List<MapNode> mapNodes = mapData.get(locMast.getRow1()); |
| | | MapNode mapNode = mapNodes.get(locMast.getBay1()); |
| | | List<MapNode> mapNodes = mapData.get(Utils.getRow(targetLocNo)); |
| | | MapNode mapNode = mapNodes.get(Utils.getBay(targetLocNo)); |
| | | |
| | | HashMap<String, Object> location = new HashMap<>(); |
| | | location.put("xp", row); |