|
@@ -740,8 +740,9 @@ public class OrderController : BaseController
|
|
var users = await _userRepository.Queryable()
|
|
var users = await _userRepository.Queryable()
|
|
.Includes(d => d.Organization)
|
|
.Includes(d => d.Organization)
|
|
.Includes(d => d.Roles)
|
|
.Includes(d => d.Roles)
|
|
- .Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
|
|
|
+ .WhereIF(!_appOptions.Value.IsZiGong,d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
|
|
+ .WhereIF(_appOptions.Value.IsZiGong, d => d.OrgId == OrgSeedData.CenterId)
|
|
|
|
+ .ToListAsync(HttpContext.RequestAborted);
|
|
return users.Select(d => new OrderMigrationHandler
|
|
return users.Select(d => new OrderMigrationHandler
|
|
{
|
|
{
|
|
UserId = d.Id,
|
|
UserId = d.Id,
|
|
@@ -1285,7 +1286,8 @@ public class OrderController : BaseController
|
|
var users = await _userRepository.Queryable()
|
|
var users = await _userRepository.Queryable()
|
|
.Includes(d => d.Organization)
|
|
.Includes(d => d.Organization)
|
|
.Includes(d => d.Roles)
|
|
.Includes(d => d.Roles)
|
|
- .Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
|
|
|
|
+ .WhereIF(!_appOptions.Value.IsZiGong,d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
|
|
+ .WhereIF(_appOptions.Value.IsZiGong,d=> d.OrgId == OrgSeedData.CenterId)
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
return users.Select(d => new OrderMigrationHandler
|
|
return users.Select(d => new OrderMigrationHandler
|
|
{
|
|
{
|
|
@@ -3757,6 +3759,11 @@ public class OrderController : BaseController
|
|
{
|
|
{
|
|
await AverageSendOrderAsync(nextDto, HttpContext.RequestAborted);
|
|
await AverageSendOrderAsync(nextDto, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
+ var flowStepHandler = nextDto.NextHandlers.FirstOrDefault();
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Order()
|
|
|
|
+ {
|
|
|
|
+ CenterToOrgHandlerId = flowStepHandler.UserId, CenterToOrgHandlerName = flowStepHandler.Username
|
|
|
|
+ }).Where(o=>o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|
|
await _workflowDomainService.NextAsync(_sessionContext, nextDto, order.ExpiredTime, isAutoFillSummaryOpinion, cancellationToken);
|
|
await _workflowDomainService.NextAsync(_sessionContext, nextDto, order.ExpiredTime, isAutoFillSummaryOpinion, cancellationToken);
|
|
@@ -4248,11 +4255,13 @@ public class OrderController : BaseController
|
|
// .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
// .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
var (total, items) = await _orderRepository.Queryable()
|
|
|
|
+ .Includes(d=>d.Workflow.Steps)
|
|
.Where(d => SqlFunc.Subqueryable<WorkflowTrace>()
|
|
.Where(d => SqlFunc.Subqueryable<WorkflowTrace>()
|
|
.Where(step => step.ExternalId == d.Id &&
|
|
.Where(step => step.ExternalId == d.Id &&
|
|
step.HandlerOrgId == OrgSeedData.CenterId &&
|
|
step.HandlerOrgId == OrgSeedData.CenterId &&
|
|
- step.Status < EWorkflowStepStatus.Handled).Any() ||
|
|
|
|
- string.IsNullOrEmpty(d.WorkflowId)
|
|
|
|
|
|
+ step.Status < EWorkflowStepStatus.Handled)
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName),step=>step.BusinessType == EBusinessType.Send && step.HandlerName.Contains(dto.CenterToOrgHandlerName)).Any() ||
|
|
|
|
+ (string.IsNullOrEmpty(d.WorkflowId) && string.IsNullOrEmpty(dto.CenterToOrgHandlerName))
|
|
)
|
|
)
|
|
.Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
|
|
.Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
|
|
.Where(d => d.Status != EOrderStatus.BackToProvince && d.Status < EOrderStatus.Filed)
|
|
.Where(d => d.Status != EOrderStatus.BackToProvince && d.Status < EOrderStatus.Filed)
|
|
@@ -4268,7 +4277,7 @@ public class OrderController : BaseController
|
|
.WhereIF(dto.ExpiredStatus is EExpiredStatus.Normal, d => DateTime.Now < d.NearlyExpiredTime)
|
|
.WhereIF(dto.ExpiredStatus is EExpiredStatus.Normal, d => DateTime.Now < d.NearlyExpiredTime)
|
|
.WhereIF(dto.ExpiredStatus is EExpiredStatus.GoingToExpired, d => DateTime.Now > d.NearlyExpiredTime && DateTime.Now < d.ExpiredTime)
|
|
.WhereIF(dto.ExpiredStatus is EExpiredStatus.GoingToExpired, d => DateTime.Now > d.NearlyExpiredTime && DateTime.Now < d.ExpiredTime)
|
|
.WhereIF(dto.ExpiredStatus is EExpiredStatus.Expired, d => DateTime.Now >= d.ExpiredTime)
|
|
.WhereIF(dto.ExpiredStatus is EExpiredStatus.Expired, d => DateTime.Now >= d.ExpiredTime)
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName == dto.CenterToOrgHandlerName)
|
|
|
|
|
|
+ //.WhereIF(!string.IsNullOrEmpty(dto.CenterToOrgHandlerName), d => d.CenterToOrgHandlerName.Contains(dto.CenterToOrgHandlerName))
|
|
.WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent!.Value)
|
|
.WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent!.Value)
|
|
.OrderBy(d => d.Status)
|
|
.OrderBy(d => d.Status)
|
|
.OrderByIF(string.IsNullOrEmpty(dto.SortField), d => d.CreationTime, OrderByType.Desc)
|
|
.OrderByIF(string.IsNullOrEmpty(dto.SortField), d => d.CreationTime, OrderByType.Desc)
|
|
@@ -4465,7 +4474,12 @@ public class OrderController : BaseController
|
|
audit.State = ESendBackAuditState.End;
|
|
audit.State = ESendBackAuditState.End;
|
|
audit.AuditUser = "默认通过";
|
|
audit.AuditUser = "默认通过";
|
|
audit.AuditTime = DateTime.Now;
|
|
audit.AuditTime = DateTime.Now;
|
|
- var flowDirection = await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
+ if (prevStep.BusinessType == EBusinessType.Send)
|
|
|
|
+ {
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = dto.Handler.UserId, CenterToOrgHandlerName = dto.Handler.Username })
|
|
|
|
+ .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ var flowDirection = await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
var processType = flowDirection == EFlowDirection.OrgToCenter || flowDirection == EFlowDirection.CenterToCenter
|
|
var processType = flowDirection == EFlowDirection.OrgToCenter || flowDirection == EFlowDirection.CenterToCenter
|
|
? EProcessType.Zhiban
|
|
? EProcessType.Zhiban
|
|
: EProcessType.Jiaoban;
|
|
: EProcessType.Jiaoban;
|
|
@@ -4481,7 +4495,12 @@ public class OrderController : BaseController
|
|
audit.State = ESendBackAuditState.End;
|
|
audit.State = ESendBackAuditState.End;
|
|
audit.AuditUser = "默认通过";
|
|
audit.AuditUser = "默认通过";
|
|
audit.AuditTime = DateTime.Now;
|
|
audit.AuditTime = DateTime.Now;
|
|
- var flowDirection = await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
+ if (prevStep.BusinessType == EBusinessType.Send)
|
|
|
|
+ {
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = dto.Handler.UserId, CenterToOrgHandlerName = dto.Handler.Username })
|
|
|
|
+ .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ var flowDirection = await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
var processType = flowDirection == EFlowDirection.OrgToCenter || flowDirection == EFlowDirection.CenterToCenter
|
|
var processType = flowDirection == EFlowDirection.OrgToCenter || flowDirection == EFlowDirection.CenterToCenter
|
|
? EProcessType.Zhiban
|
|
? EProcessType.Zhiban
|
|
: EProcessType.Jiaoban;
|
|
: EProcessType.Jiaoban;
|
|
@@ -4489,8 +4508,9 @@ public class OrderController : BaseController
|
|
order.SendBackNum = order.SendBackNum.HasValue ? order.SendBackNum.Value + 1 : 1;
|
|
order.SendBackNum = order.SendBackNum.HasValue ? order.SendBackNum.Value + 1 : 1;
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ProcessType = processType, SendBackNum = order.SendBackNum })
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ProcessType = processType, SendBackNum = order.SendBackNum })
|
|
.Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
.Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
- //发送短信TODO
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ //发送短信TODO
|
|
|
|
+ }
|
|
|
|
|
|
await _orderSendBackAuditRepository.AddAsync(audit, HttpContext.RequestAborted);
|
|
await _orderSendBackAuditRepository.AddAsync(audit, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
@@ -4536,7 +4556,9 @@ public class OrderController : BaseController
|
|
var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
|
|
var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
|
|
sendBack.SendBackData.Handler = handler;
|
|
sendBack.SendBackData.Handler = handler;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = sendBack.SendBackData.Handler.UserId, CenterToOrgHandlerName = sendBack.SendBackData.Handler.Username })
|
|
|
|
+ .Where(o => o.Id == sendBack.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//string applicantId, string applicantOrgId, string[] applicantRoleIds,
|
|
//string applicantId, string applicantOrgId, string[] applicantRoleIds,
|
|
@@ -4554,8 +4576,8 @@ public class OrderController : BaseController
|
|
order.SendBackNum = order.SendBackNum.HasValue ? order.SendBackNum.Value + 1 : 1;
|
|
order.SendBackNum = order.SendBackNum.HasValue ? order.SendBackNum.Value + 1 : 1;
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ProcessType = processType, SendBackNum = order.SendBackNum })
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ProcessType = processType, SendBackNum = order.SendBackNum })
|
|
.Where(o => o.Id == sendBack.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
.Where(o => o.Id == sendBack.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
- //发送短信TODO
|
|
|
|
- }
|
|
|
|
|
|
+ //发送短信TODO
|
|
|
|
+ }
|
|
else
|
|
else
|
|
{
|
|
{
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { Status = sendBack.Status.Value })
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { Status = sendBack.Status.Value })
|
|
@@ -4606,7 +4628,9 @@ public class OrderController : BaseController
|
|
var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
|
|
var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
|
|
sendBack.SendBackData.Handler = handler;
|
|
sendBack.SendBackData.Handler = handler;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = sendBack.SendBackData.Handler.UserId, CenterToOrgHandlerName = sendBack.SendBackData.Handler.Username })
|
|
|
|
+ .Where(o => o.Id == sendBack.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
sendBack.SendBackData.ExpiredTime = order.ExpiredTime;
|
|
sendBack.SendBackData.ExpiredTime = order.ExpiredTime;
|
|
@@ -5071,8 +5095,11 @@ public class OrderController : BaseController
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
- //}
|
|
|
|
- await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Recall,
|
|
|
|
|
|
+ var flowStepHandler = recall.NextHandlers.FirstOrDefault();
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = flowStepHandler.UserId, CenterToOrgHandlerName = flowStepHandler.Username })
|
|
|
|
+ .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ //}
|
|
|
|
+ await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Recall,
|
|
HttpContext.RequestAborted);
|
|
HttpContext.RequestAborted);
|
|
|
|
|
|
if (order.Status >= EOrderStatus.Filed)
|
|
if (order.Status >= EOrderStatus.Filed)
|
|
@@ -5258,7 +5285,10 @@ public class OrderController : BaseController
|
|
var processType = dto.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
var processType = dto.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
|
|
? EProcessType.Zhiban
|
|
? EProcessType.Zhiban
|
|
: EProcessType.Jiaoban;
|
|
: EProcessType.Jiaoban;
|
|
- await _workflowApplication.RecallAsync(recall, endTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Redo,
|
|
|
|
|
|
+ var flowStepHandler = recall.NextHandlers.FirstOrDefault();
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = flowStepHandler.UserId, CenterToOrgHandlerName = flowStepHandler.Username })
|
|
|
|
+ .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ await _workflowApplication.RecallAsync(recall, endTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Redo,
|
|
HttpContext.RequestAborted);
|
|
HttpContext.RequestAborted);
|
|
//var publish = await _orderPublishRepository.GetAsync(x => x.OrderId == dto.OrderId);
|
|
//var publish = await _orderPublishRepository.GetAsync(x => x.OrderId == dto.OrderId);
|
|
//if (publish != null)
|
|
//if (publish != null)
|
|
@@ -5400,11 +5430,13 @@ public class OrderController : BaseController
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
- //}
|
|
|
|
|
|
+ //}
|
|
|
|
+ var flowStepHandler = recall.NextHandlers.FirstOrDefault();
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = flowStepHandler.UserId, CenterToOrgHandlerName = flowStepHandler.Username })
|
|
|
|
+ .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ //todo 特提重办,按审批通过时间依据中心派至部门的规则计算期满时间,更新order
|
|
|
|
|
|
- //todo 特提重办,按审批通过时间依据中心派至部门的规则计算期满时间,更新order
|
|
|
|
-
|
|
|
|
- await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Recall,
|
|
|
|
|
|
+ await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Recall,
|
|
HttpContext.RequestAborted);
|
|
HttpContext.RequestAborted);
|
|
if (order.Status >= EOrderStatus.Filed)
|
|
if (order.Status >= EOrderStatus.Filed)
|
|
{
|
|
{
|
|
@@ -5548,11 +5580,13 @@ public class OrderController : BaseController
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
var orderDto = _mapper.Map<OrderDto>(order);
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto,
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
- //}
|
|
|
|
-
|
|
|
|
- //todo 特提重办,按审批通过时间依据中心派至部门的规则计算期满时间,更新order
|
|
|
|
|
|
+ //}
|
|
|
|
+ var flowStepHandler = recall.NextHandlers.FirstOrDefault();
|
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { CenterToOrgHandlerId = flowStepHandler.UserId, CenterToOrgHandlerName = flowStepHandler.Username })
|
|
|
|
+ .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ //todo 特提重办,按审批通过时间依据中心派至部门的规则计算期满时间,更新order
|
|
|
|
|
|
- await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Recall,
|
|
|
|
|
|
+ await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, order.Status >= EOrderStatus.Filed, EWorkflowTraceType.Recall,
|
|
HttpContext.RequestAborted);
|
|
HttpContext.RequestAborted);
|
|
if (order.Status >= EOrderStatus.Filed)
|
|
if (order.Status >= EOrderStatus.Filed)
|
|
{
|
|
{
|
|
@@ -7518,7 +7552,13 @@ public class OrderController : BaseController
|
|
.SetColumns(o => new Orders.Order() { Status = status, SignerId = dto.Handler.UserId })
|
|
.SetColumns(o => new Orders.Order() { Status = status, SignerId = dto.Handler.UserId })
|
|
.Where(o => o.Id == dto.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
.Where(o => o.Id == dto.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+ //else if
|
|
|
|
+ //{
|
|
|
|
+ // await _orderRepository.Updateable()
|
|
|
|
+ // .SetColumns(o => new Orders.Order() { Status = status, CenterToOrgHandlerId = dto.Handler.UserId, CenterToOrgHandlerName = dto.Handler.Username })
|
|
|
|
+ // .Where(o => o.Id == dto.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
|
+ //}
|
|
|
|
+ else
|
|
{
|
|
{
|
|
await _orderRepository.Updateable()
|
|
await _orderRepository.Updateable()
|
|
.SetColumns(o => new Orders.Order() { Status = status })
|
|
.SetColumns(o => new Orders.Order() { Status = status })
|