20240416 质量月报
This commit is contained in:
@@ -2261,18 +2261,21 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
numberIndex = 1;
|
||||
int? num1 = 0, num2 = 0;
|
||||
int MonthsCountstring = 0, ProjectCountstring = 0;
|
||||
foreach (var item in InspectionDataInspection)
|
||||
{
|
||||
MonthsCountstring = Convert.ToInt32(item.RectificationRate.Replace("%", ""));
|
||||
ProjectCountstring = Convert.ToInt32(item.TotationRate.Replace("%", ""));
|
||||
//创建行
|
||||
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.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(item.Remarks, doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
num1 += item.MonthsCount;
|
||||
num2 += item.ProjectCount;
|
||||
num1 += MonthsCountstring;
|
||||
num2 += ProjectCountstring;
|
||||
numberIndex += 1;
|
||||
}
|
||||
//自动设置表格样式
|
||||
@@ -2282,8 +2285,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
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(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);
|
||||
|
||||
|
||||
@@ -869,7 +869,7 @@
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<%--9.计量器具报验管理情况--%>
|
||||
<%--9.计量器具报验管理情况--%>
|
||||
<f:Panel ID="Pnl9" IsFluid="true" Title="9.计量器具报验管理情况" runat="server" EnableCollapse="false"
|
||||
ShowHeader="true">
|
||||
<Items>
|
||||
@@ -1302,15 +1302,15 @@
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
|
||||
TextAlign="Center" />
|
||||
<f:RenderField Width="300px" ColumnID="ContentName" DataField="ContentName" ExpandUnusedSpace="true"
|
||||
<f:RenderField Width="300px" ColumnID="WorkName" DataField="WorkName" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="施工分包商">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="MonthsCount" DataField="MonthsCount"
|
||||
<f:RenderField Width="250px" ColumnID="OneOKRate" DataField="OneOKRate"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="本月一次共捡合格率">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="160px" ColumnID="ProjectCount" DataField="ProjectCount"
|
||||
<f:RenderField Width="160px" ColumnID="TotalOneOKRate" DataField="TotalOneOKRate"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="项目累计一次共捡合格率">
|
||||
</f:RenderField>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Remarks" DataField="Remarks"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="备注">
|
||||
<Editor>
|
||||
|
||||
@@ -1499,11 +1499,19 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
var db = Funs.DB;
|
||||
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
||||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
var list = new List<Model.CheckStatisc>();
|
||||
int i = 1;
|
||||
|
||||
int Quantity1Sum = 0;
|
||||
int Quantity2Sum = 0;
|
||||
int CheckNum = 0;//本月检查点数
|
||||
int TotalCheckNum = 0;//累计检查点数
|
||||
|
||||
int OKNum = 0;//本月检查合格点数
|
||||
int TotalOKNum = 0;//累计检查合格点数
|
||||
|
||||
string Quantity1Sum = String.Empty;//本月检查合格点数/本月检查点数
|
||||
string Quantity2Sum = String.Empty;//累计检查合格点数/累计检查点数
|
||||
|
||||
|
||||
//加载所有单位
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
@@ -1521,43 +1529,85 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
c.CheckDate,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName
|
||||
u.UnitName,
|
||||
c.IsOnceQualified
|
||||
};
|
||||
var AllList = query.ToList();
|
||||
var monethCount = query
|
||||
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
||||
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.ReportId = ReportId;
|
||||
|
||||
|
||||
Model.CheckStatisc checkStatisc = new Model.CheckStatisc();
|
||||
checkStatisc.Id = Guid.NewGuid().ToString();
|
||||
checkStatisc.ReportId = ReportId;
|
||||
checkStatisc.WorkName = item.UnitName;
|
||||
checkStatisc.CheckNum = monethCount.Count();
|
||||
checkStatisc.TotalCheckNum = AllList.Count();
|
||||
checkStatisc.OKNum = monethCount.Count(x => x.IsOnceQualified == true);
|
||||
checkStatisc.TotalOKNum = AllList.Count(x => x.IsOnceQualified == true);
|
||||
|
||||
if (checkStatisc.CheckNum != 0)//被除数不能为零
|
||||
{
|
||||
checkStatisc.OneOKRate = Math.Round((double)checkStatisc.OKNum / (double)checkStatisc.CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
checkStatisc.OneOKRate = "0%";
|
||||
}
|
||||
|
||||
if (checkStatisc.TotalCheckNum != 0)//被除数不能为零
|
||||
{
|
||||
checkStatisc.TotalOneOKRate = Math.Round((double)checkStatisc.TotalOKNum / (double)checkStatisc.TotalCheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
checkStatisc.TotalOneOKRate = "0%";
|
||||
}
|
||||
//如果是修改,查询表中数据
|
||||
if (objType == "1")
|
||||
{
|
||||
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "10");
|
||||
if (NewModel != null)
|
||||
{
|
||||
model.RectificationRate = NewModel.RectificationRate;
|
||||
model.Remarks = NewModel.Remarks;
|
||||
checkStatisc.Remarks = NewModel.Remarks;
|
||||
}
|
||||
}
|
||||
list.Add(model);
|
||||
list.Add(checkStatisc);
|
||||
|
||||
CheckNum += checkStatisc.CheckNum;
|
||||
TotalCheckNum += checkStatisc.TotalCheckNum;
|
||||
|
||||
OKNum += checkStatisc.OKNum;
|
||||
TotalOKNum += checkStatisc.TotalOKNum;
|
||||
|
||||
Quantity1Sum += monethCount.Count();
|
||||
Quantity2Sum += AllList.Count();
|
||||
i++;
|
||||
}
|
||||
|
||||
gvInspectionDataInspection.DataSource = list;
|
||||
gvInspectionDataInspection.DataBind();
|
||||
|
||||
if (CheckNum != 0)//被除数不能为零
|
||||
{
|
||||
Quantity1Sum = Math.Round((double)OKNum / (double)CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity1Sum = "0%";
|
||||
}
|
||||
if (TotalCheckNum != 0)//被除数不能为零
|
||||
{
|
||||
Quantity2Sum = Math.Round((double)TotalOKNum / (double)TotalCheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity2Sum = "0%";
|
||||
}
|
||||
|
||||
//合计
|
||||
JObject summary = new JObject();
|
||||
summary.Add("ContentName", "合计");
|
||||
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
||||
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
||||
summary.Add("WorkName", "合计");
|
||||
summary.Add("OneOKRate", Quantity1Sum.ToString());
|
||||
summary.Add("TotalOneOKRate", Quantity2Sum.ToString());
|
||||
|
||||
gvInspectionDataInspection.SummaryData = summary;
|
||||
#endregion
|
||||
@@ -1647,7 +1697,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
else
|
||||
{
|
||||
OneOKRate = "0%";
|
||||
OneOKRate = "0";
|
||||
}
|
||||
if (TotalCheckNum != 0)//被除数不能为零
|
||||
{
|
||||
@@ -1655,7 +1705,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
else
|
||||
{
|
||||
TotalOneOKRate = "0%";
|
||||
TotalOneOKRate = "0";
|
||||
}
|
||||
|
||||
//检验批统计:土建
|
||||
@@ -2071,7 +2121,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
u.UnitId,
|
||||
u.UnitName,
|
||||
c.IssuedDate,
|
||||
c.Status
|
||||
c.Status,
|
||||
c.ImplementationFrontState,
|
||||
};
|
||||
|
||||
var AllList = query.ToList();
|
||||
@@ -2083,8 +2134,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
NCRStatisc.WorkName = item.UnitName;
|
||||
//NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count(x => x.Status == "3");
|
||||
//NCRStatisc.OKNum = AllList.Count(x => x.Status == "3");
|
||||
NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count();
|
||||
NCRStatisc.OKNum = AllList.Count();
|
||||
NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Where(x => x.ImplementationFrontState.Trim().Equals("已闭合")).Count();
|
||||
NCRStatisc.OKNum = AllList.Where(x => x.ImplementationFrontState.Trim().Equals("已闭合")).Count();
|
||||
|
||||
NCRStatisc.CheckNum = AllList.Count();
|
||||
|
||||
@@ -3427,10 +3478,10 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
{
|
||||
ReportId = ReportId,
|
||||
ReType = "10",
|
||||
ContentName = values.Value<string>("ContentName"),
|
||||
MonthsCount = values.Value<int>("MonthsCount"),
|
||||
ProjectCount = values.Value<int>("ProjectCount"),
|
||||
//RectificationRate = values.Value<string>("RectificationRate"),
|
||||
ContentName = values.Value<string>("WorkName"),
|
||||
RectificationRate = values.Value<string>("OneOKRate"),
|
||||
TotationRate = values.Value<string>("TotalOneOKRate"),
|
||||
|
||||
Remarks = values.Value<string>("Remarks"),
|
||||
};
|
||||
if (gvInspectionDataInspection.Rows[rowIndex].DataKeys.Length > 0)
|
||||
|
||||
Reference in New Issue
Block a user