|
@@ -1175,12 +1175,37 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
|
- /// 延期列表
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- //[Permission(EPermission.DelayList)]
|
|
|
- [HttpGet("delay")]
|
|
|
+ /// 工单延期修改后下一步流程
|
|
|
+ /// </summary>
|
|
|
+ [HttpPost("delay/initial_nextFlow")]
|
|
|
+ [LogFilter("开始工单延期流程")]
|
|
|
+ public async Task InitialNextFlow([FromBody] DelayNextFlowDto dto)
|
|
|
+ {
|
|
|
+ var delay = await _orderDelayRepository.GetAsync(dto.Data.Id);
|
|
|
+ _mapper.Map(dto.Data, delay);
|
|
|
+ if (dto.Data.Files.Any())
|
|
|
+ delay.FileJson = await _fileRepository.AddFileAsync(dto.Data.Files, delay.Id, "", HttpContext.RequestAborted);
|
|
|
+ await _orderDelayRepository.UpdateAsync(delay, HttpContext.RequestAborted);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ dto.NextWorkflow.WorkflowId = delay.WorkflowId;
|
|
|
+ await _workflowApplication.NextAsync(dto.NextWorkflow,
|
|
|
+ cancellationToken: HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ throw new UserFriendlyException($"工单延期下一步流程失败!, {e.Message}", "工单延期下一步流程失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 延期列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ //[Permission(EPermission.DelayList)]
|
|
|
+ [HttpGet("delay")]
|
|
|
public async Task<PagedDto<OrderDelayDto>> DelayList([FromQuery] DelayListDto dto)
|
|
|
{
|
|
|
var (total, items) = await _orderDelayRepository.Queryable(viewFilter: false)
|
|
@@ -1234,7 +1259,8 @@ public class OrderController : BaseController
|
|
|
.FirstAsync(x => x.Id == id);
|
|
|
var rspModel = _mapper.Map<OrderDelayDto>(model);
|
|
|
rspModel.IsCanHandle = model.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
|
- if (rspModel.FileJson != null && rspModel.FileJson.Any())
|
|
|
+ rspModel.Handle = await _workflowDomainService.CheckCurrentIsStartStepAsync(rspModel.WorkflowId, _sessionContext.RequiredUserId, _sessionContext.RequiredOrgId, HttpContext.RequestAborted);
|
|
|
+ if (rspModel.FileJson != null && rspModel.FileJson.Any())
|
|
|
{
|
|
|
var ids = rspModel.FileJson.Select(x => x.Id).ToList();
|
|
|
rspModel.Files = await _fileRepository.GetFilesAsync(ids, HttpContext.RequestAborted);
|
|
@@ -1339,7 +1365,10 @@ public class OrderController : BaseController
|
|
|
[HttpGet("screen")]
|
|
|
public async Task<PagedDto<OrderScreenListDto>> ScreenList([FromQuery] ScreenListDto dto)
|
|
|
{
|
|
|
- var query = _orderScreenRepository.Queryable(viewFilter: false)
|
|
|
+ var view = dto.source == 1;
|
|
|
+ var handler = dto.source == 1 && dto.Status is EScreenStatus.Apply;
|
|
|
+
|
|
|
+ var query = _orderScreenRepository.Queryable(viewFilter: view, handlerFilter: handler)
|
|
|
.Includes(x => x.Order)
|
|
|
.Includes(x => x.VisitDetail)
|
|
|
.Includes(x => x.Visit, d => d.Order)
|
|
@@ -1348,21 +1377,11 @@ public class OrderController : BaseController
|
|
|
x => x.Visit.Order.Title.Contains(dto.Keyword!) || x.Visit.Order.No.Contains(dto.Keyword!));
|
|
|
if (dto.Status is EScreenStatus.Apply)
|
|
|
{
|
|
|
- query.Where(x => (x.Status == EScreenStatus.Apply || x.Status == EScreenStatus.Approval)
|
|
|
- && ((SqlFunc.JsonArrayLength(x.Workflow.HandlerUsers) > 0
|
|
|
- && SqlFunc.JsonListObjectAny(x.Workflow.HandlerUsers, "Key", _sessionContext.RequiredUserId))
|
|
|
- || (SqlFunc.JsonArrayLength(x.Workflow.HandlerUsers) == 0
|
|
|
- && SqlFunc.JsonListObjectAny(x.Workflow.HandlerOrgs, "Key",
|
|
|
- _sessionContext.RequiredOrgId))));
|
|
|
+ query.Where(x => (x.Status == EScreenStatus.Apply || x.Status == EScreenStatus.Approval));
|
|
|
}
|
|
|
if (dto.Status.HasValue && dto.Status == EScreenStatus.MyHandle)
|
|
|
{
|
|
|
- query.Where(x => (x.Status != EScreenStatus.Apply)
|
|
|
- && ((SqlFunc.JsonArrayLength(x.Workflow.HandlerUsers) > 0
|
|
|
- && SqlFunc.JsonListObjectAny(x.Workflow.HandlerUsers, "Key", _sessionContext.RequiredUserId))
|
|
|
- || (SqlFunc.JsonArrayLength(x.Workflow.HandlerUsers) == 0
|
|
|
- && SqlFunc.JsonListObjectAny(x.Workflow.HandlerOrgs, "Key",
|
|
|
- _sessionContext.RequiredOrgId))));
|
|
|
+ query.Where(x => (x.Status != EScreenStatus.Apply));
|
|
|
}
|
|
|
var (total, items) = await query
|
|
|
//.WhereIF(dto.Status.HasValue && dto.Status == EScreenStatus.MyHandle,
|
|
@@ -1376,10 +1395,10 @@ public class OrderController : BaseController
|
|
|
}
|
|
|
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 开始工单甄别流程
|
|
|
- /// </summary>
|
|
|
- [Permission(EPermission.ApplyScreen)]
|
|
|
+ /// <summary>
|
|
|
+ /// 开始工单甄别流程
|
|
|
+ /// </summary>
|
|
|
+ [Permission(EPermission.ApplyScreen)]
|
|
|
[HttpPost("screen/startflow")]
|
|
|
[LogFilter("开始工单甄别流程")]
|
|
|
public async Task StartFlow([FromBody] ScreenStartFlowDto dto)
|