Pārlūkot izejas kodu

1. 修正HiTeach API 取得學校資訊API 若學校region欄位為null會報錯問題
2. 修正BI端外通知無法發送問題(途中)

jeff 2 gadi atpakaļ
vecāks
revīzija
bd315e929e

+ 4 - 4
TEAMModelBI/ClientApp/src/view/systemConfig/pushmsg/createdpush.vue

@@ -319,7 +319,7 @@
               <div class="receivetype-title">接收类型:</div>
               <div class="receivetype-select">
                 <el-radio-group v-model="constructorData.receiveType">
-                  <el-radio label="hita" />
+                  <el-radio label="hita5" />
                   <el-radio label="HiTeach" disabled />
                   <el-radio label="IES" disabled />
                 </el-radio-group>
@@ -536,7 +536,7 @@ let constructorData = ref({
     personage: [],
     batchPersonage: []
   },
-  receiveType: 'hita',
+  receiveType: 'hita5',
   source: '',
   timeType: 'immediately',      // immediately or preordered
   time: 0,
@@ -869,7 +869,7 @@ function clearData () {
   constructorData.value.receivedata.school = []
   constructorData.value.receivedata.personage = []
   constructorData.value.receivedata.batchPersonage = []
-  constructorData.value.receiveType = 'hita'
+  constructorData.value.receiveType = 'hita5'
   constructorData.value.source = ''
   constructorData.value.timeType = 'immediately'
   constructorData.value.time = 0
@@ -901,7 +901,7 @@ function reusedata (value) {
   constructorData.value.receivedata.area = reuses.crowd.areaIds
   constructorData.value.receivedata.school = reuses.crowd.schoolIds
   constructorData.value.receivedata.personage = reuses.crowd.tmdIds
-  constructorData.value.receiveType = 'hita'
+  constructorData.value.receiveType = 'hita5'
   constructorData.value.source = reuses.source
   constructorData.value.timeType = 'immediately'
   constructorData.value.time = 0

+ 2 - 1
TEAMModelBI/Controllers/BICommon/BINoticeController.cs

@@ -214,6 +214,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     }
                 }
 
+                string tagServiceName = ($"{_crowdType}".ToLower().Contains("hita")) ? "HiTA" : $"{_crowdType}";
                 bINotice = new()
                 {
                     id = Guid.NewGuid().ToString(),
@@ -225,7 +226,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     theme = $"{theme}",
                     content = $"{content}",
                     crowd = crowd,
-                    crowdIds = idNameCodes.Select(s => $"{s.id}_{_crowdType}").ToList(),
+                    crowdIds = idNameCodes.Select(s => $"{s.id}_{tagServiceName}").ToList(),
                     createId = _tmdId,
                     sendTime = sendTime.GetInt64(),//发布时间待解决
                     createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),

+ 9 - 1
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -656,7 +656,15 @@ namespace TEAMModelOS.Controllers.Client
                 School school_base = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{school_code}", new PartitionKey("Base"));
                 if (!string.IsNullOrWhiteSpace(school_base.id))
                 {
-                    lang = (school_base.region.Equals("中国")) ? "zh-cn" : (school_base.region.Equals("臺灣")) ? "zh-tw" : "en-us"; //語系
+                    //語系取得
+                    if(!string.IsNullOrEmpty(school_base.region)) {
+                        if (school_base.region.Equals("中国")) lang = "zh-cn";
+                        else if (school_base.region.Equals("臺灣")) lang = "zh-tw";
+                    } else
+                    {
+                        if(_option.Location.Equals("China")) lang = "zh-cn";
+                    }
+                    //年級、科目、評測類型取得
                     foreach (Period periodinfo in school_base.period)
                     {
                         periods.Add(new { id= periodinfo.id, name= periodinfo.name });