This commit is contained in:
2023-10-24 10:48:05 +08:00
parent 4abb69942e
commit bfb4cdc428
12 changed files with 961 additions and 821 deletions
+28 -24
View File
@@ -70,30 +70,34 @@ namespace FineUIPro.Web.common
private void getPersonWorkTime()
{
this.divSafeWorkTime.InnerHtml = "0000000000";
//var ProjectTotal = (from x in Funs.DB.HSSE_MonthReportItem
//join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
//where y.ProjectId == this.ProjectId && "安全生产人工时数" == x.ReportItem
// select x.YearTotal).Sum();
decimal sumMonthCount = 0;
var getMonts = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderBy(x => x.ReporMonth);
var getmax = getMonts.FirstOrDefault();
if (getMonts.Count() > 0)
{
foreach (var item in getMonts)
{
decimal monthCount = 0;
var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == item.MonthReportId);
if (getItem != null && getItem.MonthWorkTime.HasValue)
{
monthCount = getItem.MonthWorkTime ?? 0;
sumMonthCount += monthCount;
if (sumMonthCount < getItem.ProjectWorkTime)
{
sumMonthCount = getItem.ProjectWorkTime ?? 0;
}
}
}
}
var ProjectTotal = (from x in Funs.DB.HSSE_MonthReportItem
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
where y.ProjectId == this.ProjectId && "安全生产人工时数" == x.ReportItem
select x.YearTotal).Sum();
decimal sumMonthCount = 0;
if (ProjectTotal.HasValue)
{
sumMonthCount = ProjectTotal.Value;
}
//var getMonts = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderBy(x => x.ReporMonth);
//var getmax = getMonts.FirstOrDefault();
//if (getMonts.Count() > 0)
//{
// foreach (var item in getMonts)
// {
// decimal monthCount = 0;
// var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == item.MonthReportId);
// if (getItem != null && getItem.MonthWorkTime.HasValue)
// {
// monthCount = getItem.MonthWorkTime ?? 0;
// sumMonthCount += monthCount;
// if (sumMonthCount < getItem.ProjectWorkTime)
// {
// sumMonthCount = getItem.ProjectWorkTime ?? 0;
// }
// }
// }
//}
if (sumMonthCount>0)
{