|
@@ -91,7 +91,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
|
|
|
//获取access_token
|
|
|
IDingTalkClient tokenClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
|
- OapiGettokenRequest tokenRequest = new OapiGettokenRequest() { Appkey = appKey, Appsecret = appSecret };
|
|
|
+ OapiGettokenRequest tokenRequest = new() { Appkey = appKey, Appsecret = appSecret };
|
|
|
tokenRequest.SetHttpMethod("Get");
|
|
|
OapiGettokenResponse tokenRespone = tokenClient.Execute(tokenRequest);
|
|
|
if (tokenRespone.IsError)
|
|
@@ -104,7 +104,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
//获取部门接口
|
|
|
IDingTalkClient deptListClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
|
|
|
//一级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList1 = new OapiV2DepartmentListsubRequest() { DeptId = 1L, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList1 = new() { DeptId = 1L, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList1 = deptListClient.Execute(reqDeptList1, access_token);
|
|
|
|
|
|
List<DingDingUserInfo> ddUserInfos = new();
|
|
@@ -119,7 +119,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos1.Count > 0) ddUserInfos.AddRange(dingDingUserInfos1);
|
|
|
|
|
|
//获取二级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList2 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept1.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList2 = new() { DeptId = tempDept1.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList2 = deptListClient.Execute(reqDeptList2, access_token);
|
|
|
if (rspDeptList2.Result != null)
|
|
|
{
|
|
@@ -131,7 +131,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos2.Count > 0) ddUserInfos.AddRange(dingDingUserInfos2);
|
|
|
|
|
|
//获取三级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList3 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept2.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList3 = new() { DeptId = tempDept2.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList3 = deptListClient.Execute(reqDeptList3, access_token);
|
|
|
if (rspDeptList3.Result != null)
|
|
|
{
|
|
@@ -143,7 +143,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos3.Count > 0) ddUserInfos.AddRange(dingDingUserInfos3);
|
|
|
|
|
|
//获取四级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList4 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept3.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList4 = new() { DeptId = tempDept3.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList4 = deptListClient.Execute(reqDeptList4, access_token);
|
|
|
if (rspDeptList4.Result != null)
|
|
|
{
|
|
@@ -155,7 +155,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos4.Count > 0) ddUserInfos.AddRange(dingDingUserInfos4);
|
|
|
|
|
|
//获取五级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList5 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept4.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList5 = new() { DeptId = tempDept4.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList5 = deptListClient.Execute(reqDeptList5, access_token);
|
|
|
if (rspDeptList5.Result != null)
|
|
|
{
|
|
@@ -437,7 +437,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
var table = tableClient.GetTableReference("BIDDUserInfo");
|
|
|
//string divide = _configuration["CustomParam:SiteScope"];
|
|
|
string divide = _option.Location;
|
|
|
- Dictionary<string, object> dic = new Dictionary<string, object> { { "PartitionKey", $"{divide}" } };
|
|
|
+ Dictionary<string, object> dic = new() { { "PartitionKey", $"{divide}" } };
|
|
|
|
|
|
List<DingDingUserInfo> tempUserInfos = await table.FindListByDict<DingDingUserInfo>(dic);
|
|
|
|
|
@@ -491,7 +491,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
|
|
|
if (!string.IsNullOrEmpty(item.schoolIds))
|
|
|
{
|
|
|
- List<string> tempSchoolIds = new List<string>(item.schoolIds.Split("|"));
|
|
|
+ List<string> tempSchoolIds = new(item.schoolIds.Split("|"));
|
|
|
tempUserInfo.handleSchools = await SchoolWay.GetSchoolInfos(cosmosCliet, tempSchoolIds);
|
|
|
}
|
|
|
ddUserInfos.Add(tempUserInfo);
|
|
@@ -546,7 +546,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
//string divide = _configuration["CustomParam:SiteScope"];
|
|
|
string divide = _option.Location;
|
|
|
|
|
|
- Dictionary<string, object> dic = new Dictionary<string, object> { { "PartitionKey", $"{divide}" }, { "mobile", $"{mobile}" } };
|
|
|
+ Dictionary<string, object> dic = new() { { "PartitionKey", $"{divide}" }, { "mobile", $"{mobile}" } };
|
|
|
List<DingDingUserInfo> ddUserInfoList = await table.FindListByDict<DingDingUserInfo>(dic);
|
|
|
|
|
|
if (ddUserInfoList.Count > 0)
|
|
@@ -617,7 +617,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
|
|
|
if (!string.IsNullOrEmpty(respUser.schoolIds))
|
|
|
{
|
|
|
- List<string> tempSchoolIds = new List<string>(respUser.schoolIds.Split("|"));
|
|
|
+ List<string> tempSchoolIds = new(respUser.schoolIds.Split("|"));
|
|
|
dDUserInfo.handleSchools = await SchoolWay.GetSchoolInfos(cosmosCliet, tempSchoolIds);
|
|
|
}
|
|
|
ddUserInfos.Add(dDUserInfo);
|
|
@@ -802,7 +802,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
|
|
|
//获取access_token
|
|
|
IDingTalkClient tokenClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
|
- OapiGettokenRequest tokenRequest = new OapiGettokenRequest() { Appkey = appKey, Appsecret = appSecret };
|
|
|
+ OapiGettokenRequest tokenRequest = new() { Appkey = appKey, Appsecret = appSecret };
|
|
|
tokenRequest.SetHttpMethod("Get");
|
|
|
OapiGettokenResponse tokenRespone = tokenClient.Execute(tokenRequest);
|
|
|
if (tokenRespone.IsError)
|
|
@@ -815,7 +815,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
//获取部门接口
|
|
|
IDingTalkClient deptListClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
|
|
|
//一级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList1 = new OapiV2DepartmentListsubRequest() { DeptId = 1L, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList1 = new() { DeptId = 1L, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList1 = deptListClient.Execute(reqDeptList1, access_token);
|
|
|
|
|
|
List<DingDingUserInfo> ddUserInfos = new();
|
|
@@ -830,7 +830,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos1.Count > 0) ddUserInfos.AddRange(dingDingUserInfos1);
|
|
|
|
|
|
//获取二级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList2 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept1.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList2 = new() { DeptId = tempDept1.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList2 = deptListClient.Execute(reqDeptList2, access_token);
|
|
|
if (rspDeptList2.Result != null)
|
|
|
{
|
|
@@ -842,7 +842,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos2.Count > 0) ddUserInfos.AddRange(dingDingUserInfos2);
|
|
|
|
|
|
//获取三级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList3 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept2.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList3 = new() { DeptId = tempDept2.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList3 = deptListClient.Execute(reqDeptList3, access_token);
|
|
|
if (rspDeptList3.Result != null)
|
|
|
{
|
|
@@ -854,7 +854,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos3.Count > 0) ddUserInfos.AddRange(dingDingUserInfos3);
|
|
|
|
|
|
//获取四级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList4 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept3.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList4 = new() { DeptId = tempDept3.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList4 = deptListClient.Execute(reqDeptList4, access_token);
|
|
|
if (rspDeptList4.Result != null)
|
|
|
{
|
|
@@ -866,7 +866,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
if (dingDingUserInfos4.Count > 0) ddUserInfos.AddRange(dingDingUserInfos4);
|
|
|
|
|
|
//获取五级部门
|
|
|
- OapiV2DepartmentListsubRequest reqDeptList5 = new OapiV2DepartmentListsubRequest() { DeptId = tempDept4.DeptId, Language = "zh_CN" };
|
|
|
+ OapiV2DepartmentListsubRequest reqDeptList5 = new() { DeptId = tempDept4.DeptId, Language = "zh_CN" };
|
|
|
OapiV2DepartmentListsubResponse rspDeptList5 = deptListClient.Execute(reqDeptList5, access_token);
|
|
|
if (rspDeptList5.Result != null)
|
|
|
{
|
|
@@ -1144,7 +1144,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
|
|
|
//获取access_token
|
|
|
IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
|
- OapiGettokenRequest request = new OapiGettokenRequest() { Appkey = appKey, Appsecret = appSecret };
|
|
|
+ OapiGettokenRequest request = new() { Appkey = appKey, Appsecret = appSecret };
|
|
|
request.SetHttpMethod("Get");
|
|
|
OapiGettokenResponse response = client.Execute(request);
|
|
|
if (response.IsError)
|
|
@@ -1156,15 +1156,15 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
string access_token = response.AccessToken;
|
|
|
|
|
|
IDingTalkClient InductionClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/querypreentry");
|
|
|
- OapiSmartworkHrmEmployeeQuerypreentryRequest reqInduction = new OapiSmartworkHrmEmployeeQuerypreentryRequest() { Offset = 0L, Size = 50 };
|
|
|
+ OapiSmartworkHrmEmployeeQuerypreentryRequest reqInduction = new() { Offset = 0L, Size = 50 };
|
|
|
reqInduction.SetHttpMethod("GET");
|
|
|
OapiSmartworkHrmEmployeeQuerypreentryResponse rspInduction = InductionClient.Execute(reqInduction, access_token);
|
|
|
if (rspInduction.Result.DataList != null)
|
|
|
{
|
|
|
- List<DingDingUserInfo> ddUserInfos = new List<DingDingUserInfo>();
|
|
|
+ List<DingDingUserInfo> ddUserInfos = new();
|
|
|
foreach (var itemId in rspInduction.Result.DataList)
|
|
|
{
|
|
|
- DingDingUserInfo ddUserInfo = new DingDingUserInfo();
|
|
|
+ DingDingUserInfo ddUserInfo = new();
|
|
|
ddUserInfo.PartitionKey = divide;
|
|
|
ddUserInfo.RowKey = itemId;
|
|
|
ddUserInfos.Add(ddUserInfo);
|
|
@@ -1234,7 +1234,7 @@ namespace TEAMModelBI.Controllers.BITable
|
|
|
string access_token = response.AccessToken;
|
|
|
|
|
|
IDingTalkClient quitStaffClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/querydimission");
|
|
|
- OapiSmartworkHrmEmployeeQuerydimissionRequest reqDimission = new OapiSmartworkHrmEmployeeQuerydimissionRequest() { Offset = 0L, Size = 50L };
|
|
|
+ OapiSmartworkHrmEmployeeQuerydimissionRequest reqDimission = new() { Offset = 0L, Size = 50L };
|
|
|
OapiSmartworkHrmEmployeeQuerydimissionResponse rspDimission = quitStaffClient.Execute(reqDimission, access_token);
|
|
|
if (rspDimission.Result != null)
|
|
|
{
|