Bladeren bron

1. 廢除老師取得學校資訊時運行學校購買版本變更邏輯 2.學校購買版本計算邏輯變更:原size+scale判斷改為管理+學情+五育產品判斷

jeff 1 jaar geleden
bovenliggende
commit
ffc72e2ddc

+ 8 - 19
TEAMModelOS.SDK/Models/Service/BI/BISchoolService.cs

@@ -36,28 +36,18 @@ namespace TEAMModelOS.SDK.Models.Service.BI
             }
         }
         /// <summary>
-        /// 計算學校版本公式
+        /// 計算學校版本公式 ※計算邏輯變更:廢止原size+scale判斷邏輯
         /// </summary>
         public static Edition calSchoolEdition(School school, List<string> services)
         {
-            int edition = 0;
-            if (school.size <= 100 && school.scale == 0)
-            {
-                edition = 1;
-            }
-            else if (school.size >= 300 && school.scale >= 500 && school.scale < 100 && services.Contains("YMPCVCIM"))
-            {
-                edition = 2;
-            }
-            else if (school.size >= 300 && school.scale >= 1000 && services.Contains("YMPCVCIM") && services.Count > 2)
-            {
-                edition = 3;
-            }
+            int edition = 1;
+            bool adminFlg = (services.Contains("IPDYZYLC")) ? true : false;
+            bool analFlg = (services.Contains("YMPCVCIM")) ? true : false;
+            bool fiveFlg = (services.Contains("YPXSJ6NJ")) ? true : false;
+            if (adminFlg && analFlg && fiveFlg) edition = 3;
+            else if (adminFlg && analFlg) edition = 2;
+            else edition = 1;
 
-            if (edition == 0)
-            {
-                edition = 1;
-            }
             if (school.edition != null)
             {
                 school.edition.current = edition;
@@ -73,7 +63,6 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                     current = edition,
                     record = edition
                 };
-
                 school.edition = tempEdition;
             }
             return school.edition;

+ 0 - 2
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -955,8 +955,6 @@ namespace TEAMModelOS.Controllers
                 //返回剩余空间
                 (long usedSize, long teach, long total, long surplus, Dictionary<string, double?> catalog) space =
                     await BlobService.GetSurplusSpace(school_base.id, "school", _option.Location, _azureCosmos, _azureRedis, _azureStorage, _dingDing, _httpTrigger);
-                //学校版本处理
-                _ = BISchoolService.UpSchoolEdition(client, _dingDing, services.Select(s => s.prodCode).ToList(), $"{school_code}");
 
                 return Ok(new
                 {