Browse Source

修改钉钉教师绑定醍摩豆的数据结构,并更改对应的接口信息。完善批量创校的接口信息,添加批量创区的接口。

Li 3 years ago
parent
commit
ca6fdf0aca

+ 71 - 64
TEAMModeBI/Controllers/BISchool/BatchAreaController.cs

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Models;
-
+using Azure.Cosmos;
 using DingTalk.Api;
 using DingTalk.Api.Request;
 using DingTalk.Api.Response;
@@ -25,85 +25,92 @@ namespace TEAMModeBI.Controllers.BISchool
         private readonly DingDing _dingDing;
         private readonly Option _option;
         private readonly AzureStorageFactory _azureStorage;
+        private readonly IConfiguration _configuration;
 
-        public BatchAreaController(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, IOptionsSnapshot<Option> option)
+        public BatchAreaController(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, IOptionsSnapshot<Option> option, IConfiguration configuration)
         {
             _azureCosmos = azureCosmos;
             _dingDing = dingDing;
             _azureStorage = azureStorage;
             _option = option?.Value;
+            _configuration = configuration;
         }
 
-        //public async Task<IActionResult> BatchArea(Area area) 
-        //{
-
-        //}
-
-
-        private readonly IConfiguration _configuration;
-        public IActionResult DingDingLogin(string loginTmpCode)
+        /// <summary>
+        /// 批量创区 
+        /// </summary>
+        /// <param name="areas"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("batch-createarea")]
+        public async Task<IActionResult> batchCreateArea(List<Area> areas)
         {
-            string appKey = _configuration["DingDingAuth:appKey"];
-            string appSecret = _configuration["DingDingAuth:appSecret"];
-            string getuserinfo_bycode = _configuration["DingDingAuth:getuserinfo_bycode"];
-            //判断参数是否为空
-            if (string.IsNullOrEmpty(loginTmpCode))
-            {
-                return BadRequest("temp code error");
-            }
-            //获取access_token
-            DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
-            OapiGettokenRequest request = new OapiGettokenRequest();
-            request.Appkey = appKey;
-            request.Appsecret = appSecret;
-            request.SetHttpMethod("Get");
-            OapiGettokenResponse response = client.Execute(request);
-            if (response.IsError)
-            {
-                return BadRequest();
-            }
-            string access_token = response.AccessToken;
-            //获取临时授权码 获取授权用户的个人信息
-            DefaultDingTalkClient client1 = new DefaultDingTalkClient("https://oapi.dingtalk.com/sns/getuserinfo_bycode");
-            OapiSnsGetuserinfoBycodeRequest bycodeRequest = new OapiSnsGetuserinfoBycodeRequest()
-            {
-                //通过扫描二维码,跳转到指定的Url后,向Url中追加Code临时授权码
-                TmpAuthCode = loginTmpCode
-            };
-            OapiSnsGetuserinfoBycodeResponse bycodeResponse = client1.Execute(bycodeRequest, appKey, appSecret);
-            if (bycodeResponse.IsError)
-            {
-                return BadRequest();
-            }
-            //根据unionid获取userid
-            string unionid = bycodeResponse.UserInfo.Unionid;
-            DefaultDingTalkClient clientDingTalkClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/user/getbyunionid");
-            OapiUserGetbyunionidRequest byunionidRequest = new OapiUserGetbyunionidRequest()
-            {
-                Unionid = unionid
-            };
-            OapiUserGetbyunionidResponse byunionidResponse = clientDingTalkClient.Execute(byunionidRequest, access_token);
-            if (byunionidResponse.IsError)
+            try
             {
-                return BadRequest();
+                List<Area> standards = new List<Area>();
+                bool isCreate = true;
+                if (areas.Count > 0)
+                {
+                    foreach (Area itemarea in areas)
+                    {
+                        await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") })) 
+                        {
+                            if (item.standard.Equals(itemarea.standard))
+                            {
+                                standards.Add(itemarea);
+                                isCreate = false;
+                            }                            
+                        }
+
+                        if (isCreate == true)
+                        {
+                            Area addArea = new Area()
+                            {
+                                id = Guid.NewGuid().ToString(),
+                                code = $"Base-Area",
+                                name = itemarea.name,
+                                provCode = itemarea.provCode,
+                                provName = itemarea.provName,
+                                cityCode = itemarea.cityCode,
+                                cityName = itemarea.cityName,
+                                standard = itemarea.standard,
+                                standardName = itemarea.standardName,
+                                institution = itemarea.institution
+                            };
+                            await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync<Area>(addArea, new PartitionKey("Base-Area"));
+                        }
+                    }
+                }
+                else return Ok(new { sate = 1 ,message="区域参数为空"});
+                if (standards.Count > 0)
+                    return Ok(new { state = 201, message = "已有部分区域批量创建成功;标准项已重复!请检查标准项!", standards = standards });
+                else return Ok(new { state = 200, message = "批量创区全部完成", });
             }
-            string userid = byunionidResponse.Result.Userid;
-            //根据userId获取用户信息
-            DefaultDingTalkClient clientDingTalkClient2 = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");
-            OapiV2UserGetRequest getRequest = new OapiV2UserGetRequest()
-            {
-                Userid = userid,
-                Language = "zh_CN"
-            };
-            getRequest.SetHttpMethod("Get");
-            OapiV2UserGetResponse getResponse = clientDingTalkClient2.Execute(getRequest, access_token);
-            if (getResponse.IsError)
+            catch (Exception ex)
             {
+                await _dingDing.SendBotMsg($"BI,{_option.Location} batcharea/batch-createarea \n {ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
-            return Ok(getResponse.Body);
+        }
+
+
+
+        public record TempArea 
+        {
+            public string name { get; set; }
+
+            public string provCode { get; set; }
+            public string provName { get; set; }
+            public string cityCode { get; set; }
+            public string cityName { get; set; }
+            public string standard { get; set; }
+            public string standardName { get; set; }
+            public string institution { get; set; }
+
+
         }
 
 
     }
+
 }

