| | |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private LocDetlRullUpDetailService locDetlRullUpDetailService; |
| | | @Autowired |
| | | private WrkDetlSingleService wrkDetlSingleService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | public void singleUnstackingComplete(SingleUnstackingCompleteParam param) { |
| | | Long userId = 8888L;//桁架上位软件 |
| | | //判断param参数 |
| | | if (Cools.isEmpty(param.getBarcode())){ |
| | | throw new CoolException("参数:托盘码 barcode为空"); |
| | | }else if (Cools.isEmpty(param.getPalletizingNo())){ |
| | | if (Cools.isEmpty(param.getPalletizingNo())){ |
| | | throw new CoolException("参数:码垛位编号 palletizingNo为空"); |
| | | }else if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0){ |
| | | throw new CoolException("参数:物料明细 matLists为空"); |
| | | } |
| | | WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (Cools.isEmpty(wrkMastMatrix)){ |
| | | throw new CoolException("参数:托盘码查询工作档失败:"+param.getBarcode()); |
| | | } |
| | | |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo()); |
| | | ArrayList<WrkDetl> wrkDetlsNew = new ArrayList<>(); |
| | | ArrayList<WrkDetlSingle> wrkDetlsOld = new ArrayList<>(); |
| | | //判断matLists参数 |
| | | for (SingleUnstackingCompleteParam.MatList matList:param.getMatLists()){ |
| | | if (Cools.isEmpty(matList.getPosition())){ |
| | |
| | | }else if (Cools.isEmpty(matList.getBoxNo())){ |
| | | throw new CoolException("参数:木箱编号 boxNo为空"); |
| | | } |
| | | List<WrkDetlSingle> wrkDetlSingles = wrkDetlSingleService.selectList(new EntityWrapper<WrkDetlSingle>().eq("batch", matList.getBoxNo())); |
| | | boolean sign=true; |
| | | for (WrkDetl wrkDetl:wrkDetls){ |
| | | if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码 |
| | | wrkDetl.setInspect(1); |
| | | wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch())); |
| | | for (WrkDetlSingle wrkDetlSingle:wrkDetlSingles){ |
| | | if (wrkDetlSingle.getBatch().equals(matList.getBoxNo())){//木箱编码 |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(wrkDetlSingle); |
| | | wrkDetlsNew.add(wrkDetl); |
| | | wrkDetlsOld.add(wrkDetlSingle); |
| | | sign=false; |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | for (WrkDetlSingle wrkDetlSingle : wrkDetlsOld) { |
| | | wrkDetlSingleService.delete(new EntityWrapper<WrkDetlSingle>() |
| | | .eq("batch",wrkDetlSingle.getBatch()) |
| | | .eq("wrk_no",wrkDetlSingle.getWrkNo()) |
| | | .eq("io_time",wrkDetlSingle.getIoTime())); |
| | | } |
| | | |
| | | } |
| | | |
| | | /* |
| | |
| | | //判断param参数 |
| | | if (Cools.isEmpty(param.getBarcode())){ |
| | | throw new CoolException("参数:托盘码 barcode为空"); |
| | | }else if (Cools.isEmpty(param.getPalletizingNo())){ |
| | | throw new CoolException("参数:码垛位编号 palletizingNo为空"); |
| | | } |
| | | // else if (Cools.isEmpty(param.getPalletizingNo())){ |
| | | // throw new CoolException("参数:码垛位编号 palletizingNo为空"); |
| | | // } |
| | | WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (Cools.isEmpty(wrkMastMatrix)){ |
| | | throw new CoolException("参数:托盘码查询工作档失败:"+param.getBarcode()); |
| | | }else { |
| | | if (!wrkMastMatrix.getIoType().equals(101)){ |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo()); |
| | | if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){ |
| | | throw new CoolException("返回物料明细数为"+param.getMatLists().size()+",托盘码:"+param.getBarcode()+"应剩余物料数:"+wrkDetls.size()); |
| | | } |
| | | |
| | | ArrayList<String> orgin = new ArrayList<>(); |
| | | //判断matLists参数 |
| | | for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){ |
| | | if (Cools.isEmpty(matList.getPosition())){ |
| | | throw new CoolException("参数:码垛位置 position为空"); |
| | | }else if (Cools.isEmpty(matList.getBoxNo())){ |
| | | throw new CoolException("参数:木箱编号 boxNo为空"); |
| | | } |
| | | if (!orgin.contains(matList.getPosition())){ |
| | | orgin.add(matList.getPosition()); |
| | | }else { |
| | | throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱位置存在重复"); |
| | | } |
| | | boolean sign=true; |
| | | for (WrkDetl wrkDetl:wrkDetls){ |
| | | if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码 |
| | | wrkDetl.setOrigin(matList.getPosition()); |
| | | wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch())); |
| | | sign=false; |
| | | break; |
| | | } |
| | | } |
| | | if (sign){ |
| | | throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+"未查询到对应的工作明细!"); |
| | | } |
| | | } |
| | | } |
| | | // if (wrkMastMatrix.getIoType().equals(103)){ |
| | | // List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo()); |
| | | // if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){ |
| | | // throw new CoolException("返回物料明细数为"+param.getMatLists().size()+",托盘码:"+param.getBarcode()+"应剩余物料数:"+wrkDetls.size()); |
| | | // } |
| | | // |
| | | // ArrayList<String> orgin = new ArrayList<>(); |
| | | // //判断matLists参数 |
| | | // for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){ |
| | | // if (Cools.isEmpty(matList.getPosition())){ |
| | | // throw new CoolException("参数:码垛位置 position为空"); |
| | | // }else if (Cools.isEmpty(matList.getBoxNo())){ |
| | | // throw new CoolException("参数:木箱编号 boxNo为空"); |
| | | // } |
| | | // if (!orgin.contains(matList.getPosition())){ |
| | | // orgin.add(matList.getPosition()); |
| | | // }else { |
| | | // throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱位置存在重复"); |
| | | // } |
| | | // boolean sign=true; |
| | | // for (WrkDetl wrkDetl:wrkDetls){ |
| | | // if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码 |
| | | // wrkDetl.setOrigin(matList.getPosition()); |
| | | // wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch())); |
| | | // sign=false; |
| | | // break; |
| | | // } |
| | | // } |
| | | // if (sign){ |
| | | // throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+"未查询到对应的工作明细!"); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | wrkMastMatrix.setSheetNo("1"); |
| | | wrkMastMatrix.setSheetNo("2"); |
| | | if (!wrkMastService.updateById(wrkMastMatrix)){ |
| | | throw new CoolException("更新工作档失败==》桁架上位软件:单托拆垛完成通知"); |
| | | } |