20220804考勤月记录校正数据方法优化

This commit is contained in:
2022-08-04 16:57:44 +08:00
parent 019e2fc83e
commit 03b773e8e4
8 changed files with 114 additions and 54 deletions
+6 -3
View File
@@ -277,7 +277,7 @@ namespace BLL
var getNums = from x in db.SitePerson_PersonInOutNumber
where x.ProjectId == projectId && x.InOutDate >= dateS
orderby x.InOutDate
select x;
select x;
var getInouts = from x in db.SitePerson_PersonInOut
where x.ProjectId == projectId && x.ChangeTime.Value >= dateS
select x;
@@ -289,7 +289,7 @@ namespace BLL
var getAllPersonInOutList = from x in getInouts
where x.ChangeTime > date.AddDays(-1) && x.ChangeTime < date.AddDays(1)
select x;
if (getAllPersonInOutList.Count() > 0)
{
/// 出场记录
@@ -303,13 +303,16 @@ namespace BLL
{
SafeHours = getMaxInOutDate.WorkHours ?? 0;
}
else
{
SafeHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == projectId && x.InOutDate < dateS).Max(x => x.WorkHours) ?? 0;
}
}
int getOutPersonCount = getPersonOutTimes.Select(x => x.PersonId).Distinct().Count();
SafeHours += getOutPersonCount * 8;
}
//SafeHours = Convert.ToInt32(SafeHours * 1.0 / 60);
if (itemNum != null)
{