| | |
| | | */ |
| | | @Transactional |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) { |
| | | whsType = Utils.GetWhsType(sourceStaNo); |
| | | return getLocNoRun(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //此程序用于优化堆垛机异常时的运行时间 |
| | | for (int i = times; i < crnNumber; i++) { |
| | | for (int i = times; i < crnNumber*2; i++) { |
| | | int[] locNecessaryParameters = Utils.LocNecessaryParameters(whsType, curRow, crnNumber); |
| | | curRow = locNecessaryParameters[1]; |
| | | crnNo = locNecessaryParameters[2]; |
| | | if (basCrnpService.checkSiteError(crnNo, true)) { |
| | | rowCount = locNecessaryParameters[0]; |
| | | nearRow = locNecessaryParameters[3]; |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O")); |
| | | int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type",100)); |
| | | if (locMasts.size()-crnCountO<=2){ |
| | | times++; |
| | | continue; |
| | | } |
| | | break; |
| | | } else { |
| | | times++; |
| | |
| | | boolean signRule2 = false; |
| | | |
| | | |
| | | // 靠近摆放规则 --- 同天同规格物料 //分离版 |
| | | // if (!Cools.isEmpty(matnr) && (staDescId == 1)){ |
| | | // signRule1 = true; |
| | | // } |
| | | // 靠近摆放规则 --- 同天同规格物料 //互通版 |
| | | if (!Cools.isEmpty(matnr) && staDescId == 1) { |
| | | signRule2 = true; |
| | | } |
| | | if (Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | // 靠近摆放规则 --- 同天同规格物料 //分离版 |
| | | if (!Cools.isEmpty(matnr) && (staDescId == 1)){ |
| | | signRule1 = true; |
| | | } |
| | | // 靠近摆放规则 --- 同天同规格物料 //互通版 |
| | | if (!Cools.isEmpty(matnr) && staDescId == 1) { |
| | | signRule2 = true; |
| | | } |
| | | |
| | | if (!Cools.isEmpty(matnr) && (staDescId == 11 || staDescId == 111)) { |
| | | signRule1 = true; |
| | | if (!Cools.isEmpty(matnr) && (staDescId == 11 || staDescId == 111)) { |
| | | signRule1 = true; |
| | | } |
| | | } |
| | | |
| | | if (signRule1){ |
| | |
| | | } |
| | | |
| | | // // 靠近摆放规则 --- 空托 //分离版 |
| | | // if (staDescId == 10) { |
| | | // if (staDescId == 10 && Utils.BooleanWhsTypeStaIoType(whsType)) { |
| | | // List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O")); |
| | | // for (LocMast locMast1:locMasts){ |
| | | // if (VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | |
| | | // } |
| | | |
| | | // 靠近摆放规则 --- 空托 //互通版 |
| | | if (staDescId == 10) { |
| | | if (staDescId == 10 && Utils.BooleanWhsTypeStaIoType(whsType)) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow)); |
| | | if (locMasts.size() > 0) { |
| | | for (LocMast loc : locMasts) { |
| | |
| | | } |
| | | |
| | | // 更新库位排号 |
| | | if (Utils.BooleanWhsTypeSta(whsType, staDescId)) { |
| | | if (Utils.BooleanWhsTypeSta(whsType, staDescId) && Cools.isEmpty(locMast)) { |
| | | rowLastno.setCurrentRow(curRow); |
| | | rowLastnoService.updateById(rowLastno); |
| | | } |
| | |
| | | |
| | | // 1.按规则查找库位 |
| | | if (Cools.isEmpty(locMast) && crnNo != 0) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O")); |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O").orderBy("lev1",true)); |
| | | for (LocMast locMast1 : locMasts) { |
| | | if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | | continue; |
| | |
| | | // 递归查询 |
| | | if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("O")) { |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount) { |
| | | if (times < rowCount*2) { |
| | | times = times + 1; |
| | | return getLocNoRun(1, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); |
| | | return getLocNoRun(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times); |
| | | } |
| | | // // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | // if (locTypeDto.getLocType1() < 2) { |