This commit is contained in:
2024-10-10 10:35:01 +08:00
parent 94fc0c6aa5
commit 022aebc00d
45 changed files with 1525 additions and 487 deletions
@@ -36,6 +36,23 @@
.f-grid-row.Purple {
background-color: Purple;
}
/*定义父容器*/
.content {
width: 550px;
height: 30px;
background: #E4F1FB;
margin: 0 auto;
}
/*定义进度条*/
.box {
width: 0px;
height: 30px;
line-height: 30px;
text-align: center;
background: #3BAAE3;
color: #fff;
}
</style>
</head>
<body>
@@ -293,6 +310,23 @@
EnableMaximize="true" Target="Top" EnableResize="true" runat="server"
IsModal="true" Width="1000px" Height="520px">
</f:Window>
<f:Window ID="WindowExport" Hidden="true" runat="server" MinHeight="30px"
Target="Parent" ShowHeader="false" BodyPadding="0" Margin="0"
IsModal="true" Width="550px" Height="30px">
<Items>
<f:ContentPanel ShowBorder="false" Height="30px" ShowHeader="false" ID="ContentPanel3" runat="server">
<div class="content" id="content">
<div class="box" id="box"></div>
</div>
</f:ContentPanel>
</Items>
</f:Window>
<asp:ScriptManager ID="ScriptManager2" runat="server" EnablePageMethods="true">
<Scripts>
<asp:ScriptReference Path="~/res/ProcessBar.js" />
</Scripts>
</asp:ScriptManager>
</form>
<script type="text/javascript">
// 返回false,来阻止浏览器右键菜单
@@ -2,23 +2,19 @@
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using BLL;
using FineUIPro.Web.Common.ProjectSet;
using Model;
using Model.ViewModels;
using Newtonsoft.Json.Linq;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.Streaming;
@@ -30,6 +26,21 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
public partial class TestPackageManageAudit : PageBase
{
public static int percent { get; set; }
public static string url { get; set; }
[System.Web.Services.WebMethod]
public static int getPercent()
{
return percent;
}
[System.Web.Services.WebMethod]
public static string getUrl()
{
return url;
}
#region
/// <summary>
/// 试压包主键
@@ -672,7 +683,13 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
return;
}
CreateDataExcel(selectValArray);
percent = 0;
url = "";
Thread t = new Thread(new ThreadStart(() => { CreateDataExcel(selectValArray); }));
t.Start();
PageContext.RegisterStartupScript("showProcessBar()");
//CreateDataExcel(selectValArray);
}
#region
@@ -3457,7 +3474,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
ws.GetRow(rowIndex + 17).GetCell(1).CellStyle = ws.GetRow(rowIndex + 23).GetCell(1).CellStyle = ws.GetRow(rowIndex + 23).GetCell(6).CellStyle = ws.GetRow(rowIndex + 23).GetCell(11).CellStyle = style2;
#endregion
rowIndex += 19;
rowIndex += 24;
}
ws.PrintSetup.Landscape = false;
@@ -4097,10 +4114,10 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
on c.PipelineId=a.PipelineId
inner join Pipeline_Pipeline as d
on c.PipelineId=d.PipelineId
where b.PTP_ID=@PTPID and b.ProjectId=@projectId
where b.PTP_ID=@PTPID and b.ProjectId=@projectId AND c.WelderCode IS NOT NULL
) as t
group by t.PipelineCode,t.MaterialCode,t.Specification,t.jointCount,t.FjointCount,t.WelderCode,t.WelderNum,t.NdeNum,t.FNdeNum,t.NdeReportNo";
group by t.PipelineCode,t.MaterialCode,t.Specification,t.jointCount,t.FjointCount,t.WelderCode,t.WelderNum,t.NdeNum,t.FNdeNum,t.NdeReportNo
ORDER BY t.PipelineCode,t.MaterialCode,t.Specification,t.jointCount,t.FjointCount,t.WelderCode";
SqlParameter[] parms =
{
new SqlParameter("@PTPID",this.tvControlItem.SelectedNodeID),
@@ -4694,7 +4711,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
ws.GetRow(rowIndex + 7).GetCell(20).SetCellValue("Examination Report No.");
//这里创建行数据
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 8, rowIndex + 23, style, 0, 20, true);
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 8, rowIndex + 17, style, 0, 20, true);
var dStart = 0;
var dEnd = 0;
@@ -4735,20 +4752,20 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
#region
style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Left, 11, true, false);
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 23, rowIndex + 25, style, 0, 20, true);
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 18, rowIndex + 25, style, 0, 20, true);
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 23, rowIndex + 23, 0, 3));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 23, rowIndex + 23, 4, 9));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 23, rowIndex + 23, 10, 16));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 23, rowIndex + 23, 17, 20));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 0, 3));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 4, 9));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 10, 16));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 18, rowIndex + 18, 17, 20));
ws.GetRow(rowIndex + 23).GetCell(0).SetCellValue("建设/监理单位\r\nOwner/Supervision Contractor");
ws.GetRow(rowIndex + 23).GetCell(4).SetCellValue("总承包单位\r\nGeneral Contractor");
ws.GetRow(rowIndex + 23).GetCell(10).SetCellValue("检 测 单 位\r\nExamination Contractor");
ws.GetRow(rowIndex + 23).GetCell(17).SetCellValue("施 工 单 位\r\nConstruction Company");
ws.GetRow(rowIndex + 23).Height = 28 * 20;
ws.GetRow(rowIndex + 18).GetCell(0).SetCellValue("建设/监理单位\r\nOwner/Supervision Contractor");
ws.GetRow(rowIndex + 18).GetCell(4).SetCellValue("总承包单位\r\nGeneral Contractor");
ws.GetRow(rowIndex + 18).GetCell(10).SetCellValue("检 测 单 位\r\nExamination Contractor");
ws.GetRow(rowIndex + 18).GetCell(17).SetCellValue("施 工 单 位\r\nConstruction Company");
ws.GetRow(rowIndex + 18).Height = 28 * 20;
var style1 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 11, true, false);
ws.GetRow(rowIndex + 23).GetCell(0).CellStyle = ws.GetRow(rowIndex + 23).GetCell(4).CellStyle = ws.GetRow(rowIndex + 23).GetCell(10).CellStyle = ws.GetRow(rowIndex + 23).GetCell(17).CellStyle = style1;
ws.GetRow(rowIndex + 18).GetCell(0).CellStyle = ws.GetRow(rowIndex + 18).GetCell(4).CellStyle = ws.GetRow(rowIndex + 18).GetCell(10).CellStyle = ws.GetRow(rowIndex + 18).GetCell(17).CellStyle = style1;
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 19, rowIndex + 19, 0, 3));
@@ -6997,8 +7014,8 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
ws.GetRow(rowIndex + 16).GetCell(0).SetCellValue("临时加固措施、盲板位置与标识符和施工方案要求。Temporary reinforcement measures, blind position and markings must be incompliance with Specification.");
ws.GetRow(rowIndex + 17).GetCell(0).CellStyle = style2;
ws.GetRow(rowIndex + 17).GetCell(0).SetCellValue("焊接接头及需要检验的部位未被覆盖。Welds and other positions to be tested have not yet been painted and heat-insulated.");
ws.GetRow(rowIndex + 23).GetCell(0).CellStyle = style2;
ws.GetRow(rowIndex + 23).GetCell(0).SetCellValue("试压用压力表量程、精度等级、检定状态符合规范要求。Scale, accuracy and calibration state of test use pressure gauge must be incompliance with specification. ");
ws.GetRow(rowIndex + 18).GetCell(0).CellStyle = style2;
ws.GetRow(rowIndex + 18).GetCell(0).SetCellValue("试压用压力表量程、精度等级、检定状态符合规范要求。Scale, accuracy and calibration state of test use pressure gauge must be incompliance with specification. ");
ws.GetRow(rowIndex + 19).GetCell(0).CellStyle = style2;
ws.GetRow(rowIndex + 19).GetCell(0).SetCellValue("不锈钢管道试验用水符合规范要求。Test use water of stainless steel pipline must be incompliance with specification.");
@@ -7296,7 +7313,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
ws.GetRow(rowIndex + 15).GetCell(0).SetCellValue("所有的阀门涂油脂和试压已经完成。All valves have been greased and stroked.");
ws.GetRow(rowIndex + 16).GetCell(0).SetCellValue("螺纹连接根据规范要求进行。Compound on screwed connections in accordance with specification.");
ws.GetRow(rowIndex + 17).GetCell(0).SetCellValue("安装所有的制动装置和联动装置。All locking device/interlocks installed.");
ws.GetRow(rowIndex + 23).GetCell(0).SetCellValue("检查和确定弹簧支架、滑动支架装置。Spring Support,Gags removed&support settings confirmed/Checked.");
ws.GetRow(rowIndex + 18).GetCell(0).SetCellValue("检查和确定弹簧支架、滑动支架装置。Spring Support,Gags removed&support settings confirmed/Checked.");
ws.GetRow(rowIndex + 19).GetCell(0).SetCellValue("如果需要,释放给化学清洗、油洗。System released for chemical cleaning /hot oil flushing ,if required.");
#endregion
@@ -7584,6 +7601,9 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
hssfworkbook = (XSSFWorkbook)WorkbookFactory.Create(file);
}
int totalNum = templateFileIds.Count();
int rowIndex = 1;
//操作目录模版sheet是否存在,不存在就把对应的sheet删除掉(特殊处理)
int index = 0;
if (!templateFileIds.Contains("2BEFB0F4-A466-4C59-963F-9092BACF2E52"))
@@ -7743,6 +7763,13 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
break;
}
if ((int)(90 * (rowIndex) / totalNum) > percent)
{
percent = (int)(100 * (rowIndex) / totalNum);
}
rowIndex++;
}
//生成第{N}个模版
@@ -7751,22 +7778,26 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
hssfworkbook.Write(filess);
}
try
{
FileInfo filet = new FileInfo(ReportFileName);
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", filet.Length.ToString());
Response.TransmitFile(ReportFileName, 0, filet.Length);
Response.Flush();
Response.Close();
System.IO.File.Delete(ReportFileName);
}
catch (Exception ex)
{
BLL.ErrLogInfo.WriteLog(ex.Message);
}
percent = 100;
url = ReportFileName.Replace(Server.MapPath("~/"), "");
//try
//{
// FileInfo filet = new FileInfo(ReportFileName);
// 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", filet.Length.ToString());
// Response.TransmitFile(ReportFileName, 0, filet.Length);
// Response.Flush();
// Response.Close();
// System.IO.File.Delete(ReportFileName);
//}
//catch (Exception ex)
//{
// BLL.ErrLogInfo.WriteLog(ex.Message);
//}
}
@@ -616,5 +616,32 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// WindowExport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowExport;
/// <summary>
/// ContentPanel3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel3;
/// <summary>
/// ScriptManager2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.ScriptManager ScriptManager2;
}
}