浏览代码

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 年之前
父节点
当前提交
25f3886e99

+ 27 - 0
TEAMModelBI/ClientApp/src/until/common.js

@@ -173,5 +173,32 @@ export default {
             noWan = '0' + noWan
         }
         return overWan ? getWan(overWan) + '万' + getWan(noWan) : getWan(num)
+    },
+    //处理数字  以数字+文字单位
+    numberToTextWithUnit(number) {
+        console.log('进入方法了123')
+        let nowLanguage=localStorage.getItem('local') ? (localStorage.getItem('local')).toLowerCase():(navigator.language).toLowerCase();
+        let spanValue=nowLanguage.indexOf('cn') !== 0 || nowLanguage.indexOf('tw') !==0 ? 10000:1000
+        console.log(spanValue,'进入方法了')
+        if (isNaN(number)) {
+            console.log("请输入有效数字")
+            return;
+        }
+        if (number < spanValue) {
+            return number.toString();
+        }
+        const unitCN=["万", "亿", "兆"];let unitTW=["萬","億","兆"];let unitEN=["k","M","B"]
+        const units = nowLanguage.indexOf('cn') !== 0 ? unitCN:nowLanguage.indexOf('tw') !==0 ?unitTW:unitEN
+        let unitIndex = 0;
+    
+        while (number >= spanValue && unitIndex < units.length) {
+            number /= spanValue;
+            unitIndex++;
+        }
+    
+        const roundedNumber =number.toFixed(1);
+        const numberText = roundedNumber.toString();
+    
+        return numberText + units[unitIndex - 1];
     }
 }

+ 14 - 10
TEAMModelBI/ClientApp/src/view/product/details.vue

@@ -36,7 +36,7 @@
               </div>
             </div>
             <div :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
-              <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.value}}<span class="timetag">Min</span><br /><span>{{Math.round(item.value/60)}}<span class="timetag">H</span></span></p>
+              <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.valueText}}<span class="timetag">Min</span><br /><span>{{item.valueHText}}<span class="timetag">H</span></span></p>
               <p v-else>{{item.value}}</p>
             </div>
           </div>
@@ -287,6 +287,7 @@ console.log(props.detailsData, '子组件')
 let value1 = ref('')
 let value = ref()
 let $myemit = defineEmits(['myback'])
