From 772bea0cc9ec3905f9e61658585f3b7f3b257d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Mon, 16 Aug 2021 15:24:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=8E=B0=E5=AD=98=E6=97=A0=E5=BA=9F?= =?UTF-8?q?=E5=93=81=20=E5=8E=BB=20=E4=B8=8D=E8=89=AF=E5=93=81=E4=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.U8/Pmc/PmcQuery.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/NX.ERP.U8/Pmc/PmcQuery.cs b/NX.ERP.U8/Pmc/PmcQuery.cs index fd549bc..c8c5f6f 100644 --- a/NX.ERP.U8/Pmc/PmcQuery.cs +++ b/NX.ERP.U8/Pmc/PmcQuery.cs @@ -51,7 +51,7 @@ namespace NX.ERP.U8.Pmc GROUP BY cInvCode) cs ON c.cInvCode = cs.cInvCode LEFT JOIN (SELECT cinvcode, SUM(iquantity) qty - FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') + FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') and cWhCode not in (4,5) GROUP BY cInvCode) ds ON c.cInvCode = ds.cInvCode LEFT JOIN @@ -218,7 +218,7 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,md.Rem GROUP BY cInvCode) cs ON ma.InvCode = cs.cInvCode LEFT JOIN (SELECT cinvcode, SUM(iquantity) qty - FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') + FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') and cWhCode not in (4,5) GROUP BY cInvCode) ds ON ma.InvCode = ds.cInvCode INNER JOIN Inventory p WITH (NOLOCK) ON md.InvCode = p.cInvCode INNER JOIN @@ -254,7 +254,12 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,md.Rem pu_appbody ommds WITH (nolock) ON omm.id = ommds.id LEFT JOIN (SELECT iAppIds, sum(iquantity) AS qty FROM PO_Podetails WITH (nolock) - GROUP BY iAppIds) rds ON ommds.autoid = rds.iAppIds + GROUP BY iAppIds + union all + SELECT cupsoids as iAppIds , sum(iquantity) AS qty + FROM OM_MODetails WITH (nolock) + GROUP BY cupsoids + ) rds ON ommds.autoid = rds.iAppIds WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM GROUP BY cInvCode) pu_App ON MA.INVCODE = pu_App.CINVCODE LEFT JOIN @@ -342,7 +347,7 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate,md.Rema GROUP BY cInvCode) cs ON ma.InvCode = cs.cInvCode LEFT JOIN (SELECT cinvcode, SUM(iquantity) qty - FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') + FROM InvPositionSum WITH (NOLOCK) where cPosCode not in ('00701','00801','09001') and cWhCode not in (4,5) GROUP BY cInvCode) ds ON ma.InvCode = ds.cInvCode INNER JOIN Inventory p WITH (NOLOCK) ON md.InvCode = p.cInvCode INNER JOIN @@ -378,7 +383,12 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate,md.Rema pu_appbody ommds WITH (nolock) ON omm.id = ommds.id LEFT JOIN (SELECT iAppIds, sum(iquantity) AS qty FROM PO_Podetails WITH (nolock) - GROUP BY iAppIds) rds ON ommds.autoid = rds.iAppIds + GROUP BY iAppIds + union all + SELECT cupsoids as iAppIds , sum(iquantity) AS qty + FROM OM_MODetails WITH (nolock) + GROUP BY cupsoids + ) rds ON ommds.autoid = rds.iAppIds WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND ommds.fquantity - ISNULL(rds.qty, 0) > 0) OM GROUP BY cInvCode) pu_App ON MA.INVCODE = pu_App.CINVCODE LEFT JOIN @@ -688,7 +698,7 @@ update a set a.dqty=a.dqty+isnull(ds.qty,0),a.cqty=a.cqty+isnull(cs.qty,0) fro GROUP BY cInvCode) cs ON a.cInvCode = cs.cInvCode LEFT JOIN (SELECT cinvcode, SUM(iquantity) qty - FROM InvPositionSum WITH (nolock) where cPosCode not in ('00701','00801','09001') + FROM InvPositionSum WITH (nolock) where cPosCode not in ('00701','00801','09001') and cWhCode not in (4,5) GROUP BY cInvCode) ds ON a.cInvCode = ds.cInvCode update a set a.momqty=a.momqty+isnull(MX.MQTY,0) From 1282aad61a967aab444c7831510e5f43f9ae2f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Thu, 26 Aug 2021 10:21:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B4=A7=E4=BD=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.Model/Request/Stock.cs | 2 ++ NX.ERP.U8/Store/StockDAL.cs | 8 +++++++- NX.ERP.WebAPi/Web.config | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NX.ERP.Model/Request/Stock.cs b/NX.ERP.Model/Request/Stock.cs index 339eb25..3c1771d 100644 --- a/NX.ERP.Model/Request/Stock.cs +++ b/NX.ERP.Model/Request/Stock.cs @@ -16,5 +16,7 @@ namespace NX.ERP.Model.Request public string MaterialName { get => _name; set => _name = value; } + + public IEnumerable BinCodes { get; set; } } } diff --git a/NX.ERP.U8/Store/StockDAL.cs b/NX.ERP.U8/Store/StockDAL.cs index 27b6c0c..ef811d1 100644 --- a/NX.ERP.U8/Store/StockDAL.cs +++ b/NX.ERP.U8/Store/StockDAL.cs @@ -57,11 +57,17 @@ from InvPositionSum as a left join Inventory as b on a.cInvCode=b.cInvCode where where.Add(" cInvCode in @MaterialCodes "); } + if (stock.BinCodes != null) + { + where.Add(" cPosCode in @BinCodes "); + } + return this.GetList(string.Join(" and ", where.ToArray()), new { MaterialCode = stock.MaterialCode, MaterialName = $"%{stock.MaterialName}%", - stock.MaterialCodes + stock.MaterialCodes, + stock.BinCodes }); ; diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index cede30a..3c2f47f 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -6,8 +6,8 @@ - - + + From fed3719b2be57227ce07b687223e3963abe04f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Thu, 26 Aug 2021 17:31:16 +0800 Subject: [PATCH 3/3] 1 --- NX.ERP.U8/Store/StockDAL.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NX.ERP.U8/Store/StockDAL.cs b/NX.ERP.U8/Store/StockDAL.cs index ef811d1..af6017d 100644 --- a/NX.ERP.U8/Store/StockDAL.cs +++ b/NX.ERP.U8/Store/StockDAL.cs @@ -54,7 +54,7 @@ from InvPositionSum as a left join Inventory as b on a.cInvCode=b.cInvCode where if (stock.MaterialCodes != null) { - where.Add(" cInvCode in @MaterialCodes "); + where.Add(" a.cInvCode in @MaterialCodes "); } if (stock.BinCodes != null)