修改集团展示页
This commit is contained in:
parent
a33c14f46d
commit
e5f663ff7f
|
@ -0,0 +1,2 @@
|
|||
alter table HSSE_Hazard_HazardRegister add HazardValue nvarchar(50) null
|
||||
GO
|
|
@ -29,6 +29,11 @@
|
|||
<f:DatePicker ID="txtStartTime" runat="server" Label="检查时间" LabelAlign="Right"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="200px" LabelWidth="80px">
|
||||
</f:DatePicker>
|
||||
<f:RadioButtonList runat="server" ID="rbType" Width="200px" Label="级别" LabelWidth="50px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:RadioItem Text="重大" Value="0" Selected="true" />
|
||||
<f:RadioItem Text="一般" Value="1" />
|
||||
</f:RadioButtonList>
|
||||
<f:Label ID="Label3" runat="server" Text="至">
|
||||
</f:Label>
|
||||
<f:DatePicker ID="txtEndTime" runat="server" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
|
||||
|
@ -52,19 +57,27 @@
|
|||
</f:RenderField>
|
||||
<f:RenderField Width="350px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="allcount" DataField="allcount" FieldType="Int"
|
||||
HeaderText="问题数量" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ccount" DataField="ccount" FieldType="Int"
|
||||
HeaderText="整改数量" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ucCount" DataField="ucCount" FieldType="Int"
|
||||
HeaderText="未整改数量" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="rateV" DataField="rateV" FieldType="String" HeaderText="整改率(%)" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="Count1" Width="120px" HeaderText="问题数量" HeaderTextAlign="Center" TextAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Count1(Eval("ProjectId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="Count2" Width="120px" HeaderText="整改数量" HeaderTextAlign="Center" TextAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Count2(Eval("ProjectId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="Count3" Width="120px" HeaderText="未整改数量" HeaderTextAlign="Center" TextAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Count3(Eval("ProjectId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="Count4" Width="120px" HeaderText="整改率(%)" HeaderTextAlign="Center" TextAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Count4(Eval("ProjectId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
using Aspose.Words;
|
||||
using BLL;
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FineUIPro.Web.DataShow
|
||||
{
|
||||
|
@ -24,7 +21,6 @@ namespace FineUIPro.Web.DataShow
|
|||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||
// 绑定表格t
|
||||
|
@ -37,56 +33,36 @@ namespace FineUIPro.Web.DataShow
|
|||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"select NEWID() as ID, v.ProjectId,v.ProjectCode,v.ProjectName,v.allcount,v.ccount,isnull(v.allCount,0)-ISNULL(v.cCount,0) as ucCount,
|
||||
(case when isnull(v.allCount,0) > 0 then cast((isnull(v.allCount,0)-ISNULL(v.cCount,0)) *1.0 /isnull(v.allCount,0)*100 as decimal(18, 2))
|
||||
else 0 end) as rateV
|
||||
from (select h.ProjectId,p.ProjectCode,p.ProjectName,COUNT(*) as allCount,
|
||||
isnull((select COUNT(*) from HSSE_Hazard_HazardRegister as c
|
||||
where c.ProjectId=h.ProjectId and states =3
|
||||
and '1' = @cpara
|
||||
group by c.ProjectId),0) as cCount
|
||||
from HSSE_Hazard_HazardRegister as h
|
||||
left join Base_Project as p on h.ProjectId=p.ProjectId
|
||||
where p.projectId is not null ";
|
||||
string strSql = @"select ProjectId,ProjectCode, ProjectName from Base_Project where ProjectState =1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
string cpara = string.Empty;
|
||||
if (this.drpProject.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql += " AND h.projectId = @projectId"; ///状态为已完成
|
||||
strSql += " AND projectId = @projectId"; ///状态为已完成
|
||||
listStr.Add(new SqlParameter("@projectId", this.drpProject.SelectedValue));
|
||||
|
||||
cpara += " AND c.projectId ="+ this.drpProject.SelectedValue;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtStartTime.Text))
|
||||
{
|
||||
strSql += " AND h.RegisterDate >=@StartTime";
|
||||
listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text));
|
||||
//if (!string.IsNullOrEmpty(this.txtStartTime.Text))
|
||||
//{
|
||||
// strSql += " AND h.RegisterDate >=@StartTime";
|
||||
// listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text));
|
||||
|
||||
cpara += " AND c.RegisterDate >=" + this.txtStartTime.Text;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
{
|
||||
strSql += " AND h.RegisterDate <=@EndTime";
|
||||
listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text));
|
||||
// cpara += " AND c.RegisterDate >=" + this.txtStartTime.Text;
|
||||
//}
|
||||
//if (!string.IsNullOrEmpty(this.txtEndTime.Text))
|
||||
//{
|
||||
// strSql += " AND h.RegisterDate <=@EndTime";
|
||||
// listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text));
|
||||
|
||||
// cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
|
||||
//}
|
||||
|
||||
cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(cpara))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@cpara"," '1' And "+ cpara));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@cpara", "'1'"));
|
||||
}
|
||||
strSql += " group by h.ProjectId,p.ProjectCode,p.ProjectName) as v";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -177,5 +153,132 @@ namespace FineUIPro.Web.DataShow
|
|||
{
|
||||
EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected int Count1(object projectId)
|
||||
{
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States != "4");
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getT = getT.Where(x => x.RegisterDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getT = getT.Where(x => x.RegisterDate <= datetime2);
|
||||
}
|
||||
if (this.rbType.SelectedValue == "0")
|
||||
{
|
||||
getT = getT.Where(x => x.HazardValue == "3");
|
||||
}
|
||||
else
|
||||
{
|
||||
getT = getT.Where(x => x.HazardValue != "3");
|
||||
}
|
||||
cout1 = getT.Count();
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
protected int Count2(object projectId)
|
||||
{
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States == "3");
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getT = getT.Where(x => x.RegisterDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getT = getT.Where(x => x.RegisterDate <= datetime2);
|
||||
}
|
||||
if (this.rbType.SelectedValue == "0")
|
||||
{
|
||||
getT = getT.Where(x => x.HazardValue == "3");
|
||||
}
|
||||
else
|
||||
{
|
||||
getT = getT.Where(x => x.HazardValue != "3");
|
||||
}
|
||||
cout1 = getT.Count();
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
protected int Count3(object projectId)
|
||||
{
|
||||
int cout1 = 0;
|
||||
if (projectId != null)
|
||||
{
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States != "3" && x.States != "4");
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getT = getT.Where(x => x.RegisterDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getT = getT.Where(x => x.RegisterDate <= datetime2);
|
||||
}
|
||||
if (this.rbType.SelectedValue == "0")
|
||||
{
|
||||
getT = getT.Where(x => x.HazardValue == "3");
|
||||
}
|
||||
else
|
||||
{
|
||||
getT = getT.Where(x => x.HazardValue != "3");
|
||||
}
|
||||
cout1 = getT.Count();
|
||||
}
|
||||
return cout1;
|
||||
}
|
||||
|
||||
protected string Count4(object projectId)
|
||||
{
|
||||
string rate=string.Empty;
|
||||
if (projectId != null)
|
||||
{
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getALL= Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States != "4");
|
||||
if (this.rbType.SelectedValue == "0")
|
||||
{
|
||||
getALL = getALL.Where(x => x.HazardValue == "3");
|
||||
}
|
||||
else
|
||||
{
|
||||
getALL = getALL.Where(x => x.HazardValue != "3");
|
||||
}
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getALL = getALL.Where(x => x.RegisterDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getALL = getALL.Where(x => x.RegisterDate >= datetime1);
|
||||
}
|
||||
var getT = getALL.Where(x => x.ProjectId == projectId.ToString() && x.States == "3");
|
||||
int coutall = getALL.Count();
|
||||
int cout0 = getT.Count();
|
||||
if (coutall > 0)
|
||||
{
|
||||
rate = Math.Round(cout0 * 1.0 / coutall * 100, 2).ToString();
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -77,6 +77,15 @@ namespace FineUIPro.Web.DataShow
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtStartTime;
|
||||
|
||||
/// <summary>
|
||||
/// rbType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbType;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
/// </summary>
|
||||
|
@ -113,6 +122,42 @@ namespace FineUIPro.Web.DataShow
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label labNumber;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label4;
|
||||
|
||||
/// <summary>
|
||||
/// Label5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label5;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
<f:DatePicker ID="txtEndTime" runat="server" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
|
||||
Width="130px">
|
||||
</f:DatePicker>
|
||||
<f:RadioButtonList runat="server" ID="rbType" Width="200px" Label="级别" LabelWidth="50px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:RadioItem Text="重大" Value="0" Selected="true" />
|
||||
<f:RadioItem Text="一般" Value="1" />
|
||||
</f:RadioButtonList>
|
||||
<f:DropDownList ID="drpStates" runat="server" Label="状态" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
LabelWidth="70px" LabelAlign="Right" Width="210px">
|
||||
</f:DropDownList>
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
using Aspose.Words;
|
||||
using BLL;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FineUIPro.Web.DataShow
|
||||
{
|
||||
|
@ -83,6 +79,16 @@ namespace FineUIPro.Web.DataShow
|
|||
strSql += " AND States LIKE @States";
|
||||
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
|
||||
}
|
||||
if (this.rbType.SelectedValue == "0")
|
||||
{
|
||||
strSql += " AND HazardValue =@HazardValue";
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND HazardValue != @HazardValue";
|
||||
}
|
||||
listStr.Add(new SqlParameter("@HazardValue", "3"));
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
|
@ -147,18 +153,12 @@ namespace FineUIPro.Web.DataShow
|
|||
protected string ConvertImageUrlByImage(object registrationId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
string httpUrl = string.Empty;
|
||||
var sysSet6 = (from x in Funs.DB.Sys_Set where x.SetName == "程序访问地址" select x).ToList().FirstOrDefault();
|
||||
if (sysSet6 != null)
|
||||
{
|
||||
httpUrl = sysSet6.SetValue;
|
||||
}
|
||||
if (registrationId != null)
|
||||
{
|
||||
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
|
||||
if (registration != null)
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage(httpUrl, registration.ImageUrl);
|
||||
url = BLL.UploadAttachmentService.ShowImage("../", registration.ImageUrl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
|
@ -173,18 +173,12 @@ namespace FineUIPro.Web.DataShow
|
|||
protected string ConvertImgUrlByImage(object registrationId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
string httpUrl = string.Empty;
|
||||
var sysSet6 = (from x in Funs.DB.Sys_Set where x.SetName == "程序访问地址" select x).ToList().FirstOrDefault();
|
||||
if (sysSet6 != null)
|
||||
{
|
||||
httpUrl = sysSet6.SetValue;
|
||||
}
|
||||
if (registrationId != null)
|
||||
{
|
||||
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
|
||||
if (registration != null)
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage(httpUrl, registration.RectificationImageUrl);
|
||||
url = BLL.UploadAttachmentService.ShowImage("../", registration.RectificationImageUrl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
|
|
|
@ -95,6 +95,15 @@ namespace FineUIPro.Web.DataShow
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndTime;
|
||||
|
||||
/// <summary>
|
||||
/// rbType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbType;
|
||||
|
||||
/// <summary>
|
||||
/// drpStates 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -146612,6 +146612,8 @@ namespace Model
|
|||
|
||||
private string _Requirements;
|
||||
|
||||
private string _HazardValue;
|
||||
|
||||
private EntityRef<Base_Unit> _Base_Unit;
|
||||
|
||||
private EntityRef<HSSE_Hazard_HazardRegisterTypes> _HSSE_Hazard_HazardRegisterTypes;
|
||||
|
@ -146704,6 +146706,8 @@ namespace Model
|
|||
partial void OnResultIdChanged();
|
||||
partial void OnRequirementsChanging(string value);
|
||||
partial void OnRequirementsChanged();
|
||||
partial void OnHazardValueChanging(string value);
|
||||
partial void OnHazardValueChanged();
|
||||
#endregion
|
||||
|
||||
public HSSE_Hazard_HazardRegister()
|
||||
|
@ -147561,6 +147565,26 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HazardValue", DbType="NVarChar(50)")]
|
||||
public string HazardValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._HazardValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._HazardValue != value))
|
||||
{
|
||||
this.OnHazardValueChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._HazardValue = value;
|
||||
this.SendPropertyChanged("HazardValue");
|
||||
this.OnHazardValueChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HSSE_Hazard_HazardRegister_Base_Unit", Storage="_Base_Unit", ThisKey="ResponsibleUnit", OtherKey="UnitId", IsForeignKey=true)]
|
||||
public Base_Unit Base_Unit
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue