yaowanxin
6 小时以前 18c919819ba263a03783afa38d1294436584c842
删除已开票的销售台账时,同步删除开票台账记录,修改出库台账导出
已修改3个文件
33 ■■■■■ 文件已修改
src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordOutController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordOutMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordOutController.java
@@ -85,7 +85,7 @@
    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, "采购出库台账");
    }
    /**
@@ -96,7 +96,7 @@
    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, "成品出库台账");
    }
}
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -82,6 +82,7 @@
    private final InvoiceLedgerMapper invoiceLedgerMapper;
    private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper;
    private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
    @Autowired
    private SysDeptMapper sysDeptMapper;
@@ -361,6 +362,15 @@
        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);
    }
src/main/resources/mapper/procurementrecord/ProcurementRecordOutMapper.xml
@@ -91,20 +91,23 @@
    <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">