|
@@ -113,10 +113,24 @@ namespace Hotline.Application.Subscribers
|
|
|
await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
if (dto.Result is 1)
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(order.WorkflowId))
|
|
|
+ var current = SessionContextCreator.CreateSessionContext(dto.Source);
|
|
|
+ if (string.IsNullOrEmpty(order.WorkflowId))
|
|
|
{
|
|
|
- var current = SessionContextCreator.CreateSessionContext(dto.Source);
|
|
|
- await _workflowApplication.HandleToEndAsync(current, order.WorkflowId, "省工单同意退回", null, EReviewResult.Approval, cancellationToken);
|
|
|
+ var startDto = new StartWorkflowDto
|
|
|
+ {
|
|
|
+ DefinitionModuleCode = WorkflowModuleConsts.OrderHandle,
|
|
|
+ Title = order.Title,
|
|
|
+ Opinion = dto.Reason ?? "省工单同意退回",
|
|
|
+ };
|
|
|
+ await _workflowApplication.StartToEndAsync(startDto, current, order.Id, order.ExpiredTime,
|
|
|
+ cancellationToken);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //await _workflowApplication.HandleToEndAsync(current, order.WorkflowId, "省工单同意退回", null,
|
|
|
+ // EReviewResult.Approval, cancellationToken);
|
|
|
+ await _workflowApplication.JumpToEndAsync(current, order.WorkflowId, dto.Reason ?? "省工单同意退回",
|
|
|
+ null, cancellationToken: cancellationToken);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -146,7 +160,9 @@ namespace Hotline.Application.Subscribers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- await _workflowApplication.HandleToEndAsync(current, order.WorkflowId, dto.Opinion, null,
|
|
|
+ //await _workflowApplication.HandleToEndAsync(current, order.WorkflowId, dto.Opinion, null,
|
|
|
+ // cancellationToken: cancellationToken);
|
|
|
+ await _workflowApplication.JumpToEndAsync(current, order.WorkflowId, dto.Opinion, null,
|
|
|
cancellationToken: cancellationToken);
|
|
|
}
|
|
|
}
|
|
@@ -318,7 +334,8 @@ namespace Hotline.Application.Subscribers
|
|
|
Kv orgProcessingResults = null;
|
|
|
if (!string.IsNullOrEmpty(processingResult))
|
|
|
{
|
|
|
- var dicData = await _systemDicDataRepository.GetAsync(x => x.DicTypeCode == SysDicTypeConsts.VisitSatisfaction && x.DicDataValue == processingResult, cancellationToken);
|
|
|
+ var dicData = await _systemDicDataRepository.GetAsync(x => x.DicTypeCode == SysDicTypeConsts.VisitSatisfaction &&
|
|
|
+ x.DicDataValue == processingResult, cancellationToken);
|
|
|
if (dicData != null)
|
|
|
{
|
|
|
orgProcessingResults = new Kv();
|
|
@@ -331,7 +348,7 @@ namespace Hotline.Application.Subscribers
|
|
|
orderVisit.VisitState = Share.Enums.Order.EVisitState.Visited;
|
|
|
orderVisit.VisitTime = dto.VisitTime;
|
|
|
orderVisit.VisitType = dto.VisitType;
|
|
|
- orderVisit.IsCanHandle = false;
|
|
|
+ orderVisit.IsCanHandle = orgProcessingResults.Key == "2";
|
|
|
orderVisit.IsCanAiVisit = false;
|
|
|
orderVisit.NowEvaluate = orgProcessingResults;
|
|
|
await _orderVisitRepository.UpdateAsync(orderVisit, cancellationToken);
|
|
@@ -518,7 +535,10 @@ namespace Hotline.Application.Subscribers
|
|
|
var orderDelay = await _orderDelayRepository.GetAsync(x => x.OrderId == order.Id && x.DelayState == EDelayState.Examining, cancellationToken);
|
|
|
var current = SessionContextCreator.CreateSessionContext(dto.Source);
|
|
|
await _workflowApplication.HandleToEndAsync(current, orderDelay.WorkflowId, dto.Opinion, dto.Files,
|
|
|
- dto.IsPass ? Share.Enums.FlowEngine.EReviewResult.Approval : Share.Enums.FlowEngine.EReviewResult.Failed, cancellationToken);
|
|
|
+ dto.IsPass ? EReviewResult.Approval : EReviewResult.Failed, cancellationToken);
|
|
|
+
|
|
|
+ //await _workflowApplication.JumpToEndAsync(current, orderDelay.WorkflowId, dto.Opinion, dto.Files,
|
|
|
+ // dto.IsPass ? EReviewResult.Approval : EReviewResult.Failed, cancellationToken);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -534,12 +554,12 @@ namespace Hotline.Application.Subscribers
|
|
|
if (string.IsNullOrEmpty(order.WorkflowId))
|
|
|
throw new UserFriendlyException($"该工单未开启流程,orderId: {dto.OrderId}");
|
|
|
|
|
|
- if (dto.Files != null && dto.Files.Any())
|
|
|
- {
|
|
|
- order.FileJson = await _fileRepository.AddFileAsync(dto.Files, order.Id, order.WorkflowId,
|
|
|
- cancellationToken);
|
|
|
- await _orderRepository.FileAsync(order, cancellationToken);
|
|
|
- }
|
|
|
+ //if (dto.Files != null && dto.Files.Any())
|
|
|
+ //{
|
|
|
+ // order.FileJson = await _fileRepository.AddFileAsync(dto.Files, order.Id, order.WorkflowId,
|
|
|
+ // cancellationToken);
|
|
|
+ // await _orderRepository.FileAsync(order, cancellationToken);
|
|
|
+ //}
|
|
|
|
|
|
var current = SessionContextCreator.CreateSessionContext(dto.Source);
|
|
|
switch (dto.FinishType)
|