| | |
| | | LocMast locMast = null; |
| | | |
| | | // 靠近摆放规则 --- 同天同规格物料 |
| | | if (!Cools.isEmpty(matNos)) { |
| | | if (!Cools.isEmpty(matNos) && matNos.size() == 1) { |
| | | List<String> locNos = locDetlService.getSameDetl(matNos.get(0), start, end); |
| | | for (String locNo : locNos) { |
| | | List<String> groupLoc = Utils.getGroupLoc(locNo); |
| | | locMast = locMastService.findOutMost(groupLoc); |
| | | if (null != locMast) { |
| | | LocMast locMast0 = locMastService.findOutMost(groupLoc); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast, locTypeDto)) { |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(locMast.getCrnNo(), true)) { |
| | | crnNo = locMast.getCrnNo(); |
| | | if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) { |
| | | crnNo = locMast0.getCrnNo(); |
| | | locMast = locMast0; |
| | | break; |
| | | } |
| | | } |
| | |
| | | if (locMasts.size() > 0) { |
| | | for (LocMast loc : locMasts) { |
| | | List<String> groupLoc = Utils.getGroupLoc(loc.getLocNo()); |
| | | locMast = locMastService.findOutMost(groupLoc); |
| | | if (null != locMast) { |
| | | LocMast locMast0 = locMastService.findOutMost(groupLoc); |
| | | if (null != locMast0) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(locMast, locTypeDto)) { |
| | | if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) { |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(locMast.getCrnNo(), true)) { |
| | | crnNo = locMast.getCrnNo(); |
| | | if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) { |
| | | crnNo = locMast0.getCrnNo(); |
| | | locMast = locMast0; |
| | | break; |
| | | } |
| | | } |
| | |
| | | if (null == locMast) { |
| | | Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | for (int i = 0; i < shelves.group; i ++) { |
| | | if (i > 0) { |
| | | curRow = currentRow; |
| | | } |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | |
| | | } |
| | | } |
| | | } |
| | | // 因库位移转、需预留空库位 |
| | | // 因库位移转、需预留空库位 todo:luxiaotao |
| | | // if (!locMastService.checkEmptyCount(locMast)) { |
| | | // locMast = null; |
| | | // } |