| | |
| | | private InOutService inOutService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private HalfBarcodeService halfBarcodeService; |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 4.入库完成 |
| | |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | |
| | | //更新半托信息 |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet()); |
| | | //对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (!Cools.isEmpty(wrkDetl.getSpecs())){ |
| | | String[] split = wrkDetl.getSpecs().split("\\*"); |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | if (halfBarcode == null){ |
| | | HalfBarcode hb = new HalfBarcode(); |
| | | hb.setZpallet(wrkDetl.getZpallet()); |
| | | hb.setSpecs(wrkDetl.getZpallet().substring(0,1)); |
| | | hb.setAnfme(1); |
| | | if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){ |
| | | hb.setPrice(2650 - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){ |
| | | hb.setPrice(1750 - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){ |
| | | hb.setPrice(800 - thickness); |
| | | } |
| | | if (!halfBarcodeService.insert(hb)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | }else { |
| | | if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() - thickness); |
| | | } |
| | | if (!halfBarcodeService.half(halfBarcode)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!locDetlService.insert(locDetl)) { |
| | | // exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | } |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | |
| | | // 对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (wrkDetl.getSpecs() != null){ |
| | | String[] split = wrkDetl.getSpecs().split("\\*"); |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | // 根据托盘码找到半托信息 |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet()); |
| | | if (halfBarcode != null){ |
| | | halfBarcode.setPrice(thickness + halfBarcode.getPrice()); // 可放厚度 |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() - 1); // 数量 |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | |
| | | //更新半托信息 |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet()); |
| | | //对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (!Cools.isEmpty(wrkDetl.getSpecs())){ |
| | | String[] split = wrkDetl.getSpecs().split("\\*"); |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | if (halfBarcode == null){ |
| | | HalfBarcode hb = new HalfBarcode(); |
| | | hb.setZpallet(wrkDetl.getZpallet()); |
| | | hb.setSpecs(wrkDetl.getZpallet().substring(0,1)); |
| | | hb.setAnfme(1); |
| | | if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){ |
| | | hb.setPrice(2650 - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){ |
| | | hb.setPrice(1750 - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){ |
| | | hb.setPrice(800 - thickness); |
| | | } |
| | | if (!halfBarcodeService.insert(hb)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | }else { |
| | | if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() - thickness); |
| | | }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){ |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() + 1); |
| | | halfBarcode.setPrice(halfBarcode.getPrice() - thickness); |
| | | } |
| | | if (!halfBarcodeService.half(halfBarcode)){ |
| | | throw new CoolException("更新半托信息失败"); |
| | | } |
| | | } |
| | | |
| | | locDetl = new LocDetl(); |
| | |
| | | |
| | | for (WrkDetl wrkDetl : wrkDetls101) { |
| | | InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr()); |
| | | // 对模具的规格做处理得到厚度 |
| | | Integer thickness = 0; |
| | | if (wrkDetl.getSpecs() != null){ |
| | | String[] split = wrkDetl.getSpecs().split("\\*"); |
| | | thickness = Integer.parseInt(split[1]); |
| | | } |
| | | // 根据托盘码找到半托信息 |
| | | HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet()); |
| | | if (halfBarcode != null){ |
| | | halfBarcode.setPrice(thickness + halfBarcode.getPrice()); // 可放厚度 |
| | | halfBarcode.setAnfme(halfBarcode.getAnfme() - 1); // 数量 |
| | | } |
| | | if (inOut != null){ |
| | | inOut.setTemp1("不在库");//属性 是否在库 |
| | | inOut.setBrand("");//托盘条码 |
| | |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | if (!halfBarcodeService.half(halfBarcode)){ |
| | | return FAIL.setMsg("更新半托信息失败"); |
| | | } |
| | | } |
| | | |
| | | for (WrkDetl wrkDetl : wrkDetls101) { |