Browse Source

平均派单

田爽 1 year ago
parent
commit
fcf2abcadd
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/Hotline.Application/Identity/IdentityAppService.cs

+ 5 - 3
src/Hotline.Application/Identity/IdentityAppService.cs

@@ -138,9 +138,11 @@ public class IdentityAppService : IIdentityAppService, IScopeDependency
         try
         {
             DateTime time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
-            //根据当前时间获取排班信息
-            var scheduling = await _schedulingRepository.Queryable().Includes(x => x.SchedulingUser)
-                .Where(x => x.SchedulingTime == time && x.WorkingTime <= DateTime.Now.TimeOfDay && x.OffDutyTime >= DateTime.Now.TimeOfDay && x.AtWork!.Value != true && x.SchedulingUser.UserId == id)
+
+	            //&& x.AtWork!.Value != true
+			//根据当前时间获取排班信息
+			var scheduling = await _schedulingRepository.Queryable().Includes(x => x.SchedulingUser)
+                .Where(x => x.SchedulingTime == time && x.WorkingTime <= DateTime.Now.TimeOfDay && x.OffDutyTime >= DateTime.Now.TimeOfDay && ( x.AtWork == true || x.AtWork  == null) && x.SchedulingUser.UserId == id)
                 .OrderBy(x => x.SendOrderNum).FirstAsync(cancellationToken);
             if (scheduling != null)
             {