+ 151 - 73
TEAMModeBI/Controllers/BISchool/BatchSchoolController.cs

@@ -111,7 +111,7 @@ namespace TEAMModeBI.Controllers.BISchool
                 if (!jsonElement.TryGetProperty("mode", out JsonElement mode)) return Ok(new { state = 1, message = "mode参数错误!" });     //del删除权限  up更新权限
                 if (!jsonElement.TryGetProperty("paramPower", out JsonElement paramPower)) return Ok(new { state = 1, message = "paramPower参数错误!" });
 
-                List<reoleds> havepower = new List<reoleds>(); //已存在的权限
+                List<Exist> havepower = new List<Exist>(); //已存在的
                 var client = _azureCosmos.GetCosmosClient();
                 
                 //更新權限
@@ -142,7 +142,7 @@ namespace TEAMModeBI.Controllers.BISchool
                             var bools = st.permissions.Find(x => x.Equals($"{pm}"));
                             if (!string.IsNullOrEmpty($"{bools}"))
                             {
-                                havepower.Add(new reoleds { ID = id.GetString(), relos = bools });
+                                havepower.Add(new Exist { ID = id.GetString(), name = bools });
                             }
                             else
                             {
@@ -164,89 +164,128 @@ namespace TEAMModeBI.Controllers.BISchool
 
 
         /// <summary>
-        /// 批量创校  --完成带测验
+        /// 批量创校
         /// </summary>
         /// <param name="school"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("batch-createschool")]
-        public async Task<IActionResult> batchCreateSchool(School school, string number)
+        public async Task<IActionResult> batchCreateSchool(List<BISchool> bISchools)
         {
             try
             {
-                List<School> school_list = new List<School>();
-                //创建多个学校
-                for (int i = 0; i < int.Parse(number); i++)
-                {
-                    string id = $"{school.id}_{i}";
-                    var client = _azureCosmos.GetCosmosClient();
-                    var schoolContainer = client.GetContainer(Constant.TEAMModelOS, "School");
-                    var response = await schoolContainer.ReadItemStreamAsync(id, new PartitionKey($"Base"));
-                    if (response.Status == 200)
+                List<BISchool> schools = new List<BISchool>();
+
+                if (bISchools.Count > 0)
+                {                    
+                    var cosmosClient = _azureCosmos.GetCosmosClient();
+                    foreach (BISchool bischool in bISchools) 
                     {
-                        string sql = $"select distinct value(c) from c jion A1 in c.schools where A1.schoolID='{id}'";
-                        List<Teacher> teacher_list = new List<Teacher>();
-                        await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+                        var schoolStatus = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{bischool.id}", new PartitionKey($"Base"));
+                        if (schoolStatus.Status == 200)                        
                         {
-                            teacher_list.Add(item);
-                        }
-
-                        foreach (var item in teacher_list)
+                            schools.Add(bischool);
+                        }                        
+                        else 
                         {
-                            TeacherSchool teacherSchool = item.schools.Find(x => x.schoolId.Equals(id));
-                            if (teacherSchool != null)
+                            List<Period> periods = new List<Period>();
+                            string campusId = Guid.NewGuid().ToString();
+                            bischool.period.ForEach(x =>
                             {
-                                teacherSchool.name = $"{school.name}_{i}";
-                                teacherSchool.picture = school.picture;
-                                teacherSchool.areaId = school.areaId;
+                                periods.Add(new Period { id = Guid.NewGuid().ToString(), name = x, campusId = campusId });
+                            });
+                            School upSchool = new School
+                            {
+                                id = bischool.id,
+                                name = bischool.name,
+                                size = bischool.size,
+                                code = "Base",
+                                campuses = new List<Campus> { new Campus { name = bischool.name, id = campusId } },
+                                region = bischool.region,
+                                province = bischool.province,
+                                city = bischool.city,
+                                dist = bischool.dist,
+                                timeZone = new TEAMModelOS.SDK.Models.TimeZone { label = "(UTC+08:00) 北京,重庆,香港特别行政区,乌鲁木齐", value = "+08:00" },
+                                type = 2,
+                                pk = "School",
+                                ttl = -1,
+                                schoolCode = bischool.id,
+                                period = periods
+                            };
+                            //创建学校
+                            await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<School>(upSchool, new PartitionKey(upSchool.code));
+                            Teacher teacher = null;
+                            try
+                            {
+                                //查询该教师是否存在
+                                teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Teacher>($"{bischool.admin}", new PartitionKey("Base"));
                             }
-                            await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync(item, item.id, new PartitionKey($"Base"));
-                        }
-                        school.id = id;
-                        school = await schoolContainer.UpsertItemAsync(school, new PartitionKey($"Base"));
-                    }
-                    else
-                    {
-                        school.code = "Base";
-                        school.id = $"{school.id}_{i}";
-                        school = await schoolContainer.CreateItemAsync(school, new PartitionKey($"Base"));
-                    }
-                }
+                            catch
+                            {
+                            }
+                            if (teacher != null)  
+                            {
+                                //教师存在,在该教师信息中添加要管理的学校信息
+                                teacher.schools.Add(new Teacher.TeacherSchool { schoolId = bischool.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+                                await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, bischool.admin, new PartitionKey("Base"));
+                                SchoolTeacher schoolTeacher = new SchoolTeacher
+                                {
+                                    id = bischool.admin,
+                                    code = $"Teacher-{bischool.id}",
+                                    roles = new List<string> { "admin", "teacher" },
+                                    job = "管理员",
+                                    name = teacher.name,
+                                    picture = teacher.picture,
+                                    status = "join",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
+                                    pk = "Teacher",
+                                    ttl = -1
+                                };
 
-                ////创一个学校案例
-                //var client = _azureCosmos.GetCosmosClient();
-                //var schoolContainer = client.GetContainer(Constant.TEAMModelOS, "School");
-                //var response = await schoolContainer.ReadItemStreamAsync(school.id, new PartitionKey($"Base"));
-                //if (response.Status == 200)
-                //{
-                //    string sql = $"select distinct value(c) from c jion A1 in c.schools where A1.schoolID='{school.id}'";
-                //    List<Teacher> teacher_list = new List<Teacher>();
-                //    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") })) 
-                //    {
-                //        teacher_list.Add(item);
-                //    }
+                                await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").UpsertItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
+                            }
+                            else  
+                            {
+                                //不存在 新建教师和新建要管理的学校信息
+                                Teacher addteacher = new Teacher
+                                {
+                                    id = bischool.admin,
+                                    pk = "Base",
+                                    code = "Base",
+                                    name = $"{bischool.name}-管理员"?.ToString(),
+                                    picture = "",
+                                    //创建账号并第一次登录IES5则默认赠送1G
+                                    size = 1,
+                                    defaultSchool = bischool.id,
+                                    schools = new List<Teacher.TeacherSchool>() { new TeacherSchool { schoolId = bischool.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } }
+                                };
 
-                //    foreach (var item in teacher_list) 
-                //    {
-                //        TeacherSchool teacherSchool = item.schools.Find(x => x.schoolId.Equals(school.id));
-                //        if (teacherSchool != null) 
-                //        {
-                //            teacherSchool.name = school.name;
-                //            teacherSchool.picture = school.picture;
-                //            teacherSchool.areaId = school.areaId;
-                //        }
-                //        await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync(item, item.id, new PartitionKey($"Base"));
-                //    }
-                //    school = await schoolContainer.UpsertItemAsync(school, new PartitionKey($"Base"));
-                //}
-                //else 
-                //{
-                //    school.code = "Base";
-                //    school = await schoolContainer.CreateItemAsync(school,new PartitionKey($"Base"));
-                //}
+                                await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(addteacher, new PartitionKey("Base"));
+                                SchoolTeacher schoolTeacher = new SchoolTeacher
+                                {
+                                    id = bischool.admin,
+                                    code = $"Teacher-{bischool.id}",
+                                    roles = new List<string> { "admin", "teacher" },
+                                    job = "管理员",
+                                    name = bischool.admin,
+                                    picture = "",
+                                    status = "join",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
+                                    pk = "Teacher",
+                                    ttl = -1
+                                };
 
-                return Ok(new { school_list });
+                                await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").UpsertItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
+                            }
+                        }
+                    }
+                }
+                else return Ok(new { state = 1, message = "创校信息为空" });
 
+                if (schools.Count > 0)
+                    return Ok(new { state = 201, message = "已有部分学校批量创建成功;学校编号已经重复!请检查学校编号!", schools = schools });
+                else
+                    return Ok(new { state = 200, message = "批量创校已全部完成" });
             }
             catch (Exception ex)
             {
@@ -255,15 +294,54 @@ namespace TEAMModeBI.Controllers.BISchool
             }
         }
 
+        /// <summary>
+        /// 批量创校的数据结构
+        /// </summary>
+        public record BISchool()
+        {
+            /// <summary>
+            /// 学校ID
+            /// </summary>
+            public string id { get; set; }
+            /// <summary>
+            /// 学校名称
+            /// </summary>
+            public string name { get; set; }
+            /// <summary>
+            /// 学校管理员
+            /// </summary>
+            public string admin { get; set; }
+            /// <summary>
+            /// 学校的学段
+            /// </summary>
+            public List<string> period { get; set; }
+            /// <summary>
+            /// 学校空间大小
+            /// </summary>
+            public int size { get; set; }
+            /// <summary>
+            /// 地区
+            /// </summary>
+            public string region { get; set; }
+            /// <summary>
+            /// 省份
+            /// </summary>
+            public string province { get; set; }
+            /// <summary>
+            /// 城市
+            /// </summary>
+            public string city { get; set; }
+            /// <summary>
+            /// 县,区,郡
+            /// </summary>
+            public string dist { get; set; }
+        }
 
-
-
-        public record reoleds() 
+        public record Exist() 
         {
             public string ID { get; set; }
-            public string relos { get; set; }
+            public string name { get; set; }
         }
 
-
     }
 }

+ 5 - 95
TEAMModeBI/Controllers/DingDingStruc/DDStructController.cs

