#
luxiaotao1123
2021-04-03 8e7ccc76d83f0bb2be1cbaf3d8d50dff4d15b6ba
src/main/java/com/zy/common/service/CommonService.java
@@ -89,6 +89,11 @@
        return workNo;
    }
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, int times) {
        LocTypeDto oldLocType = locTypeDto.clone();
        return getLocNo(whsType, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
    }
    /**
     * 检索库位号
     * @param whsType 类型 1:双深式货架
@@ -97,7 +102,7 @@
     * @param matNos 物料号集合
     * @return locNo 检索到的库位号
     */
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, int times) {
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) {
        StartupDto startupDto = new StartupDto();
        // 生成工作号
        int workNo = getWorkNo(0);
@@ -255,26 +260,35 @@
        // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位
        if (Cools.isEmpty(locMast)) {
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < rowCount) {
            if (times < crn_qty) {
                times = times + 1;
                return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times);
                return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
            } else {
                times = 0;
            }
            // 货物检索低库位仓失败,兼容高库位仓后继续执行
            if (locTypeDto.getLocType1() == 1) {
                locTypeDto.setLocType1((short) 2);
                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times);
                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
            }
            // 货物检索窄库位仓失败,兼容宽库位仓后继续执行
            if (locTypeDto.getLocType2() == 1) {
                locTypeDto.setLocType2((short) 2);
                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times);
                if (oldLocType.getLocType1() == 1) {
                    locTypeDto.setLocType1((short) 1);
                }
                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
            }
            // 货物检索轻库位仓失败,兼容重库位仓后继续执行
            if (locTypeDto.getLocType3() == 1) {
                locTypeDto.setLocType3((short) 2);
                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, times);
                if (oldLocType.getLocType1() == 1) {
                    locTypeDto.setLocType1((short) 1);
                }
                if (oldLocType.getLocType2() == 1) {
                    locTypeDto.setLocType2((short) 1);
                }
                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
            }
            log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times);
            throw new CoolException("没有空库位");