| | |
| | | |
| | | // 审批通过 |
| | | if (req.getApproveStatus() == 3) { |
| | | // 查询采购入库记录 |
| | | LambdaQueryWrapper<ProcurementRecordStorage> lambdaQueryWrapper = new LambdaQueryWrapper<ProcurementRecordStorage>() |
| | | .eq(ProcurementRecordStorage::getSalesLedgerProductId, req.getSalesLedgerProductId()); |
| | | ProcurementRecordStorage procurementRecordStorage = procurementRecordStorageService.getOne(lambdaQueryWrapper); |
| | | |
| | | if (procurementRecordStorage == null) { |
| | | // 保证前面的修改全部回滚 |
| | | throw new ServiceException("采购记录不存在,审批回滚"); |
| | | } |
| | | // // 查询采购入库记录 |
| | | // LambdaQueryWrapper<ProcurementRecordStorage> lambdaQueryWrapper = new LambdaQueryWrapper<ProcurementRecordStorage>() |
| | | // .eq(ProcurementRecordStorage::getSalesLedgerProductId, req.getSalesLedgerProductId()); |
| | | // ProcurementRecordStorage procurementRecordStorage = procurementRecordStorageService.getOne(lambdaQueryWrapper); |
| | | // |
| | | // if (procurementRecordStorage == null) { |
| | | // // 保证前面的修改全部回滚 |
| | | // throw new ServiceException("采购记录不存在,审批回滚"); |
| | | // } |
| | | |
| | | // 生成出库记录 |
| | | ProcurementRecordOutAdd procurementRecordOutAdd = new ProcurementRecordOutAdd(); |
| | | procurementRecordOutAdd.setId(procurementRecordStorage.getId()); |
| | | // procurementRecordOutAdd.setId(procurementRecordStorage.getId()); |
| | | procurementRecordOutAdd.setId(0); |
| | | procurementRecordOutAdd.setProductModelId(salesLedgerProduct.getProductModelId()); |
| | | procurementRecordOutAdd.setSalesLedgerProductId((long) Math.toIntExact(salesLedgerProduct.getId())); |
| | | procurementRecordOutAdd.setType(2); |
| | | procurementRecordOutAdd.setUserId(Math.toIntExact(getUserId())); |