Ver código fonte

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

liqk 4 anos atrás
pai
commit
445abf00df

+ 51 - 47
TEAMModelFunction/TriggerSurvey.cs

@@ -1,6 +1,7 @@
 using Azure.Cosmos;
 using Azure.Messaging.ServiceBus;
 using Azure.Storage.Blobs.Models;
+using Azure.Storage.Sas;
 using Microsoft.Azure.Documents;
 using System;
 using System.Collections.Generic;
@@ -39,7 +40,7 @@ namespace TEAMModelFunction
                         data = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
                     }
                 } catch { data = null; }
-                await _dingDing.SendBotMsg($"问卷调查【{survey.name}-{survey.id}---{survey.ttl}】正在操作", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"问卷调查【{survey.name}-{survey.id}-ttl={survey.ttl}】正在操作", GroupNames.成都开发測試群組);
                 if (survey.ttl >= 1)
                 {
                   
@@ -47,14 +48,14 @@ namespace TEAMModelFunction
                     _azureRedis.GetRedisClient(8).KeyDelete($"Survey:Submit:{survey.id}");
                     if (data != null)
                     {
-                        data.ttl = 1;
+                        
                         if (survey.scope == "school")
                         {
-                            data = await client.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<ActivityData>(data, adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
+                            data = await client.GetContainer("TEAMModelOS", "School").DeleteItemAsync<ActivityData>(  adid, new Azure.Cosmos.PartitionKey($"{data.code}"));
                         }
                         else if (survey.scope == "private")
                         {
-                            data = await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data, adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
+                            data = await client.GetContainer("TEAMModelOS", "Teacher").DeleteItemAsync<ActivityData>( adid, new Azure.Cosmos.PartitionKey($"{data.code}"));
                         }
                     }
                     await _dingDing.SendBotMsg($"问卷调查【{survey.name}-{survey.id}】被删除", GroupNames.成都开发測試群組);
@@ -163,61 +164,62 @@ namespace TEAMModelFunction
                             await _azureStorage.UploadFileByContainer(survey.owner, cods.ToJsonString(), "survey", $"{survey.id}/record.json");
                             //结算每道题的答题情况
 
-                            var ContainerClient = _azureStorage.GetBlobContainerClient(survey.owner);
-                            var route = ContainerClient.Uri.ToString();
-                            List<BlobItem> items = await ContainerClient.List($"survey/{survey.id}/urecord");
-                            List<SurveyRecord> surveyRecords = new List<SurveyRecord>();
+                            var ContainerClient =  _azureStorage.GetBlobContainerClient(survey.owner);
+                           
                             //获取
-
-                            foreach (BlobItem item in items)
-                            {
-                                BlobAuth blobAuth = _azureStorage.GetBlobSasUriRead(survey.owner, $"{item.Name}");
-                                var url = $"{route}/{item.Name}?{blobAuth.sas}";
-                                var response = await _clientFactory.CreateClient().GetAsync(new Uri(url));
-                                var json = await JsonDocument.ParseAsync(await response.Content.ReadAsStreamAsync());
-                                var Record = json.RootElement.ToObject<SurveyRecord>();
-                                surveyRecords.Add(Record);
-                            }
-                            List<Task<string>> tasks = new List<Task<string>>();
-                            for (int index = 0; index < survey.ans.Count; index++)
-                            {
-                                string url = $"{survey.id}/qrecord/{index}.json";
-                                QuestionRecord question = new QuestionRecord() { index = index };
-                                foreach (SurveyRecord record in surveyRecords)
+                            try {
+                                List<string> items = await ContainerClient.List($"survey/{survey.id}/urecord");
+                                List<SurveyRecord> surveyRecords = new List<SurveyRecord>();
+                                foreach (string item in items)
                                 {
-                                    if (record.ans.Count == survey.ans.Count)
+                                    var Download = await _azureStorage.GetBlobContainerClient(survey.owner).GetBlobClient(item).DownloadAsync();
+                                    var json = await JsonDocument.ParseAsync(Download.Value.Content);
+                                    var Record = json.RootElement.ToObject<SurveyRecord>();
+                                    surveyRecords.Add(Record);
+                                }
+                                await _dingDing.SendBotMsg($"问卷调查问题结算数据{surveyRecords.ToJsonString()}", GroupNames.成都开发測試群組);
+                                for (int index = 0; index < survey.ans.Count; index++)
+                                {
+                                    string url = $"{survey.id}/qrecord/{index}.json";
+                                    QuestionRecord question = new QuestionRecord() { index = index };
+                                    foreach (SurveyRecord record in surveyRecords)
                                     {
-                                        foreach (var an in record.ans[index])
+                                        if (record.ans.Count == survey.ans.Count)
                                         {
-                                            //
-                                            if (question.opt.ContainsKey(an))
-                                            {
-                                                if (question.opt[an] != null)
-                                                {
-                                                    question.opt[an].Add(record.userid);
-                                                }
-                                                else
-                                                {
-                                                    question.opt[an] = new HashSet<string>() { record.userid };
-                                                }
-                                            }
-                                            else
+                                            foreach (var an in record.ans[index])
                                             {
-                                                if (survey.ans[index].Contains(an))
+                                                //
+                                                if (question.opt.ContainsKey(an))
                                                 {
-                                                    //如果是客观题code
-                                                    question.opt.Add(an, new HashSet<string> { record.userid });
+                                                    if (question.opt[an] != null)
+                                                    {
+                                                        question.opt[an].Add(record.userid);
+                                                    }
+                                                    else
+                                                    {
+                                                        question.opt[an] = new HashSet<string>() { record.userid };
+                                                    }
                                                 }
                                                 else
                                                 {
-                                                    //如果不是客观code
-                                                    question.other[record.userid] = an;
+                                                    if (survey.ans[index].Contains(an))
+                                                    {
+                                                        //如果是客观题code
+                                                        question.opt.Add(an, new HashSet<string> { record.userid });
+                                                    }
+                                                    else
+                                                    {
+                                                        //如果不是客观code
+                                                        question.other[record.userid] = an;
+                                                    }
                                                 }
                                             }
                                         }
                                     }
+                                    await _azureStorage.UploadFileByContainer(survey.owner, question.ToJsonString(), "survey", url);
                                 }
-                                tasks.Add(_azureStorage.UploadFileByContainer(survey.owner, question.ToJsonString(), "survey", url, false));
+                            } catch (Exception ex) {
+                                await _dingDing.SendBotMsg($"问卷调查问题结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                             }
                             if (string.IsNullOrEmpty(survey.recordUrl))
                             {
@@ -227,9 +229,9 @@ namespace TEAMModelFunction
                             else
                             {
                                 //异动,且已经有结算记录则不必再继续。
-                                break;
+                                //break;
                             }
-                            await Task.WhenAll(tasks);
+                            // await Task.WhenAll(tasks);
                             //更新结束状态
                             data.progress = "finish";
                             if (survey.scope == "school")
@@ -240,6 +242,8 @@ namespace TEAMModelFunction
                             {
                                 await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data, data.id, new Azure.Cosmos.PartitionKey(data.code));
                             }
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Survey:Record:{survey.id}");
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Survey:Submit:{survey.id}");
                             break;
                     }
                 }

+ 7 - 4
TEAMModelFunction/TriggerVote.cs

@@ -40,6 +40,7 @@ namespace TEAMModelFunction
                 } catch {
                     data = null;
                 }
+                await _dingDing.SendBotMsg($"投票活动【{vote.name}-{vote.id}-ttl={vote.ttl}】正在操作", GroupNames.成都开发測試群組);
                 if (vote.ttl >= 1)
                 {
                     //TODO  处理TTL删除业务
@@ -49,14 +50,14 @@ namespace TEAMModelFunction
                         data.ttl = 1;
                         if (vote.scope == "school")
                         {
-                            data = await client.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<ActivityData>(data,adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
+                            data = await client.GetContainer("TEAMModelOS", "School").DeleteItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{data.code}"));
                         }
                         else if (vote.scope == "private")
                         {
-                            data = await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data,adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
+                            data = await client.GetContainer("TEAMModelOS", "Teacher").DeleteItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{data.code}"));
                         }
                     }
-                    await _dingDing.SendBotMsg($"投票活动【{vote.name}-{vote.id}】被删除", GroupNames.醍摩豆服務運維群組);
+                    await _dingDing.SendBotMsg($"投票活动【{vote.name}-{vote.id}】被删除", GroupNames.成都开发測試群組);
                     return;
                 }
                 else
@@ -187,7 +188,7 @@ namespace TEAMModelFunction
                             }
                             else { 
                                 //异动,且已经有结算记录则不必再继续。
-                                break; 
+                                //break; 
                             }
                             await Task.WhenAll(tasks);
                             data.progress = "finish";
@@ -200,6 +201,8 @@ namespace TEAMModelFunction
                             {
                                 await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data, data.id, new Azure.Cosmos.PartitionKey(data.code));
                             }
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Vote:Record:{vote.id}");
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Vote:Count:{vote.id}");
                             break;
                     }
                 }

