|
@@ -5,6 +5,7 @@ using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Text.Json;
|
|
|
using System.Threading.Tasks;
|
|
|
+using TEAMModelBI.Models;
|
|
|
using TEAMModelBI.Tool.Context;
|
|
|
using TEAMModelOS.Models;
|
|
|
using TEAMModelOS.SDK.Context.Constant;
|
|
@@ -128,7 +129,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 查询用户的关联
|
|
|
+ /// 查询用户信息
|
|
|
/// </summary>
|
|
|
/// <param name="jsonElement"></param>
|
|
|
/// <returns></returns>
|
|
@@ -202,14 +203,39 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
var table = tableClient.GetTableReference("IESOpenApi");
|
|
|
|
|
|
List<BizRelUser> bizRelUsers = new();
|
|
|
+ List<RelBizInfo> relBizInfos = new();
|
|
|
|
|
|
if (!string.IsNullOrEmpty($"{userId}"))
|
|
|
bizRelUsers = await table.QueryWhereString<BizRelUser>($"PartitionKey eq 'BizRelUser' and userId eq '{userId}'");
|
|
|
else
|
|
|
//bizRelUsers = await table.FindListByDict<BizRelUser>(new Dictionary<string, object>() { { "PartitionKey ", "BizRelUser" } });
|
|
|
bizRelUsers = await table.QueryWhereString<BizRelUser>($"PartitionKey eq 'BizRelUser'");
|
|
|
+ if (bizRelUsers.Count > 0)
|
|
|
+ {
|
|
|
+ if (bizRelUsers.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in bizRelUsers)
|
|
|
+ {
|
|
|
+ BusinessConfig businessConfig = table.Get<BusinessConfig>("BusinessConfig", item.bizId);
|
|
|
+ RelBizInfo relBizInfo = new()
|
|
|
+ {
|
|
|
+ userRowKey = item.userId,
|
|
|
+ relId = item.RowKey,
|
|
|
+ bizRowKey = item.bizId,
|
|
|
+ roles = !string.IsNullOrEmpty($"{item.roles}") ? new List<string>(item.roles.Split(',')) : new List<string>()
|
|
|
+ };
|
|
|
+ if (businessConfig != null)
|
|
|
+ {
|
|
|
+ relBizInfo.bizName = businessConfig.name;
|
|
|
+ relBizInfo.bizCredit = businessConfig.credit;
|
|
|
+ relBizInfo.bizPicture = businessConfig.picture;
|
|
|
+ relBizInfos.Add(relBizInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- return Ok(new { state = RespondCode.Ok, bizRelUsers });
|
|
|
+ return Ok(new { state = RespondCode.Ok, relBizInfos });
|
|
|
}
|
|
|
|
|
|
|