diff --git a/SGGL/BLL/API/HSSE/APICheckSpecialService.cs b/SGGL/BLL/API/HSSE/APICheckSpecialService.cs
index 76ddef25..7a6318bf 100644
--- a/SGGL/BLL/API/HSSE/APICheckSpecialService.cs
+++ b/SGGL/BLL/API/HSSE/APICheckSpecialService.cs
@@ -234,6 +234,10 @@ namespace BLL
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
+
+ CheckItemDetailSetId = x.CheckItemSetId,
+ CheckItemDetailContent = x.CheckItemSetContent,
+ Rectification_Date = x.Rectification_Date
};
return getInfo.ToList();
}
diff --git a/SGGL/BLL/ZHGL/DataStatistics/DataStatisticsService.cs b/SGGL/BLL/ZHGL/DataStatistics/DataStatisticsService.cs
index e84bceac..ee85ae92 100644
--- a/SGGL/BLL/ZHGL/DataStatistics/DataStatisticsService.cs
+++ b/SGGL/BLL/ZHGL/DataStatistics/DataStatisticsService.cs
@@ -72,9 +72,9 @@ namespace BLL
///
///
///
- public static List RectifyNoticesStatistics(string projectId, string unitId, DateTime? startTime, DateTime? endTime)
+ public static List RectifyNoticesStatistics(string projectId, string unitId, DateTime? startTime, DateTime? endTime)
{
- List GetCheckStatistics = new List();
+ List GetCheckStatistics = new List();
var getProjects = ProjectService.GetProjectWorkList();
if (projectId != Const._Null && !string.IsNullOrEmpty(projectId))
{
@@ -89,38 +89,127 @@ namespace BLL
}
foreach (var item in getUnits)
{
- var getHazardRegister = from x in Funs.DB.Check_RectifyNotices
- where x.ProjectId == pitem.ProjectId && x.UnitId == item.UnitId
- && x.States != "0"
- select x;
- if (startTime.HasValue)
- {
- getHazardRegister = getHazardRegister.Where(x => x.CheckedDate >= startTime);
- }
- if (endTime.HasValue)
- {
- getHazardRegister = getHazardRegister.Where(x => x.CheckedDate <= endTime);
- }
- Model.ChartAnalysisItem newItem = new Model.ChartAnalysisItem
+
+ Model.RecityNoticesItem newItem = new Model.RecityNoticesItem
{
DataId = SQLHelper.GetNewID(),
DataAllName = pitem.ProjectName,
DataName = item.UnitName,
};
- newItem.DataSumCount = getHazardRegister.Count();
- newItem.DataCount1 = getHazardRegister.Where(x => x.States == "1").Count();
- newItem.DataCount2 = getHazardRegister.Where(x => x.States == "2").Count();
- newItem.DataCount3 = getHazardRegister.Where(x => x.States == "3").Count();
- newItem.DataCount4 = getHazardRegister.Where(x => x.States == "4").Count();
- newItem.DataCount5 = getHazardRegister.Where(x => x.States == "5").Count();
- if (newItem.DataCount2 > 0)
+ //安全巡检隐患数
+ var getHazardRegister = from x in Funs.DB.View_Hazard_HazardRegister
+ where x.ProblemTypes == "1" && x.ProjectId == pitem.ProjectId && x.ResponsibleUnit == item.UnitId
+ select x;
+ if (startTime.HasValue)
{
- newItem.DataCountRate = (float)newItem.DataCount5 / (float)newItem.DataCount2 * 100;
+ getHazardRegister = getHazardRegister.Where(x => x.CheckTime >= startTime);
+ }
+ if (endTime.HasValue)
+ {
+ getHazardRegister = getHazardRegister.Where(x => x.CheckTime <= endTime);
+ }
+ newItem.DataSumCount1 = getHazardRegister.Where(x=>x.Type==0).Count();
+ newItem.DataSumCountYzg1 = getHazardRegister.Where(x => x.Type == 0 && x.States == "2").Count();
+ newItem.DataSumCountDzg1 = getHazardRegister.Where(x => x.Type == 0 && x.States == "1").Count();
+ if (newItem.DataSumCountYzg1 > 0)
+ {
+ newItem.DataSumCountZgl1 =Math.Round((float)newItem.DataSumCountYzg1 / (float)newItem.DataSumCount1 * 100,2).ToString()+"%";
}
else
{
- newItem.DataCountRate = 0;
+ newItem.DataSumCountZgl1 ="0%";
}
+
+
+ //常规巡检隐患数
+ newItem.DataSumCount2 = getHazardRegister.Where(x => x.Type == 1).Count();
+ newItem.DataSumCountYzg2 = getHazardRegister.Where(x => x.Type == 1 && x.States == "2").Count();
+ newItem.DataSumCountDzg2 = getHazardRegister.Where(x => x.Type == 1 && x.States == "1").Count();
+ if (newItem.DataSumCountYzg2 > 0)
+ {
+ newItem.DataSumCountZgl2 = Math.Round((float)newItem.DataSumCountYzg2 / (float)newItem.DataSumCount2 * 100, 2).ToString() + "%";
+ }
+ else
+ {
+ newItem.DataSumCountZgl2 = "0%";
+ }
+
+ //专项检查隐患数
+ var getCheckSpecial = from x in Funs.DB.Check_CheckSpecialDetail
+ join y in Funs.DB.Check_CheckSpecial on x.CheckSpecialId equals y.CheckSpecialId
+ where x.UnitId == item.UnitId && y.ProjectId == pitem.ProjectId
+ select new { y.CheckTime,x.UnitId,y.ProjectId,x.CompleteStatus };
+ if (startTime.HasValue)
+ {
+ getCheckSpecial = getCheckSpecial.Where(x => x.CheckTime >= startTime);
+ }
+ if (endTime.HasValue)
+ {
+ getCheckSpecial = getCheckSpecial.Where(x => x.CheckTime <= endTime);
+ }
+ newItem.DataSumCount3= getCheckSpecial.Count();
+ newItem.DataSumCountYzg3 = getCheckSpecial.Where(x =>x.CompleteStatus == true).Count();
+ newItem.DataSumCountDzg3 = getCheckSpecial.Where(x =>x.CompleteStatus == false).Count();
+ if (newItem.DataSumCountYzg3 > 0)
+ {
+ newItem.DataSumCountZgl3 =Math.Round((float)newItem.DataSumCountYzg3 / (float)newItem.DataSumCount3 * 100, 2).ToString() + "%"; ;
+ }
+ else
+ {
+ newItem.DataSumCountZgl3 = "0%";
+ }
+
+ //综合检查隐患数
+ var getCheckColligation = from x in Funs.DB.Check_CheckColligationDetail
+ join y in Funs.DB.Check_CheckColligation on x.CheckColligationId equals y.CheckColligationId
+ where x.UnitId == item.UnitId && y.ProjectId == pitem.ProjectId
+ select new { y.CheckTime, x.UnitId, y.ProjectId, x.CompleteStatus };
+ if (startTime.HasValue)
+ {
+ getCheckColligation = getCheckColligation.Where(x => x.CheckTime >= startTime);
+ }
+ if (endTime.HasValue)
+ {
+ getCheckColligation = getCheckColligation.Where(x => x.CheckTime <= endTime);
+ }
+ newItem.DataSumCount4 = getCheckColligation.Count();
+ newItem.DataSumCountYzg4 = getCheckColligation.Where(x => x.CompleteStatus == true).Count();
+ newItem.DataSumCountDzg4 = getCheckColligation.Where(x => x.CompleteStatus == false).Count();
+ if (newItem.DataSumCountYzg4 > 0)
+ {
+ newItem.DataSumCountZgl4 = Math.Round((float)newItem.DataSumCountYzg4 / (float)newItem.DataSumCount4 * 100, 2).ToString();
+ }
+ else
+ {
+ newItem.DataSumCountZgl4 = "0%";
+ }
+
+ //var getHazardRegister = from x in Funs.DB.Check_RectifyNotices
+ // where x.ProjectId == pitem.ProjectId && x.UnitId == item.UnitId
+ // && x.States != "0"
+ // select x;
+ //if (startTime.HasValue)
+ //{
+ // getHazardRegister = getHazardRegister.Where(x => x.CheckedDate >= startTime);
+ //}
+ //if (endTime.HasValue)
+ //{
+ // getHazardRegister = getHazardRegister.Where(x => x.CheckedDate <= endTime);
+ //}
+ //newItem.DataSumCount = getHazardRegister.Count();
+ //newItem.DataCount1 = getHazardRegister.Where(x => x.States == "1").Count();
+ //newItem.DataCount2 = getHazardRegister.Where(x => x.States == "2").Count();
+ //newItem.DataCount3 = getHazardRegister.Where(x => x.States == "3").Count();
+ //newItem.DataCount4 = getHazardRegister.Where(x => x.States == "4").Count();
+ //newItem.DataCount5 = getHazardRegister.Where(x => x.States == "5").Count();
+ //if (newItem.DataCount2 > 0)
+ //{
+ // newItem.DataCountRate = (float)newItem.DataCount5 / (float)newItem.DataCount2 * 100;
+ //}
+ //else
+ //{
+ // newItem.DataCountRate = 0;
+ //}
GetCheckStatistics.Add(newItem);
}
}
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx
index 573d7312..9c3e4bd6 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx
@@ -44,8 +44,8 @@
+ SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true"
+ IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True" AllowColumnLocking="true">
@@ -72,7 +72,7 @@
+ EnableLock="true" Locked="true">
@@ -81,29 +81,53 @@
HeaderText="项目" TextAlign="Left" HeaderTextAlign="Center">
--%>
+ HeaderText="单位" TextAlign="Left" HeaderTextAlign="Center" EnableLock="true" Locked="true">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%--
-
-
-
-
-
-
-
-
-
+ HeaderText="已整改" TextAlign="Left" HeaderTextAlign="Center">
+ --%>
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx.cs
index 7b45c22c..d3a22b67 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNoticesStatistics.aspx.cs
@@ -1,5 +1,6 @@
using BLL;
using System;
+using System.Collections.Generic;
using System.Data;
using System.Text;
using AspNet = System.Web.UI.WebControls;
@@ -122,7 +123,7 @@ namespace FineUIPro.Web.HSSE.Check
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount;
BindGrid();
- Response.Write(GetGridTableHtml(Grid1));
+ Response.Write(GetGridTableHtmlNew(Grid1));
Response.End();
}
@@ -162,6 +163,252 @@ namespace FineUIPro.Web.HSSE.Check
return sb.ToString();
}
+
+ ///
+ /// 格式化html
+ ///
+ ///
+ ///
+ private string GetGridTableHtmlNew(Grid grid)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ MultiHeaderTable mht = new MultiHeaderTable();
+ mht.ResolveMultiHeaderTable(Grid1.Columns);
+
+
+ sb.Append("");
+
+
+ sb.Append("");
+
+ ////列数
+ //var rowCount = "";
+ //var list = Funs.DB.Base_Project.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).OrderBy(x => x.ProjectCode).ToList();
+ //for (int i = 0; i < list.Count; i++)
+ //{
+ // rowCount+="{}"
+ //}
+
+ foreach (List
");
+
+ return sb.ToString();
+ }
+
+
+ public static string MidStrEx(string sourse, string startstr, string endstr)
+ {
+ string result = string.Empty;
+ int startindex, endindex;
+ try
+ {
+ startindex = sourse.IndexOf(startstr);
+ if (startindex == -1)
+ return result;
+ string tmpstr = sourse.Substring(startindex + startstr.Length);
+ endindex = tmpstr.IndexOf(endstr);
+ if (endindex == -1)
+ return result;
+ result = tmpstr.Remove(endindex);
+ }
+ catch (Exception ex)
+ {
+
+ }
+ return result;
+ }
+
+
+ #region 多表头处理
+
+ ///
+ /// 处理多表头的类
+ ///
+ public class MultiHeaderTable
+ {
+ // 包含 rowspan,colspan 的多表头,方便生成 HTML 的 table 标签
+ public List> MultiTable = new List>();
+ // 最终渲染的列数组
+ public List Columns = new List();
+
+
+ public void ResolveMultiHeaderTable(GridColumnCollection columns)
+ {
+ List