| | |
| | | * @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 = ""; |
| | | } |
| | |
| | | |
| | | |
| | | // 相似工作档案 --- 同天同规格物料 |
| | | if (!Cools.isEmpty(matnr) && (staDescId == 1 || staDescId == 11 || staDescId == 111) ) { |
| | | if (!Cools.isEmpty(matnr) && (staDescId == 1 || staDescId == 11 || staDescId == 111) && !mixture ) { |
| | | //查询相似工作档案 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectWrkMastWrkDetlMatnrBatch(staDescId, matnr, batch,grade, crnNo); |
| | | int nearbay = 0; //相似工作档案 目标库位列 |
| | |
| | | continue; |
| | | } |
| | | for (LocMast locMastGro1 : locMasts) { |
| | | if (locMastGro1.getBay1() == 2){ |
| | | |
| | | if (locMastGro1.getBay1() == 2){ //wcs问题限制 |
| | | continue; |
| | | } |
| | | if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q")) { |
| | |
| | | continue; |
| | | } |
| | | for (LocMast locMastGro1 : locMasts1) { |
| | | 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.getLocSts().equals("F")){ |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_No", locMastGro1.getLocNo())); |
| | | if (!locDetl.getMatnr().equals(matnr) || !locDetl.getBatch().equals(batch)){ |
| | | 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("没有空库位"); |