Эх сурвалжийг харах

Merge branch 'tangj-knowledge' of http://git.fwt.com/Hotline/hotline into tangj-knowledge

TANG JIANG 2 жил өмнө
parent
commit
8cf7fc1563

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

@@ -1,4 +1,5 @@
 using Hotline.FlowEngine.Notifies;
+using Hotline.KnowledgeBase;
 using Hotline.Orders;
 using Hotline.Settings;
 using MediatR;
@@ -9,10 +10,12 @@ namespace Hotline.Application.Handlers.FlowEngine;
 public class NextStepHandler : INotificationHandler<NextStepNotify>
 {
     private readonly IOrderRepository _orderRepository;
+    private readonly IKnowledgeRepository _knowledgeRepository;
 
-    public NextStepHandler(IOrderRepository orderRepository)
+    public NextStepHandler(IOrderRepository orderRepository, IKnowledgeRepository knowledgeRepository)
     {
         _orderRepository = orderRepository;
+        _knowledgeRepository = knowledgeRepository;
     }
 
     /// <summary>Handles a notification</summary>
@@ -32,6 +35,15 @@ public class NextStepHandler : INotificationHandler<NextStepNotify>
 
                 //todo business logic
                 break;
+
+            //case WorkflowModuleConsts.KnowledgePublish:
+            //    var know = await _knowledgeRepository.GetAsync(d => d.WorkflowId == workflow.Id, cancellationToken);
+            //    //todo is null
+            //    know.Assign(notification.FlowAssignType, data.Handlers);
+
+            //    //todo business logic
+
+            //    break;
         }
     }
 }

+ 3 - 2
src/Hotline.Share/Enums/KnowledgeBase/EKnowledgeStatus.cs

@@ -6,6 +6,7 @@ public enum EKnowledgeStatus
     /// 审批中
     /// </summary>
     Auditing = 1,
-    Succeed = 2,
-    Failed = 3,
+    Failed = 2,
+    OnShelf = 3,
+    OffShelf = 4,
 }

+ 1 - 6
src/Hotline/KnowledgeBase/Knowledge.cs

@@ -55,12 +55,7 @@ public class Knowledge : WorkflowEntity// FullStateEntity
     /// 文档状态
     /// </summary>
     public EKnowledgeStatus Status { get; set; }
-
-    /// <summary>
-    /// 是否上架
-    /// </summary>
-    public bool IsOnShelf { get; set; }
-
+    
     /// <summary>
     /// 上架时间
     /// </summary>

+ 11 - 0
src/Hotline/Settings/WorkflowModule.cs

@@ -30,6 +30,9 @@ public class WorkflowModule
         Modules = new Dictionary<string, string>
         {
             { WorkflowModuleConsts.Order, "工单审批" },
+            { WorkflowModuleConsts.KnowledgePublish, "知识发布" },
+            { WorkflowModuleConsts.KnowledgeUpdate, "知识更新" },
+            { WorkflowModuleConsts.KnowledgeDelete, "知识删除" },
         };
     }
 
@@ -42,4 +45,12 @@ public class WorkflowModuleConsts
     /// 工单审批
     /// </summary>
     public const string Order = "Order";
+
+    /// <summary>
+    /// 知识发布流程
+    /// </summary>
+    public const string KnowledgePublish = "KnowledgePublish";
+    public const string KnowledgeUpdate = "KnowledgeUpdate";
+    public const string KnowledgeDelete = "KnowledgeDelete";
+
 }