From b40be1c7f939bdb3cb010513c1ae24e291e2ed66 Mon Sep 17 00:00:00 2001 From: chenlin Date: Fri, 30 Jan 2026 10:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=8E=92=E7=8F=AD=E5=B7=A5?= =?UTF-8?q?=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOAN.Service/MES/group/GroupScheduleService.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/DOAN.Service/MES/group/GroupScheduleService.cs b/DOAN.Service/MES/group/GroupScheduleService.cs index 0da51a0..a1a0f4d 100644 --- a/DOAN.Service/MES/group/GroupScheduleService.cs +++ b/DOAN.Service/MES/group/GroupScheduleService.cs @@ -97,13 +97,17 @@ namespace DOAN.Service.Business public PagedInfo ListGroupByDate(GroupScheduleQueryDto2 query) { query.ScheduleDate = query.ScheduleDate.Date; - var result= Queryable().LeftJoin((it, sh) => it.FkShift == sh.Id).Where((it, sh) => it.ScheduleDate == query.ScheduleDate) - .Select((it, sh) => new GroupScheduleDto { ShiftName = sh.Name }, true) - .ToPage(query); + //var result= Queryable().LeftJoin((it, sh) => it.FkShift == sh.Id).Where((it, sh) => it.ScheduleDate == query.ScheduleDate) + // .Select((it, sh) => new GroupScheduleDto { ShiftName = sh.Name }, true) + // .ToPage(query); + + var result = Queryable().Where((it) => it.ScheduleDate == query.ScheduleDate) + .Select((it) => new GroupScheduleDto { ShiftName = "" }, true) + .ToPage(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; }