20230920 HSE管理月报

This commit is contained in:
2023-09-20 13:55:00 +08:00
parent 47f9a0e959
commit 374cad03f1
48 changed files with 6674 additions and 8104 deletions
@@ -52,14 +52,19 @@ namespace FineUIPro.Web.HSSE.Manager
#region
/// <summary>
/// 6.1 五环HSE费用投入集合
/// 本月伤害事故统计
/// </summary>
private static List<Model.Manager_Month_FiveExpenseC> fiveExpenses = new List<Model.Manager_Month_FiveExpenseC>();
private static List<Model.Manager_Month_InjuryAccidentC> injuryAccidents = new List<Model.Manager_Month_InjuryAccidentC>();
/// <summary>
/// 6.2 分包商HSE费用投入集合
/// 无伤害事故统计
/// </summary>
private static List<Model.Manager_Month_SubExpenseC> subExpenses = new List<Model.Manager_Month_SubExpenseC>();
private static List<Model.Manager_Month_NoInjuryAccidentC> noInjuryAccidents = new List<Model.Manager_Month_NoInjuryAccidentC>();
/// <summary>
/// HSE绩效指标
/// </summary>
private static List<Model.Manager_Month_PerformanceIndicatorC> performanceIndicators = new List<Model.Manager_Month_PerformanceIndicatorC>();
#endregion
@@ -70,8 +75,9 @@ namespace FineUIPro.Web.HSSE.Manager
{
if (!IsPostBack)
{
fiveExpenses.Clear();
subExpenses.Clear();
injuryAccidents.Clear();
noInjuryAccidents.Clear();
performanceIndicators.Clear();
this.MonthReportId = Request.Params["monthReportId"];
this.ProjectId = this.CurrUser.LoginProjectId;
DateTime months = Convert.ToDateTime(Request.Params["months"]);
@@ -90,155 +96,326 @@ namespace FineUIPro.Web.HSSE.Manager
this.MonthReportId = monthReport.MonthReportId;
this.ProjectId = monthReport.ProjectId;
months = Convert.ToDateTime(monthReport.Months);
Model.SGGLDB db = Funs.DB;
this.nbMainCost1.Text = (monthReport.MainCost1 ?? 0).ToString();
this.nbMainProjectCost1.Text = (monthReport.MainProjectCost1 ?? 0).ToString();
this.nbSubCost1.Text = (monthReport.SubCost1 ?? 0).ToString();
this.nbSubProjectCost1.Text = (monthReport.SubProjectCost1 ?? 0).ToString();
this.nbMainCost2.Text = (monthReport.MainCost2 ?? 0).ToString();
this.nbMainProjectCost2.Text = (monthReport.MainProjectCost2 ?? 0).ToString();
this.nbSubCost2.Text = (monthReport.SubCost2 ?? 0).ToString();
this.nbSubProjectCost2.Text = (monthReport.SubProjectCost2 ?? 0).ToString();
this.nbMainCost3.Text = (monthReport.MainCost3 ?? 0).ToString();
this.nbMainProjectCost3.Text = (monthReport.MainProjectCost3 ?? 0).ToString();
this.nbSubCost3.Text = (monthReport.SubCost3 ?? 0).ToString();
this.nbSubProjectCost3.Text = (monthReport.SubProjectCost3 ?? 0).ToString();
this.nbMainCost4.Text = (monthReport.MainCost4 ?? 0).ToString();
this.nbMainProjectCost4.Text = (monthReport.MainProjectCost4 ?? 0).ToString();
this.nbSubCost4.Text = (monthReport.SubCost4 ?? 0).ToString();
this.nbSubProjectCost4.Text = (monthReport.SubProjectCost4 ?? 0).ToString();
this.nbMainCost5.Text = (monthReport.MainCost5 ?? 0).ToString();
this.nbMainProjectCost5.Text = (monthReport.MainProjectCost5 ?? 0).ToString();
this.nbSubCost5.Text = (monthReport.SubCost5 ?? 0).ToString();
this.nbSubProjectCost5.Text = (monthReport.SubProjectCost5 ?? 0).ToString();
this.nbMainCost6.Text = (monthReport.MainCost6 ?? 0).ToString();
this.nbMainProjectCost6.Text = (monthReport.MainProjectCost6 ?? 0).ToString();
this.nbSubCost6.Text = (monthReport.SubCost6 ?? 0).ToString();
this.nbSubProjectCost6.Text = (monthReport.SubProjectCost6 ?? 0).ToString();
this.nbMainCost7.Text = (monthReport.MainCost7 ?? 0).ToString();
this.nbMainProjectCost7.Text = (monthReport.MainProjectCost7 ?? 0).ToString();
this.nbSubCost7.Text = (monthReport.SubCost7 ?? 0).ToString();
this.nbSubProjectCost7.Text = (monthReport.SubProjectCost7 ?? 0).ToString();
this.nbMainCost.Text = (monthReport.MainCost ?? 0).ToString();
this.nbMainProjectCost.Text = (monthReport.MainProjectCost ?? 0).ToString();
this.nbSubCost.Text = (monthReport.SubCost ?? 0).ToString();
this.nbSubProjectCost.Text = (monthReport.SubProjectCost ?? 0).ToString();
this.nbJianAnCost.Text = (monthReport.JianAnCost ?? 0).ToString();
this.nbJianAnProjectCost.Text = (monthReport.JianAnProjectCost ?? 0).ToString();
txtDef.Text = monthReport.AccidentDef;
#region
injuryAccidents = BLL.InjuryAccidentCService.GetInjuryAccidentCByMonthReportId(this.MonthReportId);
if (injuryAccidents.Count > 0)
{
this.gvInjuryAccident.DataSource = injuryAccidents;
this.gvInjuryAccident.DataBind();
OutputSummaryData();
}
else
{
GetInjuryAccident();
}
#endregion
#region
noInjuryAccidents = BLL.NoInjuryAccidentCService.GetNoInjuryAccidentByMonthReportId(this.MonthReportId);
if (noInjuryAccidents.Count > 0)
{
this.gvNoInjuryAccident.DataSource = noInjuryAccidents;
this.gvNoInjuryAccident.DataBind();
}
else
{
GetNoInjuryAccident();
}
#endregion
#region HSE绩效指标
performanceIndicators = BLL.PerformanceIndicatorCService.GetPerformanceIndicatorByMonthReportId(this.MonthReportId);
if (performanceIndicators.Count > 0)
{
this.gvPerformanceIndicator.DataSource = performanceIndicators;
this.gvPerformanceIndicator.DataBind();
}
else
{
GetPerformanceIndicator();
}
#endregion
}
else
{
GetFiveExpenseList(); //费用投入
GetInjuryAccident();
GetNoInjuryAccident();
GetPerformanceIndicator();
}
}
}
#endregion
#region
#region
/// <summary>
/// 费用投入
/// 本月伤害事故统计
/// </summary>
private void GetFiveExpenseList()
private void GetInjuryAccident()
{
Model.Manager_MonthReportC mr = BLL.MonthReportCService.GetLastMonthReportByDate(endTime, this.ProjectId);
decimal? sMonthType1 = 0, sMonthType2 = 0, sMonthType3 = 0, sMonthType4 = 0, sMonthType5 = 0, sMonthType6 = 0;
decimal? tMonthType1 = 0, tMonthType2 = 0;
List<Model.CostGoods_PayRegistration> payRegistrations = BLL.PayRegistrationService.GetPayRegistrationByPayDate(startTime, endTime, this.ProjectId);
if (payRegistrations != null)
List<Model.Accident_AccidentReport> reports = AccidentReportService.GetAccidentReportsByAccidentTime(startTime, endTime, this.ProjectId);
List<Model.Accident_AccidentReport> deathReports = AccidentReportService.GetAccidentReportsByAccidentType("1", startTime, endTime, this.ProjectId);
int i = 0;
Model.Manager_Month_InjuryAccidentC injury = new Model.Manager_Month_InjuryAccidentC
{
foreach (var item in payRegistrations)
{
sMonthType1 += item.SMonthType1_1 + item.SMonthType1_2 + item.SMonthType1_3 + item.SMonthType1_4 + item.SMonthType1_5 + item.SMonthType1_6 + item.SMonthType1_7 + item.SMonthType1_8 + item.SMonthType1_9 + item.SMonthType1_10 + item.SMonthType1_11 + item.SMonthType1_12 + item.SMonthType1_13 + item.SMonthType1_14 + item.SMonthType1_15 + item.SMonthType1_16;
sMonthType2 += item.SMonthType2_1 + item.SMonthType2_2 + item.SMonthType2_3 + item.SMonthType2_4;
sMonthType3 += item.SMonthType3_1 + item.SMonthType3_2 + item.SMonthType3_3 + item.SMonthType3_4 + item.SMonthType3_5 + item.SMonthType3_6;
sMonthType4 += item.SMonthType4_1 + item.SMonthType4_2 + item.SMonthType4_3 + item.SMonthType4_4 + item.SMonthType4_5 + item.SMonthType4_6 + item.SMonthType4_7 + item.SMonthType4_8 + item.SMonthType4_9 + item.SMonthType4_10 + item.SMonthType4_11 + item.SMonthType4_12 + item.SMonthType4_13 + item.SMonthType4_14 + item.SMonthType4_15 + item.SMonthType4_16 + item.SMonthType4_17 + item.SMonthType4_18 + item.SMonthType4_19 + item.SMonthType4_20 + item.SMonthType4_21 + item.SMonthType4_22 + item.SMonthType4_23 + item.SMonthType4_24 + item.SMonthType4_25 + item.SMonthType4_26 + item.SMonthType4_27 + item.SMonthType4_28 + item.SMonthType4_29 + item.SMonthType4_30 + item.SMonthType4_31 + item.SMonthType4_32 + item.SMonthType4_33 + item.SMonthType4_34 + item.SMonthType4_35 + item.SMonthType4_35 + item.SMonthType4_36 + item.SMonthType4_37 + item.SMonthType4_38 + item.SMonthType4_39 + item.SMonthType4_40;
sMonthType5 += item.SMonthType5_1 + item.SMonthType5_2 + item.SMonthType5_3 + item.SMonthType5_4 + item.SMonthType5_5 + item.SMonthType5_6;
sMonthType6 += item.SMonthType6_1 + item.SMonthType6_2 + item.SMonthType6_3;
tMonthType1 += item.TMonthType1_1 + item.TMonthType1_2 + item.TMonthType1_3 + item.TMonthType1_4 + item.TMonthType1_5 + item.TMonthType1_6 + item.TMonthType1_7 + item.TMonthType1_8 + item.TMonthType1_9 + item.TMonthType1_10 + item.TMonthType1_11;
//tMonthType2 += item.TMonthType2_1 + item.TMonthType2_2 + item.TMonthType2_3 + item.TMonthType2_4 + item.TMonthType2_5 + item.TMonthType2_6 + item.TMonthType2_7 + item.TMonthType2_8 + item.TMonthType2_9;
}
this.nbMainCost1.Text = sMonthType1.ToString();
this.nbMainCost2.Text = sMonthType2.ToString();
this.nbMainCost3.Text = sMonthType3.ToString();
this.nbMainCost4.Text = sMonthType4.ToString();
this.nbMainCost5.Text = sMonthType5.ToString();
this.nbMainCost6.Text = sMonthType6.ToString();
this.nbMainCost7.Text = tMonthType1.ToString();
this.nbMainCost.Text = (sMonthType1 + sMonthType2 + sMonthType3 + sMonthType4 + sMonthType5 + sMonthType6 + tMonthType1).ToString();
}
if (mr != null)
{
this.nbMainProjectCost1.Text = ((mr.MainProjectCost1 ?? 0) + sMonthType1).ToString();
this.nbMainProjectCost2.Text = ((mr.MainProjectCost2 ?? 0) + sMonthType2).ToString();
this.nbMainProjectCost3.Text = ((mr.MainProjectCost3 ?? 0) + sMonthType3).ToString();
this.nbMainProjectCost4.Text = ((mr.MainProjectCost4 ?? 0) + sMonthType4).ToString();
this.nbMainProjectCost5.Text = ((mr.MainProjectCost5 ?? 0) + sMonthType5).ToString();
this.nbMainProjectCost6.Text = ((mr.MainProjectCost6 ?? 0) + sMonthType6).ToString();
this.nbMainProjectCost7.Text = ((mr.MainProjectCost7 ?? 0) + tMonthType1).ToString();
this.nbMainProjectCost.Text = ((mr.MainProjectCost ?? 0) + (sMonthType1 + sMonthType2 + sMonthType3 + sMonthType4 + sMonthType5 + sMonthType6 + tMonthType1)).ToString();
}
else
InjuryAccidentId = SQLHelper.GetNewID(typeof(Model.Manager_Month_InjuryAccidentC)),
UnitName = "五环",
AttemptedIncidents = BLL.AccidentHandleService.GetAccidentHandleByAccidentDate(startTime, endTime, this.ProjectId, BLL.Const.UnitId_CWCEC),//未遂事件起数
FirstAidDressing = null, //
MedicalTreatment = null,//
WorkLimitation = null,//
LossPerson = (from x in reports where x.UnitId==Const.UnitId_CWCEC select x.PeopleNum).Sum(),
LossWorkTime = (from x in reports where x.UnitId == Const.UnitId_CWCEC select x.WorkingHoursLoss).Sum(),
LossEconomy = (from x in reports where x.UnitId == Const.UnitId_CWCEC select x.EconomicLoss).Sum() + (from x in reports where x.UnitId == Const.UnitId_CWCEC select x.EconomicOtherLoss).Sum(),
DeathPerson = (from x in deathReports where x.UnitId == Const.UnitId_CWCEC select x.PeopleNum).Sum(),
DeathWorkTime = (from x in deathReports where x.UnitId == Const.UnitId_CWCEC select x.WorkingHoursLoss).Sum(),
DeathEconomy = (from x in deathReports where x.UnitId == Const.UnitId_CWCEC select x.EconomicLoss).Sum() + (from x in deathReports where x.UnitId == Const.UnitId_CWCEC select x.EconomicOtherLoss).Sum(),
};
injuryAccidents.Add(injury);
i++;
Model.Manager_Month_InjuryAccidentC injury2 = new Model.Manager_Month_InjuryAccidentC
{
InjuryAccidentId = SQLHelper.GetNewID(typeof(Model.Manager_Month_InjuryAccidentC)),
UnitName = "分包商",
AttemptedIncidents = BLL.AccidentHandleService.GetAccidentHandleByAccidentDate(startTime, endTime, this.ProjectId, BLL.Const.UnitId_Con),//未遂事件起数,//未遂事件起数
FirstAidDressing = null, //
MedicalTreatment = null,//
WorkLimitation = null,//
LossPerson = (from x in reports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2 select x.PeopleNum).Sum(),
LossWorkTime = (from x in reports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.WorkingHoursLoss).Sum(),
LossEconomy = (from x in reports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.EconomicLoss).Sum() + (from x in reports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.EconomicOtherLoss).Sum(),
DeathPerson = (from x in deathReports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.PeopleNum).Sum(),
DeathWorkTime = (from x in deathReports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.WorkingHoursLoss).Sum(),
DeathEconomy = (from x in deathReports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.EconomicLoss).Sum() + (from x in deathReports
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
where y.UnitType == Const.ProjectUnitType_2
select x.EconomicOtherLoss).Sum(),
};
injuryAccidents.Add(injury2);
this.nbMainProjectCost1.Text = sMonthType1.ToString();
this.nbMainProjectCost2.Text = sMonthType2.ToString();
this.nbMainProjectCost3.Text = sMonthType3.ToString();
this.nbMainProjectCost4.Text = sMonthType4.ToString();
this.nbMainProjectCost5.Text = sMonthType5.ToString();
this.nbMainProjectCost6.Text = sMonthType6.ToString();
this.nbMainProjectCost7.Text = tMonthType1.ToString();
this.nbMainProjectCost.Text = (sMonthType1 + sMonthType2 + sMonthType3 + sMonthType4 + sMonthType5 + sMonthType6 + tMonthType1).ToString();
}
this.gvInjuryAccident.DataSource = injuryAccidents;
this.gvInjuryAccident.DataBind();
decimal? subMonthType1 = 0, subMonthType2 = 0, subMonthType3 = 0, subMonthType4 = 0, subMonthType5 = 0, subMonthType6 = 0, subMonthType7 = 0;
List<Model.CostGoods_SubPayRegistration> subPayRegistrations = BLL.SubPayRegistrationService.GetSubPayRegistrationByPayDate(startTime, endTime, this.ProjectId);
if (subPayRegistrations != null)
OutputSummaryData();
}
/// <summary>
/// 求和
/// </summary>
private void OutputSummaryData()
{
JObject summary = new JObject();
int TotalAttemptedIncidents = 0, TotalFirstAidDressing = 0, TotalMedicalTreatment = 0, TotalWorkLimitation = 0, TotalLossPerson = 0, TotalDeathPerson = 0;
decimal TotalLossWorkTime = 0, TotalLossEconomy = 0, TotalDeathWorkTime = 0, TotalDeathEconomy = 0;
foreach (JObject mergedRow in gvInjuryAccident.GetMergedData())
{
foreach (var item in subPayRegistrations)
JObject values = mergedRow.Value<JObject>("values");
if (!string.IsNullOrEmpty(values["AttemptedIncidents"].ToString()))
{
subMonthType1 += item.SMainApproveType1 + item.SMainApproveType2 + item.SMainApproveType3 + item.SMainApproveType4 + item.SMainApproveType5;
subMonthType2 += item.SMainApproveType6;
subMonthType3 += item.SMainApproveType7;
subMonthType4 += item.SMainApproveType8 + item.SMainApproveType9 + item.SMainApproveType10 + item.SMainApproveType11 + item.SMainApproveType12 + item.SMainApproveType13 + item.SMainApproveType14 + item.SMainApproveType15 + item.SMainApproveType16 + item.SMainApproveType17 + item.SMainApproveType18 + item.SMainApproveType19 + item.SMainApproveType20 + item.SMainApproveType21;
subMonthType5 += item.SMainApproveType22 + item.SMainApproveType23 + item.SMainApproveType24 + item.SMainApproveType25 + item.SMainApproveType26 + item.SMainApproveType27;
subMonthType6 += item.SMainApproveType28;
subMonthType6 += item.SMainApproveType29;
TotalAttemptedIncidents += values.Value<int>("AttemptedIncidents");
}
if (!string.IsNullOrEmpty(values["FirstAidDressing"].ToString()))
{
TotalFirstAidDressing += values.Value<int>("FirstAidDressing");
}
if (!string.IsNullOrEmpty(values["MedicalTreatment"].ToString()))
{
TotalMedicalTreatment += values.Value<int>("MedicalTreatment");
}
if (!string.IsNullOrEmpty(values["WorkLimitation"].ToString()))
{
TotalWorkLimitation += values.Value<int>("WorkLimitation");
}
if (!string.IsNullOrEmpty(values["LossPerson"].ToString()))
{
TotalLossPerson += values.Value<int>("LossPerson");
}
if (!string.IsNullOrEmpty(values["LossWorkTime"].ToString()))
{
TotalLossWorkTime += values.Value<decimal>("LossWorkTime");
}
if (!string.IsNullOrEmpty(values["LossEconomy"].ToString()))
{
TotalLossEconomy += values.Value<decimal>("LossEconomy");
}
if (!string.IsNullOrEmpty(values["DeathPerson"].ToString()))
{
TotalDeathPerson += values.Value<int>("DeathPerson");
}
if (!string.IsNullOrEmpty(values["DeathWorkTime"].ToString()))
{
TotalDeathWorkTime += values.Value<decimal>("DeathWorkTime");
}
if (!string.IsNullOrEmpty(values["DeathEconomy"].ToString()))
{
TotalDeathEconomy += values.Value<decimal>("DeathEconomy");
}
this.nbSubCost1.Text = subMonthType1.ToString();
this.nbSubCost2.Text = subMonthType2.ToString();
this.nbSubCost3.Text = subMonthType3.ToString();
this.nbSubCost4.Text = subMonthType4.ToString();
this.nbSubCost5.Text = subMonthType5.ToString();
this.nbSubCost6.Text = subMonthType6.ToString();
this.nbSubCost7.Text = subMonthType7.ToString();
this.nbSubCost.Text = (subMonthType1 + subMonthType2 + subMonthType3 + subMonthType4 + subMonthType5 + subMonthType6 + subMonthType7).ToString();
}
if (mr != null)
{
this.nbSubProjectCost1.Text = ((mr.SubProjectCost1 ?? 0) + subMonthType1).ToString();
this.nbSubProjectCost2.Text = ((mr.SubProjectCost2 ?? 0) + subMonthType2).ToString();
this.nbSubProjectCost3.Text = ((mr.SubProjectCost3 ?? 0) + subMonthType3).ToString();
this.nbSubProjectCost4.Text = ((mr.SubProjectCost4 ?? 0) + subMonthType4).ToString();
this.nbSubProjectCost5.Text = ((mr.SubProjectCost5 ?? 0) + subMonthType5).ToString();
this.nbSubProjectCost6.Text = ((mr.SubProjectCost6 ?? 0) + subMonthType6).ToString();
this.nbSubProjectCost7.Text = ((mr.SubProjectCost7 ?? 0) + subMonthType7).ToString();
this.nbSubProjectCost.Text = ((mr.SubProjectCost ?? 0) + (subMonthType1 + subMonthType2 + subMonthType3 + subMonthType4 + subMonthType5 + subMonthType6 + subMonthType7)).ToString();
this.nbJianAnProjectCost.Text = (mr.JianAnProjectCost ?? 0).ToString();
}
else
{
this.nbSubProjectCost1.Text = subMonthType1.ToString();
this.nbSubProjectCost2.Text = subMonthType2.ToString();
this.nbSubProjectCost3.Text = subMonthType3.ToString();
this.nbSubProjectCost4.Text = subMonthType4.ToString();
this.nbSubProjectCost5.Text = subMonthType5.ToString();
this.nbSubProjectCost6.Text = subMonthType6.ToString();
this.nbSubProjectCost7.Text = subMonthType7.ToString();
this.nbSubProjectCost.Text = (subMonthType1 + subMonthType2 + subMonthType3 + subMonthType4 + subMonthType5 + subMonthType6 + subMonthType7).ToString();
}
summary.Add("UnitName", "项目合计");
summary.Add("AttemptedIncidents", TotalAttemptedIncidents.ToString("F2"));
summary.Add("FirstAidDressing", TotalFirstAidDressing.ToString("F2"));
summary.Add("MedicalTreatment", TotalMedicalTreatment.ToString("F2"));
summary.Add("WorkLimitation", TotalWorkLimitation.ToString("F2"));
summary.Add("LossPerson", TotalLossPerson.ToString("F2"));
summary.Add("LossWorkTime", TotalLossWorkTime.ToString("F2"));
summary.Add("LossEconomy", TotalLossEconomy.ToString("F2"));
summary.Add("DeathPerson", TotalDeathPerson.ToString("F2"));
summary.Add("DeathWorkTime", TotalDeathWorkTime.ToString("F2"));
summary.Add("DeathEconomy", TotalDeathEconomy.ToString("F2"));
gvInjuryAccident.SummaryData = summary;
}
#endregion
#region
/// <summary>
/// 本月无伤害事故统计
/// </summary>
private void GetNoInjuryAccident()
{
Model.Manager_Month_NoInjuryAccidentC noInjury = new Model.Manager_Month_NoInjuryAccidentC
{
NoInjuryAccidentId = SQLHelper.GetNewID(typeof(Model.Manager_Month_NoInjuryAccidentC)),
AccidentType = null,
EconomicLosses = null,
WHAccidentCount = null,
SubAccidentCount = null,
};
noInjuryAccidents.Add(noInjury);
this.gvNoInjuryAccident.DataSource = noInjuryAccidents;
this.gvNoInjuryAccident.DataBind();
}
#endregion
#region HSE绩效指标
/// <summary>
/// HSE绩效指标
/// </summary>
private void GetPerformanceIndicator()
{
int i = 0;
Model.Manager_Month_PerformanceIndicatorC performanceIndicator = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "指导性指标",
IndicatorName = "不安全行为指数(不安全行为数/审核小时数)",
IndicatorValue = null,
SortIndex = 1,
};
performanceIndicators.Add(performanceIndicator);
i++;
var units = from x in Funs.DB.Project_ProjectUnit
where x.ProjectId == this.ProjectId && x.UnitType == "2"
orderby x.UnitType
select x;
if (units.Count() > 0)
{
foreach (Model.Project_ProjectUnit u in units)
{
Model.Manager_Month_PerformanceIndicatorC performanceIndicator2 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "过程性指标",
IndicatorName = "HSE隐患按时整改率 | " + BLL.UnitService.GetUnitNameByUnitId(u.UnitId),
IndicatorValue = null,
SortIndex = 2,
};
performanceIndicators.Add(performanceIndicator2);
}
i++;
}
Model.Manager_Month_PerformanceIndicatorC performanceIndicator3 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "结果性指标",
IndicatorName = "百万工时总可记录事件率(总可记录事件人数/总工时)*10^6",
IndicatorValue = null,
SortIndex = 3,
};
performanceIndicators.Add(performanceIndicator3);
i++;
Model.Manager_Month_PerformanceIndicatorC performanceIndicator4 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "结果性指标",
IndicatorName = "百万工时损失工时率(总损失工时/总工时)*10^6",
IndicatorValue = null,
SortIndex = 4,
};
performanceIndicators.Add(performanceIndicator4);
i++;
Model.Manager_Month_PerformanceIndicatorC performanceIndicator5 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "结果性指标",
IndicatorName = "百万工时损失工时伤害事故率(损失工时伤害事故人数/总工时)*10^6",
IndicatorValue = null,
SortIndex = 5,
};
performanceIndicators.Add(performanceIndicator5);
i++;
Model.Manager_Month_PerformanceIndicatorC performanceIndicator6 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "结果性指标",
IndicatorName = "百万工时事故发生频率(损失工时伤害事故起数/总工时)*10^6",
IndicatorValue = null,
SortIndex = 6,
};
performanceIndicators.Add(performanceIndicator6);
i++;
Model.Manager_Month_PerformanceIndicatorC performanceIndicator7 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "结果性指标",
IndicatorName = "百万工时死亡事故频率(死亡事故起数/总工时)*10^6",
IndicatorValue = null,
SortIndex = 7,
};
performanceIndicators.Add(performanceIndicator7);
i++;
Model.Manager_Month_PerformanceIndicatorC performanceIndicator8 = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = SQLHelper.GetNewID(typeof(Model.Manager_Month_PerformanceIndicatorC)),
IndicatorType = "结果性指标",
IndicatorName = "百万工时事故死亡率(死亡事故人数/总工时)*10^6",
IndicatorValue = null,
SortIndex = 8,
};
performanceIndicators.Add(performanceIndicator8);
this.gvPerformanceIndicator.DataSource = performanceIndicators;
this.gvPerformanceIndicator.DataBind();
}
#endregion
#endregion
#region
/// <summary>
/// 保存按钮
@@ -250,42 +427,11 @@ namespace FineUIPro.Web.HSSE.Manager
Model.Manager_MonthReportC oldMonthReport = BLL.MonthReportCService.GetMonthReportByMonths(Convert.ToDateTime(Request.Params["months"]), this.CurrUser.LoginProjectId);
if (oldMonthReport != null)
{
oldMonthReport.MainCost1 = Funs.GetNewDecimalOrZero(this.nbMainCost1.Text.Trim());
oldMonthReport.MainProjectCost1 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost1.Text.Trim());
oldMonthReport.SubCost1 = Funs.GetNewDecimalOrZero(this.nbSubCost1.Text.Trim());
oldMonthReport.SubProjectCost1 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost1.Text.Trim());
oldMonthReport.MainCost2 = Funs.GetNewDecimalOrZero(this.nbMainCost2.Text.Trim());
oldMonthReport.MainProjectCost2 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost2.Text.Trim());
oldMonthReport.SubCost2 = Funs.GetNewDecimalOrZero(this.nbSubCost2.Text.Trim());
oldMonthReport.SubProjectCost2 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost2.Text.Trim());
oldMonthReport.MainCost3 = Funs.GetNewDecimalOrZero(this.nbMainCost3.Text.Trim());
oldMonthReport.MainProjectCost3 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost3.Text.Trim());
oldMonthReport.SubCost3 = Funs.GetNewDecimalOrZero(this.nbSubCost3.Text.Trim());
oldMonthReport.SubProjectCost3 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost3.Text.Trim());
oldMonthReport.MainCost4 = Funs.GetNewDecimalOrZero(this.nbMainCost4.Text.Trim());
oldMonthReport.MainProjectCost4 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost4.Text.Trim());
oldMonthReport.SubCost4 = Funs.GetNewDecimalOrZero(this.nbSubCost4.Text.Trim());
oldMonthReport.SubProjectCost4 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost4.Text.Trim());
oldMonthReport.MainCost5 = Funs.GetNewDecimalOrZero(this.nbMainCost5.Text.Trim());
oldMonthReport.MainProjectCost5 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost5.Text.Trim());
oldMonthReport.SubCost5 = Funs.GetNewDecimalOrZero(this.nbSubCost5.Text.Trim());
oldMonthReport.SubProjectCost5 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost5.Text.Trim());
oldMonthReport.MainCost6 = Funs.GetNewDecimalOrZero(this.nbMainCost6.Text.Trim());
oldMonthReport.MainProjectCost6 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost6.Text.Trim());
oldMonthReport.SubCost6 = Funs.GetNewDecimalOrZero(this.nbSubCost6.Text.Trim());
oldMonthReport.SubProjectCost6 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost6.Text.Trim());
oldMonthReport.MainCost7 = Funs.GetNewDecimalOrZero(this.nbMainCost7.Text.Trim());
oldMonthReport.MainProjectCost7 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost7.Text.Trim());
oldMonthReport.SubCost7 = Funs.GetNewDecimalOrZero(this.nbSubCost7.Text.Trim());
oldMonthReport.SubProjectCost7 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost7.Text.Trim());
oldMonthReport.MainCost = Funs.GetNewDecimalOrZero(this.nbMainCost.Text.Trim());
oldMonthReport.MainProjectCost = Funs.GetNewDecimalOrZero(this.nbMainProjectCost.Text.Trim());
oldMonthReport.SubCost = Funs.GetNewDecimalOrZero(this.nbSubCost.Text.Trim());
oldMonthReport.SubProjectCost = Funs.GetNewDecimalOrZero(this.nbSubProjectCost.Text.Trim());
oldMonthReport.JianAnCost = Funs.GetNewDecimalOrZero(this.nbJianAnCost.Text.Trim());
oldMonthReport.JianAnProjectCost = Funs.GetNewDecimalOrZero(this.nbJianAnProjectCost.Text.Trim());
oldMonthReport.AccidentDef = this.txtDef.Text.Trim();
BLL.MonthReportCService.UpdateMonthReport(oldMonthReport);
OperateInjuryAccidentSort(MonthReportId);
OperateNoInjuryAccidentSort(MonthReportId);
OperatePerformanceIndicatorSort(MonthReportId);
BLL.LogService.AddSys_Log(this.CurrUser, oldMonthReport.MonthReportCode, oldMonthReport.MonthReportId, BLL.Const.ProjectManagerMonthCMenuId, BLL.Const.BtnModify);
}
else
@@ -299,49 +445,146 @@ namespace FineUIPro.Web.HSSE.Manager
monthReport.Months = Funs.GetNewDateTime(Request.Params["months"]);
monthReport.ReportMan = this.CurrUser.UserId;
monthReport.MonthReportDate = DateTime.Now;
monthReport.MainCost1 = Funs.GetNewDecimalOrZero(this.nbMainCost1.Text.Trim());
monthReport.MainProjectCost1 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost1.Text.Trim());
monthReport.SubCost1 = Funs.GetNewDecimalOrZero(this.nbSubCost1.Text.Trim());
monthReport.SubProjectCost1 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost1.Text.Trim());
monthReport.MainCost2 = Funs.GetNewDecimalOrZero(this.nbMainCost2.Text.Trim());
monthReport.MainProjectCost2 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost2.Text.Trim());
monthReport.SubCost2 = Funs.GetNewDecimalOrZero(this.nbSubCost2.Text.Trim());
monthReport.SubProjectCost2 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost2.Text.Trim());
monthReport.MainCost3 = Funs.GetNewDecimalOrZero(this.nbMainCost3.Text.Trim());
monthReport.MainProjectCost3 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost3.Text.Trim());
monthReport.SubCost3 = Funs.GetNewDecimalOrZero(this.nbSubCost3.Text.Trim());
monthReport.SubProjectCost3 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost3.Text.Trim());
monthReport.MainCost4 = Funs.GetNewDecimalOrZero(this.nbMainCost4.Text.Trim());
monthReport.MainProjectCost4 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost4.Text.Trim());
monthReport.SubCost4 = Funs.GetNewDecimalOrZero(this.nbSubCost4.Text.Trim());
monthReport.SubProjectCost4 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost4.Text.Trim());
monthReport.MainCost5 = Funs.GetNewDecimalOrZero(this.nbMainCost5.Text.Trim());
monthReport.MainProjectCost5 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost5.Text.Trim());
monthReport.SubCost5 = Funs.GetNewDecimalOrZero(this.nbSubCost5.Text.Trim());
monthReport.SubProjectCost5 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost5.Text.Trim());
monthReport.MainCost6 = Funs.GetNewDecimalOrZero(this.nbMainCost6.Text.Trim());
monthReport.MainProjectCost6 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost6.Text.Trim());
monthReport.SubCost6 = Funs.GetNewDecimalOrZero(this.nbSubCost6.Text.Trim());
monthReport.SubProjectCost6 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost6.Text.Trim());
monthReport.MainCost7 = Funs.GetNewDecimalOrZero(this.nbMainCost7.Text.Trim());
monthReport.MainProjectCost7 = Funs.GetNewDecimalOrZero(this.nbMainProjectCost7.Text.Trim());
monthReport.SubCost7 = Funs.GetNewDecimalOrZero(this.nbSubCost7.Text.Trim());
monthReport.SubProjectCost7 = Funs.GetNewDecimalOrZero(this.nbSubProjectCost7.Text.Trim());
monthReport.MainCost = Funs.GetNewDecimalOrZero(this.nbMainCost.Text.Trim());
monthReport.MainProjectCost = Funs.GetNewDecimalOrZero(this.nbMainProjectCost.Text.Trim());
monthReport.SubCost = Funs.GetNewDecimalOrZero(this.nbSubCost.Text.Trim());
monthReport.SubProjectCost = Funs.GetNewDecimalOrZero(this.nbSubProjectCost.Text.Trim());
monthReport.JianAnCost = Funs.GetNewDecimalOrZero(this.nbJianAnCost.Text.Trim());
monthReport.JianAnProjectCost = Funs.GetNewDecimalOrZero(this.nbJianAnProjectCost.Text.Trim());
monthReport.AccidentDef = this.txtDef.Text.Trim();
BLL.MonthReportCService.AddMonthReport(monthReport);
OperateInjuryAccidentSort(this.MonthReportId);
OperateNoInjuryAccidentSort(this.MonthReportId);
OperatePerformanceIndicatorSort(this.MonthReportId);
BLL.LogService.AddSys_Log(this.CurrUser, monthReport.MonthReportCode, monthReport.MonthReportId, BLL.Const.ProjectManagerMonthCMenuId, BLL.Const.BtnAdd);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#region
/// <summary>
/// 本月伤害事故统计
/// </summary>
/// <param name="monthReportId"></param>
private void OperateInjuryAccidentSort(string monthReportId)
{
BLL.InjuryAccidentCService.DeleteInjuryAccidengtByMonthReportId(monthReportId);
jerqueSaveInjuryAccidentCList();
foreach (Model.Manager_Month_InjuryAccidentC injury in injuryAccidents)
{
injury.MonthReportId = monthReportId;
BLL.InjuryAccidentCService.AddInjuryAccidentC(injury);
}
}
/// <summary>
/// 检查并保存本月伤害事故统计
/// </summary>
private void jerqueSaveInjuryAccidentCList()
{
injuryAccidents.Clear();
JArray mergedData = gvInjuryAccident.GetMergedData();
foreach (JObject mergedRow in mergedData)
{
string status = mergedRow.Value<string>("status");
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
Model.Manager_Month_InjuryAccidentC monthPlanSort = new Model.Manager_Month_InjuryAccidentC
{
InjuryAccidentId = this.gvInjuryAccident.Rows[i].DataKeys[0].ToString(),
UnitName = values.Value<string>("UnitName").ToString(),
AttemptedIncidents = Funs.GetNewInt(values.Value<string>("AttemptedIncidents").ToString()),
FirstAidDressing = Funs.GetNewInt(values.Value<string>("FirstAidDressing").ToString()),
MedicalTreatment = Funs.GetNewInt(values.Value<string>("MedicalTreatment").ToString()),
WorkLimitation = Funs.GetNewInt(values.Value<string>("WorkLimitation").ToString()),
LossPerson = Funs.GetNewInt(values.Value<string>("LossPerson").ToString()),
LossWorkTime = Funs.GetNewDecimal(values.Value<string>("LossWorkTime").ToString()),
LossEconomy = Funs.GetNewDecimal(values.Value<string>("LossEconomy").ToString()),
DeathPerson = Funs.GetNewInt(values.Value<string>("DeathPerson").ToString()),
DeathWorkTime = Funs.GetNewDecimal(values.Value<string>("DeathWorkTime").ToString()),
DeathEconomy = Funs.GetNewDecimal(values.Value<string>("DeathEconomy").ToString()),
};
injuryAccidents.Add(monthPlanSort);
}
}
#endregion
#region
/// <summary>
/// 本月伤害事故统计
/// </summary>
/// <param name="monthReportId"></param>
private void OperateNoInjuryAccidentSort(string monthReportId)
{
BLL.NoInjuryAccidentCService.DeleteNoInjuryAccidentByMonthReportId(monthReportId);
jerqueSaveNoInjuryAccidentCList();
foreach (Model.Manager_Month_NoInjuryAccidentC noInjury in noInjuryAccidents)
{
noInjury.MonthReportId = monthReportId;
BLL.NoInjuryAccidentCService.AddNoInjuryAccident(noInjury);
}
}
/// <summary>
/// 检查并保存本月无伤害事故统计
/// </summary>
private void jerqueSaveNoInjuryAccidentCList()
{
noInjuryAccidents.Clear();
JArray mergedData = gvNoInjuryAccident.GetMergedData();
foreach (JObject mergedRow in mergedData)
{
string status = mergedRow.Value<string>("status");
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
Model.Manager_Month_NoInjuryAccidentC noInjuryAccident = new Model.Manager_Month_NoInjuryAccidentC
{
NoInjuryAccidentId = this.gvNoInjuryAccident.Rows[i].DataKeys[0].ToString(),
AccidentType = values.Value<string>("AccidentType").ToString(),
EconomicLosses = Funs.GetNewDecimal(values.Value<string>("EconomicLosses").ToString()),
WHAccidentCount = Funs.GetNewInt(values.Value<string>("WHAccidentCount").ToString()),
SubAccidentCount = Funs.GetNewInt(values.Value<string>("SubAccidentCount").ToString()),
};
noInjuryAccidents.Add(noInjuryAccident);
}
}
#endregion
#region HSE绩效指标
/// <summary>
/// HSE绩效指标
/// </summary>
/// <param name="monthReportId"></param>
private void OperatePerformanceIndicatorSort(string monthReportId)
{
BLL.PerformanceIndicatorCService.DeletePerformanceIndicatorByMonthReportId(monthReportId);
jerqueSavePerformanceIndicatorCList();
foreach (Model.Manager_Month_PerformanceIndicatorC performanceIndicator in performanceIndicators)
{
performanceIndicator.MonthReportId = monthReportId;
BLL.PerformanceIndicatorCService.AddPerformanceIndicator(performanceIndicator);
}
}
/// <summary>
/// 检查并保存HSE绩效指标
/// </summary>
private void jerqueSavePerformanceIndicatorCList()
{
performanceIndicators.Clear();
JArray mergedData = gvPerformanceIndicator.GetMergedData();
foreach (JObject mergedRow in mergedData)
{
string status = mergedRow.Value<string>("status");
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
Model.Manager_Month_PerformanceIndicatorC performanceIndicator = new Model.Manager_Month_PerformanceIndicatorC
{
PerformanceIndicatorId = this.gvPerformanceIndicator.Rows[i].DataKeys[0].ToString(),
IndicatorType = values.Value<string>("IndicatorType").ToString(),
IndicatorName = values.Value<string>("IndicatorName").ToString(),
IndicatorValue = values.Value<string>("IndicatorValue").ToString(),
SortIndex = Funs.GetNewInt(values.Value<string>("SortIndex").ToString()),
};
performanceIndicators.Add(performanceIndicator);
}
}
#endregion
#endregion
}
}