自动化立体仓库 - WMS系统
lsh
2025-05-26 d61d4384e19580a32becb54e8e7f2287bed5469a
src/main/java/com/zy/common/service/CommonService.java
@@ -7,6 +7,7 @@
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.common.entity.Parameter;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
@@ -161,6 +162,47 @@
                }
            }
        }
        // 靠近摆放规则 --- 空托
        if (staDescId == 10) {
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            if (locMasts.size() > 0) {
                for (LocMast loc : locMasts) {
                    if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
                        continue;
                    }
                    String shallowLocNo = Utils.getShallowLoc(slaveProperties,  loc.getLocNo());
                    // 检测目标库位是否为空库位
                    LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                    if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
                        if (shallowLoc.getLocType1()<locTypeDto.getLocType1()){
                            continue;
                        }
                        if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) {
                            locMast = shallowLoc;
                            crnNo = locMast.getCrnNo();
                            break;
                        }
                    }
                }
            }
            if (Cools.isEmpty(locMast)) {
                List<LocMast> locMastList3 = locMastService.selectList(new EntityWrapper<LocMast>()
                        .eq("loc_sts", "O")
                        .eq("row1",3)
                        .notIn("loc_type1",1));
                if (!Cools.isEmpty(locMastList3)) {
                    locMast = locMastList3.get(0);
                }else {
                    List<LocMast> locMastList1 = locMastService.selectList(new EntityWrapper<LocMast>()
                            .eq("loc_sts", "O")
                            .eq("row1",1)
                            .notIn("loc_type1",1));
                    if (!Cools.isEmpty(locMastList1)) {
                        locMast = locMastList1.get(0);
                    }
                }
            }
        }
        if (Cools.isEmpty(locMast)){
            locMast = locMastService.queryFreeLocMast(1, locTypeDto.getLocType1());