From 1882724680a814ac569318cd4998c3d4ffcc4560 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 25 十月 2024 09:54:53 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 67 +++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs index 414d5cd..18b2239 100644 --- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs @@ -102,6 +102,73 @@ } #endregion + #region 瀹㈡埛鍒嗛〉鍒楄〃 + [Route("Gy_Customer/page")] + [HttpGet] + public json Gy_CustomerPage(string sWhere, string user, int page, int size, string Organization) + { + DataSet ds; + json res = new json(); + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("Crm_CustomerFileList", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + //瀹㈡埛鍒跺畾 + string sErr = ""; + if (oSystemParameter.ShowBill(ref sErr)) + { + if (oSystemParameter.omodel.WMS_CampanyName != "涔斾竴") + { + sWhere += ("and 缁勭粐鍚嶇О = '" + Organization + "'"); + } + } + + + sWhere = sWhere.Replace("'", "''"); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_Gy_CustomerList " + page + "," + size + ",''", "h_p_Gy_CustomerList"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_Gy_CustomerList " + page + "," + size + ",'" + sWhere + "'", "h_p_Gy_CustomerList"); + } + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + res.code = CodeConstant.SUCCEED; + res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + res.Message = "Sucess锛�"; + res.list = columnNameList; + res.data = ds.Tables[0]; + return res; + } + catch (Exception e) + { + res.code = CodeConstant.FAIL; + res.count = CountConstant.FAIL; + res.Message = "Exception锛�" + e.ToString(); + res.data = null; + return objJsonResult; + } + } + #endregion + + #region 瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛] 鏌ヨ /// <summary> /// 杩斿洖瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛]鍒楄〃 -- Gitblit v1.9.1