@@ -14,6 +14,7 @@ using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models.Service;
+using static DingTalk.Api.Response.OapiV2UserGetResponse;
 using static TEAMModelOS.SDK.Models.Teacher;
 
 namespace TEAMModeBI.Controllers.DingDingStruc
@@ -223,7 +224,7 @@ namespace TEAMModeBI.Controllers.DingDingStruc
                                                 deptBaseResponseDomain4.ParentId = dept4List.ParentId;
                                                 deptBaseResponseDomain4List.Add(deptBaseResponseDomain4);
 
-                                                //获取级部门用户列表
+                                                //获取级部门用户列表
                                                 OapiUserListidRequest reqUserList4 = new OapiUserListidRequest() { DeptId = dept4List.DeptId };
                                                 OapiUserListidResponse rspUserList4 = userListClient1.Execute(reqUserList4, access_token);
                                                 if (rspUserList4.Result != null)
@@ -326,8 +327,7 @@ namespace TEAMModeBI.Controllers.DingDingStruc
             try
             {
                 if (!jsonElement.TryGetProperty("userids", out JsonElement userIds)) return Ok(new { state = 1, message = "参数问题" });
-                List<DingDingBind> userInfos = new List<DingDingBind>();
-
+                List<UserGetResponseDomain> ddUserInfos = new List<UserGetResponseDomain>();
                 string appKey = _configuration["DingDingAuth:appKey"];
                 string appSecret = _configuration["DingDingAuth:appSecret"];
 
@@ -356,102 +356,13 @@ namespace TEAMModeBI.Controllers.DingDingStruc
                         OapiV2UserGetResponse rspUserInfo = userInfoClient.Execute(reqUserInfo, access_token);
                         if (rspUserInfo.Result != null)
                         {
-                            var DDbind = rspUserInfo.Result;
-
-                            List<DeptOrderDomain> deptOrderDomain_List = new List<DeptOrderDomain>();
-                            if (DDbind.DeptOrderList != null)
-                            {
-                                foreach (var temp in DDbind.DeptOrderList)
-                                {
-                                    DeptOrderDomain deptOrderDomain = new DeptOrderDomain();
-                                    deptOrderDomain.deptId = temp.DeptId;
-                                    deptOrderDomain.order = temp.Order;
-                                    deptOrderDomain_List.Add(deptOrderDomain);
-                                }
-                            }
-                            List<DeptPositionDomain> deptPositionDomain_List = new List<DeptPositionDomain>();
-                            if (DDbind.DeptPositionList != null)
-                            {
-                                foreach (var temp in DDbind.DeptPositionList)
-                                {
-                                    DeptPositionDomain deptPositionDomain = new DeptPositionDomain();
-                                    deptPositionDomain.deptId = temp.DeptId;
-                                    deptPositionDomain.isMain = temp.IsMain;
-                                    deptPositionDomain.title = temp.Title;
-                                    deptPositionDomain.workPlace = temp.WorkPlace;
-                                    deptPositionDomain_List.Add(deptPositionDomain);
-                                }
-                            }
-                            List<DeptLeaderDomain> deptLeaderDomain_List = new List<DeptLeaderDomain>();
-                            if (DDbind.LeaderInDept != null)
-                            {
-                                foreach (var temp in DDbind.LeaderInDept)
-                                {
-                                    DeptLeaderDomain deptLeaderDomain = new DeptLeaderDomain();
-                                    deptLeaderDomain.deptId = temp.DeptId;
-                                    deptLeaderDomain.leader = temp.Leader;
-                                    deptLeaderDomain_List.Add(deptLeaderDomain);
-                                }
-                            }
-                            List<UserRoleDomain> userRoleDomain_list = new List<UserRoleDomain>();
-                            if (DDbind.RoleList != null)
-                            {
-                                foreach (var temp in DDbind.RoleList)
-                                {
-                                    UserRoleDomain userRoleDomain = new UserRoleDomain();
-                                    userRoleDomain.groupName = temp.GroupName;
-                                    userRoleDomain.id = temp.Id;
-                                    userRoleDomain.name = temp.Name;
-                                    userRoleDomain_list.Add(userRoleDomain);
-                                }
-                            }
-                            UnionEmpExtDomain unionEmpExtDomain = new UnionEmpExtDomain();
-                            if (DDbind.UnionEmpExt != null)
-                            {
-                                unionEmpExtDomain.corpId = DDbind.UnionEmpExt.CorpId;
-                                List<UnionEmpMapVoDomain> unionEmpMapVoDomain_list = new List<UnionEmpMapVoDomain>();
-                                if (DDbind.UnionEmpExt.UnionEmpMapList != null)
-                                {
-                                    foreach (var temp in DDbind.UnionEmpExt.UnionEmpMapList)
-                                    {
-                                        UnionEmpMapVoDomain unionEmpMapVoDomain = new UnionEmpMapVoDomain();
-                                        unionEmpMapVoDomain.corpId = temp.CorpId;
-                                        unionEmpMapVoDomain.userid = temp.Userid;
-                                        unionEmpMapVoDomain_list.Add(unionEmpMapVoDomain);
-                                    }
-                                }
-                                unionEmpExtDomain.unionEmpMapList = unionEmpMapVoDomain_list;
-                                unionEmpExtDomain.userid = DDbind.UnionEmpExt.Userid;
-                            }
-                            DingDingBind ddbind = new DingDingBind
-                            {
-                                type = type,
-                                active = DDbind.Active,
-                                admin = DDbind.Admin,
-                                avatar = DDbind.Avatar,
-                                boss = DDbind.Boss,
-                                deptIdList = DDbind.DeptIdList,
-                                deptOrderList = deptOrderDomain_List,//DDbind.DeptOrderList?.ToJsonString().ToObject<List<DeptOrderDomain>>(),
-                                deptPositionList = deptPositionDomain_List, //DDbind.DeptPositionList,
-                                jobNumber = DDbind.JobNumber,
-                                leaderInDept = deptLeaderDomain_List,//DDbind.LeaderInDept,
-                                managerUserid = DDbind.ManagerUserid,
-                                mobile = DDbind.Mobile,
-                                roleList = userRoleDomain_list,//DDbind.RoleList,
-                                senior = DDbind.Senior,
-                                title = DDbind.Title,
-                                unionEmpExt = unionEmpExtDomain,//DDbind.UnionEmpExt,
-                                name = DDbind.Name,
-                                unionid = DDbind.Unionid,
-                                userid = DDbind.Userid,
-                            };
-                            userInfos.Add(ddbind);
+                            ddUserInfos.Add(rspUserInfo.Result);
                         }
                         else return Ok(new { state = 2, message = "访问失败!" });
                     }
                 }
 
