| | |
| | | if (null == task) { |
| | | throw new CoolException("数据错误,未找到容器码对应盘点任务"); |
| | | } |
| | | for (CheckDiffItem checkDiffItem : params.getCheckDiffItems()) { |
| | | for (CheckDiffItem ckDiffItem : params.getCheckDiffItems()) { |
| | | CheckDiffItem diffItem = new CheckDiffItem(); |
| | | if (Objects.isNull(checkDiffItem.getId())) { |
| | | BeanUtils.copyProperties(checkDiffItem, diffItem); |
| | | if (Objects.isNull(ckDiffItem.getId())) { |
| | | BeanUtils.copyProperties(ckDiffItem, diffItem); |
| | | diffItem.setCheckId(params.getCheckId()); |
| | | |
| | | Matnr matnr = matnrService.getOne(new LambdaQueryWrapper<Matnr>().eq(Matnr::getCode, diffItem.getMatnrCode())); |
| | |
| | | throw new CoolException("新增盘点明细保存失败!!"); |
| | | } |
| | | } else { |
| | | diffItem = checkDiffItemService.getById(checkDiffItem.getId()); |
| | | diffItem = checkDiffItemService.getById(ckDiffItem.getId()); |
| | | if (null == diffItem) { |
| | | return R.error("数据错误,未找到差异单明细"); |
| | | } |
| | | } |
| | | |
| | | checkDiffItem.setExceStatus(CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_HOLD.val); |
| | | if (!checkDiffItemService.updateById(checkDiffItem)) { |
| | | diffItem.setExceStatus(CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_HOLD.val); |
| | | if (!checkDiffItemService.updateById(diffItem)) { |
| | | throw new CoolException("更新差异单明细失败"); |
| | | } |
| | | Double checkQty = Math.round((checkDiff.getCheckQty() + checkDiffItem.getCheckQty()) * 10000) / 10000.0; |
| | | Double checkQty = Math.round((checkDiff.getCheckQty() + diffItem.getCheckQty()) * 10000) / 10000.0; |
| | | checkDiff.setCheckQty(checkQty); |
| | | } |
| | | checkDiff.setExceStatus(CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_HOLD.val); |