From 2ce7b2a6c47dbec33fb91ca4cd431bfb8b8140af Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Mon, 18 May 2026 14:23:19 +0800 Subject: [PATCH] =?UTF-8?q?20260518=20=E9=BB=84=E9=87=91=E5=8F=A3=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/HJGLDB_DS_2026-05-18_bwj.sql | 59 ++++ HJGL_DS/BLL/Common/Const.cs | 6 + HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj | 10 + .../HJGL/WeldingReport/GoldMouthLedger.aspx | 110 +++++++ .../WeldingReport/GoldMouthLedger.aspx.cs | 277 ++++++++++++++++++ .../GoldMouthLedger.aspx.designer.cs | 125 ++++++++ 6 files changed, 587 insertions(+) create mode 100644 DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql create mode 100644 HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx create mode 100644 HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.cs create mode 100644 HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.designer.cs diff --git a/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql new file mode 100644 index 0000000..b634253 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql @@ -0,0 +1,59 @@ + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule) +values('142E6B0B-530E-448B-84C5-1A93E0316E3B','ƽͷڲʼȷϱ','HJGL/WeldingReport/GoldMouthLedger.aspx',240,'F3B157B7-9BEE-4150-6666-087828F1C51D','3') +go + + +CREATE PROCEDURE [dbo].[HJGL_rpt_GoldMouthLedger] +( + @projectId NVARCHAR(50) = null +) +AS +/**********ƽͷڲʼȷϱ***************/ +SELECT jointInfo.JOT_ID, +jointInfo.ProjectId, +jointInfo.ISO_ID, +isoInfo.ISO_IsoNo, +jointInfo.JOT_JointNo, +(case when Steel.STE_Code is not null + then (case when Steel2.STE_Code is not null and Steel.STE_Code<>Steel2.STE_Code + then Steel.STE_Code+'/'+Steel2.STE_Code + else Steel.STE_Code end) + else Steel2.STE_Code end) as SteelCode,-- +null as OldIsoNo,--ͷ()ܵ߱ +null as OldSteelCode,--ͷ()ܵ +(case when Welder.WED_Code is not null + then (case when FloorWelder.WED_Code is not null and Welder.WED_Code<>FloorWelder.WED_Code + then Welder.WED_Code+'/'+FloorWelder.WED_Code + else Welder.WED_Code end) + else FloorWelder.WED_Code end) as WelderCode, -- +(CASE WHEN JointInfo.Jot_WeldingDate IS NOT NULL THEN JointInfo.Jot_WeldingDate + ELSE WeldReportMain.JOT_WeldDate END) AS JOT_WeldDate, -- +ndt.NDT_Code,--ⷽ +(case when jointInfo.RT_States is not null and jointInfo.RT_States!='ؼ' then jointInfo.RT_States +else (case when jointInfo.PT_States is not null and jointInfo.PT_States!='ؼ' then jointInfo.PT_States +else (case when jointInfo.MT_States is not null and jointInfo.MT_States!='ؼ' then jointInfo.MT_States +else (case when jointInfo.UT_States is not null and jointInfo.UT_States!='ؼ' then jointInfo.UT_States +else null end)end) end) end) as TestStates,--״̬ +jointInfo.RTFeedbackDate as TestDate,-- +null as ConfirmMan,--ȷ +jointType.JOTY_Group, +jointInfo.Sort1, +jointInfo.Sort2, +jointInfo.Sort3, +jointInfo.Sort4, +jointInfo.Sort5, +jointInfo.JOT_Remark +FROM HJGL_PW_JointInfo AS jointInfo +LEFT JOIN HJGL_PW_IsoInfo AS isoInfo ON isoInfo.ISO_ID = jointInfo.ISO_ID +LEFT JOIN HJGL_BS_JointType AS jointType ON jointType.JOTY_ID=jointInfo.JOTY_ID +LEFT JOIN HJGL_BS_Steel AS Steel ON Steel.STE_ID=jointInfo.STE_ID +LEFT JOIN HJGL_BS_Steel AS Steel2 ON Steel2.STE_ID=jointInfo.STE_ID2 +LEFT JOIN HJGL_BS_Welder AS Welder ON Welder.WED_ID= jointInfo.JOT_CellWelder +LEFT JOIN HJGL_BS_Welder AS FloorWelder ON FloorWelder.WED_ID=jointInfo.JOT_FloorWelder +LEFT JOIN HJGL_BO_WeldReportMain AS WeldReportMain ON WeldReportMain.DReportID=jointInfo.DReportID +LEFT JOIN HJGL_BO_BatchDetail AS batchDetail on batchDetail.JOT_ID = jointInfo.JOT_ID +LEFT JOIN HJGL_BS_NDTType AS ndt ON ndt.NDT_ID = batchDetail.NDT +WHERE IsGold=1 +and (jointInfo.ProjectId=@projectId or @projectId is null) +GO diff --git a/HJGL_DS/BLL/Common/Const.cs b/HJGL_DS/BLL/Common/Const.cs index 32c422b..1f0e827 100644 --- a/HJGL_DS/BLL/Common/Const.cs +++ b/HJGL_DS/BLL/Common/Const.cs @@ -2594,6 +2594,12 @@ namespace BLL /// 档案资料移交表导出模板 /// public const string JGZL_ArchivalTransferUrl = "File\\Word\\JGZL\\档案资料移交表导出模板.docx"; + #endregion + + /// + /// 黄金(碰头)焊口材质及检测确认表导出模板 + /// + public const string HJGL_GoldMouthLedgerUrl = "File\\Excel\\黄金(碰头)焊口材质及检测确认表导出模板.xlsx"; } } diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj index a117483..e790227 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj @@ -1428,6 +1428,7 @@ + @@ -5945,12 +5946,14 @@ HardReportSetDataIn.aspx + ASPXCodeBehind HardReportSetDataIn.aspx HardReportSetDataInEdit.aspx + ASPXCodeBehind HardReportSetDataInEdit.aspx @@ -6788,6 +6791,13 @@ FeedbackResultShowColumn.aspx + + GoldMouthLedger.aspx + ASPXCodeBehind + + + GoldMouthLedger.aspx + HardTestReportRecord.aspx ASPXCodeBehind diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx new file mode 100644 index 0000000..27419e5 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx @@ -0,0 +1,110 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GoldMouthLedger.aspx.cs" Inherits="FineUIPro.Web.HJGL.WeldingReport.GoldMouthLedger" %> + + + + + + + 黄金口台账 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.cs new file mode 100644 index 0000000..bea6177 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.cs @@ -0,0 +1,277 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.HJGL.WeldingReport +{ + public partial class GoldMouthLedger : PageBase + { + #region 加载页面 + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + //Funs.FineUIPleaseSelect(drpProjectId); + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + } + + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + + // 绑定表格 + BindGrid(); + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + List listStr = new List(); + if (this.drpProjectId.SelectedValue != BLL.Const._Null && this.drpProjectId.SelectedValue != null) + { + listStr.Add(new SqlParameter("@projectId", this.drpProjectId.SelectedValue)); + } + else + { + listStr.Add(new SqlParameter("@projectId", null)); + } + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_GoldMouthLedger", parameter); + + Grid1.RecordCount = tb.Rows.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 分页 + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 查询 + /// + /// 项目下拉选择事件 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 统计 + /// + /// 统计 + /// + /// + /// + protected void BtnAnalyse_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 导出 + /// + /// 导出 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = Const.HJGL_GoldMouthLedgerUrl; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + uploadfilepath = rootPath + initTemplatePath; + + List listStr = new List(); + if (this.drpProjectId.SelectedValue != BLL.Const._Null && this.drpProjectId.SelectedValue != null) + { + listStr.Add(new SqlParameter("@projectId", this.drpProjectId.SelectedValue)); + } + else + { + listStr.Add(new SqlParameter("@projectId", null)); + } + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_GoldMouthLedger", parameter); + + if (tb.Rows.Count>0) + { + newUrl = uploadfilepath.Replace("黄金(碰头)焊口材质及检测确认表导出模板", "黄金(碰头)焊口材质及检测确认表"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + // 第一步:读取文件流 + NPOI.SS.UserModel.IWorkbook workbook; + using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read)) + { + workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);//2007版 + //workbook = new NPOI.HSSF.UserModel.HSSFWorkbook(stream); //2003版 + } + //创建表头样式 + NPOI.SS.UserModel.ICellStyle titleCellStyle = workbook.CreateCellStyle(); + titleCellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + titleCellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + titleCellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + titleCellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + titleCellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + titleCellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + titleCellStyle.WrapText = true;//自动换行 + var titleFont = workbook.CreateFont(); + titleFont.FontHeightInPoints = 14; + titleCellStyle.SetFont(titleFont); + + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + cellStyle.WrapText = true;//自动换行 + var font = workbook.CreateFont(); + font.FontHeightInPoints = 11; + cellStyle.SetFont(font); + // 第二步:创建新数据行 + NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0); + NPOI.SS.UserModel.IRow row = sheet.GetRow(0); + NPOI.SS.UserModel.ICell cell; + int i = 3; + + row = sheet.CreateRow(0); + cell = row.CreateCell(0); + cell.CellStyle = titleCellStyle; + row.HeightInPoints = 35; + string projectName = string.Empty; + if (!string.IsNullOrEmpty(this.drpProjectId.SelectedValue)&&this.drpProjectId.SelectedValue!=BLL.Const._Null) + { + projectName = BLL.Base_ProjectService.GetProjectByProjectId(this.drpProjectId.SelectedValue).ProjectName; + } + cell.SetCellValue(projectName + "项目黄金(碰头)焊口材质及检测确认表"); + + for (int j = 0; j < tb.Rows.Count; j++) + { + // 第二步:创建新数据行 + row = sheet.CreateRow(i); + // 添加数据 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + cell.SetCellValue((j + 1).ToString());//序号 + + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["JOT_JointNo"].ToString());//黄金(碰头)焊口编号 + + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["ISO_IsoNo"].ToString());//管线号(新安装管道) + + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["SteelCode"].ToString());//材质(新安装管道) + + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["OldIsoNo"].ToString());//管线号(碰头(老)管道) + + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["OldSteelCode"].ToString());//材质(碰头(老)管道) + + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["WelderCode"].ToString());//焊工号 + + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Format("{0:yyyy-MM-dd}", tb.Rows[j]["JOT_WeldDate"]));//焊接完成日期 + + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["NDT_Code"].ToString());//检测方式 + + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["TestStates"].ToString());//检测状态 + + cell = row.CreateCell(10); + cell.CellStyle = cellStyle; + cell.SetCellValue(string.Format("{0:yyyy-MM-dd}", tb.Rows[j]["TestDate"]));//检测日期 + + cell = row.CreateCell(11); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["ConfirmMan"].ToString());//确认人 + + cell = row.CreateCell(12); + cell.CellStyle = cellStyle; + cell.SetCellValue(tb.Rows[j]["JOT_Remark"].ToString());//备注 + i++; + } + // 第三步:写入文件流 + using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write)) + { + workbook.Write(stream); + workbook.Close(); + } + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + else + { + Alert.ShowInTop("当前无记录,无法导出!", MessageBoxIcon.Warning); + } + } + #endregion + + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.designer.cs new file mode 100644 index 0000000..85d49c6 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/GoldMouthLedger.aspx.designer.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.WeldingReport +{ + + + public partial class GoldMouthLedger + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// BtnAnalyse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnAnalyse; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +}