|
@@ -603,28 +603,33 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
.Where(x => x.SchedulingTime == time).CountAsync(cancellationToken);
|
|
|
if (schedulings > 0)
|
|
|
{
|
|
|
- var sendNum = steps.Count / schedulings;
|
|
|
+ var sendNum = steps.Count / schedulings;
|
|
|
+ scheduling.SendOrderNum += sendNum;
|
|
|
if (!scheduling.LoginSendOrderNum.HasValue)
|
|
|
{
|
|
|
scheduling.LoginSendOrderNum = scheduling.LoginSendOrderNum.HasValue && scheduling.LoginSendOrderNum > sendNum ? scheduling.LoginSendOrderNum : sendNum;
|
|
|
+ await _schedulingRepository.Updateable()
|
|
|
+ .SetColumns(s => new Scheduling() { LoginSendOrderNum = scheduling.LoginSendOrderNum })
|
|
|
+ .Where(s => s.SchedulingTime == scheduling.SchedulingTime).ExecuteCommandAsync(cancellationToken);
|
|
|
}
|
|
|
sendNum = scheduling.LoginSendOrderNum.Value;
|
|
|
- if (sendNum <= 0) return;
|
|
|
- var sendSteps = steps.Take(sendNum).ToList();
|
|
|
await _schedulingRepository.Updateable()
|
|
|
- .SetColumns(s => new Scheduling() { AtWork = scheduling.AtWork, LoginSendOrderNum = scheduling.LoginSendOrderNum })
|
|
|
+ .SetColumns(s => new Scheduling() { SendOrderNum = scheduling.SendOrderNum, AtWork = scheduling.AtWork })
|
|
|
.Where(s => s.Id == scheduling.Id).ExecuteCommandAsync(cancellationToken);
|
|
|
- await _orderRepository.Updateable().SetColumns(o => new Order()
|
|
|
- {
|
|
|
- CenterToOrgHandlerId = user.OrgId,
|
|
|
- CenterToOrgHandlerName = user.Name
|
|
|
- }).Where(o => sendSteps.Any(s => s.ExternalId == o.Id)).ExecuteCommandAsync(cancellationToken);
|
|
|
|
|
|
- await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, string? roleId, string? roleName, ICollection<WorkflowStep> steps)>
|
|
|
- {
|
|
|
- new(user.Id, user.Name, user.OrgId, user.Organization.Name,roleId,"派单员", sendSteps)
|
|
|
- }, cancellationToken);
|
|
|
- }
|
|
|
+ if (sendNum <= 0) return;
|
|
|
+ var sendSteps = steps.Take(sendNum).ToList();
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Order()
|
|
|
+ {
|
|
|
+ CenterToOrgHandlerId = user.OrgId,
|
|
|
+ CenterToOrgHandlerName = user.Name
|
|
|
+ }).Where(o => sendSteps.Any(s => s.ExternalId == o.Id)).ExecuteCommandAsync(cancellationToken);
|
|
|
+
|
|
|
+ await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, string? roleId, string? roleName, ICollection<WorkflowStep> steps)>
|
|
|
+ {
|
|
|
+ new(user.Id, user.Name, user.OrgId, user.Organization.Name,roleId,"派单员", sendSteps)
|
|
|
+ }, cancellationToken);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|