20260227 交工资料

This commit is contained in:
毕文静 2026-02-27 10:47:20 +08:00
parent d45de18cc5
commit 727f58637c
27 changed files with 607 additions and 33 deletions

View File

@ -2435,5 +2435,27 @@ namespace BLL
/// </summary>
public static string TempFileTemplate = "TempFileTemplate";
#endregion
#region
/// <summary>
/// 封面导出模板
/// </summary>
public const string JGZL_CoverUrl = "File\\Word\\JGZL\\封面导出模板.docx";
/// <summary>
/// 交工技术文件目录导出模板
/// </summary>
public const string JGZL_FileDirectoryUrl = "File\\Word\\JGZL\\交工技术文件目录导出模板.docx";
/// <summary>
/// 交工技术文件说明导出模板
/// </summary>
public const string JGZL_DocumentDescriptionUrl = "File\\Word\\JGZL\\交工技术文件说明导出模板.docx";
/// <summary>
/// 特种设备安装改造维修告知书导出模板
/// </summary>
public const string JGZL_SpecialEquipmentMaintenanceUrl = "File\\Word\\JGZL\\特种设备安装改造维修告知书导出模板.docx";
#endregion
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" DoublePass="true" ReportInfo.Created="02/09/2026 11:02:02" ReportInfo.Modified="02/09/2026 13:49:05" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" DoublePass="true" ReportInfo.Created="02/09/2026 11:02:02" ReportInfo.Modified="02/26/2026 15:04:50" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@ -51,7 +51,7 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFqbGkipdVq/cAHUDe+HEQuA==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFU9faa5/HBb4XUQfiMoZgBg==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="SerialNumber" DataType="System.String" PropName="attach_image_id"/>
<Column Name="FileCode" DataType="System.String" PropName="image_series"/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/26/2026 11:18:50" ReportInfo.Modified="02/10/2026 16:28:07" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/26/2026 11:18:50" ReportInfo.Modified="02/26/2026 17:33:10" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@ -42,7 +42,7 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFUG9g69GfVA9m0SQU5+zU8g==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFjJpU0A3x3EO6TXRHdHMnuw==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="Num" DataType="System.String" PropName="attach_image_id"/>
<Column Name="PipelineCode" DataType="System.String" PropName="image_series"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/23/2026 17:12:17" ReportInfo.Modified="02/10/2026 10:22:53" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/23/2026 17:12:17" ReportInfo.Modified="02/26/2026 17:32:54" ReportInfo.CreatorVersion="2017.1.16.0">
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFO1XyJKOqNpCSM+qdDrd3FQ==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFg1qRjSswFxgpEVsc1cd7Ug==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="CertificateCode" DataType="System.String" PropName="attach_image_id"/>
<Column Name="EngineeringName" DataType="System.String" PropName="image_series"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/22/2025 14:15:28" ReportInfo.Modified="02/08/2026 11:01:59" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/22/2025 14:15:28" ReportInfo.Modified="02/26/2026 16:10:47" ReportInfo.CreatorVersion="2017.1.16.0">
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFTMfW2RuqdVwibFML3uCXMA==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFUUtMlb6iEYJqi3Lj2icLFQ==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="MaintenanceCode" DataType="System.String" PropName="attach_image_id"/>
<Column Name="ConUnit" DataType="System.String" PropName="image_series"/>

View File

@ -0,0 +1,14 @@
SH/T 3503 -- J103
交工技术文件目录
工程名称:
单位工程名称:管道安装工程
序号
文件编号
文件名称
页次
编制人:
日期: 年 月 日
审核人:
日期: 年 月 日

View File

@ -0,0 +1,26 @@
SH/T 3503 -- J104
交工技术文件说明
工程名称:
一、工程概况:
二、编制依据
三、参建单位
建设单位:
设计单位:
检测单位:
施工单位:
四、案卷构成及本卷册主要内容
五、编制份数
编制人:
日期: 年 月 日
审核人:
日期: 年 月 日

View File

@ -0,0 +1,26 @@
SH/T 3503 -- J101A
封 面
卷号:
石油化工建设工程项目交工技术文件
工程名称:
卷 名:管道安装工程卷
建设单位 监理单位 施工单位
(项目部章) (项目部章) (项目部章)
项目经理: 项目总监: 项目经理:
年 月 日 年 月 日 年 月 日

