From 8668e5ce64e1d7b3dbfffc42cf6767cb9ea2d6c0 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期二, 25 六月 2024 09:54:15 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml | 76 ++++++++++++++++++++++++++++++++++----
1 files changed, 68 insertions(+), 8 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
index 7a5e859..9b332f2 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
@@ -13,6 +13,9 @@
glass_child,
child_width,
child_height,
+ area,
+ total_area,
+
process,
`group`)
select
@@ -21,8 +24,13 @@
pd.glass_sort,
if(pd.glass_sort=1,'(澶�)',if(pd2.glass_sort=pd.glass_sort,'(鍐�)','')),
pd.detail,
- od.width,
+ if( od.bend_radius!='',
+ round(od.width*(od.bend_radius-round(sum(t.thicknessCount),2))/od.bend_radius,1),
+ od.width
+ ),
od.height,
+ od.area,
+ od.gross_area,
pd.process,
pd.glass_group
from sd.product_detail as pd
@@ -30,8 +38,26 @@
on od.product_id = pd.prod_id and pd.detail_type='glass'
LEFT JOIN (SELECT max(id) as id ,max(glass_sort) as glass_sort from product_detail GROUP BY prod_id)as pd2
on pd2.id=pd.id
+ left join (
+ select
+ a.prod_id,
+ a.sort_num,
+ a.glass_sort,
+ (case
+ when a.sort_num=1
+ then left(detail,LOCATE('mm',detail)-1)/2
+ else
+ left(detail,LOCATE('mm',detail)-1)
+ end) as 'thicknessCount'
+
+ from product_detail as a
+ group by prod_id,a.sort_num
+ ) as t
+ ON t.prod_id = od.product_id and t.sort_num <=pd.sort_num
+
where od.order_id = #{orderId}
+ group by od.order_number,pd.glass_sort
ORDER BY od.order_number
</insert>
@@ -42,24 +68,26 @@
<resultMap id="orderGlassDetailMap" type="com.example.erp.entity.sd.OrderGlassDetail" >
<id column="id" property="id"/>
<result column="order_id" property="orderId"/>
+ <result column="order_number" property="orderNumber"/>
<result column="glass_address" property="glassAddress"/>
<result column="technology_number" property="technologyNumber"/>
<result column="glass_child" property="glassChild"/>
<result column="child_width" property="childWidth"/>
<result column="child_height" property="childHeight"/>
+ <result column="icon" property="icon"/>
<result column="process" property="process"/>
+ <result column="area" property="area"/>
+ <result column="total_area" property="totalArea"/>
<!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
<association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
- <result column="order_number" property="orderNumber"/>
- <result column="building_number" property="buildingNumber"/>
+ <result column="building_number" property="buildingNumber"/>
+ <result column="product_id" property="productId"/>
<result column="product_name" property="productName"/>
<result column="width" property="width"/>
<result column="height" property="height"/>
<result column="shape" property="shape"/>
- <result column="gross_area" property="grossArea"/>
<result column="edging_type" property="edgingType"/>
- <result column="area" property="area"/>
<result column="quantity" property="quantity"/>
<result column="processing_note" property="processingNote"/>
<result column="beizhu" property="remarks"/>
@@ -71,8 +99,9 @@
<select id="selectOrderGlassDetailByOrderId" resultMap="orderGlassDetailMap">
select
a.order_id,
- b.order_number,
+ a.order_number,
b.building_number,
+ b.product_id,
b.product_name,
a.glass_address,
a.technology_number,
@@ -80,11 +109,12 @@
b.width,
b.height,
b.shape,
- b.gross_area,
+ a.total_area,
b.edging_type,
a.child_width,
a.child_height,
- b.area,
+ a.icon,
+ a.area,
b.quantity,
a.process,
b.remarks as 'beizhu',
@@ -95,4 +125,34 @@
where a.order_id = #{orderId}
order by a.order_number,a.technology_number
</select>
+
+ <update id="updateSizeAndProcess" parameterType="java.util.List">
+ <foreach collection="orderGlassDetails" item="item" index="index" open="" close="" separator=";">
+ update order_glass_detail as a,
+ order_detail as b
+ set
+ a.child_width = #{item.childWidth},
+ a.child_height = #{item.childHeight},
+ a.area = #{item.area},
+ a.total_area = #{item.area}*b.quantity,
+ a.icon = #{item.icon},
+ a.process = #{item.process}
+ where
+ a.order_id = b.order_id
+ and a.order_id = #{item.orderId}
+ and a.order_number = #{item.orderNumber}
+ and a.technology_number = #{item.technologyNumber}
+ </foreach>
+
+ </update>
+
+ <select id="getDifferentSizeNumber">
+ select if(count(id)>1,1,0) from (select
+ id
+ from order_glass_detail as a
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ group by child_width,child_height) as c
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0