+let { proxy } = getCurrentInstance()
 const activeName = ref('areas')
 let appearState = ref('area')
 const options = [
@@ -614,10 +615,9 @@ let basicaList = ref([
   { title: '教室总数', icon: '#icon-shouhuifangzi', value: '65', key: 'roomnum' },
   { title: '教师总数', icon: '#icon-jiaoshijie', value: '158', key: 'teachnum' },
   { title: '学生人次', icon: '#icon-zongrenshu', value: '7603', key: 'studentnum' },
-  { title: '学生参与总时数', icon: '#icon-_shijian_xiaoshuai', value: '8小时', key: 'participationnum' },
+  { title: '学生参与总时数', icon: '#icon-_shijian_xiaoshuai', value: '8小时', key: 'participationnum',valueText:'',valueHText:'', },
   { title: '课堂总数', icon: '#icon-ketang', value: '45', key: 'classnum' },
-  { title: '课堂总时数', icon: '#icon--shijian ', value: '648', key: 'classtime' },
-  { title: '授权类型', icon: '#icon-guanfangshouquan', value: '已授权', key: 'power' },
+  { title: '课堂总时数', icon: '#icon--shijian ', value: '648', key: 'classtime',valueText:'',valueHText:'',},
 ])
 let powerList = ref({
   facility: [
@@ -814,11 +814,15 @@ function init (againvalue) {
   basicaList.value[0].value = schoolId
   basicaList.value[1].value = 0
   // basicaList.value[2].value = 0
-  basicaList.value[3].value = tmidCnt
-  basicaList.value[4].value = stuShow
+  basicaList.value[3].value = proxy.$common.numberToTextWithUnit(tmidCnt)
+  basicaList.value[4].value = proxy.$common.numberToTextWithUnit(stuShow)
   basicaList.value[5].value = stuLessonLengMin
+  basicaList.value[5].valueText=proxy.$common.numberToTextWithUnit(stuLessonLengMin)
+  basicaList.value[5].valueHText=proxy.$common.numberToTextWithUnit(Math.round(stuLessonLengMin/60))
   basicaList.value[6].value = lessonRecord
   basicaList.value[7].value = lessonLengMin
+  basicaList.value[7].valueText = proxy.$common.numberToTextWithUnit(lessonLengMin)
+  basicaList.value[7].valueHText=proxy.$common.numberToTextWithUnit(Math.round(lessonLengMin/60))
 
   //处理课中使用数据
   let { useIES, useWebIrs, useDeviceIrs, useHita, useHaboard, useIES5Resource, tGreen } = propsbox.detailsData
@@ -842,10 +846,10 @@ function init (againvalue) {
   powerList.value.class[3].value = lessonCntIdDevice
   //处理任务数、作品完成、题目等。。。。
   let { mission, missionFin, item, interact } = propsbox.detailsData
-  inuseList.value[0].value = mission
-  inuseList.value[1].value = missionFin
-  inuseList.value[2].value = item
-  inuseList.value[3].value = interact
+  inuseList.value[0].value = proxy.$common.numberToTextWithUnit(mission)
+  inuseList.value[1].value = proxy.$common.numberToTextWithUnit(missionFin)
+  inuseList.value[2].value = proxy.$common.numberToTextWithUnit(item)
+  inuseList.value[3].value = proxy.$common.numberToTextWithUnit(interact)
 
   //处理多形态课堂
   let { lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, lTypeNone,lessonLeng0} = propsbox.detailsData

+ 4 - 0
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -732,6 +732,10 @@ function dataInit () {
   }).catch((err) => {
     ElMessage.error('API异常,基础数据获取异常')
   })
+  let a=proxy.$common.numberToTextWithUnit(123456); 
+  let b=proxy.$common.numberToTextWithUnit(1234567890);
+  let c=proxy.$common.numberToTextWithUnit(12345678901234);
+   console.log(a,b,c,'查看文字反应')
 }
  function serachToresult (startTime, endTime, product, schools, unit) {
   // let data = { "dateFrom": "2023-04-12", "dateTo": "2023-04-19", "prod": "HiTeach", "schoolIds": ["tbslgb", "habook"], "dateUnit": "Day" }

+ 2 - 2
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -3693,7 +3693,7 @@ const LANG_ZH_TW = {
         dashboard: {
             title: '校園大數據',
             title3: '全方位素質大數據',
-            block1: '學校IES資源與應用管理數據儀表',
+            block1: '學校IES資源與應用數據儀表',
             block2: '教室物聯',
             block3: '多元評量',
             block4: '學情分析',
@@ -3704,7 +3704,7 @@ const LANG_ZH_TW = {
             comingSoon: '即將上線',
             loading: '載入中',
             quit: '退出',
-            title2: '學校IES資源與應用管理數據儀表',
+            title2: '學校IES資源與應用數據儀表',
             typeCount: '課堂類別數',
             gradeCount: '年級數',
             subjectCount: '學科數',

+ 12 - 12
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -714,30 +714,30 @@
 					? isZhiYinVersion
 						? this.zySchoolMenu
 						: [
-								// 教学看板(国际站单独)
-								{
-									icon: "iconfont icon-data-count",
-									name: this.$t("system.menu.techDash"),
-									router: "/researchDashboard",
+								//iot (10.20 应台湾要求 调整 顺序 1.iot 2.教学看板)
+									{
+									icon: "iconfont icon-wulianwang",
+									name: this.$t("system.menu.iotBoard"),
+									router: "/schooliot",
 									tag: "",
 									role: "admin",
 									permission: "dashboard-read",
 									menuName: "TeacherDashboard",
 									child: [],
-									isShow: this.isGlobalSite
+                                    isShow: this.isGlobalSite && this.isAdmin
+									//isShow:true,
 								},
-								//iot
+								// 教学看板(国际站单独)
 								{
-									icon: "iconfont icon-wulianwang",
-									name: this.$t("system.menu.iotBoard"),
-									router: "/schooliot",
+									icon: "iconfont icon-data-count",
+									name: this.$t("system.menu.techDash"),
+									router: "/researchDashboard",
 									tag: "",
 									role: "admin",
 									permission: "dashboard-read",
 									menuName: "TeacherDashboard",
 									child: [],
-									isShow: this.isGlobalSiteRc && this.isAdmin
-									//isShow:true,
+									isShow: this.isGlobalSite,
 								},
 								// 学校管理
 								{

+ 5 - 2
TEAMModelOS/ClientApp/src/view/areaMgmt/AreaLayout.vue

@@ -251,6 +251,9 @@ export default {
       this.$refs.side1.toggleCollapse()
       this.$EventBus.$emit('onCollapseChange', this.isCollapsed)
     },
+    isGlobalSite() {
+        return this.$store.state.config.srvAdr !== "China";
+    },
     /*是否为国际测试rc*/
 			isGlobalSiteRc() {
 				if (window.location.host.includes("ies5-rc.teammodel.net")) {
@@ -277,7 +280,7 @@ export default {
           permission: '',
           menuName: 'areaIndex',
           child: [],
-          isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.$store.state.config.srvAdrType != 'product'
+          isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain()
         },
         //学区iot
         {
@@ -289,7 +292,7 @@ export default {
           permission: '',
           menuName: 'areaiot',
           child: [],
-          isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.$store.state.config.srvAdrType != 'product' && this.isGlobalSiteRc()
+          isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.isGlobalSite()
           //isShow:true,
         },
         // 研修平台

+ 6 - 4
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -298,14 +298,16 @@
 			stemEditor.create()
 			this.stemEditor = stemEditor
 
-			if(JSON.stringify(this.editInfo) === '{}'){
-				this.initEditors()
-			}
-
 			if (this.editInfo && this.isEdit) { 
 				console.log('进入多选题Mounted编辑')
 				this.doRender(this.editInfo)
 			}
+
+			setTimeout(() => {
+				if(JSON.stringify(this.editInfo) === '{}'){
+					this.initEditors()
+				}
+			}, 100);
 		},
 		computed: {
 		    // 选项顺序转化成字母

+ 7 - 6
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -248,11 +248,7 @@
 
 			stemEditor.create()
 			this.stemEditor = stemEditor
-
-			if(JSON.stringify(this.editInfo) === '{}'){
-				this.initEditors()
-			}
-
+			
 			if (this.editInfo && this.isEdit) {
 				console.log('进入单选题Mounted编辑',this.editInfo)
 				this.editSingleInfo = this.editInfo
@@ -267,10 +263,15 @@
 					this.stemEditor.txt.html(this.editSingleInfo.question)
 				})
 			}
+			setTimeout(() => {
+				if(JSON.stringify(this.editInfo) === '{}'){
+					this.initEditors()
+				}
+			}, 100);
 		},
 		watch: {
 			editInfo: {
-				handler(newValue, oldValue) {
+				handler(newValue, oldValue) {	
 					if (newValue) {
 						console.log('单选接收到的数据')
 						console.log(newValue)

+ 1 - 1
TEAMModelOS/Controllers/Analysis/ClassAnalysisController.cs

@@ -114,7 +114,7 @@ namespace TEAMModelOS.Controllers.Analysis
 
                 }
                 double studentCount = 0;
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"SELECT count(1) as stus FROM c where c.periodId = '{pId}' and c.graduate = 0 ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{code}") }))
+                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"SELECT count(1) as stus FROM c where c.periodId = '{pId}' and (c.graduate = 0 OR IS_DEFINED(c.graduate) = false) ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)

+ 20 - 22
TEAMModelOS/Controllers/Client/AClassONEController.cs

@@ -896,27 +896,31 @@ namespace TEAMModelOS.Controllers
                 List<string> artIds = new();
                 artIds = arts.Select(c => c.id).ToList();
                 List<ArtAttachment> artAttachments = new();
-                string sqlTask = $"select value(c)  from c where c.studentId = '{stuId}' and c.artId in ({string.Join(",", artIds.Select(s => $"'{s}'"))})";
-                await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).
-                GetItemQueryIterator<ArtAttachment>(queryText: sqlTask, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtAttachment-{code}") }))
-                {
-                    artAttachments.Add(item);
-                }
                 List<StudentArtResult> studentArtResults = new();
-                foreach (var art in arts) {
-                    StudentArtResult artResult = new();
-                    string stu = string.Format("{0}{1}{2}", code.GetString(), "-", stuId.GetString());
-                    var res = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stu.ToString(), new PartitionKey($"ArtResult-{art.id}"));
-                    if (res.Status == 200)
+                if (artIds.Count > 0) {
+                    string sqlTask = $"select value(c)  from c where c.studentId = '{stuId}' and c.artId in ({string.Join(",", artIds.Select(s => $"'{s}'"))})";
+                    await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).
+                    GetItemQueryIterator<ArtAttachment>(queryText: sqlTask, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtAttachment-{code}") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(res.ContentStream);
-                        artResult = json.ToObject<StudentArtResult>();
-                        studentArtResults.Add(artResult);
+                        artAttachments.Add(item);
                     }
+                   
+                    foreach (var art in arts)
+                    {
+                        StudentArtResult artResult = new();
+                        string stu = string.Format("{0}{1}{2}", code.GetString(), "-", stuId.GetString());
+                        var res = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stu.ToString(), new PartitionKey($"ArtResult-{art.id}"));
+                        if (res.Status == 200)
+                        {
+                            using var json = await JsonDocument.ParseAsync(res.ContentStream);
+                            artResult = json.ToObject<StudentArtResult>();
+                            studentArtResults.Add(artResult);
+                        }
+                    }                   
                 }
-                var quotStus = studentArtResults.Select(c => new { 
+                var quotStus = studentArtResults.Select(c => new {
                     c.artId,
-                    quotas = c.results.GroupBy(z => (z.quotaId,z.quotaName,z.subjectId)).Select(k => new { 
+                    quotas = c.results.GroupBy(z => (z.quotaId, z.quotaName, z.subjectId)).Select(k => new {
                         k.Key.quotaId,
                         k.Key.quotaName,
                         k.Key.subjectId,
@@ -924,12 +928,6 @@ namespace TEAMModelOS.Controllers
                         artAttachments.Where(p => p.studentId.Equals(stuId.GetString()) && p.artId.Equals(c.artId) && p.quotaId.Equals(k.Key.quotaId) && p.subjectId.Equals(k.Key.subjectId)).ToList().Count : 0
                     })
                 });
-               /* var quotas = artAttachments.GroupBy(c => (c.quotaId,c.subjectId,c.quotaName)).Select(x => new { 
-                    x.Key.subjectId,
-                    x.Key.quotaId,
-                    x.Key.quotaName,
-                    x.ToList().Select(z => z.files).ToList().Count
-                });*/
                 var newArts = arts.Select(c => new { 
                 
                     c.id,

+ 12 - 4
TEAMModelOS/Controllers/Common/ArtController.cs

@@ -5,6 +5,7 @@ using DocumentFormat.OpenXml.Bibliography;
 using DocumentFormat.OpenXml.Office2010.Excel;
 using DocumentFormat.OpenXml.Office2013.Excel;
 using DocumentFormat.OpenXml.Office2016.Excel;
+using DocumentFormat.OpenXml.Presentation;
 using DocumentFormat.OpenXml.Spreadsheet;
 using DocumentFormat.OpenXml.Wordprocessing;
 using HTEXLib.COMM.Helpers;
@@ -38,6 +39,7 @@ using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
+using TEAMModelOS.SDK.Models.Cosmos.Student;
 using Survey = TEAMModelOS.SDK.Models.Survey;
 
 namespace TEAMModelOS.Controllers.Common
@@ -1014,7 +1016,7 @@ namespace TEAMModelOS.Controllers.Common
                 if (!request.TryGetProperty("taskId", out JsonElement taskId)) return BadRequest();
                 string token = HttpContext.GetXAuth("authtoken");
                 var client = _azureCosmos.GetCosmosClient();
-                //var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
+                var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 List<StudentArtResult> artResults = new();
                 string sql = $"select value(c) from c where c.artId = '{id}' and array_contains(c.classIds,'{classId}')  ";
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(
@@ -1033,7 +1035,13 @@ namespace TEAMModelOS.Controllers.Common
 
                 artResults.ForEach(x => x.results.RemoveAll(z => !string.IsNullOrWhiteSpace(z.subjectId) && !subject.GetString().Equals(z.subjectId)));
                 artResults.ForEach(x => x.subjectScores.RemoveAll(z => !string.IsNullOrWhiteSpace(z.subjectId) && !subject.GetString().Equals(z.subjectId)));
-
+                List<ArtAttachment> artAttachments = new();
+                string sqlTask = $"select value(c)  from c where c.artId  = '{id}' and c.subjectId = '{subject}'";
+                await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).
+                GetItemQueryIterator<ArtAttachment>(queryText: sqlTask, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtAttachment-{school}") }))
+                {
+                    artAttachments.Add(item);
+                }
                 List<(string stuId, string url)> zyUrl = new();
                 foreach (StudentArtResult artResult in artResults)
                 {
@@ -1064,7 +1072,7 @@ namespace TEAMModelOS.Controllers.Common
                         x.classIds,
                         x.artId,
                         isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
-                        attachments = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().files,
+                        attachments = artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList(),
                         url = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().url : ""
                     });
                     return Ok(new { works, code = 200 });
@@ -1077,7 +1085,7 @@ namespace TEAMModelOS.Controllers.Common
                         x.classIds,
                         x.artId,
                         isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
-                        attachments = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().files,
+                        attachments = artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList(),
                     });
                     return Ok(new { works, code = 200 });
                 }

+ 23 - 1
TEAMModelOS/Controllers/School/ArtReviewController.cs

@@ -24,6 +24,10 @@ using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models.Service;
 using Microsoft.AspNetCore.Authorization;
+using DocumentFormat.OpenXml.Office2010.Excel;
+using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.CreateApplyForSubjectApplymentRequest.Types;
+using TEAMModelOS.SDK.Models.Cosmos.Student;
+
 namespace TEAMModelOS.Controllers
 {
     /// <summary>
@@ -271,6 +275,14 @@ namespace TEAMModelOS.Controllers
                             List<StudentArtResult> results = new List<StudentArtResult>();
                             List<double> scores = new();
                             List<ArtSubjectScore> As = new();
+
+                            List<ArtAttachment> artAttachments = new();
+                            string sqlTask = $"select value(c)  from c where c.artId  = '{_artId}' and c.subjectId = '{subjects[0]}'";
+                            await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).
+                            GetItemQueryIterator<ArtAttachment>(queryText: sqlTask, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtAttachment-{school}") }))
+                            {
+                                artAttachments.Add(item);
+                            }
                             if (ids.Any())
                             {
                                 string query = $" select value c from c where c.id in({string.Join(",", ids.Select(x => $"'{x}'"))}) ";
@@ -334,7 +346,17 @@ namespace TEAMModelOS.Controllers
                                     id = s,
                                     name = As.Where(a => a.subjectId.Equals(s)).Select(x => x.score)
                                 });
-                                return Ok(new { subjectScore, scores, results = results.OrderBy(z => z.studentId), status = 1, continuationToken });
+                                var works = results.Select(x => new
+                                {
+                                    x.studentId,
+                                    x.studentName,
+                                    x.classIds,
+                                    x.artId,
+                                    isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
+                                    attachments = artAttachments.Where(c => c.studentId.Equals(x.studentId)).ToList(),
+                                    //url = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().url : ""
+                                });
+                                return Ok(new { subjectScore, scores, works, results = results.OrderBy(z => z.studentId), status = 1, continuationToken });
                             }
                             else
                             {

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

@@ -2126,7 +2126,7 @@ namespace TEAMModelOS.Controllers
                 }
                 //學生數(今年) 用學段篩選
                 int studentCnt = 0;              
-                string sql_studentCnt = $"SELECT count(1) as stus FROM c where c.periodId = '{periodId}' and c.graduate = 0 ";
+                string sql_studentCnt = $"SELECT count(1) as stus FROM c where c.periodId = '{periodId}' and (c.graduate = 0 OR IS_DEFINED(c.graduate) = false) ";
                 await foreach (var items in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: sql_studentCnt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{_schoolId}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(items.ContentStream);
@@ -2343,7 +2343,7 @@ namespace TEAMModelOS.Controllers
                         if (i != school.period.Count - 1) { sb.Append(", "); }
                     }
                     sb.Append(")");
-                    string sql_studentCnt = $"SELECT count(1) as stus FROM c where c.periodId in {sb.ToString()}  and c.graduate = 0 ";
+                    string sql_studentCnt = $"SELECT count(1) as stus FROM c where c.periodId in {sb.ToString()}  and (c.graduate = 0 OR IS_DEFINED(c.graduate) = false) ";
 
                     await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: sql_studentCnt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{school.id}") }))
                     {