| | |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.BasShuttleService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.common.model.NavigateNode; |
| | |
| | | return locNo; |
| | | } |
| | | |
| | | //楼层转换对应出入库站点库位号 |
| | | public static String levToOutInStaLocNo(Integer lev) { |
| | | String locNo = null; |
| | | if (lev >= 2) { |
| | | lev++; |
| | | } |
| | | switch (lev) { |
| | | case 1: |
| | | locNo = "1800201"; |
| | | break; |
| | | case 3: |
| | | locNo = "1800202"; |
| | | break; |
| | | case 4: |
| | | locNo = "1800203"; |
| | | break; |
| | | case 5: |
| | | locNo = "1800204"; |
| | | break; |
| | | } |
| | | return locNo; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(JSON.toJSONString(getGroupOutsideLoc("0200101"))); |
| | | } |
| | |
| | | |
| | | //获取除白名单外的指定楼层全部穿梭车xy坐标点 |
| | | public static List<int[]> getShuttlePoints(Integer whiteShuttle, Integer lev) { |
| | | BasShuttleService basShuttleService = SpringUtils.getBean(BasShuttleService.class); |
| | | SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); |
| | | ArrayList<int[]> list = new ArrayList<>(); |
| | | for (ShuttleSlave slave : slaveProperties.getShuttle()) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (shuttleProtocol.getCurrentLocNo() == null) { |
| | | continue; |
| | | String currentLocNo = shuttleProtocol.getCurrentLocNo(); |
| | | |
| | | if (currentLocNo == null) { |
| | | //小车没有库位号数据,从数据库中取 |
| | | BasShuttle basShuttle = basShuttleService.selectById(slave.getId()); |
| | | if (basShuttle == null || basShuttle.getPoint() == null) { |
| | | continue; |
| | | } |
| | | NyShuttleProtocol.NyShuttlePointClass shuttlePoint = JSON.parseObject(basShuttle.getPoint(), NyShuttleProtocol.NyShuttlePointClass.class); |
| | | currentLocNo = NavigatePositionConvert.nyXyzToLocNo(shuttlePoint.getX(), shuttlePoint.getY(), shuttlePoint.getZ()); |
| | | } |
| | | |
| | | if (lev != Utils.getLev(shuttleProtocol.getCurrentLocNo())) { |
| | | if (lev != Utils.getLev(currentLocNo)) { |
| | | continue;//楼层不同 |
| | | } |
| | | |
| | | if (shuttleProtocol.getCurrentLocNo() == null) { |
| | | continue; |
| | | } |
| | | int[] xyPosition = NavigatePositionConvert.positionToXY(shuttleProtocol.getCurrentLocNo());//通过库位号获取xy坐标 |
| | | list.add(xyPosition); |
| | | } |