CrazyIter_Bin 4 gadi atpakaļ
vecāks
revīzija
ffbad152e3

+ 12 - 3
TEAMModelFunction/TriggerVote.cs

@@ -73,7 +73,8 @@ namespace TEAMModelFunction
                                 scode = vote.code,
                                 scope = vote.scope,
                                 classes = vote.classes,
-                                tmdids = vote.tmdids
+                                tmdids = vote.tmdids,
+                                owner=vote.owner
                             };
                             await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
                         }
@@ -90,6 +91,7 @@ namespace TEAMModelFunction
                                 scode = vote.code,
                                 scope = vote.scope,
                                 classes = vote.classes,
+                                owner = vote.owner
                                 // tmdids = vote.tmdids
                             };
                             await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
@@ -118,21 +120,28 @@ namespace TEAMModelFunction
                         break;
                     case "finish":
                         //获取投票活动的所有投票记录
-                        var records= _azureRedis.GetRedisClient(8).HashValues($"Vote:Record:{vote.id}_{vote.code}");
+                        var records= await _azureRedis.GetRedisClient(8).HashGetAllAsync($"Vote:Record:{vote.id}_{vote.code}");
                         //获取投票活动的选项及投票数
                         var counts= _azureRedis.GetRedisClient(8).SortedSetRangeByScoreWithScores($"Vote:Count:{vote.id}_{vote.code}");
                         if (counts != null && counts.Length > 0) {
                             foreach (var count in counts) {
                                 vote.options.ForEach(x => {
+                                    //重新赋值
                                     if (x.code.Equals(count.Element.ToString())) {
                                         x.count = (int)count.Score;
                                     }
                                 });
                             }
                         }
+                        List<dynamic> recordsBlob = new List<dynamic>();
                         foreach (var rcd in records) {
-                            
+                            recordsBlob.Add(new {key= rcd.Name, value= rcd.Value.ToString().ToObject<JsonElement>() });
                         }
+                        //处理活动方的记录
+                        string url = $"vote/record_{vote.id}.json";
+                        vote.recordUrl = url;
+                        await  _azureStorage.UploadFileByContainer(vote.owner, recordsBlob.ToJsonString(),"vote",$"record_{vote.id}.json");
+                        //处理投票者的记录
                         break;
                 }
             }

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

@@ -65,6 +65,6 @@ namespace TEAMModelOS.SDK.Models.Cosmos
         public string scope { get; set; }
         public List<string> classes { get; set; }
         public List<string> tmdids { get; set; }
-
+        public string owner { get; set; }
     }
 }

+ 77 - 37
TEAMModelOS.SDK/Models/Cosmos/School/Survey.cs

@@ -15,21 +15,46 @@ namespace TEAMModelOS.SDK.Models
     {
         public Survey() {
             pk = "Survey";
-            questions = new List<Questions>();
+            // questions = new List<Question>();
             classes = new List<string>();
+            tmdids = new List<string>();
         }
-       
-        public string name { get; set; }   //测试问卷名称', // 问卷名称
-        public string description { get; set; }   //测试问卷描述', // 问卷描述
+        /// <summary>
+        /// 学校编码或教室tmdid
+        /// </summary>
+        [Required(ErrorMessage = "owner 必须设置")]
+        public string owner { get; set; }
+        /// <summary>
+        /// 问卷名称
+        /// </summary>
+        [Required(ErrorMessage = "name 必须设置")]
+        public string name { get; set; }
+        /// <summary>
+        ///  问卷描述
+        /// </summary>
+        public string description { get; set; }
         //public string type { get; set; }   //normal', // 问卷类型
-        public string school { get; set; }
+        /// <summary>
+        /// 创建者的id 
+        /// </summary>
+        [Required(ErrorMessage = "creatorId 必须设置")]
         public string creatorId { get; set; }
-        public int year { get; set; }
+        // public int year { get; set; }
+        /// <summary>
+        /// pending 待发布|going 已发布|finish 已结束
+        /// </summary>
+        [Required(ErrorMessage = "progress 必须设置")]
         public string progress { get; set; }
-        public List<Questions> questions { get; set; }
-        public List<string> targetClassIds { get; set; }
-        public int stuCount { get; set; }
-        public int status { get; set; } // 问卷状态(100:待发布 200:已发布 300:已结束)
+        public string scope { get; set; }
+
+        public List<string> tmdids { get; set; }
+        public List<string> classes { get; set; }
+        // public List<string> targetClassIds { get; set; }
+        //  public int stuCount { get; set; }
+        /// <summary>
+        /// 问卷状态(100:待发布 200:已发布 300:已结束)
+        /// </summary>
+        public int status { get; set; }
         /// <summary>
         /// 发布对象
         /// </summary>
@@ -39,7 +64,7 @@ namespace TEAMModelOS.SDK.Models
         /// <summary>
         /// 发布模式 0 立即发布 1 定时
         /// </summary>
-        public string publishModel { get; set; }
+        //public string publishModel { get; set; }
 
         /// <summary>
         /// 开始时间
@@ -51,39 +76,58 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public long endTime { get; set; }
         public long createTime { get; set; } // 问卷发布时间
-        public List<string> classes { get; set; }
-        public List<string> tmdids { get; set; }
+
+        /// <summary>
+        /// 更新时间
+        /// </summary>
+        public long updateTime { get; set; }
         //public long sequenceNumber { get; set; }
 
-        public string url { get; set; }
-        public string scope { get; set; }
+        public string blobUrl { get; set; }
+        //将问题放入Blob
+        //public List<Question> questions { get; set; }
 
     }
