|
|
@@ -4,11 +4,10 @@ using Aspose.Words;
|
|
|
using Aspose.Words.Layout;
|
|
|
using Aspose.Words.Saving;
|
|
|
using Aspose.Words.Tables;
|
|
|
-using Dm.util;
|
|
|
+using Humanizer;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
using Microsoft.International.Converters.PinYinConverter;
|
|
|
using NodaTime;
|
|
|
-using NPOI.OpenXmlFormats.Vml;
|
|
|
using OASystem.API.OAMethodLib.File;
|
|
|
using OASystem.API.OAMethodLib.Hub.HubClients;
|
|
|
using OASystem.API.OAMethodLib.Hub.Hubs;
|
|
|
@@ -17,20 +16,19 @@ using OASystem.API.OAMethodLib.KiMiApi;
|
|
|
using OASystem.API.OAMethodLib.SignalR.Hubs;
|
|
|
using OASystem.Domain.AesEncryption;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
+using OASystem.Domain.Dtos.PersonnelModule;
|
|
|
using OASystem.Domain.Entities.Customer;
|
|
|
using OASystem.Domain.Entities.Financial;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.ViewModels.Financial;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Domain.ViewModels.JuHeExchangeRate;
|
|
|
-using OASystem.Domain.ViewModels.Statistics;
|
|
|
+using OASystem.Domain.ViewModels.PersonnelModule;
|
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
using System.Data;
|
|
|
using System.IdentityModel.Tokens.Jwt;
|
|
|
using System.Security.Claims;
|
|
|
-using OASystem.Domain.ViewModels.PersonnelModule;
|
|
|
-using OASystem.Domain.Dtos.PersonnelModule;
|
|
|
|
|
|
namespace OASystem.API.OAMethodLib
|
|
|
{
|
|
|
@@ -4297,6 +4295,88 @@ namespace OASystem.API.OAMethodLib
|
|
|
/// </summary>
|
|
|
private readonly static decimal _fxRateRise = 1.0350M;
|
|
|
|
|
|
+ #region 城市区间费用详情
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 城市区间费用详情 使用的币种及汇率
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="groupId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<List<CurrencyInfo>> EnterExitCostOVFeeUsedCurrencyAsync(int groupId = 0)
|
|
|
+ {
|
|
|
+ var infos = new List<CurrencyInfo>();
|
|
|
+
|
|
|
+ bool isUsedGroup = false;
|
|
|
+ var countryies = new List<string>();
|
|
|
+
|
|
|
+ var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == groupId).FirstAsync();
|
|
|
+ if (groupInfo != null)
|
|
|
+ {
|
|
|
+ countryies = _dirRep.GroupSplitCountry(groupInfo.VisitCountry);
|
|
|
+ if (countryies.Any())
|
|
|
+ {
|
|
|
+ isUsedGroup = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ infos = await _sqlSugar.Queryable<Res_OverseaVehicle>()
|
|
|
+ .LeftJoin<Sys_SetData>((ov, sd) => ov.Currency == sd.Id)
|
|
|
+ .Where((ov, sd) => ov.IsDel == 0)
|
|
|
+ .WhereIF(isUsedGroup, (ov, sd) => countryies.Contains(ov.CountryName))
|
|
|
+ .Select((ov, sd) => new CurrencyInfo()
|
|
|
+ {
|
|
|
+ CurrencyCode = sd.Name.ToUpper(),
|
|
|
+ CurrencyName = sd.Remark
|
|
|
+ })
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ //出入境费用存储的币种及汇率
|
|
|
+ var eexCurrencyInfos = new List<CurrencyInfo>();
|
|
|
+ if (infos.Any())
|
|
|
+ {
|
|
|
+ var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == groupId).FirstAsync();
|
|
|
+ if (eecInfo != null)
|
|
|
+ {
|
|
|
+ eexCurrencyInfos = CommonFun.GetCurrencyChinaToList(eecInfo.CurrencyRemark);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //合并已使用币种及汇率
|
|
|
+ infos.ForEach(x =>
|
|
|
+ {
|
|
|
+ var eexCurrencyInfo = eexCurrencyInfos.Where(y => y.CurrencyCode == x.CurrencyCode).FirstOrDefault();
|
|
|
+ if (eexCurrencyInfo != null)
|
|
|
+ {
|
|
|
+ x.Rate = eexCurrencyInfo.Rate;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //未存储费用集合
|
|
|
+ var unSaveCurrInfos = infos.Where(x => !eexCurrencyInfos.Any(y => y.CurrencyCode == x.CurrencyCode)).ToList();
|
|
|
+ if (unSaveCurrInfos.Any())
|
|
|
+ {
|
|
|
+ var currencyRate = await _juHeApi.PostItemRateAsync(unSaveCurrInfos.Select(it => it.CurrencyCode!).ToArray());
|
|
|
+ if (currencyRate.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in infos)
|
|
|
+ {
|
|
|
+ var rateInfo = currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
+ if (rateInfo != null)
|
|
|
+ {
|
|
|
+ decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
|
|
|
+ rate1 *= _fxRateRise;
|
|
|
+
|
|
|
+ item.Rate = rate1.TruncDecimals(4) + _xchgRateAdj;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return infos;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 出入境费用 初始化汇率
|
|
|
/// </summary>
|
|
|
@@ -4304,13 +4384,13 @@ namespace OASystem.API.OAMethodLib
|
|
|
public static async Task<List<CurrencyInfo>> EnterExitCostInitRate()
|
|
|
{
|
|
|
//默认币种显示
|
|
|
- List<CurrencyInfo> currencyInfos = new List<CurrencyInfo>()
|
|
|
+ var currencyInfos = new List<CurrencyInfo>()
|
|
|
{
|
|
|
- new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 7.5000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 8.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 9.5000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0500M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.9500M },
|
|
|
+ new(){ CurrencyCode="USD",CurrencyName = "美元",Rate = 7.5000M },
|
|
|
+ new(){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 8.0000M },
|
|
|
+ new(){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 9.5000M },
|
|
|
+ new(){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0500M },
|
|
|
+ new(){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.9500M },
|
|
|
};
|
|
|
|
|
|
var currencyRate = await _juHeApi.PostItemRateAsync(currencyInfos.Select(it => it.CurrencyCode!).ToArray());
|
|
|
@@ -4433,8 +4513,8 @@ namespace OASystem.API.OAMethodLib
|
|
|
//if (cacheRate.Rate != currRate)
|
|
|
//{
|
|
|
// isSendMsg = true;
|
|
|
- //>团组归属:<font color='info'>{groupName}</font>
|
|
|
- msgContent.AppendLine($">- {cacheRate.CurrencyName}汇率(页面保存):{cacheRate.Rate:#0.0000} / 实时汇率(接口保存,已上浮1.0350):{currRate:#0.0000}【原接口输出汇率为:{liveRate.Rate:#0.0000}】");
|
|
|
+ //>团组归属:<font color='info'>{groupName}</font>
|
|
|
+ msgContent.AppendLine($">- {cacheRate.CurrencyName}汇率(页面保存):{cacheRate.Rate:#0.0000} / 实时汇率(接口保存,已上浮1.0350):{currRate:#0.0000}【原接口输出汇率为:{liveRate.Rate:#0.0000}】");
|
|
|
//}
|
|
|
}
|
|
|
return (isSendMsg, msgContent.ToString(), liveRates);
|