Jason 1 year ago
parent
commit
a91d85fb8a

+ 1 - 0
src/Hotline.Api/Controllers/OrderController.cs

@@ -777,6 +777,7 @@ public class OrderController : BaseController
         var (total, items) = await _orderDelayRepository.Queryable()
             .Includes(x => x.Order)
             .Includes(x => x.Employee)
+            .Includes(x => x.Workflow)
             .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
                 d => d.Order.Title.Contains(dto.Keyword!) || d.Order.No.Contains(dto.Keyword!))
             .WhereIF(dto.IsApply, x => x.DelayState != EDelayState.Examining)

+ 2 - 1
src/Hotline.Api/config/appsettings.Development.json

@@ -95,7 +95,8 @@
     //"Password": "123456",
     "Address": "http://222.213.23.229:29003/",
     "Username": "root",
-    "Password": "12345678aa"
+    "Password": "12345678aa",
+    "Ip": "222.213.23.229"
   }
 
 }

+ 13 - 1
src/Hotline.Application/Handlers/FlowEngine/EndWorkflowHandler.cs

@@ -37,6 +37,7 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
     private readonly IRepositorySqlSugar<CircularRecord> _circularRecordRepository;
     private readonly ICircularRecordDomainService _circularRecordDomainService;
     private readonly IRepository<OrderVisit> _orderVisitRepository;
+    private readonly IRepository<OrderDelay> _orderDelayRepository;
 
 	public EndWorkflowHandler(
         IKnowledgeDomainService knowledgeDomainService,
@@ -52,8 +53,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
         IRepository<CircularReadGroup> circularReadGroupRepository,
         IRepository<CircularRecord> circularRecordRepository,
         ICircularRecordDomainService circularRecordDomainService,
+        IRepository<OrderDelay> orderDelayRepository,
         IRepository<OrderVisit> orderVisitRepository
-
 		)
     {
         _knowledgeDomainService = knowledgeDomainService;
@@ -69,6 +70,7 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
         _circularReadGroupRepository = circularReadGroupRepository;
         _circularRecordRepository = circularRecordRepository;
         _circularRecordDomainService = circularRecordDomainService;
+        _orderDelayRepository = orderDelayRepository;
         _orderVisitRepository = orderVisitRepository; 
 	}
 
@@ -194,6 +196,16 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
                     }
                 }
                 break;
+            case WorkflowModuleConsts.OrderDelay:
+                var delay = await _orderDelayRepository.GetAsync(workflow.ExternalId, cancellationToken);
+                if (delay!=null)
+                {
+                    delay.DelayState = EDelayState.Pass;
+                    await _orderDelayRepository.UpdateAsync(delay, cancellationToken);
+
+                    //处理工单延期TODO
+                }
+                break;
         }
     }
 }

+ 14 - 7
src/Hotline.Application/Mappers/CallMapperConfigs.cs

@@ -25,18 +25,25 @@ namespace Hotline.Application.Mappers
                 .Map(d=>d.CDPN,x=>x.destination_number)
                 .Map(d => d.RecordingFileUrl, x => x.recording_file_url)
                 .Map(d => d.CreatedTime, x => x.created_time)
-                .IgnoreIf((s, d) => s.answered_time == null, d => d.AnsweredTime)
+                .Map(d=> d.AnsweredTime,x=>x.answered_time)
+                //.IgnoreIf((s, d) => s.answered_time == null, d => d.AnsweredTime)
                 .Map(d => d.OverTime, x => x.over_time)
                 .Map(d => d.Gateway, x => x.gateway)
                 .Map(d => d.OtherStr, x => x.other_str)
                 .Map(d => d.OtherAccept, x => x.other_accept)
                 .Map(d => d.Status, x => x.status)
