|
@@ -55,17 +55,21 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
string sql = string.Format(@"select i.*,(select CnName from Sys_Users where Id=i.CreateUserId ) as CreateUserName from
|
|
|
Res_InvitationOfficialActivityData i {0} order by CreateTime desc", sqlWhere);
|
|
|
- List<InvitationOfficialActivityDataView> _ivitiesViews = await _sqlSugar.SqlQueryable<InvitationOfficialActivityDataView>(sql).ToListAsync();
|
|
|
+ List<InvitationOfficialActivityDataView> _ivitiesViews = _sqlSugar.SqlQueryable<InvitationOfficialActivityDataView>(sql).ToList();
|
|
|
if (_ivitiesViews.Count != 0)
|
|
|
{
|
|
|
+ List<Grp_DelegationInfo> _DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().ToList();
|
|
|
+
|
|
|
foreach (var item in _ivitiesViews)
|
|
|
{
|
|
|
string delegationNameList = "";
|
|
|
string[] DelegationName = item.Delegation.Split(',');
|
|
|
for (int i = 0; i < DelegationName.Length; i++)
|
|
|
{
|
|
|
- Grp_DelegationInfo _DelegationInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(a => a.Id ==int.Parse(DelegationName[i]));
|
|
|
- if (_DelegationInfo != null) { delegationNameList += _DelegationInfo.TeamName + ","; }
|
|
|
+ //Grp_DelegationInfo _DelegationInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(a => a.Id ==int.Parse(DelegationName[i]));
|
|
|
+ //if (_DelegationInfo != null) { delegationNameList += _DelegationInfo.TeamName + ","; }
|
|
|
+
|
|
|
+ delegationNameList += _DelegationInfos.Find(it => it.Id == int.Parse(DelegationName[i]))?.TeamName ?? "Unknown" + ",";
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(delegationNameList))
|
|
|
{
|
|
@@ -113,7 +117,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ result = new Result() { Code = -2, Msg = ex.Message };
|
|
|
}
|
|
|
return result;
|
|
|
}
|