-    /*public class Item {
-        public string stem { get; set; }
-        /// <summary>
-        ///  Complete Single Multiple Subjective, Judge判断
-        /// </summary>
-        //public string type { get; set; }
-        public bool required { get; set; }
-        public int order { get; set; }
-        public string description { get; set; } = null;
-        public List<CodeValue> options { get; set; }
-        public List<CodeVal> result { get; set; }
-    }*/
-     public class Questions { 
+
+    /// <summary>
+    ///
+    /// </summary>
+    public class Question {
         public string qid { get; set; }
         public string question { get; set; }
-        public List<Options> option { get; set; }
+        public List<OptionSurvey> options { get; set; }
         public string type { get; set; }
-        public QuestionResult result { get; set; }
+        //public QuestionResult result { get; set; }
 
     }
-    public class Options { 
+
+    public class OptionSurvey{
+        /// <summary>
+        /// 选项编码
+        /// </summary>
         public string code { get; set; }
+        /// <summary>
+        /// 选项文本
+        /// </summary>
         public string value { get; set; }
-        public Result result { get; set; }
+        /// <summary>
+        /// 选项描述
+        /// </summary>
+        //public string desc { get; set; }
+        /// <summary>
+        /// 选择数
+        /// </summary>
+        public int? count { get; set; }
+        /// <summary>
+        /// 其他答案数量
+        /// </summary>
+        public int? other { get; set; }
     }
+
+
+
+
+
     public class QuestionResult
     {
         public double finish { get; set; }
@@ -105,7 +149,7 @@ namespace TEAMModelOS.SDK.Models
     public class AnswerRate {
         public string qid { get; set; }
         public double answerRate { get; set; }
-        public List<Options> option { get; set; }
+        public List<CodeValue> option { get; set; }
     }
     public class StudentInfo {
         public string id { get; set; }
@@ -122,8 +166,4 @@ namespace TEAMModelOS.SDK.Models
         public string qid { get; set; }
         public string answer { get; set; }
     }
-    /*public class CodeVal{
-        public string code { get; set; }
-        public int value { get; set; }
-    }*/
 }

+ 25 - 13
TEAMModelOS.SDK/Models/Cosmos/Common/Vote.cs

@@ -17,27 +17,37 @@ namespace TEAMModelOS.SDK.Models
         public Vote()
         {
             pk = "Vote";
-            options = new List<OptionsVote>();
+            options = new List<OptionVote>();
 
         }
-
-        public string school { get; set; }
+        /// <summary>
+        /// 学校编码或教室tmdid
+        /// </summary>
+        [Required(ErrorMessage = "owner 必须设置")]
+        public string owner { get; set; }
         /// <summary>
         /// 投票名称
         /// </summary>
+        [Required(ErrorMessage = "name 必须设置")]
         public string name { get; set; }
         /// <summary>
         /// 创建者的id 
         /// </summary>
+        [Required(ErrorMessage = "creatorId 必须设置")]
         public string creatorId { get; set; }
         /// <summary>
+        /// 投票描述
+        /// </summary>
+        public string description { get; set; }
+        /// <summary>
         /// pending 待发布|going 已发布|finish 已结束
         /// </summary>
+        [Required(ErrorMessage = "progress 必须设置")]
         public string progress { get; set; }
         /// <summary>
         /// 投票选项
         /// </summary>
-        public List<OptionsVote> options { get; set; }
+        public List<OptionVote> options { get; set; }
         /// <summary>
         /// //匿名投票,不公布投票人相关信息
         /// </summary>
@@ -45,12 +55,16 @@ namespace TEAMModelOS.SDK.Models
         /// <summary>
         /// 投票周期/once一次,day天,week周,month月,年year等
         /// </summary>
+        [Required(ErrorMessage = "times 必须设置")]
         public string times { get; set; }
         //周期内可投票数
         public int voteNum { get; set; }
+        //周期内是否允许重复投相同一个选项。
+        public bool repeat { get; set; } 
         /// <summary>
         /// school|private
         /// </summary>
+        [Required(ErrorMessage = "scope 必须设置")]
         public string scope { get; set; }
         /// <summary>
         /// 参与投票的教师醍摩豆id
@@ -61,6 +75,10 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public List<string> classes { get; set; }
         /// <summary>
+        /// (100:待发布 200:已发布 300:已结束)
+        /// </summary>
+        public int status { get; set; }
+        /// <summary>
         /// 开始时间
         /// </summary>
         public long startTime { get; set; }
@@ -77,20 +95,14 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public long updateTime { get; set; }
         /// <summary>
-        /// 投票描述
+        /// 投票记录
         /// </summary>
-        public string description { get; set; }
-        /// <summary>
-        /// (100:待发布 200:已发布 300:已结束)
-        /// </summary>
-        public int status { get; set; }
-
-
+        public string recordUrl { get; set; }
     }
     /// <summary>
     /// 投票选项
     /// </summary>
-    public class OptionsVote
+    public class OptionVote
     {
         /// <summary>
         /// 投票编号

+ 23 - 13
TEAMModelOS.SDK/Models/Cosmos/School/Knowledge.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using System.Text;
 
 namespace TEAMModelOS.SDK.Models.Cosmos.School
@@ -11,18 +12,22 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
     {
         public Knowledge() {
             points = new List<string>();
-            blocks = new List<CodeValue>();
+            blocks = new List<Block>();
             pk = "Knowledge";
         }
-
+        [Required(ErrorMessage = "owner 必须设置")]
+        public string owner { get; set; }
+        [Required(ErrorMessage = "scope 必须设置")]
         public string scope { get; set; }
         /// <summary>
         /// 学段id
         /// </summary>
+       [Required(ErrorMessage = "periodId 必须设置")]
         public string periodId { get; set; }
         /// <summary>
         /// 学科id
         /// </summary>
+        [Required(ErrorMessage = "subjectId 必须设置")]
         public string subjectId { get; set; }
         /// <summary>
         /// 知识点
@@ -31,8 +36,13 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
         /// <summary>
         /// 知识块
         /// </summary>
-        public List<CodeValue> blocks { get; set; }
+        public List<Block> blocks { get; set; }
+
+    }
 
+    public class Block { 
+        public string name { get; set; }
+        public List<string> points { get; set; }
     }
     /*
     {
@@ -47,24 +57,24 @@ namespace TEAMModelOS.SDK.Models.Cosmos.School
         ],
         "block":[
             {
-                "code": "方程式" ,
-                "value":["一元一次方程","二元一次方程","一元二次方程","直线方程","三元一次方程","鸡兔同笼问题","微积分方程"]
+                "name": "方程式" ,
+                "points":["一元一次方程","二元一次方程","一元二次方程","直线方程","三元一次方程","鸡兔同笼问题","微积分方程"]
             },
             {
-                "code": "函数的特性" ,
-                "value": ["函数有界性","函数单调性","函数奇偶性","函数周期性","函数连续性","函数凹凸性"]
+                "name": "函数的特性" ,
+                "points": ["函数有界性","函数单调性","函数奇偶性","函数周期性","函数连续性","函数凹凸性"]
             },
             {
-                "code": "多项式函数" ,
-                "value": ["常函数","一次函数","二次函数","三次函数","四次函数","五次函数"]
+                "name": "多项式函数" ,
+                "points": ["常函数","一次函数","二次函数","三次函数","四次函数","五次函数"]
             },
             {
-                "code":  "基本初等函数" ,
-                "value": ["幂函数","指数函数","对数函数","三角函数","反三角函数","常数函数"]
+                "name":  "基本初等函数" ,
+                "points": ["幂函数","指数函数","对数函数","三角函数","反三角函数","常数函数"]
             },
             {
-                "code": "三角函数" ,
-                "value":["正弦函数","余弦函数","正切函数","余切函数","正割函数","余割函数","正矢函数","余矢函数","半正矢函数","半余矢函数","外正割函数","外余割函数"]
+                "name": "三角函数" ,
+                "points":["正弦函数","余弦函数","正切函数","余切函数","正割函数","余割函数","正矢函数","余矢函数","半正矢函数","半余矢函数","外正割函数","外余割函数"]
             }
         ]
     }

+ 1 - 1
TEAMModelOS/Controllers/Common/SurveyController.cs

@@ -53,7 +53,7 @@ namespace TEAMModelOS.Controllers
             //string code = request.survey.code;
             var client = _azureCosmos.GetCosmosClient();
             Survey survey;            
-            request.survey.school = request.survey.code;
+            //request.survey.school = request.survey.code;
             request.survey.code =  "Survey-" + request.survey.code;
             request.survey.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             /*if (request.survey.publishModel.Equals("0"))

+ 3 - 8
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -205,12 +205,7 @@ namespace TEAMModelOS.Controllers.Learn
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //活动分区
                 if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                Vote vote = null;
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Vote>(queryText: $"select value(c) from c where c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
-                {
-                    vote = item;
-                    break;
-                }
+                Vote vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(id.GetString(), new PartitionKey($"{code}"));
                 if (vote != null)
                 {
                    
@@ -254,7 +249,7 @@ namespace TEAMModelOS.Controllers.Learn
                     flag = true;
                 }
                 else {
-                    if (vote.scope == "school"&& vote.code.Replace("Vote-", "").Equals(school)) {
+                    if (vote.scope == "school"&& vote.owner.Equals(school)) {
                         flag = true;
                     }
                 }
@@ -273,7 +268,7 @@ namespace TEAMModelOS.Controllers.Learn
             }
             catch (Exception e)
             {
-                return BadRequest();
+                return BadRequest(e.StackTrace);
             }
         }
 

+ 126 - 0
TEAMModelOS/Controllers/Knowledge/KnowledgesController.cs

@@ -0,0 +1,126 @@
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Models;
+using TEAMModelOS.SDK;
+using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
+using TEAMModelOS.SDK.DI;
+using System.Text.Json;
+using TEAMModelOS.SDK.Helper.Common.StringHelper;
+using TEAMModelOS.SDK.Models;
+using Microsoft.AspNetCore.Http;
+using TEAMModelOS.SDK.Extension;
+using Azure.Cosmos;
+using Microsoft.AspNetCore.Authentication;
+using System.Text;
+using TEAMModelOS.SDK.DI.AzureCosmos.Inner;
+using Microsoft.Extensions.Options;
+namespace TEAMModelOS.Controllers
+{
+    [ProducesResponseType(StatusCodes.Status200OK)]
+    [ProducesResponseType(StatusCodes.Status400BadRequest)]
+    //[Authorize(Roles = "IES5")]
+    [Route("knowledges")]
+    [ApiController]
+    public class KnowledgesController: ControllerBase
+    {
+        private readonly SnowflakeId _snowflakeId;
+        private readonly AzureCosmosFactory _azureCosmos;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+        public KnowledgesController(AzureCosmosFactory azureCosmos, SnowflakeId snowflakeId, DingDing dingDing, IOptionsSnapshot<Option> option)
+        {
+            _azureCosmos = azureCosmos;
+            _snowflakeId = snowflakeId;
+            _dingDing = dingDing;
+            _option = option?.Value;
+        }
+        /**
+         * 
+         {
+           "periodId": "ca484aa8-e7b5-4a7c-8ef3-bd9e7b7d4fp2",
+            "subjectId":"ac73f07d-2cc8-4174-85ae-b39cc5b6beef",
+            "scope":"school",
+            "owner":"hbcn",
+            "points": [
+                "一元一次方程","二元一次方程","一元二次方程","直线方程","三元一次方程","鸡兔同笼问题","微积分方程","函数有界性","函数单调性","函数奇偶性","函数周期性","函数连续性","函数凹凸性",
+                "常函数","一次函数","二次函数","三次函数","四次函数","五次函数","幂函数","指数函数","对数函数","三角函数","反三角函数","常数函数",
+                "正弦函数","余弦函数","正切函数","余切函数","正割函数","余割函数","正矢函数","余矢函数","半正矢函数","半余矢函数","外正割函数","外余割函数"
+            ],
+            "blocks":[
+                {
+                    "name": "方程式" ,
+                    "points":["一元一次方程","二元一次方程","一元二次方程","直线方程","三元一次方程","鸡兔同笼问题","微积分方程"]
+                },
+                {
+                    "name": "函数的特性" ,
+                    "points": ["函数有界性","函数单调性","函数奇偶性","函数周期性","函数连续性","函数凹凸性"]
+                },
+                {
+                    "name": "多项式函数" ,
+                    "points": ["常函数","一次函数","二次函数","三次函数","四次函数","五次函数"]
+                },
+                {
+                    "name":  "基本初等函数" ,
+                    "points": ["幂函数","指数函数","对数函数","三角函数","反三角函数","常数函数"]
+                },
+                {
+                    "name": "三角函数" ,
+                    "points":["正弦函数","余弦函数","正切函数","余切函数","正割函数","余割函数","正矢函数","余矢函数","半正矢函数","半余矢函数","外正割函数","外余割函数"]
+                }
+            ]
+        }
+         */
+        [ProducesDefaultResponseType]
+        [HttpPost("upsert")]
+        public async Task<IActionResult> Upsert(TEAMModelOS.SDK.Models.Cosmos.School.Knowledge knowledge) {
+            var client = _azureCosmos.GetCosmosClient();
+            knowledge.code = $"Knowledge-{knowledge.owner}-{knowledge.subjectId}";
+            StringBuilder sql = new StringBuilder($"select value(c) from c where c.periodId = '{knowledge.periodId}'");
+            TEAMModelOS.SDK.Models.Cosmos.School.Knowledge old = null;
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TEAMModelOS.SDK.Models.Cosmos.School.Knowledge>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{ knowledge.code}") }))
+            {
+                old = item;
+                break;
+            }
+            if (old != null)
+            {
+                knowledge.id = old.id;
+                knowledge = await client.GetContainer("TEAMModelOS", "School").ReplaceItemAsync(knowledge, old.id, new PartitionKey($"{knowledge.code}"));
+            }
+            else {
+                knowledge.id = Guid.NewGuid().ToString();
+                knowledge = await client.GetContainer("TEAMModelOS", "School").CreateItemAsync(knowledge, new PartitionKey($"{knowledge.code}"));
+            }
+            return Ok(knowledge);
+        }
+        /**
+         * {
+            ?"periodId": "ca484aa8-e7b5-4a7c-8ef3-bd9e7b7d4fp2",
+            !"subjectId": "ac73f07d-2cc8-4174-85ae-b39cc5b6beef",
+            !"school_code": "hbcn"
+            }
+         **/
+        [ProducesDefaultResponseType]
+        [HttpPost("find")]
+        public async Task<IActionResult> Find(JsonElement request) {
+            var client = _azureCosmos.GetCosmosClient();
+            request.TryGetProperty("periodId", out JsonElement periodId);
+            if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            string code = $"Knowledge-{school_code}-{subjectId}";
+            StringBuilder sql = new StringBuilder($"select value(c) from c");
+            if (periodId.ValueKind.Equals(JsonValueKind.String)) {
+                sql.Append($" where c.periodId = '{periodId}'");
+            }
+            List<TEAMModelOS.SDK.Models.Cosmos.School.Knowledge> knowledges = new List<SDK.Models.Cosmos.School.Knowledge>() ;
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TEAMModelOS.SDK.Models.Cosmos.School.Knowledge>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+            {
+                knowledges.Add(item);
+            }
+            return Ok(knowledges);
+        }
+    }
+}

