| | |
| | | import com.zy.asrs.service.RowLastnoService; |
| | | import com.zy.common.CodeBuilder; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.model.LocGroupOrder; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.system.service.UserService; |
| | |
| | | return result; |
| | | } |
| | | |
| | | public static List<Integer> getLocGroupDesc(SlaveProperties slaveProperties, String locNo) { |
| | | List<Integer> copy = getLocGroupAsc(slaveProperties,locNo); |
| | | Collections.reverse(copy); |
| | | return copy; |
| | | } |
| | | |
| | | public static String getLocNo(Integer row, int bay, int lev) { |
| | | return zerofill(String.valueOf(row), 2) + zerofill(String.valueOf(bay), 3) + zerofill(String.valueOf(lev), 2); |
| | | } |
| | | |
| | | public static List<Integer> getLocGroupAsc(SlaveProperties slaveProperties, String locNo) { |
| | | LocGroupOrder checkOrder = findLocGroupOrder(slaveProperties, locNo); |
| | | List<Integer> rowList = checkOrder.getRowList(); |
| | | return new ArrayList<>(rowList); |
| | | } |
| | | |
| | | public static LocGroupOrder findLocGroupOrder(SlaveProperties slaveProperties, String locNo) { |
| | | int row1 = Utils.getRow(locNo); |
| | | int bay1 = Utils.getBay(locNo); |
| | | List<LocGroupOrder> locGroupAscOrder = slaveProperties.getLocGroupAscOrder(); |
| | | |
| | | LocGroupOrder checkOrder = null; |
| | | for (LocGroupOrder order : locGroupAscOrder) { |
| | | if (!order.getRowList().contains(row1)){ |
| | | continue; |
| | | } |
| | | |
| | | if (bay1 < order.getMinBay()){ |
| | | continue; |
| | | } |
| | | |
| | | if (bay1 > order.getMaxBay()){ |
| | | continue; |
| | | } |
| | | |
| | | checkOrder = order; |
| | | } |
| | | |
| | | if (checkOrder == null){ |
| | | throw new RuntimeException(locNo + "库位号,未定义库位组规则"); |
| | | } |
| | | |
| | | return checkOrder; |
| | | } |
| | | } |