瀏覽代碼

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

jeff 2 年之前
父節點
當前提交
67dd97503f

+ 4 - 4
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -2022,9 +2022,9 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                     id = courseChange.id,
                                     scode = courseChange.code,
                                     name = courseChange.name,
-                                    code = $"StuCourse-{courseChange.school}-{stu.id}",
+                                    code = $"StuCourse-{stu.schoolId}-{stu.id}",
                                     scope = courseChange.scope,
-                                    school = courseChange.school,
+                                    school = stu.schoolId,
                                     creatorId = courseChange.creatorId,
                                     classId = new List<string> { cls },
                                     pk = "StuCourse",
@@ -2104,9 +2104,9 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                     id = courseChange.id,
                                     scode = courseChange.code,
                                     name = courseChange.name,
-                                    code = $"StuCourse-{courseChange.school}-{stu.id}",
+                                    code = $"StuCourse-{stu.schoolId}-{stu.id}",
                                     scope = courseChange.scope,
-                                    school = courseChange.school,
+                                    school = stu.schoolId,
                                     creatorId = courseChange.creatorId,
                                     stulist = new List<string> { list },
                                     pk = "StuCourse",

+ 1 - 0
TEAMModelOS.SDK/Context/Configuration/Option.cs

@@ -20,6 +20,7 @@ namespace TEAMModelOS.Models
         public string HostName { get; set; }
         public string HttpTrigger { get; set; }
         public IList<string> AllowedHosts { get; }
+        public string Version { get; set; }
         public IList<StringSegment> AllowedRedirects
         {
             get

+ 4 - 0
TEAMModelOS.SDK/Models/Cosmos/School/School.cs

@@ -102,6 +102,10 @@ namespace TEAMModelOS.SDK.Models
         /// 是否為初始狀態
         /// </summary>
         public bool isinit { get; set; }
+        /// <summary>
+        /// 是否开启课例记录菜单
+        /// </summary>
+        public bool openLessonRecord { get; set; } = true;
     }
     /// <summary>
     /// 课表计划

+ 1 - 0
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -880,6 +880,7 @@ const LANG_EN_US = {
         cusTeachers: 'Instructor',
         teacherHolder: 'Please choose instructor',
         delContent: 'Are you sure to delete ',
+        delContent1: 'Note: If you need to free up the space occupied by this course, you need to manually delete the related activities and class records first, and the deletion will not be restored.',
         codeErr1: 'Course ID cannot be empty',
         codeErr2: 'Course ID can only consist of English letters and numbers',
         tableCol1: 'Seat No.',

+ 1 - 0
TEAMModelOS/ClientApp/public/lang/zh-CN.js

@@ -880,6 +880,7 @@ const LANG_ZH_CN = {
         cusTeachers: '授课教师',
         teacherHolder: '请选择授课教师',
         delContent: '是否确认删除',
+        delContent1: '注意:若需释放本课程所占的空间,需先手动删除相关活动与课堂记录, 且删除后将无法复原。',
         codeErr1: '课程编码不能为空',
         codeErr2: '课程编码只能由字母和数字组成',
         tableCol1: '序号',

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

@@ -880,6 +880,7 @@ const LANG_ZH_TW = {
         cusTeachers: '授課教師',
         teacherHolder: '請選擇授課教師',
         delContent: '是否確認刪除',
+        delContent1: '注意:若需释放本课程所占的空间,需先手动删除相关活动與課堂記錄, 且刪除後將無法復原。',
         codeErr1: '課程編碼不能為空',
         codeErr2: '課程編碼只能由字母和數位組成',
         tableCol1: '座號',
@@ -1158,7 +1159,7 @@ const LANG_ZH_TW = {
         confirmAdd: '確認新增',
         cancelAdd: '取消新增',
         createList: '新增選課班',
-        name: '名稱',
+        name: '名稱',
         nameHolder: '請輸入名單名稱…',
         nameRepeat: '選課班名稱重複',
         pdHolder: '請設定學段',

+ 4 - 0
TEAMModelOS/ClientApp/src/components/student-web/HomeView/HomeView.less

@@ -243,5 +243,9 @@
         .home-head .join-class {
             width: 80%;
         }
+
+        .no-data {
+            min-height: 300px;
+        }
     }
 }

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/HomeView/newHomeView.vue

@@ -184,7 +184,7 @@
                         </div>
                         <div class="other-box">
                             <vuescroll>
-                                <div v-if="!allNotice.length" class="no-data-notice">
+                                <div v-if="!allNotice.length" class="no-data">
                                     <img src="./noData.png" alt="">
                                     <p>{{ $t("studentWeb.public.noData") }}</p>
                                 </div>

+ 22 - 0
TEAMModelOS/ClientApp/src/view/login/page/Student.less

@@ -255,4 +255,26 @@
 }
 .other-login-text{
     font-size: 12px;
+}
+
+
+@media screen and (max-width: 768px) {
+    .loginDiv {
+        margin-top: 0;
+    }
+    .right-box {
+        flex-direction: column-reverse;
+        height: auto;
+    }
+
+    .tmd-login-box {
+        margin-right: 0;
+    }
+
+    .school-login-box {
+        margin-left: 0;
+        padding-bottom: 20px;
+        margin-bottom: 20px;
+        border-bottom: 1px dashed #ccc;
+    }
 }

+ 7 - 1
TEAMModelOS/ClientApp/src/view/mycourse/MyCourse.vue

@@ -871,7 +871,13 @@ export default {
     delCourse() {
       this.$Modal.confirm({
         title: this.$t('cusMgt.delCus'),
-        content: `${this.$t('cusMgt.delContent')}${this.courseInfo.name}?`,
+        render: (h, params) => {
+          return h("div", [
+            h("p", {style: {color: '#d94040', marginBottom: '10px'}}, this.$t('cusMgt.delContent1')),
+            h("p", `${this.$t('cusMgt.delContent')}${this.courseInfo.name}?`),
+          ])
+        },
+        // content: `${this.$t('cusMgt.delContent')}${this.courseInfo.name}?`,
         onOk: () => {
           this.$api.courseMgmt.deleteCourse({
             id: this.courseInfo.id,

+ 4 - 1
TEAMModelOS/ClientApp/src/view/student-account/stuMgt/StuMgt.vue

@@ -470,6 +470,7 @@ export default {
             "gender": this.studentInfo.gender,
             "imei": this.studentInfo.imei
           }]
+          console.error(this.studentInfo)
           let promise = this.bizType === 'insert' ? this.$api.stuAccount.saveStudent(this.$store.state.userInfo.schoolCode, params) : this.$api.stuAccount.updStudent(this.$store.state.userInfo.schoolCode, params)
           promise.then(
             (res) => {
@@ -590,6 +591,7 @@ export default {
       }
       this.$refs.selection.clearCurrentRow()
       this.addStuStatus = true
+      console.error(this.cascaderList)
     },
     exportStudent() {
       let fileName = this.$t('stuAccount.stuNameList')
@@ -995,8 +997,9 @@ export default {
     },
     cascaderList() {
       let data = this._.cloneDeep(this.years)
+      let curPeriodId = this.$store.state.user.curPeriod.id
       data.forEach(item => {
-        let children = this.classes.filter(c => c.year == item.value)
+        let children = this.classes.filter(c => c.year == item.value && c.periodId === curPeriodId)
         item.children = children.map(c => {
           return {
             label: c.name,

+ 18 - 3
TEAMModelOS/Controllers/School/SchoolController.cs

@@ -1,4 +1,5 @@
 using Azure.Cosmos;
+using DocumentFormat.OpenXml.Spreadsheet;
 using HTEXLib.COMM.Helpers;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Hosting;
@@ -136,9 +137,11 @@ namespace TEAMModelOS.Controllers
 
         public async Task<IActionResult> Upsert(School school)
         {
-            var (_, _, _, _school) = HttpContext.GetAuthTokenInfo();
+            var (userid, name , _, _school) = HttpContext.GetAuthTokenInfo();
             try
             {
+                var tableClient = _azureStorage.GetCloudTableClient();
+                var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
                 School schoolInfo = new ();
                 var client = _azureCosmos.GetCosmosClient();
                 var schoolContainer = client.GetContainer(Constant.TEAMModelOS, "School");
@@ -147,6 +150,18 @@ namespace TEAMModelOS.Controllers
                 {
                     School db_school = JsonDocument.Parse(response.Content).RootElement.Deserialize<School>();
                     //计算 比较更改前后 学段的年级变化的学段,并重新处理行政班的毕业状态。
+                    //开启课例设置是否变更
+                    if (db_school.openLessonRecord != school.openLessonRecord)
+                    {
+                        string openstr = "关闭";
+                        if (school.openLessonRecord) {
+                            openstr = "开启";
+                        }
+                        StringBuilder strMsg = new($"{name}【{userid}】{openstr}【{school.name}-{school.id}】的课堂记录菜单");
+                        //保存管理员移交至BI
+                        await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "open-lesson-record", strMsg?.ToString(), _dingDing, twebsite: "IES5", httpContext: HttpContext);
+                    }
+
                     //变更后
                     List<KeyValuePair<string, int>> period_gradeCount = new List<KeyValuePair<string, int>>();
                     school.period.ForEach(z => { period_gradeCount.Add(new KeyValuePair<string, int>(z.id, z.grades.Count)); });
@@ -170,6 +185,7 @@ namespace TEAMModelOS.Controllers
                     {
                         teachers.Add(item);
                     }
+                    
                     foreach (var item in teachers)
                     {
                         Teacher.TeacherSchool teacherSchool = item.schools.Find(x => x.schoolId.Equals(school.id));
@@ -191,8 +207,7 @@ namespace TEAMModelOS.Controllers
 
                 //创建/修改学校信息中间件
                 //_ = _httpTrigger.RequestHttpTrigger(new { school = $"{school}" }, _option.Location, "set-sc-birelation");
-                var tableClient = _azureStorage.GetCloudTableClient();
-                var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
+              
                 await BIStats.SetSchoolBIRelation(client, blobClient, tableClient, _dingDing, schoolInfo);
 
                 return Ok(new { schoolInfo });

+ 5 - 0
TEAMModelOS/Controllers/System/CoreController.cs

@@ -683,6 +683,11 @@ namespace TEAMModelOS.Controllers
             //var v2 = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
             // var description = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
             var version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
+            long.TryParse(version.PadRight(12, '0').Replace(".", ""),out long aver);
+            long.TryParse(_option.Version.PadRight(12, '0').Replace(".", ""),out long bver );
+            if (bver > aver) {
+                version = _option.Version;
+            }
             long nowtime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             //Console.WriteLine($"Assembly.GetEntryAssembly().GetName().Version: " +
 

+ 35 - 29
TEAMModelOS/Filter/AuthTokenAttribute.cs

@@ -103,46 +103,52 @@ namespace TEAMModelOS.Filter
                     }
                     string ip = IpPort.Split(":")[0];
                     var path = context.HttpContext.Request.Path;
-                    string key = $"IES5:BlackList:Token:{id}{school}{scope}:{ip}";
-                    var BTKExists = _azureRedis.GetRedisClient(8).KeyExists(key);
-                    if (BTKExists)
-                    { 
-                        var counts = _azureRedis.GetRedisClient(8).SortedSetScore(key, $"{path}");
-                        if (counts > 25)
+                    if (!$"{path}".Contains("blob/used-space") && !$"{path}".Contains("item/upsert") && !$"{path}".Contains("item/upsert-all")
+                         && !$"{path}".Contains("blob/sas-r") && !$"{path}".Contains("blob/sas-rcwld") )
+                    {
+                        string key = $"IES5:BlackList:Token:{id}{school}{scope}:{ip}";
+                        var BTKExists = _azureRedis.GetRedisClient(8).KeyExists(key);
+                        if (BTKExists)
                         {
-                            pass = false;
-                            var ttl = _azureRedis.GetRedisClient(8).KeyTimeToLive(key );
-                            if (ttl.Value.TotalSeconds > 11)
+                            var counts = _azureRedis.GetRedisClient(8).SortedSetScore(key, $"{path}");
+                            if (counts > 25)
+                            {
+                                pass = false;
+                                var ttl = _azureRedis.GetRedisClient(8).KeyTimeToLive(key);
+                                if (ttl.Value.TotalSeconds > 11)
+                                {
+                                    _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 0, 10));
+                                }
+                            }
+                            else
                             {
-                                _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 0, 10));
+                                _azureRedis.GetRedisClient(8).SortedSetIncrement(key, $"{path}", 1);
+                                _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 1, 0));
                             }
                         }
-                        else {
+                        else
+                        {
                             _azureRedis.GetRedisClient(8).SortedSetIncrement(key, $"{path}", 1);
                             _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 1, 0));
                         }
-                    }
-                    else
-                    {
-                        _azureRedis.GetRedisClient(8).SortedSetIncrement(key, $"{path}", 1);
-                        _azureRedis.GetRedisClient(8).KeyExpire(key, new TimeSpan(0, 1, 0));
-                    }
-                    //IP黑名单
-                    if (!string.IsNullOrWhiteSpace(ip)//&& !ip.Equals("127.0.0.1")
-                        )
-                    {
-                        var BIPExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:IP", ip);
-                        if (BIPExists)
+                        //IP黑名单
+                        if (!string.IsNullOrWhiteSpace(ip)//&& !ip.Equals("127.0.0.1")
+                            )
+                        {
+                            var BIPExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:IP", ip);
+                            if (BIPExists)
+                            {
+                                pass = false;
+                            }
+                        }
+                        //ID黑名单
+                        var BIDExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:ID", id);
+                        if (BIDExists)
                         {
                             pass = false;
                         }
                     }
-                    //ID黑名单
-                    var BIDExists = _azureRedis.GetRedisClient(8).HashExists("IES5:BlackList:ID", id);
-                    if (BIDExists)
-                    {
-                        pass = false;
-                    }
+                   
                     if (pass)
                     {
                         context.HttpContext.Items.Add("ID", id);

+ 2 - 1
TEAMModelOS/appsettings.json

@@ -17,7 +17,8 @@
     "JwtSecretKey": "fXO6ko/qyXeYrkecPeKdgXnuLXf9vMEtnBC9OB3s+aA=",
     "Exp": 86400,
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
-    "HttpTrigger": "https://teammodelosfunction.chinacloudsites.cn/api/"
+    "HttpTrigger": "https://teammodelosfunction.chinacloudsites.cn/api/",
+    "Version": "5.2303.1.1"
   },
   "Azure": {
     "Storage": {