Forráskód Böngészése

省工单延期通过更新工单期满时间

xf 1 éve
szülő
commit
39cfedb75d

+ 4 - 9
src/Hotline.Api/Controllers/OrderController.cs

@@ -1719,9 +1719,7 @@ public class OrderController : BaseController
     public async Task<PagedDto<OrderDto>> Query([FromQuery] QueryOrderDto dto)
     {
         var (total, items) = await _orderRepository.Queryable(workflowFilter: false)
-            .Includes(d => d.OrderDelays)
-            .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
-                d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
+            .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.Contains(dto.Keyword!) || d.No.Contains(dto.Keyword!))
             .WhereIF(!string.IsNullOrEmpty(dto.Content), d => d.Content.Contains(dto.Content!))
             .WhereIF(dto.AcceptTypes.Any(), d => dto.AcceptTypes.Contains(d.AcceptType))
             .WhereIF(dto.Channels.Any(), d => dto.Channels.Contains(d.SourceChannel))
@@ -1729,19 +1727,16 @@ public class OrderController : BaseController
             .WhereIF(!string.IsNullOrEmpty(dto.TransferPhone), d => d.TransferPhone.Contains(dto.TransferPhone!))
             //.WhereIF(dto.OrgCodes.Any(), d => d.Workflow.Assigns.Any(s => dto.OrgCodes.Contains(s.OrgCode)))
             .WhereIF(dto.OrgCodes.Any(), d => dto.OrgCodes.Contains(d.Workflow.ActualHandleOrgCode))
-            .WhereIF(!string.IsNullOrEmpty(dto.NameOrNo),
-                d => d.AcceptorName.Contains(dto.NameOrNo!) || d.AcceptorStaffNo.Contains(dto.NameOrNo!))
+            .WhereIF(!string.IsNullOrEmpty(dto.NameOrNo), d => d.AcceptorName.Contains(dto.NameOrNo!) || d.AcceptorStaffNo.Contains(dto.NameOrNo!))
             .WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
             .WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
             .WhereIF(dto.EmergencyLevels.Any(), d => dto.EmergencyLevels.Contains(d.EmergencyLevel))
-            .WhereIF(!string.IsNullOrEmpty(dto.PhoneNo),
-                d => d.FromPhone.Contains(dto.PhoneNo!) || d.Contact.Contains(dto.PhoneNo!))
+            .WhereIF(!string.IsNullOrEmpty(dto.PhoneNo), d => d.FromPhone.Contains(dto.PhoneNo!) || d.Contact.Contains(dto.PhoneNo!))
             .WhereIF(!string.IsNullOrEmpty(dto.PushTypeCode), d => d.PushTypeCode == dto.PushTypeCode)
             .WhereIF(dto.ExpiredTimeStart.HasValue, d => d.ExpiredTime >= dto.ExpiredTimeStart)
             .WhereIF(dto.ExpiredTimeEnd.HasValue, d => d.ExpiredTime <= dto.ExpiredTimeEnd)
             .WhereIF(dto.Statuses.Any(), d => dto.Statuses.Contains(d.Status))
-            .WhereIF(dto.Statuses.Any(d => d == EOrderStatus.BackToUnAccept),
-                d => d.Status <= EOrderStatus.BackToUnAccept)
+            .WhereIF(dto.Statuses.Any(d => d == EOrderStatus.BackToUnAccept), d => d.Status <= EOrderStatus.BackToUnAccept)
             .OrderByDescending(d => d.CreationTime)
             .ToPagedListAsync(dto, HttpContext.RequestAborted);
 

+ 9 - 0
src/Hotline.Application/FlowEngine/WorkflowApplication.cs

@@ -1132,6 +1132,15 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
                 }
             }
         }
+        /*
+         * if 汇总节点
+         *  t:if top
+         *      t:
+         *      f:
+         *  f:if 回到汇总还是继续往下办
+         *      t:
+         *      f:
+         */
 
         if (currentStep.InstanceMode is EInstanceMode.Dynamic &&
             !DynamicShouldTerminal(currentStepDefine, _sessionContext.OrgLevel))

+ 7 - 0
src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs

@@ -1,4 +1,5 @@
 using DotNetCore.CAP;
+using Hotline.Application.Orders;
 using Hotline.Article;
 using Hotline.CallCenter.Tels;
 using Hotline.DataSharing.Province.Services;
@@ -14,6 +15,7 @@ using Hotline.Share.Dtos.Article;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.Order;
+using Hotline.Share.Enums.Settings;
 using Hotline.Share.Mq;
 using MapsterMapper;
 using MediatR;
@@ -29,6 +31,7 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
 
     private readonly IKnowledgeDomainService _knowledgeDomainService;
     private readonly IOrderDomainService _orderDomainService;
+    private readonly IOrderApplication _orderApplication;
     private readonly ITelDomainService _telDomainService;
     private readonly IOrderRepository _orderRepository;
     private readonly IProvinceService _provinceService;
@@ -50,6 +53,7 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
     public WorkflowEndHandler(
         IKnowledgeDomainService knowledgeDomainService,
         IOrderDomainService orderDomainService,
+        IOrderApplication orderApplication,
         ITelDomainService telDomainService,
         IOrderRepository orderRepository,
         IProvinceService provinceService,
@@ -70,6 +74,7 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
     {
         _knowledgeDomainService = knowledgeDomainService;
         _orderDomainService = orderDomainService;
+        _orderApplication = orderApplication;
         _telDomainService = telDomainService;
         _orderRepository = orderRepository;
         _provinceService = provinceService;
@@ -224,6 +229,8 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
                         await _orderDelayRepository.UpdateAsync(delay, cancellationToken);
 
                         //处理工单延期TODO
+                        await _orderApplication.DelayOrderExpiredTimeAsync(delay.OrderId, delay.DelayNum,
+                            delay.DelayUnit, cancellationToken);
                     }
                     else
                     {

+ 70 - 72
src/Hotline.Application/Handlers/FlowEngine/WorkflowNextHandler.cs

@@ -85,13 +85,12 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
         var workflow = notification.Workflow;
         var data = notification.Dto;
 
-        DefinitionTag? currentTag = null;
-        if (!string.IsNullOrEmpty(notification.Trace.Tag))
-            currentTag = System.Text.Json.JsonSerializer.Deserialize<DefinitionTag>(notification.Trace.Tag);
-        DefinitionTag? nextTag = null;
-        if (!string.IsNullOrEmpty(notification.NextStepDefine.Tag))
-            nextTag = System.Text.Json.JsonSerializer.Deserialize<DefinitionTag>(notification.NextStepDefine.Tag);
-
+        var currentTag = string.IsNullOrEmpty(notification.Trace.Tag)
+            ? null
+            : System.Text.Json.JsonSerializer.Deserialize<DefinitionTag>(notification.Trace.Tag);
+        var nextTag = string.IsNullOrEmpty(notification.NextStepDefine.Tag)
+            ? null
+            : System.Text.Json.JsonSerializer.Deserialize<DefinitionTag>(notification.NextStepDefine.Tag);
 
         switch (workflow.ModuleCode)
         {
@@ -101,30 +100,35 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
                 _mapper.Map(workflow, order);
 
                 var expiredTimeChanged = false;
-                if (data.FlowDirection.HasValue && data.External.TimeLimit.HasValue &&
-                    data.External.TimeLimitUnit.HasValue)
+                if (data.FlowDirection.HasValue
+                    && data.External.TimeLimit.HasValue
+                    && data.External.TimeLimitUnit.HasValue)
                 {
                     // 1. calc expiredTime 2. update order.expiredTime 3. update workflow.expiredTime 4. publish province
 
-                    var expiredTime = _timeLimitDomainService.CalcEndTime(DateTime.Now,
-                        data.External.TimeLimitUnit.Value,
-                        data.External.TimeLimit.Value, data.FlowDirection is EFlowDirection.OrgToCenter);
+                    // var expiredTime = _timeLimitDomainService.CalcEndTime(DateTime.Now,
+                    //     data.External.TimeLimitUnit.Value,
+                    //     data.External.TimeLimit.Value, data.FlowDirection is EFlowDirection.OrgToCenter);
+
+                    var expiredTimeConfig = _timeLimitDomainService.CalcEndTime(DateTime.Now,
+                        new TimeConfig(data.External.TimeLimit.Value, data.External.TimeLimitUnit.Value));
 
                     if (data.FlowDirection is EFlowDirection.OrgToCenter)
                     {
-                        order.OrgToCenter(expiredTime.EndTime);
+                        order.OrgToCenter(expiredTimeConfig.TimeText, expiredTimeConfig.Count,
+                            expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime);
                     }
                     else if (data.FlowDirection is EFlowDirection.CenterToOrg)
                     {
-                        order.CenterToOrg(expiredTime.EndTime);
+                        order.CenterToOrg(expiredTimeConfig.TimeText, expiredTimeConfig.Count,
+                            expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime);
                         //写入质检
                         await _qualityApplication.AddQualityAsync(EQualitySource.Send, order.Id, cancellationToken);
                     }
 
-                    await _workflowDomainService.UpdateExpiredTimeAsync(workflow, expiredTime.EndTime,
-                        expiredTime.RuleStr, data.External.TimeLimit, data.External.TimeLimitUnit,
-                        order.CenterToOrgTime,
-                        cancellationToken);
+                    await _workflowDomainService.UpdateExpiredTimeAsync(workflow,
+                        expiredTimeConfig.ExpiredTime, expiredTimeConfig.TimeText,
+                        expiredTimeConfig.Count, expiredTimeConfig.TimeType, cancellationToken);
 
                     expiredTimeChanged = true;
                 }
@@ -169,77 +173,71 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
                     await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
                 }
 
-                if (nextTag is not null)
+                if (nextTag is not null && nextTag.Type == TagDefaults.TagType.Org)
                 {
-                    if (nextTag.Type == TagDefaults.TagType.Org)
+                    switch (nextTag.Value)
                     {
-                        switch (nextTag.Value)
-                        {
-                            case TagDefaults.TagValue.Province:
-                                if (screen != null)
+                        case TagDefaults.TagValue.Province:
+                            if (screen != null)
+                            {
+                                var screenDto = _mapper.Map<OrderScreenListDto>(screen);
+                                if (screen.Order != null && screen.Order.Source == ESource.ProvinceStraight)
                                 {
-                                    var screenDto = _mapper.Map<OrderScreenListDto>(screen);
-                                    if (screen.Order != null && screen.Order.Source == ESource.ProvinceStraight)
+                                    var screenOrderDto = _mapper.Map<OrderDto>(screen.Order);
+                                    //推省上
+                                    //_capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+                                    //{
+                                    //    Order = screenOrderDto,
+                                    //    Screen = screenDto,
+                                    //    ClientGuid = ""
+                                    //});
+                                    try
                                     {
-                                        var screenOrderDto = _mapper.Map<OrderDto>(screen.Order);
-                                        //推省上
-                                        //_capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
-                                        //{
-                                        //    Order = screenOrderDto,
-                                        //    Screen = screenDto,
-                                        //    ClientGuid = ""
-                                        //});
-                                        try
-                                        {
-                                            await _provinceService.ScreenCaseInfoSend(new PublishScreenDto()
-                                            {
-                                                Order = screenOrderDto,
-                                                Screen = screenDto,
-                                                ClientGuid = ""
-                                            }, cancellationToken);
-                                        }
-                                        catch (Exception e)
+                                        await _provinceService.ScreenCaseInfoSend(new PublishScreenDto()
                                         {
-                                            _logger.LogError(
-                                                "_provinceService.ScreenCaseInfoSend throw exception: {ex}", e.Message);
-                                        }
+                                            Order = screenOrderDto,
+                                            Screen = screenDto,
+                                            ClientGuid = ""
+                                        }, cancellationToken);
+                                    }
+                                    catch (Exception e)
+                                    {
+                                        _logger.LogError(
+                                            "_provinceService.ScreenCaseInfoSend throw exception: {ex}", e.Message);
                                     }
                                 }
+                            }
 
-                                break;
-                        }
+                            break;
                     }
                 }
 
                 break;
             case WorkflowModuleConsts.OrderDelay:
-                if (nextTag is not null)
+                if (nextTag is not null && nextTag.Type == TagDefaults.TagType.Org)
                 {
-                    if (nextTag.Type == TagDefaults.TagType.Org)
+                    switch (nextTag.Value)
                     {
-                        switch (nextTag.Value)
-                        {
-                            case TagDefaults.TagValue.Province:
-                                //TODO 发起省延期审批
-                                var orderDelay = await _orderDelayRepository.Queryable().Includes(x => x.Order)
-                                    .Where(x => x.Id == workflow.ExternalId).FirstAsync(cancellationToken);
-                                try
+                        case TagDefaults.TagValue.Province:
+                            //TODO 发起省延期审批
+                            var orderDelay = await _orderDelayRepository.Queryable().Includes(x => x.Order)
+                                .Where(x => x.Id == workflow.ExternalId).FirstAsync(cancellationToken);
+                            try
+                            {
+                                if (orderDelay != null)
                                 {
-                                    if (orderDelay != null)
-                                    {
-                                        //推送
-                                        var publishOrderDelay = _mapper.Map<PublishOrderDelayDto>(orderDelay);
-                                        await _provinceService.DelayCaseInfoSend(publishOrderDelay, cancellationToken);
-                                    }
+                                    //推送
+                                    var publishOrderDelay = _mapper.Map<PublishOrderDelayDto>(orderDelay);
+                                    await _provinceService.DelayCaseInfoSend(publishOrderDelay, cancellationToken);
                                 }
-                                catch (Exception e)
-                                {
-                                    _logger.LogError("_provinceService.DelayCaseInfoSend throw exception: {ex}",
-                                        e.Message);
-                                }
-
-                                break;
-                        }
+                            }
+                            catch (Exception e)
+                            {
+                                _logger.LogError("_provinceService.DelayCaseInfoSend throw exception: {ex}",
+                                    e.Message);
+                            }
+
+                            break;
                     }
                 }
 

+ 1 - 1
src/Hotline.Application/Handlers/FlowEngine/WorkflowPreviousHandler.cs

@@ -80,7 +80,7 @@ namespace Hotline.Application.Handlers.FlowEngine
                         var expiredTimeConfig = _timeLimitDomainService.CalcExpiredTime(DateTime.Now, EFlowDirection.OrgToCenter, default);
 
                         await _workflowDomainService.UpdateExpiredTimeAsync(workflow, expiredTimeConfig.ExpiredTime,
-                            expiredTimeConfig.TimeText, expiredTimeConfig.Count, expiredTimeConfig.TimeType, order.CenterToOrgTime, cancellationToken);
+                            expiredTimeConfig.TimeText, expiredTimeConfig.Count, expiredTimeConfig.TimeType, cancellationToken);
 
                         var dto = _mapper.Map<OrderDto>(order);
                         //await _capPublisher.PublishAsync(EventNames.HotlineOrderExpiredTimeUpdate, dto, cancellationToken: cancellationToken);

+ 1 - 2
src/Hotline.Application/Handlers/FlowEngine/WorkflowRecallHandler.cs

@@ -76,8 +76,7 @@ public class WorkflowRecallHandler : INotificationHandler<RecallNotify>
                         data.External.TimeLimit.Value, data.FlowDirection is EFlowDirection.OrgToCenter);
 
                     await _workflowDomainService.UpdateExpiredTimeAsync(workflow, expiredTime.EndTime,
-                        expiredTime.RuleStr, data.External.TimeLimit, data.External.TimeLimitUnit,
-                        order.CenterToOrgTime, cancellationToken);
+                        expiredTime.RuleStr, data.External.TimeLimit, data.External.TimeLimitUnit, cancellationToken);
 
                     var dto = _mapper.Map<OrderDto>(order);
                     //await _capPublisher.PublishAsync(EventNames.HotlineOrderExpiredTimeUpdate, dto, cancellationToken: cancellationToken);

+ 5 - 5
src/Hotline.Application/Orders/IOrderApplication.cs

@@ -18,10 +18,10 @@ namespace Hotline.Application.Orders
     {
         /// <summary>
         /// 更新工单办理期满时间
-        /// 1.更新工单 2.更新流程 3.推送省平台
+        /// 1.更新工单 2.更新流程
         /// </summary>
         /// <returns></returns>
-        Task DelayOrderExpiredTimeAsync(Order order, ETimeType timeType, int timeCount, bool publishToProvince = true);
+        Task DelayOrderExpiredTimeAsync(string orderId, int timeCount, ETimeType timeType, CancellationToken cancellationToken);
 
         /// <summary>
         /// 新增工单办理流程记录
@@ -36,7 +36,7 @@ namespace Hotline.Application.Orders
         Task<PagedDto<OrderDto>> GetToExpireAsync(AboutToExpireListDto dto, CancellationToken cancellationToken);
         //Task<PagedDto<WorkflowOrderDto>> GetToExpireNodeAsync(AboutToExpireListDto dto, CancellationToken cancellationToken);
         Task<PagedDto<OrderDto>> GetAboutToExpireAsync(AboutToExpireListDto dto, CancellationToken cancellationToken);
-		//Task<PagedDto<WorkflowOrderDto>> GetAboutToExpireNodeAsync(AboutToExpireListDto dto, CancellationToken cancellationToken);
-		Task OrderParticiple(string inputStr, string orderId, CancellationToken cancellationToken);
-	}
+        //Task<PagedDto<WorkflowOrderDto>> GetAboutToExpireNodeAsync(AboutToExpireListDto dto, CancellationToken cancellationToken);
+        Task OrderParticiple(string inputStr, string orderId, CancellationToken cancellationToken);
+    }
 }

