Переглянути джерело

会务流程 参与人数据格式调整

Lyyyi 3 днів тому
батько
коміт
9cdb90f3bb

+ 0 - 2
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -31440,7 +31440,6 @@ WHERE
 
         #endregion
 
-
         #region 团组会务总览进程
 
         /// <summary>
@@ -31475,7 +31474,6 @@ WHERE
                 })
                 .ToListAsync();
 
-            
             var participators = await _sqlSugar.Queryable<Sys_Users>()
                 .Where(x => x.IsDel == 0 && x.DepId == 5)
                 .Select(x => new ParticipatorInfo()

+ 1 - 1
OASystem/OASystem.Domain/Dtos/Groups/VisaProcessDtos.cs

@@ -127,7 +127,7 @@ namespace OASystem.Domain.Dtos.Groups
         /// <summary>
         /// 参与人
         /// </summary>
-        public List<ParticipatorInfo> Participators { get; set; }
+        public List<int> Participators { get; set; }
 
         /// <summary>
         /// 是否有文件(如需要)

+ 2 - 2
OASystem/OASystem.Domain/Entities/Groups/Grp_ConfProcess.cs

@@ -169,7 +169,7 @@ namespace OASystem.Domain.Entities.Groups
         /// 参与人
         /// </summary>
         [SugarColumn(IsIgnore = true)]
-        public List<ParticipatorInfo> Participators { get; set; }
+        public List<int> Participators { get; set; }
 
         /// <summary>
         /// Create
@@ -185,7 +185,7 @@ namespace OASystem.Domain.Entities.Groups
         /// <param name="remark">备注</param>
         /// <returns></returns>
         public static Grp_ConfProcessNode Create(int nodeOrder, string nodeName, string nodeDescTips, ProcessStatus status, bool isCurrent, bool isFileUp, int currUserId,
-            List<ParticipatorInfo> participators, string remark = null)
+            List<int> participators, string remark = null)
         {
             bool isEnaFileUpBtn = isFileUp;
 

+ 1 - 1
OASystem/OASystem.Domain/ViewModels/Groups/ProcessOverView.cs

@@ -28,7 +28,7 @@ namespace OASystem.Domain.ViewModels.Groups
         public string NodeName { get; set; }
         public string NodeDescTips { get; set; }
         public ProcessStatus OverallStatus { get; set; }
-        public List<ParticipatorInfo> Participators { get; set; }
+        public List<int> Participators { get; set; }
         public string StatusText { get; set; }
         public string Operator { get; set; }
         public string OpeateTime { get; set; }

+ 7 - 22
OASystem/OASystem.Infrastructure/Repositories/Groups/ProcessOverviewRepository.cs

@@ -853,7 +853,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             #region 会务流程
             //参与人 participators
-            var defaultParticipators = new List<ParticipatorInfo>() { new() { UserId = 213, UserName = "李新江" } };
+            var defaultParticipators = new List<int>() 
+            {
+                213, //李新江
+            };
 
             var defaultPorc1 = new List<Grp_ConfProcessNode>() {
                 Grp_ConfProcessNode.Create(1,"方案/报价(含成本)","", ProcessStatus.InProgress,true,false, currUserId,defaultParticipators),
@@ -935,7 +938,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     ProcessId = processId,
                     NodeName = nodeDto.NodeName,
                     NodeOrder = nodeDto.NodeOrder,
-                    Participator = JsonConvert.SerializeObject(nodeDto.Participators.Select(p => p.UserId).ToList()),
+                    Participator = JsonConvert.SerializeObject(nodeDto.Participators),
                     OverallStatus = nodeDto.OverallStatus,
                     NodeDescTips = nodeDto.NodeDescTips,
                     //Country = nodeDto.Country,
@@ -1031,24 +1034,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         //    isEnaFileUpBtn = true;
                         //}
 
-                        //获取参与人姓名
-                        var participators = new List<ParticipatorInfo>();
-                        var participatorArray = JsonConvert.DeserializeObject<List<int>>(n.Participator);
-                        if (participatorArray?.Count > 0)
-                        {
-                            foreach (var item in participatorArray)
-                            {
-                                if (userDict.TryGetValue(item, out var userName))
-                                {
-                                    participators.Add(new ParticipatorInfo
-                                    {
-                                        UserId = item,
-                                        UserName = userName
-                                    });
-                                }
-                            }
-                        }
-
                         // 获取操作人姓名(使用字典提升性能)
                         string operatorName = "-";
                         if (n.Operator.HasValue && userDict.TryGetValue(n.Operator.Value, out var name))
@@ -1064,7 +1049,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             NodeName = n.NodeName,
                             NodeDescTips = n.NodeDescTips,
                             OverallStatus = n.OverallStatus,
-                            Participators = participators,
+                            Participators = JsonConvert.DeserializeObject<List<int>>(n.Participator),
                             StatusText = n.OverallStatus.GetEnumDescription(),
                             Operator = operatorName,
                             OpeateTime = n.OperationTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-",
@@ -1432,7 +1417,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
 
             node.IsFileUp = isFileUp;
-            node.Participator = JsonConvert.SerializeObject(node.Participators.Select(x => x.UserId).ToList());
+            node.Participator = JsonConvert.SerializeObject(node.Participators);
 
             // 3. 保存节点更新
             await _sqlSugar.Updateable(node)