| | |
| | | private BareBoardHandler bareBoardHandler; |
| | | @Autowired |
| | | private BasJarMastService basJarMastService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | throw new CoolException("品号 matnr,重量范围偏移值为空!!!,请先下发基础档案!!!"); |
| | | } |
| | | |
| | | ArrayList<Integer> crns =new ArrayList<>(); |
| | | ArrayList<Integer> crnList =new ArrayList<>(); |
| | | |
| | | crns.add(1);crns.add(2);crns.add(3);crns.add(4);crns.add(5);crns.add(6);crns.add(7); |
| | | |
| | | for (Integer crnNo : crns){ |
| | | // 检测路径 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", 101) |
| | | .eq("stn_no", param.getDevNo()) |
| | | .eq("crn_no", crnNo); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)){ |
| | | continue; |
| | | } |
| | | BasCrnp basCrnp = basCrnpService.selectById(crnNo); |
| | | if (basCrnp.getCrnSts()!=3 || !basCrnp.getOutEnable().equals("Y")){ |
| | | continue; |
| | | } |
| | | if (!basCrnpService.checkSiteError(crnNo, false)){ |
| | | continue; |
| | | } |
| | | crnList.add(crnNo); |
| | | } |
| | | |
| | | if (crnList.isEmpty()){ |
| | | throw new CoolException("无可用堆垛机"); |
| | | } |
| | | |
| | | ArrayList<LocDetl> locDetlArrayList = new ArrayList<>(); |
| | | Wrapper<LocDetl> wrapper = new EntityWrapper<LocDetl>().eq("matnr", param.getMatnr()).eq("weight", param.getWeight()); |
| | |
| | | for (LocDetl locDetl:locDetls){ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | if (crnList.contains(locMast.getCrnNo())){ |
| | | if (locDetlArrayList.size()<param.getBatchNum()) {//下 |
| | | locDetlArrayList.add(locDetl); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (locDetlArrayList.isEmpty()){ |
| | | throw new CoolException("未找到符合条件的物料明细:品号==》matnr:"+param.getMatnr()+";重量==》wright:"+param.getWeight()); |
| | | } |
| | | |
| | | Integer batchNum = param.getBatchNum(); |
| | |
| | | for (LocDetl locDetl:locDetls){ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | if (crnList.contains(locMast.getCrnNo())){ |
| | | if (locDetlArrayList.size()<batchNum) {//下 |
| | | locDetlArrayList.add(locDetl); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | for (LocDetl locDetl:locDetls){ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | if (crnList.contains(locMast.getCrnNo())){ |
| | | if (locDetlArrayList.size()<batchNum) {//下 |
| | | locDetlArrayList.add(locDetl); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (locDetlArrayList.isEmpty()){ |
| | | throw new CoolException("未找到符合条件的物料明细:品号==》matnr:"+param.getMatnr()+";重量==》wright:"+param.getWeight()); |
| | | } |
| | | if (locDetlArrayList.size()<batchNum){ |
| | | throw new CoolException("库存数量:"+locDetlArrayList.size()+";小于需求数量:"+param.getBatchNum()); |
| | | } |
| | | |
| | | ArrayList<LocDetl> locDetlArraySou = new ArrayList<>(); |
| | | |
| | | for (LocDetl locDetl : locDetlArrayList){ |
| | | if (batchNum <= 0){ |
| | | return; |
| | | } |
| | | StockOutParam stockOutParam = new StockOutParam(param,locDetl); |
| | | workService.startupFullTakeStore(stockOutParam, userId); |
| | | locDetlArraySou.add(locDetl); |
| | | batchNum --; |
| | | } |
| | | try{ |
| | | StockOutParam stockOutParam = new StockOutParam(param,locDetlArraySou); |
| | | workService.startupFullTakeStore(stockOutParam, userId); |
| | | } catch (Exception e){ |
| | | throw new CoolException("生成出库任务失败:出库数量:"+locDetlArraySou.size()); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void smallContainersJar(SmallCompleteParam param) { |