| | |
| | | // 目标库位 |
| | | LocMast locMast = null; |
| | | |
| | | if (!Cools.isEmpty(matNos)) { |
| | | for (String matNo : matNos) { |
| | | Mat mat = matService.selectByMatnr(matNo); |
| | | if (matType == null) { |
| | | matType = mat.getMatType(); |
| | | } |
| | | if (matType != mat.getMatType()) { |
| | | throw new CoolException("混放物料类型不一致"); |
| | | } |
| | | } |
| | | |
| | | if (matNos.size() > 1 && matType == 1) { |
| | | //物料为单品类型,且物料种类超过1(实际为高频混放),则禁止入库 |
| | | throw new CoolException("物料类型和实际种类不一致"); |
| | | } |
| | | } |
| | | //3号可以入库前必须打开控制 |
| | | // if (!Cools.isEmpty(matNos)) { |
| | | // for (String matNo : matNos) { |
| | | // Mat mat = matService.selectByMatnr(matNo); |
| | | // if (matType == null) { |
| | | // matType = mat.getMatType(); |
| | | // } |
| | | // if (matType != mat.getMatType()) { |
| | | // throw new CoolException("混放物料类型不一致"); |
| | | // } |
| | | // } |
| | | // |
| | | // if (matNos.size() > 1 && matType == 1) { |
| | | // //物料为单品类型,且物料种类超过1(实际为高频混放),则禁止入库 |
| | | // throw new CoolException("物料类型和实际种类不一致"); |
| | | // } |
| | | // } |
| | | |
| | | // 靠近摆放规则 --- 空托 |
| | | locMast = getLocNoStep1(staDescId, locTypeDto, start, end); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //----------------2023.06.02兼容代码,后期库位规则符合要求后可删除------------------------ |
| | | //如果以上都找不到库位,则强制搜索1、2堆垛机空库位进行入库,保障3号堆垛机库位都是符合要求的 |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("loc_type1", locTypeDto.getLocType1()); |
| | | wrapper.in("crn_no", "1,2"); |
| | | wrapper.eq("loc_sts", "O"); |
| | | List<LocMast> locMasts = locMastService.selectList(wrapper); |
| | | for (LocMast mast : locMasts) { |
| | | //检测当前库位内侧其他库位是否为D、F、X |
| | | if (Utils.checkInsideLocIsDFX(mast.getLocNo())) { |
| | | //内侧其他库位不是D、F、X。不能选取该库位 |
| | | continue; |
| | | } |
| | | if(sourceStaNo==103 && mast.getRow1()>7) |
| | | { |
| | | continue; |
| | | } |
| | | if(sourceStaNo==203 && mast.getRow1()<8) |
| | | { |
| | | continue; |
| | | } |
| | | //找到库位,返回dto |
| | | return getLocNoFinalStep(staDescId, sourceStaNo, mast);//返回dto |
| | | } |
| | | //----------------2023.06.02兼容代码end--------------------- |
| | | |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | } |
| | |
| | | |
| | | //随机可用堆垛机号 |
| | | Integer randomCrnNo = Utils.getRandomCrnNo(crnNos, locTypeDto.getLocType1()); |
| | | if (randomCrnNo == null) { |
| | | return locMast; |
| | | } |
| | | ArrayList<Integer> randomCrnNos = new ArrayList<>(); |
| | | randomCrnNos.add(randomCrnNo); |
| | | |