| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 | 
							- using OASystem.API.OAMethodLib;
 
- using OASystem.Domain.Dtos.Groups;
 
- using OASystem.Domain.Entities.Groups;
 
- using OASystem.Infrastructure.Repositories.Groups;
 
- using System.Configuration;
 
- namespace OASystem.API.OAMethodLibs
 
- {
 
-     /// <summary>
 
-     /// 团组流程管控
 
-     /// </summary>
 
-     public static class GroupStepForDelegation
 
-     {
 
-         /// <summary>
 
-         /// 创建流程管控
 
-         /// </summary>
 
-         /// <param name="Diid">团组Id</param>
 
-         public static async void CreateWorkStep(int DiId)
 
-         {
 
-             var _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();
 
-             //判断是否已存在团组的流程管控
 
-             Grp_ScheduleInfo check = _grpScheduleRep.Query(s => s.DiId == DiId).First();
 
-             if (check == null)
 
-             {
 
-                 _grpScheduleRep.BeginTran();
 
-                 GroupsConfig _groupConfig = AutofacIocManager.Instance.GetService<GroupsConfig>();
 
-                 #region 主流程
 
-                 Grp_ScheduleInfo _primary = new Grp_ScheduleInfo();
 
-                 _primary.CreateUserId = _groupConfig.AutoCreate;
 
-                 _primary.DiId = DiId;
 
-                 _primary.Exception = 0;
 
-                 _primary.ExpectBeginDt = DateTime.Now.AddDays(_groupConfig.ExBeginDays);
 
-                 _primary.ExpectEndDt = DateTime.Now.AddDays(_groupConfig.ExEndDays);
 
-                 _primary.Leader = _groupConfig.Leader;
 
-                 _primary.PrimaryStep = GrpSchedulePrimaryStepEnum.Wait;
 
-                 _primary.Remark = "请设置各流程预计开始/结束时间";
 
-                 int _primaryId = await _grpScheduleRep.AddAsync(_primary);
 
-                 if (_primaryId > 0)
 
-                 {
 
-                     #region 子流程
 
-                     #region 经费预算
 
-                     Grp_ScheduleDetailInfo grp_budget = new Grp_ScheduleDetailInfo();
 
-                     grp_budget.CreateTime = DateTime.Now;
 
-                     grp_budget.CreateUserId = _groupConfig.AutoCreate;
 
-                     //grp_budget.Duty=
 
-                     #endregion
 
-                     #endregion
 
-                 }
 
-                 else
 
-                 {
 
-                     _grpScheduleRep.RollbackTran();
 
-                 }
 
-                 #endregion
 
-                 _grpScheduleRep.CommitTran();
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |