393 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			393 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Data;
							 | 
						|||
| 
								 | 
							
								using System.Data.SqlClient;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using BLL;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace FineUIPro.Web.HSSE.HiddenInspection
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public partial class RiskAnalysisChart : PageBase
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        #region 加载页面
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 加载页面
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void Page_Load(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								             
							 | 
						|||
| 
								 | 
							
								                this.AnalyseData();
							 | 
						|||
| 
								 | 
							
								           
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 统计
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 统计分析
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void BtnAnalyse_Click(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.AnalyseData();
							 | 
						|||
| 
								 | 
							
								            PageContext.RegisterStartupScript(@" setTimeout(function () { rendChart(" + legend+","+xAxis+","+series+ ");},1000);  ");
							 | 
						|||
| 
								 | 
							
								          
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        public string legend = "[]";
							 | 
						|||
| 
								 | 
							
								        public string xAxis="[]";
							 | 
						|||
| 
								 | 
							
								        public string series="[]";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 统计方法
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        private void AnalyseData()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            if (this.rblState.SelectedValue == "0")
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                string strSql = @" select u.UnitId,u.unitName,
							 | 
						|||
| 
								 | 
							
								                             count(*)    as allnum,
							 | 
						|||
| 
								 | 
							
								                             Sum(case when States= 1 or States is null then 1 else 0 end) as todo,
							 | 
						|||
| 
								 | 
							
								                             Sum(case when States= 3 or States =2 then 1 else 0 end) as finish
							 | 
						|||
| 
								 | 
							
								                             from HSSE_Hazard_HazardRegister r left join Base_Unit u on r.ResponsibleUnit = u.UnitId
							 | 
						|||
| 
								 | 
							
								                             where ProjectId=@ProjectId and States != '4' and ProblemTypes = '1'
							 | 
						|||
| 
								 | 
							
								                            ";
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += " and CheckTime >='" + this.txtStartRectificationTime.Text.Trim() + "' ";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += " and CheckTime <'" + DateTime.Parse(  this.txtEndRectificationTime.Text.Trim()).AddDays(1).ToString("yyyy-MM-dd") + "' ";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                strSql += " group by u.UnitId,u.unitName ";
							 | 
						|||
| 
								 | 
							
								                List<SqlParameter> listStr = new List<SqlParameter>();
							 | 
						|||
| 
								 | 
							
								                listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                SqlParameter[] parameter = listStr.ToArray();
							 | 
						|||
| 
								 | 
							
								                DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
							 | 
						|||
| 
								 | 
							
								                legend = "[\"全部\", \"待整改\", \"已整改\"]";
							 | 
						|||
| 
								 | 
							
								                xAxis = "[";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                string series1 = "[";
							 | 
						|||
| 
								 | 
							
								                string series2 = "[";
							 | 
						|||
| 
								 | 
							
								                string series3 = "[";
							 | 
						|||
| 
								 | 
							
								                foreach (DataRow dr in tb.Rows)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    xAxis += "\"" + dr["unitName"].ToString() + "\",";
							 | 
						|||
| 
								 | 
							
								                    series1 += "" + dr["allnum"].ToString() + ",";
							 | 
						|||
| 
								 | 
							
								                    series2 += "" + dr["todo"].ToString() + ",";
							 | 
						|||
| 
								 | 
							
								                    series3 += "" + dr["finish"].ToString() + ",";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                xAxis = xAxis.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                xAxis += "]";
							 | 
						|||
| 
								 | 
							
								                series1 = series1.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                series1 += "]";
							 | 
						|||
| 
								 | 
							
								                series2 = series2.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                series2 += "]";
							 | 
						|||
| 
								 | 
							
								                series3 = series3.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                series3 += "]";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                series = @"[{
							 | 
						|||
| 
								 | 
							
								                                name: '全部',
							 | 
						|||
| 
								 | 
							
								                                type: 'bar',
							 | 
						|||
| 
								 | 
							
								                                label: {
							 | 
						|||
| 
								 | 
							
								                                            show: true,
							 | 
						|||
| 
								 | 
							
								                                            position: 'top'
							 | 
						|||
| 
								 | 
							
								                                        }, 
							 | 
						|||
| 
								 | 
							
								                                barWidth: 20,
							 | 
						|||
| 
								 | 
							
								                                emphasis: {
							 | 
						|||
| 
								 | 
							
								                                    focus: 'series'
							 | 
						|||
| 
								 | 
							
								                                },
							 | 
						|||
| 
								 | 
							
								                                data: " + series1 + @"
							 | 
						|||
| 
								 | 
							
								                            },
							 | 
						|||
| 
								 | 
							
								                            {
							 | 
						|||
| 
								 | 
							
								                                name: '待整改',
							 | 
						|||
| 
								 | 
							
								                                type: 'bar', 
							 | 
						|||
| 
								 | 
							
								                                barWidth: 20,
							 | 
						|||
| 
								 | 
							
								                                label: {
							 | 
						|||
| 
								 | 
							
								                                            show: true,
							 | 
						|||
| 
								 | 
							
								                                            position: 'top'
							 | 
						|||
| 
								 | 
							
								                                        }, 
							 | 
						|||
| 
								 | 
							
								                                emphasis: {
							 | 
						|||
| 
								 | 
							
								                                    focus: 'series'
							 | 
						|||
| 
								 | 
							
								                                },
							 | 
						|||
| 
								 | 
							
								                                data: " + series2 + @"
							 | 
						|||
| 
								 | 
							
								                            },
							 | 
						|||
| 
								 | 
							
								                            {
							 | 
						|||
| 
								 | 
							
								                                name: '已整改',
							 | 
						|||
| 
								 | 
							
								                                type: 'bar', 
							 | 
						|||
| 
								 | 
							
								                                barWidth: 20,
							 | 
						|||
| 
								 | 
							
								                                label: {
							 | 
						|||
| 
								 | 
							
								                                            show: true,
							 | 
						|||
| 
								 | 
							
								                                            position: 'top'
							 | 
						|||
| 
								 | 
							
								                                        }, 
							 | 
						|||
| 
								 | 
							
								                                emphasis: {
							 | 
						|||
| 
								 | 
							
								                                    focus: 'series'
							 | 
						|||
| 
								 | 
							
								                                },
							 | 
						|||
| 
								 | 
							
								                                data: " + series3 + @"
							 | 
						|||
| 
								 | 
							
								                            }]";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            else
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                string strSql = @" select u.UnitId,u.unitName,r.RegisterTypesId,t.RegisterTypesName,
							 | 
						|||