View File

@ -0,0 +1,53 @@
特种设备安装改造维修告知书
施工单位: (公章) 告知书编号:
设备名称
型号(参数)
设备代码
制造编号
设备制造
单位全称
制造许可证
编号
设备地点
施工日期
施工单位全称
施工类别
许可证编号
许可证有效期
联系人
电话
传真
地址
邮编
使用单位全称
联系人
电话
传真
地址
邮编
注意事项 1告知单按每台安装、改造、维修设备区分分别各填两份。
2告知单编号为制造单位设备编号+施工单位施工工号+年份4位
3施工类别按安装、改造、维修分别填写。

View File

@ -59,6 +59,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Aspose.Words, Version=21.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.21.8.0\lib\net461\Aspose.Words.dll</HintPath>
</Reference>
<Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>

View File

@ -47,6 +47,8 @@
System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(WelderIsSync));
LoadServiceData.Start();
//Aspose21.8.0破解注入
new Aspose.Words.License().SetLicense(new System.IO.MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4yMDA2MDIwMTI2MzM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+OTM2ZTVmZDEtODY2Mi00YWJmLTk1YmQtYzhkYzBmNTNhZmE2PC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjEwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT5wSkpjQndRdnYxV1NxZ1kyOHFJYUFKSysvTFFVWWRrQ2x5THE2RUNLU0xDQ3dMNkEwMkJFTnh5L3JzQ1V3UExXbjV2bTl0TDRQRXE1aFAzY2s0WnhEejFiK1JIWTBuQkh1SEhBY01TL1BSeEJES0NGbWg1QVFZRTlrT0FxSzM5NVBSWmJRSGowOUNGTElVUzBMdnRmVkp5cUhjblJvU3dPQnVqT1oyeDc4WFE9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
}
private void WelderIsSync()

View File

@ -42,6 +42,9 @@
<f:TextBox ID="txtCode" runat="server" Label="卷号" LabelAlign="Right"></f:TextBox>
<f:Button ID="btnPrint" Text="封面打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出Word" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -1,13 +1,11 @@
using BLL;
using Aspose.Words;
using BLL;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
namespace FineUIPro.Web.JGZL
{
@ -99,7 +97,7 @@ namespace FineUIPro.Web.JGZL
{
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID));
}
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
@ -166,5 +164,73 @@ namespace FineUIPro.Web.JGZL
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = string.Empty;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
string projectId = this.tvControlItem.SelectedNodeID;
if (!string.IsNullOrEmpty(projectId))
{
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
{
initTemplatePath = Const.JGZL_CoverUrl;
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace("封面导出模板", "封面");
if (File.Exists(newUrl))
{
File.Delete(newUrl);
}
File.Copy(uploadfilepath, newUrl);
Document doc = new Aspose.Words.Document(uploadfilepath);
Bookmark code = doc.Range.Bookmarks["Code"];
if (code != null)
{
code.Text = this.txtCode.Text.Trim();
}
Bookmark projectName = doc.Range.Bookmarks["ProjectName"];
if (projectName != null)
{
projectName.Text = BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName;
}
doc.Save(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);
}
else
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}
}

View File

@ -122,6 +122,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Grid1 控件。
/// </summary>

View File

@ -44,6 +44,9 @@
</f:Button>
<f:Button ID="btnPrint" Text="交工技术文件说明打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出Word" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@ -80,7 +83,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCopiesNum" runat="server" Label="编制份数" LabelAlign="Right" LabelWidth="110px" MaxLength="500" ></f:TextBox>
<f:TextBox ID="txtCopiesNum" runat="server" Label="编制份数" LabelAlign="Right" LabelWidth="110px" MaxLength="500"></f:TextBox>
</Items>
</f:FormRow>
</Rows>

View File

