From 134ca89b9af0c3b58d4e003dc5c5739656e0de44 Mon Sep 17 00:00:00 2001 From: jiangpeng Date: Mon, 15 Jun 2026 14:12:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=AE=A2=E5=8D=95=E9=85=8D?= =?UTF-8?q?=E5=A4=87=E8=B4=A7=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/sip/ProjectOrderInfoMapper.xml | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml index 0daa3648..feed9e6c 100644 --- a/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml @@ -934,23 +934,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t3.type as product_type, t7.vendor_code, t7.vendor_name, - t1.quantity as order_num, + (select sum(quantity) from project_product_info as tt where tt.product_bom_code = t1.product_bom_code and tt.project_id = t1.project_id) as order_num, sum(ifnull(t5.bind_num, 0)) as ph_num, - ifnull(t6.bh_num,0) as bh_num, + (select count(1) from oms_inventory_info as tt where tt.order_code = t1.order_code and tt.product_code = t1.product_bom_code) as bh_num, sum(ifnull(t5.bind_num, 0) * t4.price) as sum_cost - from project_product_info as t1 - inner join project_order_info as t2 on t1.project_id = t2.project_id + from ( + select + tt1.product_bom_code, + sum(tt1.quantity) as quantity, + tt1.project_id, + tt2.id as order_id, + tt2.order_code + from project_product_info as tt1 + inner join project_order_info as tt2 on tt1.project_id = tt2.project_id + where tt2.order_code = #{orderCode} + group by tt1.product_bom_code + )as t1 inner join product_info as t3 on t1.product_bom_code = t3.product_code left join oms_purchase_order_item as t4 on t3.product_code = t4.product_code - left join oms_purchase_order_map as t5 on t2.id = t5.order_id and t4.purchase_id = t5.purchase_id and t5.product_code = t4.product_code - left join ( - select count(1) bh_num, product_code - from oms_inventory_info - where order_code = #{orderCode} - group by product_code - ) t6 on t3.product_code = t6.product_code + left join oms_purchase_order_map as t5 on t1.order_id = t5.order_id and t4.purchase_id = t5.purchase_id and t5.product_code = t4.product_code left join oms_vendor_info as t7 on t3.vendor_code = t7.vendor_code - where t2.order_code = #{orderCode} group by t3.product_code, t3.model order by t3.type, t3.product_code @@ -1112,7 +1115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t4.product_code, 0 as price, 0 as all_price, - count(1) as quantity, + sum(t3.quantity) as quantity, ifnull(t3.tax_rate,13) / 100 as tax_rate, cast(0 - 0 / (1 + ifnull(t3.tax_rate,13) / 100) as decimal(10,2)) as tax_total, t4.type,