+ 3 - 3
TEAMModelOS.SDK/DI/AzureStorage/AzureStorageBlobExtensions.cs

@@ -41,12 +41,12 @@ namespace TEAMModelOS.SDK.DI
             }
         }
 
-        public static async Task<List<BlobItem>> List(this BlobContainerClient client, string prefix = null) {
+        public static async Task<List<string>> List(this BlobContainerClient client, string prefix = null) {
             try
             {
-                List<BlobItem> items = new List<BlobItem>();
+                List<string> items = new List<string>();
                 await foreach (BlobItem item in client.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix)) {
-                    items.Add(item);
+                    items.Add(item.Name);
                 }
                 return items;
             }

+ 11 - 1
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -21,7 +21,7 @@
 			</FormItem>
 
 			<FormItem :label="$t('survey.form.time')" prop="rangeTime">
-				<DatePicker type="datetimerange" @on-change="onChangeRange" format="yyyy-MM-dd HH:mm" :class="!qnFormEdit ? 'qn-form-disabled':''"
+				<DatePicker type="datetimerange" @on-change="onChangeRange" @on-open-change="onOpenChange" format="yyyy-MM-dd HH:mm" :class="!qnFormEdit ? 'qn-form-disabled':''"
 				 :editable="isDateEdit" :placeholder="$t('survey.form.endTimePlace')" :value="[qnForm.startTime,qnForm.endTime]">
 
 				</DatePicker>
@@ -130,12 +130,22 @@
 					this.qnForm.rangeTime = null
 					this.ruleValidate.rangeTime[0].message = this.$t('survey.form.ruleStartTime')
 				} else {
+					console.log(this.getTimestampByString(arr[0]))
 					this.qnForm.startTime = this.getTimestampByString(arr[0])
 					this.qnForm.endTime = this.getTimestampByString(arr[1])
 					this.qnForm.rangeTime = arr
 					this.ruleValidate.rangeTime[0].message = this.$t('survey.form.ruleTime')
 				}
 			},
+			
+			/* 如果是第一次点击 则设置默认值为当前时间 默认结束为一天后的当前时间 */
+			onOpenChange(flag){
+				if(flag && !this.qnForm.rangeTime){
+					this.qnForm.startTime = Date.now()
+					this.qnForm.endTime = Date.now() + 86400000
+					this.qnForm.rangeTime = [Date.now(),Date.now() + 86400000]
+				}
+			},
 
 			getTimestampByString(str) {
 				str = str.substring(0, 19);

+ 5 - 0
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/QuesNaire.vue

@@ -41,6 +41,11 @@
 			<p style="font-size: 30px;color:#00ad6c;font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.already') }}</p>
 		</div>
 		
+		<div v-if="!alreadyAnswered && surveyInfo.progress === 'finish'" style="text-align: center;padding-top: 15%;">
+			<Icon type="md-stopwatch" color="#00ad6c" size="80"/>
+			<p style="font-size: 30px;color:#00ad6c;font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.overtime') }}</p>
+		</div>
+		
 
 		<!--問卷完成後,在時間結束前仍可修改答案再提交-->
 		<div v-if="surveyInfo.progress !== 'finish' && !alreadyAnswered">

+ 10 - 1
TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue

@@ -21,7 +21,7 @@
 
 			<FormItem :label="$t('vote.form.time')" prop="rangeTime">
 				<!-- <DatePicker type="datetime" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" placeholder="请选择投票结束时间" v-model="voteForm.endTime"  :options="endTimeOptions"></DatePicker> -->
-				<DatePicker type="datetimerange" transfer @on-change="onChangeRange" :options="options3" format="yyyy-MM-dd HH:mm"
+				<DatePicker type="datetimerange" transfer @on-change="onChangeRange" @on-open-change="onOpenChange" :options="options3" format="yyyy-MM-dd HH:mm"
 				 :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" :value="[voteForm.startTime,voteForm.endTime]"
 				 :placeholder="$t('vote.form.endTimePlace')"></DatePicker>
 			</FormItem>
@@ -222,6 +222,15 @@
 				}
 				console.log(this.rangeTime)
 			},
