Przeglądaj źródła

工单超期时间计算

Dun.Jason 9 miesięcy temu
rodzic
commit
3beebec01e

+ 6 - 5
src/Hotline.Api/Controllers/OrderController.cs

@@ -2951,7 +2951,7 @@ public class OrderController : BaseController
         {
             expiredTimeConfig = _timeLimitDomainService.CalcExpiredTime(DateTime.Now, EFlowDirection.CenterToCenter, order.AcceptTypeCode);
             order.CenterToCenter(expiredTimeConfig.TimeText, expiredTimeConfig.Count,
-                expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime, expiredTimeConfig.NearlyExpiredTime);
+                expiredTimeConfig.TimeType, expiredTimeConfig.ExpiredTime, expiredTimeConfig.NearlyExpiredTime,expiredTimeConfig.NearlyExpiredTimeOne);
         }
 
         _mapper.Map(expiredTimeConfig, order);
@@ -3986,7 +3986,7 @@ public class OrderController : BaseController
             //var expiredTime = _timeLimitDomainService.CalcEndTime(DateTime.Now,
             //	ETimeType.WorkDay,
             //	dto.TimeLimit.Value, order.AcceptTypeCode);
-            await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime, ProcessType = processType })
+            await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime, NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne, ProcessType = processType })
                 .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
             var orderDto = _mapper.Map<OrderDto>(order);
             await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto, cancellationToken: HttpContext.RequestAborted);
@@ -4116,7 +4116,7 @@ public class OrderController : BaseController
                     ETimeType.WorkDay,
                     dto.TimeLimit.Value, order.AcceptTypeCode);
                 endTime = expiredTime.EndTime;
-                await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.EndTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime })
+                await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.EndTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime,NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne })
                     .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
                 var orderDto = _mapper.Map<OrderDto>(order);
                 await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto, cancellationToken: HttpContext.RequestAborted);
@@ -4197,7 +4197,7 @@ public class OrderController : BaseController
             var processType = special.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
                 ? EProcessType.Zhiban
                 : EProcessType.Jiaoban;
-            await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime, ProcessType = processType })
+            await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime,NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne, ProcessType = processType })
                 .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
             var orderDto = _mapper.Map<OrderDto>(order);
             await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto, cancellationToken: HttpContext.RequestAborted);
@@ -4297,7 +4297,7 @@ public class OrderController : BaseController
                 var processType = special.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
                     ? EProcessType.Zhiban
                     : EProcessType.Jiaoban;
-                await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime, ProcessType = processType })
+                await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime, NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne, ProcessType = processType })
                     .Where(o => o.Id == order.Id).ExecuteCommandAsync(HttpContext.RequestAborted);
                 var orderDto = _mapper.Map<OrderDto>(order);
                 await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto, cancellationToken: HttpContext.RequestAborted);
@@ -4401,6 +4401,7 @@ public class OrderController : BaseController
                   x.ActualHandleTime,
                   x.ExpiredTime,
                   x.NearlyExpiredTime,
+                  x.NearlyExpiredTimeOne,
                   p.NextStepName,
                   p.NextStepCode,
                   p.StepName,

+ 2 - 1
src/Hotline.Application/Mappers/OrderMapperConfigs.cs

@@ -73,7 +73,7 @@ public class OrderMapperConfigs : IRegister
                 d.OrgProcessingResults = s.OrgProcessingResults.Value;
             });
 
-            
+
 
 
 
@@ -83,6 +83,7 @@ public class OrderMapperConfigs : IRegister
             .Map(d => d.Additions, s => s.Files)
             .IgnoreIf((s, d) => !s.ExpiredTime.HasValue, d => d.ExpiredTime)
             .IgnoreIf((s, d) => !s.NearlyExpiredTime.HasValue, d => d.NearlyExpiredTime)
+            .IgnoreIf((s, d) => !s.NearlyExpiredTimeOne.HasValue, d => d.NearlyExpiredTimeOne)
             .IgnoreIf((s, d) => string.IsNullOrEmpty(s.TimeLimit), d => d.TimeLimit)
             .IgnoreIf((s, d) => !s.TimeLimitCount.HasValue, d => d.TimeLimitCount)
             .IgnoreIf((s, d) => !s.TimeLimitUnit.HasValue, d => d.TimeLimitUnit)

+ 1 - 1
src/Hotline.Application/Orders/OrderApplication.cs

@@ -124,7 +124,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         order.TimeLimitUnit = expiredTimeConfig.TimeType;
         order.ExpiredTime = expiredTimeConfig.ExpiredTime;
         order.NearlyExpiredTime = expiredTimeConfig.NearlyExpiredTime;
-
+        order.NearlyExpiredTimeOne = expiredTimeConfig.NearlyExpiredTimeOne;
         //if (string.IsNullOrEmpty(order.WorkflowId))
         //    throw new UserFriendlyException("该工单流程id异常");
         //var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, cancellationToken: cancellationToken);

+ 1 - 1
src/Hotline.Application/Orders/OrderSecondaryHandlingApplication.cs

@@ -165,7 +165,7 @@ namespace Hotline.Application.Orders
                 var reTransactNum = order.ReTransactNum is null ? 1 : order.ReTransactNum + 1;
                 var expiredTime = _timeLimitDomainService.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
                 var processType = step.FlowDirection == EFlowDirection.OrgToCenter || step.FlowDirection == EFlowDirection.CenterToCenter ? EProcessType.Zhiban : EProcessType.Jiaoban;
-                await _orderRepository.Updateable().SetColumns(o => new Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime, ReTransactNum = reTransactNum, ProcessType = processType })
+                await _orderRepository.Updateable().SetColumns(o => new Order() { ExpiredTime = expiredTime.ExpiredTime, NearlyExpiredTime = expiredTime.NearlyExpiredTime,NearlyExpiredTimeOne = expiredTime.NearlyExpiredTimeOne, ReTransactNum = reTransactNum, ProcessType = processType })
                     .Where(o => o.Id == order.Id).ExecuteCommandAsync(cancellationToken);
                 var orderDto = _mapper.Map<OrderDto>(order);
                 await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate, orderDto, cancellationToken: cancellationToken);

+ 5 - 0
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -810,6 +810,11 @@ namespace Hotline.Share.Dtos.Order
         /// </summary>
         public DateTime? NearlyExpiredTime { get; set; }
 
+        /// <summary>
+        /// 即将超期第一级
+        /// </summary>
+        public DateTime? NearlyExpiredTimeOne { get; set; }
+
         /// <summary>
         /// 办理时间限制(如:24小时、7个工作日)
         /// </summary>

+ 1 - 0
src/Hotline/Settings/TimeLimits/TimeLimitDomainService.cs

@@ -430,6 +430,7 @@ namespace Hotline.Settings.TimeLimits
                 expiredTimeWithConfig.Count = setting.TimeValue;
                 expiredTimeWithConfig.ExpiredTime = result.EndTime;
                 expiredTimeWithConfig.NearlyExpiredTime = result.NearlyExpiredTime;
+                expiredTimeWithConfig.NearlyExpiredTimeOne = result.NearlyExpiredTimeOne;
                 return expiredTimeWithConfig;
             }
             return null;