| | |
| | | package com.zy.common.utils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.LocMastService; |
| | | |
| | | /** |
| | | * 库位编号和A*算法的xy轴转换工具类 |
| | | */ |
| | |
| | | return Short.parseShort(sb.toString()); |
| | | } |
| | | |
| | | //xyz轴转坐标编号 |
| | | public static Short xyToPosition(int x, int y, int z) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append(x); |
| | | if (x < 10) { |
| | | sb.append("00"); |
| | | } else if (x < 100) { |
| | | sb.append("0"); |
| | | } |
| | | |
| | | if (y < 10) { |
| | | sb.append("0"); |
| | | } |
| | | sb.append(y); |
| | | |
| | | if (z < 10) { |
| | | sb.append("0"); |
| | | } |
| | | sb.append(z); |
| | | String position = sb.toString(); |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = locMastService.queryByLoc(position); |
| | | return Short.parseShort(locMast.getQrCodeValue()); |
| | | } |
| | | |
| | | //转换行号,实际中最底层可能是第一行,在数组中最底层是最后一行,因此需要进行转换才可以匹配数据 |
| | | public static int covertRow(int row) { |
| | | NavigateMapData mapData = new NavigateMapData(); |