| | |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | for (LocDetlAdjustParam.LocDetlAdjust adjust : param.getList()) { |
| | | if (Cools.isEmpty(adjust.getMatnr())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | LocDetl sqlParam = new LocDetl(); |
| | | sqlParam.setLocNo(locMast.getLocNo()); |
| | | sqlParam.setMatnr(adjust.getMatNo()); |
| | | sqlParam.setMatnr(adjust.getMatnr()); |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<>(sqlParam)); |
| | | // 保存新库存明细 |
| | | if (Cools.isEmpty(one)) { |
| | | MatCode matCode = matCodeService.selectById(adjust.getMatNo()); |
| | | if (adjust.getCount() == 0){ |
| | | continue; |
| | | } |
| | | MatCode matCode = matCodeService.selectById(adjust.getMatnr()); |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.setLocNo(locMast.getLocNo()); |
| | | locDetl.setMatnr(matCode.getMatNo()); |
| | |
| | | sqlParam1.setModiUser(userId); |
| | | if (!locDetlService.update(sqlParam1, new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locMast.getLocNo()) |
| | | .eq("matnr", adjust.getMatNo()))) { |
| | | .eq("matnr", adjust.getMatnr()))) { |
| | | throw new CoolException("修改库存明细失败"); |
| | | } |
| | | } |