自动化立体仓库 - WMS系统
#1
dubin
2 天以前 295ee7dd14f5d36e2fe442714ab0a80c480c8029
src/main/java/com/zy/common/service/CommonService.java
@@ -1,6 +1,7 @@
package com.zy.common.service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
@@ -140,7 +141,7 @@
        StartupDto startupDto = new StartupDto();
//        // 获取目标站
        // 获取目标站
//        Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>().eq("type_no", staDescId).eq("stn_no", sourceStaNo).eq("crn_no", locMast.getCrnNo());
//        StaDesc staDesc = staDescService.selectOne(wrapper);
//        if (Cools.isEmpty(staDesc)) {
@@ -171,10 +172,14 @@
        List<String> locNos = locDetlService.getSameDetlList(findLocNoAttributeVo.getMatnr());
        for (String locNo : locNos) {
            //获取通道组
            List<Integer> locRowGroupDesc = Utils.getLocRowGroupDesc(slaveProperties, Utils.getRow(locNo));
            List<Integer> locRowGroupDesc = Utils.getLocGroupDesc(slaveProperties, locNo);
            for (Integer row : locRowGroupDesc) {
                String deepLocNo = Utils.getLocNo(row, Utils.getBay(locNo), Utils.getLev(locNo));
                LocMast deepLoc = locMastService.selectById(deepLocNo);
                if (deepLoc == null) {
                    continue;
                }
                if (deepLoc.getLocSts().equals("F")) {
                    continue;
                } else if (deepLoc.getLocSts().equals("O")) {
@@ -194,6 +199,9 @@
            List<Integer> levList = basCrnpService.getLevList();
            Collections.shuffle(levList);
            List<Integer> locLevList = locMastService.getLevList();
            levList.addAll(locLevList);
            for (Integer lev : levList) {
                List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                        .eq("loc_sts", "O")
@@ -202,12 +210,16 @@
                for (LocMast locMast : locMasts) {
                    String locNo = locMast.getLocNo();
                    //获取通道组
                    List<Integer> locRowGroupDesc = Utils.getLocRowGroupDesc(slaveProperties, Utils.getRow(locNo));
                    List<Integer> locRowGroupDesc = Utils.getLocGroupDesc(slaveProperties, locNo);
                    boolean flag = true;
                    for (Integer row : locRowGroupDesc) {
                        String deepLocNo = Utils.getLocNo(row, Utils.getBay(locNo), Utils.getLev(locNo));
                        LocMast deepLoc = locMastService.selectById(deepLocNo);
                        if (deepLoc == null) {
                            continue;
                        }
                        if (!deepLoc.getLocSts().equals("O")) {
                            flag = false;
                            break;
@@ -215,10 +227,16 @@
                    }
                    if (flag) {
                        Integer firstRow = locRowGroupDesc.get(0);
                        String deepLocNo = Utils.getLocNo(firstRow, Utils.getBay(locNo), Utils.getLev(locNo));
                        LocMast deepLoc = locMastService.selectById(deepLocNo);
                        targetLocMast = deepLoc;
                        for (Integer row : locRowGroupDesc) {
                            String deepLocNo = Utils.getLocNo(row, Utils.getBay(locNo), Utils.getLev(locNo));
                            LocMast deepLoc = locMastService.selectById(deepLocNo);
                            if (deepLoc == null) {
                                continue;
                            }
                            targetLocMast = deepLoc;
                            break;
                        }
                        break;
                    }
                }
@@ -241,10 +259,14 @@
        for (LocMast locMast : locMastsD) {
            String locNo = locMast.getLocNo();
            //获取通道组
            List<Integer> locRowGroupDesc = Utils.getLocRowGroupDesc(slaveProperties, Utils.getRow(locNo));
            List<Integer> locRowGroupDesc = Utils.getLocGroupDesc(slaveProperties, locNo);
            for (Integer row : locRowGroupDesc) {
                String deepLocNo = Utils.getLocNo(row, Utils.getBay(locNo), Utils.getLev(locNo));
                LocMast deepLoc = locMastService.selectById(deepLocNo);
                if (deepLoc == null) {
                    continue;
                }
                if (deepLoc.getLocSts().equals("F")) {
                    continue;
                } else if (deepLoc.getLocSts().equals("O")) {
@@ -263,6 +285,9 @@
            List<Integer> levList = basCrnpService.getLevList();
            Collections.shuffle(levList);
            List<Integer> locLevList = locMastService.getLevList();
            levList.addAll(locLevList);
            for (Integer lev : levList) {
                //相近物料匹配失败,搜索可用空库位组
                List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
@@ -272,12 +297,16 @@
                for (LocMast locMast : locMasts) {
                    String locNo = locMast.getLocNo();
                    //获取通道组
                    List<Integer> locRowGroupDesc = Utils.getLocRowGroupDesc(slaveProperties, Utils.getRow(locNo));
                    List<Integer> locRowGroupDesc = Utils.getLocGroupDesc(slaveProperties, locNo);
                    boolean flag = true;
                    for (Integer row : locRowGroupDesc) {
                        String deepLocNo = Utils.getLocNo(row, Utils.getBay(locNo), Utils.getLev(locNo));
                        LocMast deepLoc = locMastService.selectById(deepLocNo);
                        if (deepLoc == null) {
                            continue;
                        }
                        if (!deepLoc.getLocSts().equals("O")) {
                            flag = false;
                            break;
@@ -285,7 +314,16 @@
                    }
                    if (flag) {
                        targetLocMast = locMast;
                        for (Integer row : locRowGroupDesc) {
                            String deepLocNo = Utils.getLocNo(row, Utils.getBay(locNo), Utils.getLev(locNo));
                            LocMast deepLoc = locMastService.selectById(deepLocNo);
                            if (deepLoc == null) {
                                continue;
                            }
                            targetLocMast = deepLoc;
                            break;
                        }
                        break;
                    }
                }