2023-04-28

This commit is contained in:
2023-04-28 17:26:38 +08:00
parent 5b740e7bda
commit 9a94d0a844
7 changed files with 150 additions and 59 deletions
@@ -1,4 +1,5 @@
using BLL;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Configuration;
@@ -48,20 +49,20 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
List<Model.HandleStep> handleSteps = new List<Model.HandleStep>();
Model.HandleStep handleStep1 = new Model.HandleStep();
handleStep1.Id = "1";
handleStep1.Name = "整改";
handleStep1.Name = "整改";
handleSteps.Add(handleStep1);
Model.HandleStep handleStep2 = new Model.HandleStep();
handleStep2.Id = "2";
handleStep2.Name = "已整改-待复查验收";
handleStep2.Name = "按时整改";
handleSteps.Add(handleStep2);
Model.HandleStep handleStep3 = new Model.HandleStep();
handleStep3.Id = "3";
handleStep3.Name = "已闭环";
handleStep3.Name = "超期整改";
handleSteps.Add(handleStep3);
//Model.HandleStep handleStep4 = new Model.HandleStep();
//handleStep4.Id = "4";
//handleStep4.Name = "已作废";
//handleSteps.Add(handleStep4);
Model.HandleStep handleStep4 = new Model.HandleStep();
handleStep4.Id = "4";
handleStep4.Name = "超期未整改";
handleSteps.Add(handleStep4);
this.drpStates.DataSource = handleSteps; ;
this.drpStates.DataBind();
Funs.FineUIPleaseSelect(this.drpStates,"按状态");
@@ -158,8 +159,25 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
}
if (this.drpStates.SelectedValue != BLL.Const._Null)
{
strSql += " AND States LIKE @States";
listStr.Add(new SqlParameter("@States", "%" + this.drpStates.SelectedValue + "%"));
if (this.drpStates.SelectedValue == "1")
{
strSql += " AND States = '1' and RectificationPeriod > getdate()";
}
else if (this.drpStates.SelectedValue == "2")
{
strSql += " AND States in( '2','3') and RectificationPeriod > RectificationTime";
}
else if (this.drpStates.SelectedValue == "3")
{
strSql += " AND States in( '2','3') and RectificationPeriod < RectificationTime";
}
else if (this.drpStates.SelectedValue == "4")
{
strSql += " AND States ='1' and RectificationPeriod < getdate()";
}
}
if (!CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
{
@@ -613,6 +631,40 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
}
return url;
}
protected string ConverState(object registrationId)
{
string state = string.Empty;
if (registrationId != null)
{
Model.View_Hazard_HazardRegister registration = (from x in Funs.DB.View_Hazard_HazardRegister where x.HazardRegisterId == registrationId.ToString() select x).FirstOrDefault();
if (registration != null)
{
if (registration.States == "1" && registration.RectificationPeriod.Value > DateTime.Now)
{
state += "未整改";
}
else if ((registration.States == "2" || registration.States == "3")&& registration.RectificationPeriod.Value>registration.RectificationTime.Value)
{
state += "按时整改";
}
else if ((registration.States == "2" || registration.States == "3") && registration.RectificationPeriod.Value < registration.RectificationTime.Value)
{
state += "超期整改";
}
else if (registration.States =="1" && registration. RectificationPeriod.Value <DateTime.Now)
{
state += "超期未整改";
}
}
}
return state;
}
#endregion
#region