|
@@ -455,7 +455,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
#region 团组汇率
|
|
#region 团组汇率
|
|
|
|
|
|
-
|
|
|
|
foreach (TeamRateInfoView item in teamRateInfo)
|
|
foreach (TeamRateInfoView item in teamRateInfo)
|
|
{
|
|
{
|
|
TeamRateModelView teamRateModelInfo = new TeamRateModelView();
|
|
TeamRateModelView teamRateModelInfo = new TeamRateModelView();
|
|
@@ -463,39 +462,104 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
teamRateModelInfo.Id = item.Id;
|
|
teamRateModelInfo.Id = item.Id;
|
|
teamRateModelInfo.CTableId = item.CTable;
|
|
teamRateModelInfo.CTableId = item.CTable;
|
|
teamRateModelInfo.CTableName = item.Name;
|
|
teamRateModelInfo.CTableName = item.Name;
|
|
- List<TeamRateDescView> teamRateDescViews = new List<TeamRateDescView>();
|
|
|
|
|
|
+ //拆分remark里的汇率
|
|
|
|
+ teamRateModelInfo.TeamRates = GroupCurrencySplittings(item.Remark);
|
|
|
|
+ teamRateModels.Add(teamRateModelInfo);
|
|
|
|
+ }
|
|
|
|
|
|
- #region 拆分remark里的汇率
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
|
- if (item.Remark.Contains("|"))
|
|
|
|
|
|
+ return teamRateModels;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 团组汇率币种拆分
|
|
|
|
+ /// 团组币种按指定格式拆分 返回集合
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="currStr"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public List<TeamRateDescView> GroupCurrencySplittings(string currStr)
|
|
|
|
+ {
|
|
|
|
+ List<TeamRateDescView> _view = new List<TeamRateDescView>();
|
|
|
|
+
|
|
|
|
+ if (!string.IsNullOrEmpty(currStr))
|
|
|
|
+ {
|
|
|
|
+ if (currStr.Contains("|"))
|
|
{
|
|
{
|
|
- string[] currencyArr = item.Remark.Split("|");
|
|
|
|
|
|
+ string[] currencyArr = currStr.Split("|");
|
|
foreach (string currency in currencyArr)
|
|
foreach (string currency in currencyArr)
|
|
{
|
|
{
|
|
- string[] currency1 = currency.Split(":");
|
|
|
|
- string[] currency2 = currency1[0].Split("(");
|
|
|
|
-
|
|
|
|
- TeamRateDescView rateDescView = new TeamRateDescView()
|
|
|
|
- {
|
|
|
|
- CurrencyCode = currency2[1].Replace(")", "").TrimEnd(),
|
|
|
|
- CurrencyName = currency2[0],
|
|
|
|
- Rate = decimal.Parse(currency1[1]),
|
|
|
|
- };
|
|
|
|
- teamRateDescViews.Add(rateDescView);
|
|
|
|
|
|
+ _view.Add(GroupCurrencySplittingSingle(currency));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ _view.Add(GroupCurrencySplittingSingle(currStr));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ return _view;
|
|
|
|
+ }
|
|
|
|
|
|
- teamRateModelInfo.TeamRates = teamRateDescViews;
|
|
|
|
- teamRateModels.Add(teamRateModelInfo);
|
|
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 团组汇率币种拆分
|
|
|
|
+ /// 团组币种按指定格式拆分 返回集合
|
|
|
|
+ /// return TeamRateDescView
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="currStr"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public TeamRateDescView GroupCurrencySplittingSingle(string currStr)
|
|
|
|
+ {
|
|
|
|
+ TeamRateDescView _view = new TeamRateDescView();
|
|
|
|
+
|
|
|
|
+ if (!string.IsNullOrEmpty(currStr))
|
|
|
|
+ {
|
|
|
|
+ string[] currency1 = currStr.Split(":");
|
|
|
|
+ string[] currency2 = currency1[0].Split("(");
|
|
|
|
+
|
|
|
|
+ _view = new TeamRateDescView()
|
|
|
|
+ {
|
|
|
|
+ CurrencyCode = currency2[1].Replace(")", "").TrimEnd(),
|
|
|
|
+ CurrencyName = currency2[0],
|
|
|
|
+ Rate = decimal.Parse(currency1[1]),
|
|
|
|
+ };
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ return _view;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 团组汇率币种拆分 注意返回 实体类
|
|
|
|
+ /// 团组币种按指定格式拆分 返回集合
|
|
|
|
+ /// return TeamRateDescView
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="currStr"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public TeamRateDescAddCurrencyIdView GroupCurrencySplittingSingle(List<SetDataInfoView> currs,string currStr)
|
|
|
|
+ {
|
|
|
|
+ TeamRateDescAddCurrencyIdView _view = new TeamRateDescAddCurrencyIdView();
|
|
|
|
|
|
- return teamRateModels;
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(currStr))
|
|
|
|
+ {
|
|
|
|
+ string[] currency1 = currStr.Split(":");
|
|
|
|
+ string[] currency2 = currency1[0].Split("(");
|
|
|
|
+
|
|
|
|
+ string currencyCode = currency2[1].Replace(")", "").TrimEnd();
|
|
|
|
+ SetDataInfoView dataInfoView = new SetDataInfoView();
|
|
|
|
+ dataInfoView = currs.Where(it => it.Name == currencyCode).FirstOrDefault();
|
|
|
|
+ int currencyId = currs.Where(it => it.Name == currencyCode).FirstOrDefault().Id;
|
|
|
|
+ _view = new TeamRateDescAddCurrencyIdView()
|
|
|
|
+ {
|
|
|
|
+ CurrencyId = dataInfoView.Id,
|
|
|
|
+ CurrencyCode = currencyCode,
|
|
|
|
+ CurrencyName = currency2[0],
|
|
|
|
+ Rate = decimal.Parse(currency1[1]),
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ return _view;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -591,43 +655,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
string[] currencyArr = item.Remark.Split("|");
|
|
string[] currencyArr = item.Remark.Split("|");
|
|
foreach (string currency in currencyArr)
|
|
foreach (string currency in currencyArr)
|
|
{
|
|
{
|
|
- string[] currency1 = currency.Split(":");
|
|
|
|
- string[] currency2 = currency1[0].Split("(");
|
|
|
|
-
|
|
|
|
- string currencyCode = currency2[1].Replace(")", "").TrimEnd();
|
|
|
|
- SetDataInfoView dataInfoView = new SetDataInfoView();
|
|
|
|
- dataInfoView = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault();
|
|
|
|
- int currencyId = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault().Id;
|
|
|
|
- TeamRateDescAddCurrencyIdView rateDescView = new TeamRateDescAddCurrencyIdView()
|
|
|
|
- {
|
|
|
|
- CurrencyId = dataInfoView.Id,
|
|
|
|
- CurrencyCode = currencyCode,
|
|
|
|
- CurrencyName = currency2[0],
|
|
|
|
- Rate = decimal.Parse(currency1[1]),
|
|
|
|
- };
|
|
|
|
- teamRateDescViews.Add(rateDescView);
|
|
|
|
|
|
+ teamRateDescViews.Add(GroupCurrencySplittingSingle(currencyDatas, currency));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (!string.IsNullOrEmpty(item.Remark))
|
|
|
|
- {
|
|
|
|
- string[] currency1 = item.Remark.Split(":");
|
|
|
|
- string[] currency2 = currency1[0].Split("(");
|
|
|
|
-
|
|
|
|
- string currencyCode = currency2[1].Replace(")", "").TrimEnd();
|
|
|
|
- SetDataInfoView dataInfoView = new SetDataInfoView();
|
|
|
|
- dataInfoView = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault();
|
|
|
|
- int currencyId = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault().Id;
|
|
|
|
- TeamRateDescAddCurrencyIdView rateDescView = new TeamRateDescAddCurrencyIdView()
|
|
|
|
- {
|
|
|
|
- CurrencyId = dataInfoView.Id,
|
|
|
|
- CurrencyCode = currencyCode,
|
|
|
|
- CurrencyName = currency2[0],
|
|
|
|
- Rate = decimal.Parse(currency1[1]),
|
|
|
|
- };
|
|
|
|
- teamRateDescViews.Add(rateDescView);
|
|
|
|
- }
|
|
|
|
|
|
+ teamRateDescViews.Add(GroupCurrencySplittingSingle(currencyDatas, item.Remark));
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -702,43 +736,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
string[] currencyArr = item.Remark.Split("|");
|
|
string[] currencyArr = item.Remark.Split("|");
|
|
foreach (string currency in currencyArr)
|
|
foreach (string currency in currencyArr)
|
|
{
|
|
{
|
|
- string[] currency1 = currency.Split(":");
|
|
|
|
- string[] currency2 = currency1[0].Split("(");
|
|
|
|
-
|
|
|
|
- string currencyCode = currency2[1].Replace(")", "").TrimEnd();
|
|
|
|
- SetDataInfoView dataInfoView = new SetDataInfoView();
|
|
|
|
- dataInfoView = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault();
|
|
|
|
- int currencyId = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault().Id;
|
|
|
|
- TeamRateDescAddCurrencyIdView rateDescView = new TeamRateDescAddCurrencyIdView()
|
|
|
|
- {
|
|
|
|
- CurrencyId = dataInfoView.Id,
|
|
|
|
- CurrencyCode = currencyCode,
|
|
|
|
- CurrencyName = currency2[0],
|
|
|
|
- Rate = decimal.Parse(currency1[1]),
|
|
|
|
- };
|
|
|
|
- teamRateDescViews.Add(rateDescView);
|
|
|
|
|
|
+
|
|
|
|
+ teamRateDescViews.Add(GroupCurrencySplittingSingle(currencyDatas, currency));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (!string.IsNullOrEmpty(item.Remark))
|
|
|
|
- {
|
|
|
|
- string[] currency1 = item.Remark.Split(":");
|
|
|
|
- string[] currency2 = currency1[0].Split("(");
|
|
|
|
-
|
|
|
|
- string currencyCode = currency2[1].Replace(")", "").TrimEnd();
|
|
|
|
- SetDataInfoView dataInfoView = new SetDataInfoView();
|
|
|
|
- dataInfoView = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault();
|
|
|
|
- int currencyId = currencyDatas.Where(it => it.Name == currencyCode).FirstOrDefault().Id;
|
|
|
|
- TeamRateDescAddCurrencyIdView rateDescView = new TeamRateDescAddCurrencyIdView()
|
|
|
|
- {
|
|
|
|
- CurrencyId = dataInfoView.Id,
|
|
|
|
- CurrencyCode = currencyCode,
|
|
|
|
- CurrencyName = currency2[0],
|
|
|
|
- Rate = decimal.Parse(currency1[1]),
|
|
|
|
- };
|
|
|
|
- teamRateDescViews.Add(rateDescView);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ teamRateDescViews.Add(GroupCurrencySplittingSingle(currencyDatas, item.Remark));
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
#endregion
|