|
@@ -15,6 +15,7 @@ using OASystem.API.OAMethodLib.Hub.HubClients;
|
|
using OASystem.API.OAMethodLib.Hub.Hubs;
|
|
using OASystem.API.OAMethodLib.Hub.Hubs;
|
|
using OASystem.API.OAMethodLib.JuHeAPI;
|
|
using OASystem.API.OAMethodLib.JuHeAPI;
|
|
using OASystem.API.OAMethodLib.KiMiApi;
|
|
using OASystem.API.OAMethodLib.KiMiApi;
|
|
|
|
+using OASystem.API.OAMethodLib.Logging;
|
|
using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
|
|
using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
|
|
using OASystem.Domain.AesEncryption;
|
|
using OASystem.Domain.AesEncryption;
|
|
using OASystem.Domain.Attributes;
|
|
using OASystem.Domain.Attributes;
|
|
@@ -41,6 +42,7 @@ using System.Diagnostics;
|
|
using System.Globalization;
|
|
using System.Globalization;
|
|
using System.IO.Compression;
|
|
using System.IO.Compression;
|
|
using System.Text.Json;
|
|
using System.Text.Json;
|
|
|
|
+using System.Text.RegularExpressions;
|
|
using System.Web;
|
|
using System.Web;
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
@@ -58,6 +60,7 @@ namespace OASystem.API.Controllers
|
|
public class GroupsController : ControllerBase
|
|
public class GroupsController : ControllerBase
|
|
{
|
|
{
|
|
private readonly ILogger<GroupsController> _logger;
|
|
private readonly ILogger<GroupsController> _logger;
|
|
|
|
+ private readonly ITextFileLogger _eec_textLogger;
|
|
private readonly GrpScheduleRepository _grpScheduleRep;
|
|
private readonly GrpScheduleRepository _grpScheduleRep;
|
|
private readonly IMapper _mapper;
|
|
private readonly IMapper _mapper;
|
|
private readonly DelegationInfoRepository _groupRepository;
|
|
private readonly DelegationInfoRepository _groupRepository;
|
|
@@ -112,6 +115,7 @@ namespace OASystem.API.Controllers
|
|
/// 构造函数
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="logger"></param>
|
|
/// <param name="logger"></param>
|
|
|
|
+ /// <param name="eec_textLogger"></param>
|
|
/// <param name="mapper"></param>
|
|
/// <param name="mapper"></param>
|
|
/// <param name="hubContext"></param>
|
|
/// <param name="hubContext"></param>
|
|
/// <param name="sqlSugar"></param>
|
|
/// <param name="sqlSugar"></param>
|
|
@@ -154,6 +158,7 @@ namespace OASystem.API.Controllers
|
|
/// <param name="grpOrderPreInfoRep"></param>
|
|
/// <param name="grpOrderPreInfoRep"></param>
|
|
public GroupsController(
|
|
public GroupsController(
|
|
ILogger<GroupsController> logger,
|
|
ILogger<GroupsController> logger,
|
|
|
|
+ ITextFileLogger eec_textLogger,
|
|
IMapper mapper,
|
|
IMapper mapper,
|
|
IHubContext<ChatHub, IChatClient> hubContext,
|
|
IHubContext<ChatHub, IChatClient> hubContext,
|
|
SqlSugarClient sqlSugar,
|
|
SqlSugarClient sqlSugar,
|
|
@@ -197,6 +202,7 @@ namespace OASystem.API.Controllers
|
|
)
|
|
)
|
|
{
|
|
{
|
|
_logger = logger;
|
|
_logger = logger;
|
|
|
|
+ _eec_textLogger = eec_textLogger;
|
|
_mapper = mapper;
|
|
_mapper = mapper;
|
|
_grpScheduleRep = grpScheduleRep;
|
|
_grpScheduleRep = grpScheduleRep;
|
|
_groupRepository = groupRepository;
|
|
_groupRepository = groupRepository;
|
|
@@ -7350,6 +7356,46 @@ FROM
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
|
|
+ var rateRecords = new List<RateRecordInfo>();
|
|
|
|
+ #region 汇率保存前存储
|
|
|
|
+ var info = await _sqlSugar.Queryable<Grp_EnterExitCost>().FirstAsync(x => x.IsDel == 0 && x.DiId == dto.DiId);
|
|
|
|
+ if (info != null)
|
|
|
|
+ {
|
|
|
|
+ var cacheRateInfos = CommonFun.GetCurrencyChinaToList(info.CurrencyRemark);
|
|
|
|
+ if (cacheRateInfos != null && cacheRateInfos.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ rateRecords = cacheRateInfos.Select(x => new RateRecordInfo()
|
|
|
|
+ {
|
|
|
|
+ CurrencyCode = x.CurrencyCode,
|
|
|
|
+ CurrencyName = x.CurrencyName,
|
|
|
|
+ UpdatePreRate = x.Rate,
|
|
|
|
+ UpdateBreRate = dto.Currencys.Where(x1 => x1.CurrencyName.Equals(x.CurrencyName)).FirstOrDefault()?.Rate ?? 0.00M
|
|
|
|
+ }).ToList();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ rateRecords = dto.Currencys.Select(x => new RateRecordInfo()
|
|
|
|
+ {
|
|
|
|
+ CurrencyCode = x.CurrencyCode,
|
|
|
|
+ CurrencyName = x.CurrencyName,
|
|
|
|
+ UpdatePreRate = 0.00M,
|
|
|
|
+ UpdateBreRate = x.Rate
|
|
|
|
+ }).ToList();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ rateRecords = dto.Currencys.Select(x => new RateRecordInfo()
|
|
|
|
+ {
|
|
|
|
+ CurrencyCode = x.CurrencyCode,
|
|
|
|
+ CurrencyName = x.CurrencyName,
|
|
|
|
+ UpdatePreRate = 0.00M,
|
|
|
|
+ UpdateBreRate = x.Rate
|
|
|
|
+ }).ToList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
var data = await _enterExitCostRep.PostEnterExitCostOperate(dto);
|
|
var data = await _enterExitCostRep.PostEnterExitCostOperate(dto);
|
|
|
|
|
|
if (dto.DayOtherPriceData.Any())
|
|
if (dto.DayOtherPriceData.Any())
|
|
@@ -7423,14 +7469,49 @@ FROM
|
|
//汇率信息记录
|
|
//汇率信息记录
|
|
await GeneralMethod.RateRecordSave(dto.UserId, sign, "出入境费用");
|
|
await GeneralMethod.RateRecordSave(dto.UserId, sign, "出入境费用");
|
|
|
|
|
|
|
|
+ var checkCurrencys = await _enterExitCostRep.GetCheckCurrencies(dto.DiId);
|
|
//汇率验证、反推
|
|
//汇率验证、反推
|
|
- (bool isSendMsg,string msgContent) = await GeneralMethod.EnterExitCostCheckRate(dto.DiId);
|
|
|
|
|
|
+ (bool isSendMsg,string msgContent,List<CurrencyInfo> liveRates) = await GeneralMethod.EnterExitCostCheckRate(dto.DiId, checkCurrencys);
|
|
if (isSendMsg)
|
|
if (isSendMsg)
|
|
{
|
|
{
|
|
//消息推送
|
|
//消息推送
|
|
await AppNoticeLibrary.SendUserMsg_GroupShare_ToFin(dto.DiId,dto.UserId,msgContent);
|
|
await AppNoticeLibrary.SendUserMsg_GroupShare_ToFin(dto.DiId,dto.UserId,msgContent);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ #region //日志汇率记录
|
|
|
|
+
|
|
|
|
+ //按照已使用币种记录
|
|
|
|
+ if (checkCurrencys != null && checkCurrencys.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ rateRecords = rateRecords.Where(x => checkCurrencys.Select(x1 => x1.CurrencyName).ToList().Contains(x.CurrencyName)).ToList();
|
|
|
|
+
|
|
|
|
+ //汇率记录中加入实时汇率
|
|
|
|
+ if (liveRates != null && liveRates.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var item in rateRecords)
|
|
|
|
+ {
|
|
|
|
+ item.CurrLiveRate = liveRates.Where(x => x.CurrencyName.Equals(item.CurrencyName)).FirstOrDefault()?.Rate ?? 0.00M;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var teamName = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == dto.DiId && x.IsDel == 0).Select(x => x.TeamName).FirstAsync();
|
|
|
|
+ var operationName = await _sqlSugar.Queryable<Sys_Users>().Where(x => x.Id == dto.UserId && x.IsDel == 0).Select(x => x.CnName).FirstAsync();
|
|
|
|
+
|
|
|
|
+ var logContent = new StringBuilder();
|
|
|
|
+ foreach (var item in rateRecords)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ var blRate = (item.CurrLiveRate * 1.0350M).TruncDecimals(4);
|
|
|
|
+
|
|
|
|
+ string msg = $">- {item.CurrencyName}汇率:(页面保存前){item.UpdatePreRate:#0.0000}/(页面保存){item.UpdateBreRate:#0.0000}/实时汇率(已上浮1.0350):{blRate:#0.0000}【注:原接口输出汇率为:{item.CurrLiveRate:#0.0000}】";
|
|
|
|
+
|
|
|
|
+ logContent.AppendLine(msg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ _eec_textLogger.LogInformation("团组:【{teamName}({groupId})】 操作人:【{operationName}】 操作时间:【{operationTime}】\r\n{logContent}", teamName, dto.DiId, operationName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), logContent.ToString());
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
|
|
|
|
return Ok(JsonView(true, data.Msg, data.Data));
|
|
return Ok(JsonView(true, data.Msg, data.Data));
|
|
}
|
|
}
|