Quellcode durchsuchen

修改上传文件内容代码及商邀费用数据录入

wangh vor 1 Jahr
Ursprung
Commit
beb7ce79ca

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

@@ -18,6 +18,7 @@ using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 using Cell = Aspose.Words.Tables.Cell;
 using Row = Aspose.Words.Tables.Row;
 using System.Runtime.Intrinsics.Arm;
+using Microsoft.AspNetCore.Mvc.Filters;
 
 namespace OASystem.API.Controllers
 {
@@ -1629,6 +1630,10 @@ namespace OASystem.API.Controllers
         }
 
 
+
+        #endregion
+
+        #region 文件上传、删除
         /// <summary>
         /// region 文件上传  可以带参数
         /// </summary>
@@ -1640,18 +1645,37 @@ namespace OASystem.API.Controllers
         {
             try
             {
+                var TypeName = Request.Headers["TypeName"].ToString();
                 if (file != null)
                 {
                     var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
-                    if (!Directory.Exists(fileDir))
-                    {
-                        Directory.CreateDirectory(fileDir);
-                    }
                     //文件名称
                     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))
                     {
                         file.CopyTo(fs);
@@ -1669,7 +1693,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "程序错误!"));
                 throw;
             }
-            
+
         }
         /// <summary>
         /// 删除指定文件
@@ -1682,13 +1706,27 @@ namespace OASystem.API.Controllers
         {
             try
             {
+                var TypeName = Request.Headers["TypeName"].ToString();
+                string filePath = "";
                 var fileDir = AppSettingsHelper.Get("GrpFileBasePath");
                 // 返回与指定虚拟路径相对应的物理路径即绝对路径
-                string filePath = fileDir+ dto.fileName;
-                // 删除该文件
-                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();
-                if (id!=0)
+                int id = 0;
+                if (TypeName == "A")
+                {
+                    filePath = fileDir + "/团组增减款项相关文件/" + dto.fileName;
+                    // 删除该文件
+                    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, "成功!"));
                 }
@@ -1696,7 +1734,6 @@ namespace OASystem.API.Controllers
                 {
                     return Ok(JsonView(false, "失败!"));
                 }
-                
             }
             catch (Exception ex)
             {
@@ -1784,5 +1821,6 @@ namespace OASystem.API.Controllers
 
         #endregion
 
+       
     }
 }

+ 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.Linq;
 using System.Text;
@@ -39,4 +40,9 @@ namespace OASystem.Domain.Dtos
         /// </summary>
         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; }
 
         /// <summary>
-        /// 公务标识
+        /// 公务标识(是否到场)
         /// </summary>
         public int IsGoOfficaiaBussiness { get; set; }
         /// <summary>
@@ -106,19 +106,9 @@ namespace OASystem.Domain.Dtos.Groups
         /// 备注
         /// </summary>
         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; }
         /// <summary>
         /// 联系人
@@ -137,12 +127,12 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public string Email { get; set; }
         /// <summary>
-        /// 其他信息
-        /// </summary>
-        public string OtherInformation { get; set; }
-        /// <summary>
         /// 传真号码
         /// </summary>
         public string Fax { get; set; }
+        /// <summary>
+        /// 其他信息
+        /// </summary>
+        public string OtherInformation { 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)")]
         public string SndFilePath { get; set; }
         /// <summary>
-        /// 其他信息
-        /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(MAX)")]
-        public string OtherInformation { get; set; }
-        /// <summary>
         /// 传真号码
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(120)")]

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

@@ -230,10 +230,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     });
                     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)
                         {
-                            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)
                             {
 
@@ -314,7 +314,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             try
             {
                 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
                 {
                     _Decrease = grp_Decrease,

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

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