| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.common.properties.SlaveProperties; |
| | |
| | | add(zerofill(String.valueOf(3), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 3: |
| | | return new ArrayList<>(); |
| | | case 4: |
| | | return new ArrayList<>(); |
| | | case 5: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(4), 2) + locNo.substring(2)); |
| | |
| | | add(zerofill(String.valueOf(11), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 11: |
| | | return new ArrayList<>(); |
| | | case 12: |
| | | return new ArrayList<>(); |
| | | case 13: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(12), 2) + locNo.substring(2)); |
| | |
| | | add(zerofill(String.valueOf(18), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 18: |
| | | return new ArrayList<>(); |
| | | case 19: |
| | | return new ArrayList<>(); |
| | | case 20: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(19), 2) + locNo.substring(2)); |
| | |
| | | } |
| | | } |
| | | |
| | | public static List<String> getGroupOutsideLoc(String locNo){ |
| | | int row = getRow(locNo); |
| | | switch (row) { |
| | | case 1: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(2), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | case 5: |
| | | return new ArrayList<>(); |
| | | case 6: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(5), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 7: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(6), 2) + locNo.substring(2)); |
| | | add(zerofill(String.valueOf(5), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 8: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(9), 2) + locNo.substring(2)); |
| | | add(zerofill(String.valueOf(10), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 9: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(10), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 10: |
| | | case 11: |
| | | case 12: |
| | | case 13: |
| | | return new ArrayList<>(); |
| | | case 14: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(13), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 15: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(16), 2) + locNo.substring(2)); |
| | | add(zerofill(String.valueOf(17), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 16: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(17), 2) + locNo.substring(2)); |
| | | }}; |
| | | case 17: |
| | | case 18: |
| | | case 19: |
| | | case 20: |
| | | return new ArrayList<>(); |
| | | case 21: |
| | | return new ArrayList<String>() {{ |
| | | add(zerofill(String.valueOf(20), 2) + locNo.substring(2)); |
| | | }}; |
| | | default: |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | } |
| | | |
| | | public Map<Integer, List<Integer>> getRowSeqHasSortOfPakin(int start, int end) { |
| | | Map<Integer, List<Integer>> result = new HashMap<>(); |
| | | for (int i = start ; i <= end; i++) { |
| | |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 检测当前库位外侧其他库位是否为O |
| | | * 返回true表示外侧库位是O,返回false表示内侧库位不是O |
| | | */ |
| | | public static boolean checkOutsideLocIsDFX(String locNo) { |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | List<String> insideLoc = Utils.getGroupOutsideLoc(locNo); |
| | | if (insideLoc.size() > 0) { |
| | | List<LocMast> insideLocMast = locMastService.selectByLocNos(insideLoc); |
| | | for (LocMast mast : insideLocMast) { |
| | | if (!mast.getLocSts().equals("O")) { |
| | | //!O(不能选定这个外侧库位) |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | return randomCrnNo; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<String> groupLoc = Utils.getGroupLoc("1300801"); |
| | | System.out.println(groupLoc); |
| | | //public static void main(String[] args) { |
| | | // List<String> groupLoc = Utils.getGroupLoc("1300801"); |
| | | // System.out.println(groupLoc); |
| | | //} |
| | | |
| | | public static Double getIoPri(String locNo){ |
| | | switch (Utils.getRow(locNo)){ |
| | | case 3: |
| | | case 4: |
| | | case 11: |
| | | case 12: |
| | | case 18: |
| | | case 19: |
| | | return 21.0; |
| | | case 2: |
| | | case 5: |
| | | case 10: |
| | | case 13: |
| | | case 17: |
| | | case 20: |
| | | return 19.0; |
| | | case 1: |
| | | case 6: |
| | | case 9: |
| | | case 14: |
| | | case 16: |
| | | case 21: |
| | | return 17.0; |
| | | default: |
| | | return 15.0; |
| | | } |
| | | } |
| | | |
| | | public static List<String> getLocNosSort(List<String> locNos){ |
| | | List<String> locSort = new ArrayList<>(); |
| | | for (String loc : locNos){ |
| | | if (getIoPri(loc).equals(15.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | for (String loc : locNos){ |
| | | if (getIoPri(loc).equals(17.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | for (String loc : locNos){ |
| | | if (getIoPri(loc).equals(19.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | for (String loc : locNos){ |
| | | if (getIoPri(loc).equals(21.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | return locSort; |
| | | } |
| | | |
| | | public static List<StockOutParam.LocDetl> getStockOutParamLocDetlSort(List<StockOutParam.LocDetl> locNos){ |
| | | List<StockOutParam.LocDetl> locSort = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl loc : locNos){ |
| | | if (getIoPri(loc.getLocNo()).equals(15.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | for (StockOutParam.LocDetl loc : locNos){ |
| | | if (getIoPri(loc.getLocNo()).equals(17.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | for (StockOutParam.LocDetl loc : locNos){ |
| | | if (getIoPri(loc.getLocNo()).equals(19.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | for (StockOutParam.LocDetl loc : locNos){ |
| | | if (getIoPri(loc.getLocNo()).equals(21.0)){ |
| | | locSort.add(loc); |
| | | } |
| | | } |
| | | return locSort; |
| | | } |
| | | |
| | | public static boolean getLocNoWeighting(List<String> locNos,String locNo){ |
| | | boolean sign=false; |
| | | for (String loc : locNos){ |
| | | if (getBay(loc)==getBay(locNo) && getLev(loc)==getLev(locNo) && getRowWeighting(loc)==getRowWeighting(locNo)){ |
| | | sign = true; |
| | | break; |
| | | } |
| | | } |
| | | return sign; |
| | | } |
| | | |
| | | |
| | | public static int getRowWeighting(String locNo){ |
| | | switch (Utils.getRow(locNo)){ |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | return 123; |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | return 456; |
| | | case 8: |
| | | case 9: |
| | | case 10: |
| | | case 11: |
| | | return 891011; |
| | | case 12: |
| | | case 13: |
| | | case 14: |
| | | return 121314; |
| | | case 15: |
| | | case 16: |
| | | case 17: |
| | | case 18: |
| | | return 15161718; |
| | | case 19: |
| | | case 20: |
| | | case 21: |
| | | case 22: |
| | | default: |
| | | return 19202122; |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | ArrayList<String> locS = new ArrayList<String>(); |
| | | locS.add("1902501"); |
| | | locS.add("2102501"); |
| | | locS.add("1802301"); |
| | | locS.add("1800101"); |
| | | locS.add("0300102"); |
| | | locS.add("0100102"); |
| | | List<String> innermostSideLoc = getInnermostSideLoc(locS, true); |
| | | System.out.println(innermostSideLoc); |
| | | } |
| | | |
| | | public static List<String> getInnermostSideLoc(List<String> locS, boolean pakin){ |
| | | ArrayList<String> listLoc = new ArrayList<>(); |
| | | ArrayList<String> listLocRBL = new ArrayList<>(); |
| | | for (String locNo : locS){ |
| | | if (!listLocRBL.contains(Utils.getInnermostSideLocRBL(locNo, pakin))){ |
| | | listLocRBL.add(Utils.getInnermostSideLocRBL(locNo, pakin)); |
| | | listLoc.add(locNo); |
| | | }else { |
| | | for (String loc1 : listLoc){ |
| | | if (Utils.getInnermostSideLocRBL(locNo, pakin).equals(Utils.getInnermostSideLocRBL(loc1, pakin))){ |
| | | if (!pakin){ |
| | | if (Utils.getRow(loc1)>17 && Utils.getRow(locNo)>Utils.getRow(loc1) ){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | }else if ( Utils.getRow(loc1)<18 && Utils.getRow(locNo)<Utils.getRow(loc1)){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } |
| | | }else { |
| | | if ( Utils.getRow(loc1)<4 && Utils.getRow(locNo)>Utils.getRow(loc1)){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } else if (Utils.getRow(loc1)>3 && Utils.getRow(loc1)<8 && Utils.getRow(locNo)<Utils.getRow(loc1) ){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } else if (Utils.getRow(loc1)>7 && Utils.getRow(loc1)<12 && Utils.getRow(locNo)>Utils.getRow(loc1) ){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } else if (Utils.getRow(loc1)>11 && Utils.getRow(loc1)<15 && Utils.getRow(locNo)<Utils.getRow(loc1) ){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } else if (Utils.getRow(loc1)>14 && Utils.getRow(loc1)<19 && Utils.getRow(locNo)>Utils.getRow(loc1) ){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } else if ( Utils.getRow(loc1)>18 && Utils.getRow(locNo)<Utils.getRow(loc1)){ |
| | | listLoc.remove(loc1); |
| | | listLoc.add(locNo); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return listLoc; |
| | | } |
| | | |
| | | public static String getInnermostSideLocRBL(String locNo, boolean pakin){ |
| | | int row = Utils.getRow(locNo); |
| | | if (row <= 3) { |
| | | row = 3; |
| | | } else if (row <= 7) { |
| | | row = 4; |
| | | } else if (row <= 11) { |
| | | row = 11; |
| | | } else if (row <= 14) { |
| | | row = 12; |
| | | } else if (row <= 18) { |
| | | row = 18; |
| | | } else { |
| | | row = 19; |
| | | } |
| | | return ""+row+Utils.getBay(locNo)+Utils.getLev(locNo); |
| | | |
| | | //if (row <3){ |
| | | // return ""+33+Utils.getBay(locNo)+Utils.getLev(locNo); |
| | | //}else if (row>30){ |
| | | // return ""+31+Utils.getBay(locNo)+Utils.getLev(locNo); |
| | | //} |
| | | //if (row<18 && row>1){ |
| | | // row=1; |
| | | //}else if (row < 31 && row>17){ |
| | | // row=2; |
| | | //} |
| | | //if (pakin){ |
| | | // row=3-row; |
| | | //} |
| | | //return ""+row+Utils.getBay(locNo)+Utils.getLev(locNo); |
| | | |
| | | } |
| | | } |