From e5f663ff7f59b7e7cc89fd5624bdc1d65f2be294 Mon Sep 17 00:00:00 2001 From: gaofei <181547018@qq.com> Date: Mon, 27 Mar 2023 14:59:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9B=86=E5=9B=A2=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SGGLDB_WH_2023-03-27.sql | 2 + .../DataShow/HiddenRectification.aspx | 39 ++-- .../DataShow/HiddenRectification.aspx.cs | 185 ++++++++++++++---- .../HiddenRectification.aspx.designer.cs | 45 +++++ .../DataShow/HiddenRectificationItem.aspx | 5 + .../DataShow/HiddenRectificationItem.aspx.cs | 32 ++- .../HiddenRectificationItem.aspx.designer.cs | 9 + SGGL/Model/Model.cs | 24 +++ 8 files changed, 268 insertions(+), 73 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_WH_2023-03-27.sql diff --git a/DataBase/版本日志/SGGLDB_WH_2023-03-27.sql b/DataBase/版本日志/SGGLDB_WH_2023-03-27.sql new file mode 100644 index 00000000..1ebe42e7 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2023-03-27.sql @@ -0,0 +1,2 @@ +alter table HSSE_Hazard_HazardRegister add HazardValue nvarchar(50) null +GO \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx b/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx index e81213c3..3aaf9117 100644 --- a/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx +++ b/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx @@ -29,6 +29,11 @@ + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.cs b/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.cs index b82fb4db..68bf82c0 100644 --- a/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.cs @@ -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 /// 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 listStr = new List(); 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(); } + + /// + /// 数量 + /// + /// + /// + 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; + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.designer.cs index cb8fa00e..1a369f55 100644 --- a/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DataShow/HiddenRectification.aspx.designer.cs @@ -77,6 +77,15 @@ namespace FineUIPro.Web.DataShow /// protected global::FineUIPro.DatePicker txtStartTime; + /// + /// rbType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbType; + /// /// Label3 控件。 /// @@ -113,6 +122,42 @@ namespace FineUIPro.Web.DataShow /// protected global::System.Web.UI.WebControls.Label labNumber; + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label4; + + /// + /// Label5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label5; + /// /// ToolbarSeparator1 控件。 /// diff --git a/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx b/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx index 0bee361e..17a590d1 100644 --- a/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx +++ b/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx @@ -32,6 +32,11 @@ + + + + diff --git a/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.cs b/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.cs index 4562c643..9a1541b5 100644 --- a/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.cs +++ b/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.cs @@ -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; diff --git a/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.designer.cs b/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.designer.cs index 2be8e568..5dc49deb 100644 --- a/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DataShow/HiddenRectificationItem.aspx.designer.cs @@ -95,6 +95,15 @@ namespace FineUIPro.Web.DataShow /// protected global::FineUIPro.DatePicker txtEndTime; + /// + /// rbType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rbType; + /// /// drpStates 控件。 /// diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 65f7c79d..d3e7ea25 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -146612,6 +146612,8 @@ namespace Model private string _Requirements; + private string _HazardValue; + private EntityRef _Base_Unit; private EntityRef _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 {