| 
								 | 
							
								                             count(*)    as allnum,
							 | 
						|||
| 
								 | 
							
								                             Sum(case when States= 1 or States is null then 1 else 0 end) as todo,
							 | 
						|||
| 
								 | 
							
								                             Sum(case when States= 3 or States = 2 then 1 else 0 end) as finish
							 | 
						|||
| 
								 | 
							
								                             from HSSE_Hazard_HazardRegister r left join Base_Unit u on r.ResponsibleUnit = u.UnitId 
							 | 
						|||
| 
								 | 
							
															 left join HSSE_Hazard_HazardRegisterTypes t on r.RegisterTypesId=t.RegisterTypesId
							 | 
						|||
| 
								 | 
							
								                             where ProjectId=@ProjectId and States != '4' and ProblemTypes = '1'
							 | 
						|||
| 
								 | 
							
								                              ";
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += " and CheckTime >='" + this.txtStartRectificationTime.Text.Trim() + "' ";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    strSql += " and CheckTime <'" + DateTime.Parse(this.txtEndRectificationTime.Text.Trim()).AddDays(1).ToString("yyyy-MM-dd") + "' ";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                strSql += " group by u.UnitId,u.unitName ,r.RegisterTypesId,t.RegisterTypesName ";
							 | 
						|||
| 
								 | 
							
								                List<SqlParameter> listStr = new List<SqlParameter>();
							 | 
						|||
| 
								 | 
							
								                listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                SqlParameter[] parameter = listStr.ToArray();
							 | 
						|||
| 
								 | 
							
								                DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
							 | 
						|||
