自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-08-16 84f5f360f07c523dfe2569f32d561b7aef4296a1
#
2个文件已修改
64 ■■■■■ 已修改文件
src/main/java/com/zy/common/model/Shelves.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/Shelves.java
@@ -1,7 +1,6 @@
package com.zy.common.model;
import com.alibaba.fastjson.JSON;
import com.core.common.Arith;
import com.core.exception.CoolException;
import java.util.ArrayList;
@@ -111,18 +110,16 @@
    }
    public static void main(String[] args) throws InterruptedException {
        double remainder = Arith.divides(1,16 - 1, 16);
        System.out.println(remainder);
        System.out.println((int) remainder);
//        Shelves shelves = new Shelves(8,2);
//        System.out.println(shelves.nodes.toString());
//        int start = 1;
//        while (true) {
        Shelves shelves = new Shelves(2,2);
        System.out.println(shelves.nodes.toString());
        int start = 1;
        while (true) {
//            System.out.println(start);
//            start = shelves.start(start);
//            Thread.sleep(500L);
//        }
            start = shelves.start(start);
            Integer crnNo1 = shelves.get(start);
            System.out.println(crnNo1);
            Thread.sleep(500L);
        }
    }
}
src/main/java/com/zy/common/service/CommonService.java
@@ -10,6 +10,7 @@
import com.zy.asrs.utils.Utils;
import com.zy.asrs.utils.VersionUtils;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.Shelves;
import com.zy.common.model.StartupDto;
import com.zy.common.properties.SlaveProperties;
import lombok.extern.slf4j.Slf4j;
@@ -161,32 +162,16 @@
        // 如果没有相近物料,则按规则轮询货架
        if (null == locMast) {
            int t = 0;
            boolean execute = true;
            int crnNo1;
            while (execute && t < 4) {
                t++;
                switch (curRow) {
                    case 3:
                        curRow = 11;
                        crnNo1 = 2;
                        break;
                    case 11:
                        curRow = 4;
                        crnNo1 = 1;
                        break;
                    case 4:
                        curRow = 12;
                        crnNo1 = 2;
                        break;
                    default:
                        curRow = 3;
                        crnNo1 = 1;
                        break;
            Shelves shelves = new Shelves(rowCount, crn_qty);
            for (int i = 0; i < shelves.group; i ++) {
                curRow = shelves.start(curRow);
                if (curRow < 0) {
                    throw new CoolException("检索库位失败,请联系管理员");
                }
                Integer crnNo1 = shelves.get(curRow);
                if (basCrnpService.checkSiteError(crnNo1, true)) {
                    crnNo = crnNo1;
                    execute = false;
                    break;
                }
            }
        }
@@ -232,12 +217,14 @@
            if (times < rowCount) {
                times = times + 1;
                return getLocNo(whsType, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times);
            } else {
                times = 0;
            }
//            // 货物检索低库位仓失败,兼容高库位仓后继续执行
//            if (locTypeDto.getLocType1() == 1) {
//                locTypeDto.setLocType1((short) 2);
//                return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
//            }
            // 货物检索低库位仓失败,兼容高库位仓后继续执行
            if (locTypeDto.getLocType1() == 1) {
                locTypeDto.setLocType1((short) 2);
                return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, oldLocType, times);
            }
            log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times);
            throw new CoolException("没有空库位");
        }