-                return Ok(new { state = 200, userInfos = userInfos });
+                return Ok(new { state = 200, ddUserInfos = ddUserInfos });
             }
             catch (Exception ex)
             {
@@ -487,7 +398,6 @@ namespace TEAMModeBI.Controllers.DingDingStruc
             /// </summary>
             public List<string> ddUserList { get; set; }
 
-
         }
 
         public record DeptBaseResponseDomain 

File diff suppressed because it is too large
+ 4 - 148
TEAMModeBI/Controllers/LoginController.cs


+ 0 - 184
TEAMModelOS.SDK/Models/Cosmos/Teacher/Teacher.cs

@@ -49,93 +49,26 @@ namespace TEAMModelOS.SDK.Models
 
         public class DingDingBind
         {
-
             /// <summary>
             /// 绑定类型  ddteammodel
             /// </summary>
             public string type { get; set; }
 
-            /// <summary>
-            /// 是否激活
-            /// </summary>
-            public bool active { get; set; }
-
-            /// <summary>
-            /// 是否管理员
-            /// </summary>
-            public bool admin { get; set; }
-
-            /// <summary>
-            /// 头像
-            /// </summary>
-            public string avatar { get; set; }
-
-            /// <summary>
-            /// 是否老板
-            /// </summary>
-            public bool boss { get; set; }
-
             /// <summary>
             /// 所属部门id列表
             /// </summary>
             public List<long> deptIdList { get; set; }
 
-            /// <summary>
-            /// 员工在对应的部门中的排序
-            /// </summary>
-            public List<DeptOrderDomain> deptOrderList { get; set; }
-
-            /// <summary>
-            /// 任职信息
-            /// </summary>
-            public List<DeptPositionDomain> deptPositionList { get; set; }
-
-            /// <summary>
-            /// 员工工号
-            /// </summary>
-            public string jobNumber { get; set; }
-
-            /// <summary>
-            /// 员工在对应的部门中是否领导。
-            /// </summary>
-            public List<DeptLeaderDomain> leaderInDept { get; set; }
-
-            /// <summary>
-            /// 主管的ID,仅限企业内部开发调用
-            /// </summary>
-            public string managerUserid { get; set; }
-
-            /// <summary>
-            /// 手机号
-            /// </summary>
-            public string mobile { get; set; }
-
-            /// <summary>
-            /// 角色列表
-            /// </summary>
-            public List<UserRoleDomain> roleList { get; set; }
-
-            /// <summary>
-            /// 是否高管
-            /// </summary>
-            public bool senior { get; set; }
-
             /// <summary>
             /// 职位名称
             /// </summary>
             public string title { get; set; }
 
-            /// <summary>
-            /// 关联信息
-            /// </summary>
-            public UnionEmpExtDomain unionEmpExt { get; set; }
-
             /// <summary>
             /// 钉钉用户名
             /// </summary>
             public string name { get; set; }
 
-
             /// <summary>
             /// 钉钉unionid
             /// </summary>
@@ -146,122 +79,5 @@ namespace TEAMModelOS.SDK.Models
             /// </summary>
             public string userid { get; set; }
         }
