| | |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int shallowRow = remainder == 1 ? (row + 1) : (row - 1); |
| | | // int shallowRow = remainder == 1 ? (row + 1) : (row - 1); |
| | | int shallowRow = row; |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | |
| | |
| | | int row = getRow(shallowLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int targetRow; |
| | | if (remainder == 2) { |
| | | targetRow = row - 1; |
| | | } else if (remainder == 3) { |
| | | targetRow = row + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | } |
| | | // if (remainder == 2) { |
| | | // targetRow = row - 1; |
| | | // } else if (remainder == 3) { |
| | | // targetRow = row + 1; |
| | | // } else { |
| | | // throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | // } |
| | | targetRow = row; |
| | | return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | } |
| | | |
| | |
| | | |
| | | //库位排号分配 |
| | | public static int[] LocNecessaryParameters(Integer whsType, Integer curRow, Integer crnNumber) { |
| | | switch (whsType){ |
| | | switch (2){ |
| | | case 1://经典双伸库位 |
| | | return LocNecessaryParametersDoubleExtension(whsType, curRow, crnNumber); //已完善 |
| | | case 2://经典单伸库位(2排货架) |
| | |
| | | RowLastnoService rowLastnoService = SpringUtils.getBean(RowLastnoService.class); |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | Integer sRow = rowLastno.getsRow(); |
| | | Integer eRow = rowLastno.geteRow(); |
| | | Integer sCrnNo = rowLastno.getsCrnNo(); |
| | | |
| | | // 判断仓库类型是否满足要求 |
| | |
| | | |
| | | // 计算最深库位排和最浅库位排 |
| | | int minRow = sRow; // 起始排号 |
| | | int maxRow = sRow + 7; // 终止排号 (8排) |
| | | int maxRow = eRow; // |
| | | |
| | | // 检查排号范围是否合法 |
| | | if (curRow < minRow || curRow > maxRow) { |