|
@@ -2356,6 +2356,100 @@ public class OrderController : BaseController
|
|
|
return $"总共: {dto.DelayId.Length}, 成功: {success}, 失败: {fail}, 失败原因: {result.ToString()}";
|
|
|
}
|
|
|
|
|
|
+ public async Task<string> BatchAuditDelay1([FromBody] BatchDelayNextFlowDto dto)
|
|
|
+ {
|
|
|
+ var result = new StringBuilder();
|
|
|
+ var fail = 0;
|
|
|
+ var success = 0;
|
|
|
+ var workflowDto = dto.NextWorkflow;
|
|
|
+ foreach (var item in dto.DelayId)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var delay = await _orderDelayRepository.Queryable().Includes(x => x.Order).Where(x => x.Id == item)
|
|
|
+ .FirstAsync(HttpContext.RequestAborted);
|
|
|
+ workflowDto.WorkflowId = delay.WorkflowId;
|
|
|
+ var workflowEntuty = await _workflowDomainService.GetWorkflowAsync(workflowDto.WorkflowId, withDefine: true, withSteps: true,
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+ var currentStep = workflowEntuty.Steps.FirstOrDefault(d =>
|
|
|
+ d.Status == EWorkflowStepStatus.WaitForAccept || d.Status == EWorkflowStepStatus.WaitForHandle);
|
|
|
+
|
|
|
+ NextStepsWithOpinionDto<NextStepOption> next = null;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ next = await _workflowApplication.GetNextStepsAsync(delay.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException e)
|
|
|
+ {
|
|
|
+ if (e.Message.Contains("未找到对应节点"))
|
|
|
+ {
|
|
|
+ result.Append("无权审核:" + delay.No);
|
|
|
+ fail++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (next == null) continue;
|
|
|
+
|
|
|
+ if (!delay.Order.IsProvince)
|
|
|
+ {
|
|
|
+ if (next.Steps.Any(x => x.Value == "省审批"))
|
|
|
+ {
|
|
|
+ next.Steps.Remove(next.Steps.First(x => x.Value == "省审批"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!_sessionContext.OrgIsCenter && currentStep.Name != "中心初审")
|
|
|
+ {
|
|
|
+ if (next.Steps.Any(x => x.Value == "中心终审"))
|
|
|
+ {
|
|
|
+ next.Steps.Remove(next.Steps.First(x => x.Value == "中心终审"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ workflowDto.StepId = next.StepId;
|
|
|
+ workflowDto.ReviewResult = dto.IsPass ? EReviewResult.Approval : EReviewResult.Failed;
|
|
|
+
|
|
|
+ if (workflowDto.ReviewResult == EReviewResult.Approval)
|
|
|
+ {
|
|
|
+ var isBatch = next.Steps.Where(x => x.Value == workflowDto.NextStepName).Any();
|
|
|
+ if (isBatch)
|
|
|
+ {
|
|
|
+ var step = next.Steps.Where(x => x.Value == workflowDto.NextStepName).FirstOrDefault();
|
|
|
+ workflowDto.NextStepCode = step.Key;
|
|
|
+ workflowDto.NextStepName = step.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.Append("无权审核:" + delay.No);
|
|
|
+ fail++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ await _workflowDomainService.NextAsync(workflowDto, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var reject = workflowDto.Adapt<RejectDto>();
|
|
|
+ await _workflowApplication.RejectAsync(reject, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ success++;
|
|
|
+ }
|
|
|
+ catch (UserFriendlyException e)
|
|
|
+ {
|
|
|
+ result.Append(e.Message);
|
|
|
+ fail++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $"总共: {dto.DelayId.Length}, 成功: {success}, 失败: {fail}, 失败原因: {result.ToString()}";
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 延期查询流程办理下一步可选节点
|
|
|
/// </summary>
|
|
@@ -5506,16 +5600,7 @@ public class OrderController : BaseController
|
|
|
if (string.IsNullOrEmpty(order.WorkflowId))
|
|
|
throw UserFriendlyException.SameMessage("该工单未开启流程");
|
|
|
var dto = await _workflowApplication.GetNextStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
|
|
|
- //var isAqyh = false;//行业类型是否为随手拍安全隐患
|
|
|
- //if (isSnapshotEnable)
|
|
|
- //{
|
|
|
- // var orderSnapShot = await _orderSnapshotRepository.GetAsync(orderId, HttpContext.RequestAborted);
|
|
|
- // isAqyh = orderSnapShot != null && string.CompareOrdinal(orderSnapShot.IndustryName, "安全隐患") == 0;
|
|
|
- //}
|
|
|
- //if (!isAqyh)
|
|
|
- // dto.Steps = dto.Steps.Where(d => string.CompareOrdinal(d.Value, "网格员") != 0
|
|
|
- // && string.CompareOrdinal(d.Value, "工单标记") != 0).ToList();
|
|
|
-
|
|
|
+
|
|
|
dto.ExpiredTime = order.ExpiredTime;
|
|
|
dto.Content = order.Content;
|
|
|
var rsp = _mapper.Map<NextStepsWithOpinionDto<RecommendStepOption>>(dto);
|