+ 2 - 2
TEAMModelOS/Controllers/School/StudentCommonController.cs

@@ -45,10 +45,10 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         [HttpPost("find-activity")]
         [AuthToken(Roles = "student")]
-        public async Task<IActionResult> FindTch(JsonElement requert)
+        public async Task<IActionResult> FindTch(JsonElement request)
         {
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
-            (List<ActivityData> datas, string continuationToken) = await ActivityService.FindByRole("School", requert, id, _azureCosmos,_azureRedis);
+            (List<ActivityData> datas, string continuationToken) = await ActivityService.FindByRole("School", request, id, _azureCosmos,_azureRedis);
             return Ok(new { datas, continuationToken });
         }
         

+ 3 - 3
TEAMModelOS/JsonFile/Core/LangConfigV3.json

@@ -21,7 +21,7 @@
         "Analysis": "解析",
         "Score": "配分",
         "Point": "知识点",
-        "Filed": "知识|理解|应用|分析|综合|评鉴",
+        "Filed": "记忆|理解|应用|分析|创造|评价",
         "Judge": "对|错",
         "Ended": "结束",
         "Level": "难度"
@@ -45,7 +45,7 @@
         "Analysis": "解析",
         "Score": "配分",
         "Point": "知識點",
-        "Filed": "知識|理解|應用|分析|綜合|評鑒",
+        "Filed": "記憶|理解|應用|分析|創造|評鑒",
         "Judge": "對|錯",
         "Ended": "結束",
         "Level": "難度"
