|
@@ -229,7 +229,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
var steps = await _workflowDomainService.GetUnhandleStepIdsFromSendPoolAsync(OrderDefaults.SourceChannel.SendPoolId, cancellationToken);
|
|
|
var stepsList = steps.ToList();
|
|
|
|
|
|
- var user = await _userRepository.GetAsync(userId, cancellationToken);
|
|
|
+ var user = await _userRepository.Queryable()
|
|
|
+ .Includes(d => d.Organization)
|
|
|
+ .FirstAsync(d => d.Id == userId, cancellationToken);
|
|
|
DateTime time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
|
|
|
var schedulings = await _schedulingRepository.Queryable().Includes(x => x.SchedulingUser)
|
|
|
.Where(x => x.SchedulingTime == time && x.WorkingTime <= DateTime.Now.TimeOfDay && x.OffDutyTime >= DateTime.Now.TimeOfDay).CountAsync(cancellationToken);
|
|
@@ -243,8 +245,8 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
stepIds.Add(stepsList[i]);
|
|
|
stepsList.Remove(stepsList[i]);
|
|
|
}
|
|
|
- List<(string userId, string username, IReadOnlyList<string> stepIds)> handlers = new();
|
|
|
- ; handlers.Add(new ValueTuple<string, string, IReadOnlyList<string>>(user.Id, user.Name, stepIds));
|
|
|
+ List<(string, string, string, string, IReadOnlyList<string> stepIds)> handlers = new();
|
|
|
+ ; handlers.Add(new ValueTuple<string, string, string, string, IReadOnlyList<string>>(user.Id, user.Name, user.OrgId, user.Organization.Name, stepIds));
|
|
|
var workflowIds = await _workflowDomainService.ChangeHandlerRangeAsync(OrderDefaults.SourceChannel.SendPoolId, handlers, cancellationToken);
|
|
|
var orders = await _orderRepository.Queryable().Includes(d => d.Workflow).Where(d => workflowIds.Contains(d.WorkflowId))
|
|
|
.ToListAsync(cancellationToken);
|
|
@@ -277,7 +279,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
var stepsList = steps.ToList();
|
|
|
|
|
|
var sendNum = steps.Count() / schedulings.Count();
|
|
|
- List<(string userId, string username, IReadOnlyList<string> stepIds)> handlers = new();
|
|
|
+ List<(string userId, string username, string orgId, string orgName, IReadOnlyList<string> stepIds)> handlers = new();
|
|
|
if (sendNum > 0)
|
|
|
{
|
|
|
|
|
@@ -289,7 +291,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
stepIds.Add(stepsList[0]);
|
|
|
stepsList.Remove(stepsList[0]);
|
|
|
}
|
|
|
- handlers.Add(new ValueTuple<string, string, IReadOnlyList<string>>(scheduling.SchedulingUser.UserId, scheduling.SchedulingUser.UserName, stepIds));
|
|
|
+ handlers.Add(new ValueTuple<string, string, string, string, IReadOnlyList<string>>(scheduling.SchedulingUser.UserId, scheduling.SchedulingUser.UserName, "", "", stepIds));//todo
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -302,7 +304,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
stepIds.Add(stepsList[0]);
|
|
|
stepsList.Remove(stepsList[0]);
|
|
|
}
|
|
|
- handlers.Add(new ValueTuple<string, string, IReadOnlyList<string>>(schedulings[0].SchedulingUser.UserId, schedulings[0].SchedulingUser.UserName, stepIds));
|
|
|
+ handlers.Add(new ValueTuple<string, string, string, string, IReadOnlyList<string>>(schedulings[0].SchedulingUser.UserId, schedulings[0].SchedulingUser.UserName, "", "", stepIds));//todo
|
|
|
|
|
|
}
|
|
|
if (handlers.Any())
|