李昊 4 年之前
父節點
當前提交
4f5d96583c

+ 2 - 0
gx_api/GxPress/Model/GxPress.EnumConst/AllTypeConst.cs

@@ -19,6 +19,8 @@ namespace GxPress.EnumConst
         Collect = 3,
         [Description("笔记")]
         Note = 4,
+        [Description("话题本")]
+        TopicNote = -4,
         [Description("通知")]
         Notice = 5,
         [Description("站内信")]

+ 5 - 4
gx_api/GxPress/Repository/GxPress.Repository.Implement/WorkFlow/FlowTodoRepository.cs

@@ -723,11 +723,12 @@ namespace GxPress.Repository.Implement.WorkFlow
             var result = await connection.ExecuteAsync(sql);
             return result > 0;
         }
-        public async Task UpdateCCIsDoneAsync(int userId, int flowId)
+        public async Task UpdateCCIsDoneAsync(int userId, int todoId)
         {
-            await UpdateReadAsync(userId, flowId);
-            await UpdateFlowReadAsync(userId, flowId);
-            
+            var flowTodo = await _repository.GetAsync(todoId);
+            await UpdateReadAsync(userId, flowTodo.FlowId);
+            await UpdateFlowReadAsync(userId, flowTodo.FlowId);
+
         }
 
         public async Task DeleteCheckingByFlowIdAsync(int flowId)

+ 4 - 3
gx_api/GxPress/Service/GxPress.Service.Implement/Flow/FlowService.Get.cs

@@ -77,8 +77,10 @@ namespace GxPress.Service.Implement
             return (GetFlowName(user, process), new List<string>());
         }
 
-        public async Task<FlowResult> GetFlowResult(int flowId, int userId = 0)
+        public async Task<FlowResult> GetFlowResult(int todoId, int userId = 0)
         {
+            var flowTodoModel = await _flowTodoRepository.GetAsync(todoId);
+            var flowId = flowTodoModel.FlowId;
             var flowDto = await GetAsync(flowId);
             var user = await _userRepository.GetAsync(flowDto.UserId);
             var avatarUrl = await _userRepository.GetAvatarUrlAsync(flowDto.UserId);
@@ -107,7 +109,6 @@ namespace GxPress.Service.Implement
                     });
                 }
             }
-
             var nodes = new List<NodeResult>
             {
                 new NodeResult
@@ -205,7 +206,7 @@ namespace GxPress.Service.Implement
             if (userId > 0)
             {
                 //获取副流程
-                var flowToDo = await _flowTodoRepository.GetAsync(Q.Where(nameof(Entity.WorkFlow.FlowTodo.UserId), userId).Where(nameof(Entity.WorkFlow.FlowTodo.FlowId), flowId).Where(nameof(Entity.WorkFlow.FlowTodo.Type), nameof(TodoTypeConst.ApproverCheck)).OrderByDesc(nameof(Entity.WorkFlow.FlowTodo.CreatedDate)));
+                var flowToDo = flowTodoModel;
                 if (flowToDo != null)
                 {
                     if (flowToDo.IsDone && flowToDo.IsChecked)

+ 3 - 3
gx_api/GxPress/Service/GxPress.Service.Implement/Topic/TopicService.cs

@@ -228,7 +228,7 @@ namespace GxPress.Service.Implement.Topic
         }
         public async Task<string> GetTopicPageSqlAsync(TopicPageSearchRequest request)
         {
-            var topicTypeValue = GxPress.EnumConst.AllTypeConst.Note.GetHashCode();
+            var topicTypeValue = GxPress.EnumConst.AllTypeConst.TopicNote.GetHashCode();
             var sql = $@"SELECT 
                                 a.Id,a.Title,a.UserId,a.Content,a.CreatedDate,a.IsTopic,c.ParentId,
                                 (SELECT 
@@ -569,7 +569,7 @@ namespace GxPress.Service.Implement.Topic
             var query = Q.NewQuery();
             query.Where(nameof(Entity.Middle.Middle.UserId), request.UserId);
             query.Where(nameof(Entity.Middle.Middle.AttributeValue), 2);
-            query.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Note.GetHashCode());
+            query.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.TopicNote.GetHashCode());
             query.Where(nameof(Entity.Middle.Middle.IsSystemDefault), true);
             var isExists = await _middleRepository.ExistsAsync(query);
             if (!isExists)
@@ -581,7 +581,7 @@ namespace GxPress.Service.Implement.Topic
                     FolderName = "公开",
                     AttributeValue = 2,
                     UserId = request.UserId,
-                    FolderType = AllTypeConst.Note.GetHashCode(),
+                    FolderType = AllTypeConst.TopicNote.GetHashCode(),
                     RoleId = 1,
                     IsSystemDefault = true
                 });