|
@@ -7,6 +7,7 @@ using Hotline.Push;
|
|
|
using Hotline.Push.Notifies;
|
|
|
using Hotline.SeedData;
|
|
|
using Hotline.Settings;
|
|
|
+using Hotline.Settings.TimeLimitDomain;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Dtos.Push;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
@@ -35,6 +36,7 @@ namespace Hotline.Application.Subscribers
|
|
|
private readonly IOrderApplication _orderApplication;
|
|
|
private readonly IRepository<OrderDelay> _orderDelayRepository;
|
|
|
private readonly IWorkflowDomainService _workflowDomainService;
|
|
|
+ private readonly ICalcExpireTime _expireTime;
|
|
|
|
|
|
public InternalCapSubscriber(
|
|
|
IOrderRepository orderRepository,
|
|
@@ -45,7 +47,8 @@ namespace Hotline.Application.Subscribers
|
|
|
ISystemSettingCacheManager systemSettingCacheManager,
|
|
|
IOrderApplication orderApplication,
|
|
|
IRepository<OrderDelay> orderDelayRepository,
|
|
|
- IWorkflowDomainService workflowDomainService
|
|
|
+ IWorkflowDomainService workflowDomainService,
|
|
|
+ ICalcExpireTime expireTime
|
|
|
)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
@@ -57,6 +60,7 @@ namespace Hotline.Application.Subscribers
|
|
|
_orderApplication = orderApplication;
|
|
|
_orderDelayRepository = orderDelayRepository;
|
|
|
_workflowDomainService = workflowDomainService;
|
|
|
+ _expireTime = expireTime;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -258,9 +262,11 @@ namespace Hotline.Application.Subscribers
|
|
|
delay.EmployeeName = "系统自动延期";
|
|
|
delay.ApplyOrgName = OrgSeedData.CenterName;
|
|
|
delay.ApplyOrgCode = OrgSeedData.CenterId;
|
|
|
+ delay.CreatorOrgName = OrgSeedData.CenterName;
|
|
|
delay.DelayApplyType = EDelayApplyType.LocalApply;
|
|
|
delay.BeforeDelay = order.ExpiredTime;
|
|
|
delay.DelayState = EDelayState.Pass;
|
|
|
+ delay.CreatorName = "系统自动延期";
|
|
|
delay.DelayReason = "系统自动延期";
|
|
|
delay.ApplyDelayTime = DateTime.Now;
|
|
|
delay.No = order.No;
|
|
@@ -268,6 +274,11 @@ namespace Hotline.Application.Subscribers
|
|
|
delay.DelayNum = 1;
|
|
|
delay.DelayUnit = Share.Enums.Settings.ETimeType.WorkDay;
|
|
|
delay.IsProDelay = false;
|
|
|
+ if (delay.BeforeDelay != null)
|
|
|
+ {
|
|
|
+ delay.AfterDelay = (await _expireTime
|
|
|
+ .CalcEndTime(delay.BeforeDelay.Value, delay.DelayUnit, delay.DelayNum, order.AcceptTypeCode))?.EndTime; //todo
|
|
|
+ }
|
|
|
await _orderDelayRepository.AddAsync(delay, cancellationToken);
|
|
|
}
|
|
|
//处理工单延期
|