diff --git a/DataBase/版本日志/SUBQHSE_V2025-09-15-xiaj.sql b/DataBase/版本日志/SUBQHSE_V2025-09-15-xiaj.sql new file mode 100644 index 00000000..8916591c --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2025-09-15-xiaj.sql @@ -0,0 +1,5 @@ + + + +ALTER TABLE Comprehensive_InspectionEquipment +ALTER COLUMN UsedPlace NVARCHAR(500); \ No newline at end of file diff --git a/DataBase/版本日志/SUBQHSE_V2025-09-16-xiaj(角色补充项目主管).sql b/DataBase/版本日志/SUBQHSE_V2025-09-16-xiaj(角色补充项目主管).sql new file mode 100644 index 00000000..4f34021a --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2025-09-16-xiaj(角色补充项目主管).sql @@ -0,0 +1,17 @@ + + + +update Sys_Role set RoleCode='101' where RoleName='Ŀ'; + + +--ɫĿ +IF NOT EXISTS (SELECT 1 FROM Sys_Role WHERE RoleName = 'Ŀ') +BEGIN + insert into Sys_Role(RoleId,RoleName,RoleCode,IsSystemBuilt,RoleType,IsAuditFlow) + values('b51072d6-5c8d-4763-b010-b3492b50feac','Ŀ','100',1,1,1) +END +GO + + + + diff --git a/SGGL/BLL/API/APIGetHttpService.cs b/SGGL/BLL/API/APIGetHttpService.cs index 081aad15..a59ba58a 100644 --- a/SGGL/BLL/API/APIGetHttpService.cs +++ b/SGGL/BLL/API/APIGetHttpService.cs @@ -20,8 +20,8 @@ namespace BLL public static string Http(string url, string method = "GET", string contenttype = "application/json;charset=utf-8", Hashtable header = null, string data = null) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | -SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | -SecurityProtocolType.Tls12; + SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | + SecurityProtocolType.Tls12; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = string.IsNullOrEmpty(method) ? "GET" : method; request.ContentType = string.IsNullOrEmpty(contenttype) ? "application/json;charset=utf-8" : contenttype; diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs index cebc0fe2..06462030 100644 --- a/SGGL/BLL/Common/CommonService.cs +++ b/SGGL/BLL/Common/CommonService.cs @@ -589,6 +589,7 @@ namespace BLL /// public static string CreateGetHttpResponse(string url) { + System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象 request.Method = "Get";//请求方式 request.ContentType = "application/x-www-form-urlencoded";//链接类型 diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index cba955dc..e6c00786 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -390,6 +390,10 @@ namespace BLL #region 内置项目角色定义 /// + /// 项目主管 + /// + public const string ProjectSupervisor = "b51072d6-5c8d-4763-b010-b3492b50feac"; + /// /// 项目经理 /// public const string ProjectManager = "1184835B-73AF-47FB-9F83-20740CE2FAD7"; diff --git a/SGGL/BLL/OpenService/FileInsertService.cs b/SGGL/BLL/OpenService/FileInsertService.cs index 3f19aac2..5331491e 100644 --- a/SGGL/BLL/OpenService/FileInsertService.cs +++ b/SGGL/BLL/OpenService/FileInsertService.cs @@ -5,6 +5,7 @@ using System.Text; using System.Collections; using System.IO; using System.Web; +using System.Text.RegularExpressions; namespace BLL { @@ -44,6 +45,7 @@ namespace BLL } } + /// /// 获取多附件数据流类 /// @@ -61,18 +63,30 @@ namespace BLL { if (strs.Count() > i) { + //string physicalpath = Funs.AttachRootPath; string physicalpath = Funs.RootPath; - //HttpContext.Current.Request.PhysicalApplicationPath; - string fullPath = physicalpath + strs[i]; + string fpath = strs[i]; + string fullPath = physicalpath + fpath; if (!File.Exists(fullPath)) { byte[] fileContext = item; - int index = fullPath.LastIndexOf("\\"); - string filePath = fullPath.Substring(0, index); + string fileName = Regex.Match(fullPath, @"[^/\\?]+(\?.*)?$").Value; + string filePath = fullPath.Replace(fileName, ""); + //int index = fullPath.LastIndexOf("\\"); + //string filePath = fullPath.Substring(0, index) ; + //string filePath = index > 0 ? fullPath.Substring(0, index) : fullPath; - if (!Directory.Exists(filePath)) + try { - Directory.CreateDirectory(filePath); + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + } + catch (Exception ex) + { + ErrLogInfo.WriteLog($"附件【{filePath}】获取异常!"); + //continue; } //string savePath = fullPath + fileName; @@ -93,6 +107,7 @@ namespace BLL } } + /// /// 数据和附件插入到多附件表 /// diff --git a/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs b/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs index 4a2bf1e2..e0ffeee7 100644 --- a/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs +++ b/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs @@ -125,7 +125,7 @@ namespace BLL "; -//< p > 登录密码:{ user.RawPassword} + //< p > 登录密码:{ user.RawPassword} mail.Body = bodyStr; try @@ -210,6 +210,7 @@ namespace BLL //获取有邮箱的用户 var userIds = BLL.UserService.GetUserHaveEmailList(); + if (userIds.Any() && lstOverdue.Any()) { //int allnum = 0; @@ -221,6 +222,9 @@ namespace BLL if (lstProjectOverdue.Any()) { string projectName = pro.ProjectName; + + #region 提醒事项相关人员 + foreach (var user in userIds) { //if (allnum > 100) { break; } @@ -316,6 +320,96 @@ namespace BLL //Thread.Sleep(1000); //暂停1秒 } } + + #endregion + + #region 提醒项目主管和项目经理 + + var projectSupervisors = ProjectUserService.GetProjectUserByRoleId(Const.ProjectSupervisor); + var projectManagers = ProjectUserService.GetProjectUserByRoleId(Const.ProjectManager); + + List remindUserIds = new List(); + List projectSupervisorIds = projectSupervisors.Select(x => x.UserId).ToList(); + List projectManagerIds = projectManagers.Select(x => x.UserId).ToList(); + if (projectSupervisorIds.Any()) { remindUserIds.AddRange(projectSupervisorIds); } + if (projectManagerIds.Any()) { remindUserIds.AddRange(projectManagerIds); } + + var remindUsers = userIds.Where(x => remindUserIds.Contains(x.UserId)); + foreach (var user in remindUsers) + { + MailMessage mail = new MailMessage(); + //邮件主题 + mail.Subject = $"关键事项超期预警提醒——{projectName}"; + mail.To.Add(user.Email); + //mail.To.Add("test@test.com"); + mail.IsBodyHtml = true;//确保邮件正文被当作HTML解析 + + StringBuilder tbodyStr = new StringBuilder(); + + int index = 0; + if (projectManagerIds.Contains(user.UserId)) + { + foreach (var item in lstProjectOverdue) + { + index++; + tbodyStr.Append($"{index}事项逾期{item.UnitName}{item.GJSXID}{item.Detail}{item.GJSXTypeName}{item.UserName}{item.User_AcceptanceUserName}{item.CompleteDate.ToShortDateString()}{(item.DateDiffDays > 0 ? item.DateDiffDays.ToString() : "半")}"); + } + } + if (projectSupervisorIds.Contains(user.UserId) && !projectManagerIds.Contains(user.UserId)) + { + var lstProjectOverdue2 = lstOverdue.Where(x => x.ProjectId == pro.ProjectId && x.DateDiffDays > 13).ToList(); + index = 0; + foreach (var item in lstProjectOverdue2) + { + index++; + tbodyStr.Append($"{index}事项逾期{item.UnitName}{item.GJSXID}{item.Detail}{item.GJSXTypeName}{item.UserName}{item.User_AcceptanceUserName}{item.CompleteDate.ToShortDateString()}{(item.DateDiffDays > 0 ? item.DateDiffDays.ToString() : "半")}"); + } + } + //邮件正文 + string bodyStr = @" + + + + +