+			
+			/* 如果是第一次点击 则设置默认值为当前时间 默认结束为一天后的当前时间 */
+			onOpenChange(flag){
+				if(flag && !this.qnForm.rangeTime){
+					this.voteForm.startTime = Date.now()
+					this.voteForm.endTime = Date.now() + 86400000
+					this.voteForm.rangeTime = [Date.now(),Date.now() + 86400000]
+				}
+			},
 
 			getTimestampByString(str) {
 				str = str.substring(0, 19);

+ 2 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/survey.js

@@ -87,6 +87,7 @@ export default {
 		description:'描述',
 		content:'内容',
 		submit:'提交问卷',
-		already:'该活动已成功提交作答记录'
+		already:'该活动已成功提交作答记录',
+		overtime:'当前活动已结束'
 	}
 }

+ 2 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/survey.js

@@ -87,6 +87,7 @@ export default {
 		description: '描述',
 		content: '內容',
 		submit: '提交問卷',
-		already:'該活動已成功提交作答記錄'
+		already:'該活動已成功提交作答記錄',
+		overtime:'當前活動已結束'
 	}
 }

+ 55 - 41
TEAMModelOS/Controllers/Common/SurveyController.cs

@@ -25,6 +25,7 @@ using TEAMModelOS.SDK.Module.AzureBlob.Configuration;
 using System.Net.Http;
 using TEAMModelOS.SDK.Models.Cosmos;
 using Azure.Messaging.ServiceBus;
