From 4550c925da14b2ce8bf257fb25c7c0e7a1984d67 Mon Sep 17 00:00:00 2001 From: gongxh Date: Thu, 20 May 2021 10:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.Model/Response/Store/Stock.cs | 2 +- NX.ERP.U8/Store/StockDAL.cs | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/NX.ERP.Model/Response/Store/Stock.cs b/NX.ERP.Model/Response/Store/Stock.cs index 602d539..04ca200 100644 --- a/NX.ERP.Model/Response/Store/Stock.cs +++ b/NX.ERP.Model/Response/Store/Stock.cs @@ -14,7 +14,7 @@ namespace NX.ERP.Model.Response.Store private string _Qty; public string MaterialCode { get => materialCode; set => materialCode = value; } - public string BinName { get => binName; set => binName = value; } + public string BinCode { get => binName; set => binName = value; } public string Qty { get => _Qty; set => _Qty = value; } } diff --git a/NX.ERP.U8/Store/StockDAL.cs b/NX.ERP.U8/Store/StockDAL.cs index 729dbaa..161beff 100644 --- a/NX.ERP.U8/Store/StockDAL.cs +++ b/NX.ERP.U8/Store/StockDAL.cs @@ -18,12 +18,7 @@ namespace NX.ERP.U8.Store { using (var conn = U8LoginContext.Instance.Connection) { - var sql = @"select a.cInvCode as MaterialCode ,c.cPosName as BinName,(isnull(a.iQuantity,0)-isnull(b.iQuantity,0)) as Qty from ( - select cInvCode,cPosCode , sum(iQuantity)as iQuantity from InvPosition where bRdFlag=1 group by cInvCode,cPosCode - )a full join ( - select cInvCode,cPosCode , sum(iQuantity)as iQuantity from InvPosition where bRdFlag=0 group by cInvCode,cPosCode) - b on isnull(a.cInvCode,'')=isnull(b.cInvCode,'') and a.cPosCode=b.cPosCode - left join Position c on a.cPosCode=c.cPosCode where a.iQuantity<>b.iQuantity"; + var sql = @"select cInvCode as MaterialCode ,cPosCode as BinCode,iQuantity as Qty from InvPositionSum where ISNULL(iQuantity,0)<>0"; if (!string.IsNullOrEmpty(strwhere)) { sql += $" and {strwhere}"; @@ -38,7 +33,7 @@ namespace NX.ERP.U8.Store /// public IEnumerable GetListByMaterialCode(string Code) { - return this.GetList(" a.cInvCode like @Code", new { Code = $"%{Code}%" }); + return this.GetList(" cInvCode like @Code", new { Code = $"%{Code}%" }); }