|
@@ -1403,7 +1403,9 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
var table = tableClient.GetTableReference("BIDDUserInfo");
|
|
|
|
|
|
StringBuilder msg = new($"{_tmdName}[{_tmdId}]将");
|
|
|
- List<DingDingUserInfo> upUserInfo = new();
|
|
|
+ List<DingDingUserInfo> upUserInfos = new();
|
|
|
+
|
|
|
+ List<DDUserInfo> upUserInfo = new();
|
|
|
CoreUser coreUser = new();
|
|
|
string oldTmdId = null;
|
|
|
string reole = null;
|
|
@@ -1424,7 +1426,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
item.picture = coreUser.picture;
|
|
|
item.mail = coreUser.mail;
|
|
|
msg.Append($"{item.name}的{item.tmdId}账号改为新的{coreUser.id}账号;");
|
|
|
- upUserInfo.Add(item);
|
|
|
+ upUserInfos.Add(item);
|
|
|
}
|
|
|
else return Ok(new { state = 404, msg = "依据钉钉手机号未找到醍摩豆账号!" });
|
|
|
}
|
|
@@ -1512,12 +1514,52 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
|
|
|
else
|
|
|
await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
|
|
|
- upUserInfo = await table.SaveOrUpdateAll<DingDingUserInfo>(upUserInfo);
|
|
|
+ upUserInfos = await table.SaveOrUpdateAll<DingDingUserInfo>(upUserInfos);
|
|
|
}
|
|
|
|
|
|
//保存操作记录
|
|
|
await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "tabledd-update-tmdinfo", msg.ToString(), _dingDing, httpContext: HttpContext);
|
|
|
|
|
|
+ foreach (var item in upUserInfos)
|
|
|
+ {
|
|
|
+ DDUserInfo tempUserInfo = new()
|
|
|
+ {
|
|
|
+
|
|
|
+ partitionKey = item.PartitionKey,
|
|
|
+ rowKey = item.RowKey,
|
|
|
+ userId = item.userId,
|
|
|
+ unionId = item.unionId,
|
|
|
+ name = item.name,
|
|
|
+ title = item.title,
|
|
|
+ stateCode = item.stateCode,
|
|
|
+ mobile = item.mobile,
|
|
|
+ jobNumber = item.jobNumber,
|
|
|
+ pid = item.pid,
|
|
|
+ deptId = item.deptId,
|
|
|
+ deptName = item.deptName,
|
|
|
+ depts = item.depts,
|
|
|
+ avatar = item.avatar,
|
|
|
+ isAdmin = item.isAdmin,
|
|
|
+ tmdId = item.tmdId,
|
|
|
+ tmdName = item.tmdName,
|
|
|
+ tmdMobile = item.tmdMobile,
|
|
|
+ mail = item.mail,
|
|
|
+ picture = item.picture,
|
|
|
+ roles = item.roles,
|
|
|
+ joinTime = item.joinTime,
|
|
|
+ isDisable = item.isDisable,
|
|
|
+ permissions = item.permissions,
|
|
|
+ handleRoles = !string.IsNullOrEmpty($"{item.roles}") ? new List<string>(item.roles.Split(",")) : new List<string>(),
|
|
|
+ handlePermissions = !string.IsNullOrEmpty($"{item.permissions}") ? new List<string>(item.permissions.Split(",")) : new List<string>(),
|
|
|
+
|
|
|
+ };
|
|
|
+ if (!string.IsNullOrEmpty(item.schoolIds))
|
|
|
+ {
|
|
|
+ List<string> tempSchoolIds = new(item.schoolIds.Split("|"));
|
|
|
+ tempUserInfo.handleSchools = await SchoolWay.GetSchoolInfos(cosmosClient, tempSchoolIds);
|
|
|
+ }
|
|
|
+ upUserInfo.Add(tempUserInfo);
|
|
|
+ }
|
|
|
return Ok(new { state = RespondCode.Ok, upUserInfo });
|
|
|
}
|
|
|
catch (Exception ex)
|