Browse Source

(修改)团组流程管控返回数据视图结构优化

jiangjc 1 year ago
parent
commit
b9b8630b5f

+ 3 - 3
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -48,7 +48,7 @@ namespace OASystem.API.OAMethodLibs
                 _primary.Leader = _groupConfig.Leader;
                 _primary.PrimaryStep = GrpSchedulePrimaryStepEnum.Wait;
                 _primary.Remark = "请设置各流程负责人、预计开始/结束时间";
-                int _primaryId = await _grpScheduleRep.AddAsync(_primary);
+                int _primaryId = await _grpScheduleRep.AddAsyncReturnId(_primary);
                 if (_primaryId > 0)
                 {
                     #region 子流程
@@ -62,7 +62,7 @@ namespace OASystem.API.OAMethodLibs
                     _model.ExpectBeginDt = dftBeginDt;
                     _model.ExpectEndDt = dftEndDt;
                     _model.Remark = "未设置负责人";
-                    _model.ScheduleId = DiId;
+                    _model.ScheduleId = _primaryId;
                     _model.StepStatus = 0;
                     #endregion
                     #region 经费预算
@@ -361,7 +361,7 @@ Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser
                         foreach (var item in personList)
                         {
                             item.CreateUserId = _groupConfig.DefaultUser;
-                            item.ScheduleId = DiId;
+                            item.ScheduleId = _primaryId;
                         }
                         _grpScheduleRep.bulkInsert(personList);
                     }

+ 3 - 3
OASystem/OASystem.Domain/Enums/GrpScheduleEnum.cs

@@ -15,13 +15,13 @@ namespace OASystem.Domain.Enums
         /// <summary>
         /// 未开始/等待任务分配 I
         /// </summary>
-        [Description("未开始/等待任务分配")]
+        [Description("团组出行")]
         Wait = 0,
 
         /// <summary>
-        /// 确认出团/任务分配 I
+        /// 确认出团/任务分配完成 I
         /// </summary>
-        [Description("确认出团/任务分配完成")]
+        [Description("确认出团")]
         Confirm = 1,
 
         #region 经费预算

+ 2 - 1
OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleCombinView.cs

@@ -9,7 +9,8 @@ namespace OASystem.Domain.ViewModels.Groups
     public class Grp_ScheduleCombinView
     {
         public Grp_ScheduleView Primary { get; set; }
-        public List<Grp_ScheduleDetailView> ChildList { get; set; }
+        //public List<Grp_ScheduleDetailView> ChildList { get; set; }
         public List<Grp_SchedulePersonView> PersonList { get; set; }
+        public List<Grp_ScheduleRootView> RootList { get; set; }
     }
 }

+ 26 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleView.cs

@@ -2,6 +2,7 @@
 using OASystem.Domain.Enums;
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -66,4 +67,29 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public int Exception { get; set; }
     }
+
+    public class Grp_ScheduleRootView
+    {
+        public int Root { get; set; }
+        public string RootName
+        {
+            get
+            {
+                NameValueCollection nvc = EnumHelper.GetNVCFromEnumValue(typeof(GrpSchedulePrimaryStepEnum));
+                string rst = nvc[this.Root.ToString()];
+                if (string.IsNullOrEmpty(rst))
+                {
+                    rst = Root.ToString();
+                }
+                return rst;
+            }
+        }
+        public List<Grp_ScheduleDetailView> ChildList { get; set; }
+        public GrpConfig Config { get; set; }
+    }
+
+    public class GrpConfig
+    {
+        public string backgroundColor { get; set; }
+    }
 }

+ 33 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs

@@ -59,6 +59,29 @@ namespace OASystem.Infrastructure.Repositories.Groups
             #endregion
             _view.Primary = primary;
 
+            #region 主流程节点
+
+            List<Grp_ScheduleRootView> rootList = new List<Grp_ScheduleRootView>()
+            {
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Wait },
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Confirm},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Budget},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Feedback},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Puote},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Visa},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Business},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.CostAudit},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Pay},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Training},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.DropOff},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.PickUp},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Collect},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Finish}
+            };
+
+
+            #endregion
+
             #region 子节点
 
             //子节点
@@ -105,10 +128,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
                 temp.ChildList = new List<Grp_ScheduleDetailView>(tempChildList);
+
+
                 childList.Add(temp);
             }
             #endregion
-            _view.ChildList = new List<Grp_ScheduleDetailView>(childList);
+            foreach (var item in rootList)
+            {
+                item.ChildList = new List<Grp_ScheduleDetailView>(childList.Where(s => s.Root == item.Root).ToList());
+            }
+
+            _view.RootList = new List<Grp_ScheduleRootView>(rootList);
 
             #region 流程人员
             List<Grp_SchedulePersonInfo> personEntityList = _sqlSugar.Queryable<Grp_SchedulePersonInfo>().Where(s => s.IsDel != 1 && s.ScheduleId == _dto.ScheduleId).ToList();
@@ -118,7 +148,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Grp_SchedulePersonView temp = new Grp_SchedulePersonView();
                 temp.JobStr = item.JobStr;
                 temp.PersonId = item.Id;
-                temp.PersonRemark=item.Remark;
+                temp.PersonRemark = item.Remark;
                 temp.SysUserId = item.SysUserId;
                 temp.SysUserName = item.SysUserName;
                 personList.Add(temp);
@@ -143,7 +173,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return _viewList;
         }
 
-        public void bulkInsert<T>(List<T> list)
+        public void bulkInsert<T>(List<T> list) where T : class, new()
         {
             _sqlSugar.Insertable(list).UseParameter().ExecuteCommand();
         }