|  |  | 
 |  |  |      */ | 
 |  |  |     public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) { | 
 |  |  |         StartupDto startupDto = new StartupDto(); | 
 |  |  |         int start; | 
 |  |  |         int end; | 
 |  |  |         int start = 2; | 
 |  |  |         int end = 30; | 
 |  |  |         switch (sourceStaNo) { | 
 |  |  |             case 103: | 
 |  |  |                 whsType = 1; | 
 |  |  |                 start = 1; | 
 |  |  |                 end = 14; | 
 |  |  |                 break; | 
 |  |  |             case 203: | 
 |  |  |             case 107: | 
 |  |  |                 whsType = 2; | 
 |  |  |                 start = 8; | 
 |  |  |                 end = 21; | 
 |  |  |                 end = 17; | 
 |  |  |                 break; | 
 |  |  |             case 118: | 
 |  |  |                 whsType = 3; | 
 |  |  |                 start = 18; | 
 |  |  |                 break; | 
 |  |  |             default: | 
 |  |  |                 throw new CoolException("检索库位失败,请联系管理员"); | 
 |  |  |                 whsType = 1; | 
 |  |  |                 break; | 
 |  |  |         } | 
 |  |  |         // 生成工作号 | 
 |  |  |         int workNo = getWorkNo(0); | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 如果没有相近物料,则按规则轮询货架 | 
 |  |  |  | 
 |  |  |         int currentRow = 1; | 
 |  |  |         if (null == locMast) { | 
 |  |  |             Shelves shelves = new Shelves(rowCount, crn_qty); | 
 |  |  |             for (int i = 0; i < shelves.group; i ++) { | 
 |  |  |                 if (i > 0) { | 
 |  |  |                     curRow = currentRow; | 
 |  |  |                 } | 
 |  |  |                 curRow = shelves.start(curRow); | 
 |  |  |                 if (curRow < 0) { | 
 |  |  |                     throw new CoolException("检索库位失败,请联系管理员"); | 
 |  |  |                 } | 
 |  |  |                 currentRow = curRow; | 
 |  |  |                 int crnNo1 = shelves.get(curRow); | 
 |  |  |                 if (whsType == 1) { | 
 |  |  |                     switch (curRow) { | 
 |  |  |                         case 1: | 
 |  |  |                             curRow = 1; | 
 |  |  |                             break; | 
 |  |  |                         case 2: | 
 |  |  |                             curRow = 7; | 
 |  |  |                             break; | 
 |  |  |                         case 3: | 
 |  |  |                             curRow = 8; | 
 |  |  |                             break; | 
 |  |  |                         case 4: | 
 |  |  |                             curRow = 14; | 
 |  |  |                             break; | 
 |  |  |                         default: | 
 |  |  |                             throw new CoolException("检索库位失败,请联系管理员"); | 
 |  |  |                     } | 
 |  |  |                 } else { | 
 |  |  |                     switch (curRow) { | 
 |  |  |                         case 1: | 
 |  |  |                             curRow = 8; | 
 |  |  |                             break; | 
 |  |  |                         case 2: | 
 |  |  |                             curRow = 14; | 
 |  |  |                             break; | 
 |  |  |                         case 3: | 
 |  |  |                             curRow = 15; | 
 |  |  |                             break; | 
 |  |  |                         case 4: | 
 |  |  |                             curRow = 21; | 
 |  |  |                             break; | 
 |  |  |                         default: | 
 |  |  |                             throw new CoolException("检索库位失败,请联系管理员"); | 
 |  |  |                     } | 
 |  |  |                     crnNo1 = crnNo1 + 1; | 
 |  |  |                 Integer crnNo1 = shelves.get(curRow) + 1; | 
 |  |  |                 if (whsType != 1) { | 
 |  |  |                     crnNo1 = whsType; | 
 |  |  |                 } | 
 |  |  |                 if (basCrnpService.checkSiteError(crnNo1, true)) { | 
 |  |  |                     crnNo = crnNo1; | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 更新库位排号 | 
 |  |  |         rowLastno.setCurrentRow(currentRow); | 
 |  |  |         rowLastno.setCurrentRow(curRow); | 
 |  |  |         rowLastnoService.updateById(rowLastno); | 
 |  |  |  | 
 |  |  |         // 开始查找库位 ==============================>> |