| | |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return 0f; |
| | | } |
| | | return (float) Arith.multiplys(2, f, 1); |
| | | } |
| | | |
| | | public static Integer getStaNoByLocNo(String locNo) { |
| | | HashMap<String, Integer> map = new HashMap<>(); |
| | | map.put("0100101", 102); |
| | | map.put("0100202", 103); |
| | | map.put("0100102", 104); |
| | | map.put("0100203", 105); |
| | | map.put("0100103", 106); |
| | | map.put("0100204", 107); |
| | | map.put("0100104", 108); |
| | | map.put("0100205", 109); |
| | | map.put("0100105", 110); |
| | | map.put("0100206", 111); |
| | | map.put("0100106", 112); |
| | | map.put("0100207", 113); |
| | | map.put("0100107", 114); |
| | | map.put("0100208", 115); |
| | | map.put("0100108", 116); |
| | | map.put("0100209", 117); |
| | | map.put("0100109", 118); |
| | | map.put("0100210", 119); |
| | | map.put("0100110", 120); |
| | | |
| | | return map.get(locNo); |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count){ |
| | |
| | | } |
| | | return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号,如果没有深库位,则返回为空 |
| | | */ |
| | | public static String getDeepLoc2(SlaveProperties slaveProperties, String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | boolean deepLoc = isDeepLoc(slaveProperties, row);//判断是否为深库位 |
| | | if (deepLoc) { |
| | | return null; |
| | | } |
| | | if (row == 1 || row == 6) { |
| | | return null; |
| | | } |
| | | //2,8,11,15,19,23 |
| | | if (row == 5 || row == 8 || row == 12 || row == 16 || row == 20 || row == 24) { |
| | | return zerofill(String.valueOf(row - 1), 2) + shallowLoc.substring(2); |
| | | } else { |
| | | return zerofill(String.valueOf(row + 1), 2) + shallowLoc.substring(2); |
| | | } |
| | | } |
| | | /** |
| | | * 获取 浅库位排对应的深库位排 |
| | | */ |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取所在巷道 |
| | | */ |
| | | public static int getLaneByLocNo(String locNo) { |
| | | int row = Utils.getRow(locNo); |
| | | switch (row) { |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | return 1; |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | return 2; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SlaveProperties slaveProperties = new SlaveProperties(); |
| | | slaveProperties.setDoubleDeep(true); |