首页数据只显示本年份修改

This commit is contained in:
2024-01-03 14:12:27 +08:00
parent e8877811ef
commit f590c95d94
6 changed files with 291 additions and 130 deletions
+20 -13
View File
@@ -123,8 +123,9 @@ namespace FineUIPro.Web.common
var ProjectTotal1 = (from x in Funs.DB.HSSE_MonthReportItem
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
where ("成达公司HSE管理人数" == x.ReportItem || "分包商HSE管理人数" == x.ReportItem) && y.Years == DateTime.Now.Year
select x.YearTotal).Sum();
//where ("成达公司HSE管理人数" == x.ReportItem || "分包商HSE管理人数" == x.ReportItem) && y.Years == DateTime.Now.Year
where ("成达公司现场人数" == x.ReportItem ) && y.Years == DateTime.Now.Year
select x.YearTotal).Sum();
if (ProjectTotal1.HasValue)
{
@@ -133,14 +134,16 @@ namespace FineUIPro.Web.common
var ProjectTotal2 = (from x in Funs.DB.HSSE_MonthReportItem
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
where ("成达公司现场人数" == x.ReportItem || "分包商现场人数" == x.ReportItem) && y.Years == DateTime.Now.Year
select x.YearTotal).Sum();
//where ("成达公司现场人数" == x.ReportItem || "分包商现场人数" == x.ReportItem) && y.Years == DateTime.Now.Year
where ( "分包商现场人数" == x.ReportItem) && y.Years == DateTime.Now.Year
select x.YearTotal).Sum();
if (ProjectTotal2.HasValue && ProjectTotal1.HasValue)
{
this.divZYPerson.InnerHtml = (ProjectTotal2.Value - ProjectTotal1.Value).ToString();
}
else if (ProjectTotal2.HasValue)
//if (ProjectTotal2.HasValue && ProjectTotal1.HasValue)
//{
// this.divZYPerson.InnerHtml = (ProjectTotal2.Value - ProjectTotal1.Value).ToString();
//}
//else
if (ProjectTotal2.HasValue)
{
this.divZYPerson.InnerHtml = ProjectTotal2.Value.ToString();
}
@@ -202,9 +205,9 @@ namespace FineUIPro.Web.common
// this.divRectifyRate.InnerHtml = Math.Round(ccount * 1.0 / allcout * 100, 1).ToString();
//}
DateTime time = DateTime.Parse(DateTime.Now.ToString("yyyy-01-01"));
var getRectify = from x in Funs.DB.View_Hazard_HazardRegister
where x.States != Const.State_0 && x.States != Const.State_R && x.States != null
where x.States != Const.State_0 && x.States != Const.State_R && x.States != null && x.RegisterDate>= time
group x by x.States into g
select new { g.Key, Count = g.Count() };
var allcout = getRectify.ToList();
@@ -269,13 +272,17 @@ namespace FineUIPro.Web.common
/// </summary>
private void getCQMSProblem()
{
DateTime time = DateTime.Parse(DateTime.Now.ToString("yyyy-01-01"));
///整改率
CRectificationRate = 0;
///合格率
CQualifiedRate = 0;
var getJointCheckDetail = from x in Funs.DB.Check_JointCheckDetail
where x.CreateDate >= time
select x;
var getCheckControl = from x in Funs.DB.Check_CheckControl select x;
var getCheckControl = from x in Funs.DB.Check_CheckControl
where x.CheckDate >= time
select x;
///问题总数
int AllCount = getJointCheckDetail.Count() + getCheckControl.Count();
this.divCQMSAllNum.InnerHtml = AllCount.ToString();
@@ -293,7 +300,7 @@ namespace FineUIPro.Web.common
CRectificationRate = Math.Round(CCount * 1.0 / AllCount * 100, 1);
}
}
var inspectionManagements = from x in Funs.DB.View_CQMS_InspectionManagementDetail select x;
var inspectionManagements = from x in Funs.DB.View_CQMS_InspectionManagementDetail where x.CheckDate>=time select x;
if (inspectionManagements.Count() > 0)
{
int okInspectionManagements = inspectionManagements.Where(x => x.IsOnceQualified == true).Count();