Merge remote-tracking branch 'origin/tzskasrs-1' into tzskasrs-1
| | |
| | | throw new CoolException("出库失败;"+th); |
| | | } |
| | | |
| | | //**************325、331、333、339站点额外逻辑代码************** |
| | | HashMap<String, Object> tmpMap = new HashMap<>(); |
| | | if (staNo.getDevNo() == 325 || staNo.getDevNo() == 331 || staNo.getDevNo() == 333 || staNo.getDevNo() == 339) { |
| | | int[] data = {325,331,333,339}; |
| | | for (String locNo : locNos) { |
| | | List<String> groupOuterLoc = Utils.getGroupDeepLoc(locNo); |
| | | if (groupOuterLoc.isEmpty()) { |
| | | continue; |
| | | } |
| | | int index = 0; |
| | | for (String loc : groupOuterLoc) { |
| | | tmpMap.put(loc, data[index++]); |
| | | } |
| | | } |
| | | } |
| | | //**************325、331、333、339站点额外逻辑代码************** |
| | | |
| | | Integer ioType = null; |
| | | List<String> excludeLocNos = dtos.stream().map(OutLocDto::getLocNo).distinct().collect(Collectors.toList()); |
| | | // 生成工作档 |
| | |
| | | if (stnNo == 325 || stnNo == 331 || stnNo == 333 || stnNo == 339) { |
| | | stnNo = staDesc.getCrnStn(); |
| | | sourceStaNo = staDesc.getStnNo(); |
| | | |
| | | //**************325、331、333、339站点额外逻辑代码************** |
| | | Object autoStnNo = tmpMap.get(dto.getLocNo());//获取系统自动分配站点 |
| | | if (autoStnNo != null) { |
| | | stnNo = Integer.parseInt(autoStnNo.toString()); |
| | | } |
| | | //**************325、331、333、339站点额外逻辑代码************** |
| | | } |
| | | |
| | | int lev = Utils.getLev(dto.getLocNo()); |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(JSON.toJSONString(getGroupLoc("1305908"))); |
| | | System.out.println(JSON.toJSONString(getGroupDeepLoc("1505908"))); |
| | | } |
| | | |
| | | /** |
| | | * 获取深浅库位组 |
| | | * @param locNo 库位号 |
| | | * @return |
| | | */ |
| | | public static List<String> getGroupDeepLoc(String locNo){ |
| | | int row = getRow(locNo); |
| | | int bay = getBay(locNo); |
| | | |
| | | //(1,3,4,10,11)没有外侧方向库位组,(13,14,16)59列之内没有外侧方向库位组 |
| | | if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {//1排 |
| | | return new ArrayList<>(); |
| | | } |
| | | if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {//3-4排 |
| | | return new ArrayList<>(); |
| | | } |
| | | if (CommonService.THIRD_GROUP_ROW_LIST.contains(row)) {//6-7排 |
| | | List<String> result = new ArrayList<>(); |
| | | for (Integer row0 : CommonService.THIRD_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); |
| | | } |
| | | return result; |
| | | } |
| | | if (CommonService.FOURTH_GROUP_ROW_LIST.contains(row)) {//8排 |
| | | return new ArrayList<>(); |
| | | } |
| | | if (CommonService.FIFTH_GROUP_ROW_LIST.contains(row)) {//10-11排 |
| | | return new ArrayList<>(); |
| | | } |
| | | if (CommonService.SIXTH_GROUP_ROW_LIST.contains(row) && (bay >= 59 && bay <= 61)) {//13-16排59-61列外侧方向库位组 |
| | | List<String> result = new ArrayList<>(); |
| | | for (Integer row0 : CommonService.SIXTH_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); |
| | | } |
| | | return result; |
| | | } |
| | | if (CommonService.SEVENTH_GROUP_ROW_LIST.contains(row) && bay < 59) {//13-14排59列之内没有外侧方向库位组 |
| | | return new ArrayList<>(); |
| | | } |
| | | if (CommonService.EIGHTH_GROUP_ROW_LIST.contains(row) && bay < 59) {//16排59列之内没有外侧方向库位组 |
| | | return new ArrayList<>(); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd()); |
| | | for (LocMast locMast0 : locMasts) { |
| | | LocMast locMast1 = locMastService.findInnerLoc(locMast0.getLocNo());//检测同库位组深库位是否有空闲库位 |
| | | if (locMast1 != null) { |
| | | //预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast1, 10)) { |
| | | return locMast1; |
| | | List<String> locNos = locDetlService.getSameDetl(locMast0.getLocNo()); |
| | | for (String locNo : locNos) { |
| | | LocMast locMast1 = locMastService.findInnerLoc(locNo); |
| | | if (null != locMast1) { |
| | | //预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast1, 10)) { |
| | | return locMast1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd()); |
| | | for (LocMast locMast0 : locMasts) { |
| | | LocMast locMast1 = locMastService.findInnerLoc(locMast0.getLocNo());//检测同库位组深库位是否有空闲库位 |
| | | if (locMast1 != null) { |
| | | //预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast1, 10)) { |
| | | return locMast1; |
| | | List<String> locNos = locDetlService.getSameDetl(locMast0.getLocNo()); |
| | | for (String locNo : locNos) { |
| | | LocMast locMast1 = locMastService.findInnerLoc(locNo); |
| | | if (null != locMast1) { |
| | | //预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast1, 10)) { |
| | | return locMast1; |
| | | } |
| | | } |
| | | } |
| | | } |