首页数据修改
This commit is contained in:
@@ -148,49 +148,73 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
private void getSitePerson()
|
||||
{
|
||||
var getEmployInOutRecords = Funs.DB.T_d_EmployInOutRecord.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date).ToList();
|
||||
//var getEmployInOutRecords = Funs.DB.T_d_EmployInOutRecord.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date).ToList();
|
||||
//string sql = @"select c.ConstText,b.PostType,count( *) num from SitePerson_Person a left join Base_WorkPost b on a.WorkPostId=b.WorkPostId
|
||||
// LEFT JOIN Sys_Const AS c ON c.ConstValue = b.PostType and c.GroupId = 'PostType' where IsUsed =1 and InTime<='" + DateTime.Now.ToString("yyyy-MM-dd") + "' and (OutTime is null or OutTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + @"' )
|
||||
// and a.ProjectId='" + this.ProjectId + @"' and a.AuditorDate is not null
|
||||
// group by c.ConstText,b.PostType ";
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// SqlParameter[] parameter = listStr.ToArray();
|
||||
// DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
|
||||
// int allcount = getEmployInOutRecords.Count();
|
||||
// int mcount = 0;
|
||||
// if (tb != null)
|
||||
// {
|
||||
// foreach (DataRow row in tb.Rows)
|
||||
// {
|
||||
// //allcount += int.Parse(row["num"].ToString());
|
||||
// if (!string.IsNullOrEmpty(row["ConstText"].ToString()) && row["ConstText"].ToString().Contains("管理"))
|
||||
// {
|
||||
// mcount += int.Parse(row["num"].ToString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// this.divALLPerson.InnerHtml = allcount.ToString();
|
||||
|
||||
|
||||
string sql = @"select c.ConstText,b.PostType,count( *) num from SitePerson_Person a left join Base_WorkPost b on a.WorkPostId=b.WorkPostId
|
||||
LEFT JOIN Sys_Const AS c ON c.ConstValue = b.PostType and c.GroupId = 'PostType' where IsUsed =1 and InTime<='" + DateTime.Now.ToString("yyyy-MM-dd") + "' and (OutTime is null or OutTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + @"' )
|
||||
and a.ProjectId='" + this.ProjectId + @"' and a.AuditorDate is not null
|
||||
group by c.ConstText,b.PostType ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
|
||||
int allcount = getEmployInOutRecords.Count();
|
||||
int mcount = 0;
|
||||
if (tb != null)
|
||||
//if (allcount > mcount)
|
||||
//{
|
||||
// this.divGLPerson.InnerHtml = mcount.ToString();
|
||||
// this.divZYPerson.InnerHtml = (allcount - mcount).ToString();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// this.divGLPerson.InnerHtml = allcount.ToString();
|
||||
// this.divZYPerson.InnerHtml = "0";
|
||||
//}
|
||||
var ProjectTotal1 = (from x in Funs.DB.HSSE_MonthReportItem
|
||||
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
|
||||
where ("成达公司HSE管理人数" == x.ReportItem || "分包商HSE管理人数" == x.ReportItem) && y.Years == DateTime.Now.Year && y.ProjectId==CurrUser.LoginProjectId
|
||||
select x.YearTotal).Sum();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var ProjectTotal2 = (from x in Funs.DB.HSSE_MonthReportItem
|
||||
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
|
||||
where ("成达公司现场人数" == x.ReportItem || "分包商现场人数" == x.ReportItem) && y.Years == DateTime.Now.Year && y.ProjectId == CurrUser.LoginProjectId
|
||||
select x.YearTotal).Sum();
|
||||
|
||||
if (ProjectTotal1.HasValue)
|
||||
{
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
//allcount += int.Parse(row["num"].ToString());
|
||||
if (!string.IsNullOrEmpty(row["ConstText"].ToString()) && row["ConstText"].ToString().Contains("管理"))
|
||||
{
|
||||
mcount += int.Parse(row["num"].ToString());
|
||||
}
|
||||
}
|
||||
this.divGLPerson.InnerHtml = ProjectTotal1.Value.ToString();
|
||||
}
|
||||
this.divALLPerson.InnerHtml = allcount.ToString();
|
||||
|
||||
|
||||
if (allcount > mcount)
|
||||
{
|
||||
this.divGLPerson.InnerHtml = mcount.ToString();
|
||||
this.divZYPerson.InnerHtml = (allcount - mcount).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.divGLPerson.InnerHtml = allcount.ToString();
|
||||
this.divZYPerson.InnerHtml = "0";
|
||||
}
|
||||
|
||||
if (CurrUser.LoginProjectId == "b11a16ea-148c-4bae-a5a1-32158b599482")
|
||||
if (ProjectTotal2.HasValue)
|
||||
{
|
||||
this.divALLPerson.InnerHtml = "1301";
|
||||
this.divGLPerson.InnerHtml = "172";
|
||||
this.divZYPerson.InnerHtml = "1129";
|
||||
this.divALLPerson.InnerHtml = ProjectTotal2.Value.ToString();
|
||||
}
|
||||
if (ProjectTotal1.HasValue && ProjectTotal2.HasValue)
|
||||
{
|
||||
this.divZYPerson.InnerHtml = (ProjectTotal2.Value - ProjectTotal1.Value).ToString();
|
||||
}
|
||||
else if(ProjectTotal2.HasValue)
|
||||
{
|
||||
this.divZYPerson.InnerHtml = ProjectTotal2.Value .ToString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user