计算排班时长
This commit is contained in:
parent
8b0f54b379
commit
195db55209
@ -97,11 +97,15 @@ namespace DOAN.Service.Business
|
||||
public PagedInfo<GroupScheduleDto> ListGroupByDate(GroupScheduleQueryDto2 query)
|
||||
{
|
||||
query.ScheduleDate = query.ScheduleDate.Date;
|
||||
return Queryable().LeftJoin<GroupShift>((it, sh) => it.FkShift == sh.Id).Where((it, sh) => it.ScheduleDate == query.ScheduleDate)
|
||||
var result= Queryable().LeftJoin<GroupShift>((it, sh) => it.FkShift == sh.Id).Where((it, sh) => it.ScheduleDate == query.ScheduleDate)
|
||||
.Select((it, sh) => new GroupScheduleDto { ShiftName = sh.Name }, true)
|
||||
.ToPage<GroupScheduleDto, GroupScheduleDto>(query);
|
||||
|
||||
|
||||
result.Result.ForEach(t =>
|
||||
{
|
||||
t.WorkHours = Math.Round((decimal)(((t.EndTime.Value - t.StartTime.Value).TotalMinutes - t.PlanRestTime) / 60.0), 2);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user