删除已开票的销售台账时,同步删除开票台账记录,修改出库台账导出
| | |
| | | public void exportOne(HttpServletResponse response) { |
| | | List<ProcurementRecordOutPageDto> list = procurementRecordOutMapper.listOne(); |
| | | ExcelUtil<ProcurementRecordOutPageDto> util = new ExcelUtil<>(ProcurementRecordOutPageDto.class); |
| | | util.exportExcel(response, list, "生产出库台账"); |
| | | util.exportExcel(response, list, "采购出库台账"); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void exportTwo(HttpServletResponse response) { |
| | | List<ProcurementRecordOutPageDto> list = procurementRecordOutMapper.listTwo(); |
| | | ExcelUtil<ProcurementRecordOutPageDto> util = new ExcelUtil<>(ProcurementRecordOutPageDto.class); |
| | | util.exportExcel(response, list, "生产出库台账"); |
| | | util.exportExcel(response, list, "成品出库台账"); |
| | | } |
| | | |
| | | } |
| | |
| | | private final InvoiceLedgerMapper invoiceLedgerMapper; |
| | | |
| | | private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper; |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | LambdaQueryWrapper<SalesLedgerScheduling> in = new LambdaQueryWrapper<SalesLedgerScheduling>() |
| | | .in(SalesLedgerScheduling::getSalesLedgerId, idList); |
| | | salesLedgerSchedulingMapper.delete(in); |
| | | LambdaQueryWrapper<InvoiceRegistrationProduct> InvoiceRegistrationProductWrapper = new LambdaQueryWrapper<>(); |
| | | InvoiceRegistrationProductWrapper.in(InvoiceRegistrationProduct::getSalesLedgerId, idList); |
| | | List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(InvoiceRegistrationProductWrapper); |
| | | if (!CollectionUtils.isEmpty(invoiceRegistrationProducts)) { |
| | | List<Integer> InvoiceRegistrationProductIds = invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<InvoiceLedger> invoiceLedgerQuery = new LambdaQueryWrapper<>(); |
| | | invoiceLedgerQuery.in(InvoiceLedger::getInvoiceRegistrationProductId, InvoiceRegistrationProductIds); |
| | | invoiceLedgerMapper.delete(invoiceLedgerQuery); |
| | | } |
| | | // 2. 再删除主表数据 |
| | | return salesLedgerMapper.deleteBatchIds(idList); |
| | | } |
| | |
| | | |
| | | <select id="listTwo" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t1.supplier_name, |
| | | t1.product_category, |
| | | t1.id, |
| | | t1.specification_model, |
| | | t1.unit, |
| | | t1.tax_rate, |
| | | t1.tax_inclusive_unit_price, |
| | | t1.tax_inclusive_total_price, |
| | | t1.tax_exclusive_total_price, |
| | | t1.`code`, |
| | | t3.supplier_name, |
| | | t2.product_category, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_time as time, |
| | | t1.create_by |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 3 |
| | | </select> |
| | | <select id="listPageByProduct" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |