修改首页
This commit is contained in:
parent
24ed5b1c49
commit
4efca8b862
|
@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||||
txtSolutionName.Enabled = false;
|
txtSolutionName.Enabled = false;
|
||||||
txtCNProfessional.Enabled = false;
|
txtCNProfessional.Enabled = false;
|
||||||
txtUnitWork.Enabled = false;
|
txtUnitWork.Enabled = false;
|
||||||
ContactImg = -1;
|
ContactImg = 0;
|
||||||
Panel2.Enabled = false;
|
Panel2.Enabled = false;
|
||||||
}
|
}
|
||||||
//提交版本人多次修改
|
//提交版本人多次修改
|
||||||
|
|
|
@ -45,9 +45,13 @@ namespace FineUIPro.Web.common
|
||||||
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
||||||
|
|
||||||
//本月安全人工时
|
//本月安全人工时
|
||||||
int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day))
|
int wHoursMonth = 0;
|
||||||
&& x.ProjectId == ProjectId)
|
DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString()+"-"+ DateTime.Now.Month.ToString());
|
||||||
.Max(x => x.WorkHours) ?? 0;
|
var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.ProjectId, sDate);
|
||||||
|
if (dayReports.Count>0)
|
||||||
|
{
|
||||||
|
wHoursMonth = Convert.ToInt32(dayReports[0].DayWorkTime);
|
||||||
|
}
|
||||||
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
||||||
|
|
||||||
//安全培训累计人员
|
//安全培训累计人员
|
||||||
|
|
|
@ -34,10 +34,19 @@ namespace FineUIPro.Web.common
|
||||||
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
||||||
|
|
||||||
//本月安全人工时
|
//本月安全人工时
|
||||||
int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day)))
|
int wHoursMonth = 0;
|
||||||
.Max(x => x.WorkHours) ?? 0;
|
DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString());
|
||||||
|
var dayReports = getMonthReportsByCompany(sDate);
|
||||||
|
if (dayReports.Count > 0)
|
||||||
|
{
|
||||||
|
wHoursMonth = Convert.ToInt32(dayReports[0].DayWorkTime);
|
||||||
|
}
|
||||||
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
||||||
|
|
||||||
|
//int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day)))
|
||||||
|
// .Max(x => x.WorkHours) ?? 0;
|
||||||
|
//this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
||||||
|
|
||||||
//安全培训累计人员
|
//安全培训累计人员
|
||||||
var getTrainRecord = db.EduTrain_TrainRecord.Max(x=>x.TrainPersonNum)??0;
|
var getTrainRecord = db.EduTrain_TrainRecord.Max(x=>x.TrainPersonNum)??0;
|
||||||
this.divSafePersonNum.InnerHtml = getTrainRecord.ToString();
|
this.divSafePersonNum.InnerHtml = getTrainRecord.ToString();
|
||||||
|
@ -110,6 +119,50 @@ namespace FineUIPro.Web.common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 当月人工时
|
||||||
|
/// <summary>
|
||||||
|
/// 获取出入记录人工时-月报(项目级别)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static List<Model.SitePerson_MonthReport> getMonthReportsByCompany(DateTime? sDate)
|
||||||
|
{
|
||||||
|
Model.SGGLDB db = Funs.DB;
|
||||||
|
List<Model.SitePerson_MonthReport> reports = new List<Model.SitePerson_MonthReport>();
|
||||||
|
var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber
|
||||||
|
|
||||||
|
select x;
|
||||||
|
if (getAllPersonInOutList.Count() > 0)
|
||||||
|
{
|
||||||
|
var getInMonths = (from x in getAllPersonInOutList select new { x.InOutDate.Year, x.InOutDate.Month }).Distinct();
|
||||||
|
if (sDate.HasValue)
|
||||||
|
{
|
||||||
|
getInMonths = getInMonths.Where(x => x.Year == sDate.Value.Year && x.Month == sDate.Value.Month);
|
||||||
|
}
|
||||||
|
foreach (var item in getInMonths)
|
||||||
|
{
|
||||||
|
DateTime compileDate = Funs.GetNewDateTimeOrNow(item.Year.ToString() + "-" + item.Month.ToString());
|
||||||
|
var getNow = getAllPersonInOutList.Where(x => x.InOutDate.Year == compileDate.Year && x.InOutDate.Month == compileDate.Month).Max(x => x.WorkHours);
|
||||||
|
if (getNow.HasValue)
|
||||||
|
{
|
||||||
|
Model.SitePerson_MonthReport reportItem = new Model.SitePerson_MonthReport
|
||||||
|
{
|
||||||
|
MonthReportId = SQLHelper.GetNewID(),
|
||||||
|
|
||||||
|
CompileDate = Funs.GetNewDateTime(item.Year.ToString() + "-" + item.Month.ToString()),
|
||||||
|
TotalPersonWorkTime = getNow,
|
||||||
|
};
|
||||||
|
DateTime upDate = compileDate.AddMonths(-1);
|
||||||
|
var getMax = getAllPersonInOutList.Where(x => x.InOutDate.Year == upDate.Year && x.InOutDate.Month == upDate.Month).Max(x => x.WorkHours) ?? 0;
|
||||||
|
reportItem.DayWorkTime = (getNow ?? 0) - getMax;
|
||||||
|
reports.Add(reportItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return reports;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 项目信息
|
#region 项目信息
|
||||||
protected string Project
|
protected string Project
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue