From 60c33d122fed78adebb7cb9e85ab8dff3d7aa72a Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期四, 12 六月 2025 16:26:25 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/LMESController.cs | 131 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 126 insertions(+), 5 deletions(-) diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 1f9fff4..1187096 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -313,6 +313,98 @@ } #endregion + #region 宸ュ簭娴佽浆鍗$淮鎶�-鏌ヨ-鍒嗛〉 + /// <summary> + /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ富琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("LEMS/Sc_ProcessExchangeBillList_QueryCheckRecord_byPage")] + [HttpGet] + public object Sc_ProcessExchangeBillList_QueryCheckRecord_byPage(string sWhere, string user, string Organization, int page, int size, string HBillSubType) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + if (HBillSubType == "SUB") + { + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎸囧紩鍗℃棤鏌ヨ鏉冮檺!"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娴佽浆鍗℃棤鏌ヨ鏉冮檺!"; + objJsonResult.data = null; + return objJsonResult; + } + } + + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭娲惧伐鍗曞垪琛�"); + + sWhere += sql_splice; + } + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + sWhere = sWhere.Replace("'", "''"); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_ProcessExchangeBillCheckRecordListPage " + page + "," + size + "," + "''", "h_p_Sc_ProcessExchangeBillList_Query"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_ProcessExchangeBillCheckRecordListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_ProcessExchangeBillList_Query"); + } + + //娣诲姞鍒楀悕 + 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 = "1"; + 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 = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "寮傚父锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 宸ュ簭娴佽浆鍗� 涓嬫煡 /// <summary> /// </summary> @@ -957,7 +1049,36 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.Message = "[0000-1-045]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ粠琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("LEMS/MES_Sc_ProcessExchangeBillQueryCheckRecordSub_Json")] + [HttpGet] + public object MES_Sc_ProcessExchangeBillQueryCheckRecordSub_Json(string sWhere, int selected) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = "exec h_p_ProcessExchangeBillCheckRecordList_GetSubBillList " + + "@sWhere = N'" + sWhere + "'" + + ", @selected = N'" + selected + "'"; + ds = oCN.RunProcReturn(sql, "h_p_ProcessExchangeBillCheckRecordList_GetSubBillList"); + return GetObjectJson(ds); + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-045]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -2671,7 +2792,7 @@ objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; + objJsonResult.Message = "[0000-1-037]Sucess锛�"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; @@ -2681,7 +2802,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.Message = "[0000-1-010]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -3601,7 +3722,7 @@ } //鍒锋柊榛樿宸ヨ壓璺嚎 - oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID+",'" + user + "'"); + oCN.RunProc("exec h_p_Gy_RoutingBillSetDefault " + HInterID+",'" + user + "'"); oCN.Commit();//鎻愪氦浜嬪姟 @@ -4061,7 +4182,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.Message = "[0000-1-010]Exception锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } -- Gitblit v1.9.1