Jason преди 1 година
родител
ревизия
d2c2ca4bb7
променени са 1 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. 14 1
      src/Hotline.Application/Handlers/FlowEngine/EndWorkflowHandler.cs

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

@@ -35,6 +35,7 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
     private readonly IRepository<OrderScreen> _orderScreenRepository;
     private readonly IRepository<Bulletin> _bulletinRepository;
     private readonly IRepository<Circular> _circularRepository;
+    private readonly IRepository<CircularReadGroup> _circularReadGroupRepository;
 
     public EndWorkflowHandler(
         IKnowledgeDomainService knowledgeDomainService,
@@ -48,7 +49,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
         IRepository<OrderVisitDetail> orderVisitedDetailRepository,
         IRepository<OrderScreen> orderScreenRepository,
         IRepository<Bulletin> bulletinRepository,
-        IRepository<Circular> circularRepository
+        IRepository<Circular> circularRepository,
+        IRepository<CircularReadGroup> circularReadGroupRepository
         )
     {
         _knowledgeDomainService = knowledgeDomainService;
@@ -63,6 +65,7 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
         _orderVisitedDetailRepository = orderVisitedDetailRepository;
         _bulletinRepository = bulletinRepository;
         _circularRepository = circularRepository;
+        _circularReadGroupRepository = circularReadGroupRepository;
     }
 
     /// <summary>Handles a notification</summary>
@@ -139,7 +142,17 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
                     circular.CircularTime = DateTime.Now;
                     await _circularRepository.UpdateAsync(circular, cancellationToken);
                     //更新阅读数量
+                    if (circular.CircularType == Share.Enums.Article.ECircularType.Person)
+                    {
+                        //个人
+                         _circularReadGroupRepository.Queryable().Where(x => x.CircularId == circular.Id).Select(x => x.UserId).ToList();
+                        //_circularReadGroupRepository.
 
+                    }
+                    else
+                    {
+                        //部门
+                    }
                 }
                 break;
         }