|  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 检索库位号 | 
 |  |  |      * | 
 |  |  |      * @param whsType     类型 1:双深式货架 | 
 |  |  |      * @param staDescId   路径ID | 
 |  |  |      * @param sourceStaNo 源站 | 
 |  |  |      * @param matnr       物料号集合 | 
 |  |  |      * @return locNo 检索到的库位号 | 
 |  |  |      */ | 
 |  |  |     @Transactional | 
 |  |  |     public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
 |  |  |     public StartupDto getLocNo(Integer staDescId, Integer sourceStaNo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { | 
 |  |  |         // 目标库位 | 
 |  |  |         LocMast locMast = null; | 
 |  |  |  | 
 |  |  | 
 |  |  |             List<LocMast> locMasts = locMastService.list(new LambdaQueryWrapper<LocMast>() | 
 |  |  |                     .eq(LocMast::getLocSts, "O") | 
 |  |  |                     .eq(LocMast::getLocType1, 1) | 
 |  |  |                     .eq(LocMast::getCrnNo, staDesc.getCrnNo()) | 
 |  |  |                     .eq(LocMast::getCrnNo, staDesc.getDeviceNo()) | 
 |  |  |                     .orderByAsc(LocMast::getLev1, LocMast::getBay1, LocMast::getRow1)); | 
 |  |  |             if (!locMasts.isEmpty()) { | 
 |  |  |                 for (LocMast loc : locMasts) { | 
 |  |  | 
 |  |  |         // 获取目标站 | 
 |  |  |         LambdaQueryWrapper<StaDesc> wrapper = new LambdaQueryWrapper<StaDesc>() | 
 |  |  |                 .eq(StaDesc::getTypeNo, staDescId) | 
 |  |  |                 .eq(StaDesc::getStnNo, sourceStaNo) | 
 |  |  |                 .eq(StaDesc::getCrnNo,locMast.getCrnNo()); | 
 |  |  |                 .eq(StaDesc::getStnNo, sourceStaNo); | 
 |  |  |         StaDesc staDesc = staDescService.getOne(wrapper); | 
 |  |  |         if (Cools.isEmpty(staDesc)) { | 
 |  |  |             log.error("入库路径不存在, staDescId={}, sourceStaNo={}", staDescId, sourceStaNo); | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 检测目标站 | 
 |  |  |         BasDevp staNo = basDevpService.getById(staDesc.getCrnStn()); | 
 |  |  |         BasDevp staNo = basDevpService.getById(staDesc.getDeviceNo()); | 
 |  |  |         if (!staNo.getAutoing().equals("Y")) { | 
 |  |  |             throw new CoolException("目标站" + staDesc.getCrnStn() + "不可用"); | 
 |  |  |             throw new CoolException("目标站" + staDesc.getDeviceNo() + "不可用"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 生成工作号 | 
 |  |  | 
 |  |  |         startupDto.setSourceStaNo(sourceStaNo); | 
 |  |  |         startupDto.setStaNo(staNo.getDevNo()); | 
 |  |  |         startupDto.setLocNo(locMast.getLocNo()); | 
 |  |  |         startupDto.setCrnNo(staDesc.getCrnNo()); | 
 |  |  |         return startupDto; | 
 |  |  |     } | 
 |  |  | } |