ソースを参照

新增签证增删改查Api及实体类

wangh 1 年間 前
コミット
6e1c994151

+ 2 - 1
OASystem/EntitySync/Program.cs

@@ -78,7 +78,7 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Grp_ScheduleInfo),
     //typeof(Grp_ScheduleDetailInfo),
     //typeof(Grp_SchedulePersonInfo)
-    typeof(Sys_Message),
+    //typeof(Sys_Message),
     //typeof(Sys_MessageReadAuth)
     //typeof(Crm_DeleClient)
     //typeof(Crm_NewClientData)
@@ -110,5 +110,6 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Pm_WageSheet)       //人事模块 工资表单
     //typeof(Grp_VisaProgressCustomer),
     //typeof(Grp_VisaProgressCustomerPicture)
+    typeof(Grp_VisaInfo)
 });
 Console.WriteLine("数据库结构同步完成!");

+ 100 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -47,6 +47,7 @@ namespace OASystem.API.Controllers
         private readonly InvitationOfficialActivitiesRepository _InvitationOfficialActivitiesRep;
         private readonly DelegationEnDataRepository _delegationEnDataRep;
         private readonly DelegationVisaRepository _delegationVisaRep;
+        private readonly VisaPriceRepository _visaPriceRep;
         private readonly MessageRepository _message;
         private readonly SqlSugarClient _sqlSugar;
         private string url;
@@ -57,7 +58,7 @@ namespace OASystem.API.Controllers
         public GroupsController(IMapper mapper, SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository,
             TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep,
             InvitationOfficialActivitiesRepository InvitationOfficialActivitiesRep, DelegationEnDataRepository delegationEnDataRep, EnterExitCostRepository enterExitCostRep
-            , DelegationVisaRepository delegationVisaRep, MessageRepository message)
+            , DelegationVisaRepository delegationVisaRep, MessageRepository message,VisaPriceRepository visaPriceRep)
         {
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
@@ -77,6 +78,7 @@ namespace OASystem.API.Controllers
             _enterExitCostRep = enterExitCostRep;
             _delegationVisaRep = delegationVisaRep;
             _message = message;
+            _visaPriceRep= visaPriceRep;
         }
 
         
@@ -2814,5 +2816,102 @@ namespace OASystem.API.Controllers
         }
 
         #endregion
+
+        #region 签证费用录入
+        /// <summary>
+        /// 根据diid查询签证费用列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryVisaByDiId(VisaPriceDto dto)
+        {
+            try
+            {
+                Result groupData = await _visaPriceRep.PostVisaByDiId(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, ex.Message));
+            }
+        }
+        /// <summary>
+        /// 根据签证费用Id查询单条数据及c表数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryVisaById(PostVisaByIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _visaPriceRep.PostVisaById(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, ex.Message));
+            }
+        }
+        /// <summary>
+        /// 签证费用删除
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelVisaPrice(DelBaseDto dto)
+        {
+            try
+            {
+                var res = await _visaPriceRep.SoftDeleteByIdAsync<Grp_VisaInfo>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            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> OpVisaPrice(OpVisaPriceDto dto)
+        {
+            try
+            {
+                Result groupData = await _visaPriceRep.OpVisaPrice(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, ex.Message));
+            }
+        }
+        #endregion
     }
 }

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

@@ -118,6 +118,10 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<NationalTravelFeeOperateDto, Grp_NationalTravelFee>();
             #endregion
 
+            #region 签证费用录入
+            CreateMap<OpVisaPriceDto, Grp_VisaInfo>();
+            CreateMap<OpVisaPriceDto, Grp_CreditCardPayment>();
+            #endregion
 
             #endregion
             #region Resource

