| | |
| | | Loc loc = new Loc(); |
| | | InTaskMsgDto inTaskMsgDto = new InTaskMsgDto(); |
| | | locTypeDto.setLocType1(18); |
| | | List<Loc> loc1 = locService.list(new LambdaQueryWrapper<Loc>() |
| | | LambdaQueryWrapper<Loc> locQw = new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getAreaId, area) |
| | | .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | .eq(Loc::getType, locTypeDto.getLocType1()); |
| | | if (deviceBind.getStartRow() != null && deviceBind.getEndRow() != null) { |
| | | locQw.ge(Loc::getRow, deviceBind.getStartRow()).le(Loc::getRow, deviceBind.getEndRow()); |
| | | } |
| | | locQw.orderByAsc(Loc::getLev).orderByAsc(Loc::getCol).orderByAsc(Loc::getRow); |
| | | List<Loc> loc1 = locService.list(locQw); |
| | | // 若按巷道行范围未查到空库位,则放宽条件:不限制行范围,仅按库区+空库+类型查询(与 loc/page 行为一致) |
| | | if (Cools.isEmpty(loc1) && times == 0) { |
| | | loc1 = locService.list(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getAreaId, area) |
| | | .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | .eq(Loc::getType, locTypeDto.getLocType1()) |
| | | .ge(Loc::getRow, deviceBind.getStartRow()) |
| | | .le(Loc::getRow, deviceBind.getEndRow()) |
| | | .orderByAsc(Loc::getLev) |
| | | .orderByAsc(Loc::getCol) |
| | | .orderByAsc(Loc::getRow) |
| | | ); |
| | | } |
| | | for (Loc loc2 : loc1) { |
| | | if (!LocUtils.locMoveCheckLocTypeComplete(loc2, locTypeDto)) { |
| | | continue; |
| | |
| | | ); |
| | | if (Cools.isEmpty(deviceSite)) { |
| | | deviceNo = 0; |
| | | // 有可用空库位但未配置路径时,用源站点作为目标站点,仍返回该库位,避免误报“没有空库位” |
| | | if (loc != null && loc.getId() != null && Objects.equals(loc.getUseStatus(), LocStsType.LOC_STS_TYPE_O.type)) { |
| | | inTaskMsgDto.setStaNo(sourceStaNo); |
| | | } else { |
| | | loc = null; |
| | | } |
| | | } else { |
| | | inTaskMsgDto.setStaNo(deviceSite.getDeviceSite()); |
| | | } |