From 956970d74fa97208d0fa873ff1f8ab7ecdc393e4 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期二, 29 十月 2024 10:08:45 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/PublicPageMethodController.cs | 44 +++++++++++++++++++++++++++++++++++--------- 1 files changed, 35 insertions(+), 9 deletions(-) diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs index 2c8564e..45881d2 100644 --- a/WebAPI/Controllers/PublicPageMethodController.cs +++ b/WebAPI/Controllers/PublicPageMethodController.cs @@ -3410,7 +3410,7 @@ #region 鏉′欢鏌ヨ鏉冮檺鍒楄〃 [Route("PublicPageMethod/PowerList")] [HttpGet] - public object PowerList(string czybm, string sGnbm) + public object PowerList(string czybm, string sGnbm,string HSouceBillType) { try { @@ -3426,10 +3426,17 @@ sName = sGnbm; } } + if (HSouceBillType == "yh") + { + ds = oCN.RunProcReturn("select * from Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl"); + } + else if (HSouceBillType == "js") + { + ds = oCN.RunProcReturn("select * from System_UserGroup where GroupID='" + czybm + "'", "System_UserGroup"); + } - ds = oCN.RunProcReturn("select * from Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl"); string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]); - ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityID,'' AuthorityHID, gnms ,gnbm hgnbm FROM xt_xtgnb where useflag=1 and sjgnbm='" + sName + "' and rightflag=1 order by gnbm", "xt_xtgnb"); + ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityID,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityHID, gnms ,gnbm hgnbm FROM xt_xtgnb where useflag=1 and sjgnbm='" + sName + "' and rightflag=1 order by gnbm", "xt_xtgnb"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -3466,7 +3473,7 @@ SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); string sql = string.Format(@"select '鏉冮檺绠$悊-鐢ㄦ埛' id,'' HNumber,'鏉冮檺绠$悊--鐢ㄦ埛' title,'' ParentID union all - select gnbm id,gnsy HNumber,gnmc as title, case when sjgnbm='' then '鏉冮檺绠$悊--鐢ㄦ埛' else sjgnbm end ParentID from Xt_Xtgnb where sjgnbm='' + select gnbm id,gnsy HNumber,gnmc as title, case when sjgnbm='' then '鏉冮檺绠$悊--鐢ㄦ埛' else sjgnbm end ParentID from Xt_Xtgnb where sjgnbm='' and useflag=1 union all Select gnbm id,gnsy HNumber,gnmc as title,sjgnbm as ParentID from Xt_Xtgnb where mjbz=0 and useflag=1 and rightflag=1 and sjgnbm in( @@ -3503,6 +3510,7 @@ string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); string msg4 = sArray[2].ToString(); + string HSouceBillType = sArray[3].ToString(); ListModels oListModels = new ListModels(); try { @@ -3511,7 +3519,16 @@ msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n lsmain = oListModels.getObjectByJson_UserPower(msg3); - ds = oCN.RunProcReturn("select * from Gy_Czygl where czybm='" + msg4.Trim() + "'", "Gy_Czygl"); + + if (HSouceBillType == "yh") + { + ds = oCN.RunProcReturn("select * from Gy_Czygl where czybm='" + msg4.Trim() + "'", "Gy_Czygl"); + } + else if (HSouceBillType == "js") + { + ds = oCN.RunProcReturn("select * from System_UserGroup where GroupID='" + msg4 + "'", "System_UserGroup"); + } + string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]); string Auth_str = AuthorityID; string MKID = ""; @@ -3565,7 +3582,16 @@ } oDs = null; } - oCN.RunProc("UPDATE Gy_Czygl SET AuthorityID='" + Auth_str + "' WHERE czybm='" + msg4.Trim() + "'"); + + if (HSouceBillType == "yh") + { + oCN.RunProc("UPDATE Gy_Czygl SET AuthorityID='" + Auth_str + "' WHERE czybm='" + msg4.Trim() + "'"); + } + else if (HSouceBillType == "js") + { + oCN.RunProc("UPDATE System_UserGroup SET AuthorityID='" + Auth_str + "' WHERE GroupID='" + msg4.Trim() + "'"); + } + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鎺堟潈鎴愬姛锛�"; @@ -3646,13 +3672,13 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (sWhere == null || sWhere.Equals("")) { - ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_ClassTimePrjGroup where HStopflag=0 Order by HItemID ", "Gy_ClassTimePrjGroup"); + ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_ClassTimePrj where HStopflag=0 Order by HItemID ", "Gy_ClassTimePrj"); } else { - string sql1 = "Select HItemID,HNumber ,HName from Gy_ClassTimePrjGroup where HStopflag=0 "; + string sql1 = "Select HItemID,HNumber ,HName from Gy_ClassTimePrj where HStopflag=0 "; string sql = sql1 + sWhere; - ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrjGroup"); + ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrj"); } //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); -- Gitblit v1.9.1