+ 142 - 0
OASystem/OASystem.Domain/Dtos/Groups/VisaPriceDto.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.Groups
+{
+    /// <summary>
+    /// 根据团组id查询签证费用列表
+    /// </summary>
+    public class VisaPriceDto
+    {
+        public int PageIndex { get; set; } = 1;
+        public int PageSize { get; set; } = 10;
+        public int PortType { get; set; } = 1;
+        public int DiID { get; set; }
+        /// <summary>
+        /// 客户名称
+        /// </summary>
+        public String VisaClient { get; set; }
+    }
+    public class PostVisaByIdDto 
+    {
+        public int Id { get; set; }
+    }
+    /// <summary>
+    /// 签证费用修改添加dto
+    /// </summary>
+    public class OpVisaPriceDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 主键Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+        /// <summary>
+        /// 签证客户
+        /// </summary>
+        public string VisaClient { get; set; }
+        /// <summary>
+        /// 签证费用
+        /// </summary>
+        public decimal VisaPrice { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        public int VisaCurrency { get; set; }
+        /// <summary>
+        /// 是否第三方代办
+        /// </summary>
+        public int IsThird { get; set; }
+        /// <summary>
+        /// 签证人员类型
+        /// </summary>
+        public string PassengerType { get; set; }
+        /// <summary>
+        /// 办理签证人数
+        /// </summary>
+        public int VisaNumber { get; set; }
+        /// <summary>
+        /// 免签人数
+        /// </summary>
+        public int VisaFreeNumber { get; set; }
+
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+
+
+        //c表dto参数
+        /// <summary>
+        /// 支付方式
+        /// </summary>
+        public int PayDId { get; set; }
+        /// <summary>
+        /// 消费方式
+        /// </summary>
+        public string ConsumptionPatterns { get; set; }
+        /// <summary>
+        /// 消费日期
+        /// </summary>
+        public String ConsumptionDate { get; set; }
+        /// <summary>
+        /// 卡类型
+        /// </summary>
+        public int CTDId { get; set; }
+
+        /// <summary>
+        /// 公司银行卡号
+        /// </summary>
+        public string CompanyBankNo { get; set; }
+        /// <summary>
+        /// 对方开户行
+        /// </summary>
+        public string OtherBankName { get; set; }
+        /// <summary>
+        /// 对方银行账号
+        /// </summary>
+        public string OtherSideNo { get; set; }
+        /// <summary>
+        /// 对方姓名
+        /// </summary>
+        public string OtherSideName { get; set; }
+
+        /// <summary>
+        /// 银行卡号
+        /// </summary>
+        public string BankNo { get; set; }
+        /// <summary>
+        /// 持卡人姓名
+        /// </summary>
+        public string CardholderName { get; set; }
+        /// <summary>
+        /// 收款方
+        /// </summary>
+        public string Payee { get; set; }
+        /// <summary>
+        /// 费用标识
+        /// </summary>
+        public int OrbitalPrivateTransfer { get; set; }
+
+        /// <summary>
+        /// C表备注
+        /// </summary>
+        public string CRemark { get; set; }
+    }
+}

+ 53 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_VisaInfo.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    [SugarTable("Grp_VisaInfo")]
+    public class Grp_VisaInfo:EntityBase
+    {
+
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int DIId { get; set; }
+        /// <summary>
+        /// 签证客户
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string VisaClient { get; set; }
+        /// <summary>
+        /// 签证费用
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
+        public decimal VisaPrice { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int VisaCurrency { get; set; }
+        /// <summary>
+        /// 是否第三方支付
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsThird { get; set; }
+        /// <summary>
+        /// 签证人员类型
+        /// </summary>
+        public string PassengerType { get; set; }
+        /// <summary>
+        /// 办理签证人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int VisaNumber { get; set; }
+        /// <summary>
+        /// 免签人数
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int VisaFreeNumber { get; set; }
+    }
+}

+ 21 - 0
OASystem/OASystem.Domain/ViewModels/Groups/VisaInfoView.cs

@@ -0,0 +1,21 @@
+using OASystem.Domain.Entities.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    public class VisaInfoView:Grp_VisaInfo
+    {
+        /// <summary>
+        /// 总经理是否审核
+        /// </summary>
+        public int IsAuditGM { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        public string VisaCurrencyStr { get; set; }
+    }
+}

+ 2 - 0
OASystem/OASystem.Domain/ViewModels/System/SetDataView.cs

@@ -18,6 +18,8 @@ namespace OASystem.Domain.ViewModels.System
         /// setdatatype id
         /// </summary>
         public int STid { get; set; }
