20240401 质量月报15整改率
This commit is contained in:
@@ -2095,6 +2095,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
int Quantity1Sum = 0;
|
||||
int Quantity2Sum = 0;
|
||||
int ClosedCountSum = 0;
|
||||
//加载所有单位
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
@@ -2112,17 +2113,28 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
c.CheckDate,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName
|
||||
u.UnitName,
|
||||
c.State
|
||||
};
|
||||
var AllList = query.ToList();
|
||||
var monethCount = query
|
||||
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
||||
var ClosedCount = query.Where(x => x.State == "7");//已关闭数量
|
||||
|
||||
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();
|
||||
if (AllList.Count() > 0)
|
||||
{
|
||||
model.RectificationRate = (100.0 * (ClosedCount.Count() / AllList.Count())).ToString("#0.00") + "%";
|
||||
}
|
||||
else
|
||||
{
|
||||
model.RectificationRate = "0.00%";
|
||||
}
|
||||
|
||||
model.ReportId = ReportId;
|
||||
//如果是修改,查询表中数据
|
||||
if (objType == "1")
|
||||
@@ -2130,7 +2142,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "1");
|
||||
if (NewModel != null)
|
||||
{
|
||||
model.RectificationRate = NewModel.RectificationRate;
|
||||
//model.RectificationRate = NewModel.RectificationRate;
|
||||
model.Remarks = NewModel.Remarks;
|
||||
}
|
||||
}
|
||||
@@ -2138,6 +2150,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
Quantity1Sum += monethCount.Count();
|
||||
Quantity2Sum += AllList.Count();
|
||||
ClosedCountSum += ClosedCount.Count();
|
||||
|
||||
i++;
|
||||
}
|
||||
gvQualityInspection.DataSource = list;
|
||||
@@ -2148,7 +2162,14 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
summary.Add("ContentName", "合计");
|
||||
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
||||
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
||||
|
||||
if (Quantity2Sum > 0)
|
||||
{
|
||||
summary.Add("RectificationRate", (100.00 * (ClosedCountSum / Quantity2Sum)).ToString("#0.00") + "%");
|
||||
}
|
||||
else
|
||||
{
|
||||
summary.Add("RectificationRate", "0.00%");
|
||||
}
|
||||
gvQualityInspection.SummaryData = summary;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user