|
@@ -45,11 +45,24 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
var teamRateDatas = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); // STid=66 全球币种
|
|
|
|
|
|
+
|
|
|
+
|
|
|
dynamic _data = null;
|
|
|
|
|
|
if (dto.PortType == 1)
|
|
|
{
|
|
|
- _data = new { GroupData = groups.Data, TeamRateData = teamRateDatas.Data };
|
|
|
+ List<Sys_SetData> sys_SetDatas = new List<Sys_SetData>();
|
|
|
+ sys_SetDatas = JsonConvert.DeserializeObject<List<Sys_SetData>>(JsonConvert.SerializeObject(teamRateDatas.Data));
|
|
|
+ List<TeamRateDescView> teamRateDescViews = new List<TeamRateDescView>();
|
|
|
+ foreach (Sys_SetData item in sys_SetDatas)
|
|
|
+ {
|
|
|
+ teamRateDescViews.Add(new TeamRateDescView() {
|
|
|
+ CurrencyName = item.Remark,
|
|
|
+ CurrencyCode = item.Name,
|
|
|
+ Rate = 0.0000M
|
|
|
+ });
|
|
|
+ }
|
|
|
+ _data = new { GroupData = groups.Data, TeamRateData = teamRateDescViews };
|
|
|
|
|
|
}
|
|
|
else if (dto.PortType == 2)
|
|
@@ -198,7 +211,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 团组汇率 Rep
|
|
|
/// </summary>
|
|
@@ -296,6 +308,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
TeamRateModelView teamRateModelInfo = new TeamRateModelView();
|
|
|
|
|
|
+ teamRateModelInfo.Id = item.Id;
|
|
|
teamRateModelInfo.CTableId = item.CTable;
|
|
|
teamRateModelInfo.CTableName = item.Name;
|
|
|
List<TeamRateDescView> teamRateDescViews = new List<TeamRateDescView>();
|
|
@@ -347,5 +360,74 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 团组汇率 更新 or 添加
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<Result> PostGroupRateUpdate(TeamRateUpdateDto dto)
|
|
|
+ {
|
|
|
+
|
|
|
+ Result result = new() { Code = -2 };
|
|
|
+
|
|
|
+
|
|
|
+ List<Grp_TeamRate> teamRates = new List<Grp_TeamRate>();
|
|
|
+ foreach (TeamRateUpdateInfo item in dto.teamRateUpdateInfos)
|
|
|
+ {
|
|
|
+ Grp_TeamRate teamRateInfo = new Grp_TeamRate();
|
|
|
+ string currencyStr = string.Empty;
|
|
|
+ foreach (TeamRateDescView currency in item.teamRates)
|
|
|
+ {
|
|
|
+ currencyStr += string.Format(@"{0}({1}):{2}|", currency.CurrencyName, currency.CurrencyCode, currency.Rate);
|
|
|
+ }
|
|
|
+ if (currencyStr.Length > 0)
|
|
|
+ {
|
|
|
+ currencyStr = currencyStr.Substring(0, currencyStr.Length - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ teamRateInfo.DiId = dto.DiId;
|
|
|
+ teamRateInfo.CreateUserId = dto.CreateUserId;
|
|
|
+ teamRateInfo.Id = item.Id;
|
|
|
+ teamRateInfo.CreateTime = DateTime.Now;
|
|
|
+ teamRateInfo.CTable = item.CTable;
|
|
|
+ teamRateInfo.Remark = currencyStr;
|
|
|
+ teamRates.Add(teamRateInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int addCount = 0, updateCount = 0;
|
|
|
+ if (dto.PortType == 1)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var x = _sqlSugar.Storageable(teamRates).ToStorage();
|
|
|
+ addCount= x.AsInsertable.ExecuteCommand(); //不存在插入
|
|
|
+ updateCount = x.AsUpdateable.ExecuteCommand(); //存在更新
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ result.Msg = ex.Message;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (dto.PortType == 2)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (dto.PortType == 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ result.Code = 0;
|
|
|
+ result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount,updateCount);
|
|
|
+
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|