@ -10,6 +10,7 @@ using System.Web.UI.WebControls;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.IO;
using Microsoft.SqlServer.Server;
using Aspose.Words;
namespace FineUIPro.Web.JGZL
{
@ -41,7 +42,7 @@ namespace FineUIPro.Web.JGZL
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
{
this.drpProjectId.DataTextField = "ProjectCode";
this.drpProjectId.DataValueField = "ProjectId";
this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1");
@ -144,7 +145,7 @@ namespace FineUIPro.Web.JGZL
{
this.DocumentDescriptionId = report.DocumentDescriptionId;
this.txtProjectOverview.Text = report.ProjectOverview;
if(!string.IsNullOrEmpty(report.ConstructionUnit))
if (!string.IsNullOrEmpty(report.ConstructionUnit))
{
this.txtConstructionUnit.Text = report.ConstructionUnit;
}
@ -152,7 +153,7 @@ namespace FineUIPro.Web.JGZL
{
this.txtConstructionUnit.Text = "浙江石油化工有限公司";
}
this.txtDesigningUnit.Text = report.DesigningUnit;
this.txtTestingUnit.Text = report.TestingUnit;
if (!string.IsNullOrEmpty(report.ConstructionCompany))
@ -216,7 +217,7 @@ namespace FineUIPro.Web.JGZL
newDocumentDescription.DesigningUnit = this.txtDesigningUnit.Text;
newDocumentDescription.TestingUnit = this.txtTestingUnit.Text;
newDocumentDescription.ConstructionCompany = this.txtConstructionCompany.Text;
newDocumentDescription.CompilationBasis=this.txtCompilationBasis.Text;
newDocumentDescription.CompilationBasis = this.txtCompilationBasis.Text;
newDocumentDescription.MainContent = this.txtMainContent.Text;
newDocumentDescription.CopiesNum = this.txtCopiesNum.Text;
if (!string.IsNullOrEmpty(this.DocumentDescriptionId))
@ -286,5 +287,98 @@ namespace FineUIPro.Web.JGZL
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = string.Empty;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
string projectId = this.tvControlItem.SelectedNodeID;
if (!string.IsNullOrEmpty(projectId))
{
initTemplatePath = Const.JGZL_DocumentDescriptionUrl;
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace("交工技术文件说明导出模板", "交工技术文件说明");
if (File.Exists(newUrl))
{
File.Delete(newUrl);
}
File.Copy(uploadfilepath, newUrl);
Document doc = new Aspose.Words.Document(uploadfilepath);
Bookmark projectName = doc.Range.Bookmarks["ProjectName"];
if (projectName != null)
{
projectName.Text = BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName;
}
Bookmark projectOverview = doc.Range.Bookmarks["ProjectOverview"];
if (projectOverview != null)
{
projectOverview.Text = this.txtProjectOverview.Text;
}
Bookmark compilationBasis = doc.Range.Bookmarks["CompilationBasis"];
if (compilationBasis != null)
{
compilationBasis.Text = this.txtCompilationBasis.Text;
}
Bookmark constructionUnit = doc.Range.Bookmarks["ConstructionUnit"];
if (constructionUnit != null)
{
constructionUnit.Text = this.txtConstructionUnit.Text;
}
Bookmark designingUnit = doc.Range.Bookmarks["DesigningUnit"];
if (designingUnit != null)
{
designingUnit.Text = this.txtDesigningUnit.Text;
}
Bookmark testingUnit = doc.Range.Bookmarks["TestingUnit"];
if (testingUnit != null)
{
testingUnit.Text = this.txtTestingUnit.Text;
}
Bookmark constructionCompany = doc.Range.Bookmarks["ConstructionCompany"];
if (constructionCompany != null)
{
constructionCompany.Text = this.txtConstructionCompany.Text;
}
Bookmark mainContent = doc.Range.Bookmarks["MainContent"];
if (mainContent != null)
{
mainContent.Text = this.txtMainContent.Text;
}
Bookmark copiesNum = doc.Range.Bookmarks["CopiesNum"];
if (copiesNum != null)
{
copiesNum.Text = this.txtCopiesNum.Text;
}
doc.Save(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);
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}
}

View File

@ -122,6 +122,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// SimpleForm1 控件。
/// </summary>

View File

@ -41,6 +41,9 @@
</f:ToolbarFill>
<f:Button ID="btnPrint" Text="交工技术文件目录打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出Word" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -1,13 +1,16 @@
using BLL;
using Aspose.Words;
using Aspose.Words.Layout;
using Aspose.Words.Tables;
using BLL;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace FineUIPro.Web.JGZL
{
@ -291,5 +294,165 @@ namespace FineUIPro.Web.JGZL
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = string.Empty;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
//每页显示的固定数据行数
int rowsPerPage = 36;
string projectId = this.tvControlItem.SelectedNodeID;
if (!string.IsNullOrEmpty(projectId))
{
string strSql = @"SELECT * from JGZL_FileDirectory order by SerialNumber asc";
List<SqlParameter> listStr = new List<SqlParameter>();
//listStr.Add(new SqlParameter("@ProjectId", projectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
initTemplatePath = Const.JGZL_FileDirectoryUrl;
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace("交工技术文件目录导出模板", "交工技术文件目录");
if (File.Exists(newUrl))
{
File.Delete(newUrl);
}
File.Copy(uploadfilepath, newUrl);
//更新书签内容
Document doc = new Aspose.Words.Document(newUrl);
DocumentBuilder builder = new DocumentBuilder(doc);
Aspose.Words.Tables.Table table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, 0, true);
Bookmark projectName = doc.Range.Bookmarks["ProjectName"];
if (projectName != null)
{
projectName.Text = BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName;
}
// 设置表头行重复显示
table.Rows[0].RowFormat.HeadingFormat = true;
table.Rows[1].RowFormat.HeadingFormat = true;
// 先记录页尾行,并从表格中移除
Row footerRow = table.Rows[table.Rows.Count - 1];
table.Rows.RemoveAt(table.Rows.Count - 1);
for (int i = 0; i < tb.Rows.Count; i++)
{
//创建行
Row row = new Row(doc);
row.Cells.Add(CreateCell((i + 1).ToString(), doc, 27, "", ""));
row.Cells.Add(CreateCell(tb.Rows[i]["FileCode"].ToString(), doc, 118, "", ""));
row.Cells.Add(CreateCell(tb.Rows[i]["FileName"].ToString(), doc, 261.3, "", ""));
row.Cells.Add(CreateCell(tb.Rows[i]["Remark"].ToString(), doc, 74, "", ""));
table.Rows.Insert(i + 2, row);
}
// 计算并插入空白行,填满整页
// 计算总数据行数
int totalDataRows = tb.Rows.Count;
// 计算需要补充的空白行数量
int remainder = totalDataRows % rowsPerPage;
int needBlankRows = remainder == 0 ? 0 : rowsPerPage - remainder;
// 插入空白行(和数据行格式保持一致,仅内容为空)
for (int i = 0; i < needBlankRows - 1; i++)
{
Row blankRow = new Row(doc);
// 空白行的单元格宽度和数据行保持一致
blankRow.Cells.Add(CreateCell("", doc, 27, "", ""));
blankRow.Cells.Add(CreateCell("", doc, 118, "", ""));
blankRow.Cells.Add(CreateCell("", doc, 261.3, "", ""));
blankRow.Cells.Add(CreateCell("", doc, 74, "", ""));
// 插入到表格最后一行
table.Rows.Add(blankRow);
}
//把页尾行重新加回表格最后
table.Rows.Add(footerRow);
//自动设置表格样式
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
table.Alignment = TableAlignment.Center;
doc.Save(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);
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
public static Cell CreateCell(String value, Document doc, double cellWidth, string cellMerge = "", string CenterPage = "", string cellUnitLeft = "")
{
Cell cell = new Cell(doc);
Paragraph p = new Paragraph(doc);
if (!string.IsNullOrEmpty(cellMerge))
{
if (cellMerge == "0")
{
cell.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.First;//竖直方向合并的第一个单元格
}
else
{
cell.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.Previous;//竖直方向合并的第一个单元格
}
}
else
{
cell.CellFormat.VerticalMerge = Aspose.Words.Tables.CellMerge.None;
}
if (!string.IsNullOrEmpty(CenterPage))
{
//序号
value = " " + value;
}
if (!string.IsNullOrEmpty(cellUnitLeft))
{
p.ParagraphFormat.Alignment = ParagraphAlignment.Left;//表格中字体居左
}
else
{
p.ParagraphFormat.Alignment = ParagraphAlignment.Center;//表格中字体居中
}
p.AppendChild(new Run(doc, value));
cell.CellFormat.Width = cellWidth;
cell.CellFormat.VerticalAlignment = Aspose.Words.Tables.CellVerticalAlignment.Center;
cell.CellFormat.Borders.LineWidth = 0.75;
cell.AppendChild(p);
return cell;
}
#endregion
}
}

View File

@ -113,6 +113,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Grid1 控件。
/// </summary>

View File

@ -39,12 +39,15 @@
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<%--<f:Button ID="btnAdd" runat="server" Icon="Add" Text="增加" OnClick="btnAdd_Click"></f:Button>--%>
<f:Button ID="btnPrint" Text="特种设备安装改造维修告知书打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出Word" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@ -53,9 +56,9 @@
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<Items>
<f:TextBox ID="txtConUnit" runat="server" Label="施工单位" LabelAlign="Right" LabelWidth="130px" MaxLength="50" Required="true" ShowRedStar="true"></f:TextBox>
<f:TextBox ID="txtMaintenanceCode" runat="server" Label="告知书编号" LabelAlign="Right" LabelWidth="130px" MaxLength="50" Required="true" ShowRedStar="true"></f:TextBox>
<f:TextBox ID="txtMaintenanceCode" runat="server" Label="告知书编号" LabelAlign="Right" LabelWidth="130px" MaxLength="50" Required="true" ShowRedStar="true"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>

View File

@ -9,6 +9,7 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using FineUIPro.Web.common.BaseInfo;
using Aspose.Words;
namespace FineUIPro.Web.JGZL
{
@ -691,5 +692,177 @@ namespace FineUIPro.Web.JGZL
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/");
string initTemplatePath = string.Empty;
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
string projectId = this.tvControlItem.SelectedNodeID;
if (!string.IsNullOrEmpty(projectId))
{
initTemplatePath = Const.JGZL_SpecialEquipmentMaintenanceUrl;
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace("特种设备安装改造维修告知书导出模板", "特种设备安装改造维修告知书");
if (File.Exists(newUrl))
{
File.Delete(newUrl);
}
File.Copy(uploadfilepath, newUrl);
Document doc = new Aspose.Words.Document(uploadfilepath);
Bookmark conUnit = doc.Range.Bookmarks["ConUnit"];
if (conUnit != null)
{
conUnit.Text = this.txtConUnit.Text.Trim();
}
Bookmark maintenanceCode = doc.Range.Bookmarks["MaintenanceCode"];
if (maintenanceCode != null)
{
maintenanceCode.Text = this.txtMaintenanceCode.Text.Trim();
}
Bookmark equipmentName = doc.Range.Bookmarks["EquipmentName"];
if (equipmentName != null)
{
equipmentName.Text = this.txtEquipmentName.Text.Trim();
}
Bookmark equipmentModel = doc.Range.Bookmarks["EquipmentModel"];
if (equipmentModel != null)
{
equipmentModel.Text = this.txtEquipmentModel.Text.Trim();
}
Bookmark equipmentCode = doc.Range.Bookmarks["EquipmentCode"];
if (equipmentCode != null)
{
equipmentCode.Text = this.txtEquipmentCode.Text.Trim();
}
Bookmark manufacturingNumber = doc.Range.Bookmarks["ManufacturingNumber"];
if (manufacturingNumber != null)
{
manufacturingNumber.Text = this.txtManufacturingNumber.Text.Trim();
}
Bookmark manufacturingUnit = doc.Range.Bookmarks["ManufacturingUnit"];
if (manufacturingUnit != null)
{
manufacturingUnit.Text = this.txtManufacturingUnit.Text.Trim();
}
Bookmark manufacturingLicenseNumber = doc.Range.Bookmarks["ManufacturingLicenseNumber"];
if (manufacturingLicenseNumber != null)
{
manufacturingLicenseNumber.Text = this.txtManufacturingLicenseNumber.Text.Trim();
}
Bookmark equipmentLocation = doc.Range.Bookmarks["EquipmentLocation"];
if (equipmentLocation != null)
{
equipmentLocation.Text = this.txtEquipmentLocation.Text.Trim();
}
Bookmark constructionDate = doc.Range.Bookmarks["ConstructionDate"];
if (constructionDate != null)
{
string d = string.Format("{0:yyyy年MM月dd}", this.txtConstructionDate.Text);
constructionDate.Text = d;
}
Bookmark constructionCategory = doc.Range.Bookmarks["ConstructionCategory"];
if (constructionCategory != null)
{
constructionCategory.Text = this.drpConstructionCategory.SelectedText;
}
Bookmark licenseNumber = doc.Range.Bookmarks["LicenseNumber"];
if (licenseNumber != null)
{
licenseNumber.Text = this.txtLicenseNumber.Text.Trim();
}
Bookmark licenseValidityDate = doc.Range.Bookmarks["LicenseValidityDate"];
if (licenseValidityDate != null)
{
string d = string.Format("{0:yyyy年MM月dd}", this.txtLicenseValidityDate.Text);
licenseValidityDate.Text = d;
}
Bookmark conContactMan = doc.Range.Bookmarks["ConContactMan"];
if (conContactMan != null)
{
conContactMan.Text = this.txtConContactMan.Text.Trim();
}
Bookmark conTelephone = doc.Range.Bookmarks["ConTelephone"];
if (conTelephone != null)
{
conTelephone.Text = this.txtConTelephone.Text.Trim();
}
Bookmark conFax = doc.Range.Bookmarks["ConFax"];
if (conFax != null)
{
conFax.Text = this.txtConFax.Text.Trim();
}
Bookmark conAddress = doc.Range.Bookmarks["ConAddress"];
if (conAddress != null)
{
conAddress.Text = this.txtConAddress.Text.Trim();
}
Bookmark conEmail = doc.Range.Bookmarks["ConEmail"];
if (conEmail != null)
{
conEmail.Text = this.txtConEmail.Text.Trim();
}
Bookmark useUnit = doc.Range.Bookmarks["UseUnit"];
if (useUnit != null)
{
useUnit.Text = this.txtUseUnit.Text.Trim();
}
Bookmark useContactMan = doc.Range.Bookmarks["UseContactMan"];
if (useContactMan != null)
{
useContactMan.Text = this.txtUseContactMan.Text.Trim();
}
Bookmark useTelephone = doc.Range.Bookmarks["UseTelephone"];
if (useTelephone != null)
{
useTelephone.Text = this.txtUseTelephone.Text.Trim();
}
Bookmark useFax = doc.Range.Bookmarks["UseFax"];
if (useFax != null)
{
useFax.Text = this.txtUseFax.Text.Trim();
}
Bookmark useAddress = doc.Range.Bookmarks["UseAddress"];
if (useAddress != null)
{
useAddress.Text = this.txtUseAddress.Text.Trim();
}
Bookmark useEmail = doc.Range.Bookmarks["UseEmail"];
if (useEmail != null)
{
useEmail.Text = this.txtUseEmail.Text.Trim();
}
doc.Save(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);
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}
}

View File

@ -122,6 +122,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// SimpleForm1 控件。
/// </summary>

View File

@ -743,7 +743,7 @@ namespace FineUIPro.Web.Welder
{
foreach (var q in quas)
{
if (q.MIDWelder_QualifiedProjectCode.Contains("+") || q.MIDWelder_QualifiedProjectCode.Contains(""))
if (q.MIDWelder_QualifiedProjectCode.Contains("+") || q.MIDWelder_QualifiedProjectCode.Contains("")|| q.MIDWelder_QualifiedProjectCode.Contains("和"))
{
string[] codes = null;
if (q.MIDWelder_QualifiedProjectCode.Contains("+"))
@ -754,13 +754,15 @@ namespace FineUIPro.Web.Welder
{
codes = q.MIDWelder_QualifiedProjectCode.Split('');
}
if (q.MIDWelder_QualifiedProjectCode.Contains("和"))
{
codes = q.MIDWelder_QualifiedProjectCode.Split('和');
}
foreach (string c in codes)
{
var oldCode = from x in Funs.DB.HJGL_BS_WelderQualifiedProject where x.WED_ID == wederId && x.QualifiedProjectCode == c && x.LimitDate.Value.Date == q.MIDWelder_LimitDate.Value.Date select x;
if (oldCode.Count() == 0)
{
Model.HJGL_BS_WelderQualifiedProject welderQualifiedProject = new Model.HJGL_BS_WelderQualifiedProject();
welderQualifiedProject.WelderQualifiedProjectId = SQLHelper.GetNewID(typeof(Model.HJGL_BS_WelderQualifiedProject));
welderQualifiedProject.WED_ID = wederId;

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Aspose.Words" version="21.8.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net461" />
<package id="NPOI" version="2.5.5" targetFramework="net461" />
<package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net461" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>