20240331 质量月报
This commit is contained in:
@@ -104,10 +104,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
//本月质量目标管理情况
|
||||
CqmsTargetService.Delete(rowID);
|
||||
|
||||
TextBoxContentService.Delete(rowID);
|
||||
|
||||
|
||||
Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(rowID);
|
||||
WeekAndMonthReportNewService.Delete(rowID);
|
||||
}
|
||||
BindGrid();
|
||||
@@ -889,9 +887,327 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
doc.Save(newUrl);
|
||||
var reportItem = db.Report_CQMS_MonthReportItem.Where(x => x.ReportId == Id).OrderBy(x => x.ContentName).ToList();
|
||||
|
||||
#region 9.计量器具报验管理情况
|
||||
#endregion
|
||||
|
||||
#region 10.现场质量共检数据
|
||||
#endregion
|
||||
|
||||
#region 11.压力管道监检情况
|
||||
#endregion
|
||||
|
||||
#region 12.管道试压包管理情况
|
||||
#endregion
|
||||
|
||||
#region 13.特种设备监检情况
|
||||
#endregion
|
||||
|
||||
#region 14.NCR管理情况
|
||||
#endregion
|
||||
|
||||
#region 15.质量巡检情况
|
||||
var qualityInspections = reportItem.Where(x => x.ReType == "1").ToList();
|
||||
if (qualityInspections.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 26;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
numberIndex = 1;
|
||||
int? num1 = 0, num2 = 0;
|
||||
foreach (var item in qualityInspections)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.RectificationRate, doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks, doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.ProjectCount;
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 16.质量专项检查情况
|
||||
var specialChecks = reportItem.Where(x => x.ReType == "2").ToList();
|
||||
if (specialChecks.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 27;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
numberIndex = 1;
|
||||
int? num1 = 0, num2 = 0;
|
||||
foreach (var item in specialChecks)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks, doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.ProjectCount;
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 17.质量文件上报情况
|
||||
var fileReports = reportItem.Where(x => x.ReType == "3").ToList();
|
||||
if (fileReports.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 28;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
numberIndex = 1;
|
||||
int? num1 = 0, num2 = 0, num3 = 0, num4 = 0;
|
||||
foreach (var item in fileReports)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.ProjectCount;
|
||||
num3 += item.MonthsBackCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 18.本月质量问题处理情况
|
||||
#region (1)原材料问题
|
||||
whileIndex = 29;
|
||||
Aspose.Words.Tables.Table table18_1 = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
bool isYm18_1 = true;
|
||||
//跳过页眉的表头
|
||||
while (isYm18_1)
|
||||
{
|
||||
if (table18_1.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table18_1 = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm18_1 = false;
|
||||
}
|
||||
}
|
||||
var rowMaterialProblems = db.Report_RowMaterialProblem.Where(x => x.ReportId == Id);
|
||||
int numberIndex18_1 = 1;
|
||||
foreach (var item in rowMaterialProblems)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex18_1.ToString(), doc, table18_1.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.UnitId, doc, table18_1.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProblemDesrioption, doc, table18_1.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TreatmentMeasures, doc, table18_1.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProcessingResults, doc, table18_1.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remark, doc, table18_1.FirstRow.Cells[5].CellFormat.Width));
|
||||
table18_1.Rows.Insert(numberIndex18_1, row);
|
||||
|
||||
numberIndex18_1 += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table18_1.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
#endregion
|
||||
|
||||
#region (2)施工过程问题
|
||||
whileIndex = 30;
|
||||
Aspose.Words.Tables.Table table18_2 = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
bool isYm18_2 = true;
|
||||
//跳过页眉的表头
|
||||
while (isYm18_2)
|
||||
{
|
||||
if (table18_2.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table18_2 = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm18_2 = false;
|
||||
}
|
||||
}
|
||||
var constructionProblems = db.Report_ConstructionProblems.Where(x => x.ReportId == Id);
|
||||
int numberIndex18_2 = 1;
|
||||
foreach (var item in constructionProblems)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex18_2.ToString(), doc, table18_2.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.UnitId, doc, table18_2.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProblemDesrioption, doc, table18_2.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TreatmentMeasures, doc, table18_2.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProcessingResults, doc, table18_2.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remark, doc, table18_2.FirstRow.Cells[5].CellFormat.Width));
|
||||
table18_2.Rows.Insert(numberIndex18_2, row);
|
||||
|
||||
numberIndex18_2 += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table18_2.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 19.下月质量控制重点
|
||||
whileIndex = 31;
|
||||
Aspose.Words.Tables.Table table19 = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
bool isYm19 = true;
|
||||
//跳过页眉的表头
|
||||
while (isYm19)
|
||||
{
|
||||
if (table19.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table19 = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm19 = false;
|
||||
}
|
||||
}
|
||||
var nextQualityControls = db.Report_NextQualityControl.Where(x => x.ReportId == Id);
|
||||
int numberIndex19 = 1;
|
||||
foreach (var item in nextQualityControls)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex19.ToString(), doc, table19.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.NextQualityControlContent, doc, table19.FirstRow.Cells[1].CellFormat.Width));
|
||||
table19.Rows.Insert(numberIndex19, row);
|
||||
|
||||
numberIndex19 += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table19.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
#endregion
|
||||
|
||||
#region 20.项目质量体系审核
|
||||
bkmark = doc.Range.Bookmarks["Content20"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 21.类似项目管理经验教训应对措施及跟踪
|
||||
bkmark = doc.Range.Bookmarks["Content21"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 22.附件
|
||||
bkmark = doc.Range.Bookmarks["Content22"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText;
|
||||
}
|
||||
#endregion
|
||||
|
||||
doc.Save(newUrl);
|
||||
string fileName = Path.GetFileName(newUrl);
|
||||
FileInfo info = new FileInfo(newUrl);
|
||||
long fileSize = info.Length;
|
||||
|
||||
Reference in New Issue
Block a user