| | |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | |
| | | import java.text.DecimalFormat; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 列 |
| | | */ |
| | | public static int getBay(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(2, 5)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 层 |
| | | */ |
| | | public static int getLev(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(5, 7)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 当检索到双深库位的浅库位时,如果深库位无货,则放入对应的深库位 |
| | | */ |
| | | public static void toDeepIfEmptyByShallow(String shallowLoc) { |
| | |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SlaveProperties slaveProperties = new SlaveProperties(); |
| | | slaveProperties.setDoubleDeep(true); |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(1);list.add(4);list.add(5);list.add(8);list.add(9);list.add(12); |
| | | slaveProperties.setDoubleLocs(list); |
| | | slaveProperties.setGroupCount(4); |
| | | Integer deepRow = getDeepRow(slaveProperties, 6); |
| | | System.out.println(deepRow); |
| | | |
| | | } |
| | | // public static void main(String[] args) { |
| | | // SlaveProperties slaveProperties = new SlaveProperties(); |
| | | // slaveProperties.setDoubleDeep(true); |
| | | // List<Integer> list = new ArrayList<>(); |
| | | // list.add(1);list.add(4);list.add(5);list.add(8);list.add(9);list.add(12); |
| | | // slaveProperties.setDoubleLocs(list); |
| | | // slaveProperties.setGroupCount(4); |
| | | // Integer deepRow = getDeepRow(slaveProperties, 6); |
| | | // System.out.println(deepRow); |
| | | // } |
| | | |
| | | public static boolean BooleanWhsTypeSta(Integer whsType){ |
| | | if (whsType==1){ |
| | |
| | | public static int RowCount(Integer whsType,Integer curRow,Integer crnNumber){ |
| | | return LocNecessaryParameters(whsType, curRow,crnNumber)[0]; |
| | | } |
| | | |
| | | public static int getCurRow(Integer whsType,Integer curRow,Integer crnNumber){ |
| | | return LocNecessaryParameters(whsType, curRow,crnNumber)[1]; |
| | | } |
| | | |
| | | public static int getCrnNo(Integer whsType,Integer curRow,Integer crnNumber){ |
| | | return LocNecessaryParameters(whsType, curRow,crnNumber)[2]; |
| | | } |
| | | |
| | | public static int getNearRow(Integer whsType,Integer curRow,Integer crnNumber){ |
| | | return LocNecessaryParameters(whsType, curRow,crnNumber)[3]; |
| | | } |
| | |
| | | } |
| | | return necessaryParameters; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | List<LocMast> locS = new ArrayList<LocMast>(); |
| | | String locNo = "0000102"; |
| | | for (int i = 1; i < 16; i++) { |
| | | String s = zerofill(String.valueOf(i), 2) + locNo.substring(2); |
| | | LocMast locMast = new LocMast(); |
| | | locMast.setLocNo(s); |
| | | locS.add(locMast); |
| | | } |
| | | List<String> innermostSideLoc = getInnermostSideLoc(locS); |
| | | System.out.println(innermostSideLoc); |
| | | } |
| | | |
| | | //转换为各自对应的深库位 |
| | | public static List<String> getInnermostSideLoc(List<LocMast> locS) { |
| | | ArrayList<String> listLocRBL = new ArrayList<>(); |
| | | for (LocMast locMast : locS) { |
| | | String innermostSideLocRBL = Utils.getInnermostSideLocRBL(locMast.getLocNo()); |
| | | if (Cools.isEmpty(innermostSideLocRBL)) { |
| | | continue; |
| | | } |
| | | if (!listLocRBL.contains(innermostSideLocRBL)) { |
| | | listLocRBL.add(innermostSideLocRBL); |
| | | } |
| | | } |
| | | return listLocRBL; |
| | | } |
| | | |
| | | public static String getInnermostSideLocRBL(String locNo) { |
| | | int row = Utils.getRow(locNo); |
| | | if (row % 4 == 0 || (row + 3) % 4 == 0) { |
| | | return zerofill(String.valueOf(row), 2) + locNo.substring(2); |
| | | } else if ((row + 2) % 4 == 0) { |
| | | return zerofill(String.valueOf(row - 1), 2) + locNo.substring(2); |
| | | } else if ((row + 1) % 4 == 0) { |
| | | return zerofill(String.valueOf(row + 1), 2) + locNo.substring(2); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String getInnermostSideLocLBR(String locNo) { |
| | | int row = Utils.getRow(locNo); |
| | | if (row % 4 == 0) { |
| | | return zerofill(String.valueOf(row - 1), 2) + locNo.substring(2); |
| | | } else if ((row + 3) % 4 == 0) { |
| | | return zerofill(String.valueOf(row + 1), 2) + locNo.substring(2); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |