zjj
2024-05-30 09284f08c7a901f684cf26ccb0e51a9204d9cd64
zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/CommonService.java
@@ -228,6 +228,13 @@
                throw new CoolException("入库路径不存在");
            }
            //找相同空托盘
            LambdaQueryWrapper<LocMast> wrapper0 = new LambdaQueryWrapper<LocMast>()
                    .eq(LocMast::getLocSts, "D")
                    .eq(LocMast::getLocType1, locTypeDto.getLocType1())
                    .eq(LocMast::getCrnNo, staDesc.getDeviceNo())
                    .eq(LocMast::getHostId, hostId);
            LambdaQueryWrapper<LocMast> wrapper1 = new LambdaQueryWrapper<LocMast>()
                    .eq(LocMast::getLocSts, "O")
                    .eq(LocMast::getLocType1, locTypeDto.getLocType1())
@@ -245,9 +252,9 @@
                wrapper1.le(LocMast::getLev1, locRangeDto.getTargetLev());
            }
            List<LocMast> locMasts = locMastService.list(wrapper1);
            if (!locMasts.isEmpty()) {
                for (LocMast loc : locMasts) {
            List<LocMast> locMasts0 = locMastService.list(wrapper0);
            if (!locMasts0.isEmpty()) {
                for (LocMast loc : locMasts0) {
                    LocMast locMast0 = locMastService.findNearloc(loc.getLocNo(), hostId, locRangeDto);
                    if (null != locMast0) {
                        locMast = locMast0;
@@ -257,6 +264,19 @@
            }
            if (locMast == null) {
                List<LocMast> locMasts = locMastService.list(wrapper1);
                if (!locMasts.isEmpty()) {
                    for (LocMast loc : locMasts) {
                        LocMast locMast0 = locMastService.findNearloc(loc.getLocNo(), hostId, locRangeDto);
                        if (null != locMast0) {
                            locMast = locMast0;
                            break;
                        }
                    }
                }
            }
            if (locMast == null) {
                throw new CoolException("缺少空库位");
            }
        }