| 
								 | 
							
								                Dictionary<string, Dictionary<string, string>> data = new Dictionary<string, Dictionary<string, string>>();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                legend = "[";
							 | 
						|||
| 
								 | 
							
								                xAxis = "[";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                HashSet<string> xdic = new HashSet<string>();
							 | 
						|||
| 
								 | 
							
								                HashSet<string> unitdic = new HashSet<string>();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                foreach (DataRow dr in tb.Rows)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    xdic.Add(dr["RegisterTypesName"].ToString());
							 | 
						|||
| 
								 | 
							
								                    unitdic.Add(dr["unitName"].ToString());
							 | 
						|||
| 
								 | 
							
								                    Dictionary<string, string> temp = null;
							 | 
						|||
| 
								 | 
							
								                    if (!data.ContainsKey(dr["unitName"].ToString()))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        data.Add(dr["unitName"].ToString(), new Dictionary<string,string>());
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    temp = data[dr["unitName"].ToString()];
							 | 
						|||
| 
								 | 
							
								                    if (!temp.ContainsKey(dr["RegisterTypesName"].ToString()))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        temp.Add(dr["RegisterTypesName"].ToString(),"0");
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    temp[dr["RegisterTypesName"].ToString()]=dr["allnum"].ToString();
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                foreach (string types in xdic)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    xAxis += "\"" + types + "\",";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                xAxis = xAxis.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                xAxis += "]";
							 | 
						|||
| 
								 | 
							
								                foreach (string types in unitdic)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    legend += "\"" + types + "[全部]\",";
							 | 
						|||
| 
								 | 
							
								                    legend += "\"" + types + "[未整改]\",";
							 | 
						|||
| 
								 | 
							
								                    legend += "\"" + types + "[已整改]\",";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                legend = legend.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                legend += "]";
							 | 
						|||
| 
								 | 
							
								                series = "[";
							 | 
						|||
| 
								 | 
							
								                foreach (string unit in data.Keys)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    string tempseries = "";
							 | 
						|||
| 
								 | 
							
								                    foreach (string types in xdic)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        if (data[unit].ContainsKey(types))
							 | 
						|||
| 
								 | 
							
								                        {
							 | 
						|||
| 
								 | 
							
								                            tempseries += "" + data[unit][types] + ",";
							 | 
						|||
| 
								 | 
							
								                        }
							 | 
						|||
| 
								 | 
							
								                        else
							 | 
						|||
| 
								 | 
							
								                        {
							 | 
						|||
| 
								 | 
							
								                            tempseries += "0,";
							 | 
						|||
| 
								 | 
							
								                        }
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                    series += @"{
							 | 
						|||
| 
								 | 
							
								                                name: '"+ unit + @"[全部]',
							 | 
						|||
| 
								 | 
							
								                                type: 'bar',
							 | 
						|||
| 
								 | 
							
								                                stack: '全部',
							 | 
						|||
| 
								 | 
							
								                                barWidth: 10,
							 | 
						|||
| 
								 | 
							
								                                label: {
							 | 
						|||
| 
								 | 
							
								                                    show: true,
							 | 
						|||
| 
								 | 
							
								                                    position: 'top'
							 | 
						|||
| 
								 | 
							
								                                }, 
							 | 
						|||
| 
								 | 
							
								                                emphasis: {
							 | 
						|||
| 
								 | 
							
								                                    focus: 'series'
							 | 
						|||
| 
								 | 
							
								                                },
							 | 
						|||
| 
								 | 
							
								                                data: [" + tempseries.TrimEnd(',') + @"] 
							 | 
						|||
| 
								 | 
							
								                                },";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                 data = new Dictionary<string, Dictionary<string, string>>();
							 | 
						|||
| 
								 | 
							
								                foreach (DataRow dr in tb.Rows)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    xdic.Add(dr["RegisterTypesName"].ToString());
							 | 
						|||
| 
								 | 
							
								                    Dictionary<string,string> temp = null;
							 | 
						|||
| 
								 | 
							
								                    if (!data.ContainsKey(dr["unitName"].ToString()))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        data.Add(dr["unitName"].ToString(), new Dictionary<string, string>());
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    temp = data[dr["unitName"].ToString()];
							 | 
						|||
