劳务人员看板

This commit is contained in:
geh
2026-05-09 11:43:24 +08:00
parent c375bff46b
commit 6c67afae72
19 changed files with 4902 additions and 22 deletions
+45
View File
@@ -203,6 +203,47 @@ namespace FineUIPro.Web.common
#endregion
#region
//累计人工时
var allProjectsDetails = (from detail in db.SitePerson_DayReportDetail
join report in db.SitePerson_DayReport
on detail.DayReportId equals report.DayReportId
join unit in db.Base_Unit
on detail.UnitId equals unit.UnitId
join project in db.Base_Project
on report.ProjectId equals project.ProjectId
where BaseDataService.BeUnderConstructionList.Contains(report.ProjectId) &&
report.CompileDate == (from r in db.SitePerson_DayReport
where r.ProjectId == report.ProjectId
select r.CompileDate).Max()
orderby project.ShortName, unit.UnitCode
select new
{
detail.DayReportDetailId,
report.ProjectId,
ProjectName = project.ShortName,
unit.UnitName,
detail.PersonWorkTime,
// 当年累计
YearPersonWorkTime = (from d in db.SitePerson_DayReportDetail
join r in db.SitePerson_DayReport on d.DayReportId equals r.DayReportId
where r.ProjectId == report.ProjectId
&& d.UnitId == detail.UnitId
&& r.CompileDate <= report.CompileDate
&& r.CompileDate.Value.Year == report.CompileDate.Value.Year
select d.PersonWorkTime ?? 0).Sum(),
// 总累计
TotalPersonWorkTime = (from d in db.SitePerson_DayReportDetail
join r in db.SitePerson_DayReport on d.DayReportId equals r.DayReportId
where r.ProjectId == report.ProjectId
&& d.UnitId == detail.UnitId
&& r.CompileDate <= report.CompileDate
select d.PersonWorkTime ?? 0).Sum()
}).ToList();
// 计算所有项目累计人工时总和
var totalManHour = allProjectsDetails.Sum(x => x.TotalPersonWorkTime);
#endregion
// 构造返回数据
var returnData = new
{
@@ -350,6 +391,10 @@ namespace FineUIPro.Web.common
useNum = inspectionMachineList.Where(x => x.InspectionType == "计量").Sum(x => x.UnitsCount ?? 0),
okNum = inspectionMachineList.Where(x => x.InspectionType == "计量" && x.IsCheckOK.HasValue && x.IsCheckOK == true).Sum(x => x.UnitsCount ?? 0),
},
manHour = new
{//工时数
totalManHour = totalManHour,
}
}
};