+
+        public string Remark { get; set; }
     }
 
     /// <summary>

+ 406 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaPriceRepository.cs

@@ -0,0 +1,406 @@
+
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Financial;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.ViewModels.Financial;
+using OASystem.Domain.ViewModels.Groups;
+using OASystem.Infrastructure.Repositories.System;
+using Org.BouncyCastle.Asn1.Cms;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Groups
+{
+    public class VisaPriceRepository : BaseRepository<Grp_VisaInfo, VisaPriceDto>
+    {
+        private readonly IMapper _mapper;
+
+        public VisaPriceRepository(SqlSugarClient sqlSugar,IMapper mapper)
+            : base(sqlSugar)
+        {
+            _mapper=mapper;
+        }
+        
+
+        /// <summary>
+        /// 根据diid查询签证费用列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> PostVisaByDiId(VisaPriceDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string sqlWhere = string.Empty;
+                if (!string.IsNullOrWhiteSpace(dto.VisaClient))
+                {
+                    sqlWhere += string.Format(@" And v.VisaClient like '%{0}%'", dto.VisaClient);
+                }
+                
+                sqlWhere += string.Format(@"And v.DIId={0} and v.isdel={1}", dto.DiID, 0);
+                string UserId = "";
+                List<Grp_GroupsTaskAssignment> gtaUIdList = _sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(a => a.DIId == dto.DiID && a.IsDel == 0 && a.CTId == 80).ToList();
+                foreach (Grp_GroupsTaskAssignment gta in gtaUIdList)
+                    UserId += gta.UId + ",";
+
+                if (!string.IsNullOrWhiteSpace(UserId))
+                {
+                    UserId = UserId.Substring(0, UserId.Length - 1);
+                }
+                sqlWhere += string.Format(@" And v.CreateUserId in ({0})", UserId);
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                {
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                string sql = string.Format(@"select *,(select IsAuditGM from Grp_CreditCardPayment where CTable=80 and CId=v.Id) IsAuditGM,(select Name from Sys_SetData where isdel=0 and v.VisaCurrency=Id) VisaCurrencyStr from Grp_VisaInfo v {0} order by CreateTime desc", sqlWhere);
+                List<VisaInfoView> infoViews = _sqlSugar.SqlQueryable<VisaInfoView>(sql).ToList();
+                if (infoViews.Count != 0)
+                {
+                    if (dto.PageIndex != 0 && dto.PageSize != 0)
+                    {
+
+                        int count = infoViews.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<VisaInfoView> visaInfosPage = new List<VisaInfoView>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < infoViews.Count)
+                            {
+                                visaInfosPage.Add(infoViews[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        ListViewBase<VisaInfoView> rst = new ListViewBase<VisaInfoView>();
+                        rst.DataList = visaInfosPage;
+                        rst.DataCount = count;
+                        rst.CurrPageIndex = dto.PageIndex;
+                        rst.CurrPageSize = dto.PageSize;
+                        return result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
+                    }
+                    else
+                    {
+                        return result = new Result() { Code = 0, Msg = "查询成功!", Data = infoViews };
+                    }
+                }
+                else
+                {
+                    if (dto.PageIndex != 0 && dto.PageSize != 0)
+                    {
+                        ListViewBase<VisaInfoView> rst = new ListViewBase<VisaInfoView>();
+                        rst.DataList = infoViews;
+                        rst.DataCount = infoViews.Count;
+                        rst.CurrPageIndex = dto.PageIndex;
+                        rst.CurrPageSize = dto.PageSize;
+                        return result = new Result() { Code = 0, Msg = "暂无数据!", Data = rst };
+                    }
+                    else
+                    {
+                        return result = new Result() { Code = 0, Msg = "暂无数据!", Data = infoViews };
+                    }
+
+                }
+            }
+            catch (Exception)
+            {
+                return result = new Result() { Code = -2, Msg = "未知错误" };
+                throw;
+            }
+        }
+        /// <summary>
+        /// 根据签证费用Id查询单条数据及c表数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> PostVisaById(PostVisaByIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                Grp_VisaInfo _VisaInfo = _sqlSugar.Queryable<Grp_VisaInfo>().First(a => a.Id == dto.Id && a.IsDel==0);
+                Grp_CreditCardPayment _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a=>a.CId==dto.Id && a.IsDel==0 && a.CTable==80);
+                var data = new
+                {
+                    _VisaInfo = _VisaInfo,
+                    _CreditCardPayment = _CreditCardPayment
+                };
+                return result = new Result() { Code = 0, Msg = "暂无数据!", Data = data };
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+        }
+        /// <summary>
+        /// 签证费用录入操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> OpVisaPrice(OpVisaPriceDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            BeginTran();
+            try
+            {
+                int id = 0;
+                Grp_VisaInfo grp_Visa1 = _mapper.Map<Grp_VisaInfo>(dto);
+                Grp_CreditCardPayment c = _mapper.Map<Grp_CreditCardPayment>(dto);
+                c.PayMoney = grp_Visa1.VisaPrice;
+                Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 80);
+                if (_TeamRate != null)
+                {
+                    int OtherRateId = 0;
+                    Sys_SetData setData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == _TeamRate.OtherRateId);
+                    if (setData != null)
+                    {
+                        OtherRateId = setData.Id;
+                    }
+
+                    #region 汇率换算
+
+                    if (grp_Visa1.VisaCurrency == 49)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateU;
+                        c.DayRate = _TeamRate.RateU;
+                    }
+                    else if (OtherRateId == grp_Visa1.VisaCurrency)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.OtherPrice;
+                        c.DayRate = _TeamRate.OtherPrice;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 51)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateE;
+                        c.DayRate = _TeamRate.RateE;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 50)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateJ;
+                        c.DayRate = _TeamRate.RateJ;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 55)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateH;
+                        c.DayRate = _TeamRate.RateH;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 56)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateN;
+                        c.DayRate = _TeamRate.RateN;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 65)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateS;
+                        c.DayRate = _TeamRate.RateS;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 54)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateA;
+                        c.DayRate = _TeamRate.RateA;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 53)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateC;
+                        c.DayRate = _TeamRate.RateC;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 63)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateT;
+                        c.DayRate = _TeamRate.RateT;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 68)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateBL;
+                        c.DayRate = _TeamRate.RateBL;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 69)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateHB;
+                        c.DayRate = _TeamRate.RateHB;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 336)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateFJD;
+                        c.DayRate = _TeamRate.RateFJD;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 337)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateTL;
+                        c.DayRate = _TeamRate.RateTL;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 338)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateRP;
+                        c.DayRate = _TeamRate.RateRP;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 341)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RatePeso;
+                        c.DayRate = _TeamRate.RatePeso;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 342)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateMYR;
+                        c.DayRate = _TeamRate.RateMYR;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 344)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateCZK;
+                        c.DayRate = _TeamRate.RateCZK;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 345)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateMXN;
+                        c.DayRate = _TeamRate.RateMXN;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 354)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateMOP;
+                        c.DayRate = _TeamRate.RateMOP;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 359)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateARS;
+                        c.DayRate = _TeamRate.RateARS;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 361)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateHUF;
+                        c.DayRate = _TeamRate.RateHUF;
+                    }
+                    else if (grp_Visa1.VisaCurrency == 362)
+                    {
+                        c.RMBPrice = c.PayMoney * _TeamRate.RateRUB;
+                        c.DayRate = _TeamRate.RateRUB;
+                    }
+                    else
+                    {
+                        c.DayRate = 1;
+                        c.RMBPrice = c.PayMoney;
+                    }
+                }
+                else
+                {
+                    c.DayRate = 1;
+                    c.RMBPrice = c.PayMoney;
+                }
+                #endregion
+                if (dto.Status==1)//添加
+                {
+                    Grp_VisaInfo grp_Visa =_sqlSugar.Queryable<Grp_VisaInfo>().First(a=>a.IsDel==0 && a.VisaCurrency==dto.VisaCurrency && a.VisaPrice==dto.VisaPrice && a.VisaClient==dto.VisaClient);
+                    if (grp_Visa!=null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };
+                    }
+                    else
+                    {
+                        id = await AddAsyncReturnId(grp_Visa1);
+                        if (id!=0)
+                        {
+                            c.PayMoney = dto.VisaPrice;
+                            c.PaymentCurrency = dto.VisaCurrency;
+                            c.Remark = dto.CRemark;
+                            c.PayPercentage = 100;
+                            c.CTable = 80;
+                            c.CId=id;
+                            c.IsAuditGM = 0;
+                            if (c.PayDId == 72)
+                            {
+                                c.IsPay = 1;
+                            }
+                            int cId = await _sqlSugar.Insertable(c).ExecuteReturnIdentityAsync();
+                            if (cId != 0)
+                            {
+                                 result = new Result() { Code = 0, Msg = "添加成功!" };
+
+                            }
+                            else
+                            {
+                                RollbackTran();
+                                 result = new Result() { Code = -1, Msg = "添加失败!" };
+                            }
+                        }
+                        else
+                        {
+                            RollbackTran();
+                            result = new Result() { Code = -1, Msg = "添加失败,请稍后重试!" };
+                        }
+                    }
+                    
+                }
+                else if (dto.Status==2)//修改
+                {
+
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_VisaInfo
+                    {
+                        VisaClient = grp_Visa1.VisaClient,
+                        VisaPrice = grp_Visa1.VisaPrice,
+                        VisaCurrency = grp_Visa1.VisaCurrency,
+                        IsThird = grp_Visa1.IsThird,
+                        PassengerType = grp_Visa1.PassengerType,
+                        VisaNumber = grp_Visa1.VisaNumber,
+                        VisaFreeNumber = grp_Visa1.VisaFreeNumber,
+                        Remark = dto.Remark,
+                    });
+                    if (res)
+                    {
+                        c.PayMoney = dto.VisaPrice;
+                        c.PaymentCurrency = dto.VisaCurrency;
+                        c.Remark = dto.CRemark;
+                        c.PayPercentage = 100;
+                        c.CTable = 80;
+                        int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == grp_Visa1.Id && a.CTable==80).SetColumns(a => new Grp_CreditCardPayment
+                        {
+                            PayDId = dto.PayDId,
+                            PayMoney = c.PayMoney,
+                            PaymentCurrency = c.PaymentCurrency,
+                            Payee = c.Payee,
+                            OrbitalPrivateTransfer = c.OrbitalPrivateTransfer,
+                            DayRate = c.DayRate,
+                            RMBPrice = c.RMBPrice,
+                            ConsumptionPatterns = c.ConsumptionPatterns,
+                            ConsumptionDate = c.ConsumptionDate,
+                            CTDId = c.CTDId,
+                            CompanyBankNo = c.CompanyBankNo,
+                            OtherBankName = c.OtherBankName,
+                            OtherSideNo = c.OtherSideNo,
+                            OtherSideName = c.OtherSideName,
+                            BankNo = c.BankNo,
+                            CardholderName = c.CardholderName,
+                            Remark = c.Remark,
+
+                        }).ExecuteCommandAsync();
+
+                        result = new Result() { Code = 0, Msg = "修改成功!" };
+                    }
+                    else
+                    {
+                        RollbackTran();
+                        result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
+                    }
+                }
+                CommitTran();
+            }
+            catch (Exception ex)
+            {
+                 result = new Result() { Code = -2, Msg = "未知错误" };
+            }
+            return result;
+        }
+    }
+}

+ 5 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/InvitationOfficialActivityDataRepository.cs

@@ -69,7 +69,11 @@ namespace OASystem.Infrastructure.Repositories.Resource
                             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 (!string.IsNullOrWhiteSpace(delegationNameList))
+                        {
+                            item.DelegationStr = delegationNameList.Substring(0, delegationNameList.Length - 1);
+                        }
+                        
                     }
                     if (dto.PageSize == 0 && dto.PageIndex == 0)
                     {

+ 0 - 1
OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

@@ -297,5 +297,4 @@ public static class CommonFun
         return rateStr;
     }
     #endregion
-
 }