| | |
| | | //判断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.getBoxType())){ |
| | | throw new CoolException("参数:木箱类型 boxType为空"); |
| | | // }else if (Cools.isEmpty(param.getPalletizingNo())){ |
| | | // throw new CoolException("参数:码垛位编号 palletizingNo为空"); |
| | | // }else if (Cools.isEmpty(param.getBoxType())){ |
| | | // throw new CoolException("参数:木箱类型 boxType为空"); |
| | | }else if (Cools.isEmpty(param.getMatList()) || param.getMatList().size()==0){ |
| | | throw new CoolException("参数:物料明细 matLists为空"); |
| | | throw new CoolException("参数:物料明细 matList为空"); |
| | | } |
| | | |
| | | String matnrOne = "";//木箱相同位置 规格 matnr校验 1、左 |
| | | String matnrTwo = "";//木箱相同位置 规格 matnr校验 2、右 |
| | | ArrayList<String> boxNos = new ArrayList<>(); //木箱唯一编码查重 (batch) |
| | | // String matnrOne = "";//木箱相同位置 规格 matnr校验 1、左 |
| | | // String matnrTwo = "";//木箱相同位置 规格 matnr校验 2、右 |
| | | // ArrayList<String> boxNos = new ArrayList<>(); //木箱唯一编码查重 (batch) |
| | | //判断matLists参数 |
| | | for (PalletizingCompleteTwoFloorParam.MatList matList:param.getMatList()){ |
| | | if (Cools.isEmpty(matList.getMatnr())){ |
| | | throw new CoolException("参数:规格 matnr为空"); |
| | | }else if (Cools.isEmpty(matList.getPosition())){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:码垛位置 position为空"); |
| | | }else if (Cools.isEmpty(matList.getBatch())){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:木箱编号 batch为空"); |
| | | }else if (Cools.isEmpty(matList.getModel())){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:卷号 model为空"); |
| | | }else if (Cools.isEmpty(matList.getBatch())){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:木箱编号 boxNo为空"); |
| | | }else if (Cools.isEmpty(matList.getWeight()) || matList.getWeight().equals(0D)){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:净重 weight为空"); |
| | | }else if (Cools.isEmpty(matList.getRoughWeight()) || matList.getRoughWeight().equals(0D)){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:毛重 roughWeight"); |
| | | }else if (Cools.isEmpty(matList.getRollExtent()) || matList.getRollExtent().equals(0D)){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:卷长度 rollExtent"); |
| | | }else if (Cools.isEmpty(matList.getJoint()) || matList.getJoint()==0){ |
| | | throw new CoolException("规格:"+matList.getMatnr()+"、参数:接头数 joint"); |
| | | // }else if (Cools.isEmpty(matList.getPosition())){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:码垛位置 position为空"); |
| | | // }else if (Cools.isEmpty(matList.getBatch())){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:木箱编号 batch为空"); |
| | | // }else if (Cools.isEmpty(matList.getModel())){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:卷号 model为空"); |
| | | // }else if (Cools.isEmpty(matList.getBatch())){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:木箱编号 boxNo为空"); |
| | | // }else if (Cools.isEmpty(matList.getWeight()) || matList.getWeight().equals(0D)){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:净重 weight为空"); |
| | | // }else if (Cools.isEmpty(matList.getRoughWeight()) || matList.getRoughWeight().equals(0D)){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:毛重 roughWeight"); |
| | | // }else if (Cools.isEmpty(matList.getRollExtent()) || matList.getRollExtent().equals(0D)){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:卷长度 rollExtent"); |
| | | // } |
| | | // else if (Cools.isEmpty(matList.getJoint()) || matList.getJoint()==0){ |
| | | // throw new CoolException("规格:"+matList.getMatnr()+"、参数:接头数 joint"); |
| | | } |
| | | |
| | | if (matList.getPosition().equals("1")){//1、左 2、右 |
| | | if (!matnrOne.equals("")){ |
| | | if (!matnrOne.equals(matList.getMatnr())){ |
| | | throw new CoolException("木箱位置:"+matList.getPosition()+"存在不同规格卷信息"); |
| | | } |
| | | }else { |
| | | matnrOne=matList.getMatnr(); |
| | | } |
| | | }else if (matList.getPosition().equals("2")){ |
| | | if (!matnrTwo.equals("")){ |
| | | if (!matnrTwo.equals(matList.getMatnr())){ |
| | | throw new CoolException("木箱位置:"+matList.getPosition()+"存在不同规格卷信息"); |
| | | } |
| | | }else { |
| | | matnrTwo=matList.getMatnr(); |
| | | } |
| | | }else { |
| | | throw new CoolException("参数:木箱编号 boxNo:"+matList.getBatch()+",木箱位置错误:"+matList.getPosition()); |
| | | } |
| | | |
| | | if (!boxNos.contains(matList.getBatch())){ |
| | | boxNos.add(matList.getBatch()); |
| | | }else { |
| | | throw new CoolException("参数:木箱编号 boxNo:"+matList.getBatch()+",木箱编码存在重复"); |
| | | } |
| | | // if (matList.getPosition().equals("1")){//1、左 2、右 |
| | | // if (!matnrOne.equals("")){ |
| | | // if (!matnrOne.equals(matList.getMatnr())){ |
| | | // throw new CoolException("木箱位置:"+matList.getPosition()+"存在不同规格卷信息"); |
| | | // } |
| | | // }else { |
| | | // matnrOne=matList.getMatnr(); |
| | | // } |
| | | // }else if (matList.getPosition().equals("2")){ |
| | | // if (!matnrTwo.equals("")){ |
| | | // if (!matnrTwo.equals(matList.getMatnr())){ |
| | | // throw new CoolException("木箱位置:"+matList.getPosition()+"存在不同规格卷信息"); |
| | | // } |
| | | // }else { |
| | | // matnrTwo=matList.getMatnr(); |
| | | // } |
| | | // }else { |
| | | // throw new CoolException("参数:木箱编号 boxNo:"+matList.getBatch()+",木箱位置错误:"+matList.getPosition()); |
| | | // } |
| | | // |
| | | // if (!boxNos.contains(matList.getBatch())){ |
| | | // boxNos.add(matList.getBatch()); |
| | | // }else { |
| | | // throw new CoolException("参数:木箱编号 boxNo:"+matList.getBatch()+",木箱编码存在重复"); |
| | | // } |
| | | } |
| | | |
| | | // BasDevp basDevp = basDevpService.selectById(Integer.parseInt(param.getDevNo$())); |
| | |
| | | waitPakin.setZpallet(param.getBarcode()); //托盘码 |
| | | waitPakin.setOrigin(matList.getPosition()); //木箱在托盘上的位置 |
| | | waitPakin.setWeight(matList.getWeight()); //净重 |
| | | // waitPakin.setRoughWeight(matList.getRoughWeight()); //毛重 |
| | | // waitPakin.setRollExtent(matList.getRollExtent()); //长度 |
| | | waitPakin.setVolume(matList.getRoughWeight()); //毛重 |
| | | waitPakin.setPrice(matList.getRollExtent()); //长度 |
| | | waitPakin.setSpecs(String.valueOf(matList.getJoint())); //接头 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAnfme(matList.getAnfme()); // 数量 |
| | | waitPakin.setStatus("Y"); // 状态 |