CrazyIter_Bin 3 年之前
父節點
當前提交
20089dbd48

+ 4 - 4
TEAMModelFunction/ScsApisHttpTrigger.cs

@@ -72,7 +72,7 @@ namespace TEAMModelFunction
                         abilityNos = diagnoses.Select(x => x.DiagnosisDicNum).ToList();
                     }
                 }
-                return new  OkObjectResult(abilityNos);
+                return new  OkObjectResult(new { data= abilityNos .ToJsonString()});
             }
             catch (Exception ex)
             {
@@ -89,7 +89,7 @@ namespace TEAMModelFunction
         [FunctionName("GetSingleTeacherByProject")]
         public async Task<IActionResult> GetSingleTeacherByProject([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log)
         {
-            ScTeacher teacher=null;
+            string teacher=null;
             string data = await new StreamReader(req.Body).ReadToEndAsync();
             JsonElement accessConfig = data.ToObject<JsonElement>().GetProperty("accessConfig");
             JsonElement pxid = data.ToObject<JsonElement>().GetProperty("pxid");
@@ -108,9 +108,9 @@ namespace TEAMModelFunction
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                 if (result.result)
                 {
-                      teacher = result.content.ToObject<ScTeacher>();
+                      teacher = result.content;
                 }
-                return new OkObjectResult(teacher);
+                return new OkObjectResult(new {data= teacher });
             }
             catch (Exception ex)
             {

+ 2 - 1
TEAMModelOS.SDK/DI/HttpTrigger/HttpTrigger.cs

@@ -63,7 +63,8 @@ namespace TEAMModelOS.SDK.DI
             if (responseMessage.StatusCode == HttpStatusCode.OK)
             {
                 string Content= await responseMessage.Content.ReadAsStringAsync();
-                return (200, Content);
+                Content.ToObject<JsonElement>().TryGetProperty("data", out JsonElement content);
+                return (200, $"{content}");
             }
             else
             {

+ 2 - 1
TEAMModelOS.SDK/Models/Cosmos/Student/Student.cs

@@ -17,7 +17,8 @@ namespace TEAMModelOS.SDK.Models
         public string salt { get; set; }
         public int year { get; set; }
         //座位号
-        public string no { get; set; }
+        public string no { get; set; }   //座位号
+        public string irs { get; set; }
         //绑定班级Id
         public string classId { get; set; }
         //分组信息

+ 15 - 4
TEAMModelOS.SDK/Models/Service/GroupListService.cs

@@ -486,7 +486,20 @@ namespace TEAMModelOS.SDK.Models
                               requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Class-{school}") }))
                     {
                         ///行政班(学生搜寻classId动态返回)class
-                        List<RMember> smembers = students.Where(x => x.classId.Equals(item.id)).Select(y => new RMember { id = y.id, code = school, name = y.name, type = 2, picture = y.picture, no = y.no,classId=y.classId,groupId=y.groupId,groupName=y.groupName }).ToList();
+                        List<RMember> smembers = students.Where(x => x.classId.Equals(item.id))
+                            .Select(y => new RMember 
+                            {
+                                id = y.id,
+                                code = school, 
+                                name = y.name,
+                                type = 2, 
+                                picture = y.picture,
+                                no = y.no,
+                                classId=y.classId,
+                                groupId=y.groupId,
+                                groupName=y.groupName ,
+                                irs=y.irs,
+                            }).ToList();
                         members.AddRange(smembers);
                        
                         RGroupList group = new RGroupList
@@ -531,7 +544,7 @@ namespace TEAMModelOS.SDK.Models
                         var ids = item.list.Select(x => x.id).ToList();
                         if (ids.IsNotEmpty())
                         {
-                            StringBuilder stuSql = new StringBuilder($"SELECT distinct c.name,c.id,c.code,c.picture,c.no,c.classId FROM c ");
+                            StringBuilder stuSql = new StringBuilder($"SELECT distinct c.name,c.id,c.code,c.picture,c.no,c.irs,c.classId FROM c ");
                             string insql = string.Join(",", ids.Select(x => $"'{x}'"));
                             stuSql.Append($"where  c.id in ({insql})");
                             await foreach (var student in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<Student>(queryText: stuSql.ToString(),
@@ -612,7 +625,6 @@ namespace TEAMModelOS.SDK.Models
                     var student = studentsData.Find(y => y.id.Equals(x.id) && y.schoolId.Equals(x.code));
                     x.name = student?.name;
                     x.picture = student?.picture;
-                    x.no = student?.no;
                     x.classId = student?.classId;
                 });
                 var mbs = tmdids;
@@ -638,7 +650,6 @@ namespace TEAMModelOS.SDK.Models
                         var student = students.Find(t => t.id.Equals(y.id)&& t.code.Equals(y.code));
                         y.name = student?.name;
                         y.picture = student?.picture;
-                        y.no = student?.no;
                         y.classId = student?.classId;
                     }
                 }));

+ 11 - 6
TEAMModelOS.SDK/Models/Service/Third/ScApisService.cs

@@ -51,19 +51,24 @@ namespace TEAMModelOS.SDK
     {
         public string diagnosisName { get; set; }
         public string DiagnosisDicNum { get; set; }
-        public string ID { get; set; }
+        public int ID { get; set; }
     }
     public class ScTeacher
     {
-        public string PXID { get; set; }
-        public string TID { get; set; }
+        public int PXID { get; set; }
+        public int TID { get; set; }
         public string TeacherName { get; set; }
-        public string SchoolID { get; set; }
+        public int SchoolID { get; set; }
         public string SchoolName { get; set; }
-        public string ProjectID { get; set; }
-        public string ProjectItemID { get; set; }
+        public int ProjectID { get; set; }
+        public int ProjectItemID { get; set; }
         public string ProjectTitle { get; set; }
         public string ProjectItemTitle { get; set; }
+        public string CityID { get; set; }
+        public string DistrictID { get; set; }
+        public string CityName { get; set; }
+        public string DisName { get; set; }
+        public string Account { get; set; }
     }
     public class ScAccessConfig
     {

+ 1 - 1
TEAMModelOS.SDK/Models/Service/Third/ThirdService.cs

@@ -63,7 +63,7 @@ namespace TEAMModelOS.SDK.Models
             List<Ability> abilities = null;
             if (abilityNos.IsNotEmpty()) {
                 abilities = new List<Ability>();
-                StringBuilder sql = new StringBuilder($"select value(c) from c where c.no in {string.Join(",", abilityNos.Select(x => $"'{x}'"))}");
+                StringBuilder sql = new StringBuilder($"select value(c) from c where c.no in ({string.Join(",", abilityNos.Select(x => $"'{x}'"))})");
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Normal")
                          .GetItemQueryIterator<Ability>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{standard}") }))
                 {

+ 3 - 0
TEAMModelOS/Controllers/Research/AbilityStatisticsController.cs

@@ -1601,6 +1601,9 @@ namespace TEAMModelOS.Controllers.Research
                     if (abilitys != null)
                     {
                         abilitys.ForEach(x => { x.currency = 1; });
+                        currencyAb1 = abilitys;
+                        //同时处理 原有设置必修的能力点。
+                        hadSubs.FindAll(x => x.currency == 1).ForEach(y => { y.currency = 0; });
                     }
                     else {
                         currencyAb1 = null;

+ 1 - 0
TEAMModelOS/Controllers/School/GroupListController.cs

@@ -147,6 +147,7 @@ namespace TEAMModelOS.Controllers
                 type = 2;
                 Student student = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemAsync<Student>(userid, new PartitionKey($"Base-{school}"));
                 no = student.no;
+                
             }
             if ($"{scope}".Equals(Constant.ScopeTmdUser))
             {

+ 5 - 1
TEAMModelOS/Controllers/School/StudentController.cs

@@ -173,7 +173,11 @@ namespace TEAMModelOS.Controllers
                         return this.Ok(new { code = $"Base-{schoolId.GetString()}", ids = sucDelIds });
                     case "remove":
                         //將學生基本資料內的classId、no、groupId及groupName寫入null
-                        webStudents = request.GetProperty("students").ToObject<List<Student>>();
+                        List<string> stus = request.GetProperty("students").ToObject<List<string>>();
+                        webStudents = new List<Student>();
+                        foreach (string idstu in stus) {
+                            webStudents.Add(new Student { id= idstu, code=$"Base-{schoolId}"});
+                        }
                         preStudents = await GeStudentData(schoolId.GetString(), webStudents);
                         (List<string> studs, List<string> nonexistentIds, List<string> errorIds) retRemove = await removeStudentClassInfo(schoolId.GetString(), request.GetProperty("students").EnumerateArray());
                         await CheckStudent(schoolId.GetString(), webStudents, "remove", preStudents);

+ 2 - 1
TEAMModelOS/Controllers/Third/ScController.cs

@@ -207,6 +207,7 @@ namespace TEAMModelOS.Controllers.Third
         [AllowAnonymous]
         public async Task<IActionResult> Sso([FromQuery] ScSSO sso,string path)
         {
+            
             if (path.Equals("sc"))
             {
                 path = $"scpjx";
@@ -235,7 +236,7 @@ namespace TEAMModelOS.Controllers.Third
             Dictionary<string, object> dict = new Dictionary<string, object> { { "accessConfig", accessConfig }, { "pxid",sso.Pxid },{ "tid",sso.tid} };
             (int status,string json ) =await  _httpTrigger.RequestHttpTrigger(dict, _option.Location, "GetSingleTeacherByProject");
             if (status == 200) {
-                ScTeacher scTeacher= json.ToObject<ScTeacher>();
+                ScTeacher scTeacher= json.ToObject<ScTeacher>( new JsonSerializerOptions { PropertyNameCaseInsensitive = false });
                 if (scTeacher != null && scTeacher.PXID.Equals(sso.Pxid) && scTeacher.TID.Equals(sso.tid)) {
                     
                 }

+ 1 - 1
TEAMModelOS/Controllers/XTest/FixDataController.cs

@@ -572,7 +572,7 @@ namespace TEAMModelOS.Controllers
                         id="sqtszx",
                         name="四川师范大学附属青台山中学",
                         admin="1530606136",
-                        period=new List<string>(){ "初中"},
+                        period=new List<string>(){ "初中","高中"},
                         size=100,
                     }
                 };