Browse Source

课纲添加状态

黄贺彬 6 years ago
parent
commit
9459cf22e6

+ 6 - 0
TEAMModelOS.Model/Syllabus/Dtos/SyllabusTree.cs

@@ -69,5 +69,11 @@ namespace TEAMModelOS.Model.Syllabus.Dtos
         [Required(ErrorMessage = "{0} 必须填写")]
         public string VolumeCode { get; set; }
 
+        /// <summary>
+        /// 数据状态
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public int Status { get; set; } = 1;
+
     }
 }

+ 4 - 10
TEAMModelOS.Model/Syllabus/Models/KnowledgeBlock.cs

@@ -11,8 +11,6 @@ namespace TEAMModelOS.Model.Syllabus.Models
     [MessagePackObject(keyAsPropertyName: true)]
     public class KnowledgeBlock : TableEntity
     {
-        public string Id { get; set; }
-        public string Key { get; set; }
         /// <summary>
         /// 名称
         /// </summary>
@@ -21,17 +19,13 @@ namespace TEAMModelOS.Model.Syllabus.Models
         /// 描述
         /// </summary>
         public string Description { get; set; }
-        public string TeamModelId { get; set; }
         /// <summary>
-        /// 学校编码
+        /// 上级ID
         /// </summary>
-        public string SchoolCode { get; set; }
+        public string Pid { get; set; } = "root";
         /// <summary>
-        /// 语言版本
+        /// 学科
         /// </summary>
-        [PartitionKey]
-        public string Lang { get; set; }
-
-
+        public string SubjectCode { get; set; }
     }
 }

+ 4 - 4
TEAMModelOS.Model/Syllabus/Models/KnowledgeBlockPoint.cs

@@ -11,7 +11,7 @@ namespace TEAMModelOS.Model.Syllabus.Models
     [MessagePackObject(keyAsPropertyName: true)]
     public class KnowledgeBlockPoint : TableEntity
     {
-        public string Id { get; set; }
+        //public string Id { get; set; }
         public string PointId { get; set; }
         /// <summary>
         /// 原始名称
@@ -21,9 +21,9 @@ namespace TEAMModelOS.Model.Syllabus.Models
         /// 别名
         /// </summary>
         public string Alias { get; set; }
+        /// <summary>
+        /// 知识块ID
+        /// </summary>
         public string BlockId { get; set; }
-        //[PartitionKey]
-        //public string Lang { get; set; }
-        
     }
 }

+ 1 - 6
TEAMModelOS.Model/Syllabus/Models/KnowledgePoint.cs

@@ -24,11 +24,6 @@ namespace TEAMModelOS.Model.Syllabus.Models
         /// 描述
         /// </summary>
         public string Description { get; set; }
-        ///// <summary>
-        ///// 语言版本
-        ///// </summary>
-        //[PartitionKey]
-        //public string Lang { get; set; }
         /// <summary>
         /// 学科
         /// </summary>
@@ -36,7 +31,7 @@ namespace TEAMModelOS.Model.Syllabus.Models
         /// <summary>
         /// 建议关联学段
         /// </summary>
-        public string[] AdvicePeriodCode { get; set; }
+        public string AdvicePeriodCode { get; set; }
 
     }
 }

+ 30 - 0
TEAMModelOS.Model/Syllabus/Models/SchoolBlock.cs

@@ -0,0 +1,30 @@
+using Microsoft.WindowsAzure.Storage.Table;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.Model.Syllabus.Models
+{
+    public class SchoolBlock :TableEntity
+    {/// <summary>
+     /// 名称
+     /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// 描述
+        /// </summary>
+        public string Description { get; set; }
+        /// <summary>
+        /// 上级ID
+        /// </summary>
+        public string Pid { get; set; } = "root";
+        /// <summary>
+        /// 学科
+        /// </summary>
+        public string SubjectCode { get; set; }
+        /// <summary>
+        /// 学校编码
+        /// </summary>
+        public string SchoolCode { get; set; }
+    }
+}

+ 28 - 0
TEAMModelOS.Model/Syllabus/Models/SchoolBlockPoint.cs

@@ -0,0 +1,28 @@
+using MessagePack;
+using Microsoft.WindowsAzure.Storage.Table;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+
+namespace TEAMModelOS.Model.Syllabus.Models
+{
+    [TableSpace(Name = "Syllabus")]
+    [MessagePackObject(keyAsPropertyName: true)]
+    public class SchoolBlockPoint : TableEntity
+    {
+        //public string Id { get; set; }
+        public string PointId { get; set; }
+        /// <summary>
+        /// 原始名称
+        /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// 别名
+        /// </summary>
+        public string Alias { get; set; }
+        public string BlockId { get; set; }
+        
+        
+    }
+}

