| | |
| | | // if (locCount > 0 || waitCount > 0){ |
| | | // throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet()); |
| | | // } |
| | | Integer wrkNo = wrkDetlService.selectWrkNoByMatnr(matBarcode.getMatnr()); |
| | | if (wrkNo != null){ |
| | | WrkMast wrkMast = wrkMastService.selectById(wrkNo); |
| | | if (wrkMast == null){ |
| | | throw new CoolException("工作档异常,有工作明细档无工作档"); |
| | | } |
| | | if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 101){ |
| | | throw new CoolException("工作档不是全板出库/拣料出库"); |
| | | } |
| | | if (wrkMast.getWrkSts() != 14 && wrkMast.getWrkSts() != 15){ |
| | | throw new CoolException("工作档未完成"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Integer wrkNo = wrkDetlService.selectWrkNoByMatnr(matBarcode.getMatnr()); |
| | | // if (wrkNo != null){ |
| | | // WrkMast wrkMast = wrkMastService.selectById(wrkNo); |
| | | // if (wrkMast == null){ |
| | | // throw new CoolException("工作档异常,有工作明细档无工作档"); |
| | | // } |
| | | // if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 101){ |
| | | // throw new CoolException("工作档不是全板出库/拣料出库"); |
| | | // } |
| | | // if (wrkMast.getWrkSts() != 14 && wrkMast.getWrkSts() != 15){ |
| | | // throw new CoolException("工作档未完成"); |
| | | // } |
| | | // } |
| | | //对于已经有库存 组托档 工作档的数据 不允许解绑 |
| | | Integer locCount = locDetlService.selectCountByMatNr(matBarcode.getMatnr()); |
| | | Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr()); |
| | | if (locCount > 0 || waitCount > 0){ |
| | | throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet()); |
| | | } |
| | | // Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr()); |
| | | // if (locCount > 0 || waitCount > 0){ |
| | | // throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet()); |
| | | // } |
| | | //对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (!Cools.isEmpty(matBarcode.getSpecs())){ |
| | |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(matBarcode.getZpallet()); |
| | | if (halfBarcode != null){ |
| | | // 如果模具没有库存 更新半托信息 数量 可放厚度 |
| | | if (halfBarcode != null && locCount <= 0){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() - 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() + thickness); |
| | | if (!halfBarcodeService.half(halfBarcode)){ |
| | |
| | | if (mat.getColor().equals("报废")){ |
| | | throw new CoolException("该物料已报废,请勿绑定"); |
| | | } |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(waitPakin.getBarcode()); |
| | | // HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(waitPakin.getBarcode()); |
| | | //对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (!Cools.isEmpty(mat.getSpecs())){ |
| | | String[] split = mat.getSpecs().split("\\*"); |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | if (halfBarcode == null){ |
| | | HalfBarcode hb = new HalfBarcode(); |
| | | hb.setZpallet(waitPakin.getBarcode()); |
| | | hb.setSpecs(waitPakin.getBarcode().substring(0,1)); |
| | | hb.setAnfme(1); |
| | | if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){ |
| | | hb.setPrice(2650 - thickness); |
| | | }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){ |
| | | hb.setPrice(1750 - thickness); |
| | | }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){ |
| | | hb.setPrice(800 - thickness); |
| | | } |
| | | if (!halfBarcodeService.insert(hb)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | }else { |
| | | if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(2650 - thickness); |
| | | }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(1750 - thickness); |
| | | }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(800 - thickness); |
| | | } |
| | | if (!halfBarcodeService.half(halfBarcode)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | } |
| | | // Integer thickness = 0; |
| | | // if (!Cools.isEmpty(mat.getSpecs())){ |
| | | // String[] split = mat.getSpecs().split("\\*"); |
| | | // thickness = Integer.parseInt(split[1]); |
| | | // } |
| | | // if (halfBarcode == null){ |
| | | // HalfBarcode hb = new HalfBarcode(); |
| | | // hb.setZpallet(waitPakin.getBarcode()); |
| | | // hb.setSpecs(waitPakin.getBarcode().substring(0,1)); |
| | | // hb.setAnfme(1); |
| | | // if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){ |
| | | // hb.setPrice(2650 - thickness); |
| | | // }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){ |
| | | // hb.setPrice(1750 - thickness); |
| | | // }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){ |
| | | // hb.setPrice(800 - thickness); |
| | | // } |
| | | // if (!halfBarcodeService.insert(hb)){ |
| | | // throw new CoolException("更新半托信息失败"); |
| | | // } |
| | | // }else { |
| | | // if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){ |
| | | // halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | // halfBarcode.setPrice(2650 - thickness); |
| | | // }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){ |
| | | // halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | // halfBarcode.setPrice(1750 - thickness); |
| | | // }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){ |
| | | // halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | // halfBarcode.setPrice(800 - thickness); |
| | | // } |
| | | // if (!halfBarcodeService.half(halfBarcode)){ |
| | | // throw new CoolException("更新半托信息失败"); |
| | | // } |
| | | // } |
| | | MatBarcode mb=new MatBarcode(); |
| | | mb.setZpallet(waitPakin.getBarcode()); |
| | | mb.setMatnr(mat.getMatnr()); |
| | |
| | | if (mat.getColor().equals("报废")){ |
| | | throw new CoolException("该物料已报废,请勿绑定"); |
| | | } |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(mat.getUnit()); |
| | | // HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(mat.getUnit()); |
| | | //对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (!Cools.isEmpty(mat.getSpecs())){ |
| | | String[] split = mat.getSpecs().split("\\*"); |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | if (halfBarcode == null){ |
| | | HalfBarcode hb = new HalfBarcode(); |
| | | hb.setZpallet(mat.getUnit()); |
| | | hb.setSpecs(mat.getUnit().substring(0,1)); |
| | | hb.setAnfme(1); |
| | | if (Integer.parseInt(mat.getUnit().substring(0,1))==6){ |
| | | hb.setPrice(2650 - thickness); |
| | | }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){ |
| | | hb.setPrice(1750 - thickness); |
| | | }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){ |
| | | hb.setPrice(800 - thickness); |
| | | } |
| | | if (!halfBarcodeService.insert(hb)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | }else { |
| | | if (Integer.parseInt(mat.getUnit().substring(0,1))==6){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice()- thickness); |
| | | }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice()- thickness); |
| | | }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice()- thickness); |
| | | } |
| | | if (!halfBarcodeService.half(halfBarcode)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | } |
| | | // Integer thickness = 0; |
| | | // if (!Cools.isEmpty(mat.getSpecs())){ |
| | | // String[] split = mat.getSpecs().split("\\*"); |
| | | // thickness = Integer.parseInt(split[1]); |
| | | // } |
| | | // if (halfBarcode == null){ |
| | | // HalfBarcode hb = new HalfBarcode(); |
| | | // hb.setZpallet(mat.getUnit()); |
| | | // hb.setSpecs(mat.getUnit().substring(0,1)); |
| | | // hb.setAnfme(1); |
| | | // if (Integer.parseInt(mat.getUnit().substring(0,1))==6){ |
| | | // hb.setPrice(2650 - thickness); |
| | | // }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){ |
| | | // hb.setPrice(1750 - thickness); |
| | | // }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){ |
| | | // hb.setPrice(800 - thickness); |
| | | // } |
| | | // if (!halfBarcodeService.insert(hb)){ |
| | | // throw new CoolException("更新半托信息失败"); |
| | | // } |
| | | // }else { |
| | | // if (Integer.parseInt(mat.getUnit().substring(0,1))==6){ |
| | | // halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | // halfBarcode.setPrice(halfBarcode.getPrice()- thickness); |
| | | // }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){ |
| | | // halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | // halfBarcode.setPrice(halfBarcode.getPrice()- thickness); |
| | | // }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){ |
| | | // halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | // halfBarcode.setPrice(halfBarcode.getPrice()- thickness); |
| | | // } |
| | | // if (!halfBarcodeService.half(halfBarcode)){ |
| | | // throw new CoolException("更新半托信息失败"); |
| | | // } |
| | | // } |
| | | MatBarcode mb=new MatBarcode(); |
| | | mb.setZpallet(mat.getUnit()); |
| | | mb.setMatnr(mat.getMatnr()); |