Browse Source

解决program冲突

wangh 1 year ago
parent
commit
789474188f

+ 16 - 2
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -30,18 +30,32 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostConferenceList()
         {
-            List<Grp_DelegationInfo> listSource = _busRep.Query<Grp_DelegationInfo>(s => s.TeamDid == 691).ToList();
+            List<Grp_DelegationInfo> listSource = _busRep.Query<Grp_DelegationInfo>(s => s.TeamDid == 691 && s.IsDel == 0).ToList();
             List<GroupNameView> viewList = new List<GroupNameView>();
             foreach (var group in listSource)
             {
                 GroupNameView _view = new GroupNameView();
-                _view.Id=group.Id;
+                _view.Id = group.Id;
                 _view.GroupName = group.TeamName;
             }
 
             return Ok(JsonView(viewList));
         }
 
+        /// <summary>
+        /// 获取会务的采购物品计划清单
+        /// </summary>
+        /// <param name="ConfId">会务活动Id</param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostConfItemList(int ConfId)
+        {
+
+
+            return Ok(JsonView(false));
+        }
+
         #endregion
     }
 }

+ 12 - 6
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -35,14 +35,14 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostSearchGrpSchedule(string paras)
+        public async Task<IActionResult> PostSearchGrpSchedule(JsonDtoBase _jsonDto)
         {
-            if (string.IsNullOrEmpty(paras))
+            if (string.IsNullOrEmpty(_jsonDto.Paras))
             {
                 return Ok(JsonView(false, "参数为空"));
             }
 
-            Grp_ScheduleDto _ScheduleDto = JsonConvert.DeserializeObject<Grp_ScheduleDto>(paras);
+            Grp_ScheduleDto _ScheduleDto = JsonConvert.DeserializeObject<Grp_ScheduleDto>(_jsonDto.Paras);
             if (_ScheduleDto != null)
             {
                 if (_ScheduleDto.SearchType == 2)//获取列表
@@ -212,6 +212,7 @@ namespace OASystem.API.Controllers
         {
             try
             {
+                Logs("请求:" + JsonConvert.SerializeObject(dto));
                 var groupData = await _groupRepository.GroupOperation(dto);
                 if (groupData.Code != 0)
                 {
@@ -294,9 +295,14 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, groupData.Msg));
             }
 
+            TeamCodeView teamCodeView = new TeamCodeView
+            {
+                TourCode = groupData.Data
+            }; 
+
             GroupStepForDelegation.CreateWorkStep(dto.GroupId); //创建管控流程
 
-            return Ok(JsonView(groupData.Data));
+            return Ok(JsonView(teamCodeView));
         }
 
         /// <summary>
@@ -313,7 +319,7 @@ namespace OASystem.API.Controllers
             {
                 return Ok(JsonView(false, groupData.Msg));
             }
-            
+
             return Ok(JsonView(groupData.Data, groupData.Data.Count));
         }
 
@@ -358,7 +364,7 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(groupData.Data));
         }
 
-       
+
 
         #endregion
     }

+ 47 - 4
OASystem/OASystem.Api/Controllers/SmallFunController.cs

@@ -1,6 +1,13 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
 using OASystem.API.OAMethodLib.JuHeAPI;
+using OASystem.Domain.ViewModels.JuHeExchangeRate;
+using System.Buffers;
+using System.Collections.Specialized;
+using System.Text.Json;
+using System.Text.Json.Nodes;
+using System.Xml.Linq;
 
 namespace OASystem.API.Controllers
 {
@@ -22,20 +29,56 @@ namespace OASystem.API.Controllers
             this._juHeApiService = juHeApiService;
         }
 
+
+        #region 聚合汇率相关
         /// <summary>
-        /// 获取汇率
+        /// 获取汇率接口
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GetMsgList()
+        public async Task<IActionResult> GeExchangeRate()
         {
-            var msgData = await _juHeApiService.GetExchangeRateAsync();
+            string rateDataString = await RedisRepository.RedisFactory
+                                                         .CreateRedisRepository()
+                                                         .StringGetAsync<string>("OA2023JuHeExchangeRate");//string 取
+
+            //if (string.IsNullOrEmpty(rateDataString))
+            //{
+                var rateData = await _juHeApiService.GetExchangeRateAsync();
+                if (rateData.Resultcode == "200" && rateData.Error_code == 0)
+                {
+                    var data = rateData.Result;
+
+                    System.Text.Json.JsonSerializer.Deserialize<ListDictionary>(data.ToJson());
+
+
+                    var node = JsonNode.Parse(data.ToJson());
+                    var responseData = System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, dynamic>>(node);
+                //var responseData = System.Text.Json.JsonSerializer.Deserialize<ExchangeRateModel>(data);
+
+                //var responseData = JsonSerializer.Deserialize<Dictionary<string, dynamic>>(data);
+                //var node = JsonNode.Parse(data.ToJson());
+                //var myClass = node.GetValue<ExchangeRateModel>;
 
 
+                TimeSpan ts = DateTime.Now.AddMinutes(120) - DateTime.Now; //设置redis 过期时间 比 jwt 时间 快一分钟
+                    await RedisRepository.RedisFactory.CreateRedisRepository()
+                                                      .StringSetAsync<string>("OA2023JuHeExchangeRate", data.ToJson(), ts);//string 存
+                                                                                                                                                   //JsonObject.Create(data, ExchangeRateModel).ToJson();
+                }
+            //}
+
+           
+
             return Ok(JsonView(true));
         }
+        #endregion
+        /// <summary>
+        /// 获取汇率
+        /// </summary>
+        /// <returns></returns>
+
 
     }
 }

+ 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);
                     }

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/JuHeAPI/IJuHeApiService.cs

@@ -11,6 +11,6 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
         /// 获取汇率
         /// </summary>
         /// <returns></returns>
-        Task<string> GetExchangeRateAsync();
+        Task<JuHeAPIResult> GetExchangeRateAsync();
     }
 }

+ 34 - 20
OASystem/OASystem.Api/OAMethodLib/JuHeAPI/JuHeApiService.cs

@@ -1,6 +1,8 @@
-using OASystem.Domain.ViewModels.JuHeExchangeRate;
+using Dm;
+using OASystem.Domain.ViewModels.JuHeExchangeRate;
 using System.Net.Http;
 using System.Net.Http.Json;
+using System.Text.Json;
 using Ubiety.Dns.Core;
 
 namespace OASystem.API.OAMethodLib.JuHeAPI
@@ -16,11 +18,10 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
         /// <summary>
         /// 初始化
         /// </summary>
-        /// <param name="httpClient"></param>
-        public JuHeApiService(HttpClient httpClient)
+        /// <param name="clientFactory"></param>
+        public JuHeApiService(IHttpClientFactory clientFactory)
         {
-            _httpClient = httpClient;
-            _httpClient.BaseAddress = new Uri("http://web.juhe.cn:8080");
+            _httpClient = clientFactory.CreateClient("PublicJuHeApi"); ;
         }
 
         /// <summary>
@@ -28,27 +29,40 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
         /// </summary>
         /// <returns></returns>
         /// <exception cref="NotImplementedException"></exception>
-        public async Task<string> GetExchangeRateAsync()
+        public async Task<JuHeAPIResult> GetExchangeRateAsync()
         {
+            var result = new JuHeAPIResult() { Resultcode = "10000",Reason="未知错误" };
+
             string url = string.Format("/finance/exchange/rmbquot");
-            var parameters2 = new Dictionary<string, string>();
-            parameters2.Add("key", _appKey);//你申请的key 
-            parameters2.Add("type", "0"); //两种格式(0或者1,默认为0)
-            parameters2.Add("bank", "3"); //(0:工商银行,1:招商银行,2:建设银行,3:中国银行,4:交通银行,5:农业银行,默认为:0)
-            var httpContent = new StringContent(JsonConvert.SerializeObject(parameters2), Encoding.UTF8, "application/json");
-            var exchangeReq = await _httpClient.PostAsync(url, httpContent);
-            if (exchangeReq.IsSuccessStatusCode)
-            {
-                var stringResponse = await exchangeReq.Content.ReadAsStringAsync();
 
+            try
+            {
+                var exchangeReq = await _httpClient.PostAsync(url,
+                                    new FormUrlEncodedContent(new List<KeyValuePair<string, string>>()
+                                    {
+                                        new KeyValuePair<string, string>("key",_appKey),//你申请的key 
+                                        new KeyValuePair<string, string>("type","0"),   //两种格式(0或者1,默认为0)
+                                        new KeyValuePair<string, string>("bank","3")    //(0:工商银行,1:招商银行,2:建设银行,3:中国银行,
+                                                                                        //4:交通银行,5:农业银行,默认为:0)
+                                    }));
+                if (exchangeReq.IsSuccessStatusCode)
+                {
+                    var stringResponse = await exchangeReq.Content.ReadAsStringAsync();
 
+                    result = System.Text.Json.JsonSerializer.Deserialize<JuHeAPIResult>(stringResponse,
+                    new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
+                }
+                else
+                {
+                    result.Reason = "汇率接口请求失败!";
+                }
             }
-            else {
-               
+            catch (Exception ex)
+            {
+                result.Reason = ex.Message;
             }
-
-            throw new HttpRequestException(exchangeReq.ReasonPhrase);
-
+            
+            return result;
         }
     }
 }

+ 24 - 11
OASystem/OASystem.Api/Program.cs

@@ -36,7 +36,8 @@ builder.Services.AddControllers()
     });
 
 
-#region 上传文件 
+
+#region Cors
 builder.Services.AddCors(policy =>
 {
     policy.AddPolicy("Cors", opt => opt
@@ -45,20 +46,31 @@ builder.Services.AddCors(policy =>
     .AllowAnyMethod()
     .WithExposedHeaders("X-Pagination"));
 });
+#endregion
 
-//builder.Services.Configure<FormOptions>(options =>
+#region 上传文件 
+//builder.Services.AddCors(policy =>
 //{
-//    options.KeyLengthLimit = int.MaxValue;
-//    options.ValueLengthLimit = int.MaxValue;
-//    options.MultipartBodyLengthLimit = int.MaxValue;
-//    options.MultipartHeadersLengthLimit = int.MaxValue;
+//    policy.AddPolicy("Cors", opt => opt
+//    .AllowAnyOrigin()
+//    .AllowAnyHeader()
+//    .AllowAnyMethod()
+//    .WithExposedHeaders("X-Pagination"));
 //});
 
-//builder.Services.Configure<KestrelServerOptions>(options =>
-//{
-//    options.Limits.MaxRequestBodySize = int.MaxValue;
-//    options.Limits.MaxRequestBufferSize = int.MaxValue;
-//});
+builder.Services.Configure<FormOptions>(options =>
+{
+    options.KeyLengthLimit = int.MaxValue;
+    options.ValueLengthLimit = int.MaxValue;
+    options.MultipartBodyLengthLimit = int.MaxValue;
+    options.MultipartHeadersLengthLimit = int.MaxValue;
+});
+
+builder.Services.Configure<KestrelServerOptions>(options =>
+{
+    options.Limits.MaxRequestBodySize = int.MaxValue;
+    options.Limits.MaxRequestBufferSize = int.MaxValue;
+});
 
 #endregion
 
@@ -223,6 +235,7 @@ builder.Services.AddScoped<IMapper, Mapper>();
 #region 聚合API 服务
 builder.Services.AddControllersWithViews();
 builder.Services.AddSingleton<IJuHeApiService, JuHeApiService>();
+builder.Services.AddHttpClient("PublicJuHeApi", c => c.BaseAddress = new Uri("http://web.juhe.cn"));
 
 #endregion
 

+ 5 - 0
OASystem/OASystem.Domain/Dtos/DtoBase.cs

@@ -20,4 +20,9 @@ namespace OASystem.Domain.Dtos
         public int PageIndex { get; set; } = 1;
         public int PageSize { get; set; } = 10;
     }
+
+    public class JsonDtoBase
+    {
+        public string Paras { get; set; }
+    }
 }

+ 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; }
+    }
 }

+ 6 - 0
OASystem/OASystem.Domain/ViewModels/JuHeExchangeRate/JuHeAPIResult.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -89,4 +90,9 @@ namespace OASystem.Domain.ViewModels.JuHeExchangeRate
         public string? Time { get; set; }
     }
 
+
+    public record AclRecord
+    {
+        public Dictionary<string, StringCollection> ACL { get; set; }
+    }
 }

+ 47 - 48
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -1,4 +1,5 @@
-using OASystem.Domain;
+using Newtonsoft.Json;
+using OASystem.Domain;
 using OASystem.Domain.Dtos;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.UserDto;
@@ -53,7 +54,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                              Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
                                              Left Join Sys_Users su On gdi.JietuanOperator = su.Id
                                              Where gdi.IsDel = 0 
-                                             Order By VisitDate Desc");
+                                             Order By gdi.CreateTime Desc");
 
                 var _DelegationList = await _sqlSugar.SqlQueryable<DelegationListView>(sql).ToListAsync();
                 if (_DelegationList.Count > 0)
@@ -176,34 +177,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             if (dto.PortType == 1 || dto.PortType == 2) //web
             {
-                Grp_DelegationInfo groupInfo = new Grp_DelegationInfo()
-                {
-                    SalesQuoteNo = dto.SalesQuoteNo,
-                    TeamLevSId = dto.TeamLevSId,
-                    ClientName = dto.ClientName,
-                    ClientUnit = dto.ClientUnit,
-                    TeamName = dto.TeamName,
-                    TeamDid = dto.TeamDid,
-                    VisitDate = Convert.ToDateTime(dto.VisitDate),
-                    VisitCountry = dto.VisitCountry,
-                    VisitPurpose = dto.VisitPurpose,
-                    VisitDays = dto.VisitDays,
-                    VisitPNumber = dto.VisitPNumber,
-                    SpecialNeeds = dto.SpecialNeeds,
-                    OtherNeeds = dto.OtherNeeds,
-                    Remark = dto.Remark,
-                    JietuanOperator = dto.UserId,
-                    TellPhone = dto.TellPhone,
-                    CGRWSPBMMC = dto.CGRWSPBMMC,
-                    CGRWSPWH = dto.CGRWSPWH,
-                    ZZSCBMMC = dto.ZZSCBMMC,
-                    ZZSCSPWH = dto.ZZSCSPWH,
-                    TontractTime = Convert.ToDateTime(dto.TontractTime),
-                    PaymentMoney = dto.PaymentMoney,
-                    PayDay = dto.PayDay
-                };
-
-
                 if (dto.Status == 1) //添加
                 {
                     string selectSql = string.Format(@"Select * From Grp_DelegationInfo 
@@ -232,24 +205,50 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     //    }
                     //}
 
-                    groupInfo.SalesQuoteNo = dto.SalesQuoteNo;
-                    groupInfo.TourCode = "";
-                    groupInfo.SalesDate = DateTime.Now;
-                    groupInfo.IsState = 0; //默认团组未完成 0
-                    groupInfo.JietuanTime = DateTime.Now;
-                    groupInfo.IsDel = 0;
-                    groupInfo.BudgetCost = 0.00M;
-                    groupInfo.HotelComplain = 0;
-                    groupInfo.OPComplain = 0;
-                    groupInfo.OAComplain = 0;
-                    groupInfo.AirComplain = 0;
-                    groupInfo.VisaComplain = 0;
-                    groupInfo.CreateUserId = dto.UserId;
-                    groupInfo.CreateTime = DateTime.Now;
-                    groupInfo.DeleteUserId = null;
-                    groupInfo.DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss");
-
-                    var addId = await _sqlSugar.Insertable(groupInfo).ExecuteReturnIdentityAsync();
+                    Grp_DelegationInfo delegationInfo = new Grp_DelegationInfo()
+                    {
+                        SalesQuoteNo = dto.SalesQuoteNo,
+                        TeamLevSId = dto.TeamLevSId,
+                        ClientName = dto.ClientName,
+                        ClientUnit = dto.ClientUnit,
+                        TeamName = dto.TeamName,
+                        TeamDid = dto.TeamDid,
+                        VisitDate = Convert.ToDateTime(dto.VisitDate),
+                        VisitCountry = dto.VisitCountry,
+                        VisitPurpose = dto.VisitPurpose,
+                        VisitDays = dto.VisitDays,
+                        VisitPNumber = dto.VisitPNumber,
+                        SpecialNeeds = dto.SpecialNeeds,
+                        OtherNeeds = dto.OtherNeeds,
+                        Remark = dto.Remark,
+                        JietuanOperator = dto.UserId,
+                        TellPhone = dto.TellPhone,
+                        CGRWSPBMMC = dto.CGRWSPBMMC,
+                        CGRWSPWH = dto.CGRWSPWH,
+                        ZZSCBMMC = dto.ZZSCBMMC,
+                        ZZSCSPWH = dto.ZZSCSPWH,
+                        TontractTime = Convert.ToDateTime(dto.TontractTime),
+                        PaymentMoney = dto.PaymentMoney,
+                        PayDay = dto.PayDay,
+                        TourCode = "",
+                        SalesDate = DateTime.Now,
+                        IsState = 0, //默认团组未完成 0
+                        JietuanTime = DateTime.Now,
+                        IsDel = 0,
+                        BudgetCost = 0.00M,
+                        HotelComplain = 0,
+                        OPComplain = 0,
+                        OAComplain = 0,
+                        AirComplain = 0,
+                        VisaComplain = 0,
+                        CreateUserId = dto.UserId,
+                        CreateTime = DateTime.Now,
+                        DeleteUserId = null,
+                        DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss")
+                    };
+
+                    Log.Information("添加:"+ JsonConvert.SerializeObject(delegationInfo));
+                    var addId = await _sqlSugar.Insertable(delegationInfo).ExecuteReturnIdentityAsync();
                     if (addId > 0)
                     {
                         result.Code = 0;

+ 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();
         }