From 0492494978c8f217be8dcec87769d5d2085883ae Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 11 十月 2024 17:58:43 +0800 Subject: [PATCH] 工艺路线列表:增加 启用默认 按钮,选中工艺路线后点击会将该工艺路线变为同物料唯一的默认工艺路线 --- WebAPI/Controllers/LMESController.cs | 151 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 149 insertions(+), 2 deletions(-) diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index 7832a77..b4d6eb6 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -3370,6 +3370,152 @@ } + #region 宸ヨ壓璺嚎鍒楄〃 鍚敤榛樿_鏉冮檺鍒ゆ柇 + [Route("Gy_RoutingBill/set_defaultRoute_CheckRight")] + [HttpGet] + public object set_defaultRoute_CheckRight(string user, string HBillSubType) + { + try + { + if (HBillSubType == "SUB") + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_SetDefaultRoute", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鍚敤榛樿宸ヨ壓璺嚎!"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_SetDefaultRoute", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬惎鐢ㄩ粯璁�!"; + objJsonResult.data = null; + return objJsonResult; + } + } + + + 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 宸ヨ壓璺嚎鍒楄〃 鍚敤榛樿 + [Route("Gy_RoutingBill/set_defaultRoute")] + [HttpGet] + public object set_defaultRoute(string HInterID, string user, string HBillSubType) + { + try + { + if (HBillSubType == "SUB") + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_SetDefaultRoute", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鍚敤榛樿宸ヨ壓璺嚎!"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_SetDefaultRoute", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬惎鐢ㄩ粯璁�!"; + objJsonResult.data = null; + return objJsonResult; + } + } + + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "Gy_RoutingBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (!(ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].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("exec h_p_Gy_RoutingBillCheck " + HInterID+",'" + user + "'"); + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + oCN.RollBack(); + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 宸ヨ壓璺嚎瀹℃牳/鍙嶅鏍稿姛鑳� [Route("Gy_RoutingBill/CheckGy_RoutingBill")] [HttpGet] @@ -3437,8 +3583,9 @@ //瀹℃牳宸ヨ壓璺嚎 oCN.RunProc(" Update Gy_RoutingBillMain set HChecker='" + user + "',HCheckDate=getdate(),HBillStatus=2 Where HInterID=" + HInterID.ToString()); - //鍒锋柊榛樿宸ヨ壓璺嚎 - oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID); + + ////鍒锋柊榛樿宸ヨ壓璺嚎 + //oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID); ////瀹℃牳鍗曟嵁 //if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) -- Gitblit v1.9.1