| | |
| | | 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"))); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | //检测楼层是否有穿梭车 |
| | | public static boolean checkLevHasShuttle(Integer lev) { |
| | | SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); |
| | | for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { |
| | | //获取四向穿梭车线程 |
| | | NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); |
| | | if (shuttleThread == null) { |
| | | continue; |
| | | } |
| | | NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); |
| | | if (shuttleProtocol == null) { |
| | | continue; |
| | | } |
| | | String currentLocNo = shuttleProtocol.getCurrentLocNo(); |
| | | if (currentLocNo == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (lev == Utils.getLev(currentLocNo)) { |
| | | return true;//指定楼层有穿梭车 |
| | | } |
| | | } |
| | | |
| | | return false;//指定楼层没有穿梭车 |
| | | } |
| | | |
| | | } |