maven
昨天 e0f2b2a83684fba1b15e90226f5ae78c9680165f
yys  修改仓储物流bug
已修改2个文件
28 ■■■■ 文件已修改
src/main/resources/mapper/procurementrecord/CustomStorageMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/CustomStorageMapper.xml
@@ -4,13 +4,14 @@
    <select id="listPageCopyByCustom" resultType="com.ruoyi.procurementrecord.pojo.CustomStorage">
        select t1.*,
               sum(t1.inbound_num) as inboundNum,
               sum(t1.inbound_num) as inboundNum0,
               sum(t1.tax_inclusive_total_price) as taxInclusiveTotalPrice,
               SUM(t1.inbound_num) - COALESCE(SUM(t2.inbound_num), 0) AS availableStock
                sum(t1.tax_inclusive_total_price) as totalPrice,
                sum(t1.inbound_num) as inboundNum,
                sum(t1.inbound_num) as inboundNum0,
                SUM(t1.inbound_num) - COALESCE(SUM(t2.inbound_num), 0) AS availableStock
               from custom_storage t1
               left join procurement_record_out t2 on t1.id = t2.procurement_record_storage_id and t2.type = 3
        <where>
            t2.type = 3
            <if test="req.productCategory != null and req.productCategory != ''">
                and t1.product_category like  concat('%',#{req.productCategory},'%')
            </if>
@@ -30,10 +31,11 @@
        sum(t1.inbound_num) as inboundNum,
        sum(t1.inbound_num) as inboundNum0,
        sum(t1.tax_inclusive_total_price) as taxInclusiveTotalPrice,
        SUM(t1.inbound_num) - COALESCE(SUM(t2.inbound_num), 0) AS availableStock
        (t1.inbound_num - COALESCE(SUM(t2.inbound_num), 0)) AS availableStock
        from custom_storage t1
        left join procurement_record_out t2 on t1.id = t2.procurement_record_storage_id and t2.type = 3
        <where>
            t2.type = 3
            <if test="req.productCategory != null and req.productCategory != ''">
                and t1.product_category like  concat('%',#{req.productCategory},'%')
            </if>
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -51,7 +51,7 @@
        t1.update_time,
        t1.create_by,
        t2.warn_num,
        SUM(t1.inbound_num) - COALESCE(SUM(t4.inbound_num), 0) AS availableStock
        (t1.inbound_num - COALESCE(SUM(t4.inbound_num), 0)) / count(1) AS availableStock
        from  procurement_record_storage t1
                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2
                  left join purchase_ledger t3 on t3.id = t2.sales_ledger_id
@@ -141,19 +141,19 @@
        t1.inbound_batches,
        t1.unit_price as unitPrice,
        sum(t1.total_price) as totalPrice,
        sum(t1.inbound_num) as inboundNum,
        sum(t1.inbound_num) as inboundNum0,
        sum(t1.inbound_num) / COALESCE(count(1), 1) as inboundNum,
        sum(t1.inbound_num) / COALESCE(count(1), 1) as inboundNum0,
        t1.create_time,
        t1.update_time,
        t1.create_by,
        t2.warn_num,
        SUM(t1.inbound_num) - COALESCE(SUM(t4.inbound_num), 0) AS availableStock
        (SUM(t1.inbound_num) - COALESCE(SUM(t4.inbound_num), 0)) / COALESCE(count(1), 1) AS availableStock
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2
        left join purchase_ledger t3 on t3.id = t2.sales_ledger_id
        left join procurement_record_out t4 on t1.id = t4.procurement_record_storage_id and t4.type = 1
        <where>
            t1.type = 1
            t1.type = 1 and t4.type = 1
            <if test="req.supplierName != null and req.supplierName != ''">
                and t3.supplier_name like  concat('%',#{req.supplierName},'%')
            </if>
@@ -264,7 +264,7 @@
        t1.update_time,
        t1.create_by,
        t2.warn_num,
        SUM(t1.inbound_num) - COALESCE(SUM(t4.inbound_num), 0) AS availableStock
        (t1.inbound_num - COALESCE(SUM(t4.inbound_num), 0)) / count(1) AS availableStock
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1
        left join sales_ledger t3 on t3.id = t2.sales_ledger_id
@@ -312,13 +312,13 @@
        t1.update_time,
        t1.create_by,
        t2.warn_num,
        SUM(t1.inbound_num) - COALESCE(SUM(t4.inbound_num), 0) AS availableStock
        SUM(t1.inbound_num) - COALESCE(SUM(t4.inbound_num), 0) / COALESCE(count(1), 1) AS availableStock
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1
        left join sales_ledger t3 on t3.id = t2.sales_ledger_id
        left join procurement_record_out t4 on t1.id = t4.procurement_record_storage_id and t4.type = 2
        <where>
            t1.type = 2
            t4.type = 2 and t1.type = 2
            <if test="req.customerName != null and req.customerName != ''">
                and t3.customer_name like  concat('%',#{req.customerName},'%')
            </if>