From e2707a20e6654bce07f239324a5647b86ab1a33d Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 12 一月 2024 13:13:33 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/基础资料/基础资料/Xt_FastICSchemeController.cs | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 111 insertions(+), 3 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..b564ba1 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> /// 鏂板淇敼鍗曟嵁-淇濆瓨鎸夐挳 @@ -84,6 +145,7 @@ string msg4 = sArray[2].ToString();//杩囨护鍊� string msg5 = sArray[3].ToString();//鏍囩绫诲瀷 string msg6 = sArray[4].ToString();//鐢ㄦ埛 + string OperationType = sArray[5].ToString();//鎿嶄綔绫诲瀷 DAL.ClsXt_FastICScheme_Ctl oBill = new DAL.ClsXt_FastICScheme_Ctl(); //鍙嶅簭鍒楀寲 @@ -92,7 +154,14 @@ 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); + if (Convert.ToInt32(OperationType) != 3) + { + lsmain = oListModels.getObjectByJson_Xt_FastICSchemeMain(msg2); + } + else + { + oBill.omodel.HInterID = Convert.ToInt32(msg2); + } foreach (Model.ClsXt_FastICSchemeMain_Model oItem in lsmain) { @@ -115,14 +184,14 @@ //淇濆瓨 //淇濆瓨瀹屾瘯鍚庡鐞� 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); } else { - bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.ModifyBill(Convert.ToInt32(msg2), msg3, msg4, msg5, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { @@ -153,5 +222,44 @@ } } #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