Browse Source

修改包装工序看板sql

master
赵宏斌 5 months ago
parent
commit
2f30ebd35d
  1. 30
      src/main/resources/mapper/board/BoardMapper.xml

30
src/main/resources/mapper/board/BoardMapper.xml

@ -147,18 +147,32 @@
</select> </select>
<select id="SORoutingBoardForBaoZhuang" resultType="com.heai.modules.board.entity.SORoutingBoardData" > <select id="SORoutingBoardForBaoZhuang" resultType="com.heai.modules.board.entity.SORoutingBoardData" >
SELECT a.site,a.OrderNo,a.ItemNo,a.OperationDesc,a.PartNo,dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,a.QtyRequired,
a.QtyReported,a.QtyApprove,isnull(SOP.TotalFinishedQty,0) lastApproveQty,b.NeedDate as planFinishTime,dbo.Get_SORouting_ClosedFlag(a.site,a.OrderNo,a.ItemNo) as ClosedFlag
,isnull(CONVERT(varchar(30), p1.NumValue),p1.TextValue) text2,p2.NumValue num2,p3.TextValue text1,p4.TextValue text3
from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
LEFT JOIN SORoutingOutput SOP ON a.site=SOP.site and a.OrderNo=SOP.OrderNo and SOP.itemNo=dbo.Get_SORouting_PreviousOperationItemNo(a.site,a.OrderNo,a.itemNo)
SELECT a.site,
a.OrderNo,
T.SeqNo,
a.OperationDesc,
a.PartNo,
dbo.Get_Part_Spec(a.Site,a.PartNo) as PartDesc,
T.QtyRequired,
T.QtyReported,
T.QtyApprove,
isnull(SOP.QtyApprove,0) lastApproveQty,
T.S_ScheduledDate as planFinishTime,
isnull(CONVERT(varchar(30), p1.NumValue),p1.TextValue) text2,p2.NumValue num2,p3.TextValue text1,p4.TextValue text3
from SOScheduledRouting T
LEFT JOIN SOScheduledRouting SOP ON SOP.site=t.site and SOP.OrderNo=t.OrderNo and SOP.SeqNo = isnull(T.PreviousSeqNo,-1)
,SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo
LEFT JOIN PartSubPropertiesValue p1 on p1.site=a.site and p1.PartNo=a.PartNo and p1.PropertiesItemNo='BAG' LEFT JOIN PartSubPropertiesValue p1 on p1.site=a.site and p1.PartNo=a.PartNo and p1.PropertiesItemNo='BAG'
LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='QTY' LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='QTY'
LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='CARTON' LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='CARTON'
LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='BAG TYPE' LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='BAG TYPE'
where a.partNo like 'FP%' and (b.status not in ('已取消','已关闭','已停工') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING'
and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0) >a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01'
order by planFinishTime
where -- OutWorkFlag代表是否开工
T.Site = A.Site AND T.OrderNo = A.OrderNo AND T.ItemNo = A.ItemNo AND T.ClosedFlag = 'N' AND T.OutWorkFlag = 'Y'
AND a.partNo like 'FP%'
and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING'
and T.S_ScheduledDate >'2022-01-01'
order by T.S_ScheduledDate
</select> </select>
<select id="SeqNoForLiuHua" resultType="com.heai.modules.board.entity.SORoutingBoardData" > <select id="SeqNoForLiuHua" resultType="com.heai.modules.board.entity.SORoutingBoardData" >

Loading…
Cancel
Save