|  |  |  | 
|---|
|  |  |  | throw new CoolException(param.getBarcode() + "数据已经在库"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //判断托盘是否已经在工作档 | 
|---|
|  |  |  | if (wrkMastService.selectCount(new EntityWrapper<WrkMast>() | 
|---|
|  |  |  | .eq("barcode", param.getBarcode())) > 0) { | 
|---|
|  |  |  | throw new CoolException(param.getBarcode() + "数据已经在任务档中"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //判断是否存在料箱码 => 存在料箱码则要求提交上来的物料list必须全部都有料箱码 | 
|---|
|  |  |  | boolean hasContainerCode = false; | 
|---|
|  |  |  | int containerCodeCount = 0;//料箱码数量 | 
|---|
|  |  |  | for (CombParam.CombMat combMat : param.getCombMats()) { | 
|---|
|  |  |  | if (combMat.getContainerCode() != null) { | 
|---|
|  |  |  | if(!Cools.isEmpty(combMat.getContainerCode())){ | 
|---|
|  |  |  | //if (combMat.getContainerCode() != null) { | 
|---|
|  |  |  | hasContainerCode = true; | 
|---|
|  |  |  | containerCodeCount++; | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void nodePakinNoComb(CombParam param) { | 
|---|
|  |  |  | if(Cools.isEmpty(param.getLocno())){ | 
|---|
|  |  |  | throw new CoolException("库位号未填写,无法入库"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | param.getCombMats().forEach(combMat -> { | 
|---|
|  |  |  | Wrapper<ManLocDetl> wrapper = new EntityWrapper<ManLocDetl>().eq("loc_no", param.getLocno()).eq("matnr",combMat.getMatnr()); | 
|---|
|  |  |  | Utils.wapperSetCondition(wrapper,"container_code",combMat.getContainerCode()); | 
|---|
|  |  |  | Utils.wapperSetCondition(wrapper,"batch",combMat.getBatch()); | 
|---|
|  |  |  | Utils.wapperSetCondition(wrapper,"csocode",combMat.getCsocode()); | 
|---|
|  |  |  | Utils.wapperSetCondition(wrapper,"isoseq",combMat.getIsoseq()); | 
|---|
|  |  |  | ManLocDetl manLocDetl = manLocDetlService.selectOne(wrapper); | 
|---|
|  |  |  | if(Cools.isEmpty(manLocDetl)){ | 
|---|
|  |  |  | saveManlocDetl(combMat,param.getLocno()); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | manLocDetl.setAnfme(manLocDetl.getAnfme() + combMat.getAnfme()); | 
|---|
|  |  |  | manLocDetlService.update(manLocDetl,wrapper); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //生成平库入出库日志 | 
|---|
|  |  |  | SaasUtils.insertLog(0,param.getLocno(),combMat.getMatnr(), combMat.getAnfme(),""); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private boolean saveManlocDetl(CombParam.CombMat combMat, String locNo){ | 
|---|
|  |  |  | Node node = nodeService.selectOne(new EntityWrapper<Node>() | 
|---|
|  |  |  | .eq("name", locNo)); | 
|---|
|  |  |  | Mat mat = matService.selectByMatnr(combMat.getMatnr()); | 
|---|
|  |  |  | ManLocDetl manLocDetl = new ManLocDetl(); | 
|---|
|  |  |  | BeanUtils.copyProperties(mat,manLocDetl); | 
|---|
|  |  |  | manLocDetl.setAnfme(combMat.getAnfme()); | 
|---|
|  |  |  | manLocDetl.setNodeId(node.getId()); | 
|---|
|  |  |  | manLocDetl.setContainerCode(combMat.getContainerCode()); | 
|---|
|  |  |  | manLocDetl.setCsocode(combMat.getCsocode()); | 
|---|
|  |  |  | manLocDetl.setIsoseq(combMat.getIsoseq()); | 
|---|
|  |  |  | manLocDetl.setCreateTime(new Date()); | 
|---|
|  |  |  | manLocDetl.setModiTime(new Date()); | 
|---|
|  |  |  | manLocDetl.setLocNo(locNo); | 
|---|
|  |  |  | manLocDetl.setStatus(1); | 
|---|
|  |  |  | return manLocDetlService.insert(manLocDetl); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void saveManlocDetl(WaitPakin waitPakin, Date now, String locNo){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Node node = nodeService.selectOne(new EntityWrapper<Node>() | 
|---|