This commit is contained in:
2024-05-12 10:29:59 +08:00
parent a1c00d5980
commit cd0275d2bc
11 changed files with 634 additions and 452 deletions
@@ -962,7 +962,14 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
}
string ReportFileName = filePath + "管道焊接工作记录.xlsx";
string sqlStr = @"SELECT WeldSilkId,PipelineId,WorkAreaId,a.ProjectName,a.WeldJointCode,a.Specification,a.Material1Code,a.WeldingMethodCode,a.WeldingDate,a.WeldSilkCode,a.WeldMatCode,a.BackingWelderCode,a.CoverWelderCode,a.IsHotProess,(case a.IsHotProess when 1 then '是' else '否' end) as IsHotProessName,PrepareTemp,WeldingLocationCode FROM View_Pipeline_WeldJoint as a WHERE 1= 1 AND PipelineId =@PipelineId and Is_hjName='是' ";
string sqlStr = @"SELECT WeldSilkId,PipelineId,WorkAreaId,a.ProjectName,a.WeldJointCode,a.Specification,a.Material1Code,
a.WeldingMethodCode,a.WeldingDate,a.WeldSilkCode,a.WeldMatCode,a.BackingWelderCode,a.CoverWelderCode,
a.IsHotProess,(case a.IsHotProess when 1 then '是' else '否' end) as IsHotProessName,PrepareTemp,
WeldingLocationCode,a.WeldTypeCode,
(SELECT TOP 1 n.NDEReportNo FROM dbo.Batch_NDEItem n WHERE n.TrustBatchItemId=
(SELECT TOP 1 bt.TrustBatchItemId FROM dbo.Batch_BatchTrustItem bt WHERE bt.WeldJointId=a.WeldJointId)) AS NDEReportNo
FROM View_Pipeline_WeldJoint as a
WHERE 1= 1 AND PipelineId =@PipelineId and Is_hjName='是' ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
SqlParameter[] parameter = listStr.ToArray();
@@ -970,8 +977,8 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
var titleQuery = from a in Funs.DB.Pipeline_Pipeline
join b in Funs.DB.Base_Project on a.ProjectId equals b.ProjectId
join c in Funs.DB.Base_Unit on a.UnitId equals c.UnitId
select new { a.PipelineId, a.PipelineCode, b.ProjectName, c.UnitName };
join c in Funs.DB.Project_WorkArea on a.WorkAreaId equals c.WorkAreaId
select new { a.PipelineId, a.PipelineCode, b.EnProjectName, b.ProjectName, c.WorkAreaName, c.EnWorkAreaName };
var titleModel = titleQuery.FirstOrDefault();
if (titleModel != null && tb.Rows.Count > 0)
{
@@ -1030,19 +1037,19 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
//行1
region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 11, 14);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 1).GetCell(11).SetCellValue("Project Name:");
ws.GetRow(rowIndex + 1).GetCell(11).SetCellValue($"Project Name:{titleModel.EnProjectName}");
ws.GetRow(rowIndex + 1).GetCell(11).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 9, true, false);
//行2
region = new CellRangeAddress(rowIndex + 2, rowIndex + 2, 11, 14);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 2).GetCell(11).SetCellValue($"单位工程名称:{titleModel.UnitName}");
ws.GetRow(rowIndex + 2).GetCell(11).SetCellValue($"单位工程名称:{titleModel.WorkAreaName}");
ws.GetRow(rowIndex + 2).GetCell(11).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10, true, false);
//行3
region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 11, 14);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 3).GetCell(11).SetCellValue("Unit Name");
ws.GetRow(rowIndex + 3).GetCell(11).SetCellValue($"Unit Name{titleModel.EnWorkAreaName}");
ws.GetRow(rowIndex + 3).GetCell(11).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10, true, false);
//画线
@@ -1140,7 +1147,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
//焊口编号
ws.GetRow(dataIndex).GetCell(1).SetCellValue(tb.Rows[i]["WeldJointCode"].ToString());
//焊接形式
ws.GetRow(dataIndex).GetCell(3).SetCellValue("");
ws.GetRow(dataIndex).GetCell(3).SetCellValue(tb.Rows[i]["WeldTypeCode"].ToString());
//焊工代号
List<string> welderStr = new List<string>();
if (!string.IsNullOrWhiteSpace(tb.Rows[i]["BackingWelderCode"].ToString()))
@@ -1178,7 +1185,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
//焊接日期
ws.GetRow(dataIndex).GetCell(13).SetCellValue(tb.Rows[i]["WeldingDate"].ToString());
//无损检查报告
ws.GetRow(dataIndex).GetCell(14).SetCellValue("");
ws.GetRow(dataIndex).GetCell(14).SetCellValue(tb.Rows[i]["NDEReportNo"].ToString());
}
rowIndex += tIndex;