瀏覽代碼

修复互评记录问题。

CrazyIter_Bin 3 年之前
父節點
當前提交
b911bd824c

+ 26 - 0
TEAMModelOS.SDK/Models/Cosmos/Research/AbilityRecord.cs

@@ -96,6 +96,32 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public int currency { get; set; }
 
+    }
+    public class OtherScoreReply
+    { /// <summary>
+      /// 角色类型  成员 member   学校 school  专家 expert
+      /// </summary>
+        public string roleType { get; set; }
+        /// <summary>
+        /// 评论人的id
+        /// </summary>
+        public string tmdid { get; set; }
+        /// <summary>
+        /// 评论人
+        /// </summary>
+        public string tmdname { get; set; }
+        //总评   -1未评,0未通过,1合格,2优秀
+        public int score { get; set; } = -1;
+        /// <summary>
+        /// 某人对你这个能力点的学习评价的的评语记录的Id集合。
+        /// </summary>
+        public List<DebateReply> replies { get; set; } = new List<DebateReply>();
+        /// <summary>
+        /// 根据评判标准进行打分
+        /// </summary>
+        public List<ScoreUpload> scoreUploads { get; set; } = new List<ScoreUpload>();
+        public long time { get; set; }
+
     }
     public class SubUpload {
         public int score { get; set; } = -1;

+ 12 - 0
TEAMModelOS.SDK/Models/Cosmos/Research/TeacherTrain.cs

@@ -220,6 +220,18 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public int xzscore { get; set; } = -1;
         /// <summary>
+        /// 校评tmdid
+        /// </summary>
+        public string xztmdid { get; set; }
+        /// <summary>
+        /// 校评人名
+        /// </summary>
+        public string xztmdname { get; set; }
+        /// <summary>
+        /// 校评时间
+        /// </summary>
+        public long xztime { get; set; } = -1;
+        /// <summary>
         /// 已提交数量
         /// </summary>
         public int uploadHas { get; set; }

+ 3 - 0
TEAMModelOS.SDK/Models/Service/StatisticsService.cs

@@ -515,6 +515,9 @@ namespace TEAMModelOS.SDK
                     if (schoolScore != null && schoolScore.score >= 0)
                     {
                         teacherAility.xzscore = schoolScore.score;
+                        teacherAility.xztime= schoolScore.time;
+                        teacherAility.xztmdid = schoolScore.tmdid;
+                        teacherAility.xztmdname= schoolScore.tmdname;
 
                     }
                     var hprecord = item.otherScore.FindAll(x => x.roleType.Equals("member")).Select(y => new TeacherHprecord { tmdid = y.tmdid, tmdname = y.tmdname, score = y.score });

+ 18 - 2
TEAMModelOS/Controllers/Research/AbilitySubController.cs

@@ -303,7 +303,7 @@ namespace TEAMModelOS.Controllers
                         //获取线一个人的完整的能力点订阅数据
                         var replyIds = abilitySub.otherScore.SelectMany(x => x.replyIds).Where(y=>!string.IsNullOrEmpty(y));
                         List<DebateReply> replies = new List<DebateReply>();
-                        if (replyIds != null) {
+                        if (replyIds != null && replyIds.Count()>0) {
                           
                             string sql = $"select value(A1)  from  c join  A1 in  c.replies    where A1.id in({string.Join(",", replyIds.Select(o => $"'{o}'"))})";
                             await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School")
@@ -316,12 +316,28 @@ namespace TEAMModelOS.Controllers
                                
                             });
                         }
+                        List<OtherScoreReply> scoreReplies= new List<OtherScoreReply>();
+                        abilitySub.otherScore.ForEach(x => {
+                            OtherScoreReply scoreReply = new OtherScoreReply
+                            {
+                                roleType=x.roleType,
+                                tmdid=x.tmdid,
+                                tmdname=x.tmdname,
+                                score=x.score,
+                                scoreUploads=x.scoreUploads,
+                                time=x.time
+                            };
+                            var rs=  replies.FindAll(m => x.replyIds.Contains(m.id));
+                            scoreReply.replies.AddRange(rs);
+                            scoreReplies.Add(scoreReply);
+                        });
+
                         Dictionary<string, List<DebateReply>> pairs = new Dictionary<string, List<DebateReply>>();
                         abilitySub.otherScore.GroupBy(x => x.roleType).Select(m => new { key= m.Key, list = m.ToList() }).ToList().ForEach(y => {
                         var reply= replies.FindAll(z =>y.list.SelectMany(a=>a.replyIds).Contains(z.id));
                         pairs.Add(y.key, reply);
                         });
-                        return Ok(new { abilitySub, ability= abilityA, replies= pairs });
+                        return Ok(new { scoreReplies ,ability = abilityA    });
                     case "SetOnlineDone":
                         //完成线上学习
                         abilitySub.done = true;

+ 10 - 7
TEAMModelOS/Controllers/XTest/FixDataController.cs

@@ -100,20 +100,23 @@ namespace TEAMModelOS.Controllers
                         {
                             if (!r.type.Equals("link") && (string.IsNullOrWhiteSpace(r.hash) || r.size == 0))
                             {
-                                BlobDownloadStreamingResult blobDownload = await client.GetBlobClient(r.link).DownloadStreamingAsync(range: new HttpRange(0, 4*1048571),rangeGetContentHash:true);
-                                string hash1 = "";
+                                BlobDownloadInfo blobDownload = await client.GetBlobClient(r.link).DownloadAsync(range: new HttpRange(0, 4*1048576),rangeGetContentHash:true);
+                               
                                 if (blobDownload.Details.ContentHash != null) {
-                                      hash1 = Md5Hash.GetbyteToString(blobDownload.Details.ContentHash);
+                                    string hash = Md5Hash.GetbyteToString(blobDownload.Details.ContentHash);
+                                    r.hash = hash;
                                 }
                                
-                                byte[] retVal = md5.ComputeHash(blobDownload.Content);
-                                string hash = Md5Hash.GetbyteToString(retVal);
-                                r.hash = hash;
-                                r.size = blobDownload.Content.Length;
+                                //byte[] retVal = md5.ComputeHash(blobDownload.Content);
+                                //string hash = Md5Hash.GetbyteToString(retVal);
+                                //r.hash = hash;
+                                //r.size = blobDownload.Content.Length;
                             }
                         }
                     }
+                   // CosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").
                 }
+
             }
             return Ok(abilityTasks);
         }