+ 5 - 0
TEAMModelOS.Model/Syllabus/Models/SyllabusNode.cs

@@ -56,5 +56,10 @@ namespace TEAMModelOS.Model.Syllabus.Models
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         public string VolumeCode { get; set; }
+        /// <summary>
+        /// 数据状态
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public int Status { get; set; } = 1;
     }
 }

+ 21 - 0
TEAMModelOS/Controllers/Core/SeedDataController.cs

@@ -1,11 +1,16 @@
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using TEAMModelOS.Helper.Common.FileHelper;
+using TEAMModelOS.SDK.Context.Configuration;
 using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
 using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
+using TEAMModelOS.SDK.Helper.Common.FileHelper;
+using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SeedData;
 
 namespace TEAMModelOS.Controllers.Core
@@ -33,5 +38,21 @@ namespace TEAMModelOS.Controllers.Core
               _seedDataService.SeedClass();
             return responseBuilder.build(); 
         }
+        /// <summary>
+        /// 获取基础信息
+        /// </summary>
+        /// <param name="identity"></param>
+        /// <returns></returns>
+        [HttpGet("getBase")]
+        public BaseJosnRPCResponse getBase(string identity)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            string path = BaseConfigModel.ContentRootPath + "/JsonFile/Core/XiaoXueYuWenPoint.json";
+            string areaString = FileHelper.FileToString(path);
+            List<RoleClaim> claims = MessagePackHelper.JsonToObject<List<RoleClaim>>(areaString);
+            builder.Data(claims);
+            return builder.build();
+        }
+
     }
 }

+ 17 - 0
TEAMModelOS/Controllers/Syllabus/Seed/Point.cs

@@ -0,0 +1,17 @@
+using MessagePack;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace TEAMModelOS.Controllers.Syllabus.Seed
+{
+    [MessagePackObject(keyAsPropertyName: true)]
+    public class Point
+    {
+        public string pointId { get; set; }
+        public string pointName { get; set; }
+        public string pointPid { get; set; }
+        public List<Point> childPoint { get; set; }
+    }
+}

+ 41 - 0
TEAMModelOS/Controllers/Syllabus/Seed/SyllabusSeedDataController.cs

@@ -0,0 +1,41 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Controllers.Syllabus.Seed;
+using TEAMModelOS.Helper.Common.FileHelper;
+using TEAMModelOS.SDK.Context.Configuration;
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
+using TEAMModelOS.SDK.Helper.Common.FileHelper;
+using TEAMModelOS.SDK.Helper.Common.JsonHelper;
+using TEAMModelOS.SeedData;
+
+namespace TEAMModelOS.Controllers.Syllabus.Seed
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    public class SyllabusSeedDataController : BaseController
+    {
+       
+        /// <summary>
+        /// 获取基础信息
+        /// </summary>
+        /// <param name="identity"></param>
+        /// <returns></returns>
+        [HttpGet("XiaoXueYuWenPoint")]
+        public BaseJosnRPCResponse getBase(string identity)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            string path = BaseConfigModel.ContentRootPath + "/JsonFile/Core/XiaoXueYuWenPoint.json";
+            string areaString = FileHelper.FileToString(path);
+            List<Point> claims = MessagePackHelper.JsonToObject<List<Point>>(areaString);
+            builder.Data(claims);
+            return builder.build();
+        }
+
+    }
+}

File diff suppressed because it is too large
+ 4827 - 0
TEAMModelOS/JsonFile/Syllabus/XiaoXueYuWenPoint.json


+ 7 - 5
TEAMModelOS/SeedData/SeedDataService.cs

@@ -29,18 +29,20 @@ namespace TEAMModelOS.SeedData
 
         public void SeedData()
         {
-            SeedRootAdmin();
-            //SeedRoleClaim();
+            //SeedRootAdmin();
+           // SeedRoleClaim();
+           //SeedIdentityClaim();
+          
             //SeedRole();
             //SeedSchool();
             //SeedTextBook();
-            
-            
+
+
             //SeedSchoolRole();
             //SeedSubject();
             //SeedGrade();
             //SeedOrgStructure();
-          
+
             //SeedIdentityClaim();
             // SeedClass();
             //SeedArea();