| | |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.excel.InvoiceLedgerExcelDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerFileMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.pojo.InvoiceLedger; |
| | | import com.ruoyi.sales.pojo.InvoiceLedgerFile; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.service.InvoiceLedgerService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentMapper receiptPaymentMapper; |
| | | |
| | | /** |
| | | * 开票台账新增 |
| | |
| | | /** |
| | | * 附件下载 |
| | | * @param response |
| | | * @param invoiceLedgerDto |
| | | * @param invoiceRegistrationProductDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void invoiceLedgerExport(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) { |
| | | List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoiceLedgerList(invoiceLedgerDto); |
| | | List<InvoiceLedgerExcelDto> invoiceLedgerExcelDtoList = invoiceLedgerDtoList.stream().map(item -> { |
| | | public void invoiceLedgerExport(HttpServletResponse response, InvoiceRegistrationProductDto invoiceRegistrationProductDto) { |
| | | List<InvoiceRegistrationProductDto> invoiceRegistrationProductList = invoiceRegistrationProductMapper.invoiceRegistrationProductList(invoiceRegistrationProductDto); |
| | | List<InvoiceLedgerExcelDto> invoiceLedgerExcelDtoList = invoiceRegistrationProductList.stream().map(item -> { |
| | | InvoiceLedgerExcelDto invoiceLedgerExcelDto = new InvoiceLedgerExcelDto(); |
| | | BeanUtils.copyProperties(item, invoiceLedgerExcelDto); |
| | | return invoiceLedgerExcelDto; |
| | |
| | | return invoiceRegistrationProductDto; |
| | | } |
| | | |
| | | /** |
| | | * 开票台账删除 |
| | | * @param invoiceRegistrationProductId |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delInvoiceLedger(Integer invoiceRegistrationProductId) { |
| | | // 判断是否有回款记录 |
| | | List<ReceiptPayment> receiptPaymentList = receiptPaymentMapper.receiptPaymentListByProdRegId(invoiceRegistrationProductId); |
| | | if(!CollectionUtils.isEmpty(receiptPaymentList)){ |
| | | throw new RuntimeException("请先删除回款记录"); |
| | | } |
| | | // 删除开票台账 |
| | | |
| | | // 删除开票登记 |
| | | // 回滚已开票数量 |
| | | } |
| | | |
| | | } |