|
@@ -1648,9 +1648,9 @@ public class OrderController : BaseController
|
|
|
.Includes(x => x.OrderVisit)
|
|
|
.Includes(x => x.OrderVisit, y => y.Order)
|
|
|
.Includes(x => x.OrderVisit, y => y.Employee)
|
|
|
- .LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.IsDeleted == false)
|
|
|
- //&& s.Status < EScreenStatus.End
|
|
|
- .Where((x, s) => s.Id == null)
|
|
|
+ .LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.IsDeleted == false)
|
|
|
+ .WhereIF(dto.ScreenSendBack is 1, (x, s) => s.Status == EScreenStatus.SendBack && s.SendBackApply == true)
|
|
|
+ .WhereIF(dto.ScreenSendBack is 2, (x, s) => (s.Status != EScreenStatus.SendBack && s.SendBackApply != true) || s.Id == null )
|
|
|
.WhereIF(dto.IsHomePage.HasValue && dto.IsHomePage == true,
|
|
|
x => x.OrderVisit.VisitTime < dto.CreationTimeEnd && x.OrderVisit.VisitTime > dto.CreationTimeStart)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderVisit.Order!.No!.Contains(dto.No!))
|
|
@@ -1832,7 +1832,8 @@ public class OrderController : BaseController
|
|
|
_mapper.Map(dto.Data, screen);
|
|
|
if (dto.Data.Files.Any())
|
|
|
screen.FileJson = await _fileRepository.AddFileAsync(dto.Data.Files, screen.Id, "", HttpContext.RequestAborted);
|
|
|
- await _orderScreenRepository.UpdateAsync(screen, HttpContext.RequestAborted);
|
|
|
+ screen.SendBackApplyNum++;
|
|
|
+ await _orderScreenRepository.UpdateAsync(screen, HttpContext.RequestAborted);
|
|
|
try
|
|
|
{
|
|
|
dto.NextWorkflow.WorkflowId = screen.WorkflowId;
|
|
@@ -1853,18 +1854,14 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
var workflow = await _workflowDomainService.GetWorkflowAsync(dto.WorkflowId, withSteps: true,
|
|
|
cancellationToken: HttpContext.RequestAborted);
|
|
|
- if (workflow.Steps.Count > 2)
|
|
|
- {
|
|
|
- await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
- else {
|
|
|
- TerminateDto terDto = new TerminateDto
|
|
|
- {
|
|
|
- WorkflowId = dto.WorkflowId,
|
|
|
- Opinion = "退回申请人"
|
|
|
- };
|
|
|
- await _workflowDomainService.TerminateAsync(terDto, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
+ var screen = await _orderScreenRepository.Queryable().Where(x => x.WorkflowId == dto.WorkflowId).FirstAsync();
|
|
|
+ if (screen == null)
|
|
|
+ throw UserFriendlyException.SameMessage("甄别信息错误!");
|
|
|
+ screen.SendBackApply = workflow.Steps.Count <= 2;
|
|
|
+ await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
+ screen.Status = EScreenStatus.SendBack;
|
|
|
+ screen.SendBackNum++;
|
|
|
+ await _orderScreenRepository.UpdateAsync(screen, HttpContext.RequestAborted);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 查询工单甄别流程开启参数
|