20260428 项目工作量统计
This commit is contained in:
parent
ea46298b9e
commit
cab2bb840a
|
|
@ -0,0 +1,155 @@
|
|||
|
||||
|
||||
ALTER PROC [dbo].[HJGL_sp_rpt_iso_analyze]
|
||||
@unitNo VARCHAR(400) = NULL,
|
||||
@isono VARCHAR(100) = NULL,
|
||||
@steel varchar(50) = NULL,
|
||||
@projectId NVARCHAR(50) = NULL,
|
||||
@StartDate datetime =null,
|
||||
@EndDate datetime =null
|
||||
AS
|
||||
/*보쌈묏鱗좆固셕 杳뉴<E69DB3>錦맣黨2020.03.06*/
|
||||
SELECT iso.ProjectId,iso.ISO_IsoNo,iso.PressureTestPackageNo,Unit.UnitCode AS bsu_unitcode, --데貫덜쯤
|
||||
Unit.UnitName AS bsu_unitname, --데貫츰냔
|
||||
Project.ProjectCode as projectCode, --嘉묏뵀
|
||||
Project.ProjectName as projectName, --淃커츰냔
|
||||
'┻'+cast(cast(ISO_Dia as FLOAT) as nvarchar(50))+'≠'+cast(cast(ISO_Sch as FLOAT) as nvarchar(50)) as IsoDesc, --밗窟寮방목
|
||||
v.ISO_ID,v.total_jot,v.total_din,
|
||||
ISNULL(v1.finished_total_jot,0) AS finished_total_jot,
|
||||
ISNULL(v1.finished_total_din,0) AS finished_total_din,v1.maxdate,
|
||||
ISNULL(v1.total_film,0) AS total_film,
|
||||
ISNULL(v1.pass_film,0) AS pass_film,
|
||||
CAST(CASE ISNULL(v1.total_film ,0) WHEN 0 THEN 0
|
||||
ELSE 1.0*ISNULL(v1.pass_film,0) / (1.0 * v1.total_film) END AS DECIMAL(19,3))
|
||||
AS passrate, --듐왯북목쪽
|
||||
ISNULL(v2.point_jot,0) AS point_jot,
|
||||
ISNULL(v2.point_total_film,0) AS point_total_film,
|
||||
ISNULL(v2.point_pass_film,0) AS point_pass_film,
|
||||
CAST(CASE ISNULL(v2.point_total_film ,0) WHEN 0 THEN 0
|
||||
ELSE 1.0*ISNULL(v2.point_pass_film,0) / (1.0 * v2.point_total_film) END AS DECIMAL(19,3))
|
||||
AS point_passrate, --듐왯북목쪽
|
||||
|
||||
ISNULL(v3.ext_jot,0) AS ext_jot,
|
||||
ISNULL(v3.ext_total_film,0) AS ext_total_film,
|
||||
ISNULL(v3.ext_pass_film,0) AS ext_pass_film,
|
||||
CAST(CASE ISNULL(v3.ext_total_film ,0) WHEN 0 THEN 0
|
||||
ELSE 1.0*ISNULL(v3.ext_pass_film,0) / (1.0 * v3.ext_total_film) END AS DECIMAL(19,3))
|
||||
AS point_passrate, --윈拷북목쪽
|
||||
(ISNULL(v2.point_jot,0)+ISNULL(v3.ext_jot,0)) AS check_total_jot,
|
||||
ISNULL(v4.total_repairjot,0) AS total_repairjot,
|
||||
ISNULL(v5.trust_total_jot,0) AS trust_total_jot,
|
||||
CAST(CASE ISNULL(v.total_jot,0) WHEN 0 THEN 0
|
||||
ELSE 1.0*ISNULL(v2.point_jot,0) / (1.0 * v.total_jot) END AS DECIMAL(19,3))
|
||||
AS trustrate, --官辜궐절
|
||||
CAST(CASE ISNULL(v.total_jot,0) WHEN 0 THEN 0
|
||||
ELSE 1.0*(ISNULL(v3.ext_jot,0) + ISNULL(v2.point_jot,0)) / (1.0 * v.total_jot)
|
||||
END AS DECIMAL(19,3))
|
||||
AS checkrate, --綠決궐절
|
||||
ISNULL(v6.total_fjot,0) as total_fjot,--갛陋보왯鑒
|
||||
ISNULL(v7.total_sjot,0) as total_sjot --渡齡보왯鑒
|
||||
FROM
|
||||
(SELECT ISO_ID, COUNT(JOT_ID) AS total_jot,SUM(ISNULL(JOT_Size,0)) AS total_din
|
||||
FROM dbo.HJGL_PW_JointInfo
|
||||
GROUP BY ISO_ID) v
|
||||
LEFT JOIN
|
||||
(SELECT ISO_ID, COUNT(JOT_ID) AS finished_total_jot,SUM(ISNULL(JOT_Size,0)) AS finished_total_din,
|
||||
max(weldreport.JOT_WeldDate) AS maxdate, SUM(ISNULL(jot.RT_FilmNum,0)) AS total_film,
|
||||
SUM(ISNULL(jot.RT_FilmNum,0)-ISNULL(jot.RT1_RepairFilmNum,0)) AS pass_film
|
||||
FROM dbo.HJGL_PW_JointInfo jot
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not null
|
||||
GROUP BY ISO_ID) v1 ON v1.ISO_ID=v.ISO_ID
|
||||
LEFT JOIN
|
||||
(SELECT ISO_ID, COUNT(jot.JOT_ID) AS point_jot,SUM(ISNULL(jot.RT_FilmNum,0)) AS point_total_film,
|
||||
SUM(ISNULL(jot.RT_FilmNum,0)-ISNULL(jot.RT1_RepairFilmNum,0)) AS point_pass_film
|
||||
FROM dbo.HJGL_PW_JointInfo jot
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not NULL AND jot.PointType='듐왯' or ((select top 1 CH_TrustItemID from HJGL_CH_TrustItem ti where ti.JOT_ID=jot.JOT_ID) is not null and jot.PointType is null)
|
||||
GROUP BY ISO_ID) v2 ON v2.ISO_ID=v.ISO_ID
|
||||
LEFT JOIN
|
||||
(SELECT ISO_ID, COUNT(jot.JOT_ID) AS ext_jot,SUM(ISNULL(jot.RT_FilmNum,0)) AS ext_total_film,
|
||||
SUM(ISNULL(jot.RT_FilmNum,0)-ISNULL(jot.RT1_RepairFilmNum,0)) AS ext_pass_film
|
||||
FROM dbo.HJGL_PW_JointInfo jot
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not NULL AND jot.PointType='윈拷'
|
||||
GROUP BY ISO_ID) v3 ON v3.ISO_ID=v.ISO_ID
|
||||
LEFT JOIN
|
||||
(SELECT jot.ISO_ID, COUNT(distinct trust.JOT_ID) AS trust_total_jot --trust.CH_TrustItemID
|
||||
FROM dbo.HJGL_CH_TrustItem trust
|
||||
LEFT join dbo.HJGL_PW_JointInfo AS jot on jot.JOT_ID=trust.JOT_ID
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not NULL
|
||||
GROUP BY jot.ISO_ID) v5 ON v5.ISO_ID=v.ISO_ID
|
||||
LEFT JOIN
|
||||
(SELECT ISO_ID,COUNT(DISTINCT(jot.JOT_ID)) AS total_repairjot
|
||||
FROM dbo.HJGL_PW_JointInfo jot
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not NULL
|
||||
AND(jot.RT1_RepairFilmNum IS NOT NULL OR jot.PTIsRepair1=1 OR jot.MTIsRepair1=1 OR jot.UTIsRepair1=1)
|
||||
GROUP BY ISO_ID) v4 ON v4.ISO_ID=v.ISO_ID
|
||||
--갛陋보왯
|
||||
LEFT JOIN
|
||||
(SELECT ISO_ID,COUNT(jot.JOT_ID) AS total_fjot
|
||||
FROM dbo.HJGL_PW_JointInfo jot
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not NULL
|
||||
AND jot.WLO_Code='F'
|
||||
GROUP BY ISO_ID) v6 ON v6.ISO_ID=v.ISO_ID
|
||||
--渡齡보왯
|
||||
LEFT JOIN
|
||||
(SELECT ISO_ID,COUNT(jot.JOT_ID) AS total_sjot
|
||||
FROM dbo.HJGL_PW_JointInfo jot
|
||||
LEFT join HJGL_BO_WeldReportMain AS weldreport on weldreport.DReportID=jot.DReportID
|
||||
WHERE (weldreport.JOT_WeldDate>=@StartDate or @StartDate is null) and (weldreport.JOT_WeldDate<=@EndDate or @EndDate is null)
|
||||
AND jot.DReportID is not NULL
|
||||
AND jot.WLO_Code='S'
|
||||
GROUP BY ISO_ID) v7 ON v7.ISO_ID=v.ISO_ID
|
||||
|
||||
LEFT JOIN dbo.HJGL_PW_IsoInfo iso ON iso.ISO_ID = v.ISO_ID
|
||||
LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = iso.BSU_ID
|
||||
LEFT JOIN Base_Project AS Project ON Project.ProjectId = iso.ProjectId
|
||||
WHERE (iso.ProjectId = @projectId OR @projectId IS NULL)
|
||||
AND (iso.BSU_ID=@unitno OR @unitno IS NULL)
|
||||
AND (iso.STE_ID=@steel OR @steel IS NULL)
|
||||
AND (iso.ISO_IsoNo = @isono OR @isono IS NULL)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
ALTER PROCEDURE [dbo].[sp_rpt_WelderQualified]
|
||||
(
|
||||
@projectId NVARCHAR(50),
|
||||
@WED_Name nvarchar(50) = null
|
||||
)
|
||||
AS
|
||||
/***********슥묏栗죕-북목보묏되션깊*************/
|
||||
SELECT (ROW_NUMBER() OVER(ORDER BY pw.ProjectWelderId)) AS Number,
|
||||
pw.ProjectWelderId,
|
||||
w.WED_Code,
|
||||
w.WED_Name,
|
||||
w.WED_WorkCode as CertificateNo,
|
||||
convert(varchar(10),wqp.LimitDate,111) as LimitDate,
|
||||
STRING_AGG(wqp.QualifiedProjectCode, '뵨') as QualifiedProjectCode
|
||||
FROM Project_Welder pw
|
||||
LEFT JOIN HJGL_BS_Welder w ON w.WED_ID = pw.WED_ID
|
||||
left join HJGL_BS_WelderQualifiedProject wqp on wqp.WED_ID = pw.WED_ID
|
||||
where pw.ProjectId=@projectId
|
||||
and (w.WED_Name like @WED_Name or @WED_Name is null)
|
||||
and wqp.LimitDate IS NOT NULL AND wqp.LimitDate> = GETDATE()
|
||||
GROUP BY pw.ProjectWelderId,w.WED_Code,w.WED_Name,w.WED_WorkCode,wqp.LimitDate
|
||||
order by w.WED_Code,wqp.LimitDate
|
||||
GO
|
||||
|
||||
|
||||
|
|
@ -2544,6 +2544,11 @@ namespace BLL
|
|||
/// </summary>
|
||||
public const string JGZL_QualifiedWelderUrl = "File\\Word\\JGZL\\合格焊工登记表导出模板.docx";
|
||||
|
||||
/// <summary>
|
||||
/// 无损检测人员登记表导出模板
|
||||
/// </summary>
|
||||
public const string JGZL_NDTPersonUrl = "File\\Word\\JGZL\\无损检测人员登记表导出模板.docx";
|
||||
|
||||
/// <summary>
|
||||
/// 管道系统压力试验条件确认记录导出模板
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/18/2025 17:45:45" ReportInfo.Modified="04/22/2026 17:06:07" ReportInfo.CreatorVersion="2017.1.16.0">
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/18/2025 17:45:45" ReportInfo.Modified="04/27/2026 17:23:16" 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+/QFpwSqHYzuJtrZDhrux7H3AA==">
|
||||
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFpIePiT3/qx525jbed3JeoA==">
|
||||
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
|
||||
<Column Name="PersonName" DataType="System.String" PropName="attach_image_id"/>
|
||||
<Column Name="CertificateNumber" DataType="System.String" PropName="image_series"/>
|
||||
|
|
|
|||
|
|
@ -9,12 +9,6 @@
|
|||
证书编号
|
||||
合格项目代号
|
||||
有效期限
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
建设/监理单位
|
||||
总承包单位
|
||||
施工单位
|
||||
|
|
|
|||
|
|
@ -0,0 +1,158 @@
|
|||
SH/T 3503 -- J116
|
||||
无损检测人员登记表
|
||||
工程名称:
|
||||
|
||||
序号
|
||||
姓名
|
||||
证书编号
|
||||
合格项目代号
|
||||
级别
|
||||
有效期限
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
建设/监理单位
|
||||
总承包单位
|
||||
检测单位
|
||||
专业工程师:
|
||||
|
||||
|
||||
日期: 年 月 日
|
||||
专业工程师:
|
||||
|
||||
|
||||
日期: 年 月 日
|
||||
专业工程师:
|
||||
制表人:
|
||||
|
||||
日期: 年 月 日
|
||||
|
||||
|
|
@ -112,13 +112,14 @@
|
|||
<f:RenderField HeaderText="完成焊口" ColumnID="finished_total_jot" DataField="finished_total_jot" SortField="finished_total_jot"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Right" Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="预制焊口" ColumnID="total_sjot" DataField="total_sjot" SortField="total_sjot"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Right" Width="90px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="安装焊口" ColumnID="total_fjot" DataField="total_fjot" SortField="total_fjot"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Right" Width="90px">
|
||||
</f:RenderField>
|
||||
|
||||
<%-- <f:RenderField HeaderText="预制总焊口" ColumnID="total_sjot" DataField="total_sjot" SortField="total_sjot"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Right" Width="90px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="安装总焊口" ColumnID="total_fjot" DataField="total_fjot" SortField="total_fjot"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Right" Width="90px">
|
||||
</f:RenderField>
|
||||
<%--
|
||||
|
||||
<f:RenderField HeaderText="预制完成焊口" ColumnID="finished_total_sjot" DataField="finished_total_sjot" SortField="finished_total_sjot"
|
||||
FieldType="Int" HeaderTextAlign="Center" TextAlign="Right" Width="100px">
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@
|
|||
<f:Button ID="btnSave" Text="保存" ToolTip="保存" Icon="SystemSave" runat="server" OnClick="btnSave_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>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
using BLL;
|
||||
using Aspose.Words;
|
||||
using Aspose.Words.Tables;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
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;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JGZL
|
||||
{
|
||||
|
|
@ -549,5 +551,172 @@ 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 maxrowCount = 22;
|
||||
|
||||
string projectId = this.tvControlItem.SelectedNodeID;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
string strSql = @"SELECT * from JGZL_NDTPerson where ProjectId = @ProjectId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", projectId));
|
||||
if (!string.IsNullOrEmpty(this.txtPersonNameS.Text))
|
||||
{
|
||||
strSql += " and PersonName like @personName";
|
||||
listStr.Add(new SqlParameter("@personName", "%" + this.txtPersonNameS.Text + "%"));
|
||||
}
|
||||
strSql += " order by ValidityDate desc";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
initTemplatePath = Const.JGZL_NDTPersonUrl;
|
||||
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 - 2];
|
||||
table.Rows.RemoveAt(table.Rows.Count - 2);
|
||||
Row footerRow2 = table.Rows[table.Rows.Count - 1];
|
||||
table.Rows.RemoveAt(table.Rows.Count - 1);
|
||||
|
||||
// 清空模板里的旧数据行,只保留2行表头(防止错位)
|
||||
while (table.Rows.Count > 2)
|
||||
{
|
||||
table.Rows.RemoveAt(2);
|
||||
}
|
||||
Row headerRow = table.Rows[1]; // 字段名表头行
|
||||
double[] colWidths = new double[6];
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
colWidths[i] = headerRow.Cells[i].CellFormat.Width;
|
||||
}
|
||||
// 填充数据行
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell((i + 1).ToString(), doc, colWidths[0], "楷体", "10.5"));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["PersonName"].ToString(), doc, colWidths[1], "楷体", "10.5"));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["CertificateNumber"].ToString(), doc, colWidths[2], "楷体", "10.5"));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["QualifiedProjectCode"].ToString(), doc, colWidths[3], "楷体", "10.5"));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["Levels"].ToString(), doc, colWidths[4], "楷体", "10.5"));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["ValidityDate"].ToString(), doc, colWidths[5], "楷体", "10.5"));
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
// 不满一页,自动填充空白行
|
||||
int realDataCount = tb.Rows.Count;
|
||||
int needBlankRows = maxrowCount - realDataCount;
|
||||
if (needBlankRows > 0)
|
||||
{
|
||||
for (int i = 0; i < needBlankRows; i++)
|
||||
{
|
||||
Row blankRow = new Row(doc);
|
||||
blankRow.Cells.Add(CreateCell("", doc, colWidths[0], "楷体", "10.5"));
|
||||
blankRow.Cells.Add(CreateCell("", doc, colWidths[1], "楷体", "10.5"));
|
||||
blankRow.Cells.Add(CreateCell("", doc, colWidths[2], "楷体", "10.5"));
|
||||
blankRow.Cells.Add(CreateCell("", doc, colWidths[3], "楷体", "10.5"));
|
||||
blankRow.Cells.Add(CreateCell("", doc, colWidths[4], "楷体", "10.5"));
|
||||
blankRow.Cells.Add(CreateCell("", doc, colWidths[5], "楷体", "10.5"));
|
||||
table.Rows.Add(blankRow);
|
||||
}
|
||||
}
|
||||
|
||||
//把页尾行重新加回表格最后
|
||||
table.Rows.Add(footerRow);
|
||||
table.Rows.Add(footerRow2);
|
||||
|
||||
// 设置表格格式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
table.Alignment = TableAlignment.Center;
|
||||
table.SetBorders(Aspose.Words.LineStyle.Single, 1, System.Drawing.Color.Black);
|
||||
|
||||
// 强制刷新所有单元格宽度,防止个别单元格宽度不生效
|
||||
foreach (Row r in table.Rows)
|
||||
{
|
||||
foreach (Cell c in r.Cells)
|
||||
{
|
||||
c.CellFormat.Width = colWidths[c.ParentRow.Cells.IndexOf(c)];
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建带字体、宽度的表格单元格
|
||||
/// </summary>
|
||||
private Cell CreateCell(string text, Document doc, double width, string fontName, string fontSize)
|
||||
{
|
||||
Cell cell = new Cell(doc);
|
||||
cell.CellFormat.Width = width;
|
||||
cell.CellFormat.LeftPadding = 2;
|
||||
cell.CellFormat.RightPadding = 2;
|
||||
cell.CellFormat.TopPadding = 2;
|
||||
cell.CellFormat.BottomPadding = 2;
|
||||
|
||||
Paragraph para = new Paragraph(doc);
|
||||
para.ParagraphFormat.Alignment = ParagraphAlignment.Center; // 居中
|
||||
para.ParagraphFormat.SpaceAfter = 0;
|
||||
para.ParagraphFormat.SpaceBefore = 0;
|
||||
|
||||
Run run = new Run(doc, text);
|
||||
run.Font.Name = fontName; // 字体
|
||||
run.Font.Size = Convert.ToDouble(fontSize); // 字号
|
||||
|
||||
para.AppendChild(run);
|
||||
cell.AppendChild(para);
|
||||
|
||||
return cell;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -140,6 +140,15 @@ namespace FineUIPro.Web.JGZL
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnPrint;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:TextBox ID="txtName" runat="server" Label="姓名" EmptyText="输入查询条件" LabelAlign="Right" AutoPostBack="true" OnTextChanged="txtName_TextChanged"></f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnPrint" Text="合格焊工登记表打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ namespace FineUIPro.Web.JGZL
|
|||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.tvControlItem.SelectedNodeID));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_Name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = BLL.SQLHelper.GetDataTableRunProc("sp_rpt_WelderQualified", parameter);
|
||||
|
||||
|
|
@ -172,6 +176,10 @@ namespace FineUIPro.Web.JGZL
|
|||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", projectId));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_Name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = BLL.SQLHelper.GetDataTableRunProc("sp_rpt_WelderQualified", parameter);
|
||||
|
||||
|
|
@ -230,14 +238,15 @@ namespace FineUIPro.Web.JGZL
|
|||
string newUrl = string.Empty;
|
||||
string filePath = string.Empty;
|
||||
|
||||
//每页显示的固定数据行数
|
||||
int rowsPerPage = 36;
|
||||
|
||||
string projectId = this.tvControlItem.SelectedNodeID;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", projectId));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@WED_Name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = BLL.SQLHelper.GetDataTableRunProc("sp_rpt_WelderQualified", parameter);
|
||||
|
||||
|
|
@ -266,49 +275,48 @@ namespace FineUIPro.Web.JGZL
|
|||
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);
|
||||
// 先记录页尾行,并从表格中移除
|
||||
Row footerRow = table.Rows[table.Rows.Count-2];
|
||||
table.Rows.RemoveAt(table.Rows.Count-2);
|
||||
Row footerRow2 = table.Rows[table.Rows.Count - 1];
|
||||
table.Rows.RemoveAt(table.Rows.Count - 1);
|
||||
|
||||
// 清空模板里的旧数据行,只保留2行表头(防止错位)
|
||||
while (table.Rows.Count > 2)
|
||||
{
|
||||
table.Rows.RemoveAt(2);
|
||||
}
|
||||
|
||||
// 单位:磅 1.69cm ≈ 48磅
|
||||
double col1 = 0.93 * 28.35; // 序号
|
||||
double col2 = 1.7 * 28.35; // 焊工姓名
|
||||
double col3 = 2.19 * 28.35; // 焊工代号
|
||||
double col4 = 3.95 * 28.35; // 证书编号
|
||||
double col5 = 6.04 * 28.35; // 合格项目代号
|
||||
double col6 = 2.27 * 28.35; // 有效日期
|
||||
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell((i + 1).ToString(), doc, 26.37, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["WED_Name"].ToString(), doc, 48.2, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["WED_Code"].ToString(), doc,62, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["CertificateNo"].ToString(), doc, 111.98, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["QualifiedProjectCode"].ToString(), doc, 171.23, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["LimitDate"].ToString(), doc, 64.3545, "", ""));
|
||||
table.Rows.Insert(i + 2, row);
|
||||
row.Cells.Add(CreateCell((i + 1).ToString(), doc, col1, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["WED_Name"].ToString(), doc, col2, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["WED_Code"].ToString(), doc, col3, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["CertificateNo"].ToString(), doc, col4, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["QualifiedProjectCode"].ToString(), doc, col5, "", ""));
|
||||
row.Cells.Add(CreateCell(tb.Rows[i]["LimitDate"].ToString(), doc, col6, "", ""));
|
||||
table.Rows.Add(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, "", ""));
|
||||
// blankRow.Cells.Add(CreateCell("", doc, 74, "", ""));
|
||||
// blankRow.Cells.Add(CreateCell("", doc, 74, "", ""));
|
||||
// // 插入到表格最后一行
|
||||
// table.Rows.Add(blankRow);
|
||||
//}
|
||||
//把页尾行重新加回表格最后
|
||||
//table.Rows.Add(footerRow);
|
||||
table.Rows.Add(footerRow);
|
||||
table.Rows.Add(footerRow2);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
table.Alignment = TableAlignment.Center;
|
||||
table.SetBorders(Aspose.Words.LineStyle.Single, 1, System.Drawing.Color.Black);
|
||||
|
||||
|
||||
doc.Save(newUrl);
|
||||
|
||||
|
|
@ -330,54 +338,19 @@ namespace FineUIPro.Web.JGZL
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static Cell CreateCell(String value, Document doc, double cellWidth, string cellMerge = "", string CenterPage = "", string cellUnitLeft = "")
|
||||
private Cell CreateCell(string text, Document doc, double width, string bgColor, string align)
|
||||
{
|
||||
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);
|
||||
cell.AppendChild(new Paragraph(doc));
|
||||
cell.FirstParagraph.AppendChild(new Run(doc, text));
|
||||
cell.CellFormat.Width = width;
|
||||
return cell;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void txtName_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -95,6 +95,15 @@ namespace FineUIPro.Web.JGZL
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue