大屏优化
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BLL
|
||||
&& x.ChangeTime.Value.Month == dateValue.Month
|
||||
&& x.ChangeTime.Value.Day == dateValue.Day
|
||||
select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType };
|
||||
if (getDayAll.Count() > 0)
|
||||
if (getDayAll.Any())
|
||||
{
|
||||
var getInMaxs = from x in getDayAll
|
||||
group x by x.PersonId into g
|
||||
@@ -36,7 +36,7 @@ namespace BLL
|
||||
IsIn = g.First().IsIn,
|
||||
PostType = g.First().PostType
|
||||
};
|
||||
if (getInMaxs.Count() > 0)
|
||||
if (getInMaxs.Any())
|
||||
{
|
||||
getSiteInOutList = getInMaxs.Where(x => x.IsIn == true).ToList();
|
||||
}
|
||||
@@ -44,6 +44,42 @@ namespace BLL
|
||||
return getSiteInOutList;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Model.PageDataPersonInOutItem> getPersonNum(List<string> projectIds, DateTime dateValue)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var startDate = dateValue.Date;
|
||||
var endDate = startDate.AddDays(1);
|
||||
List<Model.PageDataPersonInOutItem> getSiteInOutList = new List<Model.PageDataPersonInOutItem>();
|
||||
var getDayAll = from x in db.SitePerson_PersonInOutNow
|
||||
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
|
||||
join z in db.Base_WorkPost on y.WorkPostId equals z.WorkPostId
|
||||
where projectIds.Contains(x.ProjectId)
|
||||
&& x.ChangeTime >= startDate &&
|
||||
x.ChangeTime < endDate
|
||||
select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType,x.ProjectId };
|
||||
if (getDayAll.Any())
|
||||
{
|
||||
var getInMaxs = from x in getDayAll
|
||||
group x by new {x.PersonId,x.ProjectId} into g
|
||||
select new Model.PageDataPersonInOutItem
|
||||
{
|
||||
PersonId = g.First().PersonId,
|
||||
ProjectId = g.First().ProjectId,
|
||||
ChangeTime = g.Max(x => x.ChangeTime),
|
||||
IsIn = g.First().IsIn,
|
||||
PostType = g.First().PostType
|
||||
};
|
||||
if (getInMaxs.Any())
|
||||
{
|
||||
getSiteInOutList = getInMaxs.Where(x => x.IsIn == true).ToList();
|
||||
}
|
||||
}
|
||||
return getSiteInOutList;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取当前人工时
|
||||
@@ -150,7 +186,7 @@ namespace BLL
|
||||
where x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month
|
||||
&& x.ChangeTime.Value.Day == dateValue.Day
|
||||
select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType };
|
||||
if (getDayAll.Count() > 0)
|
||||
if (getDayAll.Any())
|
||||
{
|
||||
var getInMaxs = from x in getDayAll
|
||||
group x by x.PersonId into g
|
||||
@@ -161,7 +197,7 @@ namespace BLL
|
||||
IsIn = g.First().IsIn,
|
||||
PostType = g.First().PostType
|
||||
};
|
||||
if (getInMaxs.Count() > 0)
|
||||
if (getInMaxs.Any())
|
||||
{
|
||||
getSiteInOutList = getInMaxs.Where(x => x.IsIn == true).ToList();
|
||||
}
|
||||
@@ -181,7 +217,7 @@ namespace BLL
|
||||
where x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month
|
||||
&& x.ChangeTime.Value.Day == dateValue.Day && pids.Contains(x.ProjectId)
|
||||
select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType };
|
||||
if (getDayAll.Count() > 0)
|
||||
if (getDayAll.Any())
|
||||
{
|
||||
var getInMaxs = from x in getDayAll
|
||||
group x by x.PersonId into g
|
||||
@@ -192,7 +228,7 @@ namespace BLL
|
||||
IsIn = g.First().IsIn,
|
||||
PostType = g.First().PostType
|
||||
};
|
||||
if (getInMaxs.Count() > 0)
|
||||
if (getInMaxs.Any())
|
||||
{
|
||||
getSiteInOutList = getInMaxs.Where(x => x.IsIn == true).ToList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user