| | |
| | | qualityInspect.setProductId(saleProduct.getId()); |
| | | qualityInspect.setProductName(saleProduct.getProductCategory()); |
| | | qualityInspect.setModel(saleProduct.getSpecificationModel()); |
| | | qualityInspect.setProductModelId(saleProduct.getProductModelId()); |
| | | qualityInspect.setUnit(saleProduct.getUnit()); |
| | | qualityInspect.setQuantity(saleProduct.getQuantity()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | |
| | | |
| | | LocalDateTime localDateTime = entryDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
| | | salesLedgerProduct.setRegisterDate(localDateTime); |
| | | salesLedgerProduct.setFutureTickets(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deletePurchaseLedgerByIds(Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | throw new BaseException("请选中至少一条数据"); |
| | |
| | | salesLedgerProductMapper.delete(queryWrapper); |
| | | // 批量删除关联的采购台账的来票登记 |
| | | LambdaQueryWrapper<TicketRegistration> ticketRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getSalesLedgerId,ids); |
| | | ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getPurchaseLedgerId,ids); |
| | | ticketRegistrationMapper.delete(ticketRegistrationLambdaQueryWrapper); |
| | | // 批量删除关联的采购台账的来票登记记录 |
| | | LambdaQueryWrapper<ProductRecord> productRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | LambdaQueryWrapper<QualityInspect> materialInspectLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | materialInspectLambdaQueryWrapper.in(QualityInspect::getPurchaseLedgerId, ids); |
| | | List<QualityInspect> qualityInspects = qualityInspectMapper.selectList(materialInspectLambdaQueryWrapper); |
| | | qualityInspects.stream().forEach(qualityInspect -> { |
| | | if (qualityInspect.getInspectState().equals(1)) { |
| | | throw new BaseException("已提交的检验单不能删除"); |
| | | } |
| | | }); |
| | | List<Long> inspectIds = qualityInspects.stream() |
| | | .map(QualityInspect::getId) |
| | | .collect(Collectors.toList()); |