Browse Source

更新团组流程管控内容:根据流程管控Id(Grp_ScheduleDetail.Id)获取流程详情数据

Feint 1 year ago
parent
commit
0c6c3e25fc

+ 1 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -52,7 +52,7 @@ namespace OASystem.API.Controllers
                 }
                 else//获取对象
                 {
-                    Grp_ScheduleView _grpScheduleView = await _grpScheduleRep.GetView_GrpSchedule(_ScheduleDto);
+                    Grp_ScheduleCombinView _grpScheduleView = await _grpScheduleRep.GetView_GrpSchedule(_ScheduleDto);
                     if (_grpScheduleView != null)
                     {
                         return Ok(JsonView(_grpScheduleView));

+ 37 - 5
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -70,6 +70,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_budget202.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BudgetChild02);
                     grp_budget202.ParentStep = (int)GrpSchedulePrimaryStepEnum.Budget;
                     grp_budget202.Step = (int)GrpSchedulePrimaryStepEnum.BudgetChild02;
+                    grp_budget202.SLevel = 2;
                     entityList.Add(grp_budget202);
                     #endregion
                     #region 市场部人员报价对接/反馈
@@ -78,6 +79,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_feedback302.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.FeedbackChild02);
                     grp_feedback302.ParentStep = (int)GrpSchedulePrimaryStepEnum.Feedback;
                     grp_feedback302.Step = (int)GrpSchedulePrimaryStepEnum.FeedbackChild02;
+                    grp_feedback302.SLevel = 2;
                     entityList.Add(grp_feedback302);
 
                     //录入最终总经费预算
@@ -85,6 +87,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_feedback303.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.FeedbackChild03);
                     grp_feedback303.ParentStep = (int)GrpSchedulePrimaryStepEnum.Feedback;
                     grp_feedback303.Step = (int)GrpSchedulePrimaryStepEnum.FeedbackChild03;
+                    grp_feedback303.SLevel = 2;
                     entityList.Add(grp_feedback303);
 
                     //完成报价对接/反馈
@@ -92,6 +95,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_feedback304.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.FeedbackChild04);
                     grp_feedback304.ParentStep = (int)GrpSchedulePrimaryStepEnum.Feedback;
                     grp_feedback304.Step = (int)GrpSchedulePrimaryStepEnum.FeedbackChild04;
+                    grp_feedback304.SLevel = 2;
                     entityList.Add(grp_feedback304);
                     #endregion
                     #region (目前为空)报批流程
@@ -103,6 +107,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa502.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild02);
                     grp_visa502.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa502.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild02;
+                    grp_visa502.SLevel = 2;
                     entityList.Add(grp_visa502);
 
                     //取护照资料
@@ -110,6 +115,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa503.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild03);
                     grp_visa503.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa503.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild03;
+                    grp_visa503.SLevel = 2;
                     entityList.Add(grp_visa503);
 
                     //填资料
@@ -117,6 +123,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa504.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild04);
                     grp_visa504.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa504.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild04;
+                    grp_visa504.SLevel = 2;
                     entityList.Add(grp_visa504);
 
                     //送签
@@ -124,6 +131,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa505.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild05);
                     grp_visa505.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa505.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild05;
+                    grp_visa505.SLevel = 2;
                     entityList.Add(grp_visa505);
 
                     //出签+取护照
@@ -131,6 +139,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa506.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild06);
                     grp_visa506.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa506.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild06;
+                    grp_visa506.SLevel = 2;
                     entityList.Add(grp_visa506);
 
                     //归还护照
@@ -138,6 +147,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa507.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild07);
                     grp_visa507.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa507.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild07;
+                    grp_visa507.SLevel = 2;
                     entityList.Add(grp_visa507);
 
                     //签证费用录入 
@@ -145,90 +155,104 @@ namespace OASystem.API.OAMethodLibs
                     grp_visa508.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild08);
                     grp_visa508.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa508.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild08;
+                    grp_visa508.SLevel = 2;
                     entityList.Add(grp_visa508);
                     #endregion
                     #region 业务操作
                     //机票
                     Grp_ScheduleDetailInfo grp_busJP601 = _model.DeepClone();
                     grp_busJP601.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJP);
-                    grp_busJP601.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
+                    grp_busJP601.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busJP601.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
+                    grp_busJP601.SLevel = 2;
                     entityList.Add(grp_busJP601);
                     //机票-询价并导入黑屏代码
                     Grp_ScheduleDetailInfo grp_busJP6012 = _model.DeepClone();
                     grp_busJP6012.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild02);
                     grp_busJP6012.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6012.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild02;
+                    grp_busJP6012.SLevel = 3;
                     entityList.Add(grp_busJP6012);
                     //机票-机票已占位
                     Grp_ScheduleDetailInfo grp_busJP6013 = _model.DeepClone();
                     grp_busJP6013.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild03);
                     grp_busJP6013.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6013.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild03;
+                    grp_busJP6013.SLevel = 3;
                     entityList.Add(grp_busJP6013);
                     //机票-已出票
                     Grp_ScheduleDetailInfo grp_busJP6014 = _model.DeepClone();
                     grp_busJP6014.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild04);
                     grp_busJP6014.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6014.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild04;
+                    grp_busJP6014.SLevel = 3;
                     entityList.Add(grp_busJP6014);
                     //机票-机票费用录入
                     Grp_ScheduleDetailInfo grp_busJP6015 = _model.DeepClone();
                     grp_busJP6015.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild05);
                     grp_busJP6015.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6015.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild05;
+                    grp_busJP6015.SLevel = 3;
                     entityList.Add(grp_busJP6015);
 
                     //酒店
                     Grp_ScheduleDetailInfo grp_busJD602 = _model.DeepClone();
                     grp_busJD602.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJD);
-                    grp_busJD602.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
+                    grp_busJD602.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busJD602.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJD;
+                    grp_busJD602.SLevel = 2;
                     entityList.Add(grp_busJD602);
                     //酒店-酒店费用录入
                     Grp_ScheduleDetailInfo grp_busJD6022 = _model.DeepClone();
                     grp_busJD6022.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJDChild02);
                     grp_busJD6022.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJD;
                     grp_busJD6022.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJDChild02;
+                    grp_busJD6022.SLevel = 3;
                     entityList.Add(grp_busJD6022);
 
                     //OP
                     Grp_ScheduleDetailInfo grp_busOP603 = _model.DeepClone();
                     grp_busOP603.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessOP);
-                    grp_busOP603.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
+                    grp_busOP603.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busOP603.Step = (int)GrpSchedulePrimaryStepEnum.BusinessOP;
+                    grp_busOP603.SLevel = 2;
                     entityList.Add(grp_busOP603);
                     //OP-OP费用录入
                     Grp_ScheduleDetailInfo grp_busOP6032 = _model.DeepClone();
                     grp_busOP6032.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessOPChild02);
                     grp_busOP6032.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessOP;
                     grp_busOP6032.Step = (int)GrpSchedulePrimaryStepEnum.BusinessOPChild02;
+                    grp_busOP6032.SLevel = 3;
                     entityList.Add(grp_busOP6032);
 
                     //商邀
                     Grp_ScheduleDetailInfo grp_busSY604 = _model.DeepClone();
                     grp_busSY604.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSY);
-                    grp_busSY604.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
+                    grp_busSY604.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busSY604.Step = (int)GrpSchedulePrimaryStepEnum.BusinessSY;
+                    grp_busSY604.SLevel = 2;
                     entityList.Add(grp_busSY604);
                     //商邀-商邀费用录入
                     Grp_ScheduleDetailInfo grp_busSY6042 = _model.DeepClone();
                     grp_busSY6042.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSYChild02);
                     grp_busSY6042.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessSY;
                     grp_busSY6042.Step = (int)GrpSchedulePrimaryStepEnum.BusinessSYChild02;
+                    grp_busSY6042.SLevel = 3;
                     entityList.Add(grp_busSY6042);
 
                     //其他
                     Grp_ScheduleDetailInfo grp_busQT605 = _model.DeepClone();
                     grp_busQT605.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessQT);
-                    grp_busQT605.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
+                    grp_busQT605.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busQT605.Step = (int)GrpSchedulePrimaryStepEnum.BusinessQT;
+                    grp_busQT605.SLevel = 2;
                     entityList.Add(grp_busQT605);
                     //商邀-商邀费用录入
                     Grp_ScheduleDetailInfo grp_busQT6052 = _model.DeepClone();
                     grp_busQT6052.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessQTChild02);
                     grp_busQT6052.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessQT;
                     grp_busQT6052.Step = (int)GrpSchedulePrimaryStepEnum.BusinessQTChild02;
+                    grp_busQT6052.SLevel = 3;
                     entityList.Add(grp_busQT6052);
 
                     #endregion
@@ -239,6 +263,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_cost702.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost702.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild02;
                     grp_cost702.Duty = _groupConfig.Boss;
+                    grp_cost702.SLevel = 2;
                     entityList.Add(grp_cost702);
                     //酒店费用审批
                     Grp_ScheduleDetailInfo grp_cost703 = _model.DeepClone();
@@ -246,6 +271,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_cost703.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost703.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild03;
                     grp_cost703.Duty = _groupConfig.Boss;
+                    grp_cost703.SLevel = 2;
                     entityList.Add(grp_cost703);
                     //OP费用审批
                     Grp_ScheduleDetailInfo grp_cost704 = _model.DeepClone();
@@ -253,6 +279,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_cost704.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost704.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild04;
                     grp_cost704.Duty = _groupConfig.Boss;
+                    grp_cost704.SLevel = 2;
                     entityList.Add(grp_cost704);
                     //OP费用审批
                     Grp_ScheduleDetailInfo grp_cost705 = _model.DeepClone();
@@ -260,6 +287,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_cost705.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost705.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild05;
                     grp_cost705.Duty = _groupConfig.Boss;
+                    grp_cost705.SLevel = 2;
                     entityList.Add(grp_cost705);
                     //增减款项审批
                     Grp_ScheduleDetailInfo grp_cost706 = _model.DeepClone();
@@ -267,6 +295,7 @@ namespace OASystem.API.OAMethodLibs
                     grp_cost706.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost706.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild06;
                     grp_cost706.Duty = _groupConfig.Boss;
+                    grp_cost706.SLevel = 2;
                     entityList.Add(grp_cost706);
                     #endregion
                     #region 付款给供应商
@@ -275,18 +304,21 @@ namespace OASystem.API.OAMethodLibs
                     grp_pay802.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.PayChild02);
                     grp_pay802.ParentStep = (int)GrpSchedulePrimaryStepEnum.Pay;
                     grp_pay802.Step = (int)GrpSchedulePrimaryStepEnum.PayChild02;
+                    grp_pay802.SLevel = 2;
                     entityList.Add(grp_pay802);
                     //商邀费用付款
                     Grp_ScheduleDetailInfo grp_pay803 = _model.DeepClone();
                     grp_pay803.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.PayChild03);
                     grp_pay803.ParentStep = (int)GrpSchedulePrimaryStepEnum.Pay;
                     grp_pay803.Step = (int)GrpSchedulePrimaryStepEnum.PayChild03;
+                    grp_pay803.SLevel = 2;
                     entityList.Add(grp_pay803);
                     //增减款项付款
                     Grp_ScheduleDetailInfo grp_pay804 = _model.DeepClone();
                     grp_pay804.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.PayChild04);
                     grp_pay804.ParentStep = (int)GrpSchedulePrimaryStepEnum.Pay;
                     grp_pay804.Step = (int)GrpSchedulePrimaryStepEnum.PayChild04;
+                    grp_pay804.SLevel = 2;
                     entityList.Add(grp_pay804);
                     #endregion
                     #region (目前为空)出行事项会议

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

@@ -20,7 +20,7 @@ namespace OASystem.Domain.Dtos.Groups
         #region 对象
 
         /// <summary>
-        /// 团组流程Id
+        /// 团组流程管控Id
         /// </summary>
         public int ScheduleId { get; set; }
 

+ 6 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_ScheduleInfo.cs

@@ -82,6 +82,12 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int ScheduleId { get; set; }
 
+        /// <summary>
+        /// 等级
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SLevel { get; set; }
+
         /// <summary>
         /// 流程
         /// </summary>

+ 51 - 0
OASystem/OASystem.Domain/Enums/EnumHelper.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.ComponentModel;
 using System.Linq;
 using System.Reflection;
@@ -41,5 +42,55 @@ namespace OASystem.Domain.Enums
         {
             return Enum.Parse(enumType, value) as Enum;
         }
+
+        /// <summary>
+        /// 根据Key获取枚举描述
+        /// </summary>
+        /// <param name="en"></param>
+        /// <returns></returns>
+        public static string GetDescription(this System.Enum en)
+        {
+            Type type = en.GetType();
+            MemberInfo[] memInfo = type.GetMember(en.ToString());
+            if (memInfo != null && memInfo.Length > 0)
+            {
+                object[] attrs = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
+                if (attrs != null && attrs.Length > 0)
+                    return ((DescriptionAttribute)attrs[0]).Description;
+            }
+            return en.ToString();
+        }
+        /// <summary>
+        /// 根据枚举类型得到其所有的 值 与 枚举定义Description属性 的集合
+        /// </summary>
+        /// <param name="enumType"></param>
+        /// <returns></returns>
+        public static NameValueCollection GetNVCFromEnumValue(Type enumType)
+        {
+            NameValueCollection nvc = new NameValueCollection();
+            Type typeDescription = typeof(DescriptionAttribute);
+            System.Reflection.FieldInfo[] fields = enumType.GetFields();
+            string strText = string.Empty;
+            string strValue = string.Empty;
+            foreach (FieldInfo field in fields)
+            {
+                if (field.FieldType.IsEnum)
+                {
+                    strValue = ((int)enumType.InvokeMember(field.Name, BindingFlags.GetField, null, null, null)).ToString();
+                    object[] arr = field.GetCustomAttributes(typeDescription, true);
+                    if (arr.Length > 0)
+                    {
+                        DescriptionAttribute aa = (DescriptionAttribute)arr[0];
+                        strText = aa.Description;
+                    }
+                    else
+                    {
+                        strText = "";
+                    }
+                    nvc.Add(strValue, strText);
+                }
+            }
+            return nvc;
+        }
     }
 }

+ 15 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleCombinView.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+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_SchedulePersonView> PersonList { get; set; }
+    }
+}

+ 42 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleDetailView.cs

@@ -0,0 +1,42 @@
+using OASystem.Domain.Enums;
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    public class Grp_ScheduleDetailView
+    {
+        public int DetailId { get; set; }
+        /// <summary>
+        /// 根节点(主流程)
+        /// </summary>
+        public int Root { get; set; }
+        public int Step { get; set; }
+        public string StepName
+        {
+            get
+            {
+                NameValueCollection nvc = EnumHelper.GetNVCFromEnumValue(typeof(GrpSchedulePrimaryStepEnum));
+                string rst = nvc[this.Step.ToString()];
+                if (string.IsNullOrEmpty(rst))
+                {
+                    rst = Step.ToString();
+                }
+                return rst;
+            }
+        }
+        public int Duty { get; set; }
+        public string JobContent { get; set; }
+        public DateTime ExpectBeginDt { get; set; }
+        public DateTime ExpectEndDt { get; set; }
+        public DateTime RealEndDt { get; set; }
+        public string Remark { get; set; }
+        public int Exception { get; set; }
+        public int Level { get; set; }
+        public List<Grp_ScheduleDetailView> ChildList { get; set; }
+    }
+}

+ 17 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_SchedulePersonView.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    public class Grp_SchedulePersonView
+    {
+        public int PersonId { get; set; }
+        public int SysUserId { get; set; }
+        public string SysUserName { get; set; }
+        public string JobStr { get; set; }
+        public string PersonRemark { get; set; }
+    }
+}

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

@@ -49,11 +49,83 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <typeparam name="T"></typeparam>
         /// <param name="_dto"></param>
         /// <returns></returns>
-        public async Task<Grp_ScheduleView> GetView_GrpSchedule(Grp_ScheduleDto _dto)
+        public async Task<Grp_ScheduleCombinView> GetView_GrpSchedule(Grp_ScheduleDto _dto)
         {
-            Grp_ScheduleView _view = null;
+            Grp_ScheduleCombinView _view = new Grp_ScheduleCombinView();
+
+            #region 主流程
             string sql = this.SetSql_GrpScheduleDto(_dto);
-            _view = await _sqlSugar.SqlQueryable<Grp_ScheduleView>(sql).FirstAsync();
+            Grp_ScheduleView primary = await _sqlSugar.SqlQueryable<Grp_ScheduleView>(sql).FirstAsync();
+            #endregion
+            _view.Primary = primary;
+
+            #region 子节点
+
+            //子节点
+            List<Grp_ScheduleDetailInfo> detailEntityList = _sqlSugar.Queryable<Grp_ScheduleDetailInfo>().Where(s => s.IsDel != 1 && s.ScheduleId == _dto.ScheduleId).ToList();
+            List<Grp_ScheduleDetailView> childList = new List<Grp_ScheduleDetailView>();
+
+            //区分2级节点 3级节点
+            List<Grp_ScheduleDetailInfo> LV2List = detailEntityList.Where(s => s.SLevel == 2).ToList();
+            List<Grp_ScheduleDetailInfo> LV3List = detailEntityList.Where(s => s.SLevel == 3).ToList();
+            foreach (var item in LV2List)
+            {
+                Grp_ScheduleDetailView temp = new Grp_ScheduleDetailView();
+                temp.Duty = item.Duty;
+                temp.Exception = item.Exception;
+                temp.ExpectBeginDt = item.ExpectBeginDt;
+                temp.ExpectEndDt = item.ExpectEndDt;
+                temp.DetailId = item.Id;
+                temp.JobContent = item.JobContent;
+                temp.Level = item.SLevel;
+                temp.RealEndDt = item.RealEndDt;
+                temp.Remark = item.Remark;
+                temp.Root = item.ParentStep;
+                temp.Step = item.Step;
+
+                List<Grp_ScheduleDetailInfo> tempLv3List = LV3List.Where(s => s.ParentStep == item.Step).ToList();
+                List<Grp_ScheduleDetailView> tempChildList = new List<Grp_ScheduleDetailView>();
+                if (tempLv3List.Count > 0)
+                {
+                    foreach (var item2 in tempLv3List)
+                    {
+                        Grp_ScheduleDetailView temp2 = new Grp_ScheduleDetailView();
+                        temp2.Duty = item2.Duty;
+                        temp2.Exception = item2.Exception;
+                        temp2.ExpectBeginDt = item2.ExpectBeginDt;
+                        temp2.ExpectEndDt = item2.ExpectEndDt;
+                        temp2.DetailId = item2.Id;
+                        temp2.JobContent = item2.JobContent;
+                        temp2.Level = item2.SLevel;
+                        temp2.RealEndDt = item2.RealEndDt;
+                        temp2.Remark = item2.Remark;
+                        temp2.Root = item2.ParentStep;
+                        temp2.Step = item2.Step;
+                        tempChildList.Add(temp2);
+                    }
+                }
+                temp.ChildList = new List<Grp_ScheduleDetailView>(tempChildList);
+                childList.Add(temp);
+            }
+            #endregion
+            _view.ChildList = new List<Grp_ScheduleDetailView>(childList);
+
+            #region 流程人员
+            List<Grp_SchedulePersonInfo> personEntityList = _sqlSugar.Queryable<Grp_SchedulePersonInfo>().Where(s => s.IsDel != 1 && s.ScheduleId == _dto.ScheduleId).ToList();
+            List<Grp_SchedulePersonView> personList = new List<Grp_SchedulePersonView>();
+            foreach (var item in personEntityList)
+            {
+                Grp_SchedulePersonView temp = new Grp_SchedulePersonView();
+                temp.JobStr = item.JobStr;
+                temp.PersonId = item.Id;
+                temp.PersonRemark=item.Remark;
+                temp.SysUserId = item.SysUserId;
+                temp.SysUserName = item.SysUserName;
+                personList.Add(temp);
+            }
+            #endregion
+            _view.PersonList = new List<Grp_SchedulePersonView>(personList);
+
             return _view;
         }