关键事项超期预警提醒

+请点击此处,查看详细信息,并及时处置关闭 + + + + + + + + + + + + + + + +" + tbodyStr.ToString() + "
序号类型责任单位事项编号事项描述事项类别发起人责任人约定完成时间超期时间(天)
"; + + mail.Body = bodyStr; + if (index > 1) + { + //allnum++; + bool send = PushEmail(mail); + //Thread.Sleep(1000); //暂停1秒 + } + } + + #endregion } } } diff --git a/SGGL/BLL/ProjectData/ProjectUserService.cs b/SGGL/BLL/ProjectData/ProjectUserService.cs index b3c260f1..c153853c 100644 --- a/SGGL/BLL/ProjectData/ProjectUserService.cs +++ b/SGGL/BLL/ProjectData/ProjectUserService.cs @@ -6,7 +6,7 @@ public static class ProjectUserService { - public static SGGLDB db = Funs.DB; + //public static SGGLDB db = Funs.DB; /// ///获取项目用户信息 @@ -35,6 +35,15 @@ return (from x in Funs.DB.Project_ProjectUser where x.UserId == userId select x).ToList(); } + /// + ///获取项目用户信息 根据用户角色ID + /// + /// + public static List GetProjectUserByRoleId(string roleId) + { + return (from x in Funs.DB.Project_ProjectUser where x.RoleId.Contains(roleId) select x).ToList(); + } + /// ///获取当前项目用户信息根据用户ID /// diff --git a/SGGL/BLL/WebService/CNCECHSSEGetWebService.cs b/SGGL/BLL/WebService/CNCECHSSEGetWebService.cs index 0872c8cb..88587aca 100644 --- a/SGGL/BLL/WebService/CNCECHSSEGetWebService.cs +++ b/SGGL/BLL/WebService/CNCECHSSEGetWebService.cs @@ -13,6 +13,8 @@ namespace BLL #region 督查检查整改上报 + + /// /// 督查检查整改上报 /// @@ -23,12 +25,12 @@ namespace BLL { try { - // CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); var upCheckReport = from x in db.View_DCGL_CheckRectifyListFromSUB where x.RealEndDate.HasValue && x.CheckRectifyId == checkRectifyId select new Model.DCGLCheckRectifyItem { CheckRectifyId = x.CheckRectifyId, + NoticeItemId = x.NoticeItemId, CheckRectifyCode = x.CheckRectifyCode, ProjectId = x.ProjectId, UnitId = x.UnitId, @@ -42,13 +44,15 @@ namespace BLL OrderEndDate = x.OrderEndDate, OrderEndPerson = x.OrderEndPerson, RealEndDate = x.RealEndDate, - Verification = x.Verification, + //Verification = x.Verification, + Situation = x.Situation, AttachFileId = x.AttachFileId2, ToKeyId = x.ToKeyId2, AttachSource = x.AttachSource2, AttachUrl = x.AttachUrl2, - ////附件转为字节传送 - FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2), + FilePath = Funs.SGGLUrl + //////附件转为字节传送 + //FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2), }; string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/UpDCGLCheckRectifyTable"; @@ -91,6 +95,8 @@ namespace BLL return code; } } + + #endregion diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 86bc7338..f2bffe13 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1895,6 +1895,7 @@ + diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx index 7341da11..533afa56 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx @@ -129,7 +129,7 @@ - + @@ -255,24 +255,24 @@ - + - + - + - + + + diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs index b3066ac3..2a54c6f2 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs @@ -57,6 +57,8 @@ namespace FineUIPro.Web.ProjectData { this.ProjectId = this.CurrUser.LoginProjectId; } + ///项目主管 + UserService.InitUserDropDownList(this.drpProjectSupervisor, string.Empty, true); ///项目经理 UserService.InitUserDropDownList(this.drpProjectManager, string.Empty, true); ///施工经理 @@ -123,6 +125,12 @@ namespace FineUIPro.Web.ProjectData var getPUser = Funs.DB.Project_ProjectUser.Where(x => x.ProjectId == this.ProjectId); if (getPUser.Count() > 0) { + ///项目主管 + var s = getPUser.FirstOrDefault(x => x.RoleId.Contains(BLL.Const.ProjectSupervisor)); + if (s != null) + { + this.drpProjectSupervisor.SelectedValue = s.UserId; + } ///项目经理 var m = getPUser.FirstOrDefault(x => x.RoleId.Contains(BLL.Const.ProjectManager)); if (m != null) @@ -490,7 +498,8 @@ namespace FineUIPro.Web.ProjectData /// /// private void SetProjectManager(string projectId) - { + { + string newProjectSupervisor = this.drpProjectSupervisor.SelectedValue; string newProjectManager = this.drpProjectManager.SelectedValue; string newConstructionManager = this.drpConstructionManager.SelectedValue; string newHSSEManager = this.drpHSSEManager.SelectedValue; @@ -499,6 +508,48 @@ namespace FineUIPro.Web.ProjectData var project = BLL.ProjectService.GetProjectByProjectId(projectId); if (project != null) { + #region 项目主管 + + string OldProjectSupervisor = string.Empty; ////项目主管 + var s = Funs.DB.Project_ProjectUser.FirstOrDefault(x => x.ProjectId == projectId && x.RoleId.Contains(BLL.Const.ProjectSupervisor)); + if (s != null) + { + OldProjectSupervisor = s.UserId; + } + ////此人不在项目中 + if (!string.IsNullOrEmpty(newProjectSupervisor) && newProjectSupervisor != Const._Null && newProjectSupervisor != OldProjectSupervisor) + { + BLL.ProjectUserService.DeleteProjectUserByProjectIdUserId(projectId, newProjectSupervisor); + BLL.ProjectUserService.DeleteProjectUserByProjectIdUserId(projectId, OldProjectSupervisor); + var user = BLL.UserService.GetUserByUserId(newProjectSupervisor); + if (user != null && !string.IsNullOrEmpty(user.UnitId)) + { + var punit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(projectId, user.UnitId); + if (punit == null) ///项目单位为空时要增加项目单位 + { + Model.Project_ProjectUnit newProjectUnit = new Project_ProjectUnit + { + ProjectId = projectId, + UnitId = user.UnitId, + InTime = System.DateTime.Now + }; + BLL.ProjectUnitService.AddProjectUnit(newProjectUnit); + } + + Model.Project_ProjectUser newProjectUser = new Model.Project_ProjectUser + { + ProjectId = projectId, + UserId = newProjectSupervisor, + UnitId = user.UnitId, + RoleId = BLL.Const.ProjectSupervisor, + IsPost = true + }; + BLL.ProjectUserService.AddProjectUser(newProjectUser); + } + } + + #endregion + #region 项目经理 string OldProjectManager = string.Empty; ////项目经理 diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.designer.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.designer.cs index d05a7512..6ea2f148 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.designer.cs @@ -500,6 +500,15 @@ namespace FineUIPro.Web.ProjectData /// protected global::FineUIPro.Form Form3; + /// + /// drpProjectSupervisor 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectSupervisor; + /// /// drpProjectManager 控件。 /// @@ -510,13 +519,13 @@ namespace FineUIPro.Web.ProjectData protected global::FineUIPro.DropDownList drpProjectManager; /// - /// drpConstructionManager 控件。 + /// drpHSSEManager 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpConstructionManager; + protected global::FineUIPro.DropDownList drpHSSEManager; /// /// drpQAManager 控件。 @@ -528,13 +537,13 @@ namespace FineUIPro.Web.ProjectData protected global::FineUIPro.DropDownList drpQAManager; /// - /// drpHSSEManager 控件。 + /// drpConstructionManager 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpHSSEManager; + protected global::FineUIPro.DropDownList drpConstructionManager; /// /// drpDriveManager 控件。 diff --git a/SGGL/FineUIPro.Web/SysManage/UserList.aspx b/SGGL/FineUIPro.Web/SysManage/UserList.aspx index 9faf7a56..8f6074b7 100644 --- a/SGGL/FineUIPro.Web/SysManage/UserList.aspx +++ b/SGGL/FineUIPro.Web/SysManage/UserList.aspx @@ -47,7 +47,7 @@ - diff --git a/SGGL/FineUIPro.Web/SysManage/UserListEdit.aspx b/SGGL/FineUIPro.Web/SysManage/UserListEdit.aspx index e2f82681..0edd3947 100644 --- a/SGGL/FineUIPro.Web/SysManage/UserListEdit.aspx +++ b/SGGL/FineUIPro.Web/SysManage/UserListEdit.aspx @@ -84,7 +84,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/main_new0.aspx b/SGGL/FineUIPro.Web/common/main_new0.aspx index fd6141d5..a0cf9f71 100644 --- a/SGGL/FineUIPro.Web/common/main_new0.aspx +++ b/SGGL/FineUIPro.Web/common/main_new0.aspx @@ -155,28 +155,28 @@
-
2020-10-10 12:40:26
+
-
2020-10-10 12:40:26
+
-
2020-10-10 12:40:26
+
-
2020-10-10 12:40:26
+
diff --git a/SGGL/FineUIPro.Web/indexProject.aspx b/SGGL/FineUIPro.Web/indexProject.aspx index b4001e4d..e18d1426 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx +++ b/SGGL/FineUIPro.Web/indexProject.aspx @@ -20,6 +20,8 @@ + +