| | |
| | | return workNo; |
| | | } |
| | | |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, int times) { |
| | | LocTypeDto oldLocType = locTypeDto.clone(); |
| | | return getLocNo(whsType, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | |
| | | /** |
| | | * 检索库位号 |
| | | * @param whsType 类型 1:双深式货架 |
| | |
| | | * @param matNos 物料号集合 |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, int times) { |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) { |
| | | StartupDto startupDto = new StartupDto(); |
| | | // 生成工作号 |
| | | int workNo = getWorkNo(0); |
| | |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount) { |
| | | times = times + 1; |
| | | return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times); |
| | | return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } else { |
| | | times = 0; |
| | | } |
| | | // 货物检索低库位仓失败,兼容高库位仓后继续执行 |
| | | if (locTypeDto.getLocType1() == 1) { |
| | | locTypeDto.setLocType1((short) 2); |
| | | return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times); |
| | | return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | // 货物检索窄库位仓失败,兼容宽库位仓后继续执行 |
| | | if (locTypeDto.getLocType2() == 1) { |
| | | locTypeDto.setLocType2((short) 2); |
| | | return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times); |
| | | if (oldLocType.getLocType1() == 1) { |
| | | locTypeDto.setLocType1((short) 1); |
| | | } |
| | | return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | // 货物检索轻库位仓失败,兼容重库位仓后继续执行 |
| | | if (locTypeDto.getLocType3() == 1) { |
| | | locTypeDto.setLocType3((short) 2); |
| | | return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times); |
| | | if (oldLocType.getLocType1() == 1) { |
| | | locTypeDto.setLocType1((short) 1); |
| | | } |
| | | if (oldLocType.getLocType2() == 1) { |
| | | locTypeDto.setLocType2((short) 1); |
| | | } |
| | | return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |