| | |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos) { |
| | | if (sourceStaNo == 3) { |
| | | whsType = 1; |
| | | } else if (sourceStaNo == 7) { |
| | | whsType = 2; |
| | | } else { |
| | | throw new CoolException("无效入库站"); |
| | | } |
| | | StartupDto startupDto = new StartupDto(); |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | if (Cools.isEmpty(rowLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | if (rowLastno.getWhsType() == 1){ |
| | | if (whsType == 1 || whsType == 2){ |
| | | int curRow = rowLastno.getCurrentRow(); |
| | | int sRow = rowLastno.getsRow(); |
| | | int eRow = rowLastno.geteRow(); |
| | |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | if (null == locMast) { |
| | | // 获取目标站所在货架排号 |
| | | Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | // 获取目标站所在货架排号 todo:luxiaotao |
| | | if (curRow == sRow) { |
| | | curRow = eRow; |
| | | } else { |
| | | curRow = sRow; |
| | | } |
| | | for (List<Integer> node : shelves.nodes){ |
| | | if (node.contains(curRow)) { |
| | | crnNo = shelves.nodes.indexOf(node) + 1; |
| | | break; |
| | | } |
| | | } |
| | | crnNo = whsType; |
| | | // Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | // curRow = shelves.start(curRow); |
| | | // if (curRow < 0) { |
| | | // throw new CoolException("检索库位失败,请联系管理员"); |
| | | // } |
| | | // for (List<Integer> node : shelves.nodes){ |
| | | // if (node.contains(curRow)) { |
| | | // crnNo = shelves.nodes.indexOf(node) + 1; |
| | | // break; |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | basCrnpService.checkSiteStatus(crnNo); |