20240407 质量月报17、23
This commit is contained in:
@@ -1142,22 +1142,996 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
#endregion
|
||||
|
||||
var reportItem = db.Report_CQMS_MonthReportItem.Where(x => x.ReportId == Id).OrderBy(x => x.ContentName).ToList();
|
||||
|
||||
#region 9.计量器具报验管理情况
|
||||
var measuringInspection = reportItem.Where(x => x.ReType == "9").ToList();
|
||||
if (measuringInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 13;
|
||||
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 measuringInspection)
|
||||
{
|
||||
//创建行
|
||||
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 10.现场质量共检数据
|
||||
#region 10-1 土建
|
||||
var TJInspection = reportItem.Where(x => x.ReType == "10-4").ToList();
|
||||
if (TJInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 14;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in TJInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-2 设备
|
||||
var SBInspection = reportItem.Where(x => x.ReType == "10-2").ToList();
|
||||
if (SBInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 15;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in SBInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-3 管道
|
||||
var GDInspection = reportItem.Where(x => x.ReType == "10-3").ToList();
|
||||
if (GDInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 16;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in GDInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-4 电气
|
||||
var DQInspection = reportItem.Where(x => x.ReType == "10-4").ToList();
|
||||
if (DQInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 17;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in DQInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-5.仪表
|
||||
var YBInspection = reportItem.Where(x => x.ReType == "10-5").ToList();
|
||||
if (YBInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 18;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in YBInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-6.防腐
|
||||
var FFInspection = reportItem.Where(x => x.ReType == "10-6").ToList();
|
||||
if (FFInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 19;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in FFInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-7.消防
|
||||
var XFInspection = reportItem.Where(x => x.ReType == "10-7").ToList();
|
||||
if (XFInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 20;
|
||||
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;
|
||||
string num5 = string.Empty;
|
||||
string num6 = string.Empty;
|
||||
foreach (var item in XFInspection)
|
||||
{
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
// 合并第一行的前两个单元格
|
||||
table.Rows[0].Cells[0].CellFormat.VerticalMerge = CellMerge.First;
|
||||
table.Rows[1].Cells[0].CellFormat.VerticalMerge = CellMerge.Previous;
|
||||
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsBackCount.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.Remarks.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, row);
|
||||
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.MonthsBackCount;
|
||||
num3 += item.ProjectCount;
|
||||
num4 += item.TotalNoBackCount;
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
if (num1 != 0)//被除数不能为零
|
||||
{
|
||||
num5 = Math.Round((double)num3 / (double)num1 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = "0%";
|
||||
}
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num6 = Math.Round((double)num4 / (double)num2 * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
num6 = "0%";
|
||||
}
|
||||
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.Rows[0].Cells[0].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("合计", doc, table.Rows[0].Cells[1].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.Rows[1].Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.Rows[1].Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num3.ToString(), doc, table.Rows[1].Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num4.ToString(), doc, table.Rows[1].Cells[5].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num5.ToString(), doc, table.Rows[1].Cells[6].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num6.ToString(), doc, table.Rows[1].Cells[7].CellFormat.Width));
|
||||
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10.总数
|
||||
var InspectionDataInspection = reportItem.Where(x => x.ReType == "10").ToList();
|
||||
if (InspectionDataInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 21;
|
||||
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 InspectionDataInspection)
|
||||
{
|
||||
//创建行
|
||||
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
|
||||
#endregion
|
||||
|
||||
#region 11.压力管道监检情况
|
||||
var PressureInspection = reportItem.Where(x => x.ReType == "11").ToList();
|
||||
if (PressureInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 22;
|
||||
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;
|
||||
foreach (var item in PressureInspection)
|
||||
{
|
||||
//创建行
|
||||
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.TotalNoBackCount.ToString(), 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;
|
||||
num3 += 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("", doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 12.管道试压包管理情况
|
||||
var PipingInspection = reportItem.Where(x => x.ReType == "12").ToList();
|
||||
if (PipingInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 23;
|
||||
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;
|
||||
foreach (var item in PipingInspection)
|
||||
{
|
||||
//创建行
|
||||
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.TotalNoBackCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), 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);
|
||||
num3 += item.TotalNoBackCount;
|
||||
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(num3.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), 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 13.特种设备监检情况
|
||||
var SpecialInspection = reportItem.Where(x => x.ReType == "13").ToList();
|
||||
if (SpecialInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 24;
|
||||
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;
|
||||
foreach (var item in SpecialInspection)
|
||||
{
|
||||
//创建行
|
||||
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.TotalNoBackCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), 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;
|
||||
num3 += 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(num3.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num1.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(num2.ToString(), doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 14.NCR管理情况
|
||||
var NcrManagementInspection = reportItem.Where(x => x.ReType == "14").ToList();
|
||||
if (NcrManagementInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
whileIndex = 25;
|
||||
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;
|
||||
string num4 = string.Empty;
|
||||
foreach (var item in NcrManagementInspection)
|
||||
{
|
||||
//创建行
|
||||
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.TotalNoBackCount.HasValue ? item.TotalNoBackCount.ToString() : "0", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.ProjectCount;
|
||||
num3 += item.TotalNoBackCount;
|
||||
numberIndex += 1;
|
||||
}
|
||||
|
||||
if (num2 != 0)//被除数不能为零
|
||||
{
|
||||
num4 = Math.Round((double)num2 / (double)num3 * 100, 2) + "%";//保留两位小数、后四舍五3
|
||||
}
|
||||
else
|
||||
{
|
||||
num4 = "0%";
|
||||
}
|
||||
|
||||
//自动设置表格样式
|
||||
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 15.质量巡检情况
|
||||
|
||||
@@ -30,6 +30,17 @@
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.photo {
|
||||
height: 300px;
|
||||
line-height: 300px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.photo img {
|
||||
height: 300px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -837,7 +848,7 @@
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
|
||||
|
||||
<Items>
|
||||
<f:Form ID="Form19" runat="server" ShowBorder="true" BodyPadding="5px" ShowHeader="false" Title="表单">
|
||||
<Rows>
|
||||
@@ -1790,6 +1801,122 @@
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
<%--23.施工照片--%>
|
||||
<f:Panel ID="Panel28" IsFluid="true" Title="23.施工照片" runat="server" EnableCollapse="false"
|
||||
ShowHeader="true">
|
||||
<Items>
|
||||
<f:Form ID="Form32" runat="server" ShowBorder="true" BodyPadding="5px" ShowHeader="false" Title="表单">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Image ID="imgPhoto" CssClass="photo" ImageUrl="~/res/images/R-C.png" ShowEmptyLabel="true" runat="server">
|
||||
</f:Image>
|
||||
<f:Image ID="imgPhoto2" CssClass="photo" ImageUrl="~/res/images/R-C.png" ShowEmptyLabel="true" runat="server">
|
||||
</f:Image>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="10% 20% 30% 20% 20%">
|
||||
<Items>
|
||||
<f:Label ID="Label7" runat ="server"></f:Label>
|
||||
<f:FileUpload runat="server" ID="filePhoto" ShowRedStar="false" ShowEmptyLabel="true"
|
||||
ButtonText="上传照片" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto_FileSelected">
|
||||
</f:FileUpload>
|
||||
<f:Label ID="Label8" runat ="server"></f:Label>
|
||||
<f:FileUpload runat="server" ID="filePhoto2" ShowRedStar="false" ShowEmptyLabel="true"
|
||||
ButtonText="上传照片" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto_FileSelected">
|
||||
</f:FileUpload>
|
||||
<f:Label ID="Label9" runat ="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="10% 30% 20% 30% 10%">
|
||||
<Items>
|
||||
<f:Label ID="Label4" runat ="server"></f:Label>
|
||||
<f:TextBox runat="server" ID="txtPhotoContent1" Width="300px">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label5" runat ="server"></f:Label>
|
||||
<f:TextBox runat="server" ID="txtPhotoContent2" Width="300px">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label6" runat ="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Image ID="imgPhoto3" CssClass="photo" ImageUrl="~/res/images/R-C.png" ShowEmptyLabel="true" runat="server">
|
||||
</f:Image>
|
||||
<f:Image ID="imgPhoto4" CssClass="photo" ImageUrl="~/res/images/R-C.png" ShowEmptyLabel="true" runat="server">
|
||||
</f:Image>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="10% 20% 30% 20% 20%">
|
||||
<Items>
|
||||
<f:Label ID="Label10" runat ="server"></f:Label>
|
||||
<f:FileUpload runat="server" ID="filePhoto3" ShowRedStar="false" ShowEmptyLabel="true"
|
||||
ButtonText="上传照片" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto_FileSelected">
|
||||
</f:FileUpload>
|
||||
<f:Label ID="Label11" runat ="server"></f:Label>
|
||||
<f:FileUpload runat="server" ID="filePhoto4" ShowRedStar="false" ShowEmptyLabel="true"
|
||||
ButtonText="上传照片" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto_FileSelected" >
|
||||
</f:FileUpload>
|
||||
<f:Label ID="Label12" runat ="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="10% 30% 20% 30% 10%">
|
||||
<Items>
|
||||
<f:Label ID="Label13" runat ="server"></f:Label>
|
||||
<f:TextBox runat="server" ID="txtPhotoContent3" Width="300px">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label14" runat ="server"></f:Label>
|
||||
<f:TextBox runat="server" ID="txtPhotoContent4" Width="300px">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label15" runat ="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Image ID="imgPhoto5" CssClass="photo" ImageUrl="~/res/images/R-C.png" ShowEmptyLabel="true" runat="server">
|
||||
</f:Image>
|
||||
<f:Image ID="imgPhoto6" CssClass="photo" ImageUrl="~/res/images/R-C.png" ShowEmptyLabel="true" runat="server">
|
||||
</f:Image>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="10% 20% 30% 20% 20%">
|
||||
<Items>
|
||||
<f:Label ID="Label16" runat ="server"></f:Label>
|
||||
<f:FileUpload runat="server" ID="filePhoto5" ShowRedStar="false" ShowEmptyLabel="true"
|
||||
ButtonText="上传照片" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto_FileSelected">
|
||||
</f:FileUpload>
|
||||
<f:Label ID="Label17" runat ="server"></f:Label>
|
||||
<f:FileUpload runat="server" ID="filePhoto6" ShowRedStar="false" ShowEmptyLabel="true"
|
||||
ButtonText="上传照片" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
|
||||
AutoPostBack="true" OnFileSelected="filePhoto_FileSelected">
|
||||
</f:FileUpload>
|
||||
<f:Label ID="Label18" runat ="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="10% 30% 20% 30% 10%">
|
||||
<Items>
|
||||
<f:Label ID="Label19" runat ="server"></f:Label>
|
||||
<f:TextBox runat="server" ID="txtPhotoContent5" Width="300px">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label20" runat ="server"></f:Label>
|
||||
<f:TextBox runat="server" ID="txtPhotoContent6" Width="300px">
|
||||
</f:TextBox>
|
||||
<f:Label ID="Label21" runat ="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
|
||||
@@ -187,13 +187,25 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText;
|
||||
txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText;
|
||||
txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText;
|
||||
|
||||
|
||||
imgPhoto.ImageUrl = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl;
|
||||
txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText;
|
||||
imgPhoto2.ImageUrl = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl;
|
||||
txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText;
|
||||
imgPhoto3.ImageUrl = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl;
|
||||
txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText;
|
||||
imgPhoto4.ImageUrl = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl;
|
||||
txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText;
|
||||
imgPhoto5.ImageUrl = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl;
|
||||
txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText;
|
||||
imgPhoto6.ImageUrl = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl;
|
||||
txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText;
|
||||
#endregion
|
||||
|
||||
//加载所有grid
|
||||
lodAllGrid("1");
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1124,123 +1136,123 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
c.MonthRate,
|
||||
c.TotalRate
|
||||
};
|
||||
if (query.ToList().Count > 0) {
|
||||
if (query.ToList().Count > 0) {
|
||||
//加载工艺管道
|
||||
var gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "工艺管道");
|
||||
var model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "工艺管道";
|
||||
var model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "工艺管道";
|
||||
|
||||
if (gygdModel != null)
|
||||
{
|
||||
model.MonthQuantity = gygdModel.MonthQuantity;
|
||||
model.TotalQuantity = gygdModel.TotalQuantity;
|
||||
model.MonthRate = gygdModel.MonthRate + "%";
|
||||
model.TotalRate = gygdModel.TotalRate + "%";
|
||||
#region 小计和合计
|
||||
if (gygdModel != null)
|
||||
{
|
||||
model.MonthQuantity = gygdModel.MonthQuantity;
|
||||
model.TotalQuantity = gygdModel.TotalQuantity;
|
||||
model.MonthRate = gygdModel.MonthRate + "%";
|
||||
model.TotalRate = gygdModel.TotalRate + "%";
|
||||
#region 小计和合计
|
||||
//小计
|
||||
num0 += gygdModel.MonthQuantity;
|
||||
num1 += gygdModel.TotalQuantity;
|
||||
|
||||
//合计
|
||||
totalNum0 += gygdModel.MonthQuantity;
|
||||
totalNum1 += gygdModel.TotalQuantity;
|
||||
|
||||
#endregion
|
||||
list.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.MonthQuantity = 0;
|
||||
model.TotalQuantity = 0;
|
||||
model.MonthRate = "0%";
|
||||
model.TotalRate = "0%";
|
||||
list.Add(model);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//地管
|
||||
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "地管");
|
||||
model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "地管";
|
||||
|
||||
if (gygdModel != null)
|
||||
{
|
||||
model.MonthQuantity = gygdModel.MonthQuantity;
|
||||
model.TotalQuantity = gygdModel.TotalQuantity;
|
||||
model.MonthRate = gygdModel.MonthRate + "%";
|
||||
model.TotalRate = gygdModel.TotalRate + "%";
|
||||
#region 小计和合计
|
||||
//小计
|
||||
num0 += gygdModel.MonthQuantity;
|
||||
num1 += gygdModel.TotalQuantity;
|
||||
|
||||
//合计
|
||||
totalNum0 += gygdModel.MonthQuantity;
|
||||
totalNum1 += gygdModel.TotalQuantity;
|
||||
|
||||
#endregion
|
||||
list.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.MonthQuantity = 0;
|
||||
model.TotalQuantity = 0;
|
||||
model.MonthRate = "0%";
|
||||
model.TotalRate = "0%";
|
||||
list.Add(model);
|
||||
}
|
||||
|
||||
|
||||
//非标
|
||||
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "非标");
|
||||
model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "非标";
|
||||
|
||||
if (gygdModel != null)
|
||||
{
|
||||
model.MonthQuantity = gygdModel.MonthQuantity;
|
||||
model.TotalQuantity = gygdModel.TotalQuantity;
|
||||
model.MonthRate = gygdModel.MonthRate + "%";
|
||||
model.TotalRate = gygdModel.TotalRate + "%";
|
||||
#region 小计和合计
|
||||
//小计
|
||||
num0 += gygdModel.MonthQuantity;
|
||||
num1 += gygdModel.TotalQuantity;
|
||||
|
||||
//合计
|
||||
totalNum0 += gygdModel.MonthQuantity;
|
||||
totalNum1 += gygdModel.TotalQuantity;
|
||||
|
||||
#endregion
|
||||
list.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.MonthQuantity = 0;
|
||||
model.TotalQuantity = 0;
|
||||
model.MonthRate = "0%";
|
||||
model.TotalRate = "0%";
|
||||
list.Add(model);
|
||||
}
|
||||
//小计
|
||||
num0 += gygdModel.MonthQuantity;
|
||||
num1 += gygdModel.TotalQuantity;
|
||||
|
||||
//合计
|
||||
totalNum0 += gygdModel.MonthQuantity;
|
||||
totalNum1 += gygdModel.TotalQuantity;
|
||||
|
||||
#endregion
|
||||
model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "小计";
|
||||
model.MonthQuantity = num0;
|
||||
model.TotalQuantity = num1;
|
||||
model.MonthRate = "";
|
||||
model.TotalRate = "";
|
||||
list.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.MonthQuantity = 0;
|
||||
model.TotalQuantity = 0;
|
||||
model.MonthRate = "0%";
|
||||
model.TotalRate = "0%";
|
||||
list.Add(model);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//地管
|
||||
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "地管");
|
||||
model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "地管";
|
||||
|
||||
if (gygdModel != null)
|
||||
{
|
||||
model.MonthQuantity = gygdModel.MonthQuantity;
|
||||
model.TotalQuantity = gygdModel.TotalQuantity;
|
||||
model.MonthRate = gygdModel.MonthRate + "%";
|
||||
model.TotalRate = gygdModel.TotalRate + "%";
|
||||
#region 小计和合计
|
||||
//小计
|
||||
num0 += gygdModel.MonthQuantity;
|
||||
num1 += gygdModel.TotalQuantity;
|
||||
|
||||
//合计
|
||||
totalNum0 += gygdModel.MonthQuantity;
|
||||
totalNum1 += gygdModel.TotalQuantity;
|
||||
|
||||
#endregion
|
||||
list.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.MonthQuantity = 0;
|
||||
model.TotalQuantity = 0;
|
||||
model.MonthRate = "0%";
|
||||
model.TotalRate = "0%";
|
||||
list.Add(model);
|
||||
}
|
||||
|
||||
|
||||
//非标
|
||||
gygdModel = query.FirstOrDefault(x => x.ProfessionalName == "非标");
|
||||
model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "非标";
|
||||
|
||||
if (gygdModel != null)
|
||||
{
|
||||
model.MonthQuantity = gygdModel.MonthQuantity;
|
||||
model.TotalQuantity = gygdModel.TotalQuantity;
|
||||
model.MonthRate = gygdModel.MonthRate + "%";
|
||||
model.TotalRate = gygdModel.TotalRate + "%";
|
||||
#region 小计和合计
|
||||
//小计
|
||||
num0 += gygdModel.MonthQuantity;
|
||||
num1 += gygdModel.TotalQuantity;
|
||||
|
||||
//合计
|
||||
totalNum0 += gygdModel.MonthQuantity;
|
||||
totalNum1 += gygdModel.TotalQuantity;
|
||||
|
||||
#endregion
|
||||
list.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.MonthQuantity = 0;
|
||||
model.TotalQuantity = 0;
|
||||
model.MonthRate = "0%";
|
||||
model.TotalRate = "0%";
|
||||
list.Add(model);
|
||||
}
|
||||
//小计
|
||||
model = new Model.ProcessControl_NondestructiveTest_New();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.CreateMan = item.UnitName;//用作存储施工单位名称
|
||||
model.ProfessionalName = "小计";
|
||||
model.MonthQuantity = num0;
|
||||
model.TotalQuantity = num1;
|
||||
model.MonthRate = "";
|
||||
model.TotalRate = "";
|
||||
list.Add(model);
|
||||
}
|
||||
}
|
||||
|
||||
Grid10.DataSource = list;
|
||||
@@ -2263,29 +2275,32 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
select new { x.UnitId, y.UnitName };
|
||||
foreach (var item in units)
|
||||
{
|
||||
//var query = from c in db.Check_CheckControl
|
||||
// join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
||||
// from u in unitJoin.DefaultIfEmpty()
|
||||
// where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
||||
// select new
|
||||
// {
|
||||
// c.CheckDate,
|
||||
// c.ProjectId,
|
||||
// u.UnitId,
|
||||
// u.UnitName
|
||||
// };
|
||||
//var AllList = query.ToList();//项目数
|
||||
var query = from c in db.Comprehensive_DataReceivingDoc
|
||||
join u in db.Base_Unit on c.SendUnit equals u.UnitId into unitJoin
|
||||
from u in unitJoin.DefaultIfEmpty()
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.SendUnit == item.UnitId
|
||||
select new
|
||||
{
|
||||
c.ReceiveDate,
|
||||
c.ProjectId,
|
||||
c.IsReply,
|
||||
c.RetrunWuhuangCopies,
|
||||
u.UnitId,
|
||||
u.UnitName
|
||||
};
|
||||
var AllList = query.ToList();//项目数
|
||||
//本月数
|
||||
//var monethCount = query.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
||||
//var yzCount = 0;//本月业主/ 监理返回数量
|
||||
//var NoBackCount = 0;//累计未返回数量
|
||||
var monethCount = query.Where(x => (x.ReceiveDate >= Convert.ToDateTime(startDate) && x.ReceiveDate <= Convert.ToDateTime(endDate)));
|
||||
var yzCount = query.Where(x => x.IsReply == true && x.RetrunWuhuangCopies != null && (x.ReceiveDate >= Convert.ToDateTime(startDate) && x.ReceiveDate <= Convert.ToDateTime(endDate)));//本月业主/ 监理返回数量
|
||||
int totalReturnCount = query.Where(x => x.IsReply == true && x.RetrunWuhuangCopies != null).Count();//总的已返回数量
|
||||
var NoBackCount = AllList.Count() - totalReturnCount;//累计未返回数量
|
||||
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.ContentName = item.UnitName;
|
||||
//model.MonthsCount = monethCount.Count();
|
||||
//model.ProjectCount = AllList.Count();
|
||||
//model.MonthsBackCount =;
|
||||
//model.TotalNoBackCount =;
|
||||
model.MonthsCount = monethCount.Count();
|
||||
model.ProjectCount = AllList.Count();
|
||||
model.MonthsBackCount = yzCount.Count();
|
||||
model.TotalNoBackCount = NoBackCount;
|
||||
model.ReportId = ReportId;
|
||||
//如果是修改,查询表中数据
|
||||
if (objType == "1")
|
||||
@@ -2298,10 +2313,10 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
list.Add(model);
|
||||
|
||||
//Quantity1Sum += monethCount.Count();
|
||||
//Quantity2Sum += AllList.Count();
|
||||
//Quantity3Sum += yzCount.Count();
|
||||
//Quantity4Sum += NoBackCount.Count();
|
||||
Quantity1Sum += monethCount.Count();
|
||||
Quantity2Sum += AllList.Count();
|
||||
Quantity3Sum += yzCount.Count();
|
||||
Quantity4Sum += NoBackCount;
|
||||
i++;
|
||||
}
|
||||
gvFileReport.DataSource = list;
|
||||
@@ -2481,6 +2496,137 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 23.施工照片
|
||||
protected void filePhoto_FileSelected(object sender, EventArgs e)
|
||||
{
|
||||
if (filePhoto.HasFile)
|
||||
{
|
||||
string fileName = filePhoto.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
// 清空文件上传控件
|
||||
filePhoto.Reset();
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
filePhoto.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
|
||||
imgPhoto.ImageUrl = "~/upload/" + fileName;
|
||||
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto.Reset();
|
||||
}
|
||||
|
||||
if (filePhoto2.HasFile)
|
||||
{
|
||||
string fileName = filePhoto2.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
// 清空文件上传控件
|
||||
filePhoto2.Reset();
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
filePhoto2.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
|
||||
imgPhoto2.ImageUrl = "~/upload/" + fileName;
|
||||
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto2.Reset();
|
||||
}
|
||||
|
||||
if (filePhoto3.HasFile)
|
||||
{
|
||||
string fileName = filePhoto3.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
// 清空文件上传控件
|
||||
filePhoto3.Reset();
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
filePhoto3.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
|
||||
imgPhoto3.ImageUrl = "~/upload/" + fileName;
|
||||
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto3.Reset();
|
||||
}
|
||||
|
||||
if (filePhoto4.HasFile)
|
||||
{
|
||||
string fileName = filePhoto4.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
// 清空文件上传控件
|
||||
filePhoto4.Reset();
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
filePhoto4.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
|
||||
imgPhoto4.ImageUrl = "~/upload/" + fileName;
|
||||
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto4.Reset();
|
||||
}
|
||||
|
||||
if (filePhoto5.HasFile)
|
||||
{
|
||||
string fileName = filePhoto5.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
// 清空文件上传控件
|
||||
filePhoto5.Reset();
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
filePhoto5.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
|
||||
imgPhoto5.ImageUrl = "~/upload/" + fileName;
|
||||
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto5.Reset();
|
||||
}
|
||||
|
||||
if (filePhoto6.HasFile)
|
||||
{
|
||||
string fileName = filePhoto6.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
// 清空文件上传控件
|
||||
filePhoto6.Reset();
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
filePhoto6.SaveAs(Server.MapPath("~/upload/" + fileName));
|
||||
|
||||
imgPhoto6.ImageUrl = "~/upload/" + fileName;
|
||||
|
||||
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
|
||||
filePhoto6.Reset();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
@@ -2587,6 +2733,9 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//保存19.下月质量控制重点
|
||||
saveNextQualityControl();
|
||||
|
||||
//保存23.施工照片
|
||||
saveImages();
|
||||
|
||||
//保存文本框
|
||||
saveTxtContent();
|
||||
#endregion
|
||||
@@ -2672,6 +2821,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存施工方案及检验试验计划审批情况
|
||||
/// <summary>
|
||||
/// 3.1保存一般施工方案审批情况
|
||||
/// </summary>
|
||||
@@ -2774,7 +2924,9 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存4.设计交底管理情况
|
||||
/// <summary>
|
||||
/// 保存设计交底管理情况
|
||||
/// </summary>
|
||||
@@ -2808,7 +2960,9 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存图纸会审
|
||||
/// <summary>
|
||||
/// 保存图纸会审
|
||||
/// </summary>
|
||||
@@ -2842,7 +2996,9 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存设备材料报验管理情况
|
||||
/// <summary>
|
||||
/// 保存设备材料报验管理情况
|
||||
/// </summary>
|
||||
@@ -2877,7 +3033,9 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存文本框内容
|
||||
/// <summary>
|
||||
/// 保存文本框内容
|
||||
/// </summary>
|
||||
@@ -2938,6 +3096,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
Funs.DB.Report_TextBoxContent.InsertAllOnSubmit(txtContentList);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 9.计量器具报验管理情况
|
||||
void saveMeasuringInspection()
|
||||
@@ -3124,11 +3283,11 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
{
|
||||
ReportId = ReportId,
|
||||
ReType = "14",
|
||||
ContentName = values.Value<string>("ContentName"),
|
||||
MonthsCount = values.Value<int>("MonthsCount"),
|
||||
ProjectCount = values.Value<int>("ProjectCount"),
|
||||
//RectificationRate = values.Value<string>("RectificationRate"),
|
||||
Remarks = values.Value<string>("Remarks")
|
||||
ContentName = values.Value<string>("WorkName"),
|
||||
MonthsCount = values.Value<int>("CurrentPeriodOkNum"),
|
||||
ProjectCount = values.Value<int>("OKNum"),
|
||||
TotalNoBackCount = values.Value<int>("CheckNum"),
|
||||
RectificationRate = values.Value<string>("OKRate"),
|
||||
};
|
||||
if (gvNcrManagementInspection.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
@@ -3232,10 +3391,10 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
ReportId = ReportId,
|
||||
ReType = "3",
|
||||
ContentName = values.Value<string>("ContentName"),
|
||||
//MonthsCount = Funs.GetNewInt(values.Value<int>("MonthsCount").ToString()),
|
||||
//ProjectCount = Funs.GetNewInt(values.Value<int>("ProjectCount").ToString()),
|
||||
//MonthsBackCount = Funs.GetNewInt(values.Value<int>("MonthsBackCount").ToString()),
|
||||
//TotalNoBackCount = Funs.GetNewInt(values.Value<int>("TotalNoBackCount").ToString())
|
||||
MonthsCount = Funs.GetNewInt(values.Value<int>("MonthsCount").ToString()),
|
||||
ProjectCount = Funs.GetNewInt(values.Value<int>("ProjectCount").ToString()),
|
||||
MonthsBackCount = Funs.GetNewInt(values.Value<int>("MonthsBackCount").ToString()),
|
||||
TotalNoBackCount = Funs.GetNewInt(values.Value<int>("TotalNoBackCount").ToString())
|
||||
};
|
||||
if (gvFileReport.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
@@ -3351,10 +3510,63 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 23.施工照片
|
||||
void saveImages()
|
||||
{
|
||||
var ImageLists = new List<Model.Report_TextBoxContent>();
|
||||
var imgage1 = new Model.Report_TextBoxContent();
|
||||
imgage1.Id = Guid.NewGuid().ToString();
|
||||
imgage1.ReportId = ReportId;
|
||||
imgage1.ContentType = "23-1";
|
||||
imgage1.ContentText = txtPhotoContent1.Text;
|
||||
imgage1.ImageUrl = imgPhoto.ImageUrl;
|
||||
ImageLists.Add(imgage1);
|
||||
|
||||
var imgage2 = new Model.Report_TextBoxContent();
|
||||
imgage2.Id = Guid.NewGuid().ToString();
|
||||
imgage2.ReportId = ReportId;
|
||||
imgage2.ContentType = "23-2";
|
||||
imgage2.ContentText = txtPhotoContent2.Text;
|
||||
imgage2.ImageUrl = imgPhoto2.ImageUrl;
|
||||
ImageLists.Add(imgage2);
|
||||
|
||||
var imgage3 = new Model.Report_TextBoxContent();
|
||||
imgage3.Id = Guid.NewGuid().ToString();
|
||||
imgage3.ReportId = ReportId;
|
||||
imgage3.ContentType = "23-3";
|
||||
imgage3.ContentText = txtPhotoContent3.Text;
|
||||
imgage3.ImageUrl = imgPhoto3.ImageUrl;
|
||||
ImageLists.Add(imgage3);
|
||||
|
||||
var imgage4 = new Model.Report_TextBoxContent();
|
||||
imgage4.Id = Guid.NewGuid().ToString();
|
||||
imgage4.ReportId = ReportId;
|
||||
imgage4.ContentType = "23-4";
|
||||
imgage4.ContentText = txtPhotoContent4.Text;
|
||||
imgage4.ImageUrl = imgPhoto4.ImageUrl;
|
||||
ImageLists.Add(imgage4);
|
||||
|
||||
var imgage5 = new Model.Report_TextBoxContent();
|
||||
imgage5.Id = Guid.NewGuid().ToString();
|
||||
imgage5.ReportId = ReportId;
|
||||
imgage5.ContentType = "23-5";
|
||||
imgage5.ContentText = txtPhotoContent2.Text;
|
||||
imgage5.ImageUrl = imgPhoto5.ImageUrl;
|
||||
ImageLists.Add(imgage5);
|
||||
|
||||
var imgage6 = new Model.Report_TextBoxContent();
|
||||
imgage6.Id = Guid.NewGuid().ToString();
|
||||
imgage6.ReportId = ReportId;
|
||||
imgage6.ContentType = "23-6";
|
||||
imgage6.ContentText = txtPhotoContent6.Text;
|
||||
imgage6.ImageUrl = imgPhoto6.ImageUrl;
|
||||
ImageLists.Add(imgage6);
|
||||
|
||||
Funs.DB.Report_TextBoxContent.InsertAllOnSubmit(ImageLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+517
-177
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user