From 9869d6d8a0542143358717e3dc3e8a7346a2c50b Mon Sep 17 00:00:00 2001 From: lilili Date: Mon, 29 May 2023 13:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=9F=E4=BA=A7=E9=A2=86?= =?UTF-8?q?=E6=96=99=E9=A1=B5=E9=9D=A2=E5=8F=8A=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NFine.Application/WMS/PickMaterialApp.cs | 111 ++++++++++++- .../Views/PickMaterial/ICSMOPickMerge.cshtml | 146 +++++++++++++++--- 2 files changed, 232 insertions(+), 25 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs index 5924f6c..e5502bc 100644 --- a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs +++ b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs @@ -149,6 +149,24 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'"; { sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' "); } + if (!string.IsNullOrWhiteSpace(queryParam["Order"].ToString())) + { + sqlString.Append($@" and a.OrderNumber like '%{queryParam["Order"]}%' "); + } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "); + } + if (!string.IsNullOrWhiteSpace(queryParam["CreateDate"].ToString())) + { + sqlString.Append($@" and a.CreateDateTime >='{queryParam["CreateDate"].ToDate()}' and a.CreateDateTime <'{queryParam["CreateDate"].ToDate().AddDays(+1)}' "); + } + if (!string.IsNullOrWhiteSpace(queryParam["NeedDate"].ToString())) + { + sqlString.Append($@" and a.NeedDate like '%{queryParam["NeedDate"]}%' "); + } } sqlString.Append(@" group by a.ApplyCode, a.WorkPoint,a.IssueQuantity,a.CreateDateTime,a.createperson, @@ -169,7 +187,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'"; var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"SELECT * FROM (select row_number() over(partition by a.ApplyCode,a.InvCode,a.Sequence ORDER BY a.ApplyCode) as row, - a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName ,a.InvCode, + a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName ,a.InvCode,a.OrderNumber, a.EATTRIBUTE,a.Sets,a.OrderInvCode,a.OrderInvDescribe,a.BillType,a.Remarks,a.Desks,a.DispatchNumber,a.DispatcherName, a.ReceiverNumber,a.ReceiverName,a.Urgency,a.NeedDate,a.NeedTime,a.RemarksTerm,a.TextNumber,a.InvDescribe,a.Unit,a.StockIndicator, d.InvName,d.InvDesc,d.InvStd,d.InvUnit,detail.LocationCode AS Area, @@ -197,6 +215,24 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'"; { sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' "; } + if (!string.IsNullOrWhiteSpace(queryParam["Order"].ToString())) + { + sql += $@" and a.OrderNumber like '%{queryParam["Order"]}%' "; + } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "; + } + if (!string.IsNullOrWhiteSpace(queryParam["CreateDate"].ToString())) + { + sql += $@" and a.CreateDateTime like '%{queryParam["CreateDate"]}%' "; + } + if (!string.IsNullOrWhiteSpace(queryParam["NeedDate"].ToString())) + { + sql += $@" and a.NeedDate like '%{queryParam["NeedDate"]}%' "; + } } sql += " ) c WHERE c.row=1 "; sql = string.Format(sql, Code, WorkPoint); @@ -387,6 +423,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' "); } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "); + } } sqlString.Append(@"group by a.ApplyCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode, @@ -431,6 +473,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' "; } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "; + } } sql += " ) c WHERE c.row=1 "; sql = string.Format(sql, Code, WorkPoint); @@ -546,6 +594,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; LEFT JOIN ICSMOPickMerge e ON a.ID = e.SourceID AND a.WorkPoint = e.WorkPoint LEFT JOIN ICSExtension f ON a.ExtensionID = f.ID AND a.WorkPoint = f.WorkPoint LEFT JOIN ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint + LEFT JOIN ICSInventoryDetail detail ON d.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint WHERE a.WorkPoint = '{WorkPoint}' "); if (!string.IsNullOrWhiteSpace(queryJson)) { @@ -565,6 +614,20 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' "); } + if (!string.IsNullOrWhiteSpace(queryParam["CusCode"].ToString())) + { + sqlString.Append($@" and a.CusCode like '%{queryParam["CusCode"]}%' "); + } + if (!string.IsNullOrWhiteSpace(queryParam["CusName"].ToString())) + { + sqlString.Append($@" and a.CusName like '%{queryParam["CusName"]}%' "); + } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "); + } } sqlString.Append(@"GROUP BY a.SDNCode, a.CreateDateTime, a.CreatePerson, f.Colspan, f.ProjectCode, f.BatchCode, f.Version, f.Brand, @@ -609,6 +672,20 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' "; } + if (!string.IsNullOrWhiteSpace(queryParam["CusCode"].ToString())) + { + sql += $@" and a.CusCode like '%{queryParam["CusCode"]}%' "; + } + if (!string.IsNullOrWhiteSpace(queryParam["CusName"].ToString())) + { + sql += $@" and a.CusName like '%{queryParam["CusName"]}%' "; + } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "; + } } sql += " ) c WHERE c.row=1 "; sql = string.Format(sql, Code, WorkPoint); @@ -667,6 +744,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' "); } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sqlString.Append($@" (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "); + } } sqlString.Append(@" group by a.OutCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,f.BatchCode, @@ -712,6 +795,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' "; } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.WHCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "; + } } sql += " ) c WHERE c.row=1 "; sql = string.Format(sql, Code, WorkPoint); @@ -840,7 +929,13 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' "); } - + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sqlString.Append($@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.FromWarehouseCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "); + } + } sqlString.Append(@"group by a.TransferNO,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode, f.BatchCode,f.Version,f.Brand,f.cFree1,f.cFree2,f.cFree3,f.cFree4, @@ -887,6 +982,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; { sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' "; } + if (!string.IsNullOrWhiteSpace(queryParam["Container"].ToString()) && queryParam["Container"].ToString() == "2") + { + sql += $@" and (detail.LocationCode not in (SELECT F_Define2 FROM Sys_SRM_ItemsDetail + WHERE + F_Define3='HGAreaConfig' AND F_Define1=a.FromWarehouseCode AND F_Define4=a.WorkPoint) OR detail.LocationCode is null OR detail.LocationCode='') "; + } } sql += " ) as t where t.row=1"; sql = string.Format(sql, Code, WorkPoint); @@ -1494,9 +1595,9 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; from ICSWareHouseLotInfo d ,ICSInventoryLot m where d.LotNo=m.LotNo and d.WorkPoint=m.WorkPoint and d.WorkPoint='{WorkPoint}' AND d.Quantity>0 - AND SUBSTRING( SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)),0,CHARINDEX('-', SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)))) Not IN(SELECT F_Define2 FROM Sys_SRM_ItemsDetail - WHERE - F_Define3='HGAreaConfig' AND F_Define1=d.WarehouseCode AND F_Define4=d.WorkPoint)) d + --AND SUBSTRING( SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)),0,CHARINDEX('-', SUBSTRING(d.LocationCode, CHARINDEX('-',d.LocationCode)+1, LEN(d.LocationCode)))) Not IN(SELECT F_Define2 FROM Sys_SRM_ItemsDetail + --WHERE F_Define3='HGAreaConfig' AND F_Define1=d.WarehouseCode AND F_Define4=d.WorkPoint) + ) d on c.InvCode=d.INVCode AND c.WhCode=d.WarehouseCode and d.ExtensionID=c.ExtensionID LEFT JOIN (SELECT INVCode,WarehouseCode,SUM(Quantity) AS QTYTotal FROM ICSWareHouseLotInfo WHERE WorkPoint='{WorkPoint}' GROUP BY INVCode,WarehouseCode) f ON c.InvCode=f.INVCode AND c.WhCode=f.WarehouseCode order by c.Code,c.InvCode,d.MTIME "; diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml index fa95072..b7f21aa 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/PickMaterial/ICSMOPickMerge.cshtml @@ -2,6 +2,7 @@ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; } + -
+
拣料 @@ -742,17 +797,40 @@
+ + + + + +
+ +
+ +
- +
- + +
+ + + : + +
+
@@ -760,28 +838,52 @@
- +
- +
- : - + : +
- : - + : + +
+ +
+ + + : + +
+ +
+ + + : +
- + +
+ + + + + + +
+  是 +  否
@@ -790,7 +892,11 @@ + + @* + + *@