+ 17 - 4
src/Hotline.Application/Orders/OrderApplication.cs

@@ -8,6 +8,7 @@ using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.FlowEngine;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Order;
+using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Enums.Order;
 using Hotline.Share.Enums.Settings;
 using Hotline.Tools;
@@ -58,11 +59,23 @@ public class OrderApplication : IOrderApplication, IScopeDependency
     /// 1.更新工单 2.更新流程 3.推送省平台
     /// </summary>
     /// <returns></returns>
-    public async Task DelayOrderExpiredTimeAsync(Order order, ETimeType timeType, int timeCount,
-        bool publishToProvince = true)
+    public async Task DelayOrderExpiredTimeAsync(string orderId, int timeCount, ETimeType timeType, CancellationToken cancellationToken)
     {
-        var expiredTime = _timeLimitDomainService.CalcEndTime(order.ExpiredTime.Value, timeType, timeCount, false);
-        order.ExpiredTime = expiredTime.EndTime;
+        var order = await _orderDomainService.GetOrderAsync(orderId, cancellationToken: cancellationToken);
+        var expiredTimeConfig =
+            _timeLimitDomainService.CalcEndTime(order.ExpiredTime.Value, new TimeConfig(timeCount, timeType));
+        order.TimeLimit = expiredTimeConfig.TimeText;
+		order.TimeLimitCount = expiredTimeConfig.Count;
+        order.TimeLimitUnit = expiredTimeConfig.TimeType;
+		order.ExpiredTime = expiredTimeConfig.ExpiredTime;
+
+        if (string.IsNullOrEmpty(order.WorkflowId))
+            throw new UserFriendlyException("该工单流程id异常");
+		var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, cancellationToken: cancellationToken);
+        await _workflowDomainService.UpdateExpiredTimeAsync(workflow, expiredTimeConfig.ExpiredTime,
+            expiredTimeConfig.TimeText, expiredTimeConfig.Count, expiredTimeConfig.TimeType, cancellationToken);
+
+        await _orderRepository.UpdateAsync(order, cancellationToken);
     }
 
     /// <summary>

