安全检查补充公司级树
This commit is contained in:
@@ -9,6 +9,23 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
{
|
||||
public partial class RiskAnalysisChart : PageBase
|
||||
{
|
||||
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -17,10 +34,41 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
this.AnalyseData();
|
||||
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
//////权限按钮方法
|
||||
//this.GetButtonPower();
|
||||
}
|
||||
|
||||
this.AnalyseData();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
|
||||
//if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
//{
|
||||
// btnNew.Hidden = true;
|
||||
//}
|
||||
//this.GetButtonPower();
|
||||
this.AnalyseData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 统计
|
||||
@@ -32,22 +80,24 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
protected void BtnAnalyse_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.AnalyseData();
|
||||
PageContext.RegisterStartupScript(@" setTimeout(function () { rendChart(" + legend+","+xAxis+","+series+ ");},1500); ");
|
||||
|
||||
PageContext.RegisterStartupScript(@" setTimeout(function () { rendChart(" + legend + "," + xAxis + "," + series + ");},1500); ");
|
||||
|
||||
}
|
||||
public string legend = "[]";
|
||||
public string xAxis="[]";
|
||||
public string series="[]";
|
||||
public string xAxis = "[]";
|
||||
public string series = "[]";
|
||||
|
||||
/// <summary>
|
||||
/// 统计方法
|
||||
/// </summary>
|
||||
private void AnalyseData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
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,
|
||||
@@ -61,11 +111,11 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
||||
{
|
||||
strSql += " and CheckTime <'" + DateTime.Parse( this.txtEndRectificationTime.Text.Trim()).AddDays(1).ToString("yyyy-MM-dd") + "' ";
|
||||
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));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
@@ -154,7 +204,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
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));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
@@ -175,14 +225,14 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
Dictionary<string, string> temp = null;
|
||||
if (!data.ContainsKey(dr["unitName"].ToString()))
|
||||
{
|
||||
data.Add(dr["unitName"].ToString(), new Dictionary<string,string>());
|
||||
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.Add(dr["RegisterTypesName"].ToString(), "0");
|
||||
}
|
||||
temp[dr["RegisterTypesName"].ToString()]=dr["allnum"].ToString();
|
||||
temp[dr["RegisterTypesName"].ToString()] = dr["allnum"].ToString();
|
||||
}
|
||||
|
||||
foreach (string types in xdic)
|
||||
@@ -216,7 +266,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
|
||||
series += @"{
|
||||
name: '"+ unit + @"[全部]',
|
||||
name: '" + unit + @"[全部]',
|
||||
type: 'bar',
|
||||
stack: '全部',
|
||||
barWidth: 10,
|
||||
@@ -230,11 +280,11 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
data: [" + tempseries.TrimEnd(',') + @"]
|
||||
},";
|
||||
}
|
||||
data = new Dictionary<string, Dictionary<string, string>>();
|
||||
data = new Dictionary<string, Dictionary<string, string>>();
|
||||
foreach (DataRow dr in tb.Rows)
|
||||
{
|
||||
xdic.Add(dr["RegisterTypesName"].ToString());
|
||||
Dictionary<string,string> temp = null;
|
||||
Dictionary<string, string> temp = null;
|
||||
if (!data.ContainsKey(dr["unitName"].ToString()))
|
||||
{
|
||||
data.Add(dr["unitName"].ToString(), new Dictionary<string, string>());
|
||||
@@ -244,7 +294,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
{
|
||||
temp.Add(dr["RegisterTypesName"].ToString(), "0");
|
||||
}
|
||||
temp[dr["RegisterTypesName"].ToString()]=dr["todo"].ToString();
|
||||
temp[dr["RegisterTypesName"].ToString()] = dr["todo"].ToString();
|
||||
}
|
||||
foreach (string unit in data.Keys)
|
||||
{
|
||||
@@ -290,7 +340,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
{
|
||||
temp.Add(dr["RegisterTypesName"].ToString(), "0");
|
||||
}
|
||||
temp[dr["RegisterTypesName"].ToString()]=dr["finish"].ToString();
|
||||
temp[dr["RegisterTypesName"].ToString()] = dr["finish"].ToString();
|
||||
}
|
||||
foreach (string unit in data.Keys)
|
||||
{
|
||||
@@ -324,10 +374,10 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
series = series.TrimEnd(',');
|
||||
series += "]";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "单位巡检分析", this.drpChartType.SelectedValue, 1130, 450, this.ckbShow.Checked));
|
||||
|
||||
Reference in New Issue
Block a user