Browse Source

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

leiy 1 year ago
parent
commit
e2d0b382d5

+ 1 - 0
OASystem/EntitySync/Program.cs

@@ -99,5 +99,6 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Fin_ForeignReceivables),    // 对外收款账单
     //typeof(Fin_ForeignReceivables),    // 对外收款账单
     //typeof(Fin_ProceedsReceived),      // 已收款项
     //typeof(Fin_ProceedsReceived),      // 已收款项
     //typeof(Fin_OtherPrice),            // 其他款项
     //typeof(Fin_OtherPrice),            // 其他款项
+    //typeof(Res_OfficialActivities)     //公务出访
 });
 });
 Console.WriteLine("数据库结构同步完成!");
 Console.WriteLine("数据库结构同步完成!");

+ 91 - 13
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -18,6 +18,7 @@ using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 using Cell = Aspose.Words.Tables.Cell;
 using Cell = Aspose.Words.Tables.Cell;
 using Row = Aspose.Words.Tables.Row;
 using Row = Aspose.Words.Tables.Row;
 using System.Runtime.Intrinsics.Arm;
 using System.Runtime.Intrinsics.Arm;
+using Microsoft.AspNetCore.Mvc.Filters;
 
 
 namespace OASystem.API.Controllers
 namespace OASystem.API.Controllers
 {
 {
@@ -208,6 +209,23 @@ namespace OASystem.API.Controllers
 
 
             return Ok(JsonView(groupData.Data));
             return Ok(JsonView(groupData.Data));
         }
         }
+        /// <summary>
+        ///  获取团组所有信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetGroupAllList()
+        {
+            List<Grp_DelegationInfo> _DelegationInfos=_sqlSugar.Queryable<Grp_DelegationInfo>().Where(a=>a.IsDel==0).OrderBy(a=>a.CreateTime,OrderByType.Desc).ToList();
+            if (_DelegationInfos.Count == 0)
+            {
+                return Ok(JsonView(false, "暂无数据!"));
+            }
+
+            return Ok(JsonView(true,"查询成功!",_DelegationInfos));
+        }
 
 
         /// <summary>
         /// <summary>
         ///  接团信息详情
         ///  接团信息详情
@@ -1631,6 +1649,10 @@ namespace OASystem.API.Controllers
         }
         }
 
 
 
 
+
+        #endregion
+
+        #region 文件上传、删除
         /// <summary>
         /// <summary>
         /// region 文件上传  可以带参数
         /// region 文件上传  可以带参数
         /// </summary>
         /// </summary>
@@ -1642,18 +1664,37 @@ namespace OASystem.API.Controllers
         {
         {
             try
             try
             {
             {
+                var TypeName = Request.Headers["TypeName"].ToString();
                 if (file != null)
                 if (file != null)
                 {
                 {
                     var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
                     var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
-                    if (!Directory.Exists(fileDir))
-                    {
-                        Directory.CreateDirectory(fileDir);
-                    }
                     //文件名称
                     //文件名称
                     string projectFileName = file.FileName;
                     string projectFileName = file.FileName;
 
 
                     //上传的文件的路径
                     //上传的文件的路径
-                    string filePath = fileDir + $@"\{projectFileName}";
+                    string filePath = "";
+                    if (TypeName == "A")//A代表团组增减款项
+                    {
+
+                        if (!Directory.Exists(fileDir))
+                        {
+                            Directory.CreateDirectory(fileDir);
+                        }
+
+                        //上传的文件的路径
+                        filePath = fileDir + $@"\团组增减款项相关文件\{projectFileName}";
+
+                    }
+                    else if (TypeName == "B")//B代表商邀相关文件
+                    {
+                        if (!Directory.Exists(fileDir))
+                        {
+                            Directory.CreateDirectory(fileDir);
+                        }
+
+                        //上传的文件的路径
+                        filePath = fileDir + $@"\商邀相关文件\{projectFileName}";
+                    }
                     using (FileStream fs = System.IO.File.Create(filePath))
                     using (FileStream fs = System.IO.File.Create(filePath))
                     {
                     {
                         file.CopyTo(fs);
                         file.CopyTo(fs);
@@ -1671,7 +1712,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "程序错误!"));
                 return Ok(JsonView(false, "程序错误!"));
                 throw;
                 throw;
             }
             }
-            
+
         }
         }
         /// <summary>
         /// <summary>
         /// 删除指定文件
         /// 删除指定文件
@@ -1684,13 +1725,27 @@ namespace OASystem.API.Controllers
         {
         {
             try
             try
             {
             {
+                var TypeName = Request.Headers["TypeName"].ToString();
+                string filePath = "";
                 var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
                 var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
                 // 返回与指定虚拟路径相对应的物理路径即绝对路径
                 // 返回与指定虚拟路径相对应的物理路径即绝对路径
-                string filePath = fileDir+ dto.fileName;
+                int id = 0;
-                // 删除该文件
+                if (TypeName == "A")
-                System.IO.File.Delete(filePath);
+                {
-                int id= await _sqlSugar.Updateable<Grp_DecreasePayments>().Where(a => a.Id == dto.Id).SetColumns(a => new Grp_DecreasePayments {FilePath="" }).ExecuteCommandAsync();
+                    filePath = fileDir + "/团组增减款项相关文件/" + dto.fileName;
-                if (id!=0)
+                    // 删除该文件
+                    System.IO.File.Delete(filePath);
+                    id = await _sqlSugar.Updateable<Grp_DecreasePayments>().Where(a => a.Id == dto.Id).SetColumns(a => new Grp_DecreasePayments { FilePath = "" }).ExecuteCommandAsync();
+
+                }
+                else if (TypeName == "B")
+                {
+                    filePath = fileDir + "/商邀相关文件/" + dto.fileName;
+                    // 删除该文件
+                    System.IO.File.Delete(filePath);
+                    id = await _sqlSugar.Updateable<Grp_InvitationOfficialActivities>().Where(a => a.Id == dto.Id).SetColumns(a => new Grp_InvitationOfficialActivities { Attachment = "" }).ExecuteCommandAsync();
+                }
+                if (id != 0)
                 {
                 {
                     return Ok(JsonView(true, "成功!"));
                     return Ok(JsonView(true, "成功!"));
                 }
                 }
@@ -1698,7 +1753,6 @@ namespace OASystem.API.Controllers
                 {
                 {
                     return Ok(JsonView(false, "失败!"));
                     return Ok(JsonView(false, "失败!"));
                 }
                 }
-                
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
@@ -1782,9 +1836,33 @@ namespace OASystem.API.Controllers
                 throw;
                 throw;
             }
             }
         }
         }
-
+        /// <summary>
+        /// 商邀删除
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelInvitationOfficialActivities(DelBaseDto dto)
+        {
+            try
+            {
+                var res = await _InvitationOfficialActivitiesRep.SoftDeleteByIdAsync<Grp_InvitationOfficialActivities>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
 
 
         #endregion
         #endregion
 
 
+
     }
     }
 }
 }

+ 181 - 8
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1,5 +1,6 @@
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Dtos.Resource;
+using OASystem.Domain.Entities.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
 using System.Collections.Generic;
 using System.Collections.Generic;
 
 
@@ -23,11 +24,14 @@ namespace OASystem.API.Controllers
         private readonly CountryFeeRepository _countryFeeRep;
         private readonly CountryFeeRepository _countryFeeRep;
         private readonly SetDataTypeRepository _setDataTypeRep;
         private readonly SetDataTypeRepository _setDataTypeRep;
         private readonly AirTicketAgentRepository _airTicketAgentRep;
         private readonly AirTicketAgentRepository _airTicketAgentRep;
+        private readonly InvitationOfficialActivityDataRepository _InvitationOfficialActivityDataRep;
+        private readonly OfficialActivitiesRepository _officialActivitiesRep;
 
 
         public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep,
         public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep,
             LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
             LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
             HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
             HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
-            CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep)
+            CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep,
+            InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep, OfficialActivitiesRepository officialActivitiesRep)
         {
         {
             _mapper = mapper;
             _mapper = mapper;
             _config = config;
             _config = config;
@@ -40,6 +44,8 @@ namespace OASystem.API.Controllers
             _countryFeeRep = countryFeeRep;
             _countryFeeRep = countryFeeRep;
             _setDataTypeRep = setDataTypeRep;
             _setDataTypeRep = setDataTypeRep;
             _airTicketAgentRep = airTicketAgentRep;
             _airTicketAgentRep = airTicketAgentRep;
+            _InvitationOfficialActivityDataRep = invitationOfficialActivityDataRep;
+            _officialActivitiesRep = officialActivitiesRep;
         }
         }
 
 
 
 
@@ -542,15 +548,15 @@ namespace OASystem.API.Controllers
                                 break;
                                 break;
                             }
                             }
                         }
                         }
-                        return Ok(JsonView(true, "查询成功!",new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _AirTicketAgent }));
+                        return Ok(JsonView(true, "查询成功!", new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _AirTicketAgent }));
-                       
+
                     }
                     }
                 }
                 }
                 else
                 else
                 {
                 {
                     return Ok(JsonView(false, "暂无数据!"));
                     return Ok(JsonView(false, "暂无数据!"));
                 }
                 }
-                
+
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
@@ -558,6 +564,7 @@ namespace OASystem.API.Controllers
                 throw;
                 throw;
             }
             }
         }
         }
+
         /// <summary>
         /// <summary>
         /// 代理出票合作方资料操作(Status:1.新增,2.修改)
         /// 代理出票合作方资料操作(Status:1.新增,2.修改)
         /// </summary>
         /// </summary>
@@ -569,7 +576,7 @@ namespace OASystem.API.Controllers
         {
         {
             try
             try
             {
             {
-                
+
                 if (dto.Account == "")
                 if (dto.Account == "")
                 {
                 {
                     return Ok(JsonView(false, "请检查代理商账户是否填写!"));
                     return Ok(JsonView(false, "请检查代理商账户是否填写!"));
@@ -1348,8 +1355,174 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
 
         #endregion
         #endregion
 
 
-       
+        #region 商邀资料
-    }
+        /// <summary>
-
+        /// 商邀资料查询
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryInvitationOfficialActivityData(QueryInvitationOfficialActivityDataDto dto)
+        {
+            try
+            {
+                Result groupData = await _InvitationOfficialActivityDataRep.QueryInvitationOfficialActivityData(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 根据商邀资料Id查询信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryInvitationOfficialActivityById(QueryInvitationOfficialActivityByIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _InvitationOfficialActivityDataRep.QueryInvitationOfficialActivityById(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 商邀资料操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OpInvitationOfficialActivity(OpInvitationOfficialActivityDto dto)
+        {
+            try
+            {
+                Result groupData = await _InvitationOfficialActivityDataRep.OpInvitationOfficialActivity(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 删除商邀资料信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelInvitationOfficialActivity(DelBaseDto dto)
+        {
+            try
+            {
+                var res = await _InvitationOfficialActivityDataRep.SoftDeleteByIdAsync<Res_InvitationOfficialActivityData>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
 
 
+        #region 公务出访
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryOfficialActivitiesByDiId(OfficialActivitiesByDiIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _officialActivitiesRep.QueryOfficialActivitiesByDiId(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 根据公务出访数据Id查询数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryOfficialActivitiesById(OfficialActivitiesDiIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _officialActivitiesRep.QueryOfficialActivitiesById(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        /// <summary>
+        /// 公务出访操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OpOfficialActivities(OpOfficialActivitiesDto dto)
+        {
+            try
+            {
+                Result groupData = await _officialActivitiesRep.OpOfficialActivities(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        #endregion
+    }
+    #endregion
 }
 }
+

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

@@ -138,6 +138,13 @@ namespace OASystem.Domain.AutoMappers
 
 
             CreateMap<Edit_ResItemInfoDto, Res_ItemDetailInfo>();
             CreateMap<Edit_ResItemInfoDto, Res_ItemDetailInfo>();
             #endregion
             #endregion
+            #region 商邀资料
+            CreateMap<OpInvitationOfficialActivityDto, Res_InvitationOfficialActivityData>();
+            #endregion
+
+            #region 公务出访
+            CreateMap<OpOfficialActivitiesDto, Res_OfficialActivities>();
+            #endregion
             #endregion
             #endregion
 
 
             #region Crm
             #region Crm

+ 7 - 1
OASystem/OASystem.Domain/Dtos/DtoBase.cs

@@ -1,4 +1,5 @@
-using System;
+using Microsoft.AspNetCore.Http;
+using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Text;
 using System.Text;
@@ -39,4 +40,9 @@ namespace OASystem.Domain.Dtos
         /// </summary>
         /// </summary>
         public int DeleteUserId { get; set; }
         public int DeleteUserId { get; set; }
     }
     }
+    public class DataDto
+    {
+        public IFormFile file { get; set; }
+        public string typeName { get; set; }
+    }
 }
 }

+ 7 - 17
OASystem/OASystem.Domain/Dtos/Groups/InvitationOfficialActivitiesListDto.cs

@@ -95,7 +95,7 @@ namespace OASystem.Domain.Dtos.Groups
         public decimal SendCost { get; set; }
         public decimal SendCost { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// 公务标识
+        /// 公务标识(是否到场)
         /// </summary>
         /// </summary>
         public int IsGoOfficaiaBussiness { get; set; }
         public int IsGoOfficaiaBussiness { get; set; }
         /// <summary>
         /// <summary>
@@ -106,19 +106,9 @@ namespace OASystem.Domain.Dtos.Groups
         /// 备注
         /// 备注
         /// </summary>
         /// </summary>
         public string Remark { get; set; }
         public string Remark { get; set; }
-        //-----------------------邀请方资料-----------------------------
+        //-----------------------邀请方资料----------
-        public int DataId { get; set; }
+       
-        /// <summary>
-        /// 邀请方国家
-        /// </summary>
-        public string Country { get; set; }
-        /// <summary>
-        /// 邀请方名称
-        /// </summary>
-        public string UnitName { get; set; }
-        /// <summary>
         /// 邀请方地址
         /// 邀请方地址
-        /// </summary>
         public string Address { get; set; }
         public string Address { get; set; }
         /// <summary>
         /// <summary>
         /// 联系人
         /// 联系人
@@ -137,12 +127,12 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         /// </summary>
         public string Email { get; set; }
         public string Email { get; set; }
         /// <summary>
         /// <summary>
-        /// 其他信息
-        /// </summary>
-        public string OtherInformation { get; set; }
-        /// <summary>
         /// 传真号码
         /// 传真号码
         /// </summary>
         /// </summary>
         public string Fax { get; set; }
         public string Fax { get; set; }
+        /// <summary>
+        /// 其他信息
+        /// </summary>
+        public string OtherInformation { get; set; }
     }
     }
 }
 }

+ 142 - 0
OASystem/OASystem.Domain/Dtos/Resource/InvitationOfficialActivityDataDto.cs

@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Resource
+{
+    public class QueryInvitationOfficialActivityDataDto:DtoBase
+    {
+        /// <summary>
+        /// 邀请方国家
+        /// </summary>
+        public string Country { get; set; }
+        /// <summary>
+        /// 邀请方名称
+        /// </summary>
+        public string UnitName { get; set; }
+        /// <summary>
+        /// 联系人
+        /// </summary>
+        public string Contact { get; set; }
+        /// <summary>
+        /// 团名
+        /// </summary>
+        public string Delegation { get; set; }
+        /// <summary>
+        /// 涉及领域
+        /// </summary>
+        public string Field { get; set; }
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 创建时间(开始)
+        /// </summary>
+        public string StartCreateTime { get; set; }
+        /// <summary>
+        /// 创建时间(结束)
+        /// </summary>
+        public string EndCreateTime { get; set; }
+    }
+    public class QueryInvitationOfficialActivityByIdDto
+    {
+        public int Id { get; set; } 
+    }
+    public class OpInvitationOfficialActivityDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 编号
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 邀请方国家
+        /// </summary>
+        public string Country { get; set; }
+        /// <summary>
+        /// 城市
+        /// </summary>
+        public string City { get; set; }
+        /// <summary>
+        /// 邀请方名称
+        /// </summary>
+        public string UnitName { get; set; }
+        /// <summary>
+        ///邀请方官网
+        /// </summary>
+        public string UnitWeb { get; set; }
+        /// <summary>
+        /// 涉及领域
+        /// </summary>
+        public string Field { get; set; }
+        /// <summary>
+        /// 邀请方地址
+        /// </summary>
+        public string Address { get; set; }
+        /// <summary>
+        /// 邀请方信息
+        /// </summary>
+        public string UnitInfo { get; set; }
+        /// <summary>
+        /// 联系人
+        /// </summary>
+        public string Contact { get; set; }
+        /// <summary>
+        /// 职务
+        /// </summary>
+        public string Job { get; set; }
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        public string Tel { get; set; }
+        /// <summary>
+        /// 电子邮箱
+        /// </summary>
+        public string Email { get; set; }
+        /// <summary>
+        /// 微信
+        /// </summary>
+        public string WeChat { get; set; }
+        /// <summary>
+        /// fb
+        /// </summary>
+        public string FaceBook { get; set; }
+        /// <summary>
+        /// ins
+        /// </summary>
+        public string Ins { get; set; }
+        /// <summary>
+        /// 团名
+        /// </summary>
+        public string Delegation { get; set; }
+        /// <summary>
+        /// 文件地址
+        /// </summary>
+        public string FilePath { get; set; }
+        /// <summary>
+        /// 修改版文件地址
+        /// </summary>
+        public string SndFilePath { get; set; }
+        /// <summary>
+        /// 传真号码
+        /// </summary>
+        public string Fax { get; set; }
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+       
+    }
+}

+ 109 - 0
OASystem/OASystem.Domain/Dtos/Resource/OfficialActivitiesDto.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Resource
+{
+    public class OfficialActivitiesByDiIdDto: DtoBase
+    {
+        public int DiId { get; set; }
+    }
+    public class OfficialActivitiesDiIdDto
+    {
+        public int Id { get; set; }
+
+        public int DiId { get; set; }
+    }
+    public class OpOfficialActivitiesDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 编号
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 团组ID
+        /// </summary>
+        public string Diid { get; set; }
+        /// <summary>
+        /// 邀请方 1  公务方 0 
+        /// </summary>
+        public int Type { get; set; }
+        /// <summary>
+        /// 公务单位
+        /// </summary>
+        public string Client { get; set; }
+        /// <summary>
+        /// 公务日期
+        /// </summary>
+        public string Date { get; set; }
+        /// <summary>
+        /// 精确时间
+        /// </summary>
+        public string Time { get; set; }
+        /// <summary>
+        /// 地址
+        /// </summary>
+        public string Address { get; set; }
+        /// <summary>
+        /// 联系人
+        /// </summary>
+        public string Contact { get; set; }
+        /// <summary>
+        /// 联系人职务
+        /// </summary>
+        public string Job { get; set; }
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        public string Tel { get; set; }
+        /// <summary>
+        /// 公务形式
+        /// </summary>
+        public int OfficialForm { get; set; }
+        /// <summary>
+        /// 公务方背景
+        /// </summary>
+        public string Setting { get; set; }
+        /// <summary>
+        /// 着装要求
+        /// </summary>
+        public string Dresscode { get; set; }
+        /// <summary>
+        /// 参会人员
+        /// </summary>
+        public string Attendees { get; set; }
+        /// <summary>
+        /// 是否需要翻译
+        /// </summary>
+        public int IsNeedTrans { get; set; }
+        /// <summary>
+        /// 翻译人员
+        /// </summary>
+        public string Translators { get; set; }
+        /// <summary>
+        /// 翻译语种
+        /// </summary>
+        public string language { get; set; }
+        /// <summary>
+        /// 暂定行程
+        /// </summary>
+        public string Trip { get; set; }
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+
+    }
+}

+ 0 - 5
OASystem/OASystem.Domain/Entities/Resource/Res_InvitationOfficialActivityData.cs

@@ -99,11 +99,6 @@ namespace OASystem.Domain.Entities.Resource
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
         public string SndFilePath { get; set; }
         public string SndFilePath { get; set; }
         /// <summary>
         /// <summary>
-        /// 其他信息
-        /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
-        public string OtherInformation { get; set; }
-        /// <summary>
         /// 传真号码
         /// 传真号码
         /// </summary>
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]

+ 100 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_OfficialActivities.cs

@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Resource
+{
+    /// <summary>
+    /// 公务出访表
+    /// </summary>
+    [SugarTable("Res_OfficialActivities")]
+    public class Res_OfficialActivities : EntityBase
+    {    /// <summary>
+         /// 团组ID
+         /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int Diid { get; set; }
+        /// <summary>
+        /// 邀请方 1  公务方 0 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Type { get; set; }
+        /// <summary>-
+        /// 公务单位
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string Client { get; set; }
+        /// <summary>
+        /// 公务日期
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Date { get; set; }
+        /// <summary>
+        /// 精确时间
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Time { get; set; }
+        /// <summary>
+        /// 地址
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string Address { get; set; }
+        /// <summary>
+        /// 联系人
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Contact { get; set; }
+        /// <summary>
+        /// 联系人职务
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string Job { get; set; }
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Tel { get; set; }
+        /// <summary>
+        /// 公务形式
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public int OfficialForm { get; set; }
+        /// <summary>
+        /// 公务方背景
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string Setting { get; set; }
+        /// <summary>
+        /// 着装要求
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Dresscode { get; set; }
+        /// <summary>
+        /// 参会人员
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string Attendees { get; set; }
+        /// <summary>
+        /// 是否需要翻译
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsNeedTrans { get; set; }
+        /// <summary>
+        /// 翻译人员
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string Translators { get; set; }
+        /// <summary>
+        /// 翻译语种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]
+        public string language { get; set; }
+        /// <summary>
+        /// 暂定行程
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
+        public string Trip { get; set; }
+    }
+}

+ 16 - 0
OASystem/OASystem.Domain/ViewModels/Resource/InvitationOfficialActivityDataView.cs

@@ -0,0 +1,16 @@
+using OASystem.Domain.Entities;
+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 InvitationOfficialActivityDataView: Res_InvitationOfficialActivityData
+    {
+        public string CreateUserName { get; set; }
+        public string DelegationStr { get;set; }
+    }
+}

+ 15 - 0
OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs

@@ -0,0 +1,15 @@
+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 OfficialActivitiesView:Res_OfficialActivities
+    {
+        public string CreateUserName { get; set; }
+        public string OfficialFormName { get; set; }
+    }
+}

+ 3 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -231,10 +231,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     });
                     });
                     if (res)
                     if (res)
                     {
                     {
-                        Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_Decrease.Id && a.IsDel == 0);
+                        Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_Decrease.Id && a.CTable==98 && a.CId==grp_Decrease.Id && a.IsDel == 0);
                         if (grp_CreditCardPayment != null)
                         if (grp_CreditCardPayment != null)
                         {
                         {
-                            Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == grp_Decrease.DiId && a.IsDel == 0 && a.CTable == 85);
+                            Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == grp_Decrease.DiId && a.IsDel == 0 && a.CTable == 98);
                             if (_TeamRate != null)
                             if (_TeamRate != null)
                             {
                             {
 
 
@@ -315,7 +315,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             try
             try
             {
             {
                 Grp_DecreasePayments grp_Decrease = _sqlSugar.Queryable<Grp_DecreasePayments>().First(a=>a.Id==dto.Id && a.IsDel==0);
                 Grp_DecreasePayments grp_Decrease = _sqlSugar.Queryable<Grp_DecreasePayments>().First(a=>a.Id==dto.Id && a.IsDel==0);
-                Grp_CreditCardPayment grp_CreditCard= _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0);
+                Grp_CreditCardPayment grp_CreditCard= _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable==98);
                 var data = new
                 var data = new
                 {
                 {
                     _Decrease = grp_Decrease,
                     _Decrease = grp_Decrease,

+ 116 - 124
OASystem/OASystem.Infrastructure/Repositories/Groups/InvitationOfficialActivitiesRepository.cs

@@ -34,7 +34,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             try
             try
             {
             {
                 Grp_InvitationOfficialActivities grp_Invitation = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>().First(a => a.Id == dto.Id && a.IsDel == 0);
                 Grp_InvitationOfficialActivities grp_Invitation = _sqlSugar.Queryable<Grp_InvitationOfficialActivities>().First(a => a.Id == dto.Id && a.IsDel == 0);
-                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0);
+                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable==81);
                 Res_InvitationOfficialActivityData res_InvitationOfficialActivityData = new Res_InvitationOfficialActivityData();
                 Res_InvitationOfficialActivityData res_InvitationOfficialActivityData = new Res_InvitationOfficialActivityData();
                 if (grp_Invitation!=null)
                 if (grp_Invitation!=null)
                 {
                 {
@@ -68,7 +68,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 string sqlWhere = string.Empty;
                 string sqlWhere = string.Empty;
                 if (!string.IsNullOrWhiteSpace(dto.Inviter))
                 if (!string.IsNullOrWhiteSpace(dto.Inviter))
                 {
                 {
-                    sqlWhere += string.Format(@" And Inviter={0}", dto.Inviter);
+                    sqlWhere += string.Format(@" And Inviter like '%{0}%'", dto.Inviter);
                 }
                 }
                 if (!string.IsNullOrWhiteSpace(dto.StartInviteTime) && !string.IsNullOrWhiteSpace(dto.EndInviteTime))
                 if (!string.IsNullOrWhiteSpace(dto.StartInviteTime) && !string.IsNullOrWhiteSpace(dto.EndInviteTime))
                 {
                 {
@@ -120,7 +120,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     var _InvitationOfficialActivities = await _sqlSugar.SqlQueryable<Grp_InvitationOfficialActivities>(selectSql).FirstAsync();//查询是否存在
                     var _InvitationOfficialActivities = await _sqlSugar.SqlQueryable<Grp_InvitationOfficialActivities>(selectSql).FirstAsync();//查询是否存在
                     if (_InvitationOfficialActivities != null)
                     if (_InvitationOfficialActivities != null)
                     {
                     {
-                        return result = new Result() { Code = -1, Msg = "该客户已存在,请勿重复添加!" };
+                        return result = new Result() { Code = -1, Msg = "该数据已存在,请勿重复添加!" };
                     }
                     }
                     else
                     else
                     {
                     {
@@ -128,11 +128,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         if (id != 0)//修改或添加商邀资料
                         if (id != 0)//修改或添加商邀资料
                         {
                         {
                             Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
                             Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
-                            res_InvitationData.Remark = "";
+                            res_InvitationData.Country = dto.InviterArea;
-                            int DataID = 0;
+                            res_InvitationData.UnitName = dto.Inviter;
-                            if (dto.DataId == 0)
+                            res_InvitationData.Delegation = dto.DiId.ToString();
+                            Res_InvitationOfficialActivityData ifNullUp = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync
+                                (a => a.Country == res_InvitationData.Country && a.City == res_InvitationData.City && a.UnitName == res_InvitationData.UnitName);
+                            if (ifNullUp == null)///添加或修改商邀资料
                             {
                             {
-                                DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
+                                res_InvitationData.Remark = dto.OtherInformation;
+                                int DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
                                 if (DataID != 0)
                                 if (DataID != 0)
                                 {
                                 {
                                     result = new Result() { Code = 0, Msg = "添加成功!" };
                                     result = new Result() { Code = 0, Msg = "添加成功!" };
@@ -142,108 +146,102 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                     RollbackTran();
                                     RollbackTran();
                                     result = new Result() { Code = -1, Msg = "添加失败!" };
                                     result = new Result() { Code = -1, Msg = "添加失败!" };
                                 }
                                 }
+
                             }
                             }
                             else
                             else
                             {
                             {
-                                res_InvitationData.Id = dto.DataId;
+                                int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>().Where(a => a.Id == ifNullUp.Id).SetColumns(a => new Res_InvitationOfficialActivityData
-                                DataID = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>().Where(b => b.Id == res_InvitationData.Id).SetColumns(b => new Res_InvitationOfficialActivityData
                                 {
                                 {
-                                    Country = res_InvitationData.Country,
+                                   Contact=dto.Contact,
-                                    UnitName = res_InvitationData.UnitName,
+                                   Tel=dto.Tel,
-                                    Address = res_InvitationData.Address,
+                                   Email=dto.Email,
-                                    Contact = res_InvitationData.Contact,
+                                   Fax=dto.Fax,
-                                    Job = res_InvitationData.Job,
+                                   Address=dto.Address,
-                                    Tel = res_InvitationData.Tel,
+                                   Remark=dto.OtherInformation,
-                                    Email = res_InvitationData.Email,
-                                    OtherInformation = res_InvitationData.OtherInformation,
-                                    Fax = res_InvitationData.Fax
                                 }).ExecuteCommandAsync();
                                 }).ExecuteCommandAsync();
                             }
                             }
-                            if (DataID != 0)//添加C表
+                            Grp_CreditCardPayment C = new Grp_CreditCardPayment();
-                            {
+                            C.PayDId = dto.PayDId;
-                                Grp_CreditCardPayment C = new Grp_CreditCardPayment();
+                            C.ConsumptionPatterns = "";
-                                C.PayDId = dto.PayDId;
+                            C.ConsumptionDate = "";
-                                C.ConsumptionPatterns = "";
+                            C.CTDId = 0;
-                                C.ConsumptionDate = "";
+                            C.BankNo = "";
-                                C.CTDId = 0;
+                            C.CardholderName = "";
-                                C.BankNo = "";
+                            C.PayMoney = dto.InviteCosts + dto.SendCost;
-                                C.CardholderName = "";
+                            C.PaymentCurrency = dto.Currency;
-                                C.PayMoney = dto.InviteCosts + dto.SendCost;
+                            //当天汇率
-                                C.PaymentCurrency = dto.Currency;
+                            //if (!string.IsNullOrEmpty(hfRate.Value))
-                                //当天汇率
+                            //    C.DayRate = hfRate.Value;
-                                //if (!string.IsNullOrEmpty(hfRate.Value))
+                            //else
-                                //    C.DayRate = hfRate.Value;
+                            //C.DayRate = "";
-                                //else
+                            C.CompanyBankNo = "";
-                                //C.DayRate = "";
+                            C.OtherBankName = "";
-                                C.CompanyBankNo = "";
+                            C.OtherSideNo = "";
-                                C.OtherBankName = "";
+                            C.OtherSideName = "";
-                                C.OtherSideNo = "";
+                            C.Remark = "";
-                                C.OtherSideName = "";
+                            C.CreateUserId = dto.CreateUserId;
-                                C.Remark = "";
+                            C.MFOperator = "";
-                                C.CreateUserId = dto.CreateUserId;
+                            C.MFOperatorDate = "";
-                                C.MFOperator = "";
+                            C.IsAuditDM = 0;
-                                C.MFOperatorDate = "";
+                            C.AuditDMOperate = 0;
-                                C.IsAuditDM = 0;
+                            C.AuditDMDate = "";
-                                C.AuditDMOperate = 0;
+                            C.IsAuditMF = 0;
-                                C.AuditDMDate = "";
+                            C.AuditMFOperate = 0;
-                                C.IsAuditMF = 0;
+                            C.AuditMFDate = "";
-                                C.AuditMFOperate = 0;
+                            C.IsAuditGM = 0;
-                                C.AuditMFDate = "";
+                            C.AuditGMOperate = 21;
-                                C.IsAuditGM = 0;
+                            C.AuditGMDate = "";
-                                C.AuditGMOperate = 21;
+                            C.IsPay = 0;
-                                C.AuditGMDate = "";
+                            C.DIId = dto.DiId;
-                                C.IsPay = 0;
+                            C.CId = id;
-                                C.DIId = dto.DiId;
+                            C.CTable = 81;
-                                C.CId = id;
+                            C.PayPercentage = 0;
-                                C.CTable = 81;
+                            C.PayThenMoney = 0;
-                                C.PayPercentage = 0;
+                            C.PayPercentageOld = 0;
-                                C.PayThenMoney = 0;
+                            C.PayThenMoneyOld = 0;
-                                C.PayPercentageOld = 0;
+                            C.UpdateDate = "";
-                                C.PayThenMoneyOld = 0;
+                            C.Payee = dto.Payee;
-                                C.UpdateDate = "";
+                            C.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
-                                C.Payee = dto.Payee;
+                            C.ExceedBudget = 0;
-                                C.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
+                            //C.RMBPrice = 0.00f;
-                                C.ExceedBudget = 0;
-                                //C.RMBPrice = 0.00f;
 
 
-                                //设置该团组的汇率
+                            //设置该团组的汇率
-                                Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 81);
+                            Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 81);
-                                if (_TeamRate != null)
+                            if (_TeamRate != null)
-                                {
+                            {
-                                    if (dto.Currency == 49)
+                                if (dto.Currency == 49)
-                                    {
-                                        C.DayRate = _TeamRate.RateU;
-                                        C.RMBPrice = C.PayMoney * Convert.ToDecimal(_TeamRate.RateU);
-                                        //ccp.PayMoney = ccp.PayMoney * float.Parse(tr.RateU); 
-                                    }
-                                    else if (dto.Currency == 51)
-                                    {
-                                        C.DayRate = _TeamRate.RateE;
-                                        C.RMBPrice = C.PayMoney * Convert.ToDecimal(_TeamRate.RateE);
-                                        //ccp.PayMoney = ccp.PayMoney * float.Parse(tr.RateE); 
-                                    }
-                                    else
-                                    {
-                                        C.DayRate = 1M;
-                                        C.RMBPrice = C.PayMoney;
-                                    }
-                                }
-                                else
                                 {
                                 {
-                                    C.DayRate = 1M;
+                                    C.DayRate = _TeamRate.RateU;
-                                    C.RMBPrice = C.PayMoney;
+                                    C.RMBPrice = C.PayMoney * Convert.ToDecimal(_TeamRate.RateU);
+                                    //ccp.PayMoney = ccp.PayMoney * float.Parse(tr.RateU); 
                                 }
                                 }
-                                int cId = await _sqlSugar.Insertable(C).ExecuteReturnIdentityAsync();
+                                else if (dto.Currency == 51)
-                                if (cId != 0)
                                 {
                                 {
-                                    result = new Result() { Code = 0, Msg = "添加成功!" };
+                                    C.DayRate = _TeamRate.RateE;
+                                    C.RMBPrice = C.PayMoney * Convert.ToDecimal(_TeamRate.RateE);
+                                    //ccp.PayMoney = ccp.PayMoney * float.Parse(tr.RateE); 
                                 }
                                 }
                                 else
                                 else
                                 {
                                 {
-                                    RollbackTran();
+                                    C.DayRate = 1M;
-                                    result = new Result() { Code = -1, Msg = "添加失败!" };
+                                    C.RMBPrice = C.PayMoney;
                                 }
                                 }
                             }
                             }
+                            else
+                            {
+                                C.DayRate = 1M;
+                                C.RMBPrice = C.PayMoney;
+                            }
+                            int cId = await _sqlSugar.Insertable(C).ExecuteReturnIdentityAsync();
+                            if (cId != 0)
+                            {
+                                result = new Result() { Code = 0, Msg = "添加成功!" };
+                            }
+                            else
+                            {
+                                RollbackTran();
+                                result = new Result() { Code = -1, Msg = "添加失败!" };
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -265,11 +263,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (res)
                     if (res)
                     {
                     {
                         Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
                         Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
-                        res_InvitationData.Remark = "";
+                        res_InvitationData.Country = dto.InviterArea;
-                        int DataID = 0;
+                        res_InvitationData.UnitName = dto.Inviter;
-                        if (dto.DataId == 0)///添加或修改商邀资料
+                        Res_InvitationOfficialActivityData ifNullUp = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync
+                            (a => a.Country == res_InvitationData.Country && a.City == res_InvitationData.City && a.UnitName == res_InvitationData.UnitName);
+                        if (ifNullUp == null)///添加或修改商邀资料
                         {
                         {
-                            DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
+                            res_InvitationData.Remark =dto.OtherInformation;
+                            res_InvitationData.Delegation = dto.DiId.ToString();
+
+                            int DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
                             if (DataID != 0)
                             if (DataID != 0)
                             {
                             {
                                 result = new Result() { Code = 0, Msg = "添加成功!" };
                                 result = new Result() { Code = 0, Msg = "添加成功!" };
@@ -279,30 +282,25 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 RollbackTran();
                                 RollbackTran();
                                 result = new Result() { Code = -1, Msg = "添加失败!" };
                                 result = new Result() { Code = -1, Msg = "添加失败!" };
                             }
                             }
-                        }
+                                
-                        else
+                        } else
-                        {
-                            res_InvitationData.Id = dto.DataId;
-                            DataID = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>().Where(b => b.Id == res_InvitationData.Id).SetColumns(b => new Res_InvitationOfficialActivityData
                             {
                             {
-                                Country = res_InvitationData.Country,
+                                int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>().Where(a => a.Id == ifNullUp.Id).SetColumns(a => new Res_InvitationOfficialActivityData
-                                UnitName = res_InvitationData.UnitName,
+                                {
-                                Address = res_InvitationData.Address,
+                                   Contact=dto.Contact,
-                                Contact = res_InvitationData.Contact,
+                                   Tel=dto.Tel,
-                                Job = res_InvitationData.Job,
+                                   Email=dto.Email,
-                                Tel = res_InvitationData.Tel,
+                                   Fax=dto.Fax,
-                                Email = res_InvitationData.Email,
+                                   Address=dto.Address,
-                                OtherInformation = res_InvitationData.OtherInformation,
+                                   Remark=dto.OtherInformation,
-                                Fax = res_InvitationData.Fax
+                                }).ExecuteCommandAsync();
-                            }).ExecuteCommandAsync();
+                            }
-                        }
+                       
-                        if (DataID != 0)//修改C表
+                            Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_Invitation.Id && a.CTable==81 && a.IsDel == 0);
-                        {
-                            Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId ==grp_Invitation.Id && a.IsDel == 0);
                             if (grp_CreditCardPayment != null)
                             if (grp_CreditCardPayment != null)
                             {
                             {
                                 grp_CreditCardPayment.PayMoney = dto.InviteCosts + dto.SendCost;
                                 grp_CreditCardPayment.PayMoney = dto.InviteCosts + dto.SendCost;
-                                Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == grp_Invitation.DiId && a.IsDel == 0 && a.CTable == 81);
+                                Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == grp_Invitation.DiId && a.IsDel == 0 && a.IsDel==0 && a.CTable == 81);
                                 if (_TeamRate != null)
                                 if (_TeamRate != null)
                                 {
                                 {
 
 
@@ -355,12 +353,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 RollbackTran();
                                 RollbackTran();
                                 result = new Result() { Code = -1, Msg = "修改失败!" };
                                 result = new Result() { Code = -1, Msg = "修改失败!" };
                             }
                             }
-                        }
-                        else
-                        {
-                            RollbackTran();
-                            result = new Result() { Code = -1, Msg = "修改失败!" };
-                        }
                     }
                     }
                     else
                     else
                     {
                     {

+ 213 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/InvitationOfficialActivityDataRepository.cs

@@ -0,0 +1,213 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Dtos.Resource;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.ViewModels;
+using OASystem.Domain.ViewModels.Groups;
+using OASystem.Domain.ViewModels.Resource;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Resource
+{
+    public class InvitationOfficialActivityDataRepository : BaseRepository<Res_InvitationOfficialActivityData, InvitationOfficialActivitiesByIdDto>
+    {
+        private readonly IMapper _mapper;
+        public InvitationOfficialActivityDataRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+       
+
+        /// <summary>
+        /// 查询商邀资料列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> QueryInvitationOfficialActivityData(QueryInvitationOfficialActivityDataDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string sqlWhere = string.Empty;
+                if (!string.IsNullOrWhiteSpace(dto.Country)) { sqlWhere += string.Format(@" And i.Country like '%{0}%'", dto.Country); }
+                if (!string.IsNullOrWhiteSpace(dto.UnitName)) { sqlWhere += string.Format(@" And i.UnitName like '%{0}%'", dto.UnitName); }
+                if (!string.IsNullOrWhiteSpace(dto.Contact)) { sqlWhere += string.Format(@" And i.Contact like '%{0}%'", dto.Contact); }
+                if (!string.IsNullOrWhiteSpace(dto.Delegation)) { sqlWhere += string.Format(@" And ','+i.Delegation+',' like '%,{0},%'", dto.Delegation); }
+                if (!string.IsNullOrWhiteSpace(dto.Field)) { sqlWhere += string.Format(@" And i.Field like '%{0}%'", dto.Field); }
+                
+                if (dto.CreateUserId != 0 && !string.IsNullOrWhiteSpace(dto.CreateUserId.ToString())) { sqlWhere += string.Format(@" And i.CreateUserId={0}", dto.CreateUserId); }
+                if (!string.IsNullOrWhiteSpace(dto.StartCreateTime) && !string.IsNullOrWhiteSpace(dto.EndCreateTime))
+                {
+                    sqlWhere += string.Format(@" And i.CreateTime between '{0}' and '{1}'", dto.StartCreateTime, dto.EndCreateTime);
+                }
+                sqlWhere += string.Format(@"And Isdel={0}", 0);
+
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                {
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                string sql = string.Format(@"select i.*,(select CnName from Sys_Users where Id=i.CreateUserId ) as CreateUserName from 
+                                            Res_InvitationOfficialActivityData i {0} order by CreateTime desc", sqlWhere);
+                List<InvitationOfficialActivityDataView> _ivitiesViews = await _sqlSugar.SqlQueryable<InvitationOfficialActivityDataView>(sql).ToListAsync();
+                if (_ivitiesViews.Count != 0)
+                {
+                    foreach (var item in _ivitiesViews)
+                    {
+                        string delegationNameList = "";
+                        string[] DelegationName = item.Delegation.Split(',');
+                        for (int i = 0; i < DelegationName.Length; i++)
+                        {
+                            Grp_DelegationInfo _DelegationInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(a => a.Id ==int.Parse(DelegationName[i]));
+                            if (_DelegationInfo != null) { delegationNameList += _DelegationInfo.TeamName + ","; }
+                        }
+                        item.DelegationStr = delegationNameList.Substring(0,delegationNameList.Length-1);
+                    }
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        result = new Result() { Code = 0, Msg = "查询成功!", Data = _ivitiesViews };
+                    }
+                    else
+                    {
+                        int count = _ivitiesViews.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<InvitationOfficialActivityDataView> invitations = new List<InvitationOfficialActivityDataView>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < _ivitiesViews.Count)
+                            {
+                                invitations.Add(_ivitiesViews[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        ListViewBase<InvitationOfficialActivityDataView> rst = new ListViewBase<InvitationOfficialActivityDataView>();
+                        rst.DataList = invitations; 
+                        rst.DataCount = count;
+                        rst.CurrPageIndex = dto.PageIndex;
+                        rst.CurrPageSize = dto.PageSize;
+                        result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
+                    }
+                    
+                }
+                else
+                {
+                    result = new Result() { Code = 0, Msg = "暂无数据!", Data = _ivitiesViews };
+                }
+            }
+            catch (Exception ex)
+            {
+                result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
+        }
+        /// <summary>
+        /// 根据Id查询商邀资料信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public async Task<Result> QueryInvitationOfficialActivityById(QueryInvitationOfficialActivityByIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                Res_InvitationOfficialActivityData res_Invitation = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync(a => a.Id == dto.Id && a.IsDel == 0);
+                if (res_Invitation!=null) {
+                    result = new Result() { Code = 0, Msg = "查询成功!", Data = res_Invitation };
+                }
+                else
+                {
+                    result = new Result() { Code = 0, Msg = "暂无数据!", Data = res_Invitation };
+                }
+            }
+            catch (Exception ex)
+            {
+                result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
+        }
+
+        public async Task<Result> OpInvitationOfficialActivity(OpInvitationOfficialActivityDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                    string selectSql = string.Format(@"select * from Res_InvitationOfficialActivityData where UnitName='{0}' and IsDel='{1}'", dto.UnitName, 0);
+                    var res_InvitationOfficial = await _sqlSugar.SqlQueryable<Res_InvitationOfficialActivityData>(selectSql).FirstAsync();//查询是否存在
+                    if (res_InvitationOfficial != null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+
+                    }
+                    else//不存在,可添加
+                    {
+                        Res_InvitationOfficialActivityData _InvitationOfficialActivityData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
+                        int id = await _sqlSugar.Insertable(_InvitationOfficialActivityData).ExecuteReturnIdentityAsync();
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+
+                        }
+                        return 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_InvitationOfficialActivityData
+                    {
+                        Country = dto.Country,
+                        City = dto.City,
+                        UnitName = dto.UnitName,
+                        UnitWeb = dto.UnitWeb,
+                        Field = dto.Field,
+                        Address = dto.Address,
+                        UnitInfo = dto.UnitInfo,
+                        Contact = dto.Contact,
+                        Job = dto.Job,
+                        Tel = dto.Tel,
+                        Email = dto.Email,
+                        WeChat = dto.WeChat,
+                        FaceBook = dto.FaceBook,
+                        Ins = dto.Ins,
+                        Delegation = dto.Delegation,
+                        FilePath = dto.FilePath,
+                        SndFilePath = dto.SndFilePath,
+                        Fax = dto.Fax,
+                        CreateUserId = dto.CreateUserId,
+                        Remark = dto.Remark
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    return result = new Result() { Code = 0, Msg = "修改成功!" };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+        }
+    }
+}

+ 2 - 2
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -120,7 +120,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                     List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
                     List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
                     if (LocalGuideData.Count == 0)
                     if (LocalGuideData.Count == 0)
                     {
                     {
-                        return result = new Result() { Code = -1, Msg = "暂无数据" };
+                        return result = new Result() { Code = 0, Msg = "暂无数据" };
                     }
                     }
                     LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
                     LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
 
 
@@ -168,7 +168,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                     List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
                     List<Res_LocalGuideData> LocalGuideData = await _sqlSugar.SqlQueryable<Res_LocalGuideData>(sql).ToListAsync();
                     if (LocalGuideData.Count == 0)
                     if (LocalGuideData.Count == 0)
                     {
                     {
-                        return result = new Result() { Code = -1, Msg = "暂无数据" };
+                        return result = new Result() { Code = 0, Msg = "暂无数据" };
                     }
                     }
                     LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
                     LocalGuideData = LocalGuideData.OrderByDescending(x => x.CreateTime).ToList();
 
 

+ 199 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -0,0 +1,199 @@
+using AutoMapper;
+using MathNet.Numerics.Distributions;
+using MathNet.Numerics.Statistics.Mcmc;
+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 OfficialActivitiesRepository : BaseRepository<Res_OfficialActivities, OfficialActivitiesView>
+    {
+        private readonly IMapper _mapper;
+        public OfficialActivitiesRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+        
+
+        /// <summary>
+        /// 根据Diid查询公务出访数据List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> QueryOfficialActivitiesByDiId(OfficialActivitiesByDiIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string sqlWhere = string.Empty;
+                sqlWhere += string.Format(@"And o.Isdel={0} And o.DiId={1} ", 0,dto.DiId);
+
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                {
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                string sql = string.Format(@"select *,(select CnName from Sys_Users where o.CreateUserId=Id) as CreateUserName,(select Name from Sys_SetData
+                                            where Id=o.OfficialForm) as OfficialFormName from Res_OfficialActivities o {0} order by o.CreateTime desc", sqlWhere);
+                List<OfficialActivitiesView> OfficialActivities = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql).ToListAsync();
+                if (OfficialActivities.Count != 0)
+                {
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        result = new Result() { Code = 0, Msg = "查询成功!", Data = OfficialActivities };
+                    }
+                    else
+                    {
+                        int count = OfficialActivities.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<OfficialActivitiesView> _OfficialActivities = new List<OfficialActivitiesView>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < OfficialActivities.Count)
+                            {
+                                _OfficialActivities.Add(OfficialActivities[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        ListViewBase<OfficialActivitiesView> rst = new ListViewBase<OfficialActivitiesView>();
+                        rst.DataList = _OfficialActivities;
+                        rst.DataCount = count;
+                        rst.CurrPageIndex = dto.PageIndex;
+                        rst.CurrPageSize = dto.PageSize;
+                        result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
+                    }
+
+                }
+                else
+                {
+                    result = new Result() { Code = 0, Msg = "暂无数据!", Data = OfficialActivities };
+                }
+            }
+            catch (Exception ex)
+            {
+                result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 根据公务出访Id查询单个数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public async Task<Result> QueryOfficialActivitiesById(OfficialActivitiesDiIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string sqlWhere = string.Empty;
+                sqlWhere += string.Format(@"And o.Isdel={0} And o.DiId={1} And o.Id={2}", 0, dto.DiId,dto.Id);
+
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                {
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                string sql = string.Format(@"select *,(select CnName from Sys_Users where o.CreateUserId=Id) as CreateUserName,(select Name from Sys_SetData
+                                            where Id=o.OfficialForm) as OfficialFormName from Res_OfficialActivities o {0}", sqlWhere);
+                OfficialActivitiesView OfficialActivities = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql).FirstAsync();
+                List<Sys_SetData> data = await _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 38).ToListAsync();
+               
+                result = new Result() { Code = 0, Msg = "查询成功!", Data =new{
+                    OfficialActivities=OfficialActivities,
+                    SetData=data
+                    } };
+               
+            }
+            catch (Exception ex)
+            {
+                result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
+        }
+        public async Task<Result> OpOfficialActivities(OpOfficialActivitiesDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                    string selectSql = string.Format(@"select * from Res_OfficialActivities where Client='{0}' and Address='{1}' and IsDel='{2}'", dto.Client,dto.Address, 0);
+                    var res_InvitationOfficial = await _sqlSugar.SqlQueryable<Res_OfficialActivities>(selectSql).FirstAsync();//查询是否存在
+                    if (res_InvitationOfficial != null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+
+                    }
+                    else//不存在,可添加
+                    {
+
+                        int Dovid =0;
+                        Res_OfficialActivities _InvitationOfficialActivityData = _mapper.Map<Res_OfficialActivities>(dto);
+                        int id = await _sqlSugar.Insertable(_InvitationOfficialActivityData).ExecuteReturnIdentityAsync();
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+
+                        }
+                        return 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_OfficialActivities
+                    {
+                        Type = dto.Type,
+                        Client = dto.Client,
+                        Date = dto.Date,
+                        Time = dto.Time,
+                        Address = dto.Address,
+                        Contact = dto.Contact,
+                        Job = dto.Job,
+                        Tel = dto.Tel,
+                        OfficialForm = dto.OfficialForm,
+                        Setting = dto.Setting,
+                        Dresscode = dto.Dresscode,
+                        Attendees = dto.Attendees,
+                        IsNeedTrans = dto.IsNeedTrans,
+                        Translators = dto.Translators,
+                        language = dto.language,
+                        Trip = dto.Trip,
+                        CreateUserId = dto.CreateUserId,
+                        Remark = dto.Remark,
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    return result = new Result() { Code = 0, Msg = "修改成功!", Data = new { Id = dto.Id } };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+        }
+    }
+}