Browse Source

已收账单 PostReceivablesFeilDownload
更改币种显示 Code

leiy 10 months ago
parent
commit
37ea445c53

+ 16 - 7
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -935,6 +935,9 @@ namespace OASystem.API.Controllers
                     List<Grp_DayAndCost> dac3 = _DayAndCosts.Where(it => it.Type == 3).ToList(); //公杂费
                     List<Grp_DayAndCost> dac4 = _DayAndCosts.Where(it => it.Type == 4).ToList(); //培训费
 
+                    //币种Data
+                    var currData = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.STid == 66).ToList();
+
                     var DeleClientList = _sqlSugar.Queryable<Grp_TourClientList>()
                                                   .LeftJoin<Crm_DeleClient>((tcl, dc) => tcl.ClientId == dc.Id && dc.IsDel == 0)
                                                   .LeftJoin<Crm_CustomerCompany>((tcl, dc, cc) => dc.CrmCompanyId == cc.Id && dc.IsDel == 0)
@@ -1043,11 +1046,13 @@ namespace OASystem.API.Controllers
                                     int days = dac1.FindAll(x => x.Place == item.Place).Count();
                                     SetCells(ChildTable, doc, rowIndex, 0, item.Place);
                                     SetCells(ChildTable, doc, rowIndex, 1, days + "晚");
-                                    SetCells(ChildTable, doc, rowIndex, 2, item.Cost + item.Currency + "/晚");
+
+                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Name ?? "Unknown";
+                                    SetCells(ChildTable, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/晚");
                                     SetCells(ChildTable, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
                                     SetCells(ChildTable, doc, rowIndex, 4, "CNY" + item.SubTotal * days + "\r\n");
                                     rowIndex++;
-                                    zsinfo += item.Place + "  " + days + "晚 " + item.Cost + item.Currency + "/晚" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00") + "   CNY" + item.SubTotal * days + "\r\n";
+                                    zsinfo += item.Place + "  " + days + "晚 " + item.Cost.ToString("#0.00") + currencyCode + "/晚" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.0000") + "   CNY" + item.SubTotal * days + "\r\n";
                                 }
 
                             }
@@ -1078,11 +1083,13 @@ namespace OASystem.API.Controllers
                                     int days = dac2.FindAll(x => x.Place == item.Place).Count();
                                     SetCells(ChildTable1, doc, rowIndex, 0, item.Place);
                                     SetCells(ChildTable1, doc, rowIndex, 1, days + "天");
-                                    SetCells(ChildTable1, doc, rowIndex, 2, item.Cost + item.Currency + "/天");
+
+                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Name ?? "Unknown";
+                                    SetCells(ChildTable1, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/天");
                                     SetCells(ChildTable1, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
                                     SetCells(ChildTable1, doc, rowIndex, 4, "CNY" + item.SubTotal * days);
                                     rowIndex++;
-                                    hsinfo += item.Place + "  " + days + "天 " + item.Cost + item.Currency + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00") + "   CNY" + item.SubTotal * days + "\r\n";
+                                    hsinfo += item.Place + "  " + days + "天 " + item.Cost.ToString("#0.00") + currencyCode + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.0000") + "   CNY" + item.SubTotal * days + "\r\n";
                                 }
 
                             }
@@ -1113,11 +1120,13 @@ namespace OASystem.API.Controllers
                                     int days = dac3.FindAll(x => x.Place == item.Place).Count();
                                     SetCells(ChildTable2, doc, rowIndex, 0, item.Place);
                                     SetCells(ChildTable2, doc, rowIndex, 1, days + "天");
-                                    SetCells(ChildTable2, doc, rowIndex, 2, item.Cost + item.Currency + "/天");
+
+                                    string currencyCode = currData.Find(it => it.Id == item.Currency)?.Name ?? "Unknown";
+                                    SetCells(ChildTable2, doc, rowIndex, 2, item.Cost.ToString("#0.00") + currencyCode + "/天");
                                     SetCells(ChildTable2, doc, rowIndex, 3, " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00"));
                                     SetCells(ChildTable2, doc, rowIndex, 4, "CNY" + item.SubTotal * days + "\r\n");
                                     rowIndex++;