| 
								 | 
							
								                    if (!temp.ContainsKey(dr["RegisterTypesName"].ToString()))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        temp.Add(dr["RegisterTypesName"].ToString(), "0");
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    temp[dr["RegisterTypesName"].ToString()]=dr["todo"].ToString();
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                foreach (string unit in data.Keys)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    string tempseries = "";
							 | 
						|||
| 
								 | 
							
								                    foreach (string types in xdic)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        if (data[unit].ContainsKey(types))
							 | 
						|||
| 
								 | 
							
								                        {
							 | 
						|||
| 
								 | 
							
								                            tempseries += "" + data[unit][types] + ",";
							 | 
						|||
| 
								 | 
							
								                        }
							 | 
						|||
| 
								 | 
							
								                        else
							 | 
						|||
| 
								 | 
							
								                        {
							 | 
						|||
| 
								 | 
							
								                            tempseries += "0,";
							 | 
						|||
| 
								 | 
							
								                        }
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                    series += @"{
							 | 
						|||
| 
								 | 
							
								                                name: '" + unit + @"[未整改]',
							 | 
						|||
| 
								 | 
							
								                                type: 'bar',
							 | 
						|||
| 
								 | 
							
								                                stack: '未整改',
							 | 
						|||
| 
								 | 
							
								                                barWidth: 10,
							 | 
						|||
| 
								 | 
							
								                                label: {
							 | 
						|||
| 
								 | 
							
								                                    show: true,
							 | 
						|||
| 
								 | 
							
								                                    position: 'top'
							 | 
						|||
| 
								 | 
							
								                                }, 
							 | 
						|||
| 
								 | 
							
								                                emphasis: {
							 | 
						|||
| 
								 | 
							
								                                    focus: 'series'
							 | 
						|||
| 
								 | 
							
								                                },
							 | 
						|||
| 
								 | 
							
								                                data: [" + tempseries.TrimEnd(',') + @"] 
							 | 
						|||
| 
								 | 
							
								                                },";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                data = new Dictionary<string, Dictionary<string, string>>();
							 | 
						|||
| 
								 | 
							
								                foreach (DataRow dr in tb.Rows)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    xdic.Add(dr["RegisterTypesName"].ToString());
							 | 
						|||
| 
								 | 
							
								                    Dictionary<string, string> temp = null;
							 | 
						|||
| 
								 | 
							
								                    if (!data.ContainsKey(dr["unitName"].ToString()))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        data.Add(dr["unitName"].ToString(), new Dictionary<string, string>());
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    temp = data[dr["unitName"].ToString()];
							 | 
						|||
| 
								 | 
							
								                    if (!temp.ContainsKey(dr["RegisterTypesName"].ToString()))
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        temp.Add(dr["RegisterTypesName"].ToString(), "0");
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                    temp[dr["RegisterTypesName"].ToString()]=dr["finish"].ToString();
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                foreach (string unit in data.Keys)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    string tempseries = "";
							 | 
						|||
| 
								 | 
							
								                    foreach (string types in xdic)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        if (data[unit].ContainsKey(types))
							 | 
						|||
| 
								 | 
							
								                        {
							 | 
						|||
| 
								 | 
							
								                            tempseries += "" + data[unit][types] + ",";
							 | 
						|||
| 
								 | 
							
								                        }
							 | 
						|||
| 
								 | 
							
								                        else
							 | 
						|||
| 
								 | 
							
								                        {
							 | 
						|||
| 
								 | 
							
								                            tempseries += "0,";
							 | 
						|||
| 
								 | 
							
								                        }
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                    series += @"{
							 | 
						|||
| 
								 | 
							
								                                name: '" + unit + @"[已整改]',
							 | 
						|||
| 
								 | 
							
								                                type: 'bar',
							 | 
						|||
| 
								 | 
							
								                                stack: '已整改',
							 | 
						|||
| 
								 | 
							
								                                barWidth: 10,
							 | 
						|||