-
-        /// <summary>
-        /// 员工在对应的部门中的排序的数据结构
-        /// </summary>
-        public class DeptOrderDomain 
-        {
-            /// <summary>
-            /// 部门id
-            /// </summary>
-            public long deptId { get; set; }
-
-            /// <summary>
-            /// 员工在部门中的排序。
-            /// </summary>
-            public long order { get; set; }
-        }
-
-        /// <summary>
-        /// 任职信息数据结构
-        /// </summary>
-        public class DeptPositionDomain 
-        {
-            /// <summary>
-            /// 部门ID
-            /// </summary>
-            public long deptId { get; set; }
-
-            /// <summary>
-            /// 是否是主任职
-            /// </summary>
-            public bool isMain { get; set; }
-
-            /// <summary>
-            /// 部门内职位
-            /// </summary>
-            public string title { get; set; }
-
-            /// <summary>
-            /// 部门内工作地
-            /// </summary>
-            public string workPlace { get; set; }
-        }
-
-        /// <summary>
-        /// 员工在对应的部门中是否领导 数据结构
-        /// </summary>
-        public class DeptLeaderDomain 
-        {
-            /// <summary>
-            /// 部门id
-            /// </summary>
-            public long deptId { get; set; }
-
-            /// <summary>
-            /// 是否领导
-            /// </summary>
-            public bool leader { get; set; }
-        }
-
-        /// <summary>
-        /// 角色列表 数据结构
-        /// </summary>
-        public class UserRoleDomain 
-        {
-            /// <summary>
-            /// 角色组名称
-            /// </summary>
-            public string groupName { get; set; }
-
-            /// <summary>
-            /// 角色id
-            /// </summary>
-            public long id { get; set; }
-
-            /// <summary>
-            /// 角色名称
-            /// </summary>
-            public string name { get; set; }
-        }
-
-        /// <summary>
-        /// 关联信息 数据结构
-        /// </summary>
-        public class UnionEmpExtDomain
-        {
-            /// <summary>
-            /// 企业ID
-            /// </summary>
-            public string corpId { get; set; }
-
-            /// <summary>
-            /// 关联映射关系
-            /// </summary>
-            public List<UnionEmpMapVoDomain> unionEmpMapList{get;set;}
-
-            /// <summary>
-            /// 员工id
-            /// </summary>
-            public string userid { get; set; }
-        }
-
-        /// <summary>
-        /// 关联映射关系
-        /// </summary>
-        public class UnionEmpMapVoDomain
-        {
-            /// <summary>
-            /// 企业id
-            /// </summary>
-            public string corpId { get; set; }
-
-            /// <summary>
-            /// 用户id
-            /// </summary>
-            public string userid { get; set; }
-        }
-
     }
 }