diff --git a/DataBase/版本日志/HJGLDB_DS_2025-07-15_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2025-07-15_bwj.sql new file mode 100644 index 0000000..aaf0c5e --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2025-07-15_bwj.sql @@ -0,0 +1,28 @@ + +ALTER PROCEDURE [dbo].[HGGL_sp_rpt_WelderQualified] +( + @projectId NVARCHAR(50) +) +AS +/*********ϸ񺸹ǼDZ**********/ +SELECT (ROW_NUMBER() OVER(ORDER BY ProjectWelder.ProjectWelderId)) AS Number + ,ProjectWelder.ProjectWelderId + ,ProjectWelder.WED_ID + ,Welder.WED_Code + ,Welder.WED_Name + ,WelderQualifiedProject.QualifiedProjectCode + ,Welder.WED_WorkCode as CertificateNo + ,convert(varchar(10),WelderQualifiedProject.LimitDate,111) as LimitDate +FROM dbo.Project_Welder AS ProjectWelder +LEFT JOIN HJGL_BS_Welder AS Welder ON ProjectWelder.WED_ID = Welder.WED_ID +LEFT JOIN (SELECT WED_ID,QualifiedProjectCode,CertificateNo,LimitDate + FROM dbo.HJGL_BS_WelderQualifiedProject + WHERE LimitDate IS NOT NULL AND LimitDate> = GETDATE()) AS WelderQualifiedProject + ON WelderQualifiedProject.WED_ID = Welder.WED_ID +WHERE ProjectWelder.ProjectId=@ProjectId + + + +GO + + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/合格焊工登记表.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/合格焊工登记表.frx new file mode 100644 index 0000000..da0ab3c --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/合格焊工登记表.frx @@ -0,0 +1,159 @@ + + + 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..9a04e89 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/持证焊工焊绩档案.frx @@ -0,0 +1,308 @@ + + + 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/Web.config b/HJGL_DS/FineUIPro.Web/Web.config index bf404b8..aa58035 100644 --- a/HJGL_DS/FineUIPro.Web/Web.config +++ b/HJGL_DS/FineUIPro.Web/Web.config @@ -11,7 +11,7 @@ - + diff --git a/HJGL_DS/FineUIPro.Web/Welder/WelderOKRate.aspx.cs b/HJGL_DS/FineUIPro.Web/Welder/WelderOKRate.aspx.cs index 7b16efb..36fdc0b 100644 --- a/HJGL_DS/FineUIPro.Web/Welder/WelderOKRate.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/Welder/WelderOKRate.aspx.cs @@ -8,6 +8,7 @@ using BLL; using Newtonsoft.Json.Linq; using AspNet = System.Web.UI.WebControls; using System.Linq; +using System.IO; namespace FineUIPro.Web.Welder { @@ -334,13 +335,97 @@ namespace FineUIPro.Web.Welder } } - string varValue = welderName + "|" + welderCode + "|" + years + "|" + months + "|" + sumTotalFilmNum.ToString() + "|" + sumOneToatalFilmNum.ToString() + "|" + sumOnePassFilmNum.ToString() + "|" + sumOKRate; - - varValue = HttpUtility.UrlEncodeUnicode(varValue); - string replaceParameter = drpWelder.SelectedValue + "|" + years + "|" + months; - - string reportId = BLL.Const.HGGL_WelderOKRateReportId; - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId, replaceParameter, varValue, "打印 - "))); + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + string strSql = @"SELECT sp.TotalFilmNum, + sp.OneToatalFilmNum, + sp.OnePassFilmNum, + sp.OneRepairFilmNum, + sp.TwoRepairFilmNum, + sp.ThreeRepairFilmNum, + sp.CRepairFilmNum, + sp.NoRepairFilmNum, + sp.KPassFilmNum, + sp.RMaterialFilmNum, + (CAST(sp.OKRate AS VARCHAR(6)) + '%') AS OKRate, + ROW_NUMBER() over(order by project.ProjectCode) as Num, + project.ProjectCode, + project.ProjectName + FROM dbo.Sp_WelderOKRate sp + LEFT JOIN dbo.Base_Project project ON project.ProjectId = sp.ProjectId + WHERE sp.WED_ID=@WED_ID and sp.Years=@Years and sp.Months=@Months"; + + List listStr = new List(); + listStr.Add(new SqlParameter("@WED_ID", drpWelder.SelectedValue)); + listStr.Add(new SqlParameter("@Years", years)); + listStr.Add(new SqlParameter("@Months", months)); + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + if (tb.Rows.Count > 0) + { + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("Num"); + dt.Columns.Add("ProjectCode"); + dt.Columns.Add("ProjectName"); + dt.Columns.Add("TotalFilmNum"); + dt.Columns.Add("OneToatalFilmNum"); + dt.Columns.Add("OnePassFilmNum"); + dt.Columns.Add("OneRepairFilmNum"); + dt.Columns.Add("TwoRepairFilmNum"); + dt.Columns.Add("ThreeRepairFilmNum"); + dt.Columns.Add("OKRate"); + + //tb.DefaultView.Sort = "BakeDate asc"; + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["Num"] = row["Num"].ToString(); + newRow["ProjectCode"] = row["ProjectCode"].ToString(); + newRow["ProjectName"] = row["ProjectName"].ToString(); + newRow["TotalFilmNum"] = row["TotalFilmNum"].ToString(); + newRow["OneToatalFilmNum"] = row["OneToatalFilmNum"].ToString(); + newRow["OnePassFilmNum"] = row["OnePassFilmNum"].ToString(); + newRow["OneRepairFilmNum"] = row["OneRepairFilmNum"].ToString(); + newRow["TwoRepairFilmNum"] = row["TwoRepairFilmNum"].ToString(); + newRow["ThreeRepairFilmNum"] = row["ThreeRepairFilmNum"].ToString(); + newRow["OKRate"] = row["OKRate"].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + } + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("welderName", welderName); + keyValuePairs.Add("welderCode", welderCode); + keyValuePairs.Add("years", years); + keyValuePairs.Add("months", months); + keyValuePairs.Add("sumTotalFilmNum", sumTotalFilmNum.ToString()); + keyValuePairs.Add("sumOneToatalFilmNum", sumOneToatalFilmNum.ToString()); + keyValuePairs.Add("sumOnePassFilmNum", sumOnePassFilmNum.ToString()); + keyValuePairs.Add("sumOKRate", sumOKRate.ToString()); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\持证焊工焊绩档案.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + } + + //string varValue = welderName + "|" + welderCode + "|" + years + "|" + months + "|" + sumTotalFilmNum.ToString() + "|" + sumOneToatalFilmNum.ToString() + "|" + sumOnePassFilmNum.ToString() + "|" + sumOKRate; + + //varValue = HttpUtility.UrlEncodeUnicode(varValue); + //string replaceParameter = drpWelder.SelectedValue + "|" + years + "|" + months; + + //string reportId = BLL.Const.HGGL_WelderOKRateReportId; + //PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId, replaceParameter, varValue, "打印 - "))); } else { diff --git a/HJGL_DS/FineUIPro.Web/common/ProjectSet/ProjectWelder.aspx.cs b/HJGL_DS/FineUIPro.Web/common/ProjectSet/ProjectWelder.aspx.cs index a842f87..8430804 100644 --- a/HJGL_DS/FineUIPro.Web/common/ProjectSet/ProjectWelder.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/common/ProjectSet/ProjectWelder.aspx.cs @@ -5,6 +5,7 @@ using System.Data; using System.Web; using BLL; using System.Data.SqlClient; +using System.IO; namespace FineUIPro.Web.common.ProjectSet { @@ -336,13 +337,57 @@ namespace FineUIPro.Web.common.ProjectSet { if (tvProject.SelectedNode != null) { - string reportId = BLL.Const.HGGL_QualifiedWelderReportId; + //string reportId = BLL.Const.HGGL_QualifiedWelderReportId; string projectId = tvProject.SelectedNode.NodeID; if (!string.IsNullOrEmpty(projectId)) { - var projectName = BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName; - string varValue= HttpUtility.UrlEncodeUnicode(projectName); - PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId, projectId, varValue, "打印 - "))); + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + List listStr = new List(); + listStr.Add(new SqlParameter("@projectId", projectId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HGGL_sp_rpt_WelderQualified", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("Number"); + dt.Columns.Add("WED_Name"); + dt.Columns.Add("WED_Code"); + dt.Columns.Add("CertificateNo"); + dt.Columns.Add("QualifiedProjectCode"); + dt.Columns.Add("LimitDate"); + + tb.DefaultView.Sort = "Number asc"; + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["Number"] = row["Number"].ToString(); + newRow["WED_Name"] = row["WED_Name"].ToString(); + newRow["WED_Code"] = row["WED_Code"].ToString(); + newRow["CertificateNo"] = row["CertificateNo"].ToString(); + newRow["QualifiedProjectCode"] = row["QualifiedProjectCode"].ToString(); + newRow["LimitDate"] = row["LimitDate"].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\合格焊工登记表.frx"; + + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + + } + //var projectName = BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName; + //string varValue= HttpUtility.UrlEncodeUnicode(projectName); + //PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", reportId, projectId, varValue, "打印 - "))); } } else