提交代码
This commit is contained in:
@@ -1,83 +1,86 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PunchlistFrom.aspx.cs" Inherits="FineUIPro.Web.Transfer.Chart.PunchlistFrom" %>
|
||||
|
||||
<%@ Register Src="~/Controls/ChartControl.ascx" TagName="ChartControl" TagPrefix="uc1" %>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1" AjaxAspnetControls="divAccidentUnit,divAccidentTime" />
|
||||
<f:Panel ID="Panel3" CssClass="blockpanel" runat="server" EnableCollapse="false"
|
||||
BodyPadding="10px" ShowBorder="true" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowHeader="false" ShowBorder="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="20% 3% 20% 30% 15% 10%">
|
||||
<Items>
|
||||
<f:DatePicker ID="txtStartRectificationTime" runat="server" Label="检查时间" LabelAlign="Right"
|
||||
LabelWidth="80px">
|
||||
</f:DatePicker>
|
||||
<f:Label ID="Label3" runat="server" Text="至" Width="5px">
|
||||
</f:Label>
|
||||
<f:DatePicker ID="txtEndRectificationTime" runat="server">
|
||||
</f:DatePicker>
|
||||
<f:DropDownList ID="drpChartType" runat="server" Label="图形类型" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="drpChartType_SelectedIndexChanged" Width="300px" LabelWidth="80px">
|
||||
<f:ListItem Value="Column" Text="柱形图"></f:ListItem>
|
||||
<f:ListItem Value="Line" Text="折线图"></f:ListItem>
|
||||
<f:ListItem Value="Pie" Text="饼形图"></f:ListItem>
|
||||
<f:ListItem Value="StackedArea" Text="堆积面积图"></f:ListItem>
|
||||
<f:ListItem Value="Spline" Text="样条图"></f:ListItem>
|
||||
<f:ListItem Value="SplineArea" Text="样条面积图"></f:ListItem>
|
||||
<f:ListItem Value="StepLine" Text="阶梯线图"></f:ListItem>
|
||||
<f:ListItem Value="Stock" Text="股价图"></f:ListItem>
|
||||
<f:ListItem Value="Radar" Text="雷达图"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:CheckBox ID="ckbShow" runat="server" LabelWidth="80px" Label="三维效果" AutoPostBack="true"
|
||||
OnCheckedChanged="ckbShow_CheckedChanged" Width="110px">
|
||||
</f:CheckBox>
|
||||
<f:Button ID="BtnAnalyse" Text="统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow >
|
||||
<Items>
|
||||
<f:RadioButtonList ID="rblState" runat="server" Label="分析类型" LabelWidth="80px" Width="250px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpChartType_SelectedIndexChanged">
|
||||
<f:RadioItem Value="0" Selected="true" Text="按责任单位" />
|
||||
<f:RadioItem Value="1" Text="按检查项" />
|
||||
</f:RadioButtonList>
|
||||
<f:Label ID="aa" runat="server">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel4" CssClass="blockpanel" runat="server" EnableCollapse="false"
|
||||
BodyPadding="10px" ShowBorder="true" ShowHeader="false">
|
||||
<Items>
|
||||
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="360px" ShowBorder="true"
|
||||
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server">
|
||||
<Tabs>
|
||||
<f:Tab ID="Tab2" Title="按类别" BodyPadding="5px" Layout="Fit" IconFont="Bookmark" runat="server"
|
||||
TitleToolTip="按类别统计">
|
||||
<Items>
|
||||
<f:ContentPanel ShowHeader="false" runat="server" ID="cpAccidentTime" Margin="0 0 0 0">
|
||||
<div id="divAccidentTime">
|
||||
<uc1:ChartControl ID="ChartAccidentTime" runat="server" />
|
||||
</div>
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Tab>
|
||||
</Tabs>
|
||||
</f:TabStrip>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1" AjaxAspnetControls="divAccidentUnit,divAccidentTime" />
|
||||
<f:Panel ID="Panel3" CssClass="blockpanel" runat="server" EnableCollapse="false"
|
||||
BodyPadding="10px" ShowBorder="true" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowHeader="false" ShowBorder="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="20% 3% 20% 30% 15% 10%">
|
||||
<Items>
|
||||
<f:DatePicker ID="txtStartTime" runat="server" Label="时间" LabelAlign="Right"
|
||||
LabelWidth="80px">
|
||||
</f:DatePicker>
|
||||
<f:Label ID="Label3" runat="server" Text="至" Width="5px">
|
||||
</f:Label>
|
||||
<f:DatePicker ID="txtEndTime" runat="server">
|
||||
</f:DatePicker>
|
||||
<f:DropDownList ID="drpChartType" runat="server" Label="图形类型" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="drpChartType_SelectedIndexChanged" Width="300px" LabelWidth="80px">
|
||||
<f:ListItem Value="Column" Text="柱形图"></f:ListItem>
|
||||
<f:ListItem Value="Line" Text="折线图"></f:ListItem>
|
||||
<f:ListItem Value="Pie" Text="饼形图"></f:ListItem>
|
||||
<f:ListItem Value="StackedArea" Text="堆积面积图"></f:ListItem>
|
||||
<f:ListItem Value="Spline" Text="样条图"></f:ListItem>
|
||||
<f:ListItem Value="SplineArea" Text="样条面积图"></f:ListItem>
|
||||
<f:ListItem Value="StepLine" Text="阶梯线图"></f:ListItem>
|
||||
<f:ListItem Value="Stock" Text="股价图"></f:ListItem>
|
||||
<f:ListItem Value="Radar" Text="雷达图"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:CheckBox ID="ckbShow" runat="server" LabelWidth="80px" Label="三维效果" AutoPostBack="true"
|
||||
OnCheckedChanged="ckbShow_CheckedChanged" Width="110px">
|
||||
</f:CheckBox>
|
||||
<f:Button ID="BtnAnalyse" Text="统计" Icon="ChartPie" runat="server" OnClick="BtnAnalyse_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:RadioButtonList ID="rblState" runat="server" Label="分析类型" LabelWidth="80px" Width="250px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpChartType_SelectedIndexChanged">
|
||||
<f:RadioItem Value="0" Selected="true" Text="按Identified during/by" />
|
||||
<f:RadioItem Value="1" Text="按Discipline" />
|
||||
</f:RadioButtonList>
|
||||
<%--<f:DropDownList ID="drpType" OnSelectedIndexChanged="drpType_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="Identified during/by" LabelAlign="Right" AutoSelectFirstItem="false" EnableEdit="true">
|
||||
</f:DropDownList>--%>
|
||||
<f:Label ID="aa" runat="server">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel4" CssClass="blockpanel" runat="server" EnableCollapse="false"
|
||||
BodyPadding="10px" ShowBorder="true" ShowHeader="false">
|
||||
<Items>
|
||||
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="600px" ShowBorder="true"
|
||||
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server">
|
||||
<Tabs>
|
||||
<f:Tab ID="Tab2" Title="图形" BodyPadding="5px" Layout="Fit" IconFont="Bookmark" runat="server"
|
||||
TitleToolTip="图形">
|
||||
<Items>
|
||||
<f:ContentPanel ShowHeader="false" runat="server" ID="cpAccidentTime" Margin="0 0 0 0">
|
||||
<div id="divAccidentTime">
|
||||
<uc1:ChartControl ID="ChartAccidentTime" runat="server" />
|
||||
</div>
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Tab>
|
||||
</Tabs>
|
||||
</f:TabStrip>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -38,110 +38,107 @@ namespace FineUIPro.Web.Transfer.Chart
|
||||
/// </summary>
|
||||
private void AnalyseData()
|
||||
{
|
||||
var hazardRegisters = (from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.States != "4" && x.ProblemTypes == "1"
|
||||
select x);
|
||||
if (!string.IsNullOrEmpty(this.txtStartRectificationTime.Text.Trim()))
|
||||
var forms = from x in Funs.DB.Transfer_PunchlistFrom
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
|
||||
{
|
||||
hazardRegisters = hazardRegisters.Where(x => x.CheckTime >= Funs.GetNewDateTime(this.txtStartRectificationTime.Text.Trim()));
|
||||
forms = forms.Where(x => x.PUNCH_ITEM_FINISH_DATE >= Funs.GetNewDateTime(this.txtStartTime.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndRectificationTime.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
|
||||
{
|
||||
hazardRegisters = hazardRegisters.Where(x => x.CheckTime <= Funs.GetNewDateTime(this.txtEndRectificationTime.Text.Trim()));
|
||||
forms = forms.Where(x => x.PUNCH_ITEM_FINISH_DATE <= Funs.GetNewDateTime(this.txtEndTime.Text.Trim()));
|
||||
}
|
||||
var list = new List<string> { "Testing", "Pre-Commissioning", "PSSR", "Commissioning" };
|
||||
if (this.rblState.SelectedValue == "0")
|
||||
{
|
||||
#region 按单位统计
|
||||
#region 按Identified during/by统计
|
||||
if (this.drpChartType.SelectedValue != "Pie") //非饼形图
|
||||
{
|
||||
///按单位统计
|
||||
DataTable dtTime = new DataTable();
|
||||
dtTime.Columns.Add("单位", typeof(string));
|
||||
dtTime.Columns.Add("Identified during/by", typeof(string));
|
||||
dtTime.Columns.Add("总数量", typeof(string));
|
||||
dtTime.Columns.Add("待整改", typeof(string));
|
||||
dtTime.Columns.Add("已整改", typeof(string));
|
||||
|
||||
var units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
|
||||
foreach (var item in units)
|
||||
dtTime.Columns.Add("A数量", typeof(string));
|
||||
dtTime.Columns.Add("B数量", typeof(string));
|
||||
dtTime.Columns.Add("C数量", typeof(string));
|
||||
foreach (var item in list)
|
||||
{
|
||||
DataRow rowTime = dtTime.NewRow();
|
||||
Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem();
|
||||
rowTime["单位"] = item.UnitName;
|
||||
var unitHazad = hazardRegisters.Where(x => x.ResponsibleUnit == item.UnitId);
|
||||
rowTime["总数量"] = unitHazad.Count();
|
||||
rowTime["待整改"] = unitHazad.Where(x => x.States == "1" || x.States == null).Count();
|
||||
rowTime["已整改"] = unitHazad.Where(x => x.States == "3" || x.States == "2").Count();
|
||||
rowTime["Identified during/by"] = item;
|
||||
var types = forms.Where(x => x.Identified == item);
|
||||
rowTime["总数量"] = types.Count();
|
||||
rowTime["A数量"] = types.Where(x => x.Category == "A").Count();
|
||||
rowTime["B数量"] = types.Where(x => x.Category == "B").Count();
|
||||
rowTime["C数量"] = types.Where(x => x.Category == "C").Count();
|
||||
dtTime.Rows.Add(rowTime);
|
||||
}
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "单位巡检分析", this.drpChartType.SelectedValue, 1100, 300, this.ckbShow.Checked));
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项分析", this.drpChartType.SelectedValue, 1100, 550, this.ckbShow.Checked));
|
||||
}
|
||||
else //饼形图
|
||||
{
|
||||
DataTable dtTime = new DataTable();
|
||||
dtTime.Columns.Add("单位", typeof(string));
|
||||
dtTime.Columns.Add("Identified during/by", typeof(string));
|
||||
dtTime.Columns.Add("总数量", typeof(string));
|
||||
|
||||
var units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
|
||||
foreach (var item in units)
|
||||
foreach (var item in list)
|
||||
{
|
||||
DataRow rowTime = dtTime.NewRow();
|
||||
Model.SpTDesktopItem newspItem = new Model.SpTDesktopItem();
|
||||
rowTime["单位"] = item.UnitName;
|
||||
var unitHazad = hazardRegisters.Where(x => x.ResponsibleUnit == item.UnitId);
|
||||
rowTime["总数量"] = unitHazad.Count();
|
||||
rowTime["Identified during/by"] = item;
|
||||
var types = forms.Where(x => x.Identified == item);
|
||||
rowTime["总数量"] = types.Count();
|
||||
dtTime.Rows.Add(rowTime);
|
||||
}
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "单位巡检分析", this.drpChartType.SelectedValue, 1130, 450, this.ckbShow.Checked));
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项分析", this.drpChartType.SelectedValue, 1130, 550, this.ckbShow.Checked));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
else
|
||||
{
|
||||
#region 按检查项
|
||||
#region 按Discipline
|
||||
var disciplines = from x in Funs.DB.Base_TransferMajor orderby x.DisciplineCode select x;
|
||||
if (this.drpChartType.SelectedValue != "Pie") //非饼形图
|
||||
{
|
||||
///按检查项
|
||||
DataTable dtTime = new DataTable();
|
||||
dtTime.Columns.Add("检查项", typeof(string));
|
||||
dtTime.Columns.Add("Discipline", 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)
|
||||
dtTime.Columns.Add("A数量", typeof(string));
|
||||
dtTime.Columns.Add("B数量", typeof(string));
|
||||
dtTime.Columns.Add("C数量", typeof(string));
|
||||
foreach (var item in disciplines)
|
||||
{
|
||||
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();
|
||||
rowTime["Discipline"] = item.Discipline;
|
||||
var types = forms.Where(x => x.Discipline == item.Discipline);
|
||||
rowTime["总数量"] = types.Count();
|
||||
rowTime["A数量"] = types.Where(x => x.Category == "A").Count();
|
||||
rowTime["B数量"] = types.Where(x => x.Category == "B").Count();
|
||||
rowTime["C数量"] = types.Where(x => x.Category == "C").Count();
|
||||
dtTime.Rows.Add(rowTime);
|
||||
}
|
||||
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "巡检问题分析", this.drpChartType.SelectedValue, 1100, 330, this.ckbShow.Checked));
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项分析", this.drpChartType.SelectedValue, 1100, 550, this.ckbShow.Checked));
|
||||
}
|
||||
else //饼形图
|
||||
{
|
||||
///按问题类型
|
||||
DataTable dtTime = new DataTable();
|
||||
dtTime.Columns.Add("检查项", typeof(string));
|
||||
dtTime.Columns.Add("Discipline", 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)
|
||||
foreach (var item in disciplines)
|
||||
{
|
||||
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["Discipline"] = item.Discipline;
|
||||
var types = forms.Where(x => x.Discipline == item.Discipline);
|
||||
rowTime["总数量"] = types.Count();
|
||||
dtTime.Rows.Add(rowTime);
|
||||
}
|
||||
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "巡检问题分析", this.drpChartType.SelectedValue, 1100, 330, this.ckbShow.Checked));
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项分析", this.drpChartType.SelectedValue, 1100, 550, this.ckbShow.Checked));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -49,13 +49,13 @@ namespace FineUIPro.Web.Transfer.Chart {
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// txtStartRectificationTime 控件。
|
||||
/// txtStartTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtStartRectificationTime;
|
||||
protected global::FineUIPro.DatePicker txtStartTime;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
@@ -67,13 +67,13 @@ namespace FineUIPro.Web.Transfer.Chart {
|
||||
protected global::FineUIPro.Label Label3;
|
||||
|
||||
/// <summary>
|
||||
/// txtEndRectificationTime 控件。
|
||||
/// txtEndTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndRectificationTime;
|
||||
protected global::FineUIPro.DatePicker txtEndTime;
|
||||
|
||||
/// <summary>
|
||||
/// drpChartType 控件。
|
||||
|
||||
Reference in New Issue
Block a user