-                .IgnoreIf((s, d) => s.beginIvrTime == null, d => d.BeginIvrTime)
-                .IgnoreIf((s, d) => s.endIvrTime == null, d => d.EndIvrTime)
-                .IgnoreIf((s, d) => s.beginQueueTime == null, d => d.BeginQueueTime)
-                .IgnoreIf((s, d) => s.endQueueTime == null, d => d.EndQueueTime)
-                .IgnoreIf((s, d) => s.beginRingTime == null, d => d.BeginRingTime)
-                .IgnoreIf((s, d) => s.endRingTime == null, d => d.EndRingTimg)
+                .Map(d=>d.BeginIvrTime,x=>x.beginIvrTime)
+                .Map(d=>d.EndIvrTime,x=>x.endIvrTime)
+                .Map(d=>d.BeginQueueTime,x=>x.beginQueueTime)
+                .Map(d=>d.EndQueueTime,x=>x.endQueueTime)
+                .Map(d=>d.BeginRingTime,x=>x.beginRingTime)
+                .Map(d=>d.EndRingTimg,x=>x.endRingTime)
+                //.IgnoreIf((s, d) => s.beginIvrTime == null, d => d.BeginIvrTime)
+                //.IgnoreIf((s, d) => s.endIvrTime == null, d => d.EndIvrTime)
+                //.IgnoreIf((s, d) => s.beginQueueTime == null, d => d.BeginQueueTime)
+                //.IgnoreIf((s, d) => s.endQueueTime == null, d => d.EndQueueTime)
+                //.IgnoreIf((s, d) => s.beginRingTime == null, d => d.BeginRingTime)
+                //.IgnoreIf((s, d) => s.endRingTime == null, d => d.EndRingTimg)
                 .Map(d => d.OlaQueue, x => x.ola_queue)
                 .Map(d => d.BatchAccept, x => x.batch_accept)
                 .Map(d => d.IvrDtmf, x => x.ivr_dtmf)

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

@@ -93,7 +93,8 @@ public class OrderMapperConfigs : IRegister
 
         config.ForType<OrderDelay, OrderDelayDto>()
             //.Inherits<Order, OrderDto>()
-            .IgnoreIf((s, d) => s.Employee == null, d => d.EmployeeName);
+            .IgnoreIf((s, d) => s.Employee == null, d => d.EmployeeName)
+            .IgnoreIf((s, d) => s.Workflow == null, d => d.CurrentStepName);
 
     }
 }

+ 7 - 0
src/Hotline.Share/Dtos/Order/QueryOrderDto.cs

@@ -352,6 +352,13 @@ namespace Hotline.Share.Dtos.Order
         /// 一级部门Id
         /// </summary>
         public string? AreaId { get; set; }
+
+        /// <summary>
+        /// 当前办理节点
+        /// </summary>
+        public string? CurrentStepName { get; set; }
+
+
     }
 
 

+ 5 - 1
src/Hotline/Orders/OrderDelay.cs

@@ -1,4 +1,5 @@
-using Hotline.Share.Enums.Order;
+using Hotline.FlowEngine.Workflows;
+using Hotline.Share.Enums.Order;
 using Hotline.Share.Enums.Settings;
 using Hotline.Users;
 using SqlSugar;
@@ -99,5 +100,8 @@ namespace Hotline.Orders
         /// 流程ID
         /// </summary>
         public string? WorkflowId { get; set; }
+
+        [Navigate(NavigateType.OneToOne, nameof(WorkflowId))]
+        public Workflow Workflow { get; set; }
     }
 }

+ 1 - 0
src/Tr.Sdk/TrConfiguration.cs

@@ -5,4 +5,5 @@ public class TrConfiguration
     public string Address { get; set; }
     public string Username { get; set; }
     public string Password { get; set; }
+    public string Ip { get; set; }
 }

+ 1 - 2
src/XF.Domain.Repository/Entity.cs

@@ -22,8 +22,7 @@ public abstract class Entity : IEntity<string>, IDomainEvents, IDataPermission,
 
     public string? CreatorOrgName { get; set; }
 
-    [SugarColumn(DefaultValue = "0")]
-    public int CreatorOrgLevel { get; set; }
+    public int CreatorOrgLevel { get; set; } = 0;
 
     /// <summary>
     /// 一级部门Id