+using Azure.Storage.Sas;
 
 namespace TEAMModelOS.Controllers
 {
@@ -297,7 +298,7 @@ namespace TEAMModelOS.Controllers
                 if (flag)
                 {
                     //使用ttl删除,并处理相关事务逻辑
-                    survey.ttl = 2;
+                    survey.ttl = 5;
                     survey = await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync(survey, new PartitionKey($"{survey.code}"));
                     return Ok(new { flag });
                 }
@@ -478,7 +479,6 @@ namespace TEAMModelOS.Controllers
                 //活动分区
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(id.GetString(), new PartitionKey($"{code}"));
-                survey.ttl = 1;
                 List<ChangeRecord> changeRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", $"{id}" }, { "PartitionKey", survey.progress } });
                 ActivityData data = null;
                 if (survey != null)
@@ -536,59 +536,73 @@ namespace TEAMModelOS.Controllers
 
                                 var ContainerClient = _azureStorage.GetBlobContainerClient(survey.owner);
                                 var route = ContainerClient.Uri.ToString();
-                                List<BlobItem> items = await ContainerClient.List($"survey/{survey.id}/urecord");
-                                List<SurveyRecord> surveyRecords = new List<SurveyRecord>();
+
                                 //获取
 
-                                foreach (BlobItem item in items)
-                                {
-                                    BlobAuth blobAuth = _azureStorage.GetBlobSasUriRead(survey.owner, $"{item.Name}");
-                                    var url = $"{route}/{item.Name}?{blobAuth.sas}";
-                                    var response = await _clientFactory.CreateClient().GetAsync(new Uri(url));
-                                    var json = await JsonDocument.ParseAsync(await response.Content.ReadAsStreamAsync());
-                                    var Record = json.RootElement.ToObject<SurveyRecord>();
-                                    surveyRecords.Add(Record);
-                                }
-                                List<Task<string>> tasks = new List<Task<string>>();
-                                for (int index = 0; index < survey.ans.Count; index++)
+                                try
                                 {
-                                    string url = $"{survey.id}/qrecord/{index}.json";
-                                    QuestionRecord question = new QuestionRecord() { index = index };
-                                    foreach (SurveyRecord record in surveyRecords)
+                                    List<string> items = await ContainerClient.List($"survey/{survey.id}/urecord");
+                                    List<SurveyRecord> surveyRecords = new List<SurveyRecord>();
+                                    (string uri, string sas) blobAuth = _azureStorage.GetBlobContainerSAS(survey.owner, BlobContainerSasPermissions.Read);
+                                    string sas = blobAuth.sas;
+                                    var rcode = await _clientFactory.CreateClient().GetAsync(new Uri($"{route}/survey/{survey.id}/record.json?{sas}"));
+                                    var jsonc = await JsonDocument.ParseAsync(await rcode.Content.ReadAsStreamAsync());
+                                    var Recordc = jsonc.RootElement.ToObject<JsonElement>();
+                                    HttpClient httpClient = _clientFactory.CreateClient();
+                                    await _dingDing.SendBotMsg($"问卷调查问题结算数据11111--->>{Recordc.ToJsonString()}", GroupNames.成都开发測試群組);
+                                    foreach (string item in items)
                                     {
-                                        if (record.ans.Count == survey.ans.Count)
+                                        var url = $"{route}/{item}?{sas}";
+                                        var response = await httpClient.GetAsync(new Uri(url));
+                                        var json = await JsonDocument.ParseAsync(await response.Content.ReadAsStreamAsync());
+                                        var Record = json.RootElement.ToObject<SurveyRecord>();
+                                        surveyRecords.Add(Record);
+                                    }
+                                    await _dingDing.SendBotMsg($"问卷调查问题结算数据{surveyRecords.ToJsonString()}", GroupNames.成都开发測試群組);
+                                    for (int index = 0; index < survey.ans.Count; index++)
+                                    {
+                                        string url = $"{survey.id}/qrecord/{index}.json";
+                                        QuestionRecord question = new QuestionRecord() { index = index };
+                                        foreach (SurveyRecord record in surveyRecords)
                                         {
-                                            foreach (var an in record.ans[index])
+                                            if (record.ans.Count == survey.ans.Count)
                                             {
-                                                //
-                                                if (question.opt.ContainsKey(an))
-                                                {
-                                                    if (question.opt[an] != null)
-                                                    {
-                                                        question.opt[an].Add(record.userid);
-                                                    }
-                                                    else
-                                                    {
-                                                        question.opt[an] = new HashSet<string>() { record.userid };
-                                                    }
-                                                }
-                                                else
+                                                foreach (var an in record.ans[index])
                                                 {
-                                                    if (survey.ans[index].Contains(an))
+                                                    //
+                                                    if (question.opt.ContainsKey(an))
                                                     {
-                                                        //如果是客观题code
-                                                        question.opt.Add(an, new HashSet<string> { record.userid });
+                                                        if (question.opt[an] != null)
+                                                        {
+                                                            question.opt[an].Add(record.userid);
+                                                        }
+                                                        else
+                                                        {
+                                                            question.opt[an] = new HashSet<string>() { record.userid };
+                                                        }
                                                     }
                                                     else
                                                     {
-                                                        //如果不是客观code
-                                                        question.other[record.userid] = an;
+                                                        if (survey.ans[index].Contains(an))
+                                                        {
+                                                            //如果是客观题code
+                                                            question.opt.Add(an, new HashSet<string> { record.userid });
+                                                        }
+                                                        else
+                                                        {
+                                                            //如果不是客观code
+                                                            question.other[record.userid] = an;
+                                                        }
                                                     }
                                                 }
                                             }
                                         }
+                                        await _azureStorage.UploadFileByContainer(survey.owner, question.ToJsonString(), "survey", url);
                                     }
-                                    tasks.Add(_azureStorage.UploadFileByContainer(survey.owner, question.ToJsonString(), "survey", url, false));
+                                }
+                                catch (Exception ex)
+                                {
+                                    await _dingDing.SendBotMsg($"问卷调查问题结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                                 }
                                 if (string.IsNullOrEmpty(survey.recordUrl))
                                 {
@@ -598,9 +612,9 @@ namespace TEAMModelOS.Controllers
                                 else
                                 {
                                     //异动,且已经有结算记录则不必再继续。
-                                    break;
+                                    //break;
                                 }
-                                await Task.WhenAll(tasks);
+                                // await Task.WhenAll(tasks);
                                 //更新结束状态
                                 data.progress = "finish";
                                 if (survey.scope == "school")

+ 2 - 2
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -296,9 +296,9 @@ namespace TEAMModelOS.Controllers.Learn
                     }
                 }
                 if (flag)
-                { 
+                {
                     //使用ttl删除,并处理相关事务逻辑
-                    vote.ttl = 10;
+                    vote.ttl = 5;
                     vote = await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync(vote,  new PartitionKey($"{vote.code}"));
                     return Ok(new { flag });
                 }

+ 3 - 0
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -29,6 +29,9 @@ namespace TEAMModelOS.Controllers.XTest
         [HttpGet("multiple-blob")]
         public async Task<IActionResult> MultipleBlob() {
             await  _azureStorage.GetBlobContainerClient("hbcn").List("other");
+            var dn=await _azureStorage.GetBlobContainerClient("hbcn").GetBlobClient("survey/2e44ee33-ba65-34b6-7e0f-b7e627c70a54/record.json").DownloadAsync();
+            var jsonc = await JsonDocument.ParseAsync(  dn.Value.Content);
+            var Recordc = jsonc.RootElement.ToObject<JsonElement>();
             return Ok();
         }
 

+ 113 - 0
TEAMModelOS/Properties/ServiceDependencies/teammodelos-test - Web Deploy/profile.arm.json

@@ -0,0 +1,113 @@
+{
+  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
+  "contentVersion": "1.0.0.0",
+  "metadata": {
+    "_dependencyType": "appService.windows"
+  },
+  "parameters": {
+    "resourceGroupName": {
+      "type": "string",
+      "defaultValue": "TEAMModelChengdu",
+      "metadata": {
+        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+      }
+    },
+    "resourceGroupLocation": {
+      "type": "string",
+      "defaultValue": "",
+      "metadata": {
+        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
+      }
+    },
+    "resourceName": {
+      "type": "string",
+      "defaultValue": "test",
+      "metadata": {
+        "description": "Name of the main resource to be created by this template."
+      }
+    },
+    "resourceLocation": {
+      "type": "string",
+      "defaultValue": "[parameters('resourceGroupLocation')]",
+      "metadata": {
+        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+      }
+    }
+  },
+  "variables": {
+    "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+    "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
+  },
+  "resources": [
+    {
+      "type": "Microsoft.Resources/resourceGroups",
+      "name": "[parameters('resourceGroupName')]",
+      "location": "[parameters('resourceGroupLocation')]",
+      "apiVersion": "2019-10-01"
+    },
+    {
+      "type": "Microsoft.Resources/deployments",
+      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+      "resourceGroup": "[parameters('resourceGroupName')]",
+      "apiVersion": "2019-10-01",
+      "dependsOn": [
+        "[parameters('resourceGroupName')]"
+      ],
+      "properties": {
+        "mode": "Incremental",
+        "template": {
+          "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+          "contentVersion": "1.0.0.0",
+          "resources": [
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[parameters('resourceName')]",
+              "type": "Microsoft.Web/sites",
+              "apiVersion": "2015-08-01",
+              "tags": {
+                "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
+              },
+              "dependsOn": [
+                "[variables('appServicePlan_ResourceId')]"
+              ],
+              "kind": "app",
+              "properties": {
+                "name": "[parameters('resourceName')]",
+                "kind": "app",
+                "httpsOnly": true,
+                "reserved": false,
+                "serverFarmId": "[variables('appServicePlan_ResourceId')]",
+                "siteConfig": {
+                  "metadata": [
+                    {
+                      "name": "CURRENT_STACK",
+                      "value": "dotnetcore"
+                    }
+                  ]
+                }
+              },
+              "identity": {
+                "type": "SystemAssigned"
+              }
+            },
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[variables('appServicePlan_name')]",
+              "type": "Microsoft.Web/serverFarms",
+              "apiVersion": "2015-08-01",
+              "sku": {
+                "name": "S1",
+                "tier": "Standard",
+                "family": "S",
+                "size": "S1"
+              },
+              "properties": {
+                "name": "[variables('appServicePlan_name')]"
+              }
+            }
+          ]
+        }
+      }
+    }
+  ]
+}

+ 5 - 2
TEAMModelOS/Services/Common/ActivityStudentService.cs

@@ -285,6 +285,9 @@ namespace TEAMModelOS.Services.Common
             } 
             //是否需要进行分页查询,默认不分页
             bool iscontinuation = false;