| 
								 | 
							
								                                label: {
							 | 
						|||
| 
								 | 
							
								                                    show: true,
							 | 
						|||
| 
								 | 
							
								                                    position: 'top'
							 | 
						|||
| 
								 | 
							
								                                }, 
							 | 
						|||
| 
								 | 
							
								                                emphasis: {
							 | 
						|||
| 
								 | 
							
								                                    focus: 'series'
							 | 
						|||
| 
								 | 
							
								                                },
							 | 
						|||
| 
								 | 
							
								                                data: [" + tempseries.TrimEnd(',') + @"] 
							 | 
						|||
| 
								 | 
							
								                                },";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                series = series.TrimEnd(',');
							 | 
						|||
| 
								 | 
							
								                series += "]";
							 | 
						|||
| 
								 | 
							
								               
							 | 
						|||
| 
								 | 
							
								               
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //   this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "单位巡检分析", this.drpChartType.SelectedValue, 1130, 450, this.ckbShow.Checked));
							 | 
						|||
| 
								 | 
							
								            //#endregion
							 | 
						|||
| 
								 | 
							
								            //}
							 | 
						|||
| 
								 | 
							
								            //else
							 | 
						|||
| 
								 | 
							
								            //{
							 | 
						|||
| 
								 | 
							
								            //    #region 按检查项
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //    ///按检查项
							 | 
						|||
| 
								 | 
							
								            //    DataTable dtTime = new DataTable();
							 | 
						|||
| 
								 | 
							
								            //    dtTime.Columns.Add("检查项", typeof(string));
							 | 
						|||
| 
								 | 
							
								            //    dtTime.Columns.Add("总数量", typeof(string));
							 | 
						|||
| 
								 | 
							
								            //    dtTime.Columns.Add("待整改", typeof(string));
							 | 
						|||
| 
								 | 
							
								            //    dtTime.Columns.Add("已整改", typeof(string));
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //    var types = from x in Funs.DB.HSSE_Hazard_HazardRegisterTypes where x.HazardRegisterType == "1" orderby x.TypeCode select x;
							 | 
						|||
| 
								 | 
							
								            //    foreach (var item in types)
							 | 
						|||
| 
								 | 
							
								            //    {
							 | 
						|||
| 
								 | 
							
								            //        DataRow rowTime = dtTime.NewRow();
							 | 
						|||
| 
								 | 
							
								            //        Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem();
							 | 
						|||
| 
								 | 
							
								            //        rowTime["检查项"] = item.RegisterTypesName;
							 | 
						|||
| 
								 | 
							
								            //        var typeHazad = hazardRegisters.Where(x => x.RegisterTypesId == item.RegisterTypesId);
							 | 
						|||
| 
								 | 
							
								            //        rowTime["总数量"] = typeHazad.Count();
							 | 
						|||
| 
								 | 
							
								            //        rowTime["待整改"] = typeHazad.Where(x => x.States == "1" || x.States == null).Count();
							 | 
						|||
| 
								 | 
							
								            //        rowTime["已整改"] = typeHazad.Where(x => x.States == "3" || x.States == "2").Count();
							 | 
						|||
| 
								 | 
							
								            //        dtTime.Rows.Add(rowTime);
							 | 
						|||
| 
								 | 
							
								            //    }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //    //  this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "巡检问题分析", this.drpChartType.SelectedValue, 1100, 330, this.ckbShow.Checked));
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            //    #endregion
							 | 
						|||
| 
								 | 
							
								            //}
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 图形
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 图形变换 
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void drpChartType_SelectedIndexChanged(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.AnalyseData();
							 | 
						|||
| 
								 | 
							
								            PageContext.RegisterStartupScript(@"setTimeout(function () {  rendChart(" + legend + "," + xAxis + "," + series + ");}, 1000); ");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        protected void ckbShow_CheckedChanged(object sender, CheckedEventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            this.AnalyseData();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            PageContext.RegisterStartupScript(@"setTimeout(function () { rendChart(" + legend + "," + xAxis + "," + series + ");}, 1000);");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								    
							 | 
						|||
| 
								 | 
							
								    
							 | 
						|||
| 
								 | 
							
								    
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |