From df511ae796453cad9be49372e7a154735ca85c26 Mon Sep 17 00:00:00 2001 From: chenhaozhe <cgz@hz-kingdee.com> Date: 星期五, 30 五月 2025 20:56:48 +0800 Subject: [PATCH] 完成点检记录单 器具故障登记单 器具维修派工单 的修改与测试 --- WebAPI/Controllers/LMESController.cs | 143 ++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 132 insertions(+), 11 deletions(-) diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 1a21da8..1187096 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -192,7 +192,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - ds = oCN.RunProcReturn("select top 1000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc ", "h_v_Sc_ProcessExchangeBillList_Query"); + ds = oCN.RunProcReturn("select top 3000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc ", "h_v_Sc_ProcessExchangeBillList_Query"); //娣诲姞鍒楀悕 @@ -285,6 +285,98 @@ else { ds = oCN.RunProcReturn("exec h_p_Sc_ProcessExchangeBillList_Query " + page + "," + size + ",'" + Organization + "','" + 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> + /// 杩斿洖宸ュ簭娴佽浆鍗$淮鎶ゅ垪琛ㄤ富琛� + ///鍙傛暟锛歴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"); } //娣诲姞鍒楀悕 @@ -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; } @@ -1688,8 +1809,8 @@ - LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ヨ壓璺嚎鍗曟嵁:" + ds.Tables[0].Rows[0]["HBillNo"].ToString()); - oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎宸ヨ壓璺嚎鍗曟嵁锛�" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ヨ壓璺嚎鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎宸ヨ壓璺嚎鍗曟嵁锛�" + HBillNo + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; @@ -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();//鎻愪氦浜嬪姟 @@ -3705,10 +3826,10 @@ return objJsonResult; } } - + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); //瀹℃牳鍓嶆帶鍒�========================================= - string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'"; + string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_BeforeCheckCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { @@ -3736,7 +3857,7 @@ //瀹℃牳鍚庢帶鍒�========================================= - string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'"; + string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_AfterCheckCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { @@ -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