|
@@ -3968,7 +3968,18 @@ public class OrderController : BaseController
|
|
|
Status = order.Status,
|
|
|
TraceId = currentStep.Id
|
|
|
};
|
|
|
- if (oneSendBack || twoSendBack)
|
|
|
+ if (_appOptions.Value.IsZiGong && prevStep.BusinessType == EBusinessType.Send)
|
|
|
+ {
|
|
|
+ // 平均派单
|
|
|
+ var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
|
|
|
+ if (averageSendOrder)
|
|
|
+ {
|
|
|
+ var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
|
|
|
+ dto.NextHandlers = new List<FlowStepHandler> { handler };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (oneSendBack || twoSendBack)
|
|
|
{
|
|
|
var sendBack = await _orderSendBackAuditRepository.Queryable()
|
|
|
.Where(x => x.OrderId == workflow.ExternalId && x.State == ESendBackAuditState.Apply).AnyAsync();
|
|
@@ -3979,7 +3990,15 @@ public class OrderController : BaseController
|
|
|
.AnyAsync();
|
|
|
if (specialAny) throw UserFriendlyException.SameMessage("工单已存在待审批特提信息!");
|
|
|
if (order.Workflow.IsInCountersign) throw UserFriendlyException.SameMessage("工单会签中,无法进行退回!");
|
|
|
- if ((oneSendBack && isOrgToCenter) || (twoSendBack && isSecondToFirstOrgLevel))
|
|
|
+ if (oneSendBack && isOrgToCenter && _appOptions.Value.IsZiGong)
|
|
|
+ {
|
|
|
+ if (order.SendBackAuditEndTime.HasValue && order.SendBackAuditEndTime.Value < DateTime.Now )
|
|
|
+ throw UserFriendlyException.SameMessage("工单截至退回时间【" + order.SendBackAuditEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss") + "】,无法进行退回!");
|
|
|
+ var sendBackAgain = await _orderSendBackAuditRepository.Queryable().Where(x => x.OrderId == workflow.ExternalId && x.IsReturnAgain == true).AnyAsync();
|
|
|
+ if (sendBackAgain)
|
|
|
+ throw UserFriendlyException.SameMessage("工单已不允许退回!");
|
|
|
+ }
|
|
|
+ if ((oneSendBack && isOrgToCenter) || (twoSendBack && isSecondToFirstOrgLevel))
|
|
|
{
|
|
|
|
|
|
await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { Status = EOrderStatus.SendBackAudit })
|
|
@@ -3991,7 +4010,7 @@ public class OrderController : BaseController
|
|
|
audit.AuditUser = "默认通过";
|
|
|
audit.AuditTime = DateTime.Now;
|
|
|
dto.ExpiredTime = order.ExpiredTime;
|
|
|
- var flowDirection = await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
+ var flowDirection = await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
var processType = flowDirection == EFlowDirection.OrgToCenter || flowDirection == EFlowDirection.CenterToCenter
|
|
|
? EProcessType.Zhiban
|
|
|
: EProcessType.Jiaoban;
|
|
@@ -5080,7 +5099,8 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
SpecialTimeType = EnumExts.GetDescriptions<ETimeType>(),
|
|
|
SpecialReason = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SpecialReason),
|
|
|
- Step = step,
|
|
|
+ InstaShotSpecialReason = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.InstaShotSpecialReason),
|
|
|
+ Step = step,
|
|
|
BaseTypeId = baseTypeId
|
|
|
};
|
|
|
return rsp;
|
|
@@ -5106,7 +5126,8 @@ public class OrderController : BaseController
|
|
|
SpecialTimeType = EnumExts.GetDescriptions<ETimeType>(),
|
|
|
SpecialReason = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SpecialReason),
|
|
|
ReTransactErrorType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.ReTransactErrorType),
|
|
|
- Step = step,
|
|
|
+ InstaShotSpecialReason = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.InstaShotSpecialReason),
|
|
|
+ Step = step,
|
|
|
Orgs = orgs,
|
|
|
};
|
|
|
return rsp;
|