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

This commit is contained in:
2026-01-24 15:11:38 +08:00
parent 179eed5b87
commit 72edf7900e
26 changed files with 1377 additions and 708 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.SGGLDB db = new Model.SGGLDB(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
@@ -499,7 +520,7 @@ namespace FineUIPro.Web.InformationProject
if (unit != null)
{
int count = BLL.SitePerson_DayReportService.GetDayReportsByCompileDateAndUnitId(startTime, endTime, this.CurrUser.LoginProjectId, unitId).Count();
if (unit.UnitId == BLL.Const.UnitId_CWCEC) //本单位
if (unit.UnitId == CommonService.GetThisUnitId()) //本单位
{
//本单位在岗员工
decimal personNum = (from x in dayReports
@@ -594,7 +615,7 @@ namespace FineUIPro.Web.InformationProject
Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(unitId);
if (unit != null)
{
if (unit.UnitId == BLL.Const.UnitId_CWCEC) //本单位
if (unit.UnitId == CommonService.GetThisUnitId()) //本单位
{
//本单位在岗员工
decimal? personNum = db.SitePerson_MonthReportDetail.Where(x => x.MonthReportId == monthReport.MonthReportId && x.UnitId == unitId).Sum(x => x.RealPersonNum);