20231024
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user