自动化立体仓库 - WMS系统
#1
lsh
17 小时以前 e128bbc4a9df1491257320884169ba813d461f63
src/main/java/com/zy/common/service/CommonService.java
@@ -52,6 +52,8 @@
    private LocDetlService locDetlService;
    @Autowired
    private SlaveProperties slaveProperties;
    @Autowired
    private WaitPakinService waitPakinService;
    /**
     * 生成工作号
@@ -133,6 +135,7 @@
     */
    @Transactional
    public StartupDto getLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
        boolean sign999 = false;
        if (Cools.isEmpty(matnr)) {  //物料号
            matnr = "";
        }
@@ -160,7 +163,13 @@
            throw new CoolException("数据异常,请联系管理员");
        }
        // ===============>>>> 开始执行
        if (sourceStaNo == 118 || sourceStaNo == 122){
        if (staDescId == 1){
            WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("batch", batch));
            if (Cools.isEmpty(waitPakin) || waitPakin.getBrandArmType$() == 999) {
                sign999 = true;
            }
        }
        if (sign999 || sourceStaNo == 118 || sourceStaNo == 122 || sourceStaNo == 1901 || sourceStaNo == 1908){
            curRow = rowLastno.getCurrentRow1();
        } else if (sourceStaNo == 120 || sourceStaNo == 121 || sourceStaNo == 123 || sourceStaNo == 171){
            curRow = rowLastno.getCurrentRow2();
@@ -178,7 +187,7 @@
        }
        //此程序用于优化堆垛机异常时的运行时间
        for (int i = times; i < crnNumber*2; i++) {
        for (int i = times; i < crnNumber*4; i++) {
            int[] locNecessaryParameters = Utils.LocNecessaryParameters(whsType, curRow, crnNumber);
            curRow = locNecessaryParameters[1];
            crnNo = locNecessaryParameters[2];
@@ -230,7 +239,7 @@
                        if (locMast2.getCrnNo()==1 || locMast2.getCrnNo()==6){
                            continue;
                        }
                        if (sourceStaNo == 118 || sourceStaNo == 122){
                        if (sign999 || sourceStaNo == 118 || sourceStaNo == 122 || sourceStaNo == 1901 || sourceStaNo == 1908){
                            if (locMast2.getCrnNo()>3){
                                continue;
                            }
@@ -262,7 +271,7 @@
                        if (shallowLoc.getCrnNo()==1 || shallowLoc.getCrnNo()==6){
                            continue;
                        }
                        if (sourceStaNo == 118 || sourceStaNo == 122){
                        if (sign999 || sourceStaNo == 118 || sourceStaNo == 122 || sourceStaNo == 1901 || sourceStaNo == 1908){
                            if (shallowLoc.getCrnNo()>3){
                                continue;
                            }
@@ -355,7 +364,7 @@
        // 更新库位排号
        if (Utils.BooleanWhsTypeSta(whsType, staDescId) && Cools.isEmpty(locMast)) {
            if (sourceStaNo == 118 || sourceStaNo == 122){
            if (sign999 || sourceStaNo == 118 || sourceStaNo == 122 || sourceStaNo == 1901 || sourceStaNo == 1908){
                rowLastno.setCurrentRow1(curRow);
            } else if (sourceStaNo == 120 || sourceStaNo == 121 || sourceStaNo == 123 || sourceStaNo == 171){
                rowLastno.setCurrentRow2(curRow);
@@ -423,7 +432,7 @@
        // 递归查询
        if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("O")) {
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < rowCount) {
            if (times < rowCount*4) {
                times = times + 1;
                return getLocNoRun(1, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times);
            }
@@ -473,7 +482,13 @@
        if (Cools.isEmpty(grade)) {  //备用
            grade = "";
        }
        boolean sign999 = false;
        if (staDescId == 1){
            WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("batch", batch));
            if (Cools.isEmpty(waitPakin) || waitPakin.getBrandArmType$() == 999) {
                sign999 = true;
            }
        }
        // 初始化参数
        int crnNo = 0;      //堆垛机号
        int nearRow = 0;    //最浅库位排
@@ -491,7 +506,7 @@
            throw new CoolException("数据异常,请联系管理员");
        }
        // ===============>>>> 开始执行
        if (sourceStaNo == 118 || sourceStaNo == 122){
        if (sign999 || sourceStaNo == 118 || sourceStaNo == 122 || sourceStaNo == 1901 || sourceStaNo == 1908){
            curRow = rowLastno.getCurrentRow1();
        } else if (sourceStaNo == 120 || sourceStaNo == 121 || sourceStaNo == 123 || sourceStaNo == 171){
            curRow = rowLastno.getCurrentRow2();
@@ -509,7 +524,7 @@
        }
        //此程序用于优化堆垛机异常时的运行时间
        for (int i = times; i < crnNumber; i++) {
        for (int i = times; i < crnNumber*4; i++) {
            int[] locNecessaryParameters = Utils.LocNecessaryParameters(whsType, curRow, crnNumber);
            curRow = locNecessaryParameters[1];
            crnNo = locNecessaryParameters[2];
@@ -671,7 +686,7 @@
        // 更新库位排号
        if (Utils.BooleanWhsTypeSta(whsType, staDescId) && Cools.isEmpty(locMast)) {
            if (sourceStaNo == 118 || sourceStaNo == 122){
            if (sign999 || sourceStaNo == 118 || sourceStaNo == 122 || sourceStaNo == 1901 || sourceStaNo == 1908){
                rowLastno.setCurrentRow1(curRow);
            } else if (sourceStaNo == 120 || sourceStaNo == 121 || sourceStaNo == 123 || sourceStaNo == 171){
                rowLastno.setCurrentRow2(curRow);
@@ -739,7 +754,7 @@
        // 递归查询
        if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("O")) {
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < rowCount) {
            if (times < rowCount*4) {
                times = times + 1;
                return getLocNoRun(1, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times,rgvNo);
            }