+ 1 - 1
src/Hotline/FlowEngine/Workflows/IWorkflowDomainService.cs

@@ -124,7 +124,7 @@ namespace Hotline.FlowEngine.Workflows
         /// 更新期满时间
         /// </summary>
         Task UpdateExpiredTimeAsync(Workflow workflow, DateTime expiredTime, string timelimit, int? timelimiteCount,
-            ETimeType? timelimitUnit, DateTime? centerToOrgTime, CancellationToken cancellationToken);
+            ETimeType? timelimitUnit, CancellationToken cancellationToken);
 
         /// <summary>
         /// 新增流程流转记录

+ 1 - 2
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -746,13 +746,12 @@ namespace Hotline.FlowEngine.Workflows
         /// 更新期满时间
         /// </summary>
         public async Task UpdateExpiredTimeAsync(Workflow workflow, DateTime expiredTime, string timelimit, int? timelimiteCount,
-            ETimeType? timelimitUnit, DateTime? centerToOrgTime, CancellationToken cancellationToken)
+            ETimeType? timelimitUnit, CancellationToken cancellationToken)
         {
             workflow.ExpiredTime = expiredTime;
             workflow.TimeLimit = timelimit;
             workflow.TimeLimitUnit = timelimitUnit;
             workflow.TimeLimitCount = timelimiteCount;
-            //workflow.CenterToOrgTime = centerToOrgTime;
             await _workflowRepository.UpdateAsync(workflow, cancellationToken);
         }
 

+ 21 - 12
src/Hotline/Orders/Order.cs

@@ -257,7 +257,6 @@ namespace Hotline.Orders
         /// </summary>
         public string? ZhuanBanMingCheng { get; set; }
 
-
         #endregion
 
         #region 流程信息
