From 4e9644e3dbfa55525acd20734f0fa0ea3fa81b3b Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期四, 12 十二月 2024 11:14:23 +0800 Subject: [PATCH] 器具处理出库单、器具报废入库单、器具直接调拨单,分页功能完善 --- WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs index de79d99..4c57f43 100644 --- a/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs +++ b/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs @@ -5,6 +5,8 @@ using System.Data; using System.Web.Http; using WebAPI.Models; +using SyntacticSugar.constant; +using Newtonsoft.Json; namespace WebAPI.Controllers { /** @@ -134,6 +136,61 @@ #endregion + #region 鍣ㄥ叿鐩存帴璋冩嫧鍗曞垎椤靛垪琛� + [Route("Sc_MouldProdMoveBill/page")] + [HttpGet] + public object Sc_MouldProdMoveBillPage(string sWhere, string user, int page, int size) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + //鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdMoveBillList", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + sWhere = sWhere.Replace("'", "''"); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdMoveBillList " + page + "," + size + ",''", "h_p_Sc_MouldProdMoveBillList"); + } + else + { + ds = oCn.RunProcReturn("exec h_p_Sc_MouldProdMoveBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldProdMoveBillList"); + } + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = CodeConstant.SUCCEED; + objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region[鍣ㄥ叿鐩存帴璋冩嫧鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁] [Route("Sc_MouldProdMoveBill/Sc_MouldProdMoveBillListCheckDetai")] [HttpGet] -- Gitblit v1.9.1