20230629安全质量问题排查新增合计

This commit is contained in:
2023-06-29 16:45:45 +08:00
parent 304d978873
commit c87892eacb
8 changed files with 4019 additions and 24 deletions
@@ -1,4 +1,5 @@
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -62,7 +63,33 @@ namespace FineUIPro.Web.DataShow
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
Grid1.DataBind();
this.OutputSummaryData(); ///取合计值
}
public static int allCount = 0, okCount = 0, unCount = 0;
/// <summary>
/// 计算合计
/// </summary>
private void OutputSummaryData()
{
string rate = "0%";
unCount = allCount - okCount;
if (allCount > 0)
{
rate = Math.Round(okCount * 1.0 / allCount * 100, 1).ToString() + "%";
}
JObject summary = new JObject
{
{ "ProjectName", "合计" },
{ "Count1", allCount.ToString() },
{ "Count2", okCount.ToString() },
{ "Count3", unCount.ToString() },
{ "Count4", rate}
};
Grid1.SummaryData = summary;
}
#endregion
@@ -166,7 +193,7 @@ namespace FineUIPro.Web.DataShow
{
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States != "4");
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.States != "4");
if (datetime1.HasValue)
{
getT = getT.Where(x => x.RegisterDate >= datetime1);
@@ -183,7 +210,13 @@ namespace FineUIPro.Web.DataShow
{
getT = getT.Where(x => x.HazardValue != "3");
}
cout1 = getT.Count();
allCount = getT.Count();
if (allCount > 0)
{
getT = getT.Where(x => x.ProjectId == projectId.ToString());
cout1 = getT.Count();
}
}
return cout1;
}
@@ -195,7 +228,7 @@ namespace FineUIPro.Web.DataShow
{
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States == "3");
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.States == "3");
if (datetime1.HasValue)
{
getT = getT.Where(x => x.RegisterDate >= datetime1);
@@ -212,7 +245,14 @@ namespace FineUIPro.Web.DataShow
{
getT = getT.Where(x => x.HazardValue != "3");
}
cout1 = getT.Count();
okCount = getT.Count();
if (okCount > 0)
{
getT = getT.Where(x => x.ProjectId == projectId.ToString());
cout1 = getT.Count();
}
}
return cout1;
}