@@ -464,6 +463,7 @@ namespace Hotline.Orders
         /// 当前办理部门行政区划名称
         /// </summary>
         public string? CurrentHandleOrgAreaName { get; set; }
+
         #endregion
 
         #region 一级部门
@@ -576,15 +576,17 @@ namespace Hotline.Orders
         /// </summary>
         public string? TagNames { get; set; }
 
-		#endregion
+        #endregion
+
+        #region 附件冗余
+
+        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
+        public List<FileJson>? FileJson { get; set; }
 
-		#region 附件冗余
-		[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
-		public List<FileJson>? FileJson { get; set; }
-		#endregion
-	}
+        #endregion
+    }
 
-	public partial class Order
+    public partial class Order
     {
         /// <summary>
         /// 受理人
@@ -689,7 +691,7 @@ namespace Hotline.Orders
             if (Status is EOrderStatus.Filed) return;
             Status = EOrderStatus.Filed;
             FiledTime = DateTime.Now;
-            
+
             //计算实际办结时长
             SetHandleDuration();
         }
@@ -720,20 +722,26 @@ namespace Hotline.Orders
             Status = EOrderStatus.Visited;
         }
 
-        public void CenterToOrg(DateTime expiredTime)
+        public void CenterToOrg(string timelimit, int timelimitCount, ETimeType timilimitUnit, DateTime expiredTime)
         {
             ProcessType = EProcessType.Jiaoban;
+            TimeLimit = timelimit;
+            TimeLimitCount = timelimitCount;
+            TimeLimitUnit = timilimitUnit;
             ExpiredTime = expiredTime;
             CenterToOrgTime = DateTime.Now;
         }
 
-        public void OrgToCenter(DateTime expiredTime)
+        public void OrgToCenter(string timelimit, int timelimitCount, ETimeType timilimitUnit, DateTime expiredTime)
         {
             ProcessType = EProcessType.Zhiban;
+            TimeLimit = timelimit;
+            TimeLimitCount = timelimitCount;
+            TimeLimitUnit = timilimitUnit;
             ExpiredTime = expiredTime;
             CenterToOrgTime = null;
         }
-        
+
         public void SetHandleDuration()
         {
             if (!ActualHandleTime.HasValue) return;
@@ -763,6 +771,7 @@ namespace Hotline.Orders
             SignerId = null;
             SignerName = null;
         }
+
         #endregion
     }
 }

+ 1 - 1
src/Hotline/Settings/TimeLimits/ITimeLimitDomainService.cs

@@ -15,7 +15,7 @@ namespace Hotline.Settings.TimeLimits
         /// <summary>
         /// 计算期满时间
         /// </summary>
-        TimeResult CalcEndTime(DateTime beginTime, TimeConfig timeConfig);
+        ExpiredTimeWithConfig CalcEndTime(DateTime beginTime, TimeConfig timeConfig);
 
         /// <summary>
         /// 新增

+ 6 - 7
src/Hotline/Settings/TimeLimits/TimeLimitDomainService.cs

@@ -140,11 +140,7 @@ namespace Hotline.Settings.TimeLimits
                 _ => throw new ArgumentOutOfRangeException(nameof(flowDirection), flowDirection, null)
             };
 
-            var result = CalcEndTime(beginTime, timeConfig);
-            var expiredTimeDto = _mapper.Map<ExpiredTimeWithConfig>(timeConfig);
-            expiredTimeDto.ExpiredTime = result.EndTime;
-            
-            return expiredTimeDto;
+            return CalcEndTime(beginTime, timeConfig);
         }
 
         /// <summary>
@@ -323,9 +319,12 @@ namespace Hotline.Settings.TimeLimits
             return null;
         }
 
-        public TimeResult CalcEndTime(DateTime beginTime, TimeConfig timeConfig)
+        public ExpiredTimeWithConfig CalcEndTime(DateTime beginTime, TimeConfig timeConfig)
         {
-            return CalcEndTime(beginTime, timeConfig.TimeType, timeConfig.Count, default);
+            var result = CalcEndTime(beginTime, timeConfig.TimeType, timeConfig.Count, default);
+            var expiredTimeWithConfig = _mapper.Map<ExpiredTimeWithConfig>(timeConfig);
+            expiredTimeWithConfig.ExpiredTime = result.EndTime;
+            return expiredTimeWithConfig;
         }
 
         /// <summary>