Parcourir la source

Update 查询的情景信息增加得分字段

YueYunyun il y a 1 an
Parent
commit
45dff00256

+ 3 - 0
SourceCode/WeApp.Application/BaseSystem/Query/QueryAppService.cs

@@ -965,6 +965,9 @@ namespace WeApp.BaseSystem.Query
                         {
                             dto.HasEnd = runScene.IsEnd;
                             dto.Variables = dto.Variables.MergeHashtable(runScene.GetVariables());
+
+                            dto.SystemScore = runScene.SystemScore;
+                            dto.FullScore = runScene.FullScore;
                         }
                         //stopwatch.Stop();
                         //this.LogInfo($"2耗时{scenePath}:{stopwatch.ElapsedMilliseconds}毫秒");

+ 27 - 1
SourceCode/WeApp.Core/Configuration/Cache/SceneDto.cs

@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 
 using Newtonsoft.Json;
 
@@ -16,6 +17,31 @@ namespace WeApp.Configuration.Cache
         public new string _description => base._description;
 
         public new List<GuideModel> GuideInfos { get; set; }
+
+        /// <summary>
+        /// 系统得分
+        /// </summary>
+        public decimal? SystemScore { get; set; }
+
+        /// <summary>
+        /// 满分
+        /// </summary>
+        public decimal? FullScore { get; set; }
+
+        /// <summary>
+        /// 得分百分比
+        /// </summary>
+        public decimal ScorePer => GetPer();
+
+        public decimal GetPer()
+        {
+            if (SystemScore == null || FullScore == null)
+            {
+                return 0;
+            }
+
+            return Math.Round(((decimal)SystemScore / (decimal)FullScore) * 100, 2);
+        }
     }
 
     public class ScenePathDto