-                                    gzinfo += item.Place + "  " + days + "天 " + item.Cost + item.Currency + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00") + "   CNY" + item.SubTotal * days + "\r\n";
+                                    gzinfo += item.Place + "  " + days + "天 " + item.Cost.ToString("#0.00") + currencyCode + "/天" + " 汇率" + (item.SubTotal / item.Cost).ToString("#0.00") + "   CNY" + item.SubTotal * days + "\r\n";
                                 }
 
                             }
@@ -1169,7 +1178,7 @@ namespace OASystem.API.Controllers
                             }
                         }
                         //MemoryStream outSteam = new MemoryStream();
-                        string filsPath = AppSettingsHelper.Get("WordBasePath") + $"ForeignReceivables/File/{ClientItem.Key}.docx";
+                        string filsPath = AppSettingsHelper.Get("WordBasePath") + $"ForeignReceivables/File/{ClientItem.Key.Replace("\n","")}.docx";
                         doc.Save(filsPath);
                         filesToZip.Add(filsPath);
                         //streams.Add(ClientItem.Key + ".docx", outSteam.ToArray());

+ 102 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -3605,6 +3605,75 @@ namespace OASystem.API.Controllers
             }
         }
 
+
+        /// <summary>
+        /// 团组模块 - 出入境费用 
+        /// 实时汇率 tips
+        /// 签证费用 tips
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetEnterExitCostRealTimeRateAndVisaTips(EnterExitCostInfobyDiIdDto dto)
+        {
+            try
+            {
+                var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(it => it.Id == dto.DiId && it.IsDel == 0);
+                dynamic visaInfo;
+                if (groupInfo != null)
+                {
+                    List<string> countrys = _groupRepository.GroupSplitCountry(groupInfo.VisitCountry);
+                    if (countrys.Count > 0)
+                    {
+                        var countryVisaFees = await _sqlSugar.Queryable<Res_CountryFeeCost>().ToListAsync(it => it.IsDel == 0 && countrys.Contains(it.VisaCountry));
+
+
+
+
+                    }
+                }
+
+
+                //默认币种显示
+                List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
+                {
+                    new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.0000M },
+
+                };
+
+                var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
+                if (_currencyRate.Count > 0)
+                {
+
+                    foreach (var item in _currencyInfos)
+                    {
+                        var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
+                        if (rateInfo != null)
+                        {
+                            item.Rate = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
+                        }
+                    }
+                }
+
+
+                return Ok(JsonView(true, "查询成功!", new
+                {
+                    //GroupNameData = groupNameData.Data,
+                    CurrencyInit = _currencyInfos
+                }));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+                throw;
+            }
+        }
+
+
         /// <summary>
         /// 团组模块 - 出入境费用 - Info
         /// </summary>
@@ -3615,6 +3684,7 @@ namespace OASystem.API.Controllers
         {
             try
             {
+
                 var data = await _enterExitCostRep.GetEnterExitCostInfoByDiId(dto);
 
                 if (data.Code != 0)
@@ -10034,6 +10104,38 @@ namespace OASystem.API.Controllers
 
         #region 接团客户名单 PageId 104
 
+
+        /// <summary>
+        /// 接团客户名单
+        /// 迁移数据(慎用!)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostTourClientListChange()
+        {
+            try
+            {
+                _sqlSugar.ChangeDatabase(DBEnum.OA2014DB);
+                //var groupClinetData1
+
+
+
+            }
+            catch (Exception ex)
+            {
+
+                return Ok(JsonView(false, ex.Message));
+            }
+
+            return Ok(JsonView(true));
+
+        }
+
+
+
+
         /// <summary>
         /// 接团客户名单
         /// 根据团组Id查询List

+ 1 - 1
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -812,7 +812,7 @@ namespace OASystem.API.Controllers
             }
             catch (Exception ex)
             {
-                return Ok(JsonView(false, "程序错误!"));
+                return Ok(JsonView(false, ex.Message));
                 throw;
             }
 

+ 6 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_CountryFeeCost.cs

@@ -94,5 +94,11 @@ namespace OASystem.Domain.Entities.Resource
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(255)")]
         public string VisaAddress { get; set; }
 
+        /// <summary>
+        /// 最后更新时间
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(30)")]
+        public string LastUpdateTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+
     }
 }

