From fc28d01cfa022d0f91ec719490342d726db2e105 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 12 九月 2025 08:32:46 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml | 143 ++++++++++++++++++++++++++++++++++-------------
1 files changed, 104 insertions(+), 39 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
index a471991..e9757b9 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
@@ -35,6 +35,7 @@
<result column="delivery_address" property="order.deliveryAddress"/>
<result column="project" property="order.project"/>
<result column="customer_name" property="order.customerName"/>
+ <result column="customer_Id" property="order.customerId"/>
</resultMap>
@@ -118,7 +119,7 @@
and fol.type regexp #{finishedOperateLog.type}
</if>
<if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
- and fol.remarks regexp #{finishedOperateLog.remarksr}
+ and fol.remarks regexp #{finishedOperateLog.remarks}
</if>
<if test="finishedOperateLog.area != null and finishedOperateLog.area != ''">
and fol.area regexp #{finishedOperateLog.area}
@@ -143,6 +144,7 @@
from (select *
from mm.finished_operate_log aa where aa.operate_type = #{type} and aa.status!='宸蹭綔搴�') fol
left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+ left join sd.`order` o on o.order_id=fol.order_id
<where>
date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate}
<if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''">
@@ -191,7 +193,7 @@
and fol.type regexp #{finishedOperateLog.type}
</if>
<if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
- and fol.remarks regexp #{finishedOperateLog.remarksr}
+ and fol.remarks regexp #{finishedOperateLog.remarks}
</if>
<if test="finishedOperateLog.area != null and finishedOperateLog.area != ''">
and fol.area regexp #{finishedOperateLog.area}
@@ -473,10 +475,16 @@
fol.reviewed,
fol.reviewed_time,
fol.type,
- fol.remarks
+ fol.remarks,
+ fol.area,
+ fol.money,
+ o.customer_name,
+ o.project,
+ od.price
from (select *
from mm.finished_operate_log aa where aa.status!='宸蹭綔搴�') fol
left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+ left join sd.`order` o on o.order_id=fol.order_id
<where>
date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} and fol.operate_type=#{type}
<if test="finishedOperateLog.operateType != null and finishedOperateLog.operateType != ''">
@@ -526,6 +534,21 @@
</if>
<if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
and fol.remarks regexp #{finishedOperateLog.remarksr}
+ </if>
+ <if test="finishedOperateLog.area != null and finishedOperateLog.area != ''">
+ and fol.area regexp REGEXP_REPLACE(#{finishedOperateLog.area},'\\.0+$','')
+ </if>
+ <if test="finishedOperateLog.money != null and finishedOperateLog.money != ''">
+ and fol.money regexp REGEXP_REPLACE(#{finishedOperateLog.money},'\\.0+$','')
+ </if>
+ <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')">
+ and o.customer_name regexp #{finishedOperateLog.order.customerName}
+ </if>
+ <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')">
+ and o.project regexp #{finishedOperateLog.order.project}
+ </if>
+ <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.price != null and finishedOperateLog.orderDetail.price != ''">
+ and od.price regexp #{finishedOperateLog.orderDetail.price}
</if>
</where>
order by fol.`status` desc
@@ -538,6 +561,7 @@
from (select *
from mm.finished_operate_log aa where aa.status!='宸蹭綔搴�') fol
left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+ left join sd.`order` o on o.order_id=fol.order_id
<where>
date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} and fol.operate_type=#{type}
<if test="finishedOperateLog.operateType != null and finishedOperateLog.operateType != ''">
@@ -587,6 +611,21 @@
</if>
<if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
and fol.remarks regexp #{finishedOperateLog.remarksr}
+ </if>
+ <if test="finishedOperateLog.area != null and finishedOperateLog.area != ''">
+ and fol.area regexp REGEXP_REPLACE(#{finishedOperateLog.area},'\\.0+$','')
+ </if>
+ <if test="finishedOperateLog.money != null and finishedOperateLog.money != ''">
+ and fol.money regexp REGEXP_REPLACE(#{finishedOperateLog.money},'\\.0+$','')
+ </if>
+ <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.customerName != null and finishedOperateLog.order.customerName != '')">
+ and o.customer_name regexp #{finishedOperateLog.order.customerName}
+ </if>
+ <if test="finishedOperateLog.order !=null and (finishedOperateLog.order.project != null and finishedOperateLog.order.project != '')">
+ and o.project regexp #{finishedOperateLog.order.project}
+ </if>
+ <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.price != null and finishedOperateLog.orderDetail.price != ''">
+ and od.price regexp #{finishedOperateLog.orderDetail.price}
</if>
</where>
</select>
@@ -620,7 +659,15 @@
)
values (
#{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"鍏ュ簱",#{userName},
- #{flowCard.inventoryQuantity},now(),"鏈鏍�",#{container},#{deliveryDetailMoney},#{deliveryDetailArea}
+ #{flowCard.inventoryQuantity},
+ <if test="createTime != null">
+ #{createTime}
+ </if>
+ <if test="createTime == null">
+ now()
+ </if>
+ ,"鏈鏍�",#{container},#{deliveryDetailMoney},#{deliveryDetailArea}
+
)
</insert>
@@ -632,11 +679,12 @@
operator,
quantity,
operate_time,
- status
+ status,
+ remarks
)
values (
#{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber}
- ,"鍑哄簱",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"鏈鏍�"
+ ,"鍑哄簱",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"鏈鏍�",#{boxNo}
)
</insert>
@@ -715,10 +763,16 @@
fol.reviewed,
fol.reviewed_time,
fol.type,
- fol.remarks
+ fol.remarks,
+ fol.area,
+ fol.money,
+ o.customer_name,
+ o.project,
+ od.price
from (select *
from mm.finished_operate_log aa where aa.status!='宸蹭綔搴�') fol
left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+ left join sd.`order` o on o.order_id=fol.order_id
where date(fol.operate_time)>=#{dates[0]} and date(fol.operate_time) <= #{dates[1]} and fol.operate_type=#{type}
</select>
@@ -758,6 +812,7 @@
od.height,
o.project,
o.customer_name,
+ o.customer_Id,
o.delivery_address,
fol.operate_time,
fol.`status`,
@@ -800,10 +855,11 @@
and o.delivery_address regexp #{finishedOperateLog.order.deliveryAddress}
</if>
<if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
- and fol.remarks regexp #{finishedOperateLog.remarksr}
+ and fol.remarks regexp #{finishedOperateLog.remarks}
</if>
</where>
- group by fol.remarks,od.order_id,fol.process_id
+ group by fol.remarks,od.order_id
+ -- ,fol.process_id
order by fol.operate_time desc
limit #{offset},#{pageSize};
</select>
@@ -816,6 +872,7 @@
from (select *
from mm.finished_operate_log aa where aa.operate_type = '鍏ュ簱' and aa.status!='宸蹭綔搴�') fol
left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+ left join sd.`order` o on o.order_id=fol.order_id
<where>
date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate}
and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null)
@@ -847,10 +904,12 @@
and o.delivery_address regexp #{finishedOperateLog.order.deliveryAddress}
</if>
<if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''">
- and fol.remarks regexp #{finishedOperateLog.remarksr}
+ and fol.remarks regexp #{finishedOperateLog.remarks}
</if>
</where>
- group by fol.remarks,od.order_id,fol.process_id) as zu
+ group by fol.remarks,od.order_id
+ -- ,fol.process_id
+ ) as zu
</select>
@@ -874,34 +933,39 @@
</select>
<select id="getPrimaryListLimts">
+
+
+
select kkk.*,rw.teams_groups_name as teams_groups_name2 from(select o.order_id,
- o.customer_name,
- o.project,
- fol.remarks,
- SUM(fol.quantity) as quantity,
- ROUND( sum(od.width * od.height * fol.quantity) / 1000000, 2 ) as area,
- ROUND( sum(od.width * od.height * fol.quantity*p.total_thickness*2.5) / 1000000, 2 ) as weight,
- fol.process_id,
- aaa.teams_groups_name,
- aaa.previous_process,
- date( aaa.reporting_work_time) as reporting_work_time
- from (select *
- from mm.finished_operate_log aa where aa.operate_type = '鍏ュ簱' and aa.status!='宸蹭綔搴�') fol
- left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
- left join sd.`order` o on o.order_id=fol.order_id
- left join sd.product p on od.product_id=p.id
- left join (select teams_groups_name,process_id,previous_process,reporting_work_time from pp.reporting_work where this_process='鍖呰') aaa on aaa.process_id=fol.process_id
+ o.customer_name,
+ o.customer_id,
+ o.project,
+ o.batch,
+ fol.remarks,
+ SUM(fol.quantity) as quantity,
+ ROUND( sum(od.width * od.height * fol.quantity) / 1000000, 2 ) as area,
+ ROUND( sum(od.width * od.height * fol.quantity*p.total_thickness*2.5) / 1000000, 2 ) as weight,
+ fol.process_id,
+ aaa.teams_groups_name,
+ aaa.previous_process,
+ date( aaa.reporting_work_time) as reporting_work_time
+ from (select *
+ from mm.finished_operate_log aa where aa.operate_type = '鍏ュ簱' and aa.status!='宸蹭綔搴�') fol
+ left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+ left join sd.`order` o on o.order_id=fol.order_id
+ left join sd.product p on od.product_id=p.id
+ left join (select teams_groups_name,process_id,previous_process,reporting_work_time from pp.reporting_work where this_process='鍖呰' group by process_id) aaa on aaa.process_id=fol.process_id
- where
- o.order_id=#{orderId} and fol.remarks=#{remarks}
- and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null)
+ where
+ o.customer_id=#{customerId} and fol.remarks=#{remarks} and o.project=#{project}
+ and (fol.remarks is not null and fol.remarks !="") and (fol.process_id !="" and fol.process_id is not null)
- group by fol.remarks,od.order_id
- ) as kkk
- left join pp.reporting_work rw on rw.process_id=kkk.process_id and rw.this_process=kkk.previous_process
- group by kkk.remarks,kkk.order_id
+ group by fol.remarks,o.customer_name,o.project
+ ) as kkk
+ left join pp.reporting_work rw on rw.process_id=kkk.process_id and rw.this_process=kkk.previous_process
+ group by kkk.remarks,kkk.customer_id,kkk.project
</select>
@@ -926,14 +990,14 @@
<select id="getDetailLists">
SELECT
- od.building_number,
+ ifnull(od.building_number,ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'')) as building_number,
od.width,
od.height,
- fol.quantity,
+ sum(fol.quantity) as quantity,
od.product_name,
od.product_id,
- ROUND( od.width * od.height * fol.quantity / 1000000, 2 ) as area,
- ROUND( od.width * od.height * fol.quantity / 1000000, 2 )*#{thickness}*2.5 as weight
+ ROUND(sum(od.width * od.height * fol.quantity / 1000000) , 2 ) as area,
+ ROUND(sum(od.width * od.height * fol.quantity / 1000000) , 2 )*#{thickness}*2.5 as weight
FROM
( SELECT * FROM mm.finished_operate_log aa WHERE aa.operate_type = '鍏ュ簱' AND aa.STATUS != '宸蹭綔搴�' ) fol
LEFT JOIN sd.order_detail od ON fol.order_id = od.order_id
@@ -941,8 +1005,9 @@
LEFT JOIN sd.`order` o ON o.order_id = fol.order_id
WHERE
o.order_id=#{orderId} and fol.remarks=#{remarks} and od.product_id=#{productId}
+ group by od.order_id,od.order_number
ORDER BY
- fol.operate_time DESC
+ od.order_number
</select>
--
Gitblit v1.8.0