|
@@ -31,6 +31,7 @@ using NPOI.POIFS.Properties;
|
|
|
using SixLabors.ImageSharp.ColorSpaces;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using System.Diagnostics;
|
|
|
+using System.Security.Cryptography;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -46,6 +47,7 @@ namespace OASystem.API.Controllers
|
|
|
private readonly SqlSugarClient _sqlSugar;
|
|
|
private readonly HttpClient _httpClient;
|
|
|
private readonly SetDataTypeRepository _setDataTypeRep;
|
|
|
+ private readonly SetDataRepository _setDataRep;
|
|
|
private readonly DailyFeePaymentRepository _daiRep; //日付申请仓库
|
|
|
private readonly TeamRateRepository _teamRateRep; //团组汇率仓库
|
|
|
private readonly ForeignReceivablesRepository _ForForeignReceivablesRep; //对外收款账单仓库
|
|
@@ -2697,6 +2699,60 @@ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId
|
|
|
return Ok(JsonView(true, "操作成功"));
|
|
|
}
|
|
|
|
|
|
+ private Result PostCurrencyByDiid_Sync(int diId, int CId, int currencyId)
|
|
|
+ {
|
|
|
+ if (diId == 0)
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "请传入团组Id!" };
|
|
|
+ }
|
|
|
+ if (CId == 0)
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "请传入类型Id!" };
|
|
|
+ }
|
|
|
+ if (currencyId == 0)
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "请传入币种Id!" };
|
|
|
+ }
|
|
|
+ Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == diId && a.IsDel == 0 && a.CTable == CId);
|
|
|
+ List<CurrencyInfo> currencyInfos = new List<CurrencyInfo>();
|
|
|
+ CurrencyInfo CurrencyRate = new CurrencyInfo();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (_TeamRate != null)
|
|
|
+ {
|
|
|
+ Sys_SetData _SetData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == currencyId);
|
|
|
+ if (_SetData != null)
|
|
|
+ {
|
|
|
+ currencyInfos = CommonFun.GetCurrencyChinaToList(_TeamRate.Remark);
|
|
|
+ CurrencyRate = currencyInfos.FirstOrDefault(a => a.CurrencyCode == _SetData.Name);
|
|
|
+ if (CurrencyRate != null)
|
|
|
+ {
|
|
|
+ return new Result() { Code = 0, Msg = "查询成功!", Data = CurrencyRate };
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "暂无团组汇率,请前往设置!", Data = CurrencyRate };
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "暂无团组汇率,请前往设置!", Data = CurrencyRate };
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "暂无团组汇率,请前往设置!", Data = CurrencyRate };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ return new Result() { Code = -1, Msg = "查询异常!", Data = CurrencyRate };
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private bool extraCost_editCreditCardPayment(Fin_GroupExtraCostDto_OP costDto)
|
|
|
{
|
|
|
//设置团组汇率
|
|
@@ -2706,19 +2762,21 @@ Where c.CTable = 1015 And c.IsPay = 1 And f.IsDel = 0 And c.IsDel = 0 And f.DiId
|
|
|
|
|
|
if (costDto.costSign != 3)
|
|
|
{
|
|
|
- Grp_TeamRate tr = _daiRep.Query<Grp_TeamRate>(s => s.DiId == costDto.diId && s.CTable == 1015).First();
|
|
|
+ //获取新汇率 int diId,int CId, int currencyId
|
|
|
+ Result rate = this.PostCurrencyByDiid_Sync(costDto.diId, 1015, costDto.currency);
|
|
|
|
|
|
- if (tr != null)
|
|
|
+ if (rate.Code == 0)
|
|
|
{
|
|
|
- if (costDto.currency == 49)
|
|
|
+ var rateInfo = (rate.Data as CurrencyInfo);
|
|
|
+ if (rateInfo is not null)
|
|
|
{
|
|
|
- dcm_dayrate = tr.RateU;
|
|
|
- dcm_rmbPrice = dcm_rmbPrice * tr.RateU;
|
|
|
+
|
|
|
+ dcm_dayrate = rateInfo.Rate;
|
|
|
+ dcm_rmbPrice = rateInfo.Rate * dcm_rmbPrice;
|
|
|
}
|
|
|
- else if (costDto.currency == 51)
|
|
|
+ else
|
|
|
{
|
|
|
- dcm_dayrate = tr.RateE;
|
|
|
- dcm_rmbPrice = dcm_rmbPrice * tr.RateE;
|
|
|
+ dcm_dayrate = 1;
|
|
|
}
|
|
|
}
|
|
|
}
|