计算排班工时
This commit is contained in:
parent
195db55209
commit
b40be1c7f9
@ -97,13 +97,17 @@ namespace DOAN.Service.Business
|
||||
public PagedInfo<GroupScheduleDto> ListGroupByDate(GroupScheduleQueryDto2 query)
|
||||
{
|
||||
query.ScheduleDate = query.ScheduleDate.Date;
|
||||
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);
|
||||
//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);
|
||||
|
||||
var result = Queryable().Where((it) => it.ScheduleDate == query.ScheduleDate)
|
||||
.Select((it) => new GroupScheduleDto { ShiftName = "" }, 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);
|
||||
t.WorkHours = Math.Round((decimal)(((t.EndTime - t.StartTime)?.TotalMinutes ?? 0 - t.PlanRestTime) / 60.0), 2);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user