zj 2 năm trước cách đây
mục cha
commit
8cca89df28

+ 20 - 4
TEAMModelOS.FunctionV4/CosmosDB/TriggerExamLite.cs

@@ -182,11 +182,27 @@ namespace TEAMModelOS.FunctionV4
                             break;
                         case "finish":
 
-                            //处理试卷练习活动结束统计账户信息
-                            List<FMember> idList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, lite.school, lite.classes, lite.stuLists, lite.tchLists);
-                            lite.staffIds = idList;
+                            List<(string pId, List<string> gid)> gls = new List<(string pId, List<string> gid)>();
+                            if (lite.groupLists.Count > 0)
+                            {
+                                var group = lite.groupLists;
+                                foreach (var gp in group)
+                                {
+                                    foreach (KeyValuePair<string, List<string>> pp in gp)
+                                    {
+                                        gls.Add((pp.Key, pp.Value));
+                                    }
+                                }
+                            }
+                            if (lite.staffIds.Count == 0)
+                            {
+                            // 处理试卷练习活动结束统计账户信息
+                                List<FMember> idList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, lite.school, lite.classes, lite.stuLists, lite.tchLists, gls);
+                                lite.staffIds = idList;
 
-                            await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamLite>(lite, lite.id, new Azure.Cosmos.PartitionKey(lite.code));
+                                await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamLite>(lite, lite.id, new Azure.Cosmos.PartitionKey(lite.code));
+                            }
+                                
 
                             break;
                     }

+ 17 - 3
TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs

@@ -135,11 +135,25 @@ namespace TEAMModelOS.FunctionV4
                             break;
                         case "finish":
                             await Activity(_coreAPIHttpService, _serviceBus, _dingDing, client, _configuration, work);
+                            List<(string pId, List<string> gid)> gls = new List<(string pId, List<string> gid)>();
+                            if (work.groupLists.Count > 0)
+                            {
+                                var group = work.groupLists;
+                                foreach (var gp in group)
+                                {
+                                    foreach (KeyValuePair<string, List<string>> pp in gp)
+                                    {
+                                        gls.Add((pp.Key, pp.Value));
+                                    }
+                                }
+                            }
                             //处理家庭作业活动结束统计账户信息
-                            List<FMember> idsList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, work.school, work.classes, work.stuLists, work.tchLists);
-                            work.staffIds = idsList;
+                            if (work.staffIds.Count == 0) {
+                                List<FMember> idsList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, work.school, work.classes, work.stuLists, work.tchLists,gls);
+                                work.staffIds = idsList;
 
-                            await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Homework>(work, work.id, new Azure.Cosmos.PartitionKey(work.code));
+                                await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Homework>(work, work.id, new Azure.Cosmos.PartitionKey(work.code));
+                            }                          
                             break;
                     }
 

+ 5 - 3
TEAMModelOS.FunctionV4/CosmosDB/TriggerStudy.cs

@@ -207,10 +207,12 @@ namespace TEAMModelOS.FunctionV4
                                 }
                             }
                             //处理教研活动结束统计账户信息
-                            List<FMember> idList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, study.school, study.classes, study.stuLists, study.tchLists, gls);
-                            study.staffIds = idList;
-                            await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Study>(study, study.id, new Azure.Cosmos.PartitionKey(study.code));
+                            if (study.staffIds.Count == 0) {
+                                List<FMember> idList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, study.school, study.classes, study.stuLists, study.tchLists, gls);
+                                study.staffIds = idList;
+                                await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Study>(study, study.id, new Azure.Cosmos.PartitionKey(study.code));
 
+                            }                         
                             break;
                     }
                 }

+ 13 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerSurvey.cs

@@ -411,8 +411,20 @@ namespace TEAMModelOS.FunctionV4
                             //问卷整体情况
                             await _azureStorage.GetBlobContainerClient(blobcntr).UploadFileByContainer(cods.ToJsonString(), "survey", $"{survey.id}/record.json");
 
+                            List<(string pId, List<string> gid)> gls = new List<(string pId, List<string> gid)>();
+                            if (survey.groupLists.Count > 0)
+                            {
+                                var group = survey.groupLists;
+                                foreach (var gp in group)
+                                {
+                                    foreach (KeyValuePair<string, List<string>> pp in gp)
+                                    {
+                                        gls.Add((pp.Key, pp.Value));
+                                    }
+                                }
+                            }
                             //处理问卷调查活动结束统计账户信息
-                            List<FMember> idsList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, survey.school, survey.classes, survey.stuLists, survey.tchLists);
+                            List<FMember> idsList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, survey.school, survey.classes, survey.stuLists, survey.tchLists,gls);
                             survey.staffIds = idsList;
 
                             if (string.IsNullOrEmpty(survey.recordUrl))

+ 14 - 2
TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs

@@ -18,6 +18,7 @@ using TEAMModelOS.SDK.Models.Service;
 using HTEXLib.COMM.Helpers;
 using Microsoft.Extensions.Configuration;
 using DocumentFormat.OpenXml.Office2013.Excel;
+using DocumentFormat.OpenXml.Vml;
 
 namespace TEAMModelOS.FunctionV4
 {
@@ -356,9 +357,20 @@ namespace TEAMModelOS.FunctionV4
                             string url = $"/vote/{vote.id}/record.json";
                             tasks.Add(_azureStorage.GetBlobContainerClient(blobcntr).UploadFileByContainer(new { options = countcds, records = recordsBlob }.ToJsonString(), "vote", $"{vote.id}/record.json"));
                             //处理投票者的记录
-
+                            List<(string pId, List<string> gid)> gls = new List<(string pId, List<string> gid)>();
+                            if (vote.groupLists.Count > 0)
+                            {
+                                var group = vote.groupLists;
+                                foreach (var gro in group)
+                                {
+                                    foreach (KeyValuePair<string, List<string>> pp in gro)
+                                    {
+                                        gls.Add((pp.Key, pp.Value));
+                                    }
+                                }
+                            }
                             //处理投票活动结束统计账户信息
-                            List<FMember> idsList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, vote.school, vote.classes, vote.stuLists, vote.tchLists);
+                            List<FMember> idsList = await GroupListService.GetFinishMemberInfo(_coreAPIHttpService, client, _dingDing, vote.school, vote.classes, vote.stuLists, vote.tchLists, gls);
                             vote.staffIds = idsList;
 
                             if (string.IsNullOrEmpty(vote.recordUrl))

+ 1 - 1
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -746,7 +746,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                 var blobclient = _azureStorage.GetBlobContainerClient($"teammodelos");
                 //查询当前学校所有的校本研修活动
                 List<Study> studies = new();
-                var query = $"select value(c) FROM c join b in c.teacIds where b in ({tIds}) and (c.status<>404 or IS_DEFINED(c.status) = false)";
+                var query = $"select value(c) FROM c join b in c.teacIds where b in ({string.Join(",", tIds.Select(o => $"'{o}'"))}) and (c.status<>404 or IS_DEFINED(c.status) = false)";
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<Study>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{code}") }))
                 {
                     studies.Add(item);

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/Common/ArtEvaluation.cs

@@ -17,7 +17,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         public string name { get; set; }
         public string school { get; set; }
         //高级设置
-        public List<string> settings { get; set; } = new List<string>();
+        public List<JsonElement> settings { get; set; } = new List<JsonElement>();
         public string creatorId { get; set; }
         public long createTime { get; set; }
         public long updateTime { get; set; }

+ 4 - 4
TEAMModelOS.SDK/Models/Service/GroupListService.cs

@@ -1330,15 +1330,15 @@ namespace TEAMModelOS.SDK
                 staffList.ForEach(x => fMembers.Add(new FMember() { id = x.id, code = school, type = 2 }));
             }
 
-            if (tchLists != null && tchLists.Count > 0)
+/*            if (tchLists != null && tchLists.Count > 0)
             {
                 (List<RMember> staffList, List<RGroupList> classInfos) = await GetMemberByListids(_coreAPIHttpService, cosmosClient, _dingDing, tchLists, school);
                 staffList.ForEach(x => fMembers.Add(new FMember() { id = x.id, code = school, type = 2 }));
-            }
+            }*/
 
-            if (_groupLists != null && _groupLists.Count > 0) 
+            if (tchLists != null && tchLists.Count > 0) 
             {
-                (List<RMember> staffList, List<RGroupList> groupLists1) = await GetMemberByListids(_coreAPIHttpService, cosmosClient, _dingDing, classes, school, _groupLists);
+                (List<RMember> staffList, List<RGroupList> groupLists1) = await GetMemberByListids(_coreAPIHttpService, cosmosClient, _dingDing, tchLists, school, _groupLists);
                 staffList.ForEach(x => fMembers.Add(new FMember() { id = x.id, code = school, type = 2 }));
             }