| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.CollectionUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.common.utils.RgvUtils; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | private BasRgvErrLogService basRgvErrLogService; |
| | | @Autowired |
| | | private BasRgvPathService basRgvPathService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | if (rgvProtocol.getTaskNo1() != 0 || rgvProtocol.getLoaded1() != 0) {//RGV是否无任务、RGV是否无货 |
| | | continue; |
| | | } |
| | | |
| | | //判断行走路径是否被占用 |
| | | Integer staNo = wrkMast.getStaNo(); |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | if (basDevp == null) { |
| | | continue;//目标站不存在 |
| | | } |
| | | //起始路径 |
| | | int startPath = rgvProtocol.getRgvPos().intValue(); |
| | | //目标路径值 |
| | | int endPath = basDevp.getLocType3().intValue(); |
| | | boolean pathUsed = RgvUtils.isPathUsed(startPath, endPath); |
| | | |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | |
| | | * 初始化RGV地图 |
| | | */ |
| | | public synchronized void initRgvMap() { |
| | | |
| | | Object data = redisUtil.get("rgv_map"); |
| | | if (data == null) { |
| | | //重新获取全路径地图 |
| | | BasRgvPath basRgvPath = basRgvPathService.selectByRgvNo(0);//获取默认路径 |
| | | if (basRgvPath != null) { |
| | | ArrayList<RgvNode> rgvNodes = new ArrayList<>(); |
| | | List<Integer> rgvPath = JSON.parseArray(basRgvPath.getPath(), Integer.class); |
| | | for (Integer integer : rgvPath) { |
| | | RgvNode rgvNode = new RgvNode(integer); |
| | | rgvNodes.add(rgvNode); |
| | | } |
| | | //将数据库地图数据存入redis |
| | | redisUtil.set("rgv_map", JSON.toJSONString(rgvNodes)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |