From 7fcf7cc09a728223220a757614d8421115e19895 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 26 三月 2024 17:11:50 +0800 Subject: [PATCH] 异常反馈接收单,异常反馈类型 查询,编辑,审核,关闭,作废 --- WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 147 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 136 insertions(+), 11 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs index 2a9d283..0d13801 100644 --- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs @@ -93,6 +93,49 @@ } } + #region 瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛] 鏌ヨ + /// <summary> + /// 杩斿洖瀹㈡埛瀛愯〃[鍏宠仈鐢ㄦ埛]鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/RelationUserlist")] + [HttpGet] + public object RelationUserlist(Int64 HCusID) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql = "select * from h_v_Gy_Customer_RelationUsers_Query where HCusID = " + HCusID + " order by 鐢ㄦ埛缂栫爜 asc"; + ds = oCN.RunProcReturn(sql, "h_v_Gy_Customer_RelationUsers_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 = 1; + objJsonResult.Message = "Sucess锛�"; + 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; + } + } + #endregion + /// <summary> /// 瀹㈡埛鍒楄〃淇敼鎸夐挳鏂规硶 ///鍙傛暟锛歴tring sql銆� @@ -130,6 +173,45 @@ return objJsonResult; } } + + + #region 鑾峰彇褰撳墠鏈�澶х殑瀹㈡埛浠g爜 + [Route("Gy_Customer/getMaxCusNumber")] + [HttpGet] + public object getMaxCusNumber() + { + try + { + string sql = "select top(1) * from Gy_Customer order by HNumber desc"; + ds = oCN.RunProcReturn(sql, "Gy_Customer"); + + if (ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "灏氭湭瀛樺湪瀹㈡埛锛岃鑷富缁存姢瀹㈡埛浠g爜!"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion /// <summary> /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID @@ -313,6 +395,22 @@ ", " + HCusTypeID + ","+ HCreateOrgID + ","+ HUseOrgID + ")"); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + + //淇濆瓨鍚庢帶鍒� + string sql = "select * from Gy_Customer where HNumber = '" + HNumber + "' and HName = '" + HName + "' and HUSEORGID = " + HUseOrgID; + ds = oCN.RunProcReturn(sql, "Gy_Customer"); + HItemID = Int64.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString()); + ds = oCN.RunProcReturn("exec h_p_Gy_Customer_AfterSaveCtrl " + HItemID, "h_p_Gy_Customer_AfterSaveCtrl"); + if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); + objJsonResult.data = null; + return objJsonResult; + } + oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -573,6 +671,21 @@ //灏嗕笂绾� 涓洪潪鏈骇 oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); // + + //淇濆瓨鍚庢帶鍒� + ds = oCN.RunProcReturn("exec h_p_Gy_Customer_AfterSaveCtrl " + HItemID, "h_p_Gy_Customer_AfterSaveCtrl"); + if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); + objJsonResult.data = null; + return objJsonResult; + } + + + oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -634,25 +747,37 @@ return objJsonResult; } // - if (oDept.DeleteByID(HItemID)) + try { - //鍐欏叆鏃ュ織 - ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); - //鏇存柊涓婄骇涓� 鏈骇 - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "鍒犻櫎鎴愬姛"; - objJsonResult.data = null; - return objJsonResult; + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } } - else + catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.Message = "鍒犻櫎澶辫触锛岃瀹㈡埛瀛樺湪鍏宠仈鐨勯攢鍞鍗曘�侀攢鍞嚭搴撳崟銆佺敓浜ц鍗曪紝鎴栫▼搴忛敊璇��"; objJsonResult.data = null; return objJsonResult; } + } //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); -- Gitblit v1.9.1