From df2f29c5c4edccb80904b93ac63cadb255e06c6b Mon Sep 17 00:00:00 2001 From: geh <1923421292@qq.com> Date: Mon, 21 Apr 2025 09:33:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=9A=90=E6=82=A3=E6=95=B4=E6=94=B9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SUBQHSE/BLL/Common/WordHelp.cs | 8 + ...模板)建投隐患整改通知单.doc | Bin 0 -> 36864 bytes .../HSSE/Check/RectifyNoticesAdd.aspx | 23 ++- .../HSSE/Check/RectifyNoticesAdd.aspx.cs | 187 +++++++++++++++++ .../Check/RectifyNoticesAdd.aspx.designer.cs | 82 +++++--- .../HSSE/Check/RectifyNoticesAudit.aspx | 23 ++- .../HSSE/Check/RectifyNoticesAudit.aspx.cs | 188 +++++++++++++++++ .../RectifyNoticesAudit.aspx.designer.cs | 18 ++ .../HSSE/Check/RectifyNoticesRecheck.aspx | 18 +- .../HSSE/Check/RectifyNoticesRecheck.aspx.cs | 190 +++++++++++++++++- .../RectifyNoticesRecheck.aspx.designer.cs | 18 ++ .../HSSE/Check/RectifyNoticesRectify.aspx | 23 ++- .../HSSE/Check/RectifyNoticesRectify.aspx.cs | 189 ++++++++++++++++- .../RectifyNoticesRectify.aspx.designer.cs | 18 ++ .../HSSE/Check/RectifyNoticesView.aspx | 19 ++ .../HSSE/Check/RectifyNoticesView.aspx.cs | 190 +++++++++++++++++- .../Check/RectifyNoticesView.aspx.designer.cs | 66 +++--- .../HSSE/InformedConsentFormController.cs | 49 ++++- 18 files changed, 1242 insertions(+), 67 deletions(-) create mode 100644 SUBQHSE/FineUIPro.Web/File/Word/HSSE/安全质量环保检查记录(模板)建投隐患整改通知单.doc diff --git a/SUBQHSE/BLL/Common/WordHelp.cs b/SUBQHSE/BLL/Common/WordHelp.cs index a5c67b9..fe39872 100644 --- a/SUBQHSE/BLL/Common/WordHelp.cs +++ b/SUBQHSE/BLL/Common/WordHelp.cs @@ -32,6 +32,14 @@ namespace BLL wordDoc = new Document(path); } + public Document Document + { + get + { + return wordDoc; + } + } + /// /// 添加图片 /// diff --git a/SUBQHSE/FineUIPro.Web/File/Word/HSSE/安全质量环保检查记录(模板)建投隐患整改通知单.doc b/SUBQHSE/FineUIPro.Web/File/Word/HSSE/安全质量环保检查记录(模板)建投隐患整改通知单.doc new file mode 100644 index 0000000000000000000000000000000000000000..b14dc550098f68f76580aeb7172b6fa7fd882603 GIT binary patch literal 36864 zcmeHQ2Vjj?`#*PN$}$p>1Xo-H*|J1JCP`!`LL?FyH$xUlB#05D1VyM#iS-#ZVirY> zmKrfDs7shn%AAF;Xtvu(@RKGBc?gqcFQw{|V68cS7`?rTe3W}e`4&Ty}R z+)jEixFPj>dJ{Pb_e+I9h6UB(6m=)Ke+zeWA~0giMSp;|?_QVA^TUVZ<9n@F z=liuk>^^AjKSS~9@Nx0wMd|p9-mFi&e0llvIv>6+ou^aQ z`TEG~b%p2M;~|gXyybUv<#c#EFK6Cfm(EAcm!q=&E`MeEKg-USS6zJ9<<9f_p?Y2M zQQsV|h0y|y%Ney^g*C#jhFFXdq+b2EOF)}xvk6ftA!d`0Pg|dJDQHj1&E&F4y<#Pd z{1Aoepg;-54h}E>t37HbuH+V$k;lMQ^I!SGk%BQu9oD}FSE19*l z|MY~Q^enbl^oy8~f?cwk{it5H9K0gXL~>{J&Ez|yOGh@B zbjes5`nE6)Rsw5Uz- zMtVvyDElLw4x$0njlVsfUg`p#b&#_5_UfaRS&vp9&68vxhak&=X2DVF*AjvPWt^Wr zQ=rxbb%>t`P8#AIK*tmQLHT;;8m-O6xqn{Hg4zys4~} z%h3mA=?`oKUMLP~?`e6U7^aqGXq`T_$m+IaC`M3Y#*{=PWd>4#qm(&GnQxK+esNN) zc3D~?k-@8}R3LX};R2>oVJHU8+n_e%fIz*%nh9rARf;B=7OF;zYZ8*13RUORDx;Qa zj3C$&p%~v+Z}L?1%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zAW*`GDJmm^T-5~E=qU>0-1huN2VQSi>MWQ%G%E2QENDn!UWu~BjBQk1potV!c4}X5 zs#fx5P|HIPCxNsFAXh`65qMRq!dU8W?mj%lMR*XmRaJZ+!BgV?1%{{$w2VxwUs9@D ziUh4i#*@_2sl%mx3whqDhp$(ErUYJL{M39)A3*ZH`q83C&x2C*KAWb_I=0(%o+^4e zJZRsD{7V3;sdE78OqKyub;uTYd@-qu8jrBg6jrG6z^L1WuQ&DoG zwfq`@*73BK?E}zSy+1(f;B#ubOcxg(3<~aKo6J!(3*Y$K)ct=fVZvf zX>Ck9n55GlC+W1?MmojB??Bb1)7}E{Mami=o<{Mmt_o0kIR*LWhKb6!{YK}p|S+pBcPc0-HIkK z+gjV(TG-fH;-ZwLjYFr-o#9416jH#>%dWG7r;U9lJ19pxhtA#(Ha2$N9^Gv{ZM@t& z+r-**;%K8mD;w&U)wf4_n(u(D)IhJap^?3PZ3DcLZ34ps>>`Jy0j5A}fL6V2fVKdw@y&qtKnI{BU=COSmH@5&Y5i^kP`o&v$F)S<+XEZ`N5Bc7 z6*c*Hf$jp(lC~?*4R8b80rGzdcvYLpPWbVxZ*Pq#@ zI;5&WwMl;W16p^^QvGvccxfEndmzWcYBw+LhFe^8#ki7peNwgBHc-)a(G{5g!D<` z)NbE5eTv(b8X1%dZm?3S^8b~7C@%44;u0_ML@v3wr$v{F>sELc^1<@wZk~nJsip-X<49>vYT1zMPxbwzAd`+v@{~IOne+ip0*8l(j literal 0 HcmV?d00001 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx index 8abc6b2..fa1b2b7 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx @@ -25,7 +25,7 @@ - + @@ -67,7 +67,7 @@ - @@ -116,6 +116,9 @@ + + + @@ -165,6 +168,22 @@ Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="500px"> + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs index feb987f..624f36c 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.cs @@ -5,7 +5,11 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.IO; using System.Linq; +using Aspose.Words; +using Aspose.Words.Drawing; +using Aspose.Words.Tables; namespace FineUIPro.Web.HSSE.Check { @@ -417,5 +421,188 @@ namespace FineUIPro.Web.HSSE.Check //} + /// + /// 导出 + /// + /// + /// + protected void btnPrinter_Click(object sender, EventArgs e) + { + //获取所有列表导出 + if (!string.IsNullOrEmpty(this.RectifyNoticesId)) + { + var rectifyNotices = RectifyNoticesService.GetRectifyNoticesById(RectifyNoticesId); + string CheckManIds = rectifyNotices.CheckManIds; + string CheckManNames = string.Empty; + if (CheckManIds != null) + { + string[] Ids = CheckManIds.ToString().Split(','); + foreach (string t in Ids) + { + var Name = BLL.UserService.GetUserNameByUserId(t); + if (Name != null) + { + CheckManNames += Name + ","; + } + } + } + + string DutyPersonId = rectifyNotices.DutyPersonId; + string DutyPersonName = UserService.GetUserNameByUserId(DutyPersonId); + + var dataList = (from item in Funs.DB.Check_RectifyNoticesItem + join rectify in Funs.DB.Technique_Rectify + on item.RectifyId equals rectify.RectifyId into rectifyGroup + from rectify in rectifyGroup.DefaultIfEmpty() + where item.RectifyNoticesId == RectifyNoticesId + select new + { + RectifyNoticesItemId = item.RectifyNoticesItemId, + RectifyId = rectify.RectifyName, + RectifyNoticesId = item.RectifyNoticesId, + WrongContent = item.WrongContent, + Requirement = item.Requirement, + LimitTime = item.LimitTime, + RectifyResults = item.RectifyResults, + IsRectify = item.IsRectify + }).ToList(); + + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + + initTemplatePath = "File\\Word\\HSSE\\安全质量环保检查记录(模板)建投隐患整改通知单.doc"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", RectifyNoticesId + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + + File.Copy(uploadfilepath, newUrl); + AsposeWordHelper helper = new AsposeWordHelper(); + helper.OpenTempelte(newUrl); //打开模板文件 + + + var project = + (from x in Funs.DB.Base_Project where x.ProjectId == this.CurrUser.LoginProjectId select x) + .FirstOrDefault(); + string projectName = project.ProjectName; + string remark = project.Remark; + + string[] fieldNames = + { + "projectName", "remark" + }; + + object[] fieldValues = + { + projectName, remark + }; + helper.Executefield(fieldNames, fieldValues); //域赋值 + + if (dataList.Count > 0) + { + Document doc = helper.Document; + DocumentBuilder builder = new DocumentBuilder(doc); + Table table = (Table)doc.GetChild(NodeType.Table, 1, true); // 定位第一个表格 + + int number = 1; + foreach (var item in dataList) + { + string WrongContent = item.WrongContent; + string Requirement = item.Requirement; + string LimitTime = item.LimitTime.HasValue + ? $" {item.LimitTime.Value.Year} 年 {item.LimitTime.Value.Month:D2} 月 {item.LimitTime.Value.Day:D2} 日" + : ""; + List Paths = new List(); + + var res = AttachFileService.getFileUrl(item.RectifyNoticesItemId + "#1"); + if (!string.IsNullOrEmpty(res)) + { + string[] arr = res.Split(','); + for (int i = 0; i < arr.Length; i++) + { + Paths.Add(rootPath + arr[i]); + } + } + + // 克隆模板占位行 + Row newRow = (Row)table.LastRow.Clone(true); + table.AppendChild(newRow); + + // 定位到单元格 + Cell cell = newRow.FirstCell; + + // 清空单元格所有段落 + cell.RemoveAllChildren(); + Paragraph para = new Paragraph(doc); // 显式创建段落 + cell.AppendChild(para); + builder.MoveTo(para); // 定位到段落 + + // 插入文本 + builder.Write(" 存在问题" + number.ToString() + ":" + WrongContent); + builder.Writeln(); // 换行 + builder.Write(" 整改要求:" + Requirement); + builder.Writeln(); // 换行 + builder.Write(" 整改时间:" + LimitTime + " 整改责任人:" + DutyPersonName + " 监督人:" + + CheckManNames); + builder.Writeln(); // 换行 + + // 插入多张图片(横向排列) + if (Paths.Count > 0) + { + foreach (string imgPath in Paths) + { + // 计算每张图片宽度(总宽度按单元格宽度平分) + double cellWidth = cell.CellFormat.Width; + double imgWidth = (cellWidth - 10 * (Paths.Count - 1)) / Paths.Count - 10; + + // 插入图片并调整尺寸 + Shape image = builder.InsertImage(imgPath); + image.Width = Paths.Count == 1 ? imgWidth / 2 : imgWidth; + // image.Height = image.ImageData.ImageSize.HeightPixels * (imgWidth / image.ImageData.ImageSize.WidthPixels); + image.Height = 120; + + // 图片间留间距(横向排列) + if (imgPath != Paths.Last()) + { + builder.MoveTo(cell.LastParagraph.AppendChild(new Run(doc))); + builder.Write(" "); // 插入空格分隔 + } + } + } + number++; + } + + // 删除模板中的原始占位行 + table.Rows.RemoveAt(0); + } + + + helper.SaveDoc(newUrl); //文件保存,保存为doc + + // 验证文件是否存在 + if (!File.Exists(newUrl)) + { + throw new Exception("文件不存在: " + newUrl); + } + + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", + "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + } + } } \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.designer.cs index cb3dcd2..b4fa823 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAdd.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.Check { - - - public partial class RectifyNoticesAdd { - +namespace FineUIPro.Web.HSSE.Check +{ + + + public partial class RectifyNoticesAdd + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel4 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel4; - + /// /// SimpleForm1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// hdRectifyNoticesId 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdRectifyNoticesId; - + /// /// btnSave 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// btnSubmit 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSubmit; - + /// /// txtRectifyNoticesCode 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtRectifyNoticesCode; - + /// /// drpUnitId 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpUnitId; - + /// /// drpWorkAreaId 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpWorkAreaId; - + /// /// drpCheckMan 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpCheckMan; - + /// /// txtCheckPerson 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCheckPerson; - + /// /// txtCheckedDate 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtCheckedDate; - + /// /// drpHiddenHazardType 控件。 /// @@ -146,7 +148,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpHiddenHazardType; - + /// /// Grid1 控件。 /// @@ -155,7 +157,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// toolAdd 控件。 /// @@ -164,7 +166,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar toolAdd; - + /// /// btnAdd 控件。 /// @@ -173,7 +175,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnAdd; - + /// /// drpRectifyId 控件。 /// @@ -182,7 +184,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpRectifyId; - + /// /// tWrongContent 控件。 /// @@ -191,7 +193,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox tWrongContent; - + /// /// tRequirement 控件。 /// @@ -200,7 +202,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox tRequirement; - + /// /// txtLimitTimes 控件。 /// @@ -209,7 +211,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtLimitTimes; - + /// /// del 控件。 /// @@ -218,7 +220,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.LinkButtonField del; - + /// /// drpSignPerson 控件。 /// @@ -227,7 +229,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpSignPerson; - + /// /// gvFlowOperate 控件。 /// @@ -236,7 +238,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid gvFlowOperate; - + /// /// lblPageIndex 控件。 /// @@ -245,7 +247,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblPageIndex; - + /// /// WindowAtt 控件。 /// @@ -254,5 +256,23 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnPrinter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnPrinter; } } diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx index d533cf3..435d645 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx @@ -57,7 +57,7 @@ - @@ -92,6 +92,9 @@ HeaderText="合格" HeaderTextAlign="Center" TextAlign="Center"> + + + @@ -167,6 +170,22 @@ Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="500px"> - + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.cs index 0444c71..5bd2b3b 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.cs @@ -6,6 +6,10 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; +using System.IO; +using Aspose.Words; +using Aspose.Words.Drawing; +using Aspose.Words.Tables; namespace FineUIPro.Web.HSSE.Check { @@ -315,5 +319,189 @@ namespace FineUIPro.Web.HSSE.Check } } } + + /// + /// 导出 + /// + /// + /// + protected void btnPrinter_Click(object sender, EventArgs e) + { + //获取所有列表导出 + if (!string.IsNullOrEmpty(this.RectifyNoticesId)) + { + var rectifyNotices = RectifyNoticesService.GetRectifyNoticesById(RectifyNoticesId); + string CheckManIds = rectifyNotices.CheckManIds; + string CheckManNames = string.Empty; + if (CheckManIds != null) + { + string[] Ids = CheckManIds.ToString().Split(','); + foreach (string t in Ids) + { + var Name = BLL.UserService.GetUserNameByUserId(t); + if (Name != null) + { + CheckManNames += Name + ","; + } + } + } + + string DutyPersonId = rectifyNotices.DutyPersonId; + string DutyPersonName = UserService.GetUserNameByUserId(DutyPersonId); + + var dataList = (from item in Funs.DB.Check_RectifyNoticesItem + join rectify in Funs.DB.Technique_Rectify + on item.RectifyId equals rectify.RectifyId into rectifyGroup + from rectify in rectifyGroup.DefaultIfEmpty() + where item.RectifyNoticesId == RectifyNoticesId + select new + { + RectifyNoticesItemId = item.RectifyNoticesItemId, + RectifyId = rectify.RectifyName, + RectifyNoticesId = item.RectifyNoticesId, + WrongContent = item.WrongContent, + Requirement = item.Requirement, + LimitTime = item.LimitTime, + RectifyResults = item.RectifyResults, + IsRectify = item.IsRectify + }).ToList(); + + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + + initTemplatePath = "File\\Word\\HSSE\\安全质量环保检查记录(模板)建投隐患整改通知单.doc"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", RectifyNoticesId + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + + File.Copy(uploadfilepath, newUrl); + AsposeWordHelper helper = new AsposeWordHelper(); + helper.OpenTempelte(newUrl); //打开模板文件 + + + var project = + (from x in Funs.DB.Base_Project where x.ProjectId == this.CurrUser.LoginProjectId select x) + .FirstOrDefault(); + string projectName = project.ProjectName; + string remark = project.Remark; + + string[] fieldNames = + { + "projectName", "remark" + }; + + object[] fieldValues = + { + projectName, remark + }; + helper.Executefield(fieldNames, fieldValues); //域赋值 + + if (dataList.Count > 0) + { + Document doc = helper.Document; + DocumentBuilder builder = new DocumentBuilder(doc); + Table table = (Table)doc.GetChild(NodeType.Table, 1, true); // 定位第一个表格 + + int number = 1; + foreach (var item in dataList) + { + string WrongContent = item.WrongContent; + string Requirement = item.Requirement; + string LimitTime = item.LimitTime.HasValue + ? $" {item.LimitTime.Value.Year} 年 {item.LimitTime.Value.Month:D2} 月 {item.LimitTime.Value.Day:D2} 日" + : ""; + List Paths = new List(); + + var res = AttachFileService.getFileUrl(item.RectifyNoticesItemId + "#1"); + if (!string.IsNullOrEmpty(res)) + { + string[] arr = res.Split(','); + for (int i = 0; i < arr.Length; i++) + { + Paths.Add(rootPath + arr[i]); + } + } + + // 克隆模板占位行 + Row newRow = (Row)table.LastRow.Clone(true); + table.AppendChild(newRow); + + // 定位到单元格 + Cell cell = newRow.FirstCell; + + // 清空单元格所有段落 + cell.RemoveAllChildren(); + Paragraph para = new Paragraph(doc); // 显式创建段落 + cell.AppendChild(para); + builder.MoveTo(para); // 定位到段落 + + // 插入文本 + builder.Write(" 存在问题" + number.ToString() + ":" + WrongContent); + builder.Writeln(); // 换行 + builder.Write(" 整改要求:" + Requirement); + builder.Writeln(); // 换行 + builder.Write(" 整改时间:" + LimitTime + " 整改责任人:" + DutyPersonName + " 监督人:" + + CheckManNames); + builder.Writeln(); // 换行 + + // 插入多张图片(横向排列) + if (Paths.Count > 0) + { + foreach (string imgPath in Paths) + { + // 计算每张图片宽度(总宽度按单元格宽度平分) + double cellWidth = cell.CellFormat.Width; + double imgWidth = (cellWidth - 10 * (Paths.Count - 1)) / Paths.Count - 10; + + // 插入图片并调整尺寸 + Shape image = builder.InsertImage(imgPath); + image.Width = Paths.Count == 1 ? imgWidth / 2 : imgWidth; + // image.Height = image.ImageData.ImageSize.HeightPixels * (imgWidth / image.ImageData.ImageSize.WidthPixels); + image.Height = 120; + + // 图片间留间距(横向排列) + if (imgPath != Paths.Last()) + { + builder.MoveTo(cell.LastParagraph.AppendChild(new Run(doc))); + builder.Write(" "); // 插入空格分隔 + } + } + } + number++; + } + + // 删除模板中的原始占位行 + table.Rows.RemoveAt(0); + } + + + helper.SaveDoc(newUrl); //文件保存,保存为doc + + // 验证文件是否存在 + if (!File.Exists(newUrl)) + { + throw new Exception("文件不存在: " + newUrl); + } + + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", + "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + } + } } \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.designer.cs index d1eaead..b695e14 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesAudit.aspx.designer.cs @@ -265,5 +265,23 @@ namespace FineUIPro.Web.HSSE.Check /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnPrinter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnPrinter; } } diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx index c051836..7b898da 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx @@ -58,7 +58,7 @@ @@ -176,6 +176,13 @@ + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.cs index 2e6d2a9..c005a81 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; - +using System.IO; +using System.Linq; +using Aspose.Words; +using Aspose.Words.Drawing; +using Aspose.Words.Tables; namespace FineUIPro.Web.HSSE.Check { public partial class RectifyNoticesRecheck : PageBase @@ -334,5 +338,189 @@ namespace FineUIPro.Web.HSSE.Check } this.lbCom.Hidden = !this.lbDutyPerson.Hidden; } + + + /// + /// 导出 + /// + /// + /// + protected void btnPrinter_Click(object sender, EventArgs e) + { + //获取所有列表导出 + if (!string.IsNullOrEmpty(this.RectifyNoticesId)) + { + var rectifyNotices = RectifyNoticesService.GetRectifyNoticesById(RectifyNoticesId); + string CheckManIds = rectifyNotices.CheckManIds; + string CheckManNames = string.Empty; + if (CheckManIds != null) + { + string[] Ids = CheckManIds.ToString().Split(','); + foreach (string t in Ids) + { + var Name = BLL.UserService.GetUserNameByUserId(t); + if (Name != null) + { + CheckManNames += Name + ","; + } + } + } + + string DutyPersonId = rectifyNotices.DutyPersonId; + string DutyPersonName = UserService.GetUserNameByUserId(DutyPersonId); + + var dataList = (from item in Funs.DB.Check_RectifyNoticesItem + join rectify in Funs.DB.Technique_Rectify + on item.RectifyId equals rectify.RectifyId into rectifyGroup + from rectify in rectifyGroup.DefaultIfEmpty() + where item.RectifyNoticesId == RectifyNoticesId + select new + { + RectifyNoticesItemId = item.RectifyNoticesItemId, + RectifyId = rectify.RectifyName, + RectifyNoticesId = item.RectifyNoticesId, + WrongContent = item.WrongContent, + Requirement = item.Requirement, + LimitTime = item.LimitTime, + RectifyResults = item.RectifyResults, + IsRectify = item.IsRectify + }).ToList(); + + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + + initTemplatePath = "File\\Word\\HSSE\\安全质量环保检查记录(模板)建投隐患整改通知单.doc"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", RectifyNoticesId + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + + File.Copy(uploadfilepath, newUrl); + AsposeWordHelper helper = new AsposeWordHelper(); + helper.OpenTempelte(newUrl); //打开模板文件 + + + var project = + (from x in Funs.DB.Base_Project where x.ProjectId == this.CurrUser.LoginProjectId select x) + .FirstOrDefault(); + string projectName = project.ProjectName; + string remark = project.Remark; + + string[] fieldNames = + { + "projectName", "remark" + }; + + object[] fieldValues = + { + projectName, remark + }; + helper.Executefield(fieldNames, fieldValues); //域赋值 + + if (dataList.Count > 0) + { + Document doc = helper.Document; + DocumentBuilder builder = new DocumentBuilder(doc); + Table table = (Table)doc.GetChild(NodeType.Table, 1, true); // 定位第一个表格 + + int number = 1; + foreach (var item in dataList) + { + string WrongContent = item.WrongContent; + string Requirement = item.Requirement; + string LimitTime = item.LimitTime.HasValue + ? $" {item.LimitTime.Value.Year} 年 {item.LimitTime.Value.Month:D2} 月 {item.LimitTime.Value.Day:D2} 日" + : ""; + List Paths = new List(); + + var res = AttachFileService.getFileUrl(item.RectifyNoticesItemId + "#1"); + if (!string.IsNullOrEmpty(res)) + { + string[] arr = res.Split(','); + for (int i = 0; i < arr.Length; i++) + { + Paths.Add(rootPath + arr[i]); + } + } + + // 克隆模板占位行 + Row newRow = (Row)table.LastRow.Clone(true); + table.AppendChild(newRow); + + // 定位到单元格 + Cell cell = newRow.FirstCell; + + // 清空单元格所有段落 + cell.RemoveAllChildren(); + Paragraph para = new Paragraph(doc); // 显式创建段落 + cell.AppendChild(para); + builder.MoveTo(para); // 定位到段落 + + // 插入文本 + builder.Write(" 存在问题" + number.ToString() + ":" + WrongContent); + builder.Writeln(); // 换行 + builder.Write(" 整改要求:" + Requirement); + builder.Writeln(); // 换行 + builder.Write(" 整改时间:" + LimitTime + " 整改责任人:" + DutyPersonName + " 监督人:" + + CheckManNames); + builder.Writeln(); // 换行 + + // 插入多张图片(横向排列) + if (Paths.Count > 0) + { + foreach (string imgPath in Paths) + { + // 计算每张图片宽度(总宽度按单元格宽度平分) + double cellWidth = cell.CellFormat.Width; + double imgWidth = (cellWidth - 10 * (Paths.Count - 1)) / Paths.Count - 10; + + // 插入图片并调整尺寸 + Shape image = builder.InsertImage(imgPath); + image.Width = Paths.Count == 1 ? imgWidth / 2 : imgWidth; + // image.Height = image.ImageData.ImageSize.HeightPixels * (imgWidth / image.ImageData.ImageSize.WidthPixels); + image.Height = 120; + + // 图片间留间距(横向排列) + if (imgPath != Paths.Last()) + { + builder.MoveTo(cell.LastParagraph.AppendChild(new Run(doc))); + builder.Write(" "); // 插入空格分隔 + } + } + } + number++; + } + + // 删除模板中的原始占位行 + table.Rows.RemoveAt(0); + } + + + helper.SaveDoc(newUrl); //文件保存,保存为doc + + // 验证文件是否存在 + if (!File.Exists(newUrl)) + { + throw new Exception("文件不存在: " + newUrl); + } + + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", + "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + } } } \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.designer.cs index 16142db..087d7f4 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRecheck.aspx.designer.cs @@ -283,5 +283,23 @@ namespace FineUIPro.Web.HSSE.Check /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnPrinter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnPrinter; } } diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx index 2bf3850..79092ce 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx @@ -59,7 +59,7 @@ @@ -100,6 +100,9 @@ + + + @@ -149,6 +152,22 @@ Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="500px"> - + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.cs index a6d2d3d..e0678b4 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.cs @@ -6,7 +6,11 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; - +using System.IO; +using System.Linq; +using Aspose.Words; +using Aspose.Words.Drawing; +using Aspose.Words.Tables; namespace FineUIPro.Web.HSSE.Check { public partial class RectifyNoticesRectify : PageBase @@ -273,5 +277,188 @@ namespace FineUIPro.Web.HSSE.Check } } #endregion + + /// + /// 导出 + /// + /// + /// + protected void btnPrinter_Click(object sender, EventArgs e) + { + //获取所有列表导出 + if (!string.IsNullOrEmpty(this.RectifyNoticesId)) + { + var rectifyNotices = RectifyNoticesService.GetRectifyNoticesById(RectifyNoticesId); + string CheckManIds = rectifyNotices.CheckManIds; + string CheckManNames = string.Empty; + if (CheckManIds != null) + { + string[] Ids = CheckManIds.ToString().Split(','); + foreach (string t in Ids) + { + var Name = BLL.UserService.GetUserNameByUserId(t); + if (Name != null) + { + CheckManNames += Name + ","; + } + } + } + + string DutyPersonId = rectifyNotices.DutyPersonId; + string DutyPersonName = UserService.GetUserNameByUserId(DutyPersonId); + + var dataList = (from item in Funs.DB.Check_RectifyNoticesItem + join rectify in Funs.DB.Technique_Rectify + on item.RectifyId equals rectify.RectifyId into rectifyGroup + from rectify in rectifyGroup.DefaultIfEmpty() + where item.RectifyNoticesId == RectifyNoticesId + select new + { + RectifyNoticesItemId = item.RectifyNoticesItemId, + RectifyId = rectify.RectifyName, + RectifyNoticesId = item.RectifyNoticesId, + WrongContent = item.WrongContent, + Requirement = item.Requirement, + LimitTime = item.LimitTime, + RectifyResults = item.RectifyResults, + IsRectify = item.IsRectify + }).ToList(); + + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + + initTemplatePath = "File\\Word\\HSSE\\安全质量环保检查记录(模板)建投隐患整改通知单.doc"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", RectifyNoticesId + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + + File.Copy(uploadfilepath, newUrl); + AsposeWordHelper helper = new AsposeWordHelper(); + helper.OpenTempelte(newUrl); //打开模板文件 + + + var project = + (from x in Funs.DB.Base_Project where x.ProjectId == this.CurrUser.LoginProjectId select x) + .FirstOrDefault(); + string projectName = project.ProjectName; + string remark = project.Remark; + + string[] fieldNames = + { + "projectName", "remark" + }; + + object[] fieldValues = + { + projectName, remark + }; + helper.Executefield(fieldNames, fieldValues); //域赋值 + + if (dataList.Count > 0) + { + Document doc = helper.Document; + DocumentBuilder builder = new DocumentBuilder(doc); + Table table = (Table)doc.GetChild(NodeType.Table, 1, true); // 定位第一个表格 + + int number = 1; + foreach (var item in dataList) + { + string WrongContent = item.WrongContent; + string Requirement = item.Requirement; + string LimitTime = item.LimitTime.HasValue + ? $" {item.LimitTime.Value.Year} 年 {item.LimitTime.Value.Month:D2} 月 {item.LimitTime.Value.Day:D2} 日" + : ""; + List Paths = new List(); + + var res = AttachFileService.getFileUrl(item.RectifyNoticesItemId + "#1"); + if (!string.IsNullOrEmpty(res)) + { + string[] arr = res.Split(','); + for (int i = 0; i < arr.Length; i++) + { + Paths.Add(rootPath + arr[i]); + } + } + + // 克隆模板占位行 + Row newRow = (Row)table.LastRow.Clone(true); + table.AppendChild(newRow); + + // 定位到单元格 + Cell cell = newRow.FirstCell; + + // 清空单元格所有段落 + cell.RemoveAllChildren(); + Paragraph para = new Paragraph(doc); // 显式创建段落 + cell.AppendChild(para); + builder.MoveTo(para); // 定位到段落 + + // 插入文本 + builder.Write(" 存在问题" + number.ToString() + ":" + WrongContent); + builder.Writeln(); // 换行 + builder.Write(" 整改要求:" + Requirement); + builder.Writeln(); // 换行 + builder.Write(" 整改时间:" + LimitTime + " 整改责任人:" + DutyPersonName + " 监督人:" + + CheckManNames); + builder.Writeln(); // 换行 + + // 插入多张图片(横向排列) + if (Paths.Count > 0) + { + foreach (string imgPath in Paths) + { + // 计算每张图片宽度(总宽度按单元格宽度平分) + double cellWidth = cell.CellFormat.Width; + double imgWidth = (cellWidth - 10 * (Paths.Count - 1)) / Paths.Count - 10; + + // 插入图片并调整尺寸 + Shape image = builder.InsertImage(imgPath); + image.Width = Paths.Count == 1 ? imgWidth / 2 : imgWidth; + // image.Height = image.ImageData.ImageSize.HeightPixels * (imgWidth / image.ImageData.ImageSize.WidthPixels); + image.Height = 120; + + // 图片间留间距(横向排列) + if (imgPath != Paths.Last()) + { + builder.MoveTo(cell.LastParagraph.AppendChild(new Run(doc))); + builder.Write(" "); // 插入空格分隔 + } + } + } + number++; + } + + // 删除模板中的原始占位行 + table.Rows.RemoveAt(0); + } + + + helper.SaveDoc(newUrl); //文件保存,保存为doc + + // 验证文件是否存在 + if (!File.Exists(newUrl)) + { + throw new Exception("文件不存在: " + newUrl); + } + + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", + "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + } } } \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.designer.cs index 4f9d498..044507e 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesRectify.aspx.designer.cs @@ -211,5 +211,23 @@ namespace FineUIPro.Web.HSSE.Check /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnPrinter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnPrinter; } } diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx index a89a3ed..2084a9e 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx @@ -94,6 +94,9 @@ HeaderText="合格" HeaderTextAlign="Center" TextAlign="Center"> + + + @@ -135,6 +138,22 @@ Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" Height="500px"> + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.cs index 1ece950..5fe685d 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.cs @@ -3,7 +3,11 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; - +using System.IO; +using System.Linq; +using Aspose.Words; +using Aspose.Words.Drawing; +using Aspose.Words.Tables; namespace FineUIPro.Web.HSSE.Check { public partial class RectifyNoticesView1 : PageBase @@ -120,5 +124,189 @@ namespace FineUIPro.Web.HSSE.Check } return url; } + + + /// + /// 导出 + /// + /// + /// + protected void btnPrinter_Click(object sender, EventArgs e) + { + //获取所有列表导出 + if (!string.IsNullOrEmpty(this.RectifyNoticesId)) + { + var rectifyNotices = RectifyNoticesService.GetRectifyNoticesById(RectifyNoticesId); + string CheckManIds = rectifyNotices.CheckManIds; + string CheckManNames = string.Empty; + if (CheckManIds != null) + { + string[] Ids = CheckManIds.ToString().Split(','); + foreach (string t in Ids) + { + var Name = BLL.UserService.GetUserNameByUserId(t); + if (Name != null) + { + CheckManNames += Name + ","; + } + } + } + + string DutyPersonId = rectifyNotices.DutyPersonId; + string DutyPersonName = UserService.GetUserNameByUserId(DutyPersonId); + + var dataList = (from item in Funs.DB.Check_RectifyNoticesItem + join rectify in Funs.DB.Technique_Rectify + on item.RectifyId equals rectify.RectifyId into rectifyGroup + from rectify in rectifyGroup.DefaultIfEmpty() + where item.RectifyNoticesId == RectifyNoticesId + select new + { + RectifyNoticesItemId = item.RectifyNoticesItemId, + RectifyId = rectify.RectifyName, + RectifyNoticesId = item.RectifyNoticesId, + WrongContent = item.WrongContent, + Requirement = item.Requirement, + LimitTime = item.LimitTime, + RectifyResults = item.RectifyResults, + IsRectify = item.IsRectify + }).ToList(); + + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + + initTemplatePath = "File\\Word\\HSSE\\安全质量环保检查记录(模板)建投隐患整改通知单.doc"; + uploadfilepath = rootPath + initTemplatePath; + newUrl = uploadfilepath.Replace(".doc", RectifyNoticesId + ".doc"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + + File.Copy(uploadfilepath, newUrl); + AsposeWordHelper helper = new AsposeWordHelper(); + helper.OpenTempelte(newUrl); //打开模板文件 + + + var project = + (from x in Funs.DB.Base_Project where x.ProjectId == this.CurrUser.LoginProjectId select x) + .FirstOrDefault(); + string projectName = project.ProjectName; + string remark = project.Remark; + + string[] fieldNames = + { + "projectName", "remark" + }; + + object[] fieldValues = + { + projectName, remark + }; + helper.Executefield(fieldNames, fieldValues); //域赋值 + + if (dataList.Count > 0) + { + Document doc = helper.Document; + DocumentBuilder builder = new DocumentBuilder(doc); + Table table = (Table)doc.GetChild(NodeType.Table, 1, true); // 定位第一个表格 + + int number = 1; + foreach (var item in dataList) + { + string WrongContent = item.WrongContent; + string Requirement = item.Requirement; + string LimitTime = item.LimitTime.HasValue + ? $" {item.LimitTime.Value.Year} 年 {item.LimitTime.Value.Month:D2} 月 {item.LimitTime.Value.Day:D2} 日" + : ""; + List Paths = new List(); + + var res = AttachFileService.getFileUrl(item.RectifyNoticesItemId + "#1"); + if (!string.IsNullOrEmpty(res)) + { + string[] arr = res.Split(','); + for (int i = 0; i < arr.Length; i++) + { + Paths.Add(rootPath + arr[i]); + } + } + + // 克隆模板占位行 + Row newRow = (Row)table.LastRow.Clone(true); + table.AppendChild(newRow); + + // 定位到单元格 + Cell cell = newRow.FirstCell; + + // 清空单元格所有段落 + cell.RemoveAllChildren(); + Paragraph para = new Paragraph(doc); // 显式创建段落 + cell.AppendChild(para); + builder.MoveTo(para); // 定位到段落 + + // 插入文本 + builder.Write(" 存在问题" + number.ToString() + ":" + WrongContent); + builder.Writeln(); // 换行 + builder.Write(" 整改要求:" + Requirement); + builder.Writeln(); // 换行 + builder.Write(" 整改时间:" + LimitTime + " 整改责任人:" + DutyPersonName + " 监督人:" + + CheckManNames); + builder.Writeln(); // 换行 + + // 插入多张图片(横向排列) + if (Paths.Count > 0) + { + foreach (string imgPath in Paths) + { + // 计算每张图片宽度(总宽度按单元格宽度平分) + double cellWidth = cell.CellFormat.Width; + double imgWidth = (cellWidth - 10 * (Paths.Count - 1)) / Paths.Count - 10; + + // 插入图片并调整尺寸 + Shape image = builder.InsertImage(imgPath); + image.Width = Paths.Count == 1 ? imgWidth / 2 : imgWidth; + // image.Height = image.ImageData.ImageSize.HeightPixels * (imgWidth / image.ImageData.ImageSize.WidthPixels); + image.Height = 120; + + // 图片间留间距(横向排列) + if (imgPath != Paths.Last()) + { + builder.MoveTo(cell.LastParagraph.AppendChild(new Run(doc))); + builder.Write(" "); // 插入空格分隔 + } + } + } + number++; + } + + // 删除模板中的原始占位行 + table.Rows.RemoveAt(0); + } + + + helper.SaveDoc(newUrl); //文件保存,保存为doc + + // 验证文件是否存在 + if (!File.Exists(newUrl)) + { + throw new Exception("文件不存在: " + newUrl); + } + + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", + "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + } } } \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.designer.cs index 25f3236..3c88829 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/Check/RectifyNoticesView.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.Check { - - - public partial class RectifyNoticesView1 { - +namespace FineUIPro.Web.HSSE.Check +{ + + + public partial class RectifyNoticesView1 + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel4 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel4; - + /// /// SimpleForm1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// txtProjectName 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtProjectName; - + /// /// txtRectifyNoticesCode 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtRectifyNoticesCode; - + /// /// txtUnitId 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtUnitId; - + /// /// txtWorkAreaId 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWorkAreaId; - + /// /// txtCheckPersonId 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCheckPersonId; - + /// /// txtCheckPerson 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCheckPerson; - + /// /// txtCheckedDate 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCheckedDate; - + /// /// drpHiddenHazardType 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox drpHiddenHazardType; - + /// /// Grid1 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Label1 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label1; - + /// /// lbImageUrl 控件。 /// @@ -146,7 +148,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lbImageUrl; - + /// /// Label2 控件。 /// @@ -155,7 +157,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label2; - + /// /// gvFlowOperate 控件。 /// @@ -164,7 +166,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid gvFlowOperate; - + /// /// lblPageIndex 控件。 /// @@ -173,7 +175,7 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblPageIndex; - + /// /// WindowAtt 控件。 /// @@ -182,5 +184,23 @@ namespace FineUIPro.Web.HSSE.Check { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnPrinter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnPrinter; } } diff --git a/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs b/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs index ef2f606..3f1db27 100644 --- a/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs +++ b/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs @@ -71,7 +71,7 @@ namespace WebAPI.Controllers.HSSE /// /// [HttpPost] - public Model.ResponeData updateSignTime(string PersonId, DateTime? newSignTime = null) + public Model.ResponeData updateSignTime([FromBody] Item item) { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { @@ -79,11 +79,44 @@ namespace WebAPI.Controllers.HSSE try { // 查找要修改的记录 - var person = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == PersonId); + var person = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == item.PersonId); if (person != null) { - person.SignTime = newSignTime.HasValue ? newSignTime.Value : DateTime.Now; // 更新签字时间 + person.SignTime = item.newSignTime.HasValue ? item.newSignTime.Value : DateTime.Now; // 更新签字时间 db.SubmitChanges(); + + Model.ToDoItem toDoItem = new Model.ToDoItem + { + MenuId = Const.PersonListMenuId, + DataId = item.PersonId + "_1", + UrlStr = item.AttachUrl1, + }; + if (!string.IsNullOrEmpty(item.AttachUrl1)) + { + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } + + toDoItem.DataId = item.PersonId + "_2"; + toDoItem.UrlStr = item.AttachUrl2; + if (!string.IsNullOrEmpty(item.AttachUrl2)) + { + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } + + toDoItem.DataId = item.PersonId + "_3"; + toDoItem.UrlStr = item.AttachUrl3; + if (!string.IsNullOrEmpty(item.AttachUrl3)) + { + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } + + toDoItem.DataId = item.PersonId + "_4"; + toDoItem.UrlStr = item.AttachUrl4; + if (!string.IsNullOrEmpty(item.AttachUrl4)) + { + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } + responeData.code = 1; responeData.message = "保存成功。"; } @@ -100,4 +133,14 @@ namespace WebAPI.Controllers.HSSE #endregion } + + public class Item + { + public string PersonId { get; set; } + public string AttachUrl1 { get; set; } + public string AttachUrl2 { get; set; } + public string AttachUrl3 { get; set; } + public string AttachUrl4 { get; set; } + public DateTime? newSignTime { get; set; } + } } \ No newline at end of file From 594c85b083c651efc7d482cda9535882a513a7f9 Mon Sep 17 00:00:00 2001 From: geh <1923421292@qq.com> Date: Mon, 21 Apr 2025 17:44:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E9=A1=B9=E7=9B=AE=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CQMS/Check/JointCheckChartStatistics.aspx | 124 ++++++++++-------- .../Check/JointCheckChartStatistics.aspx.cs | 46 ++++++- ...JointCheckChartStatistics.aspx.designer.cs | 45 +++++++ 3 files changed, 161 insertions(+), 54 deletions(-) diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Check/JointCheckChartStatistics.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Check/JointCheckChartStatistics.aspx index c450aae..d55d605 100644 --- a/SUBQHSE/FineUIPro.Web/CQMS/Check/JointCheckChartStatistics.aspx +++ b/SUBQHSE/FineUIPro.Web/CQMS/Check/JointCheckChartStatistics.aspx @@ -1,5 +1,6 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JointCheckChartStatistics.aspx.cs" Inherits="FineUIPro.Web.CQMS.Check.JointCheckChartStatistics" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> <%@ Register Src="~/Controls/ChartControl.ascx" TagName="ChartControl" TagPrefix="uc1" %> @@ -12,58 +13,77 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
-
-
-
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+