Browse Source

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 year ago
parent
commit
deadb33fff

+ 3 - 2
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -188,6 +188,7 @@ namespace TEAMModelOS.FunctionV4
                                 List<RGroupList> members = await Activity(_coreAPIHttpService, info, classes, client, _dingDing, sub, examClassResults);
                                 if (examClassResults.Count == 0)
                                 {
+                                    List<Task<ItemResponse<ExamClassResult>>> tasks = new List<Task<ItemResponse<ExamClassResult>>>();
                                     foreach (string cla in classes)
                                     {
                                         int m = 0;
@@ -349,10 +350,10 @@ namespace TEAMModelOS.FunctionV4
                                             //result.progress = info.progress;
                                             result.school = info.school;
                                             m++;
-                                            await client.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"{result.code}"));
+                                            tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync(result, new PartitionKey($"{result.code}")));
                                         }
                                     }
-
+                                    await tasks.TaskPage(10);
 
                                 }
                                 else

+ 2 - 2
TEAMModelOS.SDK/Models/Service/Common/ActivityService.cs

@@ -61,9 +61,9 @@ namespace TEAMModelOS.SDK
             List<TeacherActivityDto> activities = new List<TeacherActivityDto>();
             HashSet<string> inviteActivityIds = new HashSet<string>();
             string yearSql = $" and c.year={DateTimeOffset.Now.Year}";
-            if (request.TryGetProperty("year", out JsonElement _year))
+            if (request.TryGetProperty("year", out JsonElement _year) &&  int.TryParse($"{_year}",out int year ))
             {
-                yearSql = $" and c.year={_year}";
+                yearSql = $" and c.year={year}";
             }
             //先获取邀请制的
             string sqlInvite = $"select value c from c join t in c.inviteTeachers where   t.id='{tmdid}' and c.pk='ActivityTeacher'";

+ 9 - 3
TEAMModelOS.SDK/Models/Service/IESActivityService.cs

@@ -609,27 +609,33 @@ namespace TEAMModelOS.SDK
         {
             try
             {
+                List<Task<ItemResponse<StuActivity>>> tasks = new List<Task<ItemResponse<StuActivity>>>();
                 if (stuActivities.IsNotEmpty())
                 {
                     foreach (var x in stuActivities)
                     {
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code));
+                        tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code)));
                     }
                 }
                 if (tmdActivities.IsNotEmpty())
                 {
                     foreach (var x in tmdActivities)
                     {
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code));
+                        tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code)));
                     }
                 }
                 if (tchActivities.IsNotEmpty())
                 {
                     foreach (var x in tchActivities)
                     {
-                        await client.GetContainer(Constant.TEAMModelOS, "Teacher").UpsertItemAsync(x, new PartitionKey(x.code));
+                        tasks.Add(client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code)));
                     }
                 }
+
+                if (tasks.Count > 0)
+                {
+                    await tasks.TaskPage(50);
+                }
             }
             catch (Exception ex)
             {

+ 3 - 3
TEAMModelOS/ClientApp/src/view/signupActivity/createActivity.vue

@@ -141,7 +141,7 @@
                                                         <Checkbox v-for="(item, index) in infoArr" :key="index" :label="item.field">
                                                             <span>
                                                                 {{ item.label }}
-                                                                <Icon type="md-create" size="18" color="orange" v-show="index > 4" @click.stop.native.prevent="changeFiled(2, item)" />
+                                                                <Icon type="md-create" size="18" color="orange" v-show="index > 3" @click.stop.native.prevent="changeFiled(2, item)" />
                                                                 <Icon type="md-trash" size="16" color="#6e6e6e" v-show="item.field === item.label" @click.stop.native.prevent="delField(index)" />
                                                             </span>
                                                         </Checkbox>
@@ -480,12 +480,12 @@ export default {
                     type: "text",
                     item: []
                 },
-                {
+                /* {
                     field: 'school',
                     label: '学校',
                     type: "select",
                     item: []
-                },
+                }, */
                 /* {
                     value: 'duties',
                     label: '职务',