自动化立体仓库 - WMS系统
#
zjj
2025-03-24 86c69620f1bb3976f01b726d3d1804527474898f
src/main/java/com/zy/common/service/CommonService.java
@@ -19,6 +19,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
@@ -123,7 +124,7 @@
        }
        //搜索整个空库位组
        locMast = getLocNoStepSingle(locTypeDto,sourceStaNo);
        locMast = getLocNoStepSingle(locTypeDto, sourceStaNo);
        if (locMast != null) {
            //找到库位,返回dto
            return getLocNoStep6(staDescId, sourceStaNo, locMast);//返回dto
@@ -139,38 +140,54 @@
        LocMast locMast = null;
        List<StaDesc> staDescs = staDescService.selectList(new EntityWrapper<StaDesc>().eq("type_no", 1).eq("stn_no", sourceStaNo));
        int num = 0;
        int crn_no = 1;
        for (StaDesc staDesc : staDescs) {
            //单品
            List<LocMast> locMasts = locMastService.selectAreaEmpty(locTypeDto.getLocType1(), staDesc.getCrnNo());//搜索货物
            int temp = locMast == null ? 0 : locMasts.size();
            if (num <= temp) {
                num = temp;
                crn_no = staDesc.getCrnNo();
            }
        }
        //for (StaDesc staDesc : staDescs) {
        //单品
        List<LocMast> locMasts = locMastService.selectAreaEmpty(locTypeDto.getLocType1(), crn_no);//搜索货物
            for (LocMast mast : locMasts) {
                LocMast tmp = null;
                boolean groupLoc = Utils.isShallowLoc(slaveProperties, mast.getLocNo());
                if (groupLoc) {
                    String shallowLoc = Utils.getDeepLoc(slaveProperties, mast.getLocNo());
                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                            .eq("loc_no", shallowLoc));
                    if (!Cools.isEmpty(locMast2)) {
                        if (locMast2.getLocSts().equals("F") || locMast2.getLocSts().equals("D")) {
                            tmp = mast;
                            if (!Cools.isEmpty(mast)) {
                                if (mast.getLocSts().equals("O")) {
                                    tmp = mast;
                                }
        for (LocMast mast : locMasts) {
            LocMast tmp = null;
            boolean groupLoc = Utils.isShallowLoc(slaveProperties, mast.getLocNo());
            if (groupLoc) {
                String shallowLoc = Utils.getDeepLoc(slaveProperties, mast.getLocNo());
                LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                        .eq("loc_no", shallowLoc));
                if (!Cools.isEmpty(locMast2)) {
                    if (locMast2.getLocSts().equals("F") || locMast2.getLocSts().equals("D")) {
                        tmp = mast;
                        if (!Cools.isEmpty(mast)) {
                            if (mast.getLocSts().equals("O")) {
                                tmp = mast;
                            }
                        }
                        //预留空库位
                        if (tmp != null && locMastService.checkEmptyCount(mast, 10)) {
                            locMast = tmp;
                            return locMast;
                        }
                    }
                    //预留空库位
                    if (tmp != null && locMastService.checkEmptyCount(mast, 10)) {
                        locMast = tmp;
                        return locMast;
                    }
                }
            } else {
                tmp = mast;
                //预留空库位
                if (tmp != null && locMastService.checkEmptyCount(mast, 10)) {
                    locMast = tmp;
                    return locMast;
                }
            }
            // }
        }
        return locMast;
    }