修改安全月报
This commit is contained in:
@@ -188,6 +188,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
if (model.Months != null)
|
||||
{
|
||||
txtReportMonths.Text = string.Format("{0:yyyy-MM}", model.Months);
|
||||
months = Convert.ToDateTime(model.Months);
|
||||
}
|
||||
if (model.StartDate != null)
|
||||
{
|
||||
@@ -263,7 +264,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
nbFireWorkCount.Text = PModel.FireWorkCount.ToString();
|
||||
nbBreakGroundCount.Text = PModel.BreakGroundCount.ToString();
|
||||
nbLimitedSpaceCount.Text = PModel.FireWorkCount.ToString();
|
||||
nbLimitedSpaceCount.Text = PModel.LimitedSpaceCount.ToString();
|
||||
nbElectricityCount.Text = PModel.ElectricityCount.ToString();
|
||||
nbHeightWorkCount.Text = PModel.HeightWorkCount.ToString();
|
||||
nbRadialWork.Text = PModel.RadialWork.ToString();
|
||||
@@ -321,6 +322,9 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
DrillRecordListGrid.DataSource = drillRecordList;
|
||||
DrillRecordListGrid.DataBind();
|
||||
}
|
||||
else {
|
||||
DrillRecordListGrid.EmptyText = "<raw><div class=\"grid-empty-text\">暂无数据</div></raw>";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 4.6.3其他应急管理工作描述
|
||||
@@ -474,7 +478,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
startTime = Convert.ToDateTime(txtStartDate.Text);
|
||||
endTime = Convert.ToDateTime(txtEndDate.Text);
|
||||
|
||||
yearStartTime = Convert.ToDateTime(months.ToString("yyyy-01-01"));
|
||||
yearStartTime = Convert.ToDateTime(startTime.ToString("yyyy-01-01"));
|
||||
|
||||
if (project.StartDate != null)
|
||||
{
|
||||
@@ -600,7 +604,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
monthReport.MonthReportId = MonthReportId;
|
||||
monthReport.ProjectId = this.CurrUser.LoginProjectId;
|
||||
monthReport.MonthReportCode = txtPeriod.Text;
|
||||
monthReport.Months = Funs.GetNewDateTime(Request.Params["months"]);
|
||||
monthReport.Months = months;
|
||||
monthReport.ReportMan = this.CurrUser.UserId;
|
||||
monthReport.MonthReportDate = DateTime.Now;
|
||||
|
||||
@@ -1066,10 +1070,12 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
FirstAidDressing = Funs.GetNewInt(values.Value<string>("FirstAidDressing").ToString()),
|
||||
MedicalTreatment = Funs.GetNewInt(values.Value<string>("MedicalTreatment").ToString()),
|
||||
WorkLimitation = Funs.GetNewInt(values.Value<string>("WorkLimitation").ToString()),
|
||||
LossCount = Funs.GetNewInt(values.Value<string>("LossCount").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()),
|
||||
DeathCount = Funs.GetNewInt(values.Value<string>("DeathCount").ToString()),
|
||||
DeathWorkTime = Funs.GetNewDecimal(values.Value<string>("DeathWorkTime").ToString()),
|
||||
DeathEconomy = Funs.GetNewDecimal(values.Value<string>("DeathEconomy").ToString()),
|
||||
};
|
||||
@@ -1769,6 +1775,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
int totalSumPersonNum = 0;//总部
|
||||
int totalSumOutPersonNum = 0;//外聘
|
||||
int totalHSEPersonNum = 0;
|
||||
var spckList = db.SitePerson_Checking.Where(x => x.ProjectId == ProjectId && x.IntoOut == "1");
|
||||
if (units.Count() > 0)
|
||||
{
|
||||
foreach (Model.Project_ProjectUnit u in units)
|
||||
@@ -1777,13 +1784,34 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
PersonSortId = Guid.NewGuid().ToString(),
|
||||
UnitId = u.UnitId,
|
||||
SumPersonNum = BLL.PersonService.GetPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text), false),//本部
|
||||
SumOutPersonNum = BLL.PersonService.GetPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text), true),//外聘
|
||||
HSEPersonNum = BLL.PersonService.GetHSEPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text)),
|
||||
HSEPersonNum = 0,
|
||||
ContractRange = u.ContractRange
|
||||
};
|
||||
//本部本月人数,本年考勤人数除当前月份,取平均数
|
||||
//年度
|
||||
var yearList = spckList.Where(x => x.IntoOutTime >= startTime
|
||||
&& x.IntoOutTime <= endTime && x.UnitId == u.UnitId).ToList().Select(x => new hseDayItem()
|
||||
{
|
||||
IdentityCard = x.IdentityCard,
|
||||
IntoOutTime = getShortTime(x.IntoOutTime)
|
||||
}).GroupBy(x => new { x.IdentityCard})
|
||||
.ToList();
|
||||
|
||||
personSort.SumPersonNum = yearList.Count();
|
||||
|
||||
//五环
|
||||
if (u.UnitId == Const.UnitId_CWCEC)
|
||||
{
|
||||
personSort.SumOutPersonNum = 0;
|
||||
}
|
||||
else {
|
||||
personSort.SumOutPersonNum = 0;
|
||||
}
|
||||
////本部人员
|
||||
//SumPersonNum = BLL.PersonService.GetPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text), false),//本部
|
||||
// SumOutPersonNum = 0,//外聘
|
||||
personSorts.Add(personSort);
|
||||
totalSumPersonNum += Convert.ToInt32(personSort.SumPersonNum);
|
||||
totalSumPersonNum += Convert.ToInt32(personSort.SumPersonNum)+ Convert.ToInt32(personSort.SumOutPersonNum);
|
||||
totalSumOutPersonNum += Convert.ToInt32(personSort.SumOutPersonNum);
|
||||
totalHSEPersonNum += Convert.ToInt32(personSort.HSEPersonNum);
|
||||
}
|
||||
@@ -1795,7 +1823,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
JObject summary = new JObject();
|
||||
summary.Add("UnitId", "合计:");
|
||||
summary.Add("SumPersonNum", totalSumPersonNum);
|
||||
summary.Add("SumOutPersonNum", totalSumOutPersonNum);
|
||||
//summary.Add("SumOutPersonNum", totalSumOutPersonNum);
|
||||
summary.Add("HSEPersonNum", totalHSEPersonNum);
|
||||
this.gvPersonSort.SummaryData = summary;
|
||||
}
|
||||
@@ -1836,8 +1864,8 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
JObject summary = new JObject();
|
||||
summary.Add("UnitId", "合计:");
|
||||
summary.Add("SumPersonNum", (from x in personSorts select x.SumPersonNum ?? 0).Sum());
|
||||
summary.Add("SumOutPersonNum", (from x in personSorts select x.SumOutPersonNum ?? 0).Sum());
|
||||
summary.Add("SumPersonNum", (from x in personSorts select x.SumPersonNum ?? 0).Sum()+ (from x in personSorts select x.SumOutPersonNum ?? 0).Sum());
|
||||
//summary.Add("SumOutPersonNum", (from x in personSorts select x.SumOutPersonNum ?? 0).Sum());
|
||||
summary.Add("HSEPersonNum", (from x in personSorts select x.HSEPersonNum ?? 0).Sum());
|
||||
this.gvPersonSort.SummaryData = summary;
|
||||
}
|
||||
@@ -1854,169 +1882,90 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
#endregion
|
||||
|
||||
#region 3.本月项目现场HSE人工日统计
|
||||
public class hseDayItem {
|
||||
public string IdentityCard { get; set; }
|
||||
|
||||
public string IntoOutTime { get; set; }
|
||||
|
||||
public string UnitId { get; set; }
|
||||
}
|
||||
|
||||
public string getShortTime(DateTime? a) {
|
||||
return Convert.ToDateTime(a).ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
private void getMonthReportCHSEDay()
|
||||
{
|
||||
|
||||
var spckList = db.SitePerson_Checking.Where(x => x.ProjectId == ProjectId && x.IntoOut == "1");
|
||||
//本月项目现场HSE人工日统计
|
||||
Model.MonthReportCHSEDay hseDay = new Model.MonthReportCHSEDay
|
||||
{
|
||||
MonthHSEDay = (endTime - startTime).Days + 1
|
||||
};
|
||||
Model.Manager_MonthReportC mr = BLL.MonthReportCService.GetLastMonthReportByDate(endTime, this.ProjectId);
|
||||
if (mr != null)
|
||||
{
|
||||
if (mr.SumHSEDay != 0)
|
||||
{
|
||||
hseDay.SumHSEDay = (mr.SumHSEDay ?? 0) + hseDay.MonthHSEDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
hseDay.SumHSEDay = hseDay.MonthHSEDay;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hseDay.SumHSEDay = hseDay.MonthHSEDay;
|
||||
}
|
||||
//累计安全工作天数(当前日期-项目开始日期)
|
||||
hseDay.SumHSEDay = (endTime - projectStartTime).Days;
|
||||
|
||||
int? monthHSEWorkDay = 0;
|
||||
int? yearHSEWorkDay = 0;
|
||||
int? sumHSEWorkDay = 0;
|
||||
decimal? hSEManhours = 0;
|
||||
decimal? sumHseManhours = 0;
|
||||
decimal? SubcontractManHours = 0;
|
||||
//本月HSE人工日、年度累计HSE人工日、总累计HSE人工日,考勤中取
|
||||
//本月
|
||||
var list = spckList.Where(x => x.IntoOutTime >= startTime
|
||||
&& x.IntoOutTime <= endTime).ToList().Select(x => new hseDayItem()
|
||||
{
|
||||
IdentityCard = x.IdentityCard,
|
||||
IntoOutTime = getShortTime(x.IntoOutTime)
|
||||
}).GroupBy(x => new { x.IdentityCard, x.IntoOutTime })
|
||||
.ToList();
|
||||
|
||||
decimal? YearHSEWorkDay = 0;
|
||||
//年度安全人工时
|
||||
var getProjectMonthReport = from x in db.SitePerson_MonthReport where x.ProjectId == ProjectId select x;
|
||||
if (getProjectMonthReport.Count() > 0)
|
||||
//本月HSE人工日
|
||||
hseDay.MonthHSEWorkDay = list.Count();
|
||||
//本月安全人工时(五环)
|
||||
hseDay.HseManhours = spckList.Where(x => x.IntoOutTime >= startTime
|
||||
&& x.IntoOutTime <= endTime && x.UnitId == Const.UnitId_CWCEC).ToList().Select(x => new hseDayItem()
|
||||
{
|
||||
////人工时月报明细
|
||||
var getMonthReportDetail = from x in db.SitePerson_MonthReportDetail
|
||||
join y in getProjectMonthReport on x.MonthReportId equals y.MonthReportId
|
||||
select x;
|
||||
var yearMonthReport = from x in getProjectMonthReport
|
||||
where x.CompileDate.Value.Year == months.Year
|
||||
select x;
|
||||
if (yearMonthReport.Count() > 0)
|
||||
{
|
||||
foreach (var item in yearMonthReport)
|
||||
{
|
||||
////年度累计安全人工时
|
||||
YearHSEWorkDay += getMonthReportDetail.Where(x => x.MonthReportId ==
|
||||
item.MonthReportId).Sum(x => x.PersonWorkTime) ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
IdentityCard = x.IdentityCard,
|
||||
IntoOutTime = getShortTime(x.IntoOutTime)
|
||||
}).GroupBy(x => new { x.IdentityCard, x.IntoOutTime })
|
||||
.ToList().Count() * 8;
|
||||
|
||||
//本月安全人工时(分包商)
|
||||
hseDay.SubcontractManHours= spckList.Where(x => x.IntoOutTime >= startTime
|
||||
&& x.IntoOutTime <= endTime && x.UnitId != Const.UnitId_CWCEC).ToList().Select(x => new hseDayItem()
|
||||
{
|
||||
YearHSEWorkDay = 0;
|
||||
}
|
||||
hseDay.YearHSEWorkDay = Convert.ToInt32(YearHSEWorkDay);
|
||||
var monthReport = BLL.Funs.DB.SitePerson_MonthReport.FirstOrDefault(x => x.CompileDate == months && x.ProjectId == ProjectId); //当月人工时月报
|
||||
if (monthReport != null)
|
||||
{
|
||||
monthHSEWorkDay = Convert.ToInt32((from x in Funs.DB.SitePerson_MonthReportDetail
|
||||
where x.MonthReportId == monthReport.MonthReportId
|
||||
select x.RealPersonNum ?? 0).Sum());
|
||||
hSEManhours = (from x in Funs.DB.SitePerson_MonthReportDetail
|
||||
join z in Funs.DB.Project_ProjectUnit
|
||||
on x.UnitId equals z.UnitId
|
||||
where z.UnitType == "1" && z.ProjectId == this.CurrUser.LoginProjectId && x.MonthReportId == monthReport.MonthReportId //总包
|
||||
select x.PersonWorkTime ?? 0).Sum();
|
||||
var q = (from x in Funs.DB.SitePerson_MonthReportDetail
|
||||
join z in Funs.DB.Project_ProjectUnit
|
||||
on x.UnitId equals z.UnitId
|
||||
where z.UnitType == "2" && z.ProjectId == this.CurrUser.LoginProjectId && x.MonthReportId == monthReport.MonthReportId //分包
|
||||
select x);
|
||||
foreach (var item in q)
|
||||
{
|
||||
SubcontractManHours += item.PersonWorkTime ?? 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
monthHSEWorkDay = 0;
|
||||
hSEManhours = 0;
|
||||
SubcontractManHours = 0;
|
||||
}
|
||||
//年度人工日
|
||||
if (months.Month == 1)
|
||||
{
|
||||
yearHSEWorkDay = monthHSEWorkDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mr != null)
|
||||
{
|
||||
if (mr.YearHSEWorkDay != null)
|
||||
{
|
||||
yearHSEWorkDay = (mr.YearHSEWorkDay ?? 0) + monthHSEWorkDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
yearHSEWorkDay = monthHSEWorkDay;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
yearHSEWorkDay = monthHSEWorkDay;
|
||||
}
|
||||
}
|
||||
if (mr != null)
|
||||
{
|
||||
if (mr.SumHSEWorkDay != 0)
|
||||
{
|
||||
sumHSEWorkDay = (mr.SumHSEWorkDay ?? 0) + monthHSEWorkDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
sumHSEWorkDay = monthHSEWorkDay;
|
||||
}
|
||||
if (mr.TotalHseManhours != 0)
|
||||
{
|
||||
sumHseManhours = (mr.TotalHseManhours ?? 0) + hSEManhours + SubcontractManHours;
|
||||
}
|
||||
else
|
||||
{
|
||||
sumHseManhours = hSEManhours + SubcontractManHours;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sumHSEWorkDay = monthHSEWorkDay;
|
||||
sumHseManhours = hSEManhours + SubcontractManHours;
|
||||
}
|
||||
hseDay.MonthHSEWorkDay = monthHSEWorkDay ?? 0;
|
||||
hseDay.YearHSEWorkDay = yearHSEWorkDay ?? 0;
|
||||
hseDay.SumHSEWorkDay = sumHSEWorkDay ?? 0;
|
||||
if (hSEManhours.ToString().Contains("."))
|
||||
{
|
||||
hseDay.HseManhours = int.Parse(hSEManhours.ToString().Substring(0, hSEManhours.ToString().LastIndexOf(".")));
|
||||
}
|
||||
else
|
||||
{
|
||||
hseDay.HseManhours = int.Parse(hSEManhours.ToString());
|
||||
}
|
||||
if (SubcontractManHours.ToString().Contains("."))
|
||||
{
|
||||
hseDay.SubcontractManHours = int.Parse(SubcontractManHours.ToString().Substring(0, SubcontractManHours.ToString().LastIndexOf(".")));
|
||||
}
|
||||
else
|
||||
{
|
||||
hseDay.SubcontractManHours = int.Parse(SubcontractManHours.ToString());
|
||||
}
|
||||
if (sumHseManhours.ToString().Contains("."))
|
||||
{
|
||||
hseDay.TotalHseManhours = int.Parse(sumHseManhours.ToString().Substring(0, sumHseManhours.ToString().LastIndexOf(".")));
|
||||
}
|
||||
else
|
||||
{
|
||||
hseDay.TotalHseManhours = int.Parse(sumHseManhours.ToString());
|
||||
}
|
||||
List<Model.MonthReportCHSEDay> list = new List<Model.MonthReportCHSEDay>();
|
||||
list.Add(hseDay);
|
||||
this.gvHSEDay.DataSource = list;
|
||||
IdentityCard = x.IdentityCard,
|
||||
IntoOutTime = getShortTime(x.IntoOutTime)
|
||||
}).GroupBy(x => new { x.IdentityCard, x.IntoOutTime })
|
||||
.ToList().Count() * 8;
|
||||
|
||||
//年度
|
||||
var yearList = spckList.Where(x => x.IntoOutTime >= yearStartTime
|
||||
&& x.IntoOutTime <= endTime).ToList().Select(x => new hseDayItem()
|
||||
{
|
||||
IdentityCard = x.IdentityCard,
|
||||
IntoOutTime = getShortTime(x.IntoOutTime)
|
||||
}).GroupBy(x => new { x.IdentityCard, x.IntoOutTime })
|
||||
.ToList();
|
||||
|
||||
|
||||
//年度累计人工日
|
||||
hseDay.YearHSEWorkDay = yearList.Count;
|
||||
//年度累计HSE人工时
|
||||
hseDay.TotalHseManhoursYear = yearList.Count * 8;
|
||||
|
||||
// //项目累计
|
||||
var pList = spckList.Where(x => x.IntoOutTime >= projectStartTime
|
||||
&& x.IntoOutTime <= endTime).ToList().Select(x => new hseDayItem()
|
||||
{
|
||||
IdentityCard = x.IdentityCard,
|
||||
IntoOutTime = getShortTime(x.IntoOutTime)
|
||||
}).GroupBy(x => new { x.IdentityCard, x.IntoOutTime })
|
||||
.ToList();
|
||||
|
||||
hseDay.SumHSEWorkDay = pList.Count;
|
||||
|
||||
hseDay.TotalHseManhours = pList.Count * 8;
|
||||
|
||||
List<Model.MonthReportCHSEDay> listCHSEDay = new List<Model.MonthReportCHSEDay>();
|
||||
listCHSEDay.Add(hseDay);
|
||||
this.gvHSEDay.DataSource = listCHSEDay;
|
||||
this.gvHSEDay.DataBind();
|
||||
}
|
||||
#endregion
|
||||
@@ -2029,9 +1978,12 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
trainSorts.Clear();
|
||||
var TotalPersonNum = 0;
|
||||
var list = db.Base_TrainType.ToList();
|
||||
var list = db.Base_TrainType.ToList().OrderBy(x=>x.TrainTypeCode);
|
||||
var listTrain = BLL.EduTrain_TrainRecordService.GetTrainingsByTrainDate(startTime, endTime, this.ProjectId);
|
||||
var listAllTrain = BLL.EduTrain_TrainRecordService.GetTrainingsByTrainDate(endTime, this.ProjectId);
|
||||
|
||||
var listBosheng = db.Bo_Sheng_Train.Where(x => x.ProjectId == ProjectId && x.TrainStartDate >= startTime && x.TrainStartDate <= endTime).ToList();
|
||||
var listAllBosheng = db.Bo_Sheng_Train.Where(x => x.ProjectId == ProjectId && x.TrainStartDate <= endTime).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
int i = 0;
|
||||
@@ -2051,6 +2003,34 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
trainSort.TeachHour = 0;
|
||||
trainSort.PersonNum = 0;
|
||||
}
|
||||
|
||||
if (listBosheng.Count> 0)
|
||||
{
|
||||
//入场
|
||||
if (item.TrainTypeId == "dfb6a37e-4412-4ba9-ad59-3bc505bc21f7")
|
||||
{
|
||||
trainSort.PersonNum += listBosheng.Where(x => x.TrainType.Contains("入场")).Sum(x=>x.PersonCount);
|
||||
Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
decimal numSum = 0;
|
||||
trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("入场")).Sum(x => funDelegate(x.TrainPeriod, numSum));
|
||||
}
|
||||
else if (item.TrainTypeId == "c1a513bb-a547-45b0-944d-b0dd88f06f82")
|
||||
{
|
||||
//其他
|
||||
trainSort.PersonNum += listBosheng.Where(x => x.TrainType.Contains("其他")).Sum(x => x.PersonCount);
|
||||
Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
decimal numSum = 0;
|
||||
trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("其他")).Sum(x => funDelegate(x.TrainPeriod, numSum));
|
||||
}
|
||||
else {
|
||||
//专项
|
||||
trainSort.PersonNum += listBosheng.Where(x => x.TrainType.Contains("专项")).Sum(x => x.PersonCount);
|
||||
Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
decimal numSum = 0;
|
||||
trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("专项")).Sum(x => funDelegate(x.TrainPeriod, numSum));
|
||||
}
|
||||
}
|
||||
|
||||
if (listAllTrain.Count > 0)
|
||||
{
|
||||
trainSort.TotalPersonNum = listAllTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TrainPersonNum);
|
||||
@@ -2060,6 +2040,31 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
trainSort.TotalPersonNum = 0;
|
||||
}
|
||||
if (listAllBosheng.Count>0)
|
||||
{
|
||||
//入场
|
||||
if (item.TrainTypeId == "dfb6a37e-4412-4ba9-ad59-3bc505bc21f7")
|
||||
{
|
||||
trainSort.TotalPersonNum += listAllBosheng.Where(x => x.TrainType.Contains("入场")).Sum(x => x.PersonCount);
|
||||
TotalPersonNum+= Convert.ToInt32(trainSort.TotalPersonNum);
|
||||
}
|
||||
else if (item.TrainTypeId == "c1a513bb-a547-45b0-944d-b0dd88f06f82")
|
||||
{
|
||||
//其他
|
||||
trainSort.TotalPersonNum += listAllBosheng.Where(x => x.TrainType.Contains("其他")).Sum(x => x.PersonCount);
|
||||
TotalPersonNum += Convert.ToInt32(trainSort.TotalPersonNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
//专项
|
||||
trainSort.TotalPersonNum += listAllBosheng.Where(x => x.TrainType.Contains("专项")).Sum(x => x.PersonCount);
|
||||
TotalPersonNum += Convert.ToInt32(trainSort.TotalPersonNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//博晟工具箱中的数据
|
||||
|
||||
i++;
|
||||
trainSorts.Add(trainSort);
|
||||
}
|
||||
@@ -2079,9 +2084,16 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 4.2现场HSE会议及检查统计
|
||||
private void GetCheckSort()
|
||||
public static decimal CustomCount(string strNum, decimal Sum)
|
||||
{
|
||||
Sum += Convert.ToDecimal(strNum);
|
||||
return Sum;
|
||||
}
|
||||
|
||||
#region 4.2现场HSE会议及检查统计
|
||||
private void GetCheckSort()
|
||||
{
|
||||
var hselogList = db.Manager_HSSELog.Where(x => x.ProjectId == ProjectId).ToList();
|
||||
int i = 0;
|
||||
|
||||
#region HSE会议 本月开展次数
|
||||
@@ -2131,14 +2143,15 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
};
|
||||
checkSorts.Add(checkSort2);
|
||||
i++;
|
||||
//日巡检取HSE日志检查次数
|
||||
Model.Manager_CheckSortC checkSort3 = new Model.Manager_CheckSortC
|
||||
{
|
||||
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
||||
SortIndex = i,
|
||||
CheckType = "日巡检",
|
||||
CheckNumber = BLL.Check_CheckDayService.GetCountByCheckTime(startTime, endTime, this.ProjectId),
|
||||
YearCheckNum = BLL.Check_CheckDayService.GetCountByCheckTime(yearStartTime, endTime, this.ProjectId),
|
||||
TotalCheckNum = BLL.Check_CheckDayService.GetCountByCheckTime(projectStartTime, endTime, this.ProjectId)
|
||||
CheckNumber = hselogList.Where(x=>x.CompileDate>=startTime && x.CompileDate<=endTime).Sum(x=>x.Num21),
|
||||
YearCheckNum = hselogList.Where(x => x.CompileDate >= yearStartTime && x.CompileDate <= endTime).Sum(x => x.Num21),
|
||||
TotalCheckNum = hselogList.Where(x => x.CompileDate >= projectStartTime && x.CompileDate <= endTime).Sum(x => x.Num21)
|
||||
};
|
||||
checkSorts.Add(checkSort3);
|
||||
i++;
|
||||
@@ -2293,7 +2306,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
var YhzgdList = from x in db.Check_RectifyNoticesItem
|
||||
join y in db.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
|
||||
where y.ProjectId == ProjectId && y.CheckedDate >= startTime && y.CheckedDate <= endTime
|
||||
select new { y.UnitId, x.HiddenHazardType, y.States };
|
||||
select new { y.UnitId, x.HiddenHazardType, y.States,y.CompleteDate,x.LimitTime };
|
||||
|
||||
int yhMonthSum = 0, yhYearSum = 0;
|
||||
var list = new List<Model.Manager_HiddenDanger>();
|
||||
@@ -2310,32 +2323,41 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
};
|
||||
//HSE巡检(一般和重大)
|
||||
//所有数据
|
||||
var Commonly1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0 && x.Risk_Level == "一般" && x.States == "2").Count();
|
||||
var MajorNum1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0 && x.Risk_Level == "重大" && x.States == "2").Count();
|
||||
//总数,已整改
|
||||
var Commonly1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0 && (x.Risk_Level == "一般" || x.Risk_Level==null || x.Risk_Level == "") && x.States == "3").Count();
|
||||
var MajorNum1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0 && x.Risk_Level == "重大" && x.States == "3").Count();
|
||||
|
||||
//总数
|
||||
var Sum1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0).Count();
|
||||
var Yzg1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0 && x.States == "2").Count();
|
||||
//已关闭并且在期限内的
|
||||
var Yzg1 = HseList.Where(x => x.ResponsibleUnit == u.UnitId && x.Type == 0 && x.States == "2"
|
||||
&& x.RectificationTime<= x.RectificationPeriod ).Count();
|
||||
|
||||
//专项检查(一般和重大)
|
||||
var Commonly2 = CheckSpecialList.Where(x => x.UnitId == u.UnitId && x.HiddenHazardType == "1" && x.CompleteStatus == true).Count();
|
||||
var Commonly2 = CheckSpecialList.Where(x => x.UnitId == u.UnitId && (x.HiddenHazardType == "1"|| x.HiddenHazardType==null || x.HiddenHazardType == "") && x.CompleteStatus == true).Count();
|
||||
var MajorNum2 = CheckSpecialList.Where(x => x.UnitId == u.UnitId && x.HiddenHazardType == "3" && x.CompleteStatus == true).Count();
|
||||
//总数,已整改
|
||||
var Sum2 = CheckSpecialList.Where(x => x.UnitId == u.UnitId).Count();
|
||||
var Yzg2 = CheckSpecialList.Where(x => x.UnitId == u.UnitId && x.CompleteStatus == true).Count();
|
||||
//已整改,在期限内的
|
||||
var Yzg2 = CheckSpecialList.Where(x => x.UnitId == u.UnitId && x.CompleteStatus == true
|
||||
&& x.CompletedDate<=x.Rectification_Date).Count();
|
||||
|
||||
//综合检查(一般和重大)
|
||||
var Commonly3 = CheckColligationList.Where(x => x.UnitId == u.UnitId && x.HiddenHazardType == "一般" && x.CompleteStatus == true).Count();
|
||||
var Commonly3 = CheckColligationList.Where(x => x.UnitId == u.UnitId && (x.HiddenHazardType == "一般" || x.HiddenHazardType==null || x.HiddenHazardType == "") && x.CompleteStatus == true).Count();
|
||||
var MajorNum3 = CheckColligationList.Where(x => x.UnitId == u.UnitId && x.HiddenHazardType == "重大" && x.CompleteStatus == true).Count();
|
||||
//总数,已整改
|
||||
var Sum3 = CheckColligationList.Where(x => x.UnitId == u.UnitId).Count();
|
||||
var Yzg3 = CheckColligationList.Where(x => x.UnitId == u.UnitId && x.CompleteStatus == true).Count();
|
||||
//已整改
|
||||
var Yzg3 = CheckColligationList.Where(x => x.UnitId == u.UnitId && x.CompleteStatus == true && x.HandleStep=="5"
|
||||
&& x.CompletedDate<= x.LimitedDate).Count();
|
||||
|
||||
//隐患整改(一般和重大)
|
||||
var Commonly4 = YhzgdList.Where(x => x.UnitId == u.UnitId && x.HiddenHazardType == "一般" && x.States == "5").Count();
|
||||
var Commonly4 = YhzgdList.Where(x => x.UnitId == u.UnitId && (x.HiddenHazardType == "一般"
|
||||
|| x.HiddenHazardType == null || x.HiddenHazardType == "") && x.States == "5").Count();
|
||||
var MajorNum4 = YhzgdList.Where(x => x.UnitId == u.UnitId && x.HiddenHazardType == "重大" && x.States == "5").Count();
|
||||
//总数,已整改
|
||||
var Sum4 = YhzgdList.Where(x => x.UnitId == u.UnitId).Count();
|
||||
var Yzg4 = YhzgdList.Where(x => x.UnitId == u.UnitId && x.States == "5").Count();
|
||||
var Yzg4 = YhzgdList.Where(x => x.UnitId == u.UnitId && x.States == "5"
|
||||
&& x.CompleteDate<= x.LimitTime).Count();
|
||||
|
||||
|
||||
model.CommonlyNum = Commonly1 + Commonly2 + Commonly3 + Commonly4;
|
||||
@@ -2350,7 +2372,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
model.ReRate = "0";
|
||||
}
|
||||
yhMonthSum += Sum1 + Sum2 + Sum3 + Sum4;
|
||||
yhMonthSum += Convert.ToInt32(model.CommonlyNum) + Convert.ToInt32(model.MajorNum);
|
||||
|
||||
list.Add(model);
|
||||
i++;
|
||||
@@ -2364,21 +2386,25 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
//安全巡检list
|
||||
var HseListYear = (from x in Funs.DB.View_Hazard_HazardRegister
|
||||
where x.ProblemTypes == "1" && x.ProjectId == ProjectId && x.CheckTime >= yearStartTime && x.CheckTime <= endTime
|
||||
&& x.States == "3"
|
||||
select x).ToList().Count;
|
||||
//专项检查
|
||||
var CheckSpecialListYear = (from x in db.Check_CheckSpecialDetail
|
||||
join y in db.Check_CheckSpecial on x.CheckSpecialId equals y.CheckSpecialId
|
||||
where y.ProjectId == ProjectId && y.CheckTime >= yearStartTime && y.CheckTime <= endTime
|
||||
&& x.CompleteStatus == true
|
||||
select x).ToList().Count;
|
||||
//综合检查
|
||||
var CheckColligationListYear = (from x in db.Check_CheckColligationDetail
|
||||
join y in db.Check_CheckColligation on x.CheckColligationId equals y.CheckColligationId
|
||||
where y.ProjectId == ProjectId && y.CheckTime >= yearStartTime && y.CheckTime <= endTime
|
||||
&& x.CompleteStatus == true
|
||||
select x).ToList().Count;
|
||||
//隐患整改单
|
||||
var YhzgdListYear = (from x in db.Check_RectifyNoticesItem
|
||||
join y in db.Check_RectifyNotices on x.RectifyNoticesId equals y.RectifyNoticesId
|
||||
where y.ProjectId == ProjectId && y.CheckedDate >= yearStartTime && y.CheckedDate <= endTime
|
||||
&& y.States == "5"
|
||||
select new { y.UnitId, x.HiddenHazardType, y.States }).ToList().Count;
|
||||
txtYearHdangerCount.Text = (HseListYear + CheckSpecialListYear + CheckColligationListYear + YhzgdListYear).ToString();
|
||||
#endregion
|
||||
@@ -2572,8 +2598,14 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
};
|
||||
drillRecordList.Add(model);
|
||||
}
|
||||
this.DrillRecordListGrid.DataSource = drillRecordList;
|
||||
this.DrillRecordListGrid.DataBind();
|
||||
if (drillRecordList.Count == 0)
|
||||
{
|
||||
DrillRecordListGrid.EmptyText = "<raw><div class=\"grid-empty-text\">暂无数据</div></raw>";
|
||||
}
|
||||
else {
|
||||
this.DrillRecordListGrid.DataSource = drillRecordList;
|
||||
this.DrillRecordListGrid.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -2981,9 +3013,11 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
FirstAidDressing = 0, //
|
||||
MedicalTreatment = 0,//
|
||||
WorkLimitation = 0,//
|
||||
LossCount=0,
|
||||
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(),
|
||||
DeathCount=0,
|
||||
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(),
|
||||
@@ -2997,6 +3031,8 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
FirstAidDressing = 0, //
|
||||
MedicalTreatment = 0,//
|
||||
WorkLimitation = 0,//
|
||||
LossCount = 0,
|
||||
DeathCount = 0,
|
||||
LossPerson = (from x in reports
|
||||
join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId
|
||||
where y.UnitType == Const.ProjectUnitType_2
|
||||
@@ -3044,7 +3080,7 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
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;
|
||||
decimal TotalLossWorkTime = 0, TotalLossEconomy = 0, TotalDeathWorkTime = 0, TotalDeathEconomy = 0 ,TotalLossCount=0,TotalDeathCount=0;
|
||||
foreach (JObject mergedRow in gvInjuryAccident.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
@@ -3084,15 +3120,25 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
{
|
||||
TotalDeathEconomy += values.Value<decimal>("DeathEconomy");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(values["LossCount"].ToString()))
|
||||
{
|
||||
TotalLossCount += values.Value<decimal>("LossCount");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(values["DeathCount"].ToString()))
|
||||
{
|
||||
TotalDeathCount += values.Value<decimal>("DeathCount");
|
||||
}
|
||||
}
|
||||
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("LossCount", TotalLossCount.ToString("F2"));
|
||||
summary.Add("LossPerson", TotalLossPerson.ToString("F2"));
|
||||
summary.Add("LossWorkTime", TotalLossWorkTime.ToString("F2"));
|
||||
summary.Add("LossEconomy", TotalLossEconomy.ToString("F2"));
|
||||
summary.Add("DeathCount", TotalDeathCount.ToString("F2"));
|
||||
summary.Add("DeathPerson", TotalDeathPerson.ToString("F2"));
|
||||
summary.Add("DeathWorkTime", TotalDeathWorkTime.ToString("F2"));
|
||||
summary.Add("DeathEconomy", TotalDeathEconomy.ToString("F2"));
|
||||
|
||||
Reference in New Issue
Block a user