| | |
| | | */ |
| | | @Transactional |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) { |
| | | whsType = Utils.GetWhsType(sourceStaNo); |
| | | try{ |
| | | whsType = Utils.GetWhsType(sourceStaNo); |
| | | }catch (Exception e){ |
| | | log.error("站点={} 未查询到对应的规则",sourceStaNo); |
| | | return null; |
| | | } |
| | | return getLocNoRun(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(matnr)) { //物料号 |
| | | matnr = ""; |
| | | } |
| | | if (Cools.isEmpty(batch)) { //箱号 |
| | | if (Cools.isEmpty(batch)) { //批次 |
| | | batch = ""; |
| | | } |
| | | if (Cools.isEmpty(grade)) { //备用 |
| | |
| | | boolean signRule2 = false; |
| | | |
| | | |
| | | if (Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | if (Utils.BooleanWhsTypeStaIoType(rowLastno)){ |
| | | // 靠近摆放规则 --- 同天同规格物料 //分离版 |
| | | if (!Cools.isEmpty(matnr) && staDescId == 1){ |
| | | signRule1 = true; |
| | |
| | | // } |
| | | |
| | | // 靠近摆放规则 --- 空托 //互通版 |
| | | if (staDescId == 10 && Utils.BooleanWhsTypeStaIoType(whsType)) { |
| | | if (staDescId == 10 && Utils.BooleanWhsTypeStaIoType(rowLastno)) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow)); |
| | | if (locMasts.size() > 0) { |
| | | if (!locMasts.isEmpty()) { |
| | | for (LocMast loc : locMasts) { |
| | | if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) { |
| | | continue; |
| | |
| | | StaDesc staDesc = null; |
| | | BasDevp staNo = null; |
| | | |
| | | if (Utils.BooleanWhsTypeSta(whsType, staDescId)) { |
| | | if (Utils.BooleanWhsTypeSta(rowLastno, staDescId)) { |
| | | // 获取目标站 |
| | | wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | |
| | | } |
| | | startupDto.setStaNo(staNo.getDevNo()); |
| | | } |
| | | } |
| | | |
| | | // 更新库位排号 |
| | | if (Utils.BooleanWhsTypeSta(whsType, staDescId) && Cools.isEmpty(locMast)) { |
| | | rowLastno.setCurrentRow(curRow); |
| | | rowLastnoService.updateById(rowLastno); |
| | | // 更新库位排号 |
| | | if (Cools.isEmpty(locMast)){ |
| | | rowLastno.setCurrentRow(curRow); |
| | | rowLastnoService.updateById(rowLastno); |
| | | } |
| | | } |
| | | |
| | | // 开始查找库位 ==============================>> |
| | |
| | | if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | | continue; |
| | | } |
| | | if (Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | if (Utils.BooleanWhsTypeStaIoType(rowLastno)){ |
| | | String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo()); |
| | | LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", shallowLoc).eq("loc_sts", "O")); |
| | |
| | | } |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(rowLastno)){ |
| | | for (LocMast locMast1 : locMasts) { |
| | | if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) { |
| | | continue; |
| | | } |
| | | if (Utils.BooleanWhsTypeStaIoType(whsType)){ |
| | | if (Utils.BooleanWhsTypeStaIoType(rowLastno)){ |
| | | String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo()); |
| | | LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", shallowLoc).eq("loc_sts", "O")); |