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,13 +1,10 @@
using Aspose.Words;
using BLL;
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.ServiceModel.Configuration;
using System.Text;
namespace FineUIPro.Web.DataShow
{
@@ -28,9 +25,9 @@ namespace FineUIPro.Web.DataShow
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
LargerHazard = (from x in Funs.DB.Solution_LargerHazard
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x).ToList();
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x).ToList();
// 绑定表格t
BindGrid();
}
@@ -58,6 +55,28 @@ namespace FineUIPro.Web.DataShow
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
this.OutputSummaryData(); ///取合计值
}
public static int allCount1 = 0, allCount2 = 0, allCount3 = 0, allCount4 = 0, allCount5 = 0, allCount6 = 0;
/// <summary>
/// 计算合计
/// </summary>
private void OutputSummaryData()
{
JObject summary = new JObject
{
{ "ProjectName", "合计" },
{ "Count1", allCount1.ToString() },
{ "Count2", allCount2.ToString() },
{ "Count3", allCount3.ToString() },
{ "Count4", allCount4.ToString() },
{ "Count5", allCount5.ToString() },
{ "Count6", allCount6.ToString() }
};
Grid1.SummaryData = summary;
}
#endregion
@@ -162,9 +181,10 @@ namespace FineUIPro.Web.DataShow
protected int Count1(object projectId)
{
int cout1 = 0;
allCount1= LargerHazard.Where(x => x.IsSuperLargerHazard == false || !x.IsSuperLargerHazard.HasValue ).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.IsSuperLargerHazard == false).Count();
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && (x.IsSuperLargerHazard == false || !x.IsSuperLargerHazard.HasValue)).Count();
}
return cout1;
}
@@ -177,6 +197,7 @@ namespace FineUIPro.Web.DataShow
protected int Count2(object projectId)
{
int cout1 = 0;
allCount2 = LargerHazard.Where(x => x.IsSuperLargerHazard == true).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.IsSuperLargerHazard == true).Count();
@@ -191,6 +212,7 @@ namespace FineUIPro.Web.DataShow
protected int Count3(object projectId)
{
int cout1 = 0;
allCount3 = LargerHazard.Where(x => x.States == Const.State_2).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.States == Const.State_2).Count();
@@ -206,6 +228,7 @@ namespace FineUIPro.Web.DataShow
protected int Count4(object projectId)
{
int cout1 = 0;
allCount4 = LargerHazard.Where(x => x.States == Const.State_1).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.States == Const.State_1).Count();
@@ -222,6 +245,7 @@ namespace FineUIPro.Web.DataShow
protected int Count5(object projectId)
{
int cout1 = 0;
allCount5 = LargerHazard.Sum(x => x.TrainPersonNum ?? 0);
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString()).Sum(x=>x.TrainPersonNum ?? 0);
@@ -237,6 +261,7 @@ namespace FineUIPro.Web.DataShow
protected int Count6(object projectId)
{
int cout1 = 0;
allCount6 = LargerHazard.Where(x => x.States == Const.State_3).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.States == Const.State_3).Count();