| | |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | @Transactional |
| | | public StartupDto getLocNo( Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) { |
| | | public StartupDto getLocNo( Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto,boolean mixture) { |
| | | try{ |
| | | Integer whsType = Utils.GetWhsType(sourceStaNo); |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | |
| | | log.error("站点={} 未查询到对应的规则",sourceStaNo); |
| | | break; |
| | | case 4: |
| | | return getLocNoRun4(whsType,staDescId,sourceStaNo,matnr,batch,grade,4,locTypeDto,0); |
| | | return getLocNoRun4(whsType,staDescId,sourceStaNo,matnr,batch,grade,4,locTypeDto,0,mixture); |
| | | case 5: |
| | | return getLocNoRun5(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0); |
| | | default: |
| | |
| | | return startupDto; |
| | | } |
| | | |
| | | public StartupDto getLocNoRun4(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) { |
| | | public StartupDto getLocNoRun4(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times,boolean mixture) { |
| | | if (Cools.isEmpty(matnr)) { //物料号 |
| | | matnr = ""; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | for (LocMast locMastGro1 : locMasts) { |
| | | if (locMastGro1.getBay1() == 2){ |
| | | if (mixture){ //混料只允许放 7 12 14 |
| | | if (locMastGro1.getBay1() != 7 && locMastGro1.getBay1() != 12 && locMastGro1.getBay1() != 14){ |
| | | continue; |
| | | } |
| | | }else { //不混料不允许放 7 12 14 |
| | | if (locMastGro1.getBay1() == 7 || locMastGro1.getBay1() == 12 || locMastGro1.getBay1() == 14){ |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | if (locMastGro1.getBay1() == 2){ //wcs问题限制 |
| | | continue; |
| | | } |
| | | if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q")) { |
| | | break; |
| | | } |
| | | if (locMastGro1.getLocSts().equals("O") || locMastGro1.getLocSts().equals("S")){ |
| | | if (locMastGro1.getLocSts().equals("O")){ |
| | | locMast = locMastGro1; |
| | | break; |
| | | } |
| | |
| | | break; |
| | | } |
| | | } |
| | | if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q")) { |
| | | if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q") || locMastGro1.getLocSts().equals("R")) { |
| | | break; |
| | | } |
| | | if (locMastGro1.getLocSts().equals("O")){ |
| | |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount*2) { |
| | | times = times + 1; |
| | | return getLocNoRun4(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); |
| | | return getLocNoRun4(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times,mixture); |
| | | } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |