Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 1 year ago
parent
commit
e2a0e258cd
39 changed files with 1934 additions and 123 deletions
  1. 67 0
      OASystem/OASystem.Api/Controllers/CRMController.cs
  2. 92 5
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  3. 122 2
      OASystem/OASystem.Api/Controllers/ResourceController.cs
  4. 0 1
      OASystem/OASystem.Api/Controllers/SystemController.cs
  5. 3 1
      OASystem/OASystem.Api/OAMethodLib/AutofacRegister.cs
  6. 408 10
      OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs
  7. 4 1
      OASystem/OASystem.Api/appsettings.json
  8. 8 0
      OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs
  9. 15 0
      OASystem/OASystem.Domain/Dtos/CRM/DeleClientAddDto.cs
  10. 19 0
      OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs
  11. 16 1
      OASystem/OASystem.Domain/Dtos/Groups/GroupsConfig.cs
  12. 32 0
      OASystem/OASystem.Domain/Dtos/Groups/Grp_ScheduleDetailDto.cs
  13. 2 1
      OASystem/OASystem.Domain/Dtos/Groups/Grp_ScheduleDto.cs
  14. 4 43
      OASystem/OASystem.Domain/Dtos/Resource/CarDataDto.cs
  15. 132 0
      OASystem/OASystem.Domain/Dtos/Resource/LocalGuideDataDto.cs
  16. 6 4
      OASystem/OASystem.Domain/Dtos/System/MessageDto.cs
  17. 13 5
      OASystem/OASystem.Domain/Entities/Customer/Crm_CustomerCert.cs
  18. 2 0
      OASystem/OASystem.Domain/Entities/Customer/Crm_VisaCustomerFamily.cs
  19. 6 0
      OASystem/OASystem.Domain/Entities/Customer/Crm_VisaCustomerSchool.cs
  20. 2 2
      OASystem/OASystem.Domain/Entities/Groups/Grp_DelegationJoinCustomer.cs
  21. 31 2
      OASystem/OASystem.Domain/Entities/Groups/Grp_ScheduleInfo.cs
  22. 5 3
      OASystem/OASystem.Domain/Entities/System/Sys_Message.cs
  23. 57 0
      OASystem/OASystem.Domain/Enums/EnumHelper.cs
  24. 258 19
      OASystem/OASystem.Domain/Enums/GrpScheduleEnum.cs
  25. 54 0
      OASystem/OASystem.Domain/ViewModels/CRM/VisaCustomerCompanyView.cs
  26. 95 0
      OASystem/OASystem.Domain/ViewModels/CRM/VisaDeleClientView.cs
  27. 18 0
      OASystem/OASystem.Domain/ViewModels/Group/DelegationInfoView.cs
  28. 15 0
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleCombinView.cs
  29. 42 0
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleDetailView.cs
  30. 17 0
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_SchedulePersonView.cs
  31. 13 0
      OASystem/OASystem.Domain/ViewModels/Resource/LocalGuideDataView.cs
  32. 9 3
      OASystem/OASystem.Domain/ViewModels/System/MessageView.cs
  33. 19 10
      OASystem/OASystem.Infrastructure/Repositories/BaseRepository.cs
  34. 54 0
      OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientCompanyRepository.cs
  35. 89 0
      OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientRepository.cs
  36. 28 1
      OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs
  37. 90 5
      OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs
  38. 2 4
      OASystem/OASystem.Infrastructure/Repositories/Login/LoginRepository.cs
  39. 85 0
      OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

+ 67 - 0
OASystem/OASystem.Api/Controllers/CRMController.cs

@@ -0,0 +1,67 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using OASystem.Infrastructure.Repositories.CRM;
+
+namespace OASystem.API.Controllers
+{
+    /// <summary>
+    /// 签证客户资料相关
+    /// </summary>
+    [Route("api/[controller]/[action]")]
+    //[ApiController]
+    public class CRMController : ControllerBase
+    {
+        private readonly VisaDeleClientCompanyRepository _clientCompanyRepository;
+        private readonly VisaDeleClientRepository _clientRepository;
+
+        /// <summary>
+        /// 初始化
+        /// </summary>
+        /// <param name="clientCompanyRepository"></param>
+        /// <param name="clientRepository"></param>
+        public CRMController(VisaDeleClientCompanyRepository clientCompanyRepository, VisaDeleClientRepository clientRepository)
+        {
+            this._clientCompanyRepository = clientCompanyRepository;
+            this._clientRepository = clientRepository;
+        }
+
+        /// <summary>
+        /// 获取签证客户公司列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetClientCompanyList(DtoBase dto)
+        { 
+            var clientCompanyData = await  _clientCompanyRepository.GetCrm_ClientCompanyList(dto);
+
+            if (clientCompanyData.Code != 0)
+            {
+                return Ok(JsonView(false, clientCompanyData.Msg == null ? "操作失败" : clientCompanyData.Msg));
+            }
+
+            return Ok(JsonView(clientCompanyData.Data, clientCompanyData.Data.Count));
+        }
+
+        /// <summary>
+        /// 获取签证客户列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetClientList(DtoBase dto)
+        {
+            var clientData = await _clientRepository.GetCrmList(dto);
+
+            if (clientData.Code != 0)
+            {
+                return Ok(JsonView(false, clientData.Msg == null ? "操作失败" : clientData.Msg));
+            }
+
+            return Ok(JsonView(clientData.Data, clientData.Data.Count));
+        }
+
+    }
+}

+ 92 - 5
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -2,6 +2,7 @@
 using Newtonsoft.Json.Serialization;
 using OASystem.API.OAMethodLibs;
 using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
 
@@ -34,7 +35,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostGrpSchedule(string paras)
+        public async Task<IActionResult> PostSearchGrpSchedule(string paras)
         {
             if (string.IsNullOrEmpty(paras))
             {
@@ -51,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));
@@ -66,11 +67,74 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(false, "暂无数据!"));
         }
 
+        /// <summary>
+        /// 修改团组流程管控详细表数据
+        /// </summary>
+        /// <param name="paras"></param>
+        /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public void testGrpSchedule()
+        public async Task<IActionResult> PostUpdateGrpScheduleDetail(Grp_ScheduleDetailUpdDto dto)
+        {
+            Grp_ScheduleDetailInfo _detail = _mapper.Map<Grp_ScheduleDetailInfo>(dto);
+            var result = await _grpScheduleRep._sqlSugar.Updateable<Grp_ScheduleDetailInfo>()
+                .Where(s => s.Id == dto.Id)
+                .UpdateColumns(s => new { s.Duty, s.ExpectBeginDt, s.ExpectEndDt, s.JobContent, s.Remark, s.StepStatus })
+                .ExecuteCommandAsync();
+            if (result > 0)
+            {
+                return Ok(JsonView(true, "保存成功!"));
+            }
+
+            return Ok(JsonView(false, "保存失败!"));
+        }
+
+        /// <summary>
+        /// 删除团组流程管控详细表数据,删除人Id请放在Duty
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<ActionResult> PostDeleteGrpScheduleDetail(Grp_ScheduleDetailUpdDto dto)
+        {
+            Grp_ScheduleDetailInfo _detail = _mapper.Map<Grp_ScheduleDetailInfo>(dto);
+            _detail.IsDel = 1;
+            _detail.DeleteUserId = dto.Duty;
+            _detail.DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            var result = await _grpScheduleRep._sqlSugar.Updateable<Grp_ScheduleDetailInfo>()
+               .Where(s => s.Id == dto.Id)
+               .UpdateColumns(s => new { s.IsDel, s.DeleteUserId, s.DeleteTime })
+               .ExecuteCommandAsync();
+            if (result > 0)
+            {
+                return Ok(JsonView(true, "删除成功!"));
+            }
+
+            return Ok(JsonView(false, "删除失败!"));
+        }
+
+        /// <summary>
+        /// 增加团组流程管控详细表数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<ActionResult> PostInsertGrpScheduleDetail(Grp_ScheduleDetailInsertDto dto)
         {
-            GroupStepForDelegation.CreateWorkStep(1228);
+            Grp_ScheduleDetailInfo _detail = _mapper.Map<Grp_ScheduleDetailInfo>(dto);
+            if (DateTime.Now < _detail.ExpectBeginDt)
+            {
+                _detail.StepStatus = 0;
+            }
+            else
+            {//若大于设置时间,不考虑设置的预计结束日期,统一视为进行中
+                _detail.StepStatus = 1;
+            }
+            var result = await _grpScheduleRep._sqlSugar.Insertable(_detail).ExecuteReturnIdentityAsync();
+            if (result > 0)
+            {
+                return Ok(JsonView(true, "添加成功!"));
+            }
+
+            return Ok(JsonView(false, "添加失败!"));
         }
 
         #endregion
@@ -151,7 +215,7 @@ namespace OASystem.API.Controllers
             catch (Exception ex)
             {
 
-                Logs("[response]" +  JsonConvert.SerializeObject( dto));
+                Logs("[response]" + JsonConvert.SerializeObject(dto));
                 Logs(ex.Message);
                 return Ok(JsonView(false, ex.Message));
             }
@@ -204,6 +268,29 @@ namespace OASystem.API.Controllers
 
             return Ok(JsonView(salesQuoteNo));
         }
+
+        /// <summary>
+        /// 获取团组名称 List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> GetGroupNameList(GroupNameDto dto)
+        {
+            var groupData = await _groupRepository.GetGroupNameList(dto);
+            if (groupData.Code != 0)
+            {
+                return Ok(JsonView(false, groupData.Msg));
+            }
+            
+
+            return Ok(JsonView(groupData.Data, groupData.Data.Count));
+        }
+
+        #endregion
+
+        #region 团组&签证
+
         #endregion
     }
 }

+ 122 - 2
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -12,12 +12,14 @@ namespace OASystem.API.Controllers
         private readonly IMapper _mapper;
         private readonly IConfiguration _config;
         private readonly CarDataRepository _carDataRep;
+        private readonly LocalGuideDataRepository _localGuideDataRep;
        
-        public ResourceController(IMapper mapper, IConfiguration config,CarDataRepository carDataRep)
+        public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep, LocalGuideDataRepository localGuideDataRep)
         {
             _mapper = mapper;
             _config = config;
             _carDataRep = carDataRep;
+            _localGuideDataRep = localGuideDataRep;
         }
         #region 车公司资料板块
 
@@ -92,6 +94,12 @@ namespace OASystem.API.Controllers
                 {
                     return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
                 }
+
+                var carDada = _carDataRep.QueryDto<Res_CarData, CarDataView>(a=>a.UnitArea==dto.UnitArea && a.UnitName==dto.UnitName && a.Contact==dto.Contact && a.ContactTel==dto.ContactTel).ToList();
+                if (carDada.Count!=0)
+                {
+                    return Ok(JsonView(false, "该信息已存在,请勿重复添加!"));
+                }
                 Res_CarData _CarData = _mapper.Map<Res_CarData>(dto);
                 int id = await _carDataRep.AddAsyncReturnId(_CarData);
                 if (id == 0) 
@@ -167,7 +175,7 @@ namespace OASystem.API.Controllers
             }
         }
         /// <summary>
-        /// 车公司信息修改
+        /// 车公司信息删除
         /// </summary>
         /// <returns></returns>
         [HttpPost]
@@ -188,5 +196,117 @@ namespace OASystem.API.Controllers
         }
         #endregion
 
+        #region 导游地接资料板块
+        /// <summary>
+        /// 导游地接资料查询
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QuerLocalGuide(DtoBase dto)
+        {
+            try
+            {
+                if (dto.PortType == 1)
+                {
+                    var LocalGuideData = _localGuideDataRep.QueryDto<Res_LocalGuideData, LocalGuideDataView>().ToList();
+                    if (LocalGuideData.Count == 0)
+                    {
+                        return Ok(JsonView(false, "暂无数据!"));
+                    }
+                    LocalGuideData = LocalGuideData.OrderByDescending(s => s.CreateTime).ToList();
+                    return Ok(JsonView(true, "查询成功", LocalGuideData));
+                }
+                else if (dto.PortType == 2)
+                {
+                    var LocalGuideData = _localGuideDataRep.QueryDto<Res_LocalGuideData, LocalGuideDataView>().ToList();
+                    if (LocalGuideData.Count == 0)
+                    {
+                        return Ok(JsonView(false, "暂无数据!"));
+                    }
+                    LocalGuideData = LocalGuideData.OrderByDescending(s => s.CreateTime).ToList();
+                    return Ok(JsonView(true, "查询成功", LocalGuideData));
+                }
+                else
+                {
+                    return Ok(JsonView(false, "请传入PortType参数!1:Web,2:Android,3:IOS"));
+                }
+
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+
+
+        }
+
+        /// <summary>
+        /// 导游地接信息操作(增改)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> LocalGuideOperation(LocalGuideOperationDto dto)
+        {
+            try
+            {
+                if (dto.UnitArea == "")
+                {
+                    return Ok(JsonView(false, "请检查单位区域是否填写!"));
+                }
+                if (dto.UnitName == "")
+                {
+                    return Ok(JsonView(false, "请检查单位名称是否填写!"));
+                }
+                if (dto.Contact == "")
+                {
+                    return Ok(JsonView(false, "请检查单位联系人是否填写!"));
+                }
+                if (dto.ContactTel == "")
+                {
+                    return Ok(JsonView(false, "请检查联系方式是否填写正确!"));
+                }
+
+                Result result = await _localGuideDataRep.LocalGuideOperation(dto);
+                if (result.Code != 0)
+                {
+                    return Ok(JsonView(false, result.Msg));
+                }
+                return Ok(JsonView(true, result.Msg, new { Id = result.Data }));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// 导游地接信息操作(删除)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> LocalGuideDel(LocalGuideDelDto dto)
+        {
+            try
+            {
+                var res = await _localGuideDataRep.SoftDeleteByIdAsync<Res_LocalGuideData>(dto.Id.ToString(),dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true,"删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        #endregion
     }
 }

+ 0 - 1
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -14,7 +14,6 @@ namespace OASystem.API.Controllers
     [Route("api/[controller]/[action]")]
     public class SystemController : ControllerBase
     {
-      
         private readonly CompanyRepository _syscomRep;
         private readonly DepartmentRepository _sysDepRep;
         private readonly UsersRepository _userRep;

+ 3 - 1
OASystem/OASystem.Api/OAMethodLib/AutofacRegister.cs

@@ -18,7 +18,9 @@ namespace OASystem.API.OAMethodLib
             _groupsConfig.Leader = int.Parse(AppSettingsHelper.Get(GroupsConfig.KEY, "Leader"));
             _groupsConfig.ExBeginDays = int.Parse(AppSettingsHelper.Get(GroupsConfig.KEY, "ExBeginDays"));
             _groupsConfig.ExEndDays = int.Parse(AppSettingsHelper.Get(GroupsConfig.KEY, "ExEndDays"));
-
+            _groupsConfig.DefaultUser = int.Parse(AppSettingsHelper.Get(GroupsConfig.KEY, "DefaultUser"));
+            _groupsConfig.Boss = int.Parse(AppSettingsHelper.Get(GroupsConfig.KEY, "Boss"));
+            _groupsConfig.FilterUser = AppSettingsHelper.Get(GroupsConfig.KEY, "FilterUser");
             builder.RegisterInstance<GroupsConfig>(_groupsConfig);
             #endregion
 

+ 408 - 10
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -1,8 +1,13 @@
-using OASystem.API.OAMethodLib;
+using Google.Protobuf.WellKnownTypes;
+using Microsoft.AspNetCore.DataProtection.KeyManagement;
+using OASystem.API.OAMethodLib;
+using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Enums;
 using OASystem.Infrastructure.Repositories.Groups;
 using System.Configuration;
+using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.OAMethodLibs
 {
@@ -12,14 +17,15 @@ namespace OASystem.API.OAMethodLibs
     /// </summary>
     public static class GroupStepForDelegation
     {
+        private readonly static GrpScheduleRepository _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();
 
         /// <summary>
         /// 创建流程管控
         /// </summary>
-        /// <param name="Diid">团组Id</param>
+        /// <param name="DiId">团组Id</param>
         public static async void CreateWorkStep(int DiId)
         {
-            var _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();
+            //var _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();
 
             //判断是否已存在团组的流程管控
             Grp_ScheduleInfo check = _grpScheduleRep.Query(s => s.DiId == DiId).First();
@@ -29,31 +35,336 @@ namespace OASystem.API.OAMethodLibs
                 _grpScheduleRep.BeginTran();
 
                 GroupsConfig _groupConfig = AutofacIocManager.Instance.GetService<GroupsConfig>();
+                DateTime dftBeginDt = DateTime.Now.AddDays(_groupConfig.ExBeginDays);//默认预计开始时间
+                DateTime dftEndDt = DateTime.Now.AddDays(_groupConfig.ExEndDays);//默认预计结束时间
 
                 #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.ExpectBeginDt = dftBeginDt;
+                _primary.ExpectEndDt = dftEndDt;
                 _primary.Leader = _groupConfig.Leader;
                 _primary.PrimaryStep = GrpSchedulePrimaryStepEnum.Wait;
-                _primary.Remark = "请设置各流程预计开始/结束时间";
+                _primary.Remark = "请设置各流程负责人、预计开始/结束时间";
                 int _primaryId = await _grpScheduleRep.AddAsync(_primary);
                 if (_primaryId > 0)
                 {
                     #region 子流程
+                    List<Grp_ScheduleDetailInfo> entityList = new List<Grp_ScheduleDetailInfo>();
 
+                    #region 模板
+                    Grp_ScheduleDetailInfo _model = new Grp_ScheduleDetailInfo();
+                    _model.CreateUserId = _groupConfig.AutoCreate;
+                    _model.Duty = _groupConfig.DefaultUser;
+                    _model.Exception = 0;
+                    _model.ExpectBeginDt = dftBeginDt;
+                    _model.ExpectEndDt = dftEndDt;
+                    _model.Remark = "未设置负责人";
+                    _model.ScheduleId = DiId;
+                    _model.StepStatus = 0;
+                    #endregion
                     #region 经费预算
+                    Grp_ScheduleDetailInfo grp_budget202 = _model.DeepClone();
+                    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 市场部人员报价对接/反馈
+                    //上传明细单
+                    Grp_ScheduleDetailInfo grp_feedback302 = _model.DeepClone();
+                    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);
+
+                    //录入最终总经费预算
+                    Grp_ScheduleDetailInfo grp_feedback303 = _model.DeepClone();
+                    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);
+
+                    //完成报价对接/反馈
+                    Grp_ScheduleDetailInfo grp_feedback304 = _model.DeepClone();
+                    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 (目前为空)报批流程
+
+                    #endregion
+                    #region 护照/签证
+                    //收集资料
+                    Grp_ScheduleDetailInfo grp_visa502 = _model.DeepClone();
+                    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);
+
+                    //取护照资料
+                    Grp_ScheduleDetailInfo grp_visa503 = _model.DeepClone();
+                    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);
 
-                    Grp_ScheduleDetailInfo grp_budget = new Grp_ScheduleDetailInfo();
-                    grp_budget.CreateTime = DateTime.Now;
-                    grp_budget.CreateUserId = _groupConfig.AutoCreate;
-                    //grp_budget.Duty=
+                    //填资料
+                    Grp_ScheduleDetailInfo grp_visa504 = _model.DeepClone();
+                    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);
 
+                    //送签
+                    Grp_ScheduleDetailInfo grp_visa505 = _model.DeepClone();
+                    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);
+
+                    //出签+取护照
+                    Grp_ScheduleDetailInfo grp_visa506 = _model.DeepClone();
+                    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);
+
+                    //归还护照
+                    Grp_ScheduleDetailInfo grp_visa507 = _model.DeepClone();
+                    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);
+
+                    //签证费用录入 
+                    Grp_ScheduleDetailInfo grp_visa508 = _model.DeepClone();
+                    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.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.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.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);
+                    //OP-OP费用录入
+                    Grp_ScheduleDetailInfo grp_busOP6033 = _model.DeepClone();
+                    grp_busOP6033.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessOPChild03);
+                    grp_busOP6033.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessOP;
+                    grp_busOP6033.Step = (int)GrpSchedulePrimaryStepEnum.BusinessOPChild03;
+                    grp_busOP6033.SLevel = 3;
+                    entityList.Add(grp_busOP6032);
+
+                    //商邀
+                    Grp_ScheduleDetailInfo grp_busSY604 = _model.DeepClone();
+                    grp_busSY604.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSY);
+                    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_busSY6043 = _model.DeepClone();
+                    grp_busSY6043.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSYChild03);
+                    grp_busSY6043.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessSY;
+                    grp_busSY6043.Step = (int)GrpSchedulePrimaryStepEnum.BusinessSYChild03;
+                    grp_busSY6043.SLevel = 3;
+                    entityList.Add(grp_busSY6043);
+
+
+                    #endregion
+                    #region 费用审批
+                    //机票费用审批
+                    Grp_ScheduleDetailInfo grp_cost702 = _model.DeepClone();
+                    grp_cost702.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild02);
+                    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();
+                    grp_cost703.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild03);
+                    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();
+                    grp_cost704.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild04);
+                    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();
+                    grp_cost705.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild05);
+                    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();
+                    grp_cost706.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild06);
+                    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 付款给供应商
+                    //OP费用付款
+                    Grp_ScheduleDetailInfo grp_pay802 = _model.DeepClone();
+                    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 (目前为空)出行事项会议
+
+                    #endregion
+                    #region (目前为空)送机
+
+                    #endregion
+                    #region (目前为空)接机
+
+                    #endregion
+                    #region 收款
+                    //收款完成
+                    Grp_ScheduleDetailInfo grp_col01 = _model.DeepClone();
+                    grp_col01.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CollectChild01);
+                    grp_col01.ParentStep = (int)GrpSchedulePrimaryStepEnum.Collect;
+                    grp_col01.Step = (int)GrpSchedulePrimaryStepEnum.CollectChild01;
+                    grp_col01.ExpectBeginDt = dftEndDt;
+                    grp_col01.ExpectEndDt = dftEndDt.AddMonths(3);
+                    grp_col01.SLevel = 2;
+                    entityList.Add(grp_col01);
+                    #endregion
+                    #region (目前为空)团组完成
+
+                    #endregion
+
+                    //SqlSugar批量添加
+                    _grpScheduleRep.bulkInsert(entityList);
+                    #endregion
+                    #region 流程管控成员
+                    string sqlPerson = string.Format(@"Select u.Id As SysUserId,u.CnName As SysUserName,JobName as JobStr 
+From Sys_Users As u With(Nolock) 
+Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id
+Inner Join Sys_JobPost as j With(Nolock) On u.JobPostId=j.Id
+Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser);
+
+                    List<Grp_SchedulePersonInfo> personList = await _grpScheduleRep.GetEntityList_SchedulePersonBySql(sqlPerson);
+                    if (personList.Count > 0)
+                    {
+                        foreach (var item in personList)
+                        {
+                            item.CreateUserId = _groupConfig.DefaultUser;
+                            item.ScheduleId = DiId;
+                        }
+                        _grpScheduleRep.bulkInsert(personList);
+                    }
 
                     #endregion
                 }
@@ -68,7 +379,94 @@ namespace OASystem.API.OAMethodLibs
 
         }
 
+        public static async void ChangeStepForPrimary(int DiId, GrpSchedulePrimaryStepEnum primary, int isDel, int exception, string remark)
+        {
+            //var _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();
+            string sqlPrimary = string.Format(@" Select * From Grp_Schedule With(Nolock) Where IsDel=0 And DiId={0} ", DiId);
+            Grp_ScheduleInfo _grpPrimaryInfo = _grpScheduleRep.GetSingleInfoBySqlWithNolock(sqlPrimary);
+            if (_grpPrimaryInfo != null)
+            {
+                _grpPrimaryInfo.PrimaryStep = primary;
+                _grpPrimaryInfo.IsDel = isDel;
+                _grpPrimaryInfo.Exception = exception;
+                _grpPrimaryInfo.Remark += ";" + remark;
+
+                var result = await _grpScheduleRep._sqlSugar.Updateable<Grp_ScheduleInfo>()
+                .Where(s => s.Id == _grpPrimaryInfo.Id)
+                .UpdateColumns(s => new { s.PrimaryStep, s.IsDel, s.Exception, s.Remark })
+                .ExecuteCommandAsync();
+            }
+        }
+
+        #region 流程管控步骤推进
+
+        /// <summary>
+        /// 刷新团组管控最新状态,或推进流程到下一节点
+        /// </summary>
+        /// <param name="scheduleId">团组流程Id</param>
+        public static async void RefreshWorkStep(int scheduleId, bool auto = false)
+        {
+            //var _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();
+            string sqlPrimary = string.Format(@" Select * From Grp_Schedule With(Nolock) Where IsDel=0 And Id={0} ", scheduleId);
+            Grp_ScheduleInfo _grpPrimaryInfo = _grpScheduleRep.GetSingleInfoBySqlWithNolock(sqlPrimary);
+            if (_grpPrimaryInfo != null)
+            {
+                List<Grp_ScheduleDetailInfo> _list = _grpScheduleRep._sqlSugar.Queryable<Grp_ScheduleDetailInfo>()
+                 .Where(s => s.ScheduleId == scheduleId && s.IsDel != 1 && s.ParentStep == (int)_grpPrimaryInfo.PrimaryStep && s.StepStatus != 2)
+                 .ToList();
+                if (_list.Count > 0)
+                {
+                    //未完成主流程节点下所有步骤任务
+                }
+                else
+                {
+                    //可推进节点
+                    if (auto)
+                    {
+                        int nextPrimaryStep = (int)_grpPrimaryInfo.PrimaryStep + 1;
+                        var result = await _grpScheduleRep._sqlSugar.Updateable<Grp_ScheduleInfo>()
+                            .Where(s => s.Id == _grpPrimaryInfo.Id)
+                            .UpdateColumns(s => new { nextPrimaryStep })
+                            .ExecuteCommandAsync();
+                    }
+                }
+
+                //eg:CheckStep_Budget
+                //switch (_grpPrimaryInfo.PrimaryStep)
+                //{
+                //    case GrpSchedulePrimaryStepEnum.Budget: CheckStep_Budget(scheduleId); break;
+                //}
+            }
+        }
+
+        /// <summary>
+        /// 暂无需求,先保存,可扩展至查询验证主流程下每一个详细流程步骤对应的业务操作是否完成,需要其他业务提供验证方法
+        /// 查看流程-经费预算
+        /// </summary>
+        /// <param name="scheduleId"></param>
+        /// <returns>true:已完成所有步骤,false:存在未完成的步骤(Grp_ScheduleDetail.StepStatus:0/1/2)</returns>
+        private static bool CheckStep_Budget(int scheduleId)
+        {
+            List<Grp_ScheduleDetailInfo> _list = _grpScheduleRep._sqlSugar.Queryable<Grp_ScheduleDetailInfo>()
+                 .Where(s => s.ScheduleId == scheduleId && s.IsDel != 1 && s.ParentStep == (int)GrpSchedulePrimaryStepEnum.Budget)
+                 .ToList();
+
+            foreach (var item in _list)
+            {
+                switch (item.Step)
+                {
+                    case (int)GrpSchedulePrimaryStepEnum.BudgetChild01:
+                        //验证方法
+                        break;
+                    case (int)GrpSchedulePrimaryStepEnum.BudgetChild02: break;
+
+                }
+            }
+
+            return false;
+        }
 
+        #endregion
 
     }
 

+ 4 - 1
OASystem/OASystem.Api/appsettings.json

@@ -8,6 +8,9 @@
     "AutoCreate": "4",
     "Leader": "149",
     "ExBeginDays": "3",
-    "ExEndDays": "30"
+    "ExEndDays": "30",
+    "DefaultUser": "51",
+    "Boss": "21",
+    "FilterUser": "51,180"
   }
 }

+ 8 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -58,13 +58,21 @@ namespace OASystem.Domain.AutoMappers
             #region Group
 
             CreateMap<GroupListDto, Grp_DelegationInfo>();
+            CreateMap<Grp_ScheduleDetailUpdDto, Grp_ScheduleDetailInfo>();
+            CreateMap<Grp_ScheduleDetailInsertDto, Grp_ScheduleDetailInfo>();
             #endregion
 
             #region Resource
+
             #region 车公司资料
             CreateMap<Res_CarData, CarDataView>();
             CreateMap<AddCarDataDto, Res_CarData>();
             #endregion
+
+            #region 导游地接资料
+            CreateMap<Res_LocalGuideData, LocalGuideDataView>();
+            CreateMap<LocalGuideOperationDto,Res_LocalGuideData>();
+            #endregion
             #endregion
         }
     }

+ 15 - 0
OASystem/OASystem.Domain/Dtos/CRM/DeleClientAddDto.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.CRM
+{
+    /// <summary>
+    /// 签证客户添加
+    /// </summary>
+    public class DeleClientAddDto
+    {
+    }
+}

+ 19 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs

@@ -184,4 +184,23 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public int UserId { get; set; }
     }
+
+    /// <summary>
+    /// 团组名称
+    /// </summary>
+    public class GroupNameDto : DtoBase
+    {
+    }
+
+    /// <summary>
+    /// 根据团组ID获取签证人员请
+    /// 求实体类
+    /// </summary>
+    public class ClientByGroupIdDto : DtoBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int GroupId { get; set; }
+    }
 }

+ 16 - 1
OASystem/OASystem.Domain/Dtos/Groups/GroupsConfig.cs

@@ -31,6 +31,21 @@ namespace OASystem.Domain.Dtos.Groups
         /// <summary>
         /// 团组默认结束日期(增加30天)
         /// </summary>
-        public int ExEndDays { get; set; }  
+        public int ExEndDays { get; set; }
+
+        /// <summary>
+        /// 默认用户Id(国交部共享号)
+        /// </summary>
+        public int DefaultUser { get; set; }
+
+        /// <summary>
+        /// 总经理Id
+        /// </summary>
+        public int Boss { get; set; }
+
+        /// <summary>
+        /// 屏蔽用户Id
+        /// </summary>
+        public string FilterUser { get; set; }
     }
 }

+ 32 - 0
OASystem/OASystem.Domain/Dtos/Groups/Grp_ScheduleDetailDto.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Groups
+{
+    public class Grp_ScheduleDetailUpdDto
+    {
+        public int Id { get; set; }
+        public int Duty { get; set; }
+        public int StepStatus { get; set; }
+        public string JobContent { get; set; }
+        public DateTime ExpectBeginDt { get; set; }
+        public DateTime ExpectEndDt { get; set; }
+        public string Remark { get; set; }
+    }
+
+    public class Grp_ScheduleDetailInsertDto
+    {
+        public int ScheduleId { get; set; }
+        public int Step { get; set; }
+        public int ParentStep { get; set; }
+        public int Duty { get; set; }
+        public string JobContent { get; set; }
+        public DateTime ExpectBeginDt { get; set; }
+        public DateTime ExpectEndDt { get; set; }
+        public int CreateUserId { get; set; }
+        public string Remark { get; set; }
+    }
+}

+ 2 - 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; }
 
@@ -31,5 +31,6 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public int SysUserId { get; set; }
 
+
     }
 }

+ 4 - 43
OASystem/OASystem.Domain/Dtos/Resource/CarDataDto.cs

@@ -35,27 +35,8 @@ namespace OASystem.Domain.Dtos.Resource
         /// <summary>
         /// 联系人手机号
         /// </summary>
-        private string contactTel;
-        public string ContactTel
-        {
-            get
-            {
-                return contactTel;
-            }
-            set
-            {
-                if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
-                {
-                    contactTel = value;
-                }
-                else
-                {
-                    contactTel = "";
-                }
-
-            }
-        }
-
+        public string ContactTel { get; set; }
+        
         /// <summary>
         /// 联系人邮箱
         /// </summary>
@@ -179,30 +160,10 @@ namespace OASystem.Domain.Dtos.Resource
         /// 联系人
         /// </summary>
         public string Contact { get; set; }
-
         /// <summary>
-        /// 联系人手机号
+        /// 联系方式
         /// </summary>
-        private string contactTel;
-        public string ContactTel
-        {
-            get
-            {
-                return contactTel;
-            }
-            set
-            {
-                if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
-                {
-                    contactTel = value;
-                }
-                else
-                {
-                    contactTel = "";
-                }
-
-            }
-        }
+        public string ContactTel { get; set; }
 
         /// <summary>
         /// 联系人邮箱

+ 132 - 0
OASystem/OASystem.Domain/Dtos/Resource/LocalGuideDataDto.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Resource
+{
+    /// <summary>
+    /// 地接导游修改添加参数
+    /// </summary>
+    public class LocalGuideOperationDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+
+        /// <summary>
+        /// 地接导游Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 区域
+        /// </summary>
+        public string UnitArea { get; set; }
+
+        /// <summary>
+        /// 公司名称
+        /// </summary>
+        public string UnitName { get; set; }
+
+        /// <summary>
+        /// 地址
+        /// </summary>
+        public string Address { get; set; }
+
+        /// <summary>
+        /// 联系人
+        /// </summary>
+        public string Contact { get; set; }
+
+        /// <summary>
+        /// 联系人手机号
+        /// </summary>
+        public string ContactTel { get; set; }
+        
+
+        /// <summary>
+        /// 联系人邮箱
+        /// </summary>
+        public string ContactEmail { get; set; }
+
+        /// <summary>
+        /// 联系人传真
+        /// </summary>
+        public string ContactFax { get; set; }
+
+        /// <summary>
+        /// 其他信息
+        /// </summary>
+        public string OtherInfo { get; set; }
+
+        /// <summary>
+        /// 服务评分
+        /// </summary>
+        public int Score { get; set; }
+
+        /// <summary>
+        /// 着装得体
+        /// A B C  选择
+        /// </summary>
+        public string SuitScore { get; set; }
+
+        /// <summary>
+        /// 服务意识强度
+        /// A B C  选择
+        /// </summary>
+        public string ServeScore { get; set; }
+
+        /// <summary>
+        /// 讲解水平专业
+        /// A B C  选择
+        /// </summary>
+        public string TalkProScore { get; set; }
+
+        /// <summary>
+        /// 时间概念强度
+        /// A B C  选择
+        /// </summary>
+        public string TimeScore { get; set; }
+
+        /// <summary>
+        /// 配合能力强,服从安排
+        /// A B C  选择
+        /// </summary>
+        public string FitScore { get; set; }
+
+        /// <summary>
+        /// 应变能力强
+        /// A B C  选择
+        /// </summary>
+        public string StrainScore { get; set; }
+
+        /// <summary>
+        /// 当地语言和中文表达流畅
+        /// A B C  选择
+        /// </summary>
+        public string LocalAndChineseScore { get; set; }
+
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
+
+    /// <summary>
+    /// 地接导游删除参数
+    /// </summary>
+    public class LocalGuideDelDto
+    {
+        public int Id { get; set; }
+        public int DeleteUserId { get; set; }
+    }
+}

+ 6 - 4
OASystem/OASystem.Domain/Dtos/System/MessageDto.cs

@@ -12,10 +12,12 @@ namespace OASystem.Domain.Dtos.System
     public class MessageDto
     {
         /// <summary>
-        /// 消息类型
-        /// 0 用户登录消息
-        /// 1 系统消息
-        /// 2 业务消息
+        /// 消息类型 
+        /// 0
+        /// 1 公告消息
+        /// 2 团组流程管控消息
+        /// 1 团组业务操作消息
+        /// 2 费用审核消息
         /// </summary>
         public int Type { get; set; }
 

+ 13 - 5
OASystem/OASystem.Domain/Entities/Customer/Crm_CustomerCert.cs

@@ -11,7 +11,6 @@ namespace OASystem.Domain.Entities.Customer
     /// </summary>
     [SugarTable("Crm_CustomerCert")]
     public class Crm_CustomerCert:EntityBase
-
     {
         /// <summary>
         /// 客户信息表Id
@@ -33,16 +32,19 @@ namespace OASystem.Domain.Entities.Customer
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string Country { get; set; }
+        
         /// <summary>
-        /// 目的地国家
+        /// 签发地区
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
-        public string TargetCountry { get; set; }
+        public string Area { get; set; }
+
         /// <summary>
-        /// 签发地区
+        /// 目的地国家
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
-        public string Area { get; set; }
+        public string TargetCountry { get; set; }
+
         /// <summary>
         /// 有效期起始时间
         /// </summary>
@@ -53,6 +55,12 @@ namespace OASystem.Domain.Entities.Customer
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
         public string ExpiryDt { get; set; }
+
+        /// <summary>
+        /// 身份证户籍地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string IDCardAddress { get; set; }
     }
 
 }

+ 2 - 0
OASystem/OASystem.Domain/Entities/Customer/Crm_VisaCustomerFamily.cs

@@ -15,6 +15,8 @@ namespace OASystem.Domain.Entities.Customer
         public int DcId { get; set; }
         /// <summary>
         /// 家庭成员称谓
+        /// SetData = 40  签证客户家人称谓  读取时使用 
+        /// 存储时 存储name
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string Appellation { get; set; }

+ 6 - 0
OASystem/OASystem.Domain/Entities/Customer/Crm_VisaCustomerSchool.cs

@@ -32,6 +32,12 @@ namespace OASystem.Domain.Entities.Customer
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(20)")]
         public string Teacher { get; set; }
+        /// <summary>
+        /// 学历
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string Education { get; set; }
+
         /// <summary>
         /// 所学课程或专业名称
         /// </summary>

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

@@ -16,11 +16,11 @@ namespace OASystem.Domain.Entities.Groups
         /// 团组表id
         /// </summary>
         [SugarColumn(IsNullable =true,ColumnDataType ="int")]
-        public int DiId { get; set; }
+        public int GrpDCId { get; set; }
         /// <summary>
         ///客户表Id
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
-        public int DcId { get; set; }
+        public int CrmDCId { get; set; }
     }
 }

+ 31 - 2
OASystem/OASystem.Domain/Entities/Groups/Grp_ScheduleInfo.cs

@@ -2,6 +2,8 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Runtime.Serialization;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -72,7 +74,7 @@ namespace OASystem.Domain.Entities.Groups
     /// 团组流程管控详细进度
     /// </summary>
     [SugarTable("Grp_ScheduleDetail")]
-    public class Grp_ScheduleDetailInfo : EntityBase
+    public class Grp_ScheduleDetailInfo : EntityBase, ICloneable
     {
         /// <summary>
         /// 团组流程Id
@@ -80,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>
@@ -93,7 +101,12 @@ namespace OASystem.Domain.Entities.Groups
         public int ParentStep { get; set; }
 
         /// <summary>
-        /// 流程状态(0/1/2 未完成/进行中/已完成)
+        /// 流程状态
+        /// <list type="table">
+        /// <item><para>0:待分配(未开始)</para></item>
+        /// <item><para>1:进行中</para></item>
+        /// <item><para>2:已完成</para></item>
+        /// </list>
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int StepStatus { get; set; }
@@ -139,6 +152,22 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int Exception { get; set; }
+
+        public object Clone()
+        {
+            return this.MemberwiseClone();
+        }
+
+        public Grp_ScheduleDetailInfo DeepClone()
+        {
+            using (Stream objectStream = new MemoryStream())
+            {
+                IFormatter formatter = new BinaryFormatter();
+                formatter.Serialize(objectStream, this);
+                objectStream.Seek(0, SeekOrigin.Begin);
+                return formatter.Deserialize(objectStream) as Grp_ScheduleDetailInfo;
+            }
+        }
     }
 
     /// <summary>

+ 5 - 3
OASystem/OASystem.Domain/Entities/System/Sys_Message.cs

@@ -13,9 +13,11 @@ namespace OASystem.Domain.Entities.System
     {
         /// <summary>
         /// 类型
-        /// 0 用户登录消息
-        /// 1 系统消息
-        /// 2 业务消息
+        /// 0 
+        /// 1 公告消息
+        /// 2 团组流程管控消息
+        /// 1 团组业务操作消息
+        /// 2 费用审核消息
         /// </summary>
         [SugarColumn(IsNullable = true,ColumnDataType = "int")]
         public int Type { get; set; }

+ 57 - 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;
@@ -35,5 +36,61 @@ namespace OASystem.Domain.Enums
                 return "";
             }
         }
+
+        //根据值获取枚举方法
+        public static Enum GetEnumByValue(Type enumType, string value)
+        {
+            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;
+        }
     }
 }

+ 258 - 19
OASystem/OASystem.Domain/Enums/GrpScheduleEnum.cs

@@ -13,100 +13,339 @@ namespace OASystem.Domain.Enums
     public enum GrpSchedulePrimaryStepEnum
     {
         /// <summary>
-        /// 未开始/等待任务分配
+        /// 未开始/等待任务分配 I
         /// </summary>
         [Description("未开始/等待任务分配")]
         Wait = 0,
 
         /// <summary>
-        /// 确认出团/任务分配
+        /// 确认出团/任务分配 I
         /// </summary>
         [Description("确认出团/任务分配完成")]
         Confirm = 1,
 
+        #region 经费预算
         /// <summary>
-        /// 经费预算
+        /// 经费预算 I
         /// </summary>
         [Description("经费预算")]
         Budget = 2,
         /// <summary>
-        /// 经费预算子流程01:完成经费预算
+        /// 经费预算自定义子流程 II
         /// </summary>
-        [Description("完成经费预算")]
         BudgetChild01 = 201,
         /// <summary>
-        /// 经费预算自定义子流程:
+        /// 经费预算子流程:完成经费预算 II
         /// </summary>
-        BudgetChildCustom = 2011,
+        [Description("完成经费预算")]
+        BudgetChild02 = 202,
+        #endregion
 
+        #region 市场部人员对接反馈
         /// <summary>
-        /// 市场部人员对接反馈
+        /// 市场部人员对接反馈 I
         /// </summary>
         [Description("市场部人员对接反馈")]
         Feedback = 3,
+        /// <summary>
+        /// 市场部人员对接反馈自定义子流程 II
+        /// </summary>
+        FeedbackChild01 = 301,
+        /// <summary>
+        /// 上传明细单 II
+        /// </summary>
+        [Description("上传明细单")]
+        FeedbackChild02 = 302,
+        /// <summary>
+        /// 录入最终总经费预算 II
+        /// </summary>
+        [Description("录入最终总经费预算")]
+        FeedbackChild03 = 303,
+        /// <summary>
+        /// 完成报价对接/反馈 II
+        /// </summary>
+        [Description("完成报价对接/反馈")]
+        FeedbackChild04 = 304,
+        #endregion
 
         /// <summary>
-        /// 报批流程
+        /// 报批流程 I
         /// </summary>
         [Description("报批流程")]
         Puote = 4,
 
+        #region 护照签证
+
         /// <summary>
-        /// 护照签证
+        /// 护照签证 I
         /// </summary>
         [Description("护照签证")]
         Visa = 5,
+        /// <summary>
+        /// 护照签证自定义子流程 II
+        /// </summary>
+        VisaChild01 = 501,
+        /// <summary>
+        /// 收集资料 II
+        /// </summary>
+        [Description("收集资料")]
+        VisaChild02 = 502,
+        /// <summary>
+        /// 取护照资料 II
+        /// </summary>
+        [Description("取护照资料")]
+        VisaChild03 = 503,
+        /// <summary>
+        /// 填资料 II
+        /// </summary>
+        [Description("填资料")]
+        VisaChild04 = 504,
+        /// <summary>
+        /// 送签 II
+        /// </summary>
+        [Description("送签")]
+        VisaChild05 = 505,
+        /// <summary>
+        /// 出签+取护照 II
+        /// </summary>
+        [Description("出签+取护照")]
+        VisaChild06 = 506,
+        /// <summary>
+        /// 归还护照 II
+        /// </summary>
+        [Description("归还护照")]
+        VisaChild07 = 507,
+        /// <summary>
+        /// 签证费用录入 II
+        /// </summary>
+        [Description("签证费用录入")]
+        VisaChild08 = 508,
+
+        #endregion
+
+        #region 业务操作
 
         /// <summary>
-        /// 业务流程
+        /// 业务流程 I
         /// </summary>
         [Description("业务操作")]
         Business = 6,
+        #region 机票
+        /// <summary>
+        /// 业务流程-机票 II
+        /// </summary>
+        [Description("业务流程-机票")]
+        BusinessJP = 601,
+        /// <summary>
+        /// 业务流程-机票-自定义子流程 III
+        /// </summary>
+        [Description("业务流程-机票-自定义子流程")]
+        BusinessJPChild01 = 6011,
+        /// <summary>
+        /// 业务流程-机票-询价并导入黑屏代码 III
+        /// </summary>
+        [Description("询价并导入黑屏代码")]
+        BusinessJPChild02 = 6012,
+        /// <summary>
+        /// 业务流程-机票-机票已占位 III
+        /// </summary>
+        [Description("机票已占位")]
+        BusinessJPChild03 = 6013,
+        /// <summary>
+        /// 业务流程-机票-已出票 III
+        /// </summary>
+        [Description("已出票")]
+        BusinessJPChild04 = 6014,
+        /// <summary>
+        /// 业务流程-机票-机票费用录入 III
+        /// </summary>
+        [Description("机票费用录入")]
+        BusinessJPChild05 = 6015,
+        #endregion
+        #region 酒店
+        /// <summary>
+        /// 业务流程-酒店 II
+        /// </summary>
+        [Description("业务流程-酒店")]
+        BusinessJD = 602,
+        /// <summary>
+        /// 业务流程-酒店-自定义子流程 III
+        /// </summary>
+        [Description("业务流程-酒店-自定义子流程")]
+        BusinessJDChild01 = 6021,
+        /// <summary>
+        /// 业务流程-酒店-酒店费用录入 III
+        /// </summary>
+        [Description("酒店费用录入")]
+        BusinessJDChild02 = 6022,
 
+        #endregion
+        #region OP
         /// <summary>
-        /// 费用审批
+        /// 业务流程-OP II
+        /// </summary>
+        [Description("业务流程-OP")]
+        BusinessOP = 603,
+        /// <summary>
+        /// 业务流程-OP-自定义子流程 III
+        /// </summary>
+        [Description("业务流程-OP-自定义子流程")]
+        BusinessOPChild01 = 6031,
+        /// <summary>
+        /// 业务流程-OP-OP询价 III
+        /// </summary>
+        [Description("OP询价")]
+        BusinessOPChild02 = 6032,
+        /// <summary>
+        /// 业务流程-OP-OP费用录入 III
+        /// </summary>
+        [Description("OP费用录入")]
+        BusinessOPChild03 = 6033,
+        #endregion
+        #region 商邀
+        /// <summary>
+        /// 业务流程-商邀 II
+        /// </summary>
+        [Description("业务流程-商邀")]
+        BusinessSY = 604,
+        /// <summary>
+        /// 业务流程-商邀-自定义子流程 III
+        /// </summary>
+        [Description("业务流程-商邀-自定义子流程")]
+        BusinessSYChild01 = 6041,
+        /// <summary>
+        /// 业务流程-商邀-商邀报批 III
+        /// </summary>
+        [Description("商邀报批")]
+        BusinessSYChild02 = 6042,
+        /// <summary>
+        /// 业务流程-商邀-商邀费用录入 III
+        /// </summary>
+        [Description("报批/商邀费用录入")]
+        BusinessSYChild03 = 6043,
+        #endregion
+        #region 其他
+        /// <summary>
+        /// 业务流程-其他 II
+        /// </summary>
+        [Description("业务流程-其他")]
+        BusinessQT = 605,
+        /// <summary>
+        /// 业务流程-商邀-自定义子流程 III
+        /// </summary>
+        [Description("业务流程-其他-自定义子流程")]
+        BusinessQTChild01 = 6051,
+        #endregion
+
+        #endregion
+
+        #region 费用审批
+
+        /// <summary>
+        /// 费用审批 I
         /// </summary>
         [Description("费用审批")]
         CostAudit = 7,
+        /// <summary>
+        /// /费用审批自定义子流程 II
+        /// </summary>
+        CostAuditChild01 = 701,
+        /// <summary>
+        /// 费用审批-机票费用审批 II
+        /// </summary>
+        [Description("机票费用审批")]
+        CostAuditChild02 = 702,
+        /// <summary>
+        /// 费用审批-酒店费用审批 II
+        /// </summary>
+        [Description("酒店费用审批")]
+        CostAuditChild03 = 703,
+        /// <summary>
+        /// 费用审批-OP费用审批 II
+        /// </summary>
+        [Description("OP费用审批")]
+        CostAuditChild04 = 704,
+        /// <summary>
+        /// 费用审批-商邀费用审批 II
+        /// </summary>
+        [Description("商邀费用审批")]
+        CostAuditChild05 = 705,
+        /// <summary>
+        /// 费用审批-增减款项审批 II
+        /// </summary>
+        [Description("增减款项审批")]
+        CostAuditChild06 = 706,
+
+        #endregion
+
+        #region 付款给供应商
 
         /// <summary>
-        /// 付款给供应商
+        /// 付款给供应商 I
         /// </summary>
         [Description("付款给供应商")]
         Pay = 8,
+        /// <summary>
+        /// 付款给供应商-自定义子流程 II
+        /// </summary>
+        PayChild01 = 801,
+        /// <summary>
+        /// 付款给供应商-OP费用付款 II
+        /// </summary>
+        [Description("OP费用付款")]
+        PayChild02 = 802,
+        /// <summary>
+        /// 付款给供应商-商邀费用付款 II
+        /// </summary>
+        [Description("商邀费用付款")]
+        PayChild03 = 803,
+        /// <summary>
+        /// 付款给供应商-增减款项付款 II
+        /// </summary>
+        [Description("增减款项付款")]
+        PayChild04 = 804,
+        #endregion
 
         /// <summary>
-        /// 出行事项会议
+        /// 出行事项会议 I
         /// </summary>
         [Description("出行事项会议")]
         Training = 9,
 
         /// <summary>
-        /// 送机
+        /// 送机 I
         /// </summary>
         [Description("送机")]
         DropOff = 10,
 
         /// <summary>
-        /// 接机
+        /// 接机 I
         /// </summary>
         [Description("接机")]
         PickUp = 11,
 
+        #region 已收款项
+
         /// <summary>
-        /// 收款
+        /// 收款 I
         /// </summary>
         [Description("收款")]
         Collect = 12,
+        /// <summary>
+        /// 收款 I
+        /// </summary>
+        [Description("收款完成")]
+        CollectChild01 = 1201,
+        #endregion
 
         /// <summary>
-        /// 团组完成
+        /// 团组完成 I 
         /// </summary>
         [Description("团组完成")]
         Finish = 13,
 
         /// <summary>
-        /// 团组取消
+        /// 团组取消 I
         /// </summary>
         [Description("团组取消")]
         Cancel = 14,

+ 54 - 0
OASystem/OASystem.Domain/ViewModels/CRM/VisaCustomerCompanyView.cs

@@ -0,0 +1,54 @@
+using OASystem.Domain.Entities.Customer;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.CRM
+{
+
+    /// <summary>
+    /// 
+    /// </summary>
+    public class VisaCustomerCompanyView : Crm_VisaCustomerCompany
+    { }
+
+
+    /// <summary>
+    /// 签证客户公司
+    /// 返回视图
+    /// </summary>
+    public class VisaCustomerCompanyListView
+    {
+        /// <summary>
+        /// ID
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 公司名称
+        /// </summary>
+        public string CompanyName { get; set; }
+
+        /// <summary>
+        /// 公司地址
+        /// </summary>
+        public string Address { get; set; }
+
+        /// <summary>
+        /// 公司邮编
+        /// </summary>
+        public string PostCodes { get; set; }
+
+        /// <summary>
+        /// 添加人姓名
+        /// </summary>
+        public string UserName { get; set; }
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        public DateTime CreateTime { get; set; }
+    }
+}

+ 95 - 0
OASystem/OASystem.Domain/ViewModels/CRM/VisaDeleClientView.cs

@@ -0,0 +1,95 @@
+using OASystem.Domain.Entities.Customer;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.CRM
+{
+    /// <summary>
+    /// 签证客户信息 View
+    /// </summary>
+    public class VisaDeleClientView: Crm_DeleClient
+    { }
+
+    /// <summary>
+    /// 签证客户信息 ListView
+    /// </summary>
+    public class VisaDeleClientListView 
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 客户姓名
+        /// </summary>
+        public string ClientName { get; set; }
+
+        /// <summary>
+        /// 所属公司
+        /// </summary>
+        public string CompanyName { get; set; }
+
+        /// <summary>
+        /// 性别 0 男  1 女
+        /// </summary>
+        public int Sex { get; set; }
+
+        /// <summary>
+        /// 婚姻状态
+        ///  0、1、2、3、4 (未设置、未婚、已婚、离异、丧偶)
+        /// </summary>
+        public int Marriage { get; set; }
+
+        /// <summary>
+        /// 客户座机
+        /// </summary>
+        public string LandlinePhone { get; set; }
+
+        /// <summary>
+        /// 客户手机号
+        /// </summary>
+        public string Tel { get; set; }
+
+        /// <summary>
+        /// 身份证号码
+        /// </summary>
+        public string IDNo { get; set; }
+
+        /// <summary>
+        /// 护照号码
+        /// </summary>
+        public string PassportNo { get; set; }
+    }
+
+    public class ClientByGroupIdView
+    {
+        /// <summary>
+        /// clientId
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 姓
+        /// </summary>
+        public string LastName { get; set; }
+
+        /// <summary>
+        /// 名称
+        /// </summary>
+        public string FirstName { get; set; }
+
+        /// <summary>
+        /// 手机号
+        /// </summary>
+        public string Tel { get; set; }
+
+        /// <summary>
+        /// 身份证No
+        /// </summary>
+        public string IdNo { get; set; }
+    }
+}

+ 18 - 0
OASystem/OASystem.Domain/ViewModels/Group/DelegationInfoView.cs

@@ -230,4 +230,22 @@ namespace OASystem.Domain.ViewModels.Group
     {
         public string SalesQuoteNo { get; set; }
     }
+
+    /// <summary>
+    /// 团组名称
+    /// 返回试图
+    /// </summary>
+    public class GroupNameView
+    {
+
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 团组名称
+        /// </summary>
+        public string GroupName { get; set; }
+    }
 }

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

+ 13 - 0
OASystem/OASystem.Domain/ViewModels/Resource/LocalGuideDataView.cs

@@ -0,0 +1,13 @@
+using OASystem.Domain.Entities.Resource;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Resource
+{
+    public class LocalGuideDataView:Res_LocalGuideData
+    {
+    }
+}

+ 9 - 3
OASystem/OASystem.Domain/ViewModels/System/MessageView.cs

@@ -18,9 +18,11 @@ namespace OASystem.Domain.ViewModels.System
     {
         /// <summary>
         /// 消息类型
-        /// 1 系统消息
-        /// 2 团组消息
-        /// 3 个人消息
+        /// 0 
+        /// 1 公告消息
+        /// 2 团组流程管控消息
+        /// 3 团组业务操作消息
+        /// 4费用
         /// </summary>
         public int Type { get; set; }
 
@@ -71,6 +73,10 @@ namespace OASystem.Domain.ViewModels.System
     {
         /// <summary>
         /// 消息类型
+        /// 1 公告消息
+        /// 2 团组流程管控消息
+        /// 3 团组业务操作消息
+        /// 4费用
         /// </summary>
         public int Type { get; set; }
 

+ 19 - 10
OASystem/OASystem.Infrastructure/Repositories/BaseRepository.cs

@@ -132,6 +132,24 @@ namespace OASystem.Infrastructure.Repositories
             return _sqlSugar.Insertable(entity).ExecuteReturnIdentityAsync();
         }
 
+        /// <summary>
+        /// 删除单挑数据,加上删除者Id
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="id"></param>
+        /// <param name="DeleteUserId"></param>
+        /// <returns></returns>
+        public virtual async Task<bool> SoftDeleteByIdAsync<T>(string id, int DeleteUserId) where T : EntityBase, new()
+        {
+            var result = await _sqlSugar.Updateable<TEntity>().Where(a => a.Id.Equals(id)).SetColumns(a => new TEntity()
+            {
+                IsDel = 1,
+                DeleteUserId = DeleteUserId,
+                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+            }).ExecuteCommandAsync();
+            return result > 0;
+        }
+
         #endregion
 
         public virtual Task<bool> AnyAsync(Expression<Func<TEntity, bool>> exp)
@@ -245,16 +263,7 @@ namespace OASystem.Infrastructure.Repositories
             }).ExecuteCommandAsync();
             return result > 0;
         }