@@ -69,7 +69,7 @@
         "Analysis": "Explain",
         "Score": "Score",
         "Point": "Point",
-        "Filed": "Knowledge|Understand|Using|Analyse|Synthesize|Discern",
+        "Filed": "Remember|Understand|Apply|Analyze|Create|Evaluate",
         "Judge": "True|False",
         "Ended": "Ended",
         "Level": "Level"

+ 4 - 5
TEAMModelOS/Services/Common/ActivityService.cs

@@ -116,6 +116,7 @@ namespace TEAMModelOS.Services.Common
             }
             catch (Exception e)
             {
+                throw new Exception(e.StackTrace);
             }
             return msgid;
         }
@@ -255,10 +256,9 @@ namespace TEAMModelOS.Services.Common
             string query = null;
             if (classes.IsNotEmpty() )
             {
-                StringBuilder insql =new StringBuilder();
-                classes.ForEach( x => { insql.Append($"'{x}',"); });
-                string sql = insql.ToString();
-                sql = sql.ToString().Substring(0, sql.Length - 2);
+                List<string> sqlList = new List<string>();
+                classes.ForEach( x => { sqlList.Add($" '{x}' "); });
+                string sql = string.Join(" , ", sqlList);
                 query = $" SELECT distinct  value c   FROM c   JOIN A0 IN c.classes join A1 in c.tmdids   where c.startTime >= {stimestamp} and c.startTime <= {etimestamp} and  c.pk='Activity'  and   (A0 in('{sql}') or A1 in ('{id}')) ";
             }
             else {
@@ -287,7 +287,6 @@ namespace TEAMModelOS.Services.Common
             bool tips = false;
             if (!requert.TryGetProperty("tips", out JsonElement jtips))
             {
-                //指定了cancellationToken 表示需要进行分页
                 if (!jtips.ValueKind.Equals(JsonValueKind.Null) && !jtips.ValueKind.Equals(JsonValueKind.True))
                 {
                     tips = jtips.GetBoolean();

+ 1 - 1
TEAMModelOS/TEAMModelOS.csproj

@@ -7,7 +7,7 @@
     <PackageReference Include="Caching.CSRedis" Version="3.6.50" />
     <PackageReference Include="CSRedisCore" Version="3.6.5" />
     <PackageReference Include="DotNetZip" Version="1.15.0" />
-    <PackageReference Include="HTEXLib" Version="2.3.5" />
+    <PackageReference Include="HTEXLib" Version="2.3.9" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.6" />
       <PackageReference Include="VueCliMiddleware" Version="3.1.2" />  </ItemGroup>
   <PropertyGroup>