| | |
| | | //} |
| | | if (Cools.isEmpty(locMast)) { |
| | | locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("row1", curRow) |
| | | .eq("loc_sts", "O") |
| | | .orderBy("lev1", true).orderBy("bay1", true)); |
| | | for(LocMast locMast1 :locMasts){ |
| | | // 目标库位 ===>> 浅库位, 则校验其深库位是否为 F D X |
| | | if (null != locMast1 && Integer.parseInt(locMast1.getLocNo().substring(0, 2)) == 2) { |
| | | LocMast deepLoc = locMastService.selectById(zerofill(String.valueOf(3), 2) + locMast1.getLocNo().substring(2)); |
| | | if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X") && !deepLoc.getLocSts().equals("P")) { |
| | | locMast = null; |
| | | }else { |
| | | if (!Cools.isEmpty(locMast1)) { |
| | | locMast = locMast1; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 目标库位 ===>> 深库位, 则校验其浅库位是否为 O |
| | | if (null != locMast1 && Integer.parseInt(locMast1.getLocNo().substring(0, 2)) == 3) { |
| | | LocMast shallowLoc = locMastService.selectById(zerofill(String.valueOf(2), 2) + locMast1.getLocNo().substring(2)); |
| | | if (!Cools.isEmpty(shallowLoc)) { |
| | | if (!shallowLoc.getLocSts().equals("O")) { |
| | | locMast = null; |
| | | }else { |
| | | if (!Cools.isEmpty(locMast1)) { |
| | | locMast = locMast1; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | | } |
| | | // 目标库位 ===>> 浅库位, 则校验其深库位是否为 F D X |
| | | if (null != locMast && Integer.parseInt(locMast.getLocNo().substring(0, 2)) == 2) { |
| | | LocMast deepLoc = locMastService.selectById(zerofill(String.valueOf(3), 2) + locMast.getLocNo().substring(2)); |
| | | if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | //if (null != locMast && Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) { |
| | | // LocMast deepLoc = locMastService.selectById(Utils.getDeepLoc(slaveProperties, locMast.getLocNo())); |
| | | // if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) { |
| | | // locMast = null; |
| | | // } |
| | | //} |
| | | // 目标库位 ===>> 深库位, 则校验其浅库位是否为 O |
| | | if (null != locMast && Integer.parseInt(locMast.getLocNo().substring(0, 2)) == 3) { |
| | | LocMast shallowLoc = locMastService.selectById(zerofill(String.valueOf(2), 2) + locMast.getLocNo().substring(2)); |
| | | if (!Cools.isEmpty(shallowLoc)) { |
| | | if (!shallowLoc.getLocSts().equals("O")) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | } |
| | | //if (null != locMast && Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) { |
| | | // LocMast shallowLoc = locMastService.selectById(Utils.getShallowLoc(slaveProperties, locMast.getLocNo())); |
| | | // if (!Cools.isEmpty(shallowLoc)) { |
| | | // if (!shallowLoc.getLocSts().equals("O")) { |
| | | // locMast = null; |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | //} |
| | | // // 目标库位 ===>> 浅库位, 则校验其深库位是否为 F D X |
| | | // if (null != locMast && Integer.parseInt(locMast.getLocNo().substring(0, 2)) == 2) { |
| | | // LocMast deepLoc = locMastService.selectById(zerofill(String.valueOf(3), 2) + locMast.getLocNo().substring(2)); |
| | | // if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X") && !deepLoc.getLocSts().equals("P")) { |
| | | // locMast = null; |
| | | // } |
| | | // } |
| | | // |
| | | // // 目标库位 ===>> 深库位, 则校验其浅库位是否为 O |
| | | // if (null != locMast && Integer.parseInt(locMast.getLocNo().substring(0, 2)) == 3) { |
| | | // LocMast shallowLoc = locMastService.selectById(zerofill(String.valueOf(2), 2) + locMast.getLocNo().substring(2)); |
| | | // if (!Cools.isEmpty(shallowLoc)) { |
| | | // if (!shallowLoc.getLocSts().equals("O")) { |
| | | // locMast = null; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | } |
| | | |
| | | // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | if (Cools.isEmpty(locMast)) { |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount) { |
| | | if (times < 4) { |
| | | times = times + 1; |
| | | if(locTypeDto.getLocType1() == 1 && times == 3){ |
| | | if(locTypeDto.getLocType1() == 1 && times == 2){ |
| | | locTypeDto.setLocType1((short) 2); |
| | | } |
| | | return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, times); |