+            if (topcout != null && topcout.Value > 0) {
+                iscontinuation = true;
+            }
             //如果指定了返回大小
             if (requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
             {
@@ -292,7 +295,7 @@ namespace TEAMModelOS.Services.Common
                 if (!continuationSchool.ValueKind.Equals(JsonValueKind.Null) && continuationSchool.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenSchool = continuationSchool.GetString();
-                    iscontinuation = true;
+                    
                 }
             }
             //如果指定了返回大小
@@ -302,7 +305,7 @@ namespace TEAMModelOS.Services.Common
                 if (!continuationTeacher.ValueKind.Equals(JsonValueKind.Null) && continuationTeacher.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenTeacher = continuationTeacher.GetString();
-                    iscontinuation = true;
+                    
                 }
             }
             //个人tmdid

+ 5 - 1
TEAMModelOS/Services/Common/ActivityTeacherService.cs

@@ -86,6 +86,10 @@ namespace TEAMModelOS.Services.Common
             }
             //是否需要进行分页查询,默认不分页
             bool iscontinuation = false;
+            if (topcout != null && topcout.Value > 0)
+            {
+                iscontinuation = true;
+            }
             //如果指定了返回大小
             if (!requert.TryGetProperty("continuationToken", out JsonElement continuation))
             {
@@ -93,7 +97,7 @@ namespace TEAMModelOS.Services.Common
                 if (!continuation.ValueKind.Equals(JsonValueKind.Null) && continuation.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationToken = continuation.GetString();
-                    iscontinuation = true;
+                    
                 }
             }
             //班级