From f4b34807a94582197610c86a801e751fb075bcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=20=E6=9C=B1?= <501697962@qq.com> Date: Tue, 22 Mar 2022 19:55:46 +0800 Subject: [PATCH] 1 --- NX.ERP.U8/Pmc/WarehouseQuery.cs | 31 +++++++++++++++++++ .../Store/OtherStoreOutController.cs | 12 +++++-- NX.ERP.WebAPi/Web.config | 6 ++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/NX.ERP.U8/Pmc/WarehouseQuery.cs b/NX.ERP.U8/Pmc/WarehouseQuery.cs index 37dbf28..5f881fa 100644 --- a/NX.ERP.U8/Pmc/WarehouseQuery.cs +++ b/NX.ERP.U8/Pmc/WarehouseQuery.cs @@ -104,6 +104,37 @@ select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,A.c } } + public IEnumerable GetList(Model.Request.OtherStoreInOut storeIn) + { + + string sql = @" select a.cInvCode,a.iQuantity,a.cPosition,b.cCode From rdrecords11 a left join rdrecord11 b on a.id=b.ID + where 1=1 +"; + + List where = new List(); + + + if (!string.IsNullOrEmpty(storeIn.Code)) + { + where.Add(" b.cCode = @cCode"); + } + + var aa = string.Join(" and ", where.ToArray()); + + if (!string.IsNullOrEmpty(aa)) + { + sql += " and " + aa; + } + + + + using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) + { + return conn.Query(sql, new { cCode = storeIn.Code }); + } + + } + } } diff --git a/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs b/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs index d1cf7a1..c1e690f 100644 --- a/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs +++ b/NX.ERP.WebAPi/Controllers/Store/OtherStoreOutController.cs @@ -28,8 +28,16 @@ namespace NX.ERP.WebAPi.Controllers.Store return dal.UpdateVocher(storeIn); } - - + + [Route("api/OtherOut/GetList")] + [HttpPost] + public IEnumerable GetList(Model.Request.OtherStoreInOut storeIn) + { + var dal = new NX.ERP.U8.Finance.WarehouseQuery(); ; + return dal.GetList(storeIn); + } + + } diff --git a/NX.ERP.WebAPi/Web.config b/NX.ERP.WebAPi/Web.config index 6acb044..89eb379 100644 --- a/NX.ERP.WebAPi/Web.config +++ b/NX.ERP.WebAPi/Web.config @@ -6,9 +6,9 @@ - - - + + +