| | |
| | | // if (!wrkMastService.updateById(mast)) { |
| | | // throw new CoolException("任务状态更新失败!!"); |
| | | // } |
| | | workService.backLocOperation(mast.getWrkNo() + "", mast.getAppeUser()); |
| | | |
| | | return R.ok("接收成功,执行回库中..."); |
| | | return workService.backLocOperation(mast.getWrkNo() + "", mast.getAppeUser()); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | String s = Utils.convertLocFormat(params.getLocNo()); |
| | | LocAroundBind bind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>() |
| | | .eq("b_loc_no", s)); |
| | | if (!Objects.isNull(bind)&&Cools.isEmpty(wrkMast.getStaNo())) { |
| | | if (!Objects.isNull(bind)) { |
| | | bind.setFreeze(1); |
| | | locAroundBindService.updateById(bind); |
| | | //冻结相邻库位 |
| | |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("zpallet", mast.getBarcode()) |
| | | .eq("loc_no", mast.getSourceLocNo())); |
| | | if (Objects.isNull(locDetl)) { |
| | | WrkDetl mainWrkDetl = null; |
| | | if (Objects.isNull(locDetl) && !Cools.isEmpty(mast.getWrkCode())) { |
| | | mainWrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>() |
| | | .eq("wrk_no", mast.getWrkCode()) |
| | | .eq("zpallet", mast.getBarcode())); |
| | | if (Objects.isNull(mainWrkDetl)) { |
| | | mainWrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>() |
| | | .eq("wrk_no", mast.getWrkCode())); |
| | | } |
| | | if (!Objects.isNull(mainWrkDetl)) { |
| | | log.info("locDetl为空,回退查询主任务明细,wrkNo={}, mainWrkNo={}, barcode={}", |
| | | mast.getWrkNo(), mast.getWrkCode(), mast.getBarcode()); |
| | | } |
| | | } |
| | | if (Objects.isNull(locDetl) && Objects.isNull(mainWrkDetl)) { |
| | | throw new CoolException("明细数据不存在!!"); |
| | | } |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", locDetl.getMatnr())); |
| | | String matnrNo = Objects.isNull(locDetl) ? mainWrkDetl.getMatnr() : locDetl.getMatnr(); |
| | | Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnrNo)); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException("物料基础信息不存在!!"); |
| | | } |
| | |
| | | Double val = Math.round((weight - matnr.getSafeQty()) * 10000) / 10000.0; |
| | | if (val.compareTo(0.0) > 0) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | BeanUtils.copyProperties(locDetl, wrkDetl); |
| | | if (Objects.isNull(locDetl)) { |
| | | BeanUtils.copyProperties(mainWrkDetl, wrkDetl); |
| | | wrkDetl.setStockQty(Cools.isEmpty(mainWrkDetl.getStockQty()) ? mainWrkDetl.getAnfme() : mainWrkDetl.getStockQty()); |
| | | wrkDetl.setZpallet(mast.getBarcode()); |
| | | } else { |
| | | BeanUtils.copyProperties(locDetl, wrkDetl); |
| | | wrkDetl.setStockQty(locDetl.getAnfme()); |
| | | } |
| | | wrkDetl.setWrkNo(mast.getWrkNo()); |
| | | wrkDetl.setStockQty(locDetl.getAnfme()); |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setWeight(weight); |
| | | wrkDetl.setIoTime(mast.getIoTime()); |
| | |
| | | } |
| | | Double realQty = Math.round((wrkDetl.getStockQty() - wrkDetl.getAnfme()) * 10000) / 10000.0; |
| | | if (!Cools.isEmpty(weight)) { |
| | | Double val = Math.round((weight - 2.35) * 10000) / 10000.0; |
| | | Double val = Math.round((weight - 3) * 10000) / 10000.0; |
| | | //称重后,计算出真实长度 |
| | | realQty = val * matnr.getVolume(); |
| | | if (realQty<matnr.getSafeQty()){ |