-        public virtual async Task<bool> SoftDeleteByIdAsync<T>(string id,int DeleteUserId) where T : EntityBase, new()
-        {
-            var result = await _sqlSugar.Updateable<TEntity>().Where(a => a.Id.Equals(id)).SetColumns(a => new TEntity()
-            {
-                IsDel = 1,
-                DeleteUserId = DeleteUserId,
-                DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
-            }).ExecuteCommandAsync();
-            return result > 0;
-        }
+       
         public virtual async Task<bool> SoftDeleteAsync<T>(Expression<Func<TEntity, bool>> wherexp) where T : EntityBase, new()
         {
             var result = await _sqlSugar.Updateable<TEntity>().Where(wherexp).SetColumns(a => new TEntity()

+ 54 - 0
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientCompanyRepository.cs

@@ -0,0 +1,54 @@
+using OASystem.Domain;
+using OASystem.Domain.Dtos;
+using OASystem.Domain.Dtos.UserDto;
+using OASystem.Domain.Entities.Customer;
+using OASystem.Domain.ViewModels.CRM;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.CRM
+{
+    /// <summary>
+    /// 签证客户公司
+    /// 仓库
+    /// </summary>
+    public class VisaDeleClientCompanyRepository : BaseRepository<Crm_VisaCustomerCompany, VisaCustomerCompanyView>
+    {
+        public VisaDeleClientCompanyRepository(SqlSugarClient sqlSugar) :
+            base(sqlSugar){ }
+
+        /// <summary>
+        /// 签证客户公司 List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> GetCrm_ClientCompanyList(DtoBase dto)
+        {
+            Result result = new Result() { Code = -2 };
+
+            if (dto.PortType == 1 || dto.PortType == 2)
+            {
+                string sql = string.Format(@"Select ccc.Id,ccc.CompanyName,ccc.Address,ccc.PostCodes,su.CnName UserName,ccc.CreateTime 
+                                             From Crm_CustomerCompany ccc Inner Join Sys_Users su On ccc.CreateUserId = su.Id");
+
+                var _clientCompanyList = await _sqlSugar.SqlQueryable<VisaCustomerCompanyListView>(sql).ToListAsync();
+                if (_clientCompanyList.Count > 0)
+                {
+                    result.Code = 0;
+                    result.Msg = "成功!";
+                    result.Data = _clientCompanyList;
+                }
+                else
+                {
+                    result.Msg = "查询失败!";
+                }
+            }
+
+            return result;
+        }
+
+    }
+}

+ 89 - 0
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientRepository.cs

@@ -0,0 +1,89 @@
+using OASystem.Domain;
+using OASystem.Domain.Dtos;
+using OASystem.Domain.Dtos.UserDto;
+using OASystem.Domain.Entities.Customer;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.ViewModels.CRM;
+using OASystem.Domain.ViewModels.Group;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.CRM
+{
+    /// <summary>
+    /// 签证客户 仓库
+    /// </summary>
+    public class VisaDeleClientRepository : BaseRepository<Crm_DeleClient, VisaDeleClientView>
+    {
+        public VisaDeleClientRepository(SqlSugarClient sqlSugar) :
+            base(sqlSugar)
+        { }
+
+        /// <summary>
+        /// 签证客户list
+        /// </summary>
+        /// <param name="loginDto"></param>
+        /// <returns></returns>
+        public async Task<Result> GetCrmList(DtoBase dto)
+        {
+            Result result = new Result() { Code = -2 };
+            if (dto.PortType == 1 || dto.PortType == 2) 
+            {
+                string sql = string.Format(@"Select cdc.Id,LastName+FirstName ClientName,ccc.CompanyName,Sex,Marriage,
+                                             	    Phone LandlinePhone,Tel,crmCard1.CertNo IDNo,crmCard2.CertNo PassportNo
+                                             From Crm_DeleClient cdc
+                                             Left Join Crm_CustomerCompany ccc On cdc.crmCompanyId = ccc.Id
+                                             Left Join Crm_CustomerCert crmCard1 On crmCard1.SdId = 773 And  cdc.Id = crmCard1.DcId 
+                                             Left Join Crm_CustomerCert crmCard2 On crmCard2.SdId = 774 And  cdc.Id = crmCard2.DcId ");
+
+
+                var clientList = await _sqlSugar.SqlQueryable<VisaDeleClientListView>(sql).ToListAsync();
+
+                if (clientList.Count > 0)
+                {
+                    result.Code = 0;
+                    result.Msg = "成功!";
+                    result.Data = clientList;
+                }
+                else
+                {
+                    result.Msg = "暂无数据!";
+                }
+            }
+
+            return result;
+        }
+
+
+        /// <summary>
+        /// 签证客户操作
+        /// </summary>
+        /// <param name="loginDto"></param>
+        /// <returns></returns>
+        public async Task<Result> CrmClinetoperation(LoginDto loginDto)
+        {
+            Result result = new Result() { Code = -2 };
+
+            return result;
+        }
+
+        /// <summary>
+        /// 签证客户 新增
+        /// </summary>
+        /// <param name="loginDto"></param>
+        /// <returns></returns>
+        public async Task<int> CrmClinetAdd(Crm_DeleClient  client)
+        {
+            int addId = -1;
+
+            
+
+
+            return addId;
+        }
+
+    }
+}

+ 28 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -321,7 +321,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
-
         /// <summary>
         /// 团组信息操作
         /// </summary>
@@ -411,6 +410,34 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
+        /// <summary>
+        /// 获取接团名称List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> GetGroupNameList(GroupNameDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+
+            if (dto.PortType == 1 || dto.PortType == 2) //web
+            {
+                string sql = string.Format(@"Select Id,TeamName GroupName From  Grp_DelegationInfo 
+                                             Where TeamName != '' And IsDel = 0
+                                             Order By Id Desc");
 
+                var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
+                if (_groupNameList.Count > 0)
+                {
+                    result.Code = 0;
+                    result.Msg = "成功!";
+                    result.Data = _groupNameList;
+                }
+                else
+                {
+                    result.Msg = "暂无团组信息";
+                }
+            }
+            return result;
+        }
     }
 }

+ 90 - 5
OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs

@@ -49,26 +49,111 @@ 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;
         }
 
+        /// <summary>
+        /// 获取团组流程(列表分页)
+        /// </summary>
+        /// <param name="_dto"></param>
+        /// <returns></returns>
         public async Task<List<Grp_ScheduleView>> GetViewList_GrpSchedule(Grp_ScheduleDto _dto)
         {
             List<Grp_ScheduleView> _viewList = new List<Grp_ScheduleView>();
             string sqlInner = this.SetSql_GrpScheduleDto(_dto);
             string sql = string.Format(@" Select * From ( Select ROW_NUMBER() Over(order By Id desc) as RowNumber,* From ( {2} ) ) as tb Where tb.RowNumber Between {0} And {1} ", (((_dto.PageIndex > 0) ? (_dto.PageIndex - 1) : 0) * _dto.PageSize) + 1, (((_dto.PageIndex > 0) ? (_dto.PageIndex - 1) : 0) + 1) * _dto.PageSize, sqlInner);
-
             _viewList = await _sqlSugar.SqlQueryable<Grp_ScheduleView>(sql).ToListAsync();
-
             return _viewList;
         }
 
+        public void bulkInsert<T>(List<T> list)
+        {
+            _sqlSugar.Insertable(list).UseParameter().ExecuteCommand();
+        }
 
+        public async Task<List<Grp_SchedulePersonInfo>> GetEntityList_SchedulePersonBySql(string sql)
+        {
+            List<Grp_SchedulePersonInfo> _list = new List<Grp_SchedulePersonInfo>();
+            _list = await _sqlSugar.SqlQueryable<Grp_SchedulePersonInfo>(sql).ToListAsync();
+            return _list;
+        }
 
     }
 }

+ 2 - 4
OASystem/OASystem.Infrastructure/Repositories/Login/LoginRepository.cs

@@ -12,10 +12,8 @@ namespace OASystem.Infrastructure.Repositories.Login
 {
     public class LoginRepository : BaseRepository<Sys_Users, LoginView>
     {
-        public LoginRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
-        {
-            
-        }
+        public LoginRepository(SqlSugarClient sqlSugar) : 
+            base(sqlSugar){}
 
         /// <summary>
         /// 用户登录

+ 85 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -0,0 +1,85 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Resource;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.ViewModels.Resource;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Resource
+{
+    public class LocalGuideDataRepository : BaseRepository<Res_LocalGuideData, LocalGuideDataView>
+    {
+        private readonly IMapper _mapper;
+        public LocalGuideDataRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            _mapper=mapper;
+        }
+        public async Task<Result> LocalGuideOperation(LocalGuideOperationDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                    string selectSql = string.Format(@"select * from Res_LocalGuideData where UnitArea='{0}' and UnitName='{1}' and Contact='{2}' and ContactTel='{3}'"
+                                                       , dto.UnitArea, dto.UnitName, dto.Contact, dto.ContactTel);
+                    var LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(selectSql).FirstAsync();//查询是否存在
+                    if (LocalGuideData != null)
+                    {
+                         return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+                         
+                    }
+                    else//不存在,可添加
+                    {
+                        Res_LocalGuideData _LocalGuideDat = _mapper.Map<Res_LocalGuideData>(dto);
+                        int id = await AddAsyncReturnId(_LocalGuideDat);
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+
+                        }
+                         result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
+                    }
+                }
+                else if(dto.Status == 2)//修改
+                {
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Res_LocalGuideData
+                    {
+                        UnitArea = dto.UnitArea,
+                        UnitName = dto.UnitName,
+                        Address = dto.Address,
+                        Contact = dto.Contact,
+                        ContactTel = dto.ContactTel,
+                        ContactEmail = dto.ContactEmail,
+                        ContactFax = dto.ContactFax,
+                        OtherInfo = dto.OtherInfo,
+                        Score = dto.Score,
+                        SuitScore = dto.SuitScore,
+                        ServeScore = dto.ServeScore,
+                        TalkProScore = dto.TalkProScore,
+                        TimeScore = dto.TimeScore,
+                        FitScore = dto.FitScore,
+                        StrainScore = dto.StrainScore,
+                        LocalAndChineseScore = dto.LocalAndChineseScore,
+                        Remark = dto.Remark,
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    result = new Result() { Code = 0, Msg = "修改成功!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+            return result;
+        }
+    }
+}