+ 1 - 1
OASystem/OASystem.Domain/Entities/System/Sys_Users.cs

@@ -44,7 +44,7 @@ namespace OASystem.Domain.Entities.System
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string Password { get; set; } 
         /// <summary>
-        /// 性别0 男1 女  2 未设置
+        /// 性别0 男 1 女  2 未设置
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int Sex { get; set; }

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

@@ -94,9 +94,9 @@ namespace OASystem.Domain.ViewModels.System
     /// </summary>
     public class UserLoginInfoView
     {
-        /// <summary>
-        /// 工号
-        /// </summary>
+        ///// <summary>
+        ///// 工号
+        ///// </summary>
         //public string Number { get; set; }
 
         /// <summary>
@@ -109,6 +109,12 @@ namespace OASystem.Domain.ViewModels.System
         /// </summary>
         public string CnName { get; set; }
 
+        /// <summary>
+        /// 性别
+        /// 0 男 1 女 2 未设置 
+        /// </summary>
+        public int Sex { get; set; }
+
         /// <summary>
         /// 公司名称
         /// </summary>

+ 19 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -191,6 +191,25 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return str.Trim();
         }
 
+        /// <summary>
+        /// 团组国家分割字符
+        /// 返回 国家数组
+        /// </summary>
+        /// <param name="teamName"></param>
+        /// <returns></returns>
+        public List<string> GroupSplitCountry (string visitCountry)
+        {
+            List<string> countrys = new List<string>();
+
+            if (!string.IsNullOrEmpty(visitCountry))
+            {
+                if (visitCountry.Contains("、")) countrys = visitCountry.Split("、").ToList();
+                else countrys.Add(visitCountry);
+            }
+            return countrys;
+        }
+
+
         /// <summary>
         /// 获取接团信息 Page List
         /// </summary>

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Login/LoginRepository.cs

@@ -62,7 +62,7 @@ namespace OASystem.Infrastructure.Repositories.Login
 
             //员工数据
             string sqlWhere = string.Format(" Where su.Id={0}", _entity.Id);
-            string userSqlWhere = string.Format(@"Select sc.CompanyName,sd.DepName,sjp.JobName,su.Id UserId,su.CnName,su.Email
+            string userSqlWhere = string.Format(@"Select sc.CompanyName,sd.DepName,sjp.JobName,su.Id UserId,su.CnName,su.Sex,su.Email
                                                   From Sys_Users su 
                                                   Inner Join Sys_Company sc On su.CompanyId = sc.Id
                                                   Inner Join Sys_Department sd On su.DepId = sd.Id

+ 4 - 2
OASystem/OASystem.Infrastructure/Repositories/Resource/CountryFeeRepository.cs

@@ -37,6 +37,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                     else//不存在,可添加
                     {
                         Res_CountryFeeCost _CountryFeeCost = _mapper.Map<Res_CountryFeeCost>(dto);
+
                         int id = await AddAsyncReturnId(_CountryFeeCost);
                         if (id == 0)
                         {
@@ -64,7 +65,8 @@ namespace OASystem.Infrastructure.Repositories.Resource
                         UrgentPrice = dto.UrgentPrice,
                         UrgentPriceDesc = dto.UrgentPriceDesc,
                         VisaAddress = dto.VisaAddress,
-                        Remark = dto.Remark
+                        Remark = dto.Remark,
+                        LastUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                     });
                     if (!res)
                     {
@@ -79,7 +81,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
             }
             catch (Exception ex)
             {
-                return result = new Result() { Code = -2, Msg = "程序错误!" };
+                return result = new Result() { Code = -2, Msg = ex.Message };
             }
             return result;
         }