| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.CodeDetectionUtil; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | return null; |
| | | } |
| | | ArrayList<Integer> crns =new ArrayList<>(); |
| | | ArrayList<Integer> crnList =new ArrayList<>(); |
| | | int[] crnCount = new int[7]; |
| | | crns.add(1); |
| | | crns.add(2); |
| | | crns.add(3); |
| | |
| | | crns.add(7); |
| | | boolean sign = true; |
| | | for (Integer crnNo : crns){ |
| | | List<String> locNoList = new ArrayList<>(); |
| | | |
| | | int crnCountD = locMastService.selectCount(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("crn_no", crnNo)); |
| | | crnCount[crnNo-1] = crnCountD; |
| | | } |
| | | crnList.add(CodeDetectionUtil.crnCodeDetectionMax(new int[]{crnCount[0],crnCount[1]})[0]+1); |
| | | crnList.add(CodeDetectionUtil.crnCodeDetectionMax(new int[]{crnCount[2],crnCount[3],crnCount[4]})[0]+3); |
| | | crnList.add(CodeDetectionUtil.crnCodeDetectionMaxT(new int[]{crnCount[2],crnCount[3],crnCount[4]},crnList.get(1)-3)[0]+3); |
| | | crnList.add(CodeDetectionUtil.crnCodeDetectionMax(new int[]{crnCount[5],crnCount[6]})[0]+6); |
| | | crnList.add(1); |
| | | crnList.add(2); |
| | | crnList.add(3); |
| | | crnList.add(4); |
| | | crnList.add(5); |
| | | crnList.add(6); |
| | | crnList.add(7); |
| | | for (Integer crnNo : crnList){ |
| | | // 检测路径 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", 110) |
| | | .eq("stn_no", staNo) |
| | | .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; |
| | | } |
| | | sign = true; |
| | | if (!basCrnpService.checkSiteError(crnNo, false)){ |
| | | continue; |
| | | } |
| | | // 获取库位 |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("crn_no", crnNo)); |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("crn_no", crnNo).orderBy("lev1",true).orderBy("bay1",true)); |
| | | for (LocMast locMastS : locMasts){ |
| | | List<String> locNoList = new ArrayList<>(); |
| | | sign = true; |
| | | |
| | | if (Cools.isEmpty(locMastS)) { |
| | | // throw new CoolException("库中无空板!!!"); |
| | |
| | | locNoList.add(locMastS.getLocNo()); |
| | | |
| | | //小料箱伴生出库 |
| | | if (Utils.getRow(locMastS.getLocNo())<=8){ |
| | | if (sign && Utils.getRow(locMastS.getLocNo())<=8){ |
| | | String locNoOther = staNoOther(locMastS.getLocNo()); |
| | | LocMast locMastOther = locMastService.selectById(locNoOther); |
| | | |
| | | if (locMastOther.getLocSts().equals("D") || locMastOther.getLocSts().equals("F") || locMastOther.getLocSts().equals("R")){ |
| | | if (locMastOther.getLocSts().equals("D")){ |
| | | locNoList.add(locNoOther); |
| | |
| | | }else { |
| | | sign=false; |
| | | } |
| | | }else if (Utils.getRow(locMastS.getLocNo())>=21 && Utils.getRow(locMastS.getLocNo())<=27){ |
| | | }else if (sign && Utils.getRow(locMastS.getLocNo())>=21 && Utils.getRow(locMastS.getLocNo())<=27){ |
| | | String locNoOther = staNoOther(locMastS.getLocNo()); |
| | | LocMast locMastOther = locMastService.selectById(locNoOther); |
| | | if (locMastOther.getLocSts().equals("D") || locMastOther.getLocSts().equals("F") || locMastOther.getLocSts().equals("R")){ |
| | |
| | | sign=false; |
| | | } |
| | | } |
| | | ArrayList<String> locArrayList = new ArrayList<>(); |
| | | for (String locNo : locNoList){ |
| | | if (!locArrayList.contains(locNo)){ |
| | | locArrayList.add(locNo); |
| | | } |
| | | } |
| | | if (sign) { |
| | | EmptyPlateOutParam param = new EmptyPlateOutParam(); |
| | | param.setOutSite(staNo); |
| | | param.setLocNos(locNoList); |
| | | param.setLocNos(locArrayList); |
| | | try{ |
| | | workService.emptyPlateOut(param, 9999L); |
| | | }catch (Exception e){ |
| | | log.error("二楼小料箱自动补空板失败!!异常原因:"+e); |
| | | log.error(staNo+"自动补空板失败!!异常原因:"+e); |
| | | } |
| | | return SUCCESS; |
| | | } |