安全报表增加系统外工时统计

This commit is contained in:
geh
2026-01-26 17:34:39 +08:00
parent 7dff01059b
commit fd322d4c7f
25 changed files with 841 additions and 306 deletions
@@ -87,6 +87,10 @@ namespace FineUIPro.Web.InformationProject
{
this.txtTotalWorkNum.Text = Convert.ToString(millionsMonthlyReport.TotalWorkNum);
}
if (millionsMonthlyReport.OutSideUnitWorkNum != null)
{
this.txtOutSideUnitWorkNum.Text = Convert.ToString(millionsMonthlyReport.OutSideUnitWorkNum);
}
if (millionsMonthlyReport.PostPersonNum != null)
{
this.txtPostPersonNum.Text = Convert.ToString(millionsMonthlyReport.PostPersonNum);
@@ -353,7 +357,7 @@ namespace FineUIPro.Web.InformationProject
if (flowOperate != null)
{
millionsMonthlyReport.States = BLL.Const.State_2;
}
}
else
{
millionsMonthlyReport.States = this.ctlAuditFlow.NextStep;
@@ -366,6 +370,7 @@ namespace FineUIPro.Web.InformationProject
millionsMonthlyReport.ContractorNum = Funs.GetNewIntOrZero(this.txtContractorNum.Text.Trim());
millionsMonthlyReport.SumPersonNum = millionsMonthlyReport.PostPersonNum + millionsMonthlyReport.SnapPersonNum + millionsMonthlyReport.ContractorNum;
millionsMonthlyReport.TotalWorkNum = Funs.GetNewDecimalOrZero(this.txtTotalWorkNum.Text.Trim());
millionsMonthlyReport.OutSideUnitWorkNum = Funs.GetNewDecimalOrZero(this.txtOutSideUnitWorkNum.Text.Trim());
millionsMonthlyReport.SeriousInjuriesNum = Funs.GetNewInt(this.txtSeriousInjuriesNum.Text.Trim());
millionsMonthlyReport.SeriousInjuriesPersonNum = Funs.GetNewInt(this.txtSeriousInjuriesPersonNum.Text.Trim());
millionsMonthlyReport.SeriousInjuriesLossHour = Funs.GetNewInt(this.txtSeriousInjuriesLossHour.Text.Trim());
@@ -381,7 +386,7 @@ namespace FineUIPro.Web.InformationProject
millionsMonthlyReport.MedicalTreatmentLossHour = Funs.GetNewInt(this.txtMedicalTreatmentLossHour.Text.Trim());
millionsMonthlyReport.FireNum = Funs.GetNewInt(this.txtFireNum.Text.Trim());
millionsMonthlyReport.EnvironmenNum = Funs.GetNewInt(this.txtEnvironmenNum.Text.Trim());
millionsMonthlyReport.TrafficNum = Funs.GetNewInt(this.txtTrafficNum.Text.Trim());
millionsMonthlyReport.TrafficNum = Funs.GetNewInt(this.txtTrafficNum.Text.Trim());
millionsMonthlyReport.EquipmentNum = Funs.GetNewInt(this.txtEquipmentNum.Text.Trim());
millionsMonthlyReport.QualityNum = Funs.GetNewInt(this.txtQualityNum.Text.Trim());
millionsMonthlyReport.OtherNum = Funs.GetNewInt(this.txtOtherNum.Text.Trim());
@@ -409,7 +414,7 @@ namespace FineUIPro.Web.InformationProject
millionsMonthlyReport.MillionsMonthlyReportId = this.MillionsMonthlyReportId;
BLL.ProjectMillionsMonthlyReportService.UpdateMillionsMonthlyReport(millionsMonthlyReport);
BLL.LogService.AddSys_Log(this.CurrUser, millionsMonthlyReport.Year.ToString() + "-" + millionsMonthlyReport.Month.ToString(), millionsMonthlyReport.MillionsMonthlyReportId, BLL.Const.ProjectMillionsMonthlyReportMenuId, BLL.Const.BtnModify);
}
else
{
@@ -474,7 +479,18 @@ namespace FineUIPro.Web.InformationProject
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
{
int? sumTotalPanhours = 0;
int? sumOutSideTotalPanhours = 0;
List<string> outSideUnitIds = new List<string>();
var projectUnits = from x in db.Project_ProjectUnit
where x.ProjectId == this.ProjectId
select x;
foreach (var projectUnit in projectUnits)
{
if (projectUnit.UnitType == BLL.Const.ProjectUnitType_1 || projectUnit.IsOutSideUnit == true)
{
outSideUnitIds.Add(projectUnit.UnitId);
}
}
//获取当期人工时日报
List<Model.SitePerson_DayReport> dayReports = BLL.SitePerson_DayReportService.GetDayReportsByCompileDate(startTime, endTime, this.ProjectId);
if (dayReports.Count > 0)
@@ -482,10 +498,15 @@ namespace FineUIPro.Web.InformationProject
foreach (var dayReport in dayReports)
{
sumTotalPanhours += Convert.ToInt32((from y in db.SitePerson_DayReportDetail where y.DayReportId == dayReport.DayReportId select y.PersonWorkTime as decimal?).Sum());
sumOutSideTotalPanhours += Convert.ToInt32((from y in db.SitePerson_DayReportDetail
where y.DayReportId == dayReport.DayReportId && outSideUnitIds.Contains(y.UnitId)
select y.PersonWorkTime as decimal?).Sum());
}
//总工时数(万)
this.txtTotalWorkNum.Text = decimal.Round(decimal.Round(Convert.ToDecimal(sumTotalPanhours), 4) / 10000, 4).ToString();
//去除系统内单位的总工时数(万)
this.txtOutSideUnitWorkNum.Text = decimal.Round(decimal.Round(Convert.ToDecimal(sumOutSideTotalPanhours), 4) / 10000, 4).ToString();
//在岗员工
//获取单位集合
var unitIds = (from x in dayReports