From a1c3a3d1b0b0b8c28a19e99177e4cee5a64949b7 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 25 二月 2025 11:20:17 +0800 Subject: [PATCH] 增加斯莫尔 性能检测散点图报表 --- WebAPI/Controllers/基础资料/基础资料/Xt_FastICSchemeController.cs | 181 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 159 insertions(+), 22 deletions(-) diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Xt_FastICSchemeController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Xt_FastICSchemeController.cs" index 140baf8..6badba2 100644 --- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Xt_FastICSchemeController.cs" +++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Xt_FastICSchemeController.cs" @@ -61,6 +61,67 @@ } } + /// <summary> + /// 鍙屽嚮杩斿洖閫夋嫨鐨勮繃婊ゆ柟妗堝垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_FastICScheme/Chooselist")] + [HttpGet] + public object Chooselist(string user, string HModuleName,Int64 HInterID,string Type) + { + try + { + List<object> columnNameList = new List<object>(); + string sql = ""; + + if (Type == "Default") + { + sql = string.Format(@"select * from h_v_Xt_FastICScheme_ChooseList where 鐢ㄦ埛缂栫爜='" + user + "' and 妯″潡鍚嶇О = '" + HModuleName + "' and 榛樿浣跨敤鏍囪 = '榛樿鏂规'"); + } + else + { + sql = string.Format(@"select * from h_v_Xt_FastICScheme_ChooseList where 鐢ㄦ埛缂栫爜='" + user + "' and 妯″潡鍚嶇О = '" + HModuleName + "' and hmainid = " + HInterID); + } + ds = oCN.RunProcReturn(sql, "h_v_Xt_FastICScheme_ChooseList"); + + if (ds.Tables[0].Rows.Count != 0 && ds != null) + { + //娣诲姞鍒楀悕 + 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 = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹紒"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #region 蹇�熻繃婊ゆ柟妗� /// <summary> /// 鏂板淇敼鍗曟嵁-淇濆瓨鎸夐挳 @@ -79,11 +140,12 @@ var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); - string msg2 = sArray[0].ToString();//琛ㄥご - string msg3 = sArray[1].ToString();//杩囨护鏉′欢id - string msg4 = sArray[2].ToString();//杩囨护鍊� - string msg5 = sArray[3].ToString();//鏍囩绫诲瀷 - string msg6 = sArray[4].ToString();//鐢ㄦ埛 + string msg2 = sArray[0].ToString();//琛ㄥご瀛楁淇℃伅 鎴� 鍗曟嵁鍐呯爜 + string HFilterIdLists = sArray[1].ToString();//杩囨护鏉′欢id + string HValue = sArray[2].ToString();//杩囨护鍊� + string HElement_type = sArray[3].ToString();//鏍囩绫诲瀷 + string user = sArray[4].ToString();//鐢ㄦ埛 + string OperationType = sArray[5].ToString();//鎿嶄綔绫诲瀷 DAL.ClsXt_FastICScheme_Ctl oBill = new DAL.ClsXt_FastICScheme_Ctl(); //鍙嶅簭鍒楀寲 @@ -92,7 +154,17 @@ List<Model.ClsXt_FastICSchemeMain_Model> lsmain = new List<Model.ClsXt_FastICSchemeMain_Model>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n - lsmain = oListModels.getObjectByJson_Xt_FastICSchemeMain(msg2); + + //褰撳墠鎿嶄綔绫诲瀷涓嶄负缂栬緫锛屽垯杩涜json鏁版嵁鐨勮В鏋� + if (Convert.ToInt32(OperationType) != 3) + { + lsmain = oListModels.getObjectByJson_Xt_FastICSchemeMain(msg2); + } + //褰撳墠鎿嶄綔绫诲瀷涓虹紪杈戯紝msg2 涓哄崟鎹唴鐮� + else + { + oBill.omodel.HInterID = Convert.ToInt32(msg2); + } foreach (Model.ClsXt_FastICSchemeMain_Model oItem in lsmain) { @@ -100,29 +172,16 @@ oBill.omodel = oItem; } - ////琛ㄤ綋鏁版嵁 - ////鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� - //msg3 = msg3.Substring(1, msg3.Length - 2); - //msg3 = msg3.Replace("\\", ""); - //msg3 = msg3.Replace("\n", ""); //\n - ////msg2 = msg2.Replace("'", "鈥�"); - //List<Model.ClsXt_FastICSchemeSub_Model> ls = new List<Model.ClsXt_FastICSchemeSub_Model>(); - //ls = oListModels.getObjectByJson_Gy_ICMOReportBillSub(msg3); - //int i = 0; - - - - //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; - if (1 == 1) + if (Convert.ToInt32(OperationType) == 1) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); - bResult = oBill.AddBill(msg3, msg4, msg5, ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(HFilterIdLists, HValue, HElement_type, user, ref DBUtility.ClsPub.sExeReturnInfo); } else { - bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.ModifyBill(Convert.ToInt32(msg2), HFilterIdLists, HValue, HElement_type, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { @@ -153,5 +212,83 @@ } } #endregion + + #region 璁剧疆涓洪粯璁ゆ柟妗� + /// <summary> + /// 璁剧疆涓洪粯璁ゆ柟妗� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_FastICScheme/SetDefaultScheme")] + [HttpGet] + public object SetDefaultScheme(Int64 HInterID,string user,string HModuleName) + { + try + { + oCN.BeginTran(); + + oCN.RunProc("update Xt_FastICSchemeMain set HUseingFlag = 0 where HUserCode ='" + user + "' and HBillName = '" + HModuleName + "'"); + + oCN.RunProc("update Xt_FastICSchemeMain set HUseingFlag = 1 where HInterID = " + HInterID); + + oCN.Commit(); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "璁剧疆鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 杩囨护鏂规鍒犻櫎鍔熻兘 + [Route("Xt_FastICScheme/DeltetXt_FastICScheme")] + [HttpGet] + public object DeltetXt_FastICScheme(string HInterID, string user) + { + try + { + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + + oCN.RunProc("delete from xt_FastICSchemeMain where HInterID in (" + HInterID + ")"); + oCN.RunProc("delete from xt_FastICSchemeSub where HInterID in (" + HInterID + ")"); + + oCN.Commit();//鎻愪氦浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } -- Gitblit v1.9.1