20211028 安全首页巡检集合静态初始处理后再取值

This commit is contained in:
2021-10-28 18:10:38 +08:00
parent 6b41214a49
commit d348939699
3 changed files with 48 additions and 257 deletions
+43 -16
View File
@@ -8,14 +8,37 @@ namespace FineUIPro.Web
{
public partial class mainMenu_HSSE : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getHazardRegisterLists= HSSE_Hazard_HazardRegisterService.GetHazardRegisterListByProjectId(this.CurrUser.LoginProjectId);
this.ProjectId = string.Empty;
if (this.CurrUser != null && !string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.ProjectId = this.CurrUser.LoginProjectId;
}
getHazardRegisterLists = new List<Model.HSSE_Hazard_HazardRegister>();
getHazardRegisterLists = HSSE_Hazard_HazardRegisterService.GetHazardRegisterListByProjectId(this.ProjectId);
///当前现场总人数
getSitePerson();
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
if (project != null && project.Telephone != null)
{
this.xmb.InnerHtml = project.Telephone;
@@ -30,7 +53,7 @@ namespace FineUIPro.Web
private void getSitePerson()
{
var getEmployInOutRecords = Funs.DB.T_d_EmployInOutRecord.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date).ToList();
var getEmployInOutRecords = Funs.DB.T_d_EmployInOutRecord.Where(x => x.ProjectId == this.ProjectId && x.RecordDate.Value == DateTime.Now.Date).ToList();
int AllCount = getEmployInOutRecords.Count();
if (AllCount > 0)
{
@@ -93,7 +116,7 @@ namespace FineUIPro.Web
Model.SingleSerie s = new Model.SingleSerie();
List<double> listdata = new List<double>();
var getStates = LicensePublicService.drpStatesItem().Where(x=>x.Value != Const._Null);
var getLicense = APILicenseDataService.getLicenseDataListByStates(this.CurrUser.LoginProjectId, Const.UnitId_CWCEC, null);
var getLicense = APILicenseDataService.getLicenseDataListByStates(this.ProjectId, Const.UnitId_CWCEC, null);
foreach (var itemStates in getStates)
{
listCategories.Add(itemStates.Text);
@@ -130,25 +153,29 @@ namespace FineUIPro.Web
List<double> listdata2 = new List<double>();
businessColumn.title = "安全检查问题统计";
var units = getHazardRegisterLists.Select(x => x.ResponsibleUnit).Distinct();
//UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
//UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
if (units.Count() > 0)
{
foreach (var unitId in units)
{
var getunits = UnitService.GetUnitByUnitId(unitId);
if (getunits != null)
var getPuUnit = Funs.DB.Project_ProjectUnit.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitId == unitId);
if (getPuUnit != null)
{
listCategories.Add(getunits.ShortUnitName ?? getunits.UnitCode);
var unitHazardRegisters = getHazardRegisterLists.Where(x => x.ResponsibleUnit == getunits.UnitId);
var noW = unitHazardRegisters.Where(x => x.States != "3");
listdata.Add(unitHazardRegisters.Count() - noW.Count());
listdata2.Add(unitHazardRegisters.Count());
var getunits = UnitService.GetUnitByUnitId(unitId);
if (getunits != null)
{
listCategories.Add(getunits.ShortUnitName ?? getunits.UnitCode);
var unitHazardRegisters = getHazardRegisterLists.Where(x => x.ResponsibleUnit == getunits.UnitId);
var noW = unitHazardRegisters.Where(x => x.States != "3");
listdata.Add(unitHazardRegisters.Count() - noW.Count());
listdata2.Add(unitHazardRegisters.Count());
}
}
}
}
else
{
var getunits = UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2).Take(10);
var getunits = UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2).Take(10);
foreach (var unit in getunits)
{
listCategories.Add(unit.ShortUnitName ?? unit.UnitCode);
@@ -223,14 +250,14 @@ namespace FineUIPro.Web
List<double> listdata = new List<double>();
List<double> listdata2 = new List<double>();
var getTrainRecord = from x in Funs.DB.EduTrain_TrainRecord
where x.ProjectId == this.CurrUser.LoginProjectId && x.TrainTypeId == Const.EntryTrainTypeId
where x.ProjectId == this.ProjectId && x.TrainTypeId == Const.EntryTrainTypeId
select x;
var getTrainRecordDetail = from x in Funs.DB.EduTrain_TrainRecordDetail
join y in getTrainRecord on x.TrainingId equals y.TrainingId
select x;
DateTime startTime = DateTime.Now;
DateTime endTime = DateTime.Now;
var getProject = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
var getProject = ProjectService.GetProjectByProjectId(this.ProjectId);
if (getProject != null && getProject.StartDate.HasValue)
{
startTime = getProject.StartDate.Value;
@@ -280,7 +307,7 @@ namespace FineUIPro.Web
businessColumn.title = "事故统计";
var getAccident = from x in Funs.DB.Accident_AccidentReport
where x.ProjectId == this.CurrUser.LoginProjectId
where x.ProjectId == this.ProjectId
select x;
listdata.Add(getAccident.Where(x => x.AccidentTypeId == "1" || x.AccidentTypeId == "2" || x.AccidentTypeId == "3" || x.AccidentTypeId == "4").Count());