|
@@ -2843,7 +2843,11 @@ public class OrderController : BaseController
|
|
|
if (sendBack)
|
|
|
throw UserFriendlyException.SameMessage("当前工单已经生成退回记录");
|
|
|
|
|
|
- var order = await _orderRepository
|
|
|
+ var specialAny = await _orderSpecialRepository.Queryable().Where(x => x.OrderId == dto.OrderId && x.State == 0)
|
|
|
+ .AnyAsync();
|
|
|
+ if (specialAny) throw UserFriendlyException.SameMessage("工单已存在待审批特提信息!");
|
|
|
+
|
|
|
+ var order = await _orderRepository
|
|
|
.Queryable()
|
|
|
.Includes(d => d.Workflow)
|
|
|
.FirstAsync(d => d.Id == workflow.ExternalId);
|
|
@@ -3143,7 +3147,12 @@ public class OrderController : BaseController
|
|
|
var screen = await _orderScreenRepository.Queryable().Where(x => x.OrderId == dto.OrderId && (int)x.Status < 2).AnyAsync();
|
|
|
if (screen) throw UserFriendlyException.SameMessage("工单存在甄别中的信息!");
|
|
|
|
|
|
- var order = await _orderRepository
|
|
|
+ if (await _orderSendBackAuditRepository.AnyAsync(x => x.OrderId == dto.OrderId && x.State == ESendBackAuditState.Apply, HttpContext.RequestAborted))
|
|
|
+ {
|
|
|
+ throw UserFriendlyException.SameMessage("该工单存在正在审核中的退回,不能办理");
|
|
|
+ }
|
|
|
+
|
|
|
+ var order = await _orderRepository
|
|
|
.Queryable()
|
|
|
.Includes(d => d.Workflow)
|
|
|
.FirstAsync(d => d.Id == dto.OrderId);
|
|
@@ -3259,6 +3268,11 @@ public class OrderController : BaseController
|
|
|
var screen = await _orderScreenRepository.Queryable().Where(x => x.OrderId == dto.OrderId && (int)x.Status < 2).AnyAsync();
|
|
|
if (screen) throw UserFriendlyException.SameMessage("工单存在甄别中的信息!");
|
|
|
|
|
|
+ if (await _orderSendBackAuditRepository.AnyAsync(x => x.OrderId == dto.OrderId && x.State == ESendBackAuditState.Apply, HttpContext.RequestAborted))
|
|
|
+ {
|
|
|
+ throw UserFriendlyException.SameMessage("该工单存在正在审核中的退回,不能办理");
|
|
|
+ }
|
|
|
+
|
|
|
var order = await _orderRepository
|
|
|
.Queryable()
|
|
|
.Includes(d => d.Workflow)
|
|
@@ -3336,7 +3350,7 @@ public class OrderController : BaseController
|
|
|
.FirstAsync(d => d.Id == dto.Id);
|
|
|
if (special is null) throw UserFriendlyException.SameMessage("无效特提审批信息!");
|
|
|
if (special.State != 0) throw UserFriendlyException.SameMessage("无效特提审批信息,特提审批信息错误,该信息已审核!");
|
|
|
- if (string.IsNullOrEmpty(dto.NextStepName)) dto.NextStepName = special.NextStepName;
|
|
|
+ if (string.IsNullOrEmpty(dto.NextStepName)) dto.NextStepName = special.NextStepName;
|
|
|
if (string.IsNullOrEmpty(dto.NextStepCode)) dto.NextStepCode = special.NextStepCode;
|
|
|
if (dto.NextHandlers.Count <= 0) dto.NextHandlers = special.NextHandlers;
|
|
|
_mapper.Map(dto, special);
|