| | |
| | | import com.zy.asrs.utils.CodeDetectionUtil; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.asrs.utils.PostMesDataUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | |
| | | } |
| | | |
| | | ArrayList<LocDetl> locDetlArrayList = new ArrayList<>(); |
| | | Wrapper<LocDetl> wrapper = new EntityWrapper<LocDetl>().eq("matnr", param.getMatnr()).eq("weight", param.getWeight()); |
| | | Wrapper<LocDetl> wrapper = new EntityWrapper<LocDetl>() |
| | | .eq("matnr", param.getMatnr()) |
| | | .eq("weight", param.getWeight()) |
| | | .orderBy("batch", true); |
| | | if (param.getDevNo() == 536) { |
| | | wrapper.eq("model", param.getModel()) |
| | | .eq("specs", param.getOrderNo()); |
| | |
| | | .lt("weight", param.getWeight() + mat.getUnits()) |
| | | .and() |
| | | .gt("weight", param.getWeight()) |
| | | .orderBy("batch", true) |
| | | .orderBy("weight", true); |
| | | if (param.getDevNo() == 536){ |
| | | locDetlWrapper.eq("model", param.getModel()) |
| | |
| | | .gt("weight", param.getWeight() - mat.getUnits()) |
| | | .and() |
| | | .lt("weight", param.getWeight()) |
| | | .orderBy("batch", true) |
| | | .orderBy("weight", false); |
| | | if (param.getDevNo() == 536){ |
| | | locDetlWrapper.eq("model", param.getModel()) |
| | |
| | | if (locDetlArrayList.size()<batchNum){ |
| | | throw new CoolException("库存数量:"+locDetlArrayList.size()+";小于需求数量:"+param.getBatchNum()); |
| | | } |
| | | ArrayList<String> locS = new ArrayList<>(); |
| | | |
| | | ArrayList<LocDetl> locDetlArrayAnd = new ArrayList<>(); |
| | | for (LocDetl locDetl : locDetlArrayList){ |
| | | if (!locS.contains(locDetl.getLocNo())){ |
| | | locDetlArrayAnd.add(locDetl); |
| | | locS.add(locDetl.getLocNo()); |
| | | if (crnList.contains(1) || crnList.contains(2)){ |
| | | String singleLoc = Utils.singleLoc(locDetl.getLocNo()); |
| | | if (Cools.isEmpty(singleLoc)){ |
| | | log.error("异常库位号:"+singleLoc+";输入库位号:"+locDetl.getLocNo()); |
| | | continue; |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", singleLoc)); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | LocDetl locDetl1 = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", singleLoc)); |
| | | if (Cools.isEmpty(locDetl1)){ |
| | | throw new CoolException("库位"+locMast.getLocNo()+"异常,在库但是无库存!!!"); |
| | | } |
| | | if (!locS.contains(locDetl1.getLocNo())){ |
| | | if (locDetl1.getMatnr().equals(locDetl.getMatnr())){ |
| | | locDetlArrayAnd.add(locDetl1); |
| | | locS.add(locDetl1.getLocNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (locDetlArrayAnd.isEmpty()){ |
| | | throw new CoolException("未找到符合条件的物料明细:品号==》matnr:"+param.getMatnr()+";重量==》wright:"+param.getWeight()); |
| | | } |
| | | if (locDetlArrayAnd.size()<batchNum){ |
| | | throw new CoolException("库存数量:"+locDetlArrayAnd.size()+";小于需求数量:"+param.getBatchNum()); |
| | | } |
| | | |
| | | ArrayList<LocDetl> locDetlArraySou = new ArrayList<>(); |
| | | |
| | | for (LocDetl locDetl : locDetlArrayList){ |
| | | for (LocDetl locDetl : locDetlArrayAnd){ |
| | | if (batchNum <= 0){ |
| | | return; |
| | | break; |
| | | } |
| | | locDetlArraySou.add(locDetl); |
| | | batchNum --; |