Browse Source

2026-01-04

生产派工单列表、采购标签生成页面查询优化
master
fengyuan_yang 2 months ago
parent
commit
c74c475237
  1. 1
      src/main/java/com/gaotao/modules/wms/data/InboundQcResultData.java
  2. 41
      src/main/resources/mapper/shopOrder/ShopOrderMapper.xml
  3. 7
      src/main/resources/mapper/wms/WmsPrintMapper.xml

1
src/main/java/com/gaotao/modules/wms/data/InboundQcResultData.java

@ -43,4 +43,5 @@ public class InboundQcResultData extends QueryPage {
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date endDate;
private String notifyNo;
private String spec;
}

41
src/main/resources/mapper/shopOrder/ShopOrderMapper.xml

@ -163,49 +163,52 @@
D.LotSize AS OrderQty
FROM
SOScheduledRouting AS T
INNER JOIN SORouting AS S WITH(NOLOCK) ON T.Site = S.Site AND T.OrderNo = S.OrderNo AND T.ItemNo = S.ItemNo
LEFT JOIN ShopOrder AS D WITH(NOLOCK) ON T.Site = D.Site AND T.OrderNo = D.OrderNo
LEFT JOIN SOScheduledList AS E WITH(NOLOCK) ON E.Site = T.Site AND E.LinkedSeqNo = T.SeqNo
LEFT JOIN Part AS P WITH(NOLOCK) ON S.Site = P.Site AND S.PartNo = P.PartNo
LEFT JOIN SORouting AS S1 WITH(NOLOCK) ON S.Site = S1.Site AND S.OrderNo = S1.OrderNo AND S.PreItemNo = S1.ItemNo
LEFT JOIN SORouting AS S2 WITH(NOLOCK) ON S.Site = S2.Site AND S.OrderNo = S2.OrderNo AND S.NextItemNo = S2.ItemNo
LEFT JOIN ( SELECT Site, CreatedOpsSeqNo, COUNT(1) AS RollCount FROM SFDC_Rolls WITH(NOLOCK) WHERE RollType = '下道流转' GROUP BY Site, CreatedOpsSeqNo) AS R ON R.Site = T.Site AND R.CreatedOpsSeqNo = T.SeqNo
LEFT JOIN Customer C WITH(NOLOCK) ON D.Site = C.Site AND D.CustomerID = C.CustomerID
INNER JOIN SORouting AS S WITH(NOLOCK) ON T.Site = S.Site AND T.OrderNo = S.OrderNo AND T.ItemNo = S.ItemNo
LEFT JOIN ShopOrder AS D WITH(NOLOCK) ON T.Site = D.Site AND T.OrderNo = D.OrderNo
LEFT JOIN SOScheduledList AS E WITH(NOLOCK) ON E.Site = T.Site AND E.LinkedSeqNo = T.SeqNo
LEFT JOIN Part AS P WITH(NOLOCK) ON S.Site = P.Site AND S.PartNo = P.PartNo
LEFT JOIN SORouting AS S1 WITH(NOLOCK) ON S.Site = S1.Site AND S.OrderNo = S1.OrderNo AND S.PreItemNo = S1.ItemNo
LEFT JOIN SORouting AS S2 WITH(NOLOCK) ON S.Site = S2.Site AND S.OrderNo = S2.OrderNo AND S.NextItemNo = S2.ItemNo
LEFT JOIN (SELECT Site, CreatedOpsSeqNo, COUNT(1) AS RollCount FROM SFDC_Rolls WITH(NOLOCK) WHERE RollType = '下道流转' GROUP BY Site, CreatedOpsSeqNo) AS R ON R.Site = T.Site AND R.CreatedOpsSeqNo = T.SeqNo
LEFT JOIN Customer C WITH(NOLOCK) ON D.Site = C.Site AND D.CustomerID = C.CustomerID
<where>
AND T.Site = S.Site
AND T.OrderNo = S.OrderNo
AND T.ItemNo = S.ItemNo
<if test=" site != null and site != ''">
<if test="site != null and site != ''">
AND T.Site like '%' + #{site} + '%'
</if>
<if test=" orderNo != null and orderNo != ''">
<if test="orderNo != null and orderNo != ''">
AND T.OrderNo like '%' + #{orderNo} + '%'
</if>
<if test=" partNo != null and partNo != ''">
<if test="seqNo != null">
AND T.SeqNo like '%' + CAST(CAST(#{seqNo} AS BIGINT) AS VARCHAR) + '%'
</if>
<if test="partNo != null and partNo != ''">
AND S.PartNo like '%' + #{partNo} + '%'
</if>
<if test=" sResourceID != null and sResourceID != ''">
<if test="sResourceID != null and sResourceID != ''">
AND T.S_ResourceID like '%' + #{sResourceID} + '%'
</if>
<if test=" workCenterNo != null and workCenterNo != ''">
<if test="workCenterNo != null and workCenterNo != ''">
AND T.S_WorkCenterNo like '%' + #{workCenterNo} + '%'
</if>
<if test=" date1 != null ">
<if test="date1 != null ">
AND D.EnterDate >= #{date1}
</if>
<if test=" date2 != null ">
<if test="date2 != null ">
AND dateadd( DAY, 1, #{date2} ) > D.EnterDate
</if>
<if test=" date3 != null ">
<if test="date3 != null ">
AND T.PlanStartTime >= #{date3}
</if>
<if test=" date4 != null ">
<if test="date4 != null ">
AND dateadd( DAY, 1, #{date4} ) > T.PlanStartTime
</if>
<if test=" date5 != null ">
<if test="date5 != null ">
AND T.PlanFinishTime>= #{date5}
</if>
<if test=" date6 != null ">
<if test="date6 != null ">
AND dateadd( DAY, 1, #{date6} ) > T.PlanFinishTime
</if>
${sql}

7
src/main/resources/mapper/wms/WmsPrintMapper.xml

@ -12,6 +12,7 @@
a.order_status,
d.part_no,
d.part_desc,
p.spec,
D.related_order_no AS po_orderNo,
D.related_order_line_no AS po_itemNo,
c.SupplierName,
@ -25,8 +26,9 @@
disposal_measures,
B.batch_qualified_qty,
b.inspector_no
from inbound_notification_head a
from inbound_notification_head a
inner join inbound_notification_detail D on a.site = D.site and a.bu_no = D.bu_no and a.order_no = D.order_no AND A.order_type ='采购入库'
LEFT JOIN PART P ON D.site = P.Site AND D.part_no = P.PartNo
inner join qc_iqc_record b on D.site = b.site and D.bu_no = b.bu_no and D.inspection_no = b.inspection_no
left join Supplier c on a.site = c.Site and a.Supplier_ID = c.supplierID
<where>
@ -48,6 +50,9 @@
<if test="query.partDesc != null and query.partDesc != ''">
and b.part_desc like '%'+ #{query.partDesc,jdbcType=CHAR} +'%'
</if>
<if test="query.spec != null and query.spec != ''">
and p.spec like '%'+ #{query.spec} +'%'
</if>
<if test="query.startDate != null">
and b.inspector_date > #{query.startDate}
</if>

Loading…
Cancel
Save