diff --git a/HJGL/FineUIPro.Web/Web.config b/HJGL/FineUIPro.Web/Web.config index baa8804..9ecdad1 100644 --- a/HJGL/FineUIPro.Web/Web.config +++ b/HJGL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx new file mode 100644 index 0000000..79410dd --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx @@ -0,0 +1,177 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PMIDetectionEntry.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.PMI.PMIDetectionEntry" %> + + + + + + + PMI检测录入 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs new file mode 100644 index 0000000..92ae0a2 --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using BLL; +using System.Web; +using System.Collections; +using Model; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace FineUIPro.Web.WeldingProcess.PMI +{ + public partial class PMIDetectionEntry : PageBase + { + #region 定义项 + /// + /// 检测单主键 + /// + public string PMIID + { + get + { + return (string)ViewState["PMIID"]; + } + set + { + ViewState["PMIID"] = value; + } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.txtNDEDateMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now); + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + this.PMIID = string.Empty; + this.InitTreeMenu();//加载树 + } + } + + #region 加载树 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + if (!string.IsNullOrEmpty(this.txtNDEDateMonth.Text.Trim())) + { + DateTime startTime = Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01"); + DateTime endTime = startTime.AddMonths(1); + this.tvControlItem.Nodes.Clear(); + List units = new List(); + Model.Project_Unit pUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId); + if (pUnit == null || pUnit.UnitType == BLL.Const.UnitType_1 || pUnit.UnitType == BLL.Const.UnitType_2 + || pUnit.UnitType == BLL.Const.UnitType_3 || pUnit.UnitType == BLL.Const.UnitType_4 + || pUnit.UnitType == BLL.Const.UnitType_6) + { + units = (from x in Funs.DB.Base_Unit + join y in Funs.DB.Project_Unit on x.UnitId equals y.UnitId + where y.ProjectId == this.CurrUser.LoginProjectId && y.UnitType.Contains(BLL.Const.UnitType_5) + select x).ToList(); + } + else + { + units.Add(BLL.Base_UnitService.GetUnit(this.CurrUser.UnitId)); + } + if (units != null) + { + foreach (var unit in units) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = unit.UnitName; + newNode.NodeID = unit.UnitId; + newNode.Expanded = true; + newNode.ToolTip = "Unit"; + this.tvControlItem.Nodes.Add(newNode); + this.BindNodes(newNode); + } + } + else + { + Alert.ShowInTop(Resources.Lan.PleaseAddUnitFirst, MessageBoxIcon.Warning); + } + } + else + { + Alert.ShowInTop(Resources.Lan.PleaseSelectTrustMonth, MessageBoxIcon.Warning); + } + } + + /// + /// 绑定树节点 + /// + /// + private void BindNodes(TreeNode node) + { + if (node.ToolTip == "Unit") + { + ///装置 + var install = (from x in Funs.DB.Project_Installation + join y in Funs.DB.PMI_Delegation on x.InstallationId equals y.InstallationId + where y.UnitId == node.NodeID && x.ProjectId == this.CurrUser.LoginProjectId + orderby x.InstallationCode + select x).Distinct(); + foreach (var q in install) + { + TreeNode newNode = new TreeNode(); + newNode.Text = q.InstallationName; + newNode.NodeID = q.InstallationId + "|" + node.NodeID; + newNode.ToolTip = "Installation"; + node.Nodes.Add(newNode); + BindNodes(newNode); + } + } + else if (node.ToolTip == "Installation") + { + string[] unitAndInstallationArr= node.NodeID.Split('|'); + var ndt = from x in Funs.DB.PMI_Delegation where x.UnitId == unitAndInstallationArr[1] + && x.InstallationId == unitAndInstallationArr[0] + && x.ProjectId == this.CurrUser.LoginProjectId select x; + foreach (var q in ndt) + { + + TreeNode newNode = new TreeNode(); + newNode.Text = q.DelegationNo; + newNode.NodeID = q.Id; + newNode.ToolTip = "DelegationNo"; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + BindNodes(newNode); + } + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.PMIID = tvControlItem.SelectedNodeID; + this.hdPMIId.Text = this.PMIID; + this.BindGrid(); + } + #endregion + + #region 数据绑定 + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + /// + /// 数据绑定 + /// + private void BindGrid() + { + if (!string.IsNullOrWhiteSpace(this.hdPMIId.Text) && this.tvControlItem.SelectedNode.ToolTip == "DelegationNo") + { + this.SetTextTemp(); + this.PageInfoLoad(); ///页面输入提交信息 + + } + } + + #region 加载页面输入提交信息 + /// + /// 加载页面输入提交信息 + /// + private void PageInfoLoad() + { + this.SimpleForm1.Reset(); ///重置所有字段 + var pageInfo = (from x in Funs.DB.PMI_Delegation + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + join n in Funs.DB.Project_Installation on x.InstallationId equals n.InstallationId + join u in Funs.DB.Sys_User on x.DetectionStandard equals u.UserId into u1 //左连接查询 + from u in u1.DefaultIfEmpty() + where x.Id==hdPMIId.Text + select new { DelegationNo=x.DelegationNo, + DelegationDate=x.DelegationDate, + InstallationName=n.InstallationName, + UnitName=y.UnitName, + DetectionMethod="待定", + Tabler=x.Tabler, + Remark=x.Remark, + }).ToList(); + if (pageInfo.Count>0) + { + this.txtDelegationNo.Text = pageInfo[0].DelegationNo; + this.txtDelegationDate.Text = pageInfo[0].DelegationDate.ToString(); + this.txtInstallationName.Text = pageInfo[0].InstallationName; + this.txtUnitName.Text = pageInfo[0].UnitName; + this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod; + this.txtTabler.Text = pageInfo[0].Tabler; + this.txtRemark.Text = pageInfo[0].Remark; + } + } + #endregion + + /// + /// 清空 + /// + private void SetTextTemp() + { + this.txtDelegationNo.Text = string.Empty; + this.txtDelegationDate.Text = string.Empty; + this.txtInstallationName.Text = string.Empty; + this.txtUnitName.Text = string.Empty; + this.txtDetectionMethod.Text = string.Empty; + this.txtTabler.Text = string.Empty; + this.txtRemark.Text = string.Empty; + } + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + #endregion + + #region 关闭弹出窗口及刷新页面 + + /// + /// 查询 + /// + /// + /// + protected void Tree_TextChanged(object sender, EventArgs e) + { + this.InitTreeMenu(); + //this.BindGrid(); + } + #endregion + + #region 格式化字符串 + /// + /// 获取缺陷 + /// + /// + /// + protected string ConvertCheckDefects(object CheckDefects) + { + string str = string.Empty; + if (CheckDefects != null) + { + HttpCookie lanCookie = Request.Cookies["SelectLan"]; + if (lanCookie["lan"] == "zh-CN") //中文 + { + str = BLL.Base_DefectService.GetDefectNameStrByDefectIdStr(CheckDefects.ToString()); + } + else + { + str = BLL.Base_DefectService.GetDefectEngNameStrByDefectIdStr(CheckDefects.ToString()); + } + } + return str; + } + #endregion + } +} \ No newline at end of file diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs new file mode 100644 index 0000000..76a035a --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.WeldingProcess.PMI +{ + + + public partial class PMIDetectionEntry + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// txtNDEDateMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtNDEDateMonth; + + /// + /// Toolbar5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar5; + + /// + /// txtSearchCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSearchCode; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdPMIId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdPMIId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtDelegationNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDelegationNo; + + /// + /// txtDelegationDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDelegationDate; + + /// + /// txtInstallationName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtInstallationName; + + /// + /// txtUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtUnitName; + + /// + /// txtDetectionMethod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDetectionMethod; + + /// + /// txtDetectionStandard 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDetectionStandard; + + /// + /// txtTabler 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtTabler; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtRemark; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageAudit.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageAudit.aspx.cs index f4de55b..cc9719d 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageAudit.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageAudit.aspx.cs @@ -4094,6 +4094,212 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage } + //24-TP-10-渗透&MT检测比例确认表 + private void template25_1(XSSFWorkbook hssfworkbook, XSSFSheet ws) + { + int rowIndex = 0; + var style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 10, true, false, "Arial Unicode MS"); + #region 头部 + var style1 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Right, 10, true, false, "Arial Unicode MS"); + ws = ExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex, style1, 0, 20, true); + + //设置行宽度 + ws.SetColumnWidth(0, 13 * 256); + ws.SetColumnWidth(1, 3 * 256); + ws.SetColumnWidth(2, 10 * 256); + for (int i = 3; i < 20; i++) + { + ws.SetColumnWidth(1, 3 * 256); + } + ws.SetColumnWidth(20, 23 * 256); + + //设置行高度 + ws.GetRow(rowIndex).Height = 10 * 20; + ws.GetRow(rowIndex).GetCell(20).CellStyle = style1; + ws.GetRow(rowIndex).GetCell(20).SetCellValue("Form No. TP-10"); + + ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 1, rowIndex + 2, style, 0, 20, true); + //设置行高度 + ws.GetRow(rowIndex + 1).Height = 10 * 20 * 9; + ws.GetRow(rowIndex + 2).Height = 10 * 20 * 3; + + //合并单元格和填充文本 + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, 2)); + ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue(""); + + var style3 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 14, true, true, "Arial Unicode MS"); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 3, 17)); + ws.GetRow(rowIndex + 1).GetCell(3).CellStyle = style3; + ws.GetRow(rowIndex + 1).GetCell(3).SetCellValue("管道焊接接头PMI检测比例确认表(一)\nPipeline Welding Joints PMI Examination Rate Confirmation Form(I)\n共 1 页 第 1 页"); + + var style2 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Top, NPOI.SS.UserModel.HorizontalAlignment.Left, 10, true, false, "Arial Unicode MS"); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 18, 20)); + ws.GetRow(rowIndex + 1).GetCell(18).CellStyle = style2; + ws.GetRow(rowIndex + 1).GetCell(18).SetCellValue("\n 工程名称:巴斯夫(广东)一体化项目\n Project Name:BASF (Guangdong) Integrated Project\n 单元名称:Citral\n Unit Name:Citral"); + + ws.GetRow(rowIndex + 2).GetCell(0).SetCellValue("执行标准\nApplicable code"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 1, 5)); + ws.GetRow(rowIndex + 2).GetCell(1).SetCellValue(""); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 6, 7)); + ws.GetRow(rowIndex + 2).GetCell(6).SetCellValue("检测方法\nExam. Method"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 8, 15)); + ws.GetRow(rowIndex + 2).GetCell(8).SetCellValue("PMI检测"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 16, 17)); + ws.GetRow(rowIndex + 2).GetCell(16).SetCellValue("检测比例\nExam. Rate"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 18, 20)); + ws.GetRow(rowIndex + 2).GetCell(18).SetCellValue("2%"); + + #endregion + + #region 表格部分 + + ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 3, rowIndex + 13, style, 0, 20, true); + //设置高度和合并列填充文本 + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 0, 1)); + ws.GetRow(rowIndex + 3).GetCell(0).SetCellValue("管道编号\nPipeline No."); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 2, 2)); + ws.GetRow(rowIndex + 3).GetCell(2).SetCellValue("材质\nMaterial"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 3, 4)); + ws.GetRow(rowIndex + 3).GetCell(3).SetCellValue("规 格/Size\n mm"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 5, 8)); + ws.GetRow(rowIndex + 3).GetCell(5).SetCellValue("管道焊接接头\nWelding Joints"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 9, 12)); + ws.GetRow(rowIndex + 3).GetCell(9).SetCellValue("施焊焊工\nWelder"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 13, 16)); + ws.GetRow(rowIndex + 3).GetCell(13).SetCellValue("检测焊接接头\nExanined Joints"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 5, 6)); + ws.GetRow(rowIndex + 4).GetCell(5).SetCellValue("总数\nTotal"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 7, 8)); + ws.GetRow(rowIndex + 4).GetCell(7).SetCellValue("固定口数\nField Joints"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 9, 10)); + ws.GetRow(rowIndex + 4).GetCell(9).SetCellValue("焊工代号\nWelder No."); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 11, 12)); + ws.GetRow(rowIndex + 4).GetCell(11).SetCellValue("施焊数量\nWelded Joints"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 13, 14)); + ws.GetRow(rowIndex + 4).GetCell(13).SetCellValue("总数\nTotal Joints"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 15, 16)); + ws.GetRow(rowIndex + 4).GetCell(15).SetCellValue("固定口数\nField Joints"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 17, 19)); + ws.GetRow(rowIndex + 3).GetCell(17).SetCellValue("实际检测比例\nActual exam. Rate"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 20, 20)); + ws.GetRow(rowIndex + 3).GetCell(20).SetCellValue("检测报告编号\nExamination Report No."); + + + for (int i = 3; i < 14; i++) + { + if (i == 3 || i == 4) + { + ws.GetRow(rowIndex + i).Height = 30 * 20; + continue; + } + + if (i == 13) + ws.GetRow(rowIndex + i).Height = 30 * 20; + else + ws.GetRow(rowIndex + i).Height = 19 * 20; + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 0, 1)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 3, 4)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 5, 6)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 7, 8)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 9, 10)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 11, 12)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 13, 14)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 15, 16)); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 17, 19)); + } + ws.GetRow(rowIndex + 13).GetCell(0).SetCellValue("小计\nTotal"); + #endregion + + #region 尾部 + + ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 14, rowIndex + 16, style, 0, 20, true); + //设置行高 + ws.GetRow(rowIndex + 14).Height = 20 * 20 * 2; + ws.GetRow(rowIndex + 15).Height = 20 * 20 * 2; + ws.GetRow(rowIndex + 16).Height = 20 * 20 * 7; + + ws.GetRow(rowIndex + 14).GetCell(0).SetCellValue("备注\nRemark"); + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 14, rowIndex + 14, 1, 20)); + + ws.GetRow(rowIndex + 14).GetCell(1).CellStyle = style2; + ws.GetRow(rowIndex + 14).GetCell(1).SetCellValue("焊口位置与检测焊口见管道单线图与无损检测报告。\nPlease refer to Pipeline Iso-drawing and NDE Report for joints position and examined joints."); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 0, 3)); + ws.GetRow(rowIndex + 15).GetCell(0).SetCellValue("建 设 / 监 理 单 位\nOwner/JianLi Company"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 4, 9)); + ws.GetRow(rowIndex + 15).GetCell(4).SetCellValue("总 承 包 单 位\nGeneral Contractor"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 10, 16)); + ws.GetRow(rowIndex + 15).GetCell(10).SetCellValue("检 测 单 位\nExamination Contractor"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 17, 20)); + ws.GetRow(rowIndex + 15).GetCell(17).SetCellValue("施 工 单 位\nConstruction Company"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 0, 3)); + ws.GetRow(rowIndex + 16).GetCell(0).CellStyle = style2; + ws.GetRow(rowIndex + 16).GetCell(0).SetCellValue("专业工程师\n Discipline Engineer: \n\n\n\n\n\n\n\n 日期Date: 年 月 日"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 4, 9)); + ws.GetRow(rowIndex + 16).GetCell(4).CellStyle = style2; + ws.GetRow(rowIndex + 16).GetCell(4).SetCellValue("专业工程师\n Discipline Engineer: \n\n\n\n\n\n\n\n 日期Date: 年 月 日"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 10, 16)); + ws.GetRow(rowIndex + 16).GetCell(10).CellStyle = style2; + ws.GetRow(rowIndex + 16).GetCell(10).SetCellValue("专业工程师\n Discipline Engineer: \n\n\n\n\n\n\n\n 日期Date: 年 月 日"); + + ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 17, 20)); + ws.GetRow(rowIndex + 16).GetCell(17).CellStyle = style2; + ws.GetRow(rowIndex + 16).GetCell(17).SetCellValue("专业工程师\n Discipline Engineer: \n\n 质量检查员:\n Quality Inspector:\n\n 制表:\n Prepared:\n\n 日期Date: 年 月 日"); + + #endregion + + ws.PrintSetup.FitWidth = 1; + ws.PrintSetup.FitHeight = 0; + ws.PrintSetup.PaperSize = (int)PaperSize.A4_Small; + + ws.FitToPage = true; + + //水平垂直居中 + ws.HorizontallyCenter = true; + ws.VerticallyCenter = true; + + //横向打印 + ws.PrintSetup.Landscape = true; + //垂直水平居中 + ws.VerticallyCenter = true; + ws.HorizontallyCenter = true; + //打印边距设置 厘米/3 + ws.SetMargin(MarginType.RightMargin, (double)2.4 / 3); + ws.SetMargin(MarginType.LeftMargin, (double)2.4 / 3); + ws.SetMargin(MarginType.TopMargin, (double)2.9 / 3); + ws.SetMargin(MarginType.BottomMargin, (double)2.4 / 3); + + //页眉页脚间距 + ws.SetMargin(MarginType.HeaderMargin, 0); + ws.SetMargin(MarginType.FooterMargin, 0); + + } + //25-管道无损检测结果汇总表SHT 3503-J412-2017 private void template25(XSSFWorkbook hssfworkbook, XSSFSheet ws) { diff --git a/HJGL/FineUIPro.Web/WeldingProcess/WeldingReport/WeldDailyExport.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/WeldingReport/WeldDailyExport.aspx.cs index 6c475bd..7e8748a 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/WeldingReport/WeldDailyExport.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/WeldingReport/WeldDailyExport.aspx.cs @@ -291,32 +291,32 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport ws.GetRow(rowIndex + 2).GetCell(19).SetCellValue("Remark"); ws.GetRow(rowIndex).Height = 69 * 20; - ws.GetRow(rowIndex + 1).Height = 12 * 20; - ws.GetRow(rowIndex + 2).Height = 24 * 20; + ws.GetRow(rowIndex + 1).Height = 15 * 20; + ws.GetRow(rowIndex + 2).Height = 30 * 20; ws.SetColumnWidth(0, 4 * 256); ws.SetColumnWidth(1, (int)(22.67 * 256)); ws.SetColumnWidth(2, (int)(9.78 * 256)); - ws.SetColumnWidth(3, (int)(6.78 * 256)); + ws.SetColumnWidth(3, (int)(5.33 * 256)); ws.SetColumnWidth(4, (int)(7.67 * 256)); ws.SetColumnWidth(5, (int)(8.33 * 256)); - ws.SetColumnWidth(6, (int)(6.33 * 256)); - ws.SetColumnWidth(7, (int)(9.11 * 256)); + ws.SetColumnWidth(6, (int)(4.42 * 256)); + ws.SetColumnWidth(7, (int)(10.82 * 256)); ws.SetColumnWidth(8, (int)(8.33 * 256)); ws.SetColumnWidth(9, (int)(8.40 * 256)); ws.SetColumnWidth(10, (int)(15.67 * 256)); - ws.SetColumnWidth(11, (int)(11.67 * 256)); + ws.SetColumnWidth(11, (int)(12 * 256)); ws.SetColumnWidth(12, (int)(8.22 * 256)); ws.SetColumnWidth(13, (int)(16.33 * 256)); - ws.SetColumnWidth(14, (int)(11.22 * 256)); - ws.SetColumnWidth(15, (int)(10.44 * 256)); - ws.SetColumnWidth(16, (int)(5.56 * 256)); - ws.SetColumnWidth(17, (int)(5.56 * 256)); - ws.SetColumnWidth(18, (int)(7.89 * 256)); + ws.SetColumnWidth(14, (int)(11.45 * 256)); + ws.SetColumnWidth(15, (int)(11.00 * 256)); + ws.SetColumnWidth(16, (int)(4.00 * 256)); + ws.SetColumnWidth(17, (int)(4.00 * 256)); + ws.SetColumnWidth(18, (int)(9.00 * 256)); ws.SetColumnWidth(19, (int)(9.33 * 256)); #endregion - - const int pageSize = 64; + + const int pageSize = 67; DataTable dt = GetDataTable(); var style3 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, false, false, "sans-serif"); @@ -370,11 +370,11 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport var distinctWelder = dt.AsEnumerable().GroupBy(row => row.Field("WelderCode")).Select(group => group.First()); decimal sumSize = decimal.Parse(dt.Compute("sum(Size)", "").ToString()); - ws.GetRow(dt.Rows.Count + 3).GetCell(0).SetCellValue("合计"); + ws.GetRow(dt.Rows.Count + 3).GetCell(0).SetCellValue("Total"); ws.GetRow(dt.Rows.Count + 3).GetCell(1).SetCellValue($"{distinctPipelineCode.Count().ToString()}"); ws.GetRow(dt.Rows.Count + 3).GetCell(3).SetCellValue($"{dt.Rows.Count}"); ws.GetRow(dt.Rows.Count + 3).GetCell(6).SetCellValue($"{sumSize}"); - ws.GetRow(dt.Rows.Count + 3).GetCell(8).SetCellValue($"{distinctWelder.Count().ToString()}"); + ws.GetRow(dt.Rows.Count + 3).GetCell(8).SetCellValue($"{distinctWelder.Count().ToString()}"); @@ -382,7 +382,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport #region 页脚部分 IFooter footer = ws.Footer; - string str = "CC7: 监理: Worley:"; + string str = " CC7: 监理: Worley:"; str += "\n\n第 &P 页,共 &N 页"; footer.Center = str;