自动化立体仓库 - WMS系统
Junjie
2023-06-02 a810d82e6ff0d820da6c888ebd9af0dba655d595
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -245,7 +245,14 @@
                    if (locDetls1.size() == 0) {//内侧库位没有相同的物料,跳过
                        continue;
                    }
                    int locRow = Utils.getRow(locDetl0.getLocNo());
                    switch (locRow) {
                        case 3:
                        case 11:
                        case 18:
                            Collections.reverse(locDetls1);
                            break;
                    }
                    for (LocDetl detl : locDetls1) {
                        double lastCount = locDetl.getCount() - useCount;//剩余所需数量
                        double realCount = 0;//实际提供数量
@@ -302,7 +309,7 @@
                double realCount = 0;//实际提供数量
                if (locDetl0.getAnfme() >= lastCount) {//实际数量大于所需数量,按所需数量提供
                    realCount = lastCount;
                }else {
                } else {
                    //实际小于所需数量,按实际数量提供
                    realCount = locDetl0.getAnfme();
                }
@@ -314,6 +321,9 @@
                    return locDetlList;
                }
            }
            //库存数量不满足
            throw new CoolException("单品区域只有" + useCount + "个货物");
        }
        return null;
@@ -457,6 +467,7 @@
                        wrkDetl.setModiTime(now);
                        wrkDetl.setModiUser(userId);
                        wrkDetl.setSpecs(locDetl.getSpecs());
                        wrkDetl.setMatType(locDetl.getMatType());
                        if (!wrkDetlService.insert(wrkDetl)) {
                            throw new CoolException("保存工作档明细失败");
                        }
@@ -489,6 +500,15 @@
            assert ioType != null;
            // 获取库位
            LocMast locMast = locMastService.selectById(dto.getLocNo());
            //-----------------2023.6.2出库兼容代码-----------------------
            List<LocDetl> locDetls = locDetlService.selectByLocNo(locMast.getLocNo());
            if (locMast.getLocType2() == 1 && locDetls.size() > 1) {
                //单品区域出库物料大于1种,强制变成101全板出库
                ioType = 101;
            }
            //-----------------2023.6.2出库兼容代码end-----------------------
            // 获取路径
            StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), staNo.getDevNo(), locMast.getRow1());
            if(staDesc == null){
@@ -540,6 +560,7 @@
                wrkDetl.setModiTime(now);
                wrkDetl.setModiUser(userId);
                wrkDetl.setSpecs(detlDto.getLocDetl().getSpecs());
                wrkDetl.setMatType(detlDto.getLocDetl().getMatType());
                if (!wrkDetlService.insert(wrkDetl)) {
                    throw new CoolException("保存工作档明细失败");
                }
@@ -626,6 +647,7 @@
            wrkDetl.setAppeUser(userId);
            wrkDetl.setModiTime(now);
            wrkDetl.setModiUser(userId);
            wrkDetl.setMatType(locDetl.getMatType());
            if (!wrkDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作档明细失败");
            }
@@ -948,6 +970,7 @@
            wrkDetl.setAppeUser(userId);
            wrkDetl.setModiTime(now);
            wrkDetl.setModiUser(userId);
            wrkDetl.setMatType(locDetl.getMatType());
            if (!wrkDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作档明细失败");
            }
@@ -1437,6 +1460,7 @@
                    wrkDetl.setAppeUser(9527L);
                    wrkDetl.setModiTime(now);
                    wrkDetl.setModiUser(9527L);
                    wrkDetl.setMatType(locDetl.getMatType());
                    if (!wrkDetlService.insert(wrkDetl)) {
                        throw new CoolException("保存工作档明细失败");
                    }