From 5d8f6ee65e43a848efcd002f1ca800193eb16992 Mon Sep 17 00:00:00 2001 From: geh <1923421292@qq.com> Date: Tue, 13 May 2025 11:04:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=A1=B9=E7=9B=AE=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBQHSE/BLL/Common/Const.cs | 5 + SUBQHSE/FineUIPro.Web/indexProject.aspx.cs | 34 +- .../WebAPI/Controllers/PersonController.cs | 488 +++++++++++++++++- .../WebAPI/Filter/TestPermissionAttribute.cs | 1 + 4 files changed, 520 insertions(+), 8 deletions(-) diff --git a/SUBQHSE/BLL/Common/Const.cs b/SUBQHSE/BLL/Common/Const.cs index 2d66c6c..699b2c1 100644 --- a/SUBQHSE/BLL/Common/Const.cs +++ b/SUBQHSE/BLL/Common/Const.cs @@ -1273,6 +1273,7 @@ namespace BLL /// 人员管理 /// public const string Menu_Person = "Menu_Person"; + public const string Menu_Person_P = "Menu_Person_P"; /// /// 通知 /// @@ -1341,10 +1342,12 @@ namespace BLL /// 质量 /// public const string Menu_CQMS = "Menu_CQMS"; + public const string Menu_CQMS_P = "Menu_CQMS_P"; /// /// 安全 /// public const string Menu_HSSE = "Menu_HSSE"; + public const string Menu_HSSE_P = "Menu_HSSE_P"; /// /// 技术 /// @@ -1373,6 +1376,7 @@ namespace BLL /// 视频监控 /// public const string Menu_DigitalSite = "Menu_DigitalSite"; + public const string Menu_DigitalSite_P = "Menu_DigitalSite_P"; /// /// 现场考勤 /// @@ -1381,6 +1385,7 @@ namespace BLL /// 设备管理 /// public const string Menu_Device = "Menu_Device"; + public const string Menu_Device_P = "Menu_Device_P"; /// /// 消息 /// diff --git a/SUBQHSE/FineUIPro.Web/indexProject.aspx.cs b/SUBQHSE/FineUIPro.Web/indexProject.aspx.cs index 0f72398..5483f43 100644 --- a/SUBQHSE/FineUIPro.Web/indexProject.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/indexProject.aspx.cs @@ -653,6 +653,26 @@ namespace FineUIPro.Web { this.Tab1.IFrameUrl = ""; } + else if (type == Const.Menu_Person_P) + { + this.Tab1.IFrameUrl = ""; + } + else if (type == Const.Menu_HSSE_P) + { + this.Tab1.IFrameUrl = ""; + } + else if (type == Const.Menu_CQMS_P) + { + this.Tab1.IFrameUrl = ""; + } + else if (type == Const.Menu_Device_P) + { + this.Tab1.IFrameUrl = ""; + } + else if (type == Const.Menu_DigitalSite_P) + { + this.Tab1.IFrameUrl = ""; + } } else { @@ -683,13 +703,13 @@ namespace FineUIPro.Web protected void btnPerson_Click(object sender, EventArgs e) { - this.MenuSwitchMethod(Const.Menu_Person); + this.MenuSwitchMethod(Const.Menu_Person_P); } protected void btnCQMS_Click(object sender, EventArgs e) { - this.MenuSwitchMethod(Const.Menu_CQMS); + this.MenuSwitchMethod(Const.Menu_CQMS_P); } protected void btnPersonal_Click(object sender, EventArgs e) @@ -703,12 +723,12 @@ namespace FineUIPro.Web } protected void btnDevice_Click(object sender, EventArgs e) { - this.MenuSwitchMethod(Const.Menu_Device); + this.MenuSwitchMethod(Const.Menu_Device_P); } protected void btnHSSE_Click(object sender, EventArgs e) { - this.MenuSwitchMethod(Const.Menu_HSSE); + this.MenuSwitchMethod(Const.Menu_HSSE_P); } protected void btnHJGL_Click(object sender, EventArgs e) @@ -734,7 +754,7 @@ namespace FineUIPro.Web } protected void btnDigitalSite_Click(object sender, EventArgs e) { - if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite, this.drpProject.Value)) + if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite_P, this.drpProject.Value)) { string video_Url = string.Empty; var sysSet16 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控地址" select x).ToList().FirstOrDefault(); @@ -745,7 +765,7 @@ namespace FineUIPro.Web var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); string url = video_Url + "#/screen?username=" + project.ProjectCode + "&password=" + project.MonitorPW; Response.Write(""); - // this.MenuSwitchMethod(Const.Menu_DigitalSite); + // this.MenuSwitchMethod(Const.Menu_DigitalSite_P); } } @@ -753,7 +773,7 @@ namespace FineUIPro.Web { get { - if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite, this.drpProject.Value)) + if (CommonService.IsHaveSystemPower(this.CurrUser.UserId, Const.Menu_DigitalSite_P, this.drpProject.Value)) { string video_Url = string.Empty; var sysSet16 = (from x in Funs.DB.Sys_Set where x.SetName == "视频监控地址" select x).ToList().FirstOrDefault(); diff --git a/SUBQHSE/WebAPI/Controllers/PersonController.cs b/SUBQHSE/WebAPI/Controllers/PersonController.cs index bb6d14e..7c7e8c1 100644 --- a/SUBQHSE/WebAPI/Controllers/PersonController.cs +++ b/SUBQHSE/WebAPI/Controllers/PersonController.cs @@ -1128,7 +1128,7 @@ namespace WebAPI.Controllers string url = Request.RequestUri.Scheme + "://" + Request.RequestUri.Host + ":" + Request.RequestUri.Port + - "/JT/" + reUrl; + "/SUBQHSE/" + reUrl; responeData.data = new {IDCard = APIIDCardInfoService.ReadIDCardInfo(url), IDCardUrl = reUrl,URL=url}; } @@ -1275,5 +1275,491 @@ namespace WebAPI.Controllers #endregion + #region 岗位列表 + + public Model.ResponeData getSql() + { + var responeData = new Model.ResponeData(); + try + { + var PersonList = (from x in Funs.DB.Sys_Menu + where x.MenuType == "Menu_Person" + select x).ToList(); + var HSSEList = (from x in Funs.DB.Sys_Menu + where x.MenuType == "Menu_HSSE" + select x).ToList(); + var CQMSList = (from x in Funs.DB.Sys_Menu + where x.MenuType == "Menu_CQMS" + select x).ToList(); + var DeviceList = (from x in Funs.DB.Sys_Menu + where x.MenuType == "Menu_Device" + select x).ToList(); + var DigitalSiteList = (from x in Funs.DB.Sys_Menu + where x.MenuType == "Menu_DigitalSite" + select x).ToList(); + int a = 0; + int b = 0; + int c = 0; + int d = 0; + int e = 0; + Dictionary amap = new Dictionary(); + Dictionary aamap = new Dictionary(); + Dictionary bmap = new Dictionary(); + Dictionary bbmap = new Dictionary(); + Dictionary bbbmap = new Dictionary(); + Dictionary cmap = new Dictionary(); + Dictionary ccmap = new Dictionary(); + Dictionary dmap = new Dictionary(); + Dictionary ddmap = new Dictionary(); + Dictionary emap = new Dictionary(); + Dictionary eemap = new Dictionary(); + + Model.SUBQHSEDB db = Funs.DB; + if (PersonList.Count > 0) + { + var qq = PersonList.Where(x => x.SuperMenu == "0"); + foreach (var q in qq) + { + var id = SQLHelper.GetNewID(); + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = q.MenuName, + Icon = q.Icon, + Url = q.Url, + SortIndex = q.SortIndex, + SuperMenu = "0", + MenuType = "Menu_Person_P", + IsOffice = q.IsOffice, + IsEnd = q.IsEnd, + IsUsed = q.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + amap.Add(q.MenuId, id); + a = a++; + } + + var nqq = PersonList.Where(x => x.SuperMenu != "0"); + + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (amap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_Person_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + aamap.Add(nq.MenuId,id); + a = a++; + } + } + + if (aamap.Count > 0) + { + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (aamap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_Person_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + a = a++; + } + } + } + + + } + if (HSSEList.Count > 0) + { + var qq = HSSEList.Where(x => x.SuperMenu == "0"); + foreach (var q in qq) + { + var id = SQLHelper.GetNewID(); + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = q.MenuName, + Icon = q.Icon, + Url = q.Url, + SortIndex = q.SortIndex, + SuperMenu = "0", + MenuType = "Menu_HSSE_P", + IsOffice = q.IsOffice, + IsEnd = q.IsEnd, + IsUsed = q.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + bmap.Add(q.MenuId, id); + b = b++; + } + + var nqq = HSSEList.Where(x => x.SuperMenu != "0"); + + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (bmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_HSSE_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + bbmap.Add(nq.MenuId,id); + b = b++; + } + } + + if (bbmap.Count>0) + { + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (bbmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_HSSE_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + bbbmap.Add(nq.MenuId,id); + b = b++; + } + } + } + + if (bbbmap.Count>0) + { + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (bbbmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_HSSE_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + } + } + } + + } + if (CQMSList.Count > 0) + { + var qq = CQMSList.Where(x => x.SuperMenu == "0"); + foreach (var q in qq) + { + var id = SQLHelper.GetNewID(); + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = q.MenuName, + Icon = q.Icon, + Url = q.Url, + SortIndex = q.SortIndex, + SuperMenu = "0", + MenuType = "Menu_CQMS_P", + IsOffice = q.IsOffice, + IsEnd = q.IsEnd, + IsUsed = q.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + cmap.Add(q.MenuId, id); + c = c++; + } + + var nqq = CQMSList.Where(x => x.SuperMenu != "0"); + + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (cmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_CQMS_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + ccmap.Add(nq.MenuId,id); + c = c++; + } + } + + if (ccmap.Count>0) + { + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (ccmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_CQMS_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + } + } + } + + } + if (DeviceList.Count > 0) + { + var qq = DeviceList.Where(x => x.SuperMenu == "0"); + foreach (var q in qq) + { + var id = SQLHelper.GetNewID(); + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = q.MenuName, + Icon = q.Icon, + Url = q.Url, + SortIndex = q.SortIndex, + SuperMenu = "0", + MenuType = "Menu_Device_P", + IsOffice = q.IsOffice, + IsEnd = q.IsEnd, + IsUsed = q.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + dmap.Add(q.MenuId, id); + d = d++; + } + + var nqq = DeviceList.Where(x => x.SuperMenu != "0"); + + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (dmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_Device_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + ddmap.Add(nq.MenuId,id); + d = d++; + } + } + + if (ddmap.Count>0) + { + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (ddmap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_Device_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + } + } + } + } + if (DigitalSiteList.Count > 0) + { + var qq = DigitalSiteList.Where(x => x.SuperMenu == "0"); + foreach (var q in qq) + { + var id = SQLHelper.GetNewID(); + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = q.MenuName, + Icon = q.Icon, + Url = q.Url, + SortIndex = q.SortIndex, + SuperMenu = "0", + MenuType = "Menu_DigitalSite_P", + IsOffice = q.IsOffice, + IsEnd = q.IsEnd, + IsUsed = q.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + emap.Add(q.MenuId, id); + e = e++; + } + + var nqq = DigitalSiteList.Where(x => x.SuperMenu != "0"); + + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (emap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_DigitalSite_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + eemap.Add(nq.MenuId,id); + e = e++; + } + } + if (eemap.Count>0) + { + foreach (var nq in nqq) + { + var id = SQLHelper.GetNewID(); + + if (eemap.TryGetValue(nq.SuperMenu, out string value)) + { + Model.Sys_Menu newmMenu = new Model.Sys_Menu + { + MenuId = id, + MenuName = nq.MenuName, + Icon = nq.Icon, + Url = nq.Url, + SortIndex = nq.SortIndex, + SuperMenu = value, + MenuType = "Menu_DigitalSite_P", + IsOffice = nq.IsOffice, + IsEnd = nq.IsEnd, + IsUsed = nq.IsUsed, + }; + db.Sys_Menu.InsertOnSubmit(newmMenu); + db.SubmitChanges(); + } + } + } + } + responeData.data = new { a=a,b=b,c=c,d=d,e=e }; + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + + return responeData; + } + + #endregion + } } \ No newline at end of file diff --git a/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs b/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs index fe1fabe..b150c15 100644 --- a/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs +++ b/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs @@ -151,6 +151,7 @@ namespace WebAPI.Filter , "InformedConsentForm*getFormByWorkPostName" , "Person*PostAddUrl" , "Person*getWorkPostList" + , "Person*getSql" , "ProjectUnitPenetrate*getDataByProjectUnitId" , "Rectify*getRectifyList" , "Rectify*getRectifyItemListBy"