diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 26ce9b36..98079fd0 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -310,6 +310,7 @@ + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index e6c00786..55dd6399 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -4188,7 +4188,7 @@ namespace BLL public const string MajorPlanApprovalMenuId = "fd116c94-714b-4b92-a3c9-cc83d358e2b3"; /// - /// 设计交底管理 + /// 施工技术交底管理 /// public const string ConTechnologyDisclosureMenuId = "A16CFA9D-2783-4573-95F9-EBA2B682B7EA"; diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index b2715e7a..18bf3752 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -95,8 +95,11 @@ namespace BLL /// public static string CNCECPath { - get; - set; + get + { + var path = BLL.ServerService.GetQHSEUrl(); + return path; + } } public static string SGGLUrl { diff --git a/SGGL/BLL/DCGL/ServerCheck/DCGLCheckNoticeItemService.cs b/SGGL/BLL/DCGL/ServerCheck/DCGLCheckNoticeItemService.cs new file mode 100644 index 00000000..31313172 --- /dev/null +++ b/SGGL/BLL/DCGL/ServerCheck/DCGLCheckNoticeItemService.cs @@ -0,0 +1,39 @@ +using Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 督查检查整改明细表 + /// + public static class DCGLCheckNoticeItemService + { + /// + /// 根据主键获取督查检查整改明细信息 + /// + /// + /// + public static Model.DCGL_Check_CheckInfo_TableNoticeItem GetCheckNoticeItemByCheckNoticeItemId(string checkNoticeItemId) + { + return Funs.DB.DCGL_Check_CheckInfo_TableNoticeItem.FirstOrDefault(e => e.ID == checkNoticeItemId); + } + + /// + /// 添加督查检查整改明细信息 + /// + /// + public static void UpdateCheckNoticeItem(Model.DCGL_Check_CheckInfo_TableNoticeItem CheckNoticeItem) + { + var newCheckNoticeItem = Funs.DB.DCGL_Check_CheckInfo_TableNoticeItem.FirstOrDefault(x => x.ID == CheckNoticeItem.ID); + if (newCheckNoticeItem != null) + { + newCheckNoticeItem.Situation = CheckNoticeItem.Situation; + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/OpenService/FileInsertService.cs b/SGGL/BLL/OpenService/FileInsertService.cs index 5331491e..2594188f 100644 --- a/SGGL/BLL/OpenService/FileInsertService.cs +++ b/SGGL/BLL/OpenService/FileInsertService.cs @@ -6,11 +6,51 @@ using System.Collections; using System.IO; using System.Web; using System.Text.RegularExpressions; +using System.Net; namespace BLL { public static class FileInsertService { + /// + /// 获取服务器图片转byte + /// + /// + /// + /// + public static List FilePathTransStream(string fileHost, string attachUrl) + { + List bytes = new List(); + var strs = attachUrl.Trim().Split(','); + + try + { + foreach (var fileUrl in strs) + { + string filepath = $"{fileHost}{fileUrl}"; + // 创建WebClient实例 + using (WebClient webClient = new WebClient()) + { + // 下载图片并保存到内存流 + using (MemoryStream ms = new MemoryStream(webClient.DownloadData(filepath))) + { + // 将MemoryStream转换为byte数组 + byte[] imageBytes = ms.ToArray(); + bytes.Add(imageBytes); + //// 使用byte数组(例如,保存到文件或进行其他处理) + //File.WriteAllBytes("localImage.jpg", imageBytes); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine("Error: " + ex.Message); + } + return bytes; + } + + /// /// 获取附件数据流类 /// @@ -45,7 +85,6 @@ namespace BLL } } - /// /// 获取多附件数据流类 /// @@ -63,7 +102,6 @@ namespace BLL { if (strs.Count() > i) { - //string physicalpath = Funs.AttachRootPath; string physicalpath = Funs.RootPath; string fpath = strs[i]; string fullPath = physicalpath + fpath; @@ -107,7 +145,6 @@ namespace BLL } } - /// /// 数据和附件插入到多附件表 /// @@ -149,5 +186,45 @@ namespace BLL } } } + + + /// + /// 数据和附件插入到多附件表【不存实际文件,只存地址】 + /// + public static void InsertAttachFileRecord(string attachFileId, string dataId, string attachSource, string attachUrl) + { + var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.AttachFileId == attachFileId); + if (getAtt != null) + { + Funs.DB.AttachFile.DeleteOnSubmit(getAtt); + Funs.DB.SubmitChanges(); + } + //多附件 + var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId); + if (attachFile == null && !string.IsNullOrEmpty(attachSource)) + { + Model.AttachFile newAttachFile = new Model.AttachFile + { + AttachFileId = attachFileId, + ToKeyId = dataId, + AttachSource = attachSource, + AttachUrl = attachUrl + }; + Funs.DB.AttachFile.InsertOnSubmit(newAttachFile); + Funs.DB.SubmitChanges(); + } + else + { + if (attachFile.AttachUrl != attachUrl) + { + ///删除附件文件 + BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, attachFile.AttachUrl); + attachFile.AttachSource = attachSource; + attachFile.AttachUrl = attachUrl; + Funs.DB.SubmitChanges(); + } + } + } + } } diff --git a/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs b/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs index e0ffeee7..4b2af579 100644 --- a/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs +++ b/SGGL/BLL/PZHGL/GJSX/GJSXMonitorService.cs @@ -24,11 +24,11 @@ namespace BLL //public static Model.SGGLDB db = Funs.DB; /// - /// 关键事项通知提醒责任人 + /// 关键事项通知提醒责任人、抄送人 /// - /// + /// /// - public static void GJSXNoticeSendEmail(string userId, string gjsxId) + public static void GJSXNoticeSendEmail(List userIds, string gjsxId) { string strSql = $@"select DATEDIFF(DAY, CompleteDate, isnull(CloseDate,getdate())) AS DateDiffDays @@ -87,17 +87,28 @@ namespace BLL }).ToList(); var gItem = lstOverdue.FirstOrDefault(); - var user = UserService.GetUserByUserId(userId); - if (gItem != null && !string.IsNullOrWhiteSpace(user.Email)) + if (gItem != null) { - MailMessage mail = new MailMessage(); - //邮件主题 - mail.Subject = $"你有新的关键事项了——{gItem.ProjectName}"; - mail.To.Add(user.Email); - //mail.To.Add("test@test.com"); - mail.IsBodyHtml = true;//确保邮件正文被当作HTML解析 - //邮件正文 - string bodyStr = $@" + foreach (var userId in userIds) + { + var user = UserService.GetUserByUserId(userId); + if (!string.IsNullOrWhiteSpace(user.Email)) + { + MailMessage mail = new MailMessage(); + //邮件主题 + if (userId == gItem.User_AcceptanceUserId) + { + mail.Subject = $"你有新的关键事项了——{gItem.ProjectName}"; + } + else + { + mail.Subject = $"有新的关键事项抄送你了——{gItem.ProjectName}"; + } + mail.To.Add(user.Email); + //mail.To.Add("test@test.com"); + mail.IsBodyHtml = true;//确保邮件正文被当作HTML解析 + //邮件正文 + string bodyStr = $@" @@ -57,7 +82,7 @@ @@ -74,10 +99,16 @@ - + + + + + <%-- - + --%> @@ -108,12 +139,19 @@ - + --%> + + + + +