20240417 质量月报
This commit is contained in:
@@ -1344,7 +1344,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-1 土建
|
||||
var TJInspection = reportItem.Where(x => x.ReType == "10-1").ToList();
|
||||
if (TJInspection.Count > 0)
|
||||
if (TJInspection != null || TJInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -1472,7 +1472,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-2 设备
|
||||
var SBInspection = reportItem.Where(x => x.ReType == "10-2").ToList();
|
||||
if (SBInspection.Count > 0)
|
||||
if (SBInspection != null || SBInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -1600,7 +1600,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-3 管道
|
||||
var GDInspection = reportItem.Where(x => x.ReType == "10-3").ToList();
|
||||
if (GDInspection.Count > 0)
|
||||
if (GDInspection != null || GDInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -1728,7 +1728,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-4 电气
|
||||
var DQInspection = reportItem.Where(x => x.ReType == "10-4").ToList();
|
||||
if (DQInspection.Count > 0)
|
||||
if (DQInspection != null || DQInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -1856,7 +1856,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-5.仪表
|
||||
var YBInspection = reportItem.Where(x => x.ReType == "10-5").ToList();
|
||||
if (YBInspection.Count > 0)
|
||||
if (YBInspection != null || YBInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -1984,7 +1984,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-6.防腐
|
||||
var FFInspection = reportItem.Where(x => x.ReType == "10-6").ToList();
|
||||
if (FFInspection.Count > 0)
|
||||
if (FFInspection != null || FFInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -2112,7 +2112,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10-7.消防
|
||||
var XFInspection = reportItem.Where(x => x.ReType == "10-7").ToList();
|
||||
if (XFInspection.Count > 0)
|
||||
if (XFInspection != null || XFInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -2240,7 +2240,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 10.总数
|
||||
var InspectionDataInspection = reportItem.Where(x => x.ReType == "10").ToList();
|
||||
if (InspectionDataInspection.Count > 0)
|
||||
if (InspectionDataInspection != null || InspectionDataInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
//whileIndex += 1;
|
||||
@@ -2260,48 +2260,67 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
}
|
||||
numberIndex = 1;
|
||||
decimal? num1 = 0, num2 = 0;
|
||||
decimal MonthsCountstring = 0, ProjectCountstring = 0;
|
||||
//decimal? num1 = 0, num2 = 0;
|
||||
//decimal MonthsCountstring = 0, ProjectCountstring = 0;
|
||||
int CheckNum = 0, OKNum = 0, TotalCheckNum = 0, TotalOKNum = 0;
|
||||
string QuantitySum1 = String.Empty;//本月检查合格点数/本月检查点数
|
||||
string QuantitySum2 = String.Empty;//累计检查合格点数/累计检查点数
|
||||
foreach (var item in InspectionDataInspection)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.RectificationRate))
|
||||
if (string.IsNullOrEmpty(item.RectificationRate))
|
||||
{
|
||||
MonthsCountstring = Convert.ToDecimal(item.RectificationRate.Replace("%", ""));
|
||||
}
|
||||
else {
|
||||
item.RectificationRate = "0%";
|
||||
MonthsCountstring= Convert.ToDecimal(item.RectificationRate.Replace("%", ""));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.TotationRate))
|
||||
if (string.IsNullOrEmpty(item.TotationRate))
|
||||
{
|
||||
ProjectCountstring = Convert.ToDecimal(item.TotationRate.Replace("%", ""));
|
||||
}
|
||||
else {
|
||||
item.TotationRate = "0%";
|
||||
ProjectCountstring = Convert.ToDecimal(item.TotationRate.Replace("%", ""));
|
||||
}
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width, "", "1"));
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotationRate.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(Convert.ToString(item.RectificationRate), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(Convert.ToString(item.TotationRate), 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 += MonthsCountstring;
|
||||
num2 += ProjectCountstring;
|
||||
//num1 += MonthsCountstring;
|
||||
//num2 += ProjectCountstring;
|
||||
CheckNum += Convert.ToInt32(item.MonthsCount);
|
||||
OKNum += Convert.ToInt32(item.ProjectCount);
|
||||
TotalCheckNum += Convert.ToInt32(item.MonthsBackCount);
|
||||
TotalOKNum += Convert.ToInt32(item.TotalNoBackCount);
|
||||
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
|
||||
|
||||
if (CheckNum != 0)//被除数不能为零
|
||||
{
|
||||
QuantitySum1 = Math.Round((decimal)OKNum / (decimal)CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
QuantitySum1 = "0%";
|
||||
}
|
||||
if (TotalCheckNum != 0)//被除数不能为零
|
||||
{
|
||||
QuantitySum2 = Math.Round((decimal)TotalOKNum / (decimal)TotalCheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
QuantitySum2 = "0%";
|
||||
}
|
||||
|
||||
|
||||
//创建合计
|
||||
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(QuantitySum1.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell(QuantitySum2.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
@@ -2473,7 +2492,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
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));
|
||||
rowhj.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
@@ -3026,8 +3045,11 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
#region 设置页眉上的数据
|
||||
whileIndex = 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, 1, true);
|
||||
//业主名称
|
||||
table.Rows[0].Cells[2].FirstParagraph.Runs[0].Text = unitsYz.UnitName;
|
||||
if (unitsYz != null)
|
||||
{
|
||||
//业主名称
|
||||
table.Rows[0].Cells[2].FirstParagraph.Runs[0].Text = unitsYz.UnitName;
|
||||
}
|
||||
|
||||
//项目号
|
||||
table.Rows[0].Cells[4].FirstParagraph.Runs[0].Text = pModel.ProjectCode;
|
||||
|
||||
Reference in New Issue
Block a user