From 28920d8132089d36b6bdb52e581195e104086435 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Fri, 30 May 2025 17:08:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?20250530=20=E6=8A=A5=E8=A1=A8=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HJGL_DS/FineUIPro.Web/ErrLog.txt | 33 +- .../File/Fastreport/射线检测报告(新).frx | 4 +- .../File/Fastreport/射线检测报告.frx | 4 +- .../File/Fastreport/射线检测结果确认表.frx | 309 ++++++++++++ .../File/Fastreport/射线检测记录.frx | 4 +- .../File/Fastreport/渗透检测记录.frx | 4 +- .../File/Fastreport/管道焊口检测委托单.frx | 4 +- .../File/Fastreport/管道焊接工作记录.frx | 4 +- .../File/Fastreport/管道焊缝检测委托单.frx | 4 +- .../File/Fastreport/管道返修焊接工作记录.frx | 4 +- .../File/Fastreport/超声检测记录.frx | 4 +- .../Fastreport/项目管理部焊缝检测委托单.frx | 4 +- .../FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- .../HJGL/CheckManage/CheckRecordPrint.aspx.cs | 2 +- .../CheckManage/ReCheckRecordPrint.aspx.cs | 128 ++++- .../RepairCheckRecordPrint.aspx.cs | 474 ++++++++++++++++-- .../WeldingReport/RTTestingResult.aspx.cs | 104 +++- HJGL_DS/FineUIPro.Web/Web.config | 4 +- HJGL_DS/WebAPI/WebAPI.csproj.user | 2 +- 19 files changed, 1019 insertions(+), 79 deletions(-) create mode 100644 HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx diff --git a/HJGL_DS/FineUIPro.Web/ErrLog.txt b/HJGL_DS/FineUIPro.Web/ErrLog.txt index 5f28270..e1c9f00 100644 --- a/HJGL_DS/FineUIPro.Web/ErrLog.txt +++ b/HJGL_DS/FineUIPro.Web/ErrLog.txt @@ -1 +1,32 @@ - \ No newline at end of file + +错误信息开始=====> +错误类型:SqlException +错误信息:在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - 定位指定的服务器/实例时出错) +错误堆栈: + 在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) + 在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) + 在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) + 在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) + 在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) + 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) + 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) + 在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) + 在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) + 在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) + 在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) + 在 System.Data.SqlClient.SqlConnection.Open() + 在 System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) + 在 System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() + 在 System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() + 在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) + 在 System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression) + 在 BLL.Sys_UserService.UserLogOn(String account, String password, Boolean rememberMe, Page page) 位置 E:\鼎盛\HJGL_DS\HJGL_DS\BLL\Common\SysManage\Sys_UserService.cs:行号 39 + 在 FineUIPro.Web.Login.btnLogin_Click(Object sender, EventArgs e) + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:05/27/2025 16:56:28 +出错文件:http://localhost:64304/Login.aspx +IP地址:::1 + +出错时间:05/27/2025 16:56:28 + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告(新).frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告(新).frx index 08c796c..964d488 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告(新).frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告(新).frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -63,7 +63,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告.frx index 3d6174d..fbd7847 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测报告.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -69,7 +69,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx new file mode 100644 index 0000000..b5b26a5 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx @@ -0,0 +1,309 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Table3_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Table3.PrintRow(0); + Table3.PrintColumns(); + + // go next data source row + rowData.Next(); + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测记录.frx index fcc3acd..9b66b73 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/渗透检测记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/渗透检测记录.frx index c1a022e..5bc373a 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/渗透检测记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/渗透检测记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊口检测委托单.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊口检测委托单.frx index 6850672..e818c25 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊口检测委托单.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊口检测委托单.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接工作记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接工作记录.frx index daf86a9..f3ff59e 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接工作记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接工作记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -50,7 +50,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊缝检测委托单.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊缝检测委托单.frx index 498c2af..31cf295 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊缝检测委托单.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊缝检测委托单.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -41,7 +41,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道返修焊接工作记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道返修焊接工作记录.frx index c83dedf..bdf7575 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道返修焊接工作记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道返修焊接工作记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -63,7 +63,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/超声检测记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/超声检测记录.frx index b520f61..dcf10c7 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/超声检测记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/超声检测记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/项目管理部焊缝检测委托单.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/项目管理部焊缝检测委托单.frx index 5d99f66..d3f6788 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/项目管理部焊缝检测委托单.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/项目管理部焊缝检测委托单.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index 8aa7c11..bf54086 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ true - Release|Any CPU + Debug|Any CPU diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/CheckRecordPrint.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/CheckRecordPrint.aspx.cs index 6cfabbf..5b0f046 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/CheckRecordPrint.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/CheckRecordPrint.aspx.cs @@ -302,7 +302,7 @@ namespace FineUIPro.Web.HJGL.CheckManage dt.Rows.Add(newRows); } BLL.Common.FastReportService.AddFastreportTable(dt); - + List listStr2 = new List(); listStr2.Add(new SqlParameter("@CH_TrustID", trustId)); listStr2.Add(new SqlParameter("@ISO_ID", isoId)); diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/ReCheckRecordPrint.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/ReCheckRecordPrint.aspx.cs index 1f25fa0..c3b2001 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/ReCheckRecordPrint.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/ReCheckRecordPrint.aspx.cs @@ -5,6 +5,7 @@ using BLL; using System.Data.SqlClient; using System.Data; using System.Web; +using System.IO; namespace FineUIPro.Web.HJGL.CheckManage { @@ -175,10 +176,131 @@ namespace FineUIPro.Web.HJGL.CheckManage trust.ReRecord_PrintDate = DateTime.Now; BLL.HJGL_TrustManageEditService.UpdateCH_Trust(trust); + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); - string reportId = BLL.Const.HJGL_ReRTCheckRecordId;//报表Id - string replaceParameter = HttpUtility.UrlEncodeUnicode(trustId + "|" + isoId + "|" + "0" + "|" + desc + "|" + "1" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_ID); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&projectId=0", reportId, replaceParameter))); + //string reportId1 = string.Empty;//报表Id + //string reportId2 = string.Empty; + //int rowNum = 0; + //string varValue = string.Empty; + //int count = 0; + var ndtType = BLL.HJGL_TestingService.GetTestingByTestingId(trust.CH_NDTMethod); + + if (ndtType.NDT_Code == "RT") + { + var listTitleStr = new List(); + listTitleStr.Add(new SqlParameter("@CH_TrustID", trustId)); + listTitleStr.Add(new SqlParameter("@ISO_ID", isoId)); + listTitleStr.Add(new SqlParameter("@IsRepair", "0")); + listTitleStr.Add(new SqlParameter("@Desc", desc)); + listTitleStr.Add(new SqlParameter("@Flag", "")); + listTitleStr.Add(new SqlParameter("@STE_Code", ndtType.NDT_Code)); + SqlParameter[] titleparameter = listTitleStr.ToArray(); + var tbTitle = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecord", titleparameter); + + DataTable dt = new DataTable(); + dt.TableName = "MainData"; + dt.Columns.Add("TestEngineeringCode"); + dt.Columns.Add("GuideBookCode"); + dt.Columns.Add("RecordCode"); + dt.Columns.Add("TrustUnitName"); + dt.Columns.Add("ConUnitName"); + dt.Columns.Add("CH_TrustDate"); + dt.Columns.Add("ProjectName"); + dt.Columns.Add("ProjectCode"); + dt.Columns.Add("TrustManName"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("JST_Name"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("WME_Name"); + dt.Columns.Add("IsHot"); + dt.Columns.Add("AcceptGrade2"); + DataRow[] rows = tbTitle.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["TestEngineeringCode"] = row["TestEngineeringCode"].ToString(); + newRows["GuideBookCode"] = row["GuideBookCode"].ToString(); + newRows["RecordCode"] = row["RecordCode"].ToString(); + newRows["TrustUnitName"] = row["TrustUnitName"].ToString(); + newRows["ConUnitName"] = row["ConUnitName"].ToString(); + newRows["CH_TrustDate"] = string.Format("{0:yyyy-MM-dd}", row["CH_TrustDate"]).ToString(); + newRows["ProjectName"] = row["ProjectName"].ToString(); + newRows["ProjectCode"] = row["ProjectCode"].ToString(); + newRows["TrustManName"] = row["TrustManName"].ToString(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["JST_Name"] = row["JST_Name"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["WME_Name"] = row["WME_Name"].ToString(); + newRows["IsHot"] = row["IsHot"].ToString(); + newRows["AcceptGrade2"] = row["AcceptGrade2"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + var wme = BLL.HJGL_WeldingMethodService.GetWeldMethodByWMEID(wME_ID); + + List listStr2 = new List(); + listStr2.Add(new SqlParameter("@CH_TrustID", trustId)); + listStr2.Add(new SqlParameter("@ISO_ID", isoId)); + listStr2.Add(new SqlParameter("@IsRepair", "0")); + listStr2.Add(new SqlParameter("@Desc", desc)); + listStr2.Add(new SqlParameter("@Flag", "")); + listStr2.Add(new SqlParameter("@STE_Code", sTE_Code)); + listStr2.Add(new SqlParameter("@STE_ID", sTE_ID)); + listStr2.Add(new SqlParameter("@STE_ID2", sTE_ID2)); + listStr2.Add(new SqlParameter("@WME_Name", wme.WME_Name)); + SqlParameter[] parameter = listStr2.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustItemRecordRT", parameter); + + DataTable dtItem = new DataTable(); + dtItem.TableName = "Data"; + dtItem.Columns.Add("Num"); + dtItem.Columns.Add("JOT_JointNo"); + dtItem.Columns.Add("JOT_JointDesc"); + dtItem.Columns.Add("WED_Code"); + dtItem.Columns.Add("FilmNum"); + dtItem.Columns.Add("CheckAddress"); + + DataRow[] itemRows = tb.DefaultView.ToTable().Select(); + int i = 0; + foreach (var row in itemRows) + { + var newRows = dtItem.NewRow(); + newRows["Num"] = (i + 1).ToString(); + newRows["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRows["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRows["WED_Code"] = row["WED_Code"].ToString(); + newRows["FilmNum"] = row["FilmNum"].ToString(); + newRows["CheckAddress"] = row["CheckAddress"].ToString(); + dtItem.Rows.Add(newRows); + i++; + } + BLL.Common.FastReportService.AddFastreportTable(dtItem); + + + //传参 + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("JointCount", jointCount.ToString()); + //keyValuePairs.Add("CheckCount", (rows.Count() - 1).ToString()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\射线检测记录.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + } + + } + //string reportId = BLL.Const.HJGL_ReRTCheckRecordId;//报表Id + //string replaceParameter = HttpUtility.UrlEncodeUnicode(trustId + "|" + isoId + "|" + "0" + "|" + desc + "|" + "1" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_ID); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&projectId=0", reportId, replaceParameter))); } BindGrid(); diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RepairCheckRecordPrint.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RepairCheckRecordPrint.aspx.cs index eace782..70ed3b0 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RepairCheckRecordPrint.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RepairCheckRecordPrint.aspx.cs @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using BLL; using System.Data.SqlClient; using System.Data; +using System.IO; namespace FineUIPro.Web.HJGL.CheckManage { @@ -228,18 +229,18 @@ namespace FineUIPro.Web.HJGL.CheckManage string sTE_ID = Grid1.DataKeys[Grid1.SelectedRowIndex][3].ToString(); string sTE_ID2 = Grid1.DataKeys[Grid1.SelectedRowIndex][4].ToString(); string wME_Name = Grid1.DataKeys[Grid1.SelectedRowIndex][5].ToString(); - List listStr = new List(); - listStr.Add(new SqlParameter("@CH_TrustID", repairId)); - listStr.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); - listStr.Add(new SqlParameter("@Desc", desc)); - listStr.Add(new SqlParameter("@Flag", "0")); - listStr.Add(new SqlParameter("@IsRepair", "1")); - listStr.Add(new SqlParameter("@STE_Code", sTE_Code)); - listStr.Add(new SqlParameter("@STE_ID", sTE_ID)); - listStr.Add(new SqlParameter("@STE_ID2", sTE_ID2)); - listStr.Add(new SqlParameter("@WME_Name", wME_Name)); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = null; + //List listStr = new List(); + //listStr.Add(new SqlParameter("@CH_TrustID", repairId)); + //listStr.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + //listStr.Add(new SqlParameter("@Desc", desc)); + //listStr.Add(new SqlParameter("@Flag", "0")); + //listStr.Add(new SqlParameter("@IsRepair", "1")); + //listStr.Add(new SqlParameter("@STE_Code", sTE_Code)); + //listStr.Add(new SqlParameter("@STE_ID", sTE_ID)); + //listStr.Add(new SqlParameter("@STE_ID2", sTE_ID2)); + //listStr.Add(new SqlParameter("@WME_Name", wME_Name)); + //SqlParameter[] parameter = listStr.ToArray(); + //DataTable tb = null; string isoNo = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(repair.ISO_ID).ISO_IsoNo; // PT,MT,UT调用一个存储过程 if (repair != null) @@ -251,9 +252,13 @@ namespace FineUIPro.Web.HJGL.CheckManage repair.Record_Printer = this.CurrUser.UserName; repair.Record_PrintDate = DateTime.Now; BLL.HJGL_RepairService.RecordPrintCH_Repair(repair); - string reportId1 = string.Empty;//报表Id - string reportId2 = string.Empty; - int rowNum = 0; + //string reportId1 = string.Empty;//报表Id + //string reportId2 = string.Empty; + //int rowNum = 0; + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + var ndtType = BLL.HJGL_TestingService.GetTestingByTestingId(repair.NDT_ID); if (ndtType.NDT_Code == "RT") { @@ -263,11 +268,112 @@ namespace FineUIPro.Web.HJGL.CheckManage fileCode.FileCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode3ByProjectId", "dbo.Base_PrintFileCode", isoNo, repair.ProjectId, BLL.Base_ProjectService.GetProjectCode(repair.ProjectId) + "-" + isoNo + "-RT-"); fileCode.FileId = repair.CH_RepairID; fileCode.FileCode2 = fileCode.FileCode.Replace(isoNo, ""); - BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); - reportId1 = BLL.Const.HJGL_RTCheckRecordReportId1; - reportId2 = BLL.Const.HJGL_RTCheckRecordReportId2; - rowNum = 18; - tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustItemRecordRT", parameter); + BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); + //reportId1 = BLL.Const.HJGL_RTCheckRecordReportId1; + //reportId2 = BLL.Const.HJGL_RTCheckRecordReportId2; + //rowNum = 18; + //tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustItemRecordRT", parameter); + + var listTitleStr = new List(); + listTitleStr.Add(new SqlParameter("@CH_TrustID", repairId)); + listTitleStr.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listTitleStr.Add(new SqlParameter("@IsRepair", "1")); + listTitleStr.Add(new SqlParameter("@Desc", desc)); + listTitleStr.Add(new SqlParameter("@Flag", "")); + listTitleStr.Add(new SqlParameter("@STE_Code", ndtType.NDT_Code)); + SqlParameter[] titleparameter = listTitleStr.ToArray(); + var tbTitle = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecord", titleparameter); + + DataTable dt = new DataTable(); + dt.TableName = "MainData"; + dt.Columns.Add("TestEngineeringCode"); + dt.Columns.Add("GuideBookCode"); + dt.Columns.Add("RecordCode"); + dt.Columns.Add("TrustUnitName"); + dt.Columns.Add("ConUnitName"); + dt.Columns.Add("CH_TrustDate"); + dt.Columns.Add("ProjectName"); + dt.Columns.Add("ProjectCode"); + dt.Columns.Add("TrustManName"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("JST_Name"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("WME_Name"); + dt.Columns.Add("IsHot"); + dt.Columns.Add("AcceptGrade2"); + DataRow[] rows = tbTitle.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["TestEngineeringCode"] = row["TestEngineeringCode"].ToString(); + newRows["GuideBookCode"] = row["GuideBookCode"].ToString(); + newRows["RecordCode"] = row["RecordCode"].ToString(); + newRows["TrustUnitName"] = row["TrustUnitName"].ToString(); + newRows["ConUnitName"] = row["ConUnitName"].ToString(); + newRows["CH_TrustDate"] = string.Format("{0:yyyy-MM-dd}", row["CH_TrustDate"]).ToString(); + newRows["ProjectName"] = row["ProjectName"].ToString(); + newRows["ProjectCode"] = row["ProjectCode"].ToString(); + newRows["TrustManName"] = row["TrustManName"].ToString(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["JST_Name"] = row["JST_Name"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["WME_Name"] = row["WME_Name"].ToString(); + newRows["IsHot"] = row["IsHot"].ToString(); + newRows["AcceptGrade2"] = row["AcceptGrade2"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + List listStr2 = new List(); + listStr2.Add(new SqlParameter("@CH_TrustID", repairId)); + listStr2.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listStr2.Add(new SqlParameter("@IsRepair", "1")); + listStr2.Add(new SqlParameter("@Desc", desc)); + listStr2.Add(new SqlParameter("@Flag", "")); + listStr2.Add(new SqlParameter("@STE_Code", sTE_Code)); + listStr2.Add(new SqlParameter("@STE_ID", sTE_ID)); + listStr2.Add(new SqlParameter("@STE_ID2", sTE_ID2)); + listStr2.Add(new SqlParameter("@WME_Name", wME_Name)); + SqlParameter[] parameter = listStr2.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustItemRecordRT", parameter); + + DataTable dtItem = new DataTable(); + dtItem.TableName = "Data"; + dtItem.Columns.Add("Num"); + dtItem.Columns.Add("JOT_JointNo"); + dtItem.Columns.Add("JOT_JointDesc"); + dtItem.Columns.Add("WED_Code"); + dtItem.Columns.Add("FilmNum"); + dtItem.Columns.Add("CheckAddress"); + + DataRow[] itemRows = tb.DefaultView.ToTable().Select(); + int i = 0; + foreach (var row in itemRows) + { + var newRows = dtItem.NewRow(); + newRows["Num"] = (i + 1).ToString(); + newRows["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRows["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRows["WED_Code"] = row["WED_Code"].ToString(); + newRows["FilmNum"] = row["FilmNum"].ToString(); + newRows["CheckAddress"] = row["CheckAddress"].ToString(); + dtItem.Rows.Add(newRows); + i++; + } + BLL.Common.FastReportService.AddFastreportTable(dtItem); + + + //传参 + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("JointCount", jointCount.ToString()); + //keyValuePairs.Add("CheckCount", (rows.Count() - 1).ToString()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\射线检测记录.frx"; + } else if (ndtType.NDT_Code == "PT") { @@ -277,11 +383,98 @@ namespace FineUIPro.Web.HJGL.CheckManage fileCode.FileCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode3ByProjectId", "dbo.Base_PrintFileCode", isoNo, repair.ProjectId, BLL.Base_ProjectService.GetProjectCode(repair.ProjectId) + "-" + isoNo + "-PT-"); fileCode.FileId = repair.CH_RepairID; fileCode.FileCode2 = fileCode.FileCode.Replace(isoNo, ""); - BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); - reportId1 = BLL.Const.HJGL_PTCheckRecordReportId1; - reportId2 = BLL.Const.HJGL_PTCheckRecordReportId2; - rowNum = 15; - tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); + BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); + var listTitleStr = new List(); + listTitleStr.Add(new SqlParameter("@CH_TrustID", repairId)); + listTitleStr.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listTitleStr.Add(new SqlParameter("@IsRepair", "1")); + listTitleStr.Add(new SqlParameter("@Desc", desc)); + listTitleStr.Add(new SqlParameter("@Flag", "")); + listTitleStr.Add(new SqlParameter("@STE_Code", ndtType.NDT_Code)); + SqlParameter[] titleparameter = listTitleStr.ToArray(); + var tbTitle = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecord", titleparameter); + + DataTable dt = new DataTable(); + dt.TableName = "MainData"; + dt.Columns.Add("TestEngineeringCode"); + dt.Columns.Add("RecordCode"); + dt.Columns.Add("TrustUnitName"); + dt.Columns.Add("ConUnitName"); + dt.Columns.Add("CH_TrustDate"); + dt.Columns.Add("ProjectName"); + dt.Columns.Add("ProjectCode"); + dt.Columns.Add("TrustManName"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("CH_NDTCriteria"); + dt.Columns.Add("AcceptGrade"); + DataRow[] rows = tbTitle.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["TestEngineeringCode"] = row["TestEngineeringCode"].ToString(); + newRows["RecordCode"] = row["RecordCode"].ToString(); + newRows["TrustUnitName"] = row["TrustUnitName"].ToString(); + newRows["ConUnitName"] = row["ConUnitName"].ToString(); + newRows["CH_TrustDate"] = string.Format("{0:yyyy-MM-dd}", row["CH_TrustDate"]).ToString(); + newRows["ProjectName"] = row["ProjectName"].ToString(); + newRows["ProjectCode"] = row["ProjectCode"].ToString(); + newRows["TrustManName"] = row["TrustManName"].ToString(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["CH_NDTCriteria"] = row["CH_NDTCriteria"].ToString(); + newRows["AcceptGrade"] = row["AcceptGrade"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + List listStr2 = new List(); + listStr2.Add(new SqlParameter("@CH_TrustID", repairId)); + listStr2.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listStr2.Add(new SqlParameter("@IsRepair", "1")); + listStr2.Add(new SqlParameter("@Desc", desc)); + listStr2.Add(new SqlParameter("@Flag", "")); + listStr2.Add(new SqlParameter("@STE_Code", sTE_Code)); + listStr2.Add(new SqlParameter("@STE_ID", sTE_ID)); + listStr2.Add(new SqlParameter("@STE_ID2", sTE_ID2)); + listStr2.Add(new SqlParameter("@WME_Name", wME_Name)); + SqlParameter[] parameter = listStr2.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); + + DataTable dtItem = new DataTable(); + dtItem.TableName = "Data"; + dtItem.Columns.Add("Number"); + dtItem.Columns.Add("JOT_JointNo"); + dtItem.Columns.Add("Specification"); + dtItem.Columns.Add("WED_Code"); + + DataRow[] itemRows = tb.DefaultView.ToTable().Select(); + + foreach (var row in itemRows) + { + var newRows = dtItem.NewRow(); + newRows["Number"] = row["Number"].ToString(); + newRows["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRows["Specification"] = row["Specification"].ToString(); + newRows["WED_Code"] = row["WED_Code"].ToString(); + dtItem.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dtItem); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("JointCount", jointCount.ToString()); + //keyValuePairs.Add("CheckCount", (rows.Count() - 1).ToString()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\渗透检测记录.frx"; + //reportId1 = BLL.Const.HJGL_PTCheckRecordReportId1; + //reportId2 = BLL.Const.HJGL_PTCheckRecordReportId2; + //rowNum = 15; + //tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); } else if (ndtType.NDT_Code == "MT") { @@ -291,11 +484,103 @@ namespace FineUIPro.Web.HJGL.CheckManage fileCode.FileCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode3ByProjectId", "dbo.Base_PrintFileCode", isoNo, repair.ProjectId, BLL.Base_ProjectService.GetProjectCode(repair.ProjectId) + "-" + isoNo + "-MT-"); fileCode.FileId = repair.CH_RepairID; fileCode.FileCode2 = fileCode.FileCode.Replace(isoNo, ""); - BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); - reportId1 = BLL.Const.HJGL_MTCheckRecordReportId1; - reportId2 = BLL.Const.HJGL_MTCheckRecordReportId2; - rowNum = 15; - tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); + BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); + + var listTitleStr = new List(); + listTitleStr.Add(new SqlParameter("@CH_TrustID", repairId)); + listTitleStr.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listTitleStr.Add(new SqlParameter("@IsRepair", "1")); + listTitleStr.Add(new SqlParameter("@Desc", desc)); + listTitleStr.Add(new SqlParameter("@Flag", "")); + listTitleStr.Add(new SqlParameter("@STE_Code", ndtType.NDT_Code)); + SqlParameter[] titleparameter = listTitleStr.ToArray(); + var tbTitle = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecord", titleparameter); + + DataTable dt = new DataTable(); + dt.TableName = "MainData"; + dt.Columns.Add("TestEngineeringCode"); + dt.Columns.Add("GuideBookCode"); + dt.Columns.Add("RecordCode"); + dt.Columns.Add("TrustUnitName"); + dt.Columns.Add("ConUnitName"); + dt.Columns.Add("CH_TrustDate"); + dt.Columns.Add("ProjectName"); + dt.Columns.Add("ProjectCode"); + dt.Columns.Add("TrustManName"); + dt.Columns.Add("BatchCode"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("CH_NDTCriteria"); + dt.Columns.Add("AcceptGrade"); + DataRow[] rows = tbTitle.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["TestEngineeringCode"] = row["TestEngineeringCode"].ToString(); + newRows["GuideBookCode"] = row["GuideBookCode"].ToString(); + newRows["RecordCode"] = row["RecordCode"].ToString(); + newRows["TrustUnitName"] = row["TrustUnitName"].ToString(); + newRows["ConUnitName"] = row["ConUnitName"].ToString(); + newRows["CH_TrustDate"] = string.Format("{0:yyyy-MM-dd}", row["CH_TrustDate"]).ToString(); + newRows["ProjectName"] = row["ProjectName"].ToString(); + newRows["ProjectCode"] = row["ProjectCode"].ToString(); + newRows["TrustManName"] = row["TrustManName"].ToString(); + newRows["BatchCode"] = row["BatchCode"].ToString(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["CH_NDTCriteria"] = row["CH_NDTCriteria"].ToString(); + newRows["AcceptGrade"] = row["AcceptGrade"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + List listStr2 = new List(); + listStr2.Add(new SqlParameter("@CH_TrustID", repairId)); + listStr2.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listStr2.Add(new SqlParameter("@IsRepair", "1")); + listStr2.Add(new SqlParameter("@Desc", desc)); + listStr2.Add(new SqlParameter("@Flag", "")); + listStr2.Add(new SqlParameter("@STE_Code", sTE_Code)); + listStr2.Add(new SqlParameter("@STE_ID", sTE_ID)); + listStr2.Add(new SqlParameter("@STE_ID2", sTE_ID2)); + listStr2.Add(new SqlParameter("@WME_Name", wME_Name)); + SqlParameter[] parameter = listStr2.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); + + DataTable dtItem = new DataTable(); + dtItem.TableName = "Data"; + dtItem.Columns.Add("Number"); + dtItem.Columns.Add("JOT_JointNo"); + dtItem.Columns.Add("Specification"); + dtItem.Columns.Add("WED_Code"); + + DataRow[] itemRows = tb.DefaultView.ToTable().Select(); + + foreach (var row in itemRows) + { + var newRows = dtItem.NewRow(); + newRows["Number"] = row["Number"].ToString(); + newRows["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRows["Specification"] = row["Specification"].ToString(); + newRows["WED_Code"] = row["WED_Code"].ToString(); + dtItem.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dtItem); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("JointCount", jointCount.ToString()); + //keyValuePairs.Add("CheckCount", (rows.Count() - 1).ToString()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\磁粉检测记录.frx"; + //reportId1 = BLL.Const.HJGL_MTCheckRecordReportId1; + //reportId2 = BLL.Const.HJGL_MTCheckRecordReportId2; + //rowNum = 15; + //tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); } else if (ndtType.NDT_Code == "UT" || ndtType.NDT_Code == "PAUT") { @@ -305,27 +590,124 @@ namespace FineUIPro.Web.HJGL.CheckManage fileCode.FileCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode3ByProjectId", "dbo.Base_PrintFileCode", isoNo, repair.ProjectId, BLL.Base_ProjectService.GetProjectCode(repair.ProjectId) + "-" + isoNo + "-UT-"); fileCode.FileId = repair.CH_RepairID; fileCode.FileCode2 = fileCode.FileCode.Replace(isoNo, ""); - BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); - reportId1 = BLL.Const.HJGL_UTCheckRecordReportId1; - reportId2 = BLL.Const.HJGL_UTCheckRecordReportId2; - rowNum = 15; - tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); - } + BLL.Base_PrintFileCodeService.AddPrintFileCode(fileCode); - if (tb.Rows.Count <= rowNum) + var listTitleStr = new List(); + listTitleStr.Add(new SqlParameter("@CH_TrustID", repairId)); + listTitleStr.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listTitleStr.Add(new SqlParameter("@IsRepair", "1")); + listTitleStr.Add(new SqlParameter("@Desc", desc)); + listTitleStr.Add(new SqlParameter("@Flag", "")); + listTitleStr.Add(new SqlParameter("@STE_Code", ndtType.NDT_Code)); + SqlParameter[] titleparameter = listTitleStr.ToArray(); + var tbTitle = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecord", titleparameter); + + DataTable dt = new DataTable(); + dt.TableName = "MainData"; + dt.Columns.Add("TestEngineeringCode"); + dt.Columns.Add("RecordCode"); + dt.Columns.Add("TrustUnitName"); + dt.Columns.Add("ConUnitName"); + dt.Columns.Add("CH_TrustDate"); + dt.Columns.Add("ProjectName"); + dt.Columns.Add("ProjectCode"); + dt.Columns.Add("TrustManName"); + dt.Columns.Add("BatchCode"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("WME_Name"); + dt.Columns.Add("IsHot"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("CH_NDTCriteria"); + dt.Columns.Add("AcceptGrade"); + DataRow[] rows = tbTitle.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["TestEngineeringCode"] = row["TestEngineeringCode"].ToString(); + newRows["RecordCode"] = row["RecordCode"].ToString(); + newRows["TrustUnitName"] = row["TrustUnitName"].ToString(); + newRows["ConUnitName"] = row["ConUnitName"].ToString(); + newRows["CH_TrustDate"] = string.Format("{0:yyyy-MM-dd}", row["CH_TrustDate"]).ToString(); + newRows["ProjectName"] = row["ProjectName"].ToString(); + newRows["ProjectCode"] = row["ProjectCode"].ToString(); + newRows["TrustManName"] = row["TrustManName"].ToString(); + newRows["BatchCode"] = row["BatchCode"].ToString(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["WME_Name"] = row["WME_Name"].ToString(); + newRows["IsHot"] = row["IsHot"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["CH_NDTCriteria"] = row["CH_NDTCriteria"].ToString(); + newRows["AcceptGrade"] = row["AcceptGrade"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + List listStr2 = new List(); + listStr2.Add(new SqlParameter("@CH_TrustID", repairId)); + listStr2.Add(new SqlParameter("@ISO_ID", repair.ISO_ID)); + listStr2.Add(new SqlParameter("@IsRepair", "1")); + listStr2.Add(new SqlParameter("@Desc", desc)); + listStr2.Add(new SqlParameter("@Flag", "")); + listStr2.Add(new SqlParameter("@STE_Code", sTE_Code)); + listStr2.Add(new SqlParameter("@STE_ID", sTE_ID)); + listStr2.Add(new SqlParameter("@STE_ID2", sTE_ID2)); + listStr2.Add(new SqlParameter("@WME_Name", wME_Name)); + SqlParameter[] parameter = listStr2.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordUTItem", parameter); + + DataTable dtItem = new DataTable(); + dtItem.TableName = "Data"; + dtItem.Columns.Add("Number"); + dtItem.Columns.Add("JOT_JointNo"); + dtItem.Columns.Add("Specification"); + dtItem.Columns.Add("WED_Code"); + + DataRow[] itemRows = tb.DefaultView.ToTable().Select(); + + foreach (var row in itemRows) + { + var newRows = dtItem.NewRow(); + newRows["Number"] = row["Number"].ToString(); + newRows["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRows["Specification"] = row["Specification"].ToString(); + newRows["WED_Code"] = row["WED_Code"].ToString(); + dtItem.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dtItem); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("JointCount", jointCount.ToString()); + //keyValuePairs.Add("CheckCount", (rows.Count() - 1).ToString()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\超声检测记录.frx"; + //reportId1 = BLL.Const.HJGL_UTCheckRecordReportId1; + //reportId2 = BLL.Const.HJGL_UTCheckRecordReportId2; + //rowNum = 15; + //tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_sp_rpt_TrustRecordPTItem", parameter); + } + if (File.Exists(rootPath + initTemplatePath)) { - string replaceParameter = HttpUtility.UrlEncodeUnicode(repairId + "|" + repair.ISO_ID + "|" + "1" + "|" + desc + "|" + "1" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_Name); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId1, replaceParameter, string.Empty))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); } + //if (tb.Rows.Count <= rowNum) + //{ + // string replaceParameter = HttpUtility.UrlEncodeUnicode(repairId + "|" + repair.ISO_ID + "|" + "1" + "|" + desc + "|" + "1" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_Name); + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId1, replaceParameter, string.Empty))); + //} - else - { - string replaceParameter1 = HttpUtility.UrlEncodeUnicode(repairId + "|" + repair.ISO_ID + "|" + "1" + "|" + desc + "|" + "1" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_Name); - string replaceParameter2 = HttpUtility.UrlEncodeUnicode(repairId + "|" + repair.ISO_ID + "|" + "1" + "|" + desc + "|" + "2" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_Name); + //else + //{ + // string replaceParameter1 = HttpUtility.UrlEncodeUnicode(repairId + "|" + repair.ISO_ID + "|" + "1" + "|" + desc + "|" + "1" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_Name); + // string replaceParameter2 = HttpUtility.UrlEncodeUnicode(repairId + "|" + repair.ISO_ID + "|" + "1" + "|" + desc + "|" + "2" + "|" + sTE_Code + "|" + sTE_ID + "|" + sTE_ID2 + "|" + wME_Name); - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId2, replaceParameter2, string.Empty))); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId1, replaceParameter1, string.Empty))); - } + // PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId2, replaceParameter2, string.Empty))); + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId1, replaceParameter1, string.Empty))); + //} } } if (e.CommandName == "fileName")//文档名 diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/RTTestingResult.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/RTTestingResult.aspx.cs index 66e3373..e6be649 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/RTTestingResult.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/RTTestingResult.aspx.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Data.SqlClient; using System.Data; using BLL; +using System.IO; namespace FineUIPro.Web.HJGL.WeldingReport { @@ -298,13 +299,108 @@ namespace FineUIPro.Web.HJGL.WeldingReport Alert.ShowInTop("请选择批编号!", MessageBoxIcon.Warning); return; } - varValue = projectName + "|" + trustUnit + "|" + ndtCriteria + "|" + constructionUnit + "|" + txtReportDate.Text; - varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ",")); + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_RTTestingResultReportId, BatchId, varValue))); + var listStr = new List(); + listStr.Add(new SqlParameter("@BatchId", BatchId)); + SqlParameter[] parameter = listStr.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("spRT_CheckResult", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("IsoDesc"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("NDTR_Name"); + dt.Columns.Add("JotyLevel"); + dt.Columns.Add("JotNum"); + dt.Columns.Add("FilmNum"); + dt.Columns.Add("NoJotNum"); + dt.Columns.Add("NoFilmNum"); + dt.Columns.Add("ExpJotNum"); + dt.Columns.Add("ExpFilmNum"); + dt.Columns.Add("ExpNoJotNum"); + dt.Columns.Add("ExpNoFilmNum"); + dt.Columns.Add("RealJotNum"); + dt.Columns.Add("RealFilmNum"); + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["IsoDesc"] = row["IsoDesc"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["NDTR_Name"] = row["NDTR_Name"].ToString(); + newRows["JotyLevel"] = row["JotyLevel"].ToString(); + newRows["JotNum"] = row["JotNum"].ToString(); + newRows["FilmNum"] = row["FilmNum"].ToString(); + newRows["NoJotNum"] = row["NoJotNum"].ToString(); + newRows["NoFilmNum"] = row["NoFilmNum"].ToString(); + newRows["ExpJotNum"] = row["ExpJotNum"].ToString(); + newRows["ExpFilmNum"] = row["ExpFilmNum"].ToString(); + newRows["ExpNoJotNum"] = row["ExpNoJotNum"].ToString(); + newRows["ExpNoFilmNum"] = row["ExpNoFilmNum"].ToString(); + newRows["RealJotNum"] = row["RealJotNum"].ToString(); + newRows["RealFilmNum"] = row["RealFilmNum"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + var listRepairStr = new List(); + listRepairStr.Add(new SqlParameter("@BatchId", BatchId)); + SqlParameter[] repairParameter = listRepairStr.ToArray(); + var repairtb = SQLHelper.GetDataTableRunProc("spRT_CheckRepairResult", repairParameter); + + DataTable repairdt = new DataTable(); + repairdt.TableName = "RepairData"; + repairdt.Columns.Add("JotNumR1"); + repairdt.Columns.Add("FilmNumR1"); + repairdt.Columns.Add("JotNumR2"); + repairdt.Columns.Add("FilmNumR2"); + repairdt.Columns.Add("JotNumR3"); + repairdt.Columns.Add("FilmNumR3"); + + DataRow[] repairRows = repairtb.DefaultView.ToTable().Select(); + foreach (var row in repairRows) + { + var newRows = repairdt.NewRow(); + newRows["JotNumR1"] = row["JotNumR1"].ToString(); + newRows["FilmNumR1"] = row["FilmNumR1"].ToString(); + newRows["JotNumR2"] = row["JotNumR2"].ToString(); + newRows["FilmNumR2"] = row["FilmNumR2"].ToString(); + newRows["JotNumR3"] = row["JotNumR3"].ToString(); + newRows["FilmNumR3"] = row["FilmNumR3"].ToString(); + + repairdt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(repairdt); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("projectName", projectName); + keyValuePairs.Add("trustUnit", trustUnit); + keyValuePairs.Add("ndtCriteria", ndtCriteria); + keyValuePairs.Add("constructionUnit", constructionUnit); + keyValuePairs.Add("reportDate",txtReportDate.Text.Trim()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\射线检测结果确认表.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + } + //varValue = projectName + "|" + trustUnit + "|" + ndtCriteria + "|" + constructionUnit + "|" + txtReportDate.Text; + //varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ",")); + + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_RTTestingResultReportId, BatchId, varValue))); } #endregion - + } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index 97d6b43..9a5da32 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -11,7 +11,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/HJGL_DS/WebAPI/WebAPI.csproj.user b/HJGL_DS/WebAPI/WebAPI.csproj.user index 28be9c4..a48b337 100644 --- a/HJGL_DS/WebAPI/WebAPI.csproj.user +++ b/HJGL_DS/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU FolderProfile true From f954ef787935a03098124011e1697b5192074eb3 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Fri, 6 Jun 2025 09:49:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?20250606=20=E6=8A=A5=E8=A1=A8=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../File/Fastreport/射线检测结果确认表.frx | 4 +- .../Fastreport/射线检测综合报告(二).frx | 357 ++++++++++++++++++ .../File/Fastreport/工程无损检测管理清单.frx | 168 +++++++++ .../检测综合报告(除射线检测外).frx | 322 ++++++++++++++++ .../Fastreport/管道焊接接头报检检查记录.frx | 24 +- .../FineUIPro.Web/FineUIPro.Web.csproj.user | 2 +- .../HJGL/CheckManage/NDTManageList.aspx.cs | 71 +++- .../HJGL/CheckManage/RTReport.aspx.cs | 87 ++++- .../CheckManage/TestingReportNotRT.aspx.cs | 81 +++- HJGL_DS/FineUIPro.Web/Web.config | 2 +- HJGL_DS/WebAPI/WebAPI.csproj.user | 2 +- 11 files changed, 1095 insertions(+), 25 deletions(-) create mode 100644 HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测综合报告(二).frx create mode 100644 HJGL_DS/FineUIPro.Web/File/Fastreport/工程无损检测管理清单.frx create mode 100644 HJGL_DS/FineUIPro.Web/File/Fastreport/检测综合报告(除射线检测外).frx diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx index b5b26a5..4eb301d 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测结果确认表.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测综合报告(二).frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测综合报告(二).frx new file mode 100644 index 0000000..288badc --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/射线检测综合报告(二).frx @@ -0,0 +1,357 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Table2_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Table2.PrintRow(0); + Table2.PrintColumns(); + + // go next data source row + rowData.Next(); + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/工程无损检测管理清单.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/工程无损检测管理清单.frx new file mode 100644 index 0000000..d30c58c --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/工程无损检测管理清单.frx @@ -0,0 +1,168 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Table2_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Table2.PrintRow(0); + Table2.PrintColumns(); + + // go next data source row + rowData.Next(); + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/检测综合报告(除射线检测外).frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/检测综合报告(除射线检测外).frx new file mode 100644 index 0000000..7ae5649 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/检测综合报告(除射线检测外).frx @@ -0,0 +1,322 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Table5_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Table5.PrintRow(0); + Table5.PrintColumns(); + + // go next data source row + rowData.Next(); + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接接头报检检查记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接接头报检检查记录.frx index a83b0fe..e1dd3f5 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接接头报检检查记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道焊接接头报检检查记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + @@ -64,12 +64,12 @@ namespace FastReport - + - + @@ -81,7 +81,7 @@ namespace FastReport - + @@ -190,7 +190,7 @@ namespace FastReport - + @@ -202,7 +202,7 @@ namespace FastReport - + @@ -227,7 +227,7 @@ namespace FastReport - + @@ -239,7 +239,7 @@ namespace FastReport - + @@ -261,9 +261,9 @@ namespace FastReport - - - + + + diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user index bf54086..8aa7c11 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ true - Debug|Any CPU + Release|Any CPU diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/NDTManageList.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/NDTManageList.aspx.cs index 70c92b5..284a912 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/NDTManageList.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/NDTManageList.aspx.cs @@ -9,6 +9,7 @@ using BLL; using System.Data.SqlClient; using System.Data; using AspNet = System.Web.UI.WebControls; +using System.IO; namespace FineUIPro.Web.HJGL.CheckManage { @@ -158,9 +159,73 @@ namespace FineUIPro.Web.HJGL.CheckManage /// protected void btnPrint_Click(object sender, EventArgs e) { - string projects = this.lblProjectCode.Text.Trim() + "|" + this.lblProjectName.Text.Trim(); - projects = Microsoft.JScript.GlobalObject.escape(projects.Replace("/", ",")); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_NDTManageListReportId, this.tvControlItem.SelectedNodeID, projects))); + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_NDTManageList", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("CH_TrustCode"); + dt.Columns.Add("BatchCode"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("JOT_JointNo"); + dt.Columns.Add("CH_TrustDate"); + dt.Columns.Add("ShootMan"); + dt.Columns.Add("shootDate"); + dt.Columns.Add("States"); + dt.Columns.Add("FilmAmount"); + dt.Columns.Add("ReportCode"); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "CH_TrustCode,BatchCode,ISO_IsoNo,JOT_JointNo ASC";//按照ID倒序排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["CH_TrustCode"] = row["CH_TrustCode"].ToString(); + newRows["BatchCode"] = row["BatchCode"].ToString(); + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + newRows["CH_TrustDate"] = row["CH_TrustDate"].ToString(); + newRows["ShootMan"] = row["ShootMan"].ToString(); + newRows["shootDate"] = string.Format("{0:yyyy-MM-dd}", row["shootDate"].ToString()); + newRows["States"] = row["States"].ToString(); + newRows["FilmAmount"] = row["FilmAmount"].ToString(); + newRows["ReportCode"] = row["ReportCode"].ToString(); + + dt.Rows.Add(newRows); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectCode", this.lblProjectCode.Text.Trim()); + keyValuePairs.Add("ProjectName", this.lblProjectName.Text.Trim()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\工程无损检测管理清单.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + //string projects = this.lblProjectCode.Text.Trim() + "|" + this.lblProjectName.Text.Trim(); + //projects = Microsoft.JScript.GlobalObject.escape(projects.Replace("/", ",")); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_NDTManageListReportId, this.tvControlItem.SelectedNodeID, projects))); } #region 导出按钮 diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RTReport.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RTReport.aspx.cs index ae43a74..d172097 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RTReport.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/RTReport.aspx.cs @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using BLL; +using System.IO; namespace FineUIPro.Web.HJGL.CheckManage { @@ -153,8 +154,90 @@ namespace FineUIPro.Web.HJGL.CheckManage /// protected void btnPrint_Click(object sender, EventArgs e) { - string projects = this.lblProjectCode.Text.Trim() + "|" + this.lblProjectName.Text.Trim() + "|" + this.lblProjectCodes.Text.Trim(); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_RTReportTwoId, this.tvControlItem.SelectedNodeID, projects, "打印 - "))); + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_RTColligateReport", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("Num"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("JOT_JointDesc"); + dt.Columns.Add("CheckRate"); + dt.Columns.Add("QuaLevel"); + dt.Columns.Add("CheckJointNum1"); + dt.Columns.Add("CheckFilmNum1"); + dt.Columns.Add("NoPassJointNum1"); + dt.Columns.Add("NoPassFilmNum1"); + dt.Columns.Add("CheckJointNumK"); + dt.Columns.Add("CheckFilmNumK"); + dt.Columns.Add("NoPassJointNumK"); + dt.Columns.Add("NoPassFilmNumK"); + dt.Columns.Add("TopRepairNum"); + dt.Columns.Add("TotalJointNum"); + dt.Columns.Add("TotalFilmNum"); + dt.Columns.Add("PassRate"); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "ISO_IsoNo ASC";//按照ID倒序排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + int i = 0; + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["Num"] = i + 1; + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRows["CheckRate"] = row["CheckRate"].ToString(); + newRows["QuaLevel"] = row["QuaLevel"].ToString(); + newRows["CheckJointNum1"] = row["CheckJointNum1"].ToString(); + newRows["CheckFilmNum1"] = row["CheckFilmNum1"].ToString(); + newRows["NoPassJointNum1"] = row["NoPassJointNum1"].ToString(); + newRows["NoPassFilmNum1"] = row["NoPassFilmNum1"].ToString(); + newRows["CheckJointNumK"] = row["CheckJointNumK"].ToString(); + newRows["CheckFilmNumK"] = row["CheckFilmNumK"].ToString(); + newRows["NoPassJointNumK"] = row["NoPassJointNumK"].ToString(); + newRows["NoPassFilmNumK"] = row["NoPassFilmNumK"].ToString(); + newRows["TopRepairNum"] = row["TopRepairNum"].ToString(); + newRows["TotalJointNum"] = row["TotalJointNum"].ToString(); + newRows["TotalFilmNum"] = row["TotalFilmNum"].ToString(); + newRows["PassRate"] = row["PassRate"].ToString(); + + dt.Rows.Add(newRows); + i++; + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectCode", this.lblProjectCode.Text.Trim()); + keyValuePairs.Add("ProjectName", this.lblProjectName.Text.Trim()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\射线检测综合报告(二).frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + //string projects = this.lblProjectCode.Text.Trim() + "|" + this.lblProjectName.Text.Trim() + "|" + this.lblProjectCodes.Text.Trim(); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_RTReportTwoId, this.tvControlItem.SelectedNodeID, projects, "打印 - "))); } } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/TestingReportNotRT.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/TestingReportNotRT.aspx.cs index 96a0c63..feec7ff 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/TestingReportNotRT.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/CheckManage/TestingReportNotRT.aspx.cs @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using BLL; using System.Data.SqlClient; using System.Data; +using System.IO; namespace FineUIPro.Web.HJGL.CheckManage { @@ -157,9 +158,83 @@ namespace FineUIPro.Web.HJGL.CheckManage /// protected void btnPrint_Click(object sender, EventArgs e) { - string projects = this.lblProjectCode.Text.Trim() + "|" + this.lblProjectName.Text.Trim() + "|" + this.lblProjectCodes.Text.Trim(); - string varValue = System.Web.HttpUtility.UrlEncode(projects); - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_TestingReportNotRT, this.tvControlItem.SelectedNodeID, varValue))); + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_sp_UnRTColligateReport", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("Num"); + dt.Columns.Add("ISO_IsoNo"); + dt.Columns.Add("STE_Code"); + dt.Columns.Add("JOT_JointDesc"); + dt.Columns.Add("CheckRate"); + dt.Columns.Add("QuaLevel"); + dt.Columns.Add("CheckJointNum1"); + dt.Columns.Add("NoPassJointNum1"); + dt.Columns.Add("CheckJointNumK"); + dt.Columns.Add("NoPassJointNumK"); + dt.Columns.Add("TopRepairNum"); + dt.Columns.Add("TotalJointNum"); + dt.Columns.Add("TotalFilmNum"); + dt.Columns.Add("PassRate"); + + DataView dv = tb.DefaultView;//获取表视图 + dv.Sort = "ISO_IsoNo ASC";//按照ID倒序排序 + tb = dv.ToTable();//转为表 + DataRow[] rows = tb.DefaultView.ToTable().Select(); + int i = 0; + foreach (var row in rows) + { + var newRows = dt.NewRow(); + newRows["Num"] = i + 1; + newRows["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + newRows["STE_Code"] = row["STE_Code"].ToString(); + newRows["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + newRows["CheckRate"] = row["CheckRate"].ToString(); + newRows["QuaLevel"] = row["QuaLevel"].ToString(); + newRows["CheckJointNum1"] = row["CheckJointNum1"].ToString(); + newRows["NoPassJointNum1"] = row["NoPassJointNum1"].ToString(); + newRows["CheckJointNumK"] = row["CheckJointNumK"].ToString(); + newRows["NoPassJointNumK"] = row["NoPassJointNumK"].ToString(); + newRows["TopRepairNum"] = row["TopRepairNum"].ToString(); + newRows["TotalJointNum"] = row["TotalJointNum"].ToString(); + newRows["TotalFilmNum"] = row["TotalFilmNum"].ToString(); + newRows["PassRate"] = row["PassRate"].ToString(); + + dt.Rows.Add(newRows); + i++; + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + //传参 + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectCode", this.lblProjectCode.Text.Trim()); + keyValuePairs.Add("ProjectName", this.lblProjectName.Text.Trim()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\检测综合报告(除射线检测外).frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + //string projects = this.lblProjectCode.Text.Trim() + "|" + this.lblProjectName.Text.Trim() + "|" + this.lblProjectCodes.Text.Trim(); + //string varValue = System.Web.HttpUtility.UrlEncode(projects); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_TestingReportNotRT, this.tvControlItem.SelectedNodeID, varValue))); } #endregion } diff --git a/HJGL_DS/FineUIPro.Web/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index 9a5da32..aa58035 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -50,7 +50,7 @@ - + diff --git a/HJGL_DS/WebAPI/WebAPI.csproj.user b/HJGL_DS/WebAPI/WebAPI.csproj.user index a48b337..28be9c4 100644 --- a/HJGL_DS/WebAPI/WebAPI.csproj.user +++ b/HJGL_DS/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU FolderProfile true