From 51aa625a0301d6be922d7e878aa5def8fd0ebb8f Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期一, 28 四月 2025 13:46:21 +0800 Subject: [PATCH] 添加报工平台新接口,工艺路线启用默认设置新存储过程 --- WebAPI/Controllers/WebAPIController.cs | 1635 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 1,470 insertions(+), 165 deletions(-) diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs index 66ae0c8..edc4139 100644 --- a/WebAPI/Controllers/WebAPIController.cs +++ b/WebAPI/Controllers/WebAPIController.cs @@ -351,7 +351,7 @@ { objjson.code = "0"; objjson.count = 0; - objjson.Message = "瀵嗙爜閿欒锛�"; + objjson.Message = "[0000-1-072]瀵嗙爜閿欒锛�"; objjson.data = null; return objjson; } @@ -379,7 +379,7 @@ objjson.code = "0"; objjson.count = 1; - objjson.Message = "鐧诲綍鎴愬姛锛�"; + objjson.Message = "[0000-1-073]鐧诲綍鎴愬姛锛�"; objjson.data = ds.Tables[0]; return objjson; @@ -389,7 +389,7 @@ objjson.code = "0"; objjson.count = 0; - objjson.Message = "鐧诲綍寮傚父锛�" + e.Message; + objjson.Message = "[0000-1-074]鐧诲綍寮傚父锛�" + e.Message; objjson.data = null; return objjson; ; } @@ -1207,74 +1207,7 @@ return objjson; } } - - - ///// <summary> - ///// 鑾峰彇浠撲綅鍒楄〃 - ///// </summary> - ///// <returns></returns> - //[Route("Web/GetStockPlaceList_Json_NEW")] - //[HttpGet] - //public object GetStockPlaceList_Json_NEW(string StockPlace, Int64 HWhID, Int64 HOrgID) - //{ - // WebS.WebService1 oWeb = new WebS.WebService1(); - // sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + HOrgID + ""; - // //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); - // if (HWhID == 0) - // { - // if (StockPlace != "") - // { - // sWhere = " Where HStopFlag=0 and HUSEORGID = " + HOrgID + " and ( HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%' ) "; - // } - // else - // { - // sWhere = " Where HStopFlag=0 "; - // } - // } - // else - // { - // if (StockPlace != "") - // { - // sWhere = " Where HStopFlag=0 and HWHID=" + HWhID.ToString() + " and HWHID=" + HWhID.ToString() + " and ( HNumber like '%" + StockPlace + "%' or HName like '%" + StockPlace + "%' ) "; - // } - // else - // { - // sWhere = " Where HStopFlag=0 and HWHID=" + HWhID.ToString(); - // } - // } - // try - // { - // //ds = webserver.GetStockPlaceList(sWhere, ref DBUtility.ClsPub.sErrInfo); - // ds = oWeb.GetStockPlaceList(sWhere, ref DBUtility.ClsPub.sErrInfo); - // if (ds == null || ds.Tables[0].Rows.Count <= 0) - // { - // objjson.code = "0"; - // objjson.count = 0; - // objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo; - // objjson.data = null; - // return objjson; - // } - // else - // { - // objjson.code = "0"; - // objjson.count = 1; - // objjson.Message = "鑾峰彇鎴愬姛!"; - // objjson.data = ds.Tables[0]; - // return objjson; - // } - // } - // catch (Exception ex) - // { - - // objjson.code = "0"; - // objjson.count = 0; - // objjson.Message = "鑾峰彇澶辫触" + ex.ToString(); - // objjson.data = null; - // return objjson; - // } - //} - - + /// <summary> /// 鑾峰彇浠撲綅鍒楄〃 /// </summary> @@ -2284,6 +2217,103 @@ return objjson; } } + + /// <summary> + /// 鑾峰彇鐜妫�楠屾柟妗堝垪琛� + /// <summary> + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Web/Gy_EnvironmentTestSchemeBillList_Json")] + [HttpGet] + public object Gy_EnvironmentTestSchemeBillList_Json(string sWhere) + { + DataSet ds; + + if (sWhere != "") + { + sWhere = " and ( 鐢熶骇閮ㄩ棬 like '%" + sWhere + "%' or 宸ヤ綔涓績 like '%" + sWhere + "%' or 宸ュ簭鍚嶇О like '%" + sWhere + "%' or 妫�娴嬮」鐩� like '%" + sWhere + "%' ) "; + } + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn("select * from h_v_Gy_EnvironmentTestSchemeBillList_PDA where 瀹℃牳浜� !='' and 鍏抽棴浜�='' " + sWhere + " Order by 鍗曟嵁鍙� ", "h_v_Gy_EnvironmentTestSchemeBillList_PDA"); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触"; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛!"; + objjson.data = ds.Tables[0]; + return objjson; + } + } + catch (Exception e) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + e.ToString(); + objjson.data = null; + return objjson; + } + } + + /// <summary> + /// 鑾峰彇鐜妫�娴嬮」鐩垪琛� + /// <summary> + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Web/Gy_EnvironmentTestItemList_Json")] + [HttpGet] + public object Gy_EnvironmentTestItemList_Json(string sWhere) + { + DataSet ds; + + if (sWhere != "") + { + sWhere = " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) "; + } + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ds = oCN.RunProcReturn("select HItemID ,HName 鐜妫�娴嬮」鐩�,HNumber 鐜妫�娴嬩唬鐮� from Gy_EnvironmentTestItem where ISNULL(HCheckTime,'')!='' and HStopflag =0 " + sWhere + " Order by HNumber ", "Gy_EnvironmentTestItem"); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触"; + objjson.data = null; + return objjson; + } + else + { + objjson.code = "0"; + objjson.count = 1; + objjson.Message = "鑾峰彇鎴愬姛!"; + objjson.data = ds.Tables[0]; + return objjson; + } + } + catch (Exception e) + { + + objjson.code = "0"; + objjson.count = 0; + objjson.Message = "鑾峰彇澶辫触" + e.ToString(); + objjson.data = null; + return objjson; + } + } + /// <summary> /// 鑾峰彇閾惰鍒楄〃 @@ -4546,7 +4576,6 @@ #endregion #endregion - #region 涓嶈壇鍚庢灉 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 /// <summary> /// 淇濆瓨涓嶈壇鍚庢灉 @@ -4716,8 +4745,7 @@ //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; if (oBill.oModel.HItemID == 0) - { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + { bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo); } else @@ -4773,7 +4801,6 @@ public object DeltetGy_BadResult(string HItemID, string user) { DataSet ds; - //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //鍒犻櫎鏉冮檺 @@ -5157,7 +5184,6 @@ #endregion #endregion - #region 妫�娴嬪�� 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 /// <summary> @@ -7085,7 +7111,6 @@ } #endregion - #region 宀椾綅鎶�鑳� 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 /// <summary> /// 淇濆瓨宀椾綅鎶�鑳� @@ -7412,7 +7437,6 @@ } } #endregion - #region 宀椾綅鎶�鑳� 鏂囦欢瀵煎叆淇濆瓨 #region 宀椾綅鎶�鑳� 鏂囦欢涓婁紶 @@ -11882,8 +11906,7 @@ //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; if (oBill.oModel.HItemID == 0) - { - // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + { bResult = oBill.AddNew(); } else @@ -11895,7 +11918,6 @@ objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); objJsonResult.data = 1; return objJsonResult; } @@ -11939,7 +11961,6 @@ public object DeltetGy_ProjectMoney(string HItemID, string user) { DataSet ds; - //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //鍒犻櫎鏉冮檺 @@ -11993,7 +12014,412 @@ } + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_ProjectMoney_BeforeDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_ProjectMoney_BeforeDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + oCN.RunProc("delete Gy_ProjectMoney where HItemID=" + HItemID); + + + //鍒犻櫎鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_ProjectMoney_AfterDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_ProjectMoney_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜锛氬垹闄ゅ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + 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 + + #region 椤圭洰璐圭敤鍒嗙被 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 + /// <summary> + /// 椤圭洰璐圭敤鍒嗙被 淇濆瓨 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveGy_ProjectMoneyClassList")] + [HttpPost] + public object SaveGy_ProjectMoneyClassList([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg2 = sArray[1].ToString(); + + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_ProjectMoneyClass_Edit", 1, false, msg2)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + //鑾峰彇鏈�澶D鍊艰祴鍊� + DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_ProjectMoneyClass ", "Gy_ProjectMoneyClass"); + if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) + { + //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] + var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); + maxid += 1; + HItemID = maxid; + } + ListModels oListModels = new ListModels(); + try + { + + WebAPI.DLL.ClsGy_ProjectMoneyClass_Ctl oBill = new WebAPI.DLL.ClsGy_ProjectMoneyClass_Ctl(); + List<Model.ClsGy_ProjectMoneyClass_Model> lsmain = new List<Model.ClsGy_ProjectMoneyClass_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); + lsmain = oListModels.getObjectByJson_Gy_ProjectMoneyClass(msg1); + foreach (Model.ClsGy_ProjectMoneyClass_Model oItem in lsmain) + { + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (oItem.HName.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� + + ds = oCN.RunProcReturn("select * from Gy_ProjectMoneyClass where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_ProjectMoneyClass"); + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鏂板鏃跺垽鏂� + if (oItem.HItemID == 0) + { + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + else//缂栬緫鏃跺垽鏂� + { + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + //寰楀埌鐭唬鐮� + string sShortNumber; + sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); + if (sShortNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItem.HShortNumber = sShortNumber;//鐭唬鐮� + oItem.HEndFlag = true;//鏈骇鏍囧織 + DataSet ds2 = oCN.RunProcReturn("select HLevel from Gy_MaterType where HItemID =" + oItem.HParentID, "Gy_MaterType");//鎼滅储鐖剁被绛夌骇 + if (ds2.Tables[0].Rows.Count > 0) + { + oItem.HLevel = (int)ds2.Tables[0].Rows[0]["HLevel"] + 1; + } + else + { + oItem.HLevel = 1; + } + oItem.HMakeEmp = msg2; //鍒涘缓浜� + + oBill.oModel = oItem; + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.oModel.HItemID == 0) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 椤圭洰璐圭敤鍒嗙被 鑾峰彇淇℃伅 + /// </summary> + /// <returns></returns> + [Route("GetGy_ProjectMoneyClassDetail")] + [HttpGet] + public ApiResult<DataSet> GetGy_ProjectMoneyClassDetail(string HID) + { + var model = LuBaoSevice.GetGy_ProjectMoneyClassDetail(HID); + return model; + } + + /// <summary> + /// 椤圭洰璐圭敤鍒嗙被 鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetGy_ProjectMoneyClass")] + [HttpGet] + public object DeltetGy_ProjectMoneyClass(string HItemID, string user) + { + DataSet ds; + try + { + //鍒犻櫎鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_ProjectMoneyClass_Drop", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HItemID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + + ds = oCN.RunProcReturn("select * from Gy_ProjectMoneyClass where HItemID=" + HItemID, "Gy_ProjectMoneyClass"); + if (ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_ProjectMoneyClass_BeforeDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_ProjectMoneyClass_BeforeDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + + oCN.RunProc("delete Gy_ProjectMoneyClass where HItemID=" + HItemID); + + //鍒犻櫎鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_ProjectMoneyClass_AfterDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_ProjectMoneyClass_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜锛氬垹闄ゅ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; @@ -16756,6 +17182,899 @@ } #endregion + #region 绠″緞 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 + /// <summary> + /// 绠″緞 淇濆瓨 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveGy_PiPeList")] + [HttpPost] + public object SaveGy_PiPeList([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg2 = sArray[1].ToString(); + + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_PiPe_Edit", 1, false, msg2)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + //鑾峰彇鏈�澶D鍊艰祴鍊� + DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_PiPe ", "Gy_PiPe"); + if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) + { + var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); + maxid += 1; + HItemID = maxid; + } + ListModels oListModels = new ListModels(); + try + { + + WebAPI.DLL.ClsGy_PiPe_Ctl oBill = new WebAPI.DLL.ClsGy_PiPe_Ctl(); + List<Model.ClsGy_PiPe_Model> lsmain = new List<Model.ClsGy_PiPe_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); + lsmain = oListModels.getObjectByJson_Gy_PiPe(msg1); + foreach (Model.ClsGy_PiPe_Model oItem in lsmain) + { + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (oItem.HName.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� + + ds = oCN.RunProcReturn("select * from Gy_PiPe where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PiPe"); + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鏂板鏃跺垽鏂� + if (oItem.HItemID == 0) + { + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + else//缂栬緫鏃跺垽鏂� + { + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + //寰楀埌鐭唬鐮� + string sShortNumber; + sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); + if (sShortNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItem.HShortNumber = sShortNumber;//鐭唬鐮� + oItem.HEndFlag = true;//鏈骇鏍囧織 + DataSet ds2 = oCN.RunProcReturn("select HLevel from Gy_PiPe where HItemID =" + oItem.HParentID, "Gy_PiPe");//鎼滅储鐖剁被绛夌骇 + if (ds2.Tables[0].Rows.Count > 0) + { + oItem.HLevel = (int)ds2.Tables[0].Rows[0]["HLevel"] + 1; + } + else + { + oItem.HLevel = 1; + } + oItem.HMakeEmp = msg2; //鍒涘缓浜� + + oBill.oModel = oItem; + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.oModel.HItemID == 0) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 绠″緞 鑾峰彇淇℃伅 + /// </summary> + /// <returns></returns> + [Route("GetGy_PiPeDetail")] + [HttpGet] + public ApiResult<DataSet> GetGy_PiPeDetail(string HID) + { + var model = LuBaoSevice.GetGy_PiPeDetail(HID); + return model; + } + + /// <summary> + /// 绠″緞 鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetGy_PiPe")] + [HttpGet] + public object DeltetGy_PiPe(string HItemID, string user) + { + DataSet ds; + try + { + //鍒犻櫎鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_PiPe_Drop", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HItemID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + + ds = oCN.RunProcReturn("select * from Gy_PiPe where HItemID=" + HItemID, "Gy_PiPe"); + if (ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_PiPe_BeforeDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_PiPe_BeforeDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + + oCN.RunProc("delete Gy_PiPe where HItemID=" + HItemID); + + //鍒犻櫎鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_PiPe_AfterDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_PiPe_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜锛氬垹闄ゅ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + 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 + + #region 绠″緞鏉愯川 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 + /// <summary> + /// 绠″緞鏉愯川 淇濆瓨 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveGy_PiPeMaterialList")] + [HttpPost] + public object SaveGy_PiPeMaterialList([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg2 = sArray[1].ToString(); + + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_PiPeMaterial_Edit", 1, false, msg2)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + //鑾峰彇鏈�澶D鍊艰祴鍊� + DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_PiPeMaterial ", "Gy_PiPeMaterial"); + if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) + { + //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] + var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); + maxid += 1; + HItemID = maxid; + } + ListModels oListModels = new ListModels(); + try + { + + WebAPI.DLL.ClsGy_PiPeMaterial_Ctl oBill = new WebAPI.DLL.ClsGy_PiPeMaterial_Ctl(); + List<Model.ClsGy_PiPeMaterial_Model> lsmain = new List<Model.ClsGy_PiPeMaterial_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); + lsmain = oListModels.getObjectByJson_Gy_PiPeMaterial(msg1); + foreach (Model.ClsGy_PiPeMaterial_Model oItem in lsmain) + { + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (oItem.HName.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� + + ds = oCN.RunProcReturn("select * from Gy_PiPeMaterial where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PiPeMaterial"); + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //鏂板鏃跺垽鏂� + if (oItem.HItemID == 0) + { + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + else//缂栬緫鏃跺垽鏂� + { + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + //寰楀埌鐭唬鐮� + string sShortNumber; + sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); + if (sShortNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItem.HShortNumber = sShortNumber;//鐭唬鐮� + oItem.HEndFlag = true;//鏈骇鏍囧織 + DataSet ds2 = oCN.RunProcReturn("select HLevel from Gy_PiPeMaterial where HItemID =" + oItem.HParentID, "Gy_PiPeMaterial");//鎼滅储鐖剁被绛夌骇 + if (ds2.Tables[0].Rows.Count > 0) + { + oItem.HLevel = (int)ds2.Tables[0].Rows[0]["HLevel"] + 1; + } + else + { + oItem.HLevel = 1; + } + oItem.HMakeEmp = msg2; //鍒涘缓浜� + + oBill.oModel = oItem; + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.oModel.HItemID == 0) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 绠″緞鏉愯川 鑾峰彇淇℃伅 + /// </summary> + /// <returns></returns> + [Route("GetGy_PiPeMaterialDetail")] + [HttpGet] + public ApiResult<DataSet> GetGy_PiPeMaterialDetail(string HID) + { + var model = LuBaoSevice.GetGy_PiPeMaterialDetail(HID); + return model; + } + + /// <summary> + /// 绠″緞鏉愯川 鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetGy_PiPeMaterial")] + [HttpGet] + public object DeltetGy_PiPeMaterial(string HItemID, string user) + { + DataSet ds; + try + { + //鍒犻櫎鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Gy_PiPeMaterial_Drop", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HItemID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + + ds = oCN.RunProcReturn("select * from Gy_PiPeMaterial where HItemID=" + HItemID, "Gy_PiPeMaterial"); + if (ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Gy_PiPeMaterial_BeforeDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Gy_PiPeMaterial_BeforeDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + oCN.RunProc("delete Gy_PiPeMaterial where HItemID=" + HItemID); + + //鍒犻櫎鍚庢帶鍒�========================================= + string sql2 = "exec h_p_Gy_PiPeMaterial_AfterDelCtrl " + HItemID + ",'" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Gy_PiPeMaterial_AfterDelCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜锛氬垹闄ゅ悗鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + 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 + + #region 璁惧鑺傛媿缁存姢 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶 + /// <summary> + /// 椤圭洰璐圭敤鍒嗙被 淇濆瓨 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveSb_EqiupMaterWorkTime")] + [HttpPost] + public object SaveSb_EqiupMaterWorkTime([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg2 = sArray[1].ToString(); + + + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + //鑾峰彇鏈�澶D鍊艰祴鍊� + DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from EqiupMaterWorkTimes ", "EqiupMaterWorkTimes"); + if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) + { + //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] + var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); + maxid += 1; + HItemID = maxid; + } + ListModels oListModels = new ListModels(); + try + { + //淇濆瓨鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("EqiupMaterWorkTimes_Edit", 1, false, msg2)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + WebAPI.DLL.ClsEqiupMaterWorkTimes_Ctl oBill = new WebAPI.DLL.ClsEqiupMaterWorkTimes_Ctl(); + List<Model.ClsEqiupMaterWorkTimes_Model> lsmain = new List<Model.ClsEqiupMaterWorkTimes_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); + lsmain = oListModels.getObjectByJson_EqiupMaterWorkTimes(msg1); + foreach (ClsEqiupMaterWorkTimes_Model item in lsmain) + { + oBill.oModel = item; + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.oModel.HItemID == 0) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 璁惧鑺傛媿缁存姢 鑾峰彇淇℃伅 + /// </summary> + /// <returns></returns> + [Route("GetEqiupMaterWorkTimeDetail")] + [HttpGet] + public ApiResult<DataSet> GetEqiupMaterWorkTimeDetail(string HID) + { + var model = LuBaoSevice.GetEqiupMaterWorkTimeDetail(HID); + return model; + } + + /// <summary> + /// 璁惧鑺傛媿缁存姢 鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetEqiupMaterWorkTime")] + [HttpGet] + public object DeltetEqiupMaterWorkTime(string HItemID, string user) + { + DataSet ds; + try + { + //鍒犻櫎鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("EqiupMaterWorkTimes_Delete", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HItemID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + + ds = oCN.RunProcReturn("select * from EqiupMaterWorkTimes where HItemID=" + HItemID, "EqiupMaterWorkTimes"); + if (ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + + + oCN.RunProc("delete from EqiupMaterWorkTimes where HItemID=" + HItemID); + + + 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 + /// <summary> /// 鐢ㄥ叧鑱斿伐搴忚幏鍙栦俊鎭� @@ -17057,7 +18376,7 @@ { try { - ds = oCN.RunProcReturn("select * from xt_BaseInfo", "xt_BaseInfo"); + ds = oCN.RunProcReturn("select HItemID,HNumber,HCusName,HLogoLabel,HMenuLabel,HUserQty,ISNULL(HLogoTranslationText_English,HLogoLabel) HLogoTranslationText_English,ISNULL(HLogoTranslationText_Spain,HLogoLabel) HLogoTranslationText_Spain , ISNULL(HMenuTranslationText_English, HLogoLabel) HMenuTranslationText_English, ISNULL(HMenuTranslationText_Spain, HLogoLabel) HMenuTranslationText_Spain from xt_BaseInfo", "xt_BaseInfo"); if (ds is null) { objjson.code = "0"; @@ -17263,6 +18582,8 @@ } } + #region 鏍哥畻鏂瑰紡缁� + /// <summary> /// 鑾峰彇鏍哥畻鏂瑰紡缁勫垪琛� /// </summary> @@ -17378,6 +18699,7 @@ return objjson; } } + /// <summary> /// 鏍哥畻鏂瑰紡缁勭紪杈� /// </summary> @@ -17471,6 +18793,7 @@ } } #endregion + /// <summary> /// 淇濆瓨鑾峰彇鏍哥畻鏂瑰紡缁� /// </summary> @@ -17522,6 +18845,8 @@ return objJsonResult; } } + + #endregion /// <summary> /// 鑾峰彇宀椾綅鍒楄〃 @@ -17753,6 +19078,7 @@ } + /// <summary> /// 鑾峰彇鐢熶骇浠诲姟鍗曞垪琛� /// </summary> @@ -17804,6 +19130,7 @@ return objjson; } } + /// <summary> /// 鑾峰彇鐢熶骇浠诲姟鍗曞垪琛� /// </summary> @@ -17964,23 +19291,19 @@ /// <returns></returns> [Route("Web/GetSc_ProcessExchangeBillListView")] [HttpGet] - public object GetSc_ProcessExchangeBillListView(string ICMOBill, int OrganizationID) - { - if (ICMOBill != "" & ICMOBill != null) - { - sWhere = " where 1=1 and 鍗曟嵁鍙� like '%" + ICMOBill + "%' "; - } + public object GetSc_ProcessExchangeBillListView(string sWhere,int OrganizationID) + { try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("select top 500 * from h_v_Sc_ProcessExchangeBillList where 1=1 order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList"); - } + ds = oCN.RunProcReturn("select top 300 * from h_v_Sc_ProcessExchangeBillList_PDA where 1=1 order by 鍗曟嵁鍙� desc,hsubid", "h_v_Sc_ProcessExchangeBillList_PDA"); + } else { - string sql = "select * from h_v_Sc_ProcessExchangeBillList " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid "; - ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList"); + string sql = "select * from h_v_Sc_ProcessExchangeBillList_PDA where 1=1 " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid "; + ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList_PDA"); } if (ds == null || ds.Tables[0].Rows.Count <= 0) { @@ -18287,7 +19610,7 @@ ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_Main where 鐗╂枡鍚嶇О='"+HName+ "' and 宸ュ簭鍚嶇О='" + HProName + "' and HSourceID='" + HSourceID + "' order by 鏃ユ湡 desc ", "h_v_Gy_QCCheckProjectList_Main"); if (ds == null || ds.Tables[0].Rows.Count <= 0) { - ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_Main where 鐗╂枡鍚嶇О='" + HName + "' and 宸ュ簭鍚嶇О='" + HProName + "' order by 鏃ユ湡 desc ", "h_v_Gy_QCCheckProjectList_Main"); + ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCCheckProjectList_Main where 鐗╂枡鍚嶇О='" + HName + "' and 宸ュ簭鍚嶇О ='" + HProName + "' order by 鏃ユ湡 desc ", "h_v_Gy_QCCheckProjectList_Main"); } if (ds == null || ds.Tables[0].Rows.Count <= 0) { @@ -18418,6 +19741,7 @@ return objjson; } } + /// <summary> /// 鏍规嵁鍣ㄥ叿涓诲唴鐮佽幏鍙栧櫒鍏蜂繚鍏绘楠岄」鐩� /// </summary> @@ -18586,7 +19910,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏃犳潈闄愭煡璇�!"; + objJsonResult.Message = "[0000-1-068]鏃犳潈闄愭煡璇�!"; objJsonResult.data = null; return objJsonResult; } @@ -18609,7 +19933,7 @@ res.code = CodeConstant.SUCCEED; res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); - res.Message = "Sucess锛�"; + res.Message = "[0000-1-037]Sucess锛�"; res.list = columnNameList; res.data = ds.Tables[0]; return res; @@ -18618,7 +19942,7 @@ { res.code = CodeConstant.FAIL; res.count = CountConstant.FAIL; - res.Message = "Exception锛�" + e.ToString(); + res.Message = "[0000-1-038]Exception锛�" + e.ToString(); res.data = null; return res; } @@ -18786,7 +20110,7 @@ { objjson.code = "0"; objjson.count = 0; - objjson.Message = "璇ヨ澶囨湁澶氫釜璁″垝鍗曟垨鐐规瑙勭▼,鎵嬪姩閫夌潃" ; + objjson.Message = ds.Tables[0].Rows[0]["HRemark"].ToString(); objjson.data = null; return objjson; } @@ -19424,6 +20748,8 @@ public string Hurl { get; set; } public string HPicNum { get; set; } public string HShowMode { get; set; } + public string HTranslationText_English { get; set; } + public string HTranslationText_Spain { get; set; } public List<MenuLoad> childMenus { get; set; } } @@ -19435,17 +20761,17 @@ { List<MenuLoad> mu = new List<MenuLoad>(); //浠ョ埗瀛愮骇缁撴瀯瀛樻斁鑿滃崟娓呭崟淇℃伅 SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //鏁版嵁搴撴搷浣滃伐鍏� - string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HType + "' order by HPosition"; + string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HType + "' order by HPosition"; ds = oCn.RunProcReturn(sql, "Gy_MenuDefineSet"); //鏌ヨ褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鑿滃崟鏁版嵁 if (ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0) //鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鏈夎缃繃鑷畾涔変俊鎭紝鑻ヨ褰曟暟涓�0锛屽垯娌℃湁璁剧疆杩囷紝鍔犺浇鎵�鏈夌殑鑿滃崟淇℃伅 { - string sql1 = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode from Gy_MenuDefineSet where HMakeName=" + + string sql1 = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Gy_MenuDefineSet where HMakeName=" + "(select top 1 c.GroupName from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId " + "left join System_UserGroup c on b.GroupId = c.GroupID where a.Czymc ='"+HMakeName+"' order by len(c.GroupName ))"; ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet"); //鏌ヨ鐢ㄦ埛缁戝畾鐨勮鑹� 鏄惁璁剧疆鑿滃崟淇℃伅 鍙栬鑹插悕绉版渶鐭殑涓�涓� if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0)) { - sql = "Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID "; + sql = "Select HitemID,HNumber,HName,HPartentID,HLevel,Hurl,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain,HPicNum from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID "; ds = oCn.RunProcReturn(sql, "Gy_Menu_1"); } } @@ -19462,6 +20788,8 @@ tbj.HLevel = int.Parse(ds.Tables[0].Rows[i]["HLevel"].ToString()); tbj.Hurl = ds.Tables[0].Rows[i]["Hurl"].ToString(); tbj.HShowMode = ds.Tables[0].Rows[i]["HShowMode"].ToString(); + tbj.HTranslationText_English = ds.Tables[0].Rows[i]["HTranslationText_English"].ToString(); + tbj.HTranslationText_Spain = ds.Tables[0].Rows[i]["HTranslationText_Spain"].ToString(); if (ds.Tables[0].Rows[i]["HPicNum"] != null) { tbj.HPicNum = ds.Tables[0].Rows[i]["HPicNum"].ToString(); @@ -19505,6 +20833,8 @@ tbjson.HLevel = tree[m].HLevel; tbjson.Hurl = dt.Rows[i]["Hurl"].ToString(); tbjson.HShowMode = dt.Rows[i]["HShowMode"].ToString(); + tbjson.HTranslationText_English = dt.Rows[i]["HTranslationText_English"].ToString(); + tbjson.HTranslationText_Spain = dt.Rows[i]["HTranslationText_Spain"].ToString(); if (dt.Rows[i]["HPicNum"] != null) { tbjson.HPicNum = dt.Rows[i]["HPicNum"].ToString(); @@ -19637,6 +20967,33 @@ return objJsonResult; } } + + //鑾峰彇鎵�鏈夋ā鍧楅〉闈� + [Route("Web/ModePageList")] + [HttpGet] + public object ModePageList() + { + try + { + + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where isnull(Hurl,'') like'%html%' Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏� + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏌ヨ鎴愬姛锛�"; + objJsonResult.data = ds; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ澶辫触锛�"; + objJsonResult.data = e.ToString(); + return objJsonResult; + } + } #endregion #region 淇濆瓨鑷畾涔夋暟鎹� @@ -19686,16 +21043,18 @@ string Hurl = ds.Tables[0].Rows[0]["Hurl"].ToString(); string HType = ds.Tables[0].Rows[0]["HType"].ToString(); string HPicNum = ds.Tables[0].Rows[0]["HPicNum"].ToString(); + string HTranslationText_English = ds.Tables[0].Rows[0]["HTranslationText_English"].ToString(); + string HTranslationText_Spain = ds.Tables[0].Rows[0]["HTranslationText_Spain"].ToString(); if (HPartentID == "0" || HPartentID == ds.Tables[0].Rows[0]["HItemID"].ToString()) { string HPosition = ds.Tables[0].Rows[0]["HPosition"].ToString(); - sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "')"; + sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition,HTranslationText_English,HTranslationText_Spain) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "','"+ HTranslationText_English + "','" + HTranslationText_Spain + "')"; oCN.RunProc(sql); } else { - sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','z')"; + sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition,HTranslationText_English,HTranslationText_Spain) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','z','" + HTranslationText_English + "','" + HTranslationText_Spain + "')"; oCN.RunProc(sql); } @@ -19734,7 +21093,7 @@ //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/Xt_UserFastMenu_Display")] [HttpGet] - public object Xt_UserFastMenu_Display(string HMakeName, string HType) + public object Xt_UserFastMenu_Display(string HMakeName, string HType,string HModelAtributos) { try { @@ -19759,7 +21118,7 @@ menuInit.HSelected = false; //鍒ゆ柇鐢ㄦ埛鏄惁閫変腑鏄剧ず璇ヨ彍鍗� - String sql = "Select * from Xt_UserFastMenu where HSubFuncID = '" + ds.Tables[0].Rows[i]["HItemID"] + "' and HUserID='" + HMakeName + "'"; + String sql = "Select * from Xt_UserFastMenu where HSubFuncID = '" + ds.Tables[0].Rows[i]["HItemID"] + "' and HUserID='" + HMakeName + "' and HModelAtributos='" + HModelAtributos + "'"; ds1 = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); if (ds1.Tables[0].Rows.Count > 0) //瀵逛簬Gy_Menu_1琛ㄤ腑鐨勮彍鍗曡妭鐐癸紝閫氳繃妫�绱㈠湪Gy_MenuDefineSet琛ㄤ腑瀵瑰簲鐢ㄦ埛鏄惁瀛樺湪璇ヨ妭鐐圭殑淇℃伅锛屽垽鏂鐢ㄦ埛鏄惁閫変腑璇ヨ妭鐐归渶瑕佸姞杞芥樉绀哄湪渚ц彍鍗曟爮 { @@ -19827,6 +21186,7 @@ string HMakeName = sArray[1].ToString(); string saveData = sArray[0].ToString(); string HTypes = sArray[2].ToString(); + string HModelAtributos = sArray[3].ToString(); List<SaveDefineMenu> saveDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SaveDefineMenu>>(saveData); //澹版槑鏁版嵁搴撴搷浣滃伐鍏� @@ -19836,7 +21196,7 @@ oCN.BeginTran(); //鍒犻櫎褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鏁版嵁 - string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "' and HType = '" + HTypes + "'"; + string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "' and HType = '" + HTypes + "' and HModelAtributos = '" + HModelAtributos + "'"; oCN.RunProc(sql); //鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹� @@ -19855,7 +21215,7 @@ string HCaption = ds.Tables[0].Rows[0]["HName"].ToString(); string HType = ds.Tables[0].Rows[0]["HType"].ToString(); - sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "')"; + sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType,HModelAtributos) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "','"+ HModelAtributos + "')"; oCN.RunProc(sql); } } @@ -19885,17 +21245,17 @@ //蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹� [Route("Web/Xt_UserFastMenu_Init")] [HttpGet] - public object Xt_UserFastMenu_Init(string HMakeName, string HType) + public object Xt_UserFastMenu_Init(string HMakeName, string HType,string HModelAtributos) { try { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = '" + HMakeName + "' and b.HType = '" + HType + "' Order by a.HItemID"; + string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = '" + HMakeName + "' and b.HType = '" + HType + "' and a.HModelAtributos = '" + HModelAtributos + "' Order by a.HItemID"; ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇 if (ds == null || ds.Tables[0].Rows.Count == 0) { - sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = 'admin' and b.HType = '" + HType + "' Order by a.HItemID"; + sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = 'admin' and b.HType = '" + HType + "' and a.HModelAtributos = '" + HModelAtributos + "' Order by a.HItemID"; ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇 } @@ -19972,61 +21332,6 @@ } #endregion #endregion - - - - - - - - - - - - - - - - - - ///// <summary> - ///// 浜у搧鍏ュ簱缂撳瓨鍒楄〃鍒锋柊淇℃伅 - ///// </summary> - ///// <returns></returns> - //[Route("Web/chanpinruk")] - //[HttpGet] - //public object chanpinruk(string HBillType, string sHMaker, Int64 HOrgID) - //{ - // try - // { - // ds = webserver.GetKf_PonderationBillMain_TempList_New(HBillType, sHMaker, HOrgID); - // if (ds == null || ds.Tables[0].Rows.Count <= 0) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; - // objJsonResult.data = null; - // return objJsonResult; - // //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning); - // } - // else - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 1; - // objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; - // 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; - // } - //} /// <summary> -- Gitblit v1.9.1