自动化立体仓库 - WMS系统
#
zyx
2024-04-07 7ad79ee463adbdbc51e37c12ae025fb8598ab670
src/main/java/com/zy/asrs/utils/Utils.java
@@ -5,7 +5,9 @@
import com.zy.common.properties.SlaveProperties;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -144,6 +146,50 @@
    }
    /**
     * 通过库位号获取 列
     */
    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("库位解析异常");
    }
    /**
     * 通过排列层获取库位号
     *
     * @return
     */
    public static String getLocByRBL(int row, int bay, int lev) {
        StringBuffer sb = new StringBuffer();
        if (row < 10) {
            sb.append("0");
        }
        sb.append(row);
        if (bay < 10) {
            sb.append("00");
        } else if (bay < 100) {
            sb.append("0");
        }
        sb.append(bay);
        if (lev < 10) {
            sb.append("0");
        }
        sb.append(lev);
        return sb.toString();
    }
    /**
     * 当检索到双深库位的浅库位时,如果深库位无货,则放入对应的深库位
     */
    public static void toDeepIfEmptyByShallow(String shallowLoc) {
@@ -161,6 +207,11 @@
    }
    public static String getDateStr(Date date){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return simpleDateFormat.format(date);
    }
    public static void main(String[] args) {
        SlaveProperties slaveProperties = new SlaveProperties();
        slaveProperties.setDoubleDeep(true);
@@ -172,4 +223,5 @@
        System.out.println(deepRow);
    }
}