CrazyIter_Bin hace 3 años
padre
commit
4a9210a26d

+ 16 - 17
TEAMModelAPI/Controllers/School/CourseController.cs

@@ -359,7 +359,6 @@ namespace TEAMModelAPI.Controllers
                             repeatSchedules.Add(y);
                             repeatRoomSchedules.Add(y);
                         });
-
                     }
                     else
                     {
@@ -374,24 +373,24 @@ namespace TEAMModelAPI.Controllers
                         }
                     }
                 });
-                schedules.RemoveAll(x => repeatListSchedules.Contains(x));
-                schedules.RemoveAll(x => repeatRoomSchedules.Contains(x));
-                schedules.RemoveAll(x => repeatTeahcerSchedules.Contains(x));
-                ////处理教室和教学班名单,教师,同时存在且相同,重复的课堂
-                //var stulist_schedules_hasRoom = saveSchedules.Where(x =>  !string.IsNullOrWhiteSpace(x.stulist) &&  !string.IsNullOrWhiteSpace(x.room));
-                ////处理教学班名单,教师,同时存在且相同,重复的课堂
-                //var stulist_schedules_noRoom = stulist_schedules.Where(x => !string.IsNullOrWhiteSpace(x.stulist) &&  string.IsNullOrWhiteSpace(x.room));
+                //移除可能重复的(导入数据自检不能通过的)。剩下的是可以保存的,但是需要再次对数据库已经有的排课信息进行去重。
+                schedules.RemoveAll(x => repeatSchedules.Contains(x));
 
-                ////处理教室和行政班名单,教师,同时存在且相同,重复的课堂
-                //var classId_schedules_hasRoom = classId_schedules.Where(x => !string.IsNullOrWhiteSpace(x.classId) && !string.IsNullOrWhiteSpace(x.room));
-                ////处理行政班名单,教师,同时存在且相同,重复的课堂
-                //var classId_schedules_noRoom = classId_schedules.Where(x => !string.IsNullOrWhiteSpace(x.classId)  &&  string.IsNullOrWhiteSpace(x.room));
-                return Ok(new { 
-                    notinCourseIds ,//课程不存在的排课
-                    noListSchedules,//没有教学名单的排课,包含行政班,教学班
-                    repeatTeahcerSchedules,//教师在同一课时有冲突的排课
-                    repeatListSchedules,//行政班或教学班在同一课时段有冲突的排课
 
+                schedules.ToList().ForEach(schedule => {
+                    
+                });
+                return Ok(new
+                {
+                    importCheckError = new
+                    {
+                        notinCourseIds,//课程不存在的排课
+                        noListSchedules,//没有教学名单的排课,包含行政班,教学班
+                        repeatTeahcerSchedules,//教师在同一课时有冲突的排课
+                        repeatListSchedules,//行政班或教学班在同一课时段有冲突的排课}
+                    },
+                    databaseCheckError=new { 
+                    }
                 });
             }
             else { 

+ 15 - 2
TEAMModelOS/Controllers/Both/ShareController.cs

@@ -151,7 +151,20 @@ namespace TEAMModelOS.Controllers
                                         from = $"ies5:{_option.Location}:{request.school}",
                                         to = new List<string>() { x.code.Replace("Share-", "").Replace($"{x.type}-", "") },
                                         label = $"{x.type}_syllabus",
-                                        body = new { location = _option.Location, biz = x.type, tmdid = x.issuer, tmdname = x.issuerName, schoolcode = $"{request.school}", schoolname = $"{schname}", status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
+                                        body = new {
+                                            location = _option.Location,
+                                            biz = x.type,
+                                            tmdid = x.issuer,
+                                            tmdname = x.issuerName,
+                                            schoolcode = $"{request.school}",
+                                            schoolname = $"{schname}",
+                                            sid = x.id,
+                                            sname = x.syllabusName,
+                                            vid = x.volumeId,
+                                            vname = x.volumeName,
+                                            status = 1,
+                                            time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
+                                        }.ToJsonString(),
                                         expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
                                     };
                                     var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");
@@ -231,7 +244,7 @@ namespace TEAMModelOS.Controllers
                                         from = $"ies5:{_option.Location}:private",
                                         to = new List<string>() { x.code.Replace("Share-", "").Replace($"{x.type}-", "") },
                                         label = $"{x.type}_syllabus",
-                                        body = new { location = _option.Location, biz = x.type, tmdid = x.issuer, tmdname = x.issuerName, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
+                                        body = new { location = _option.Location, biz = x.type, tmdid = x.issuer, tmdname = x.issuerName, sid = x.id, sname = x.syllabusName, vid = x.volumeId, vname = x.volumeName, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
                                         expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
                                     };
                                     var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");

+ 24 - 21
TEAMModelOS/Controllers/Common/HomeworkController.cs

@@ -682,26 +682,29 @@ namespace TEAMModelOS.Controllers.Learn
                                         }
                                         
                                         await StatisticsService.SendServiceBus( ($"{standard}", new List<string> { $"{one.id}" }, $"{school}", new List<string>() { StatisticsService.OfflineRecord },0)  , _configuration, _serviceBus, client);
-                                        string bizcode = "submitanswer";
-                                        if (!string.IsNullOrWhiteSpace(homework.creatorId)) {
-                                            Notification notification = new Notification
-                                            {
-                                                hubName = "hita",
-                                                type = "msg",
-                                                from = $"ies5:{_option.Location}:private",
-                                                to = new List<string> { homework.creatorId },
-                                                label = $"{bizcode}_homework",
-                                                body = new { location = _option.Location, biz = bizcode, tmdid = one.id, tmdname = one.name, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
-                                                expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
-                                            };
-                                            var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");
-                                            var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
-                                            var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
-                                            var location = _option.Location;
-                                            var code = await _notificationService.SendNotification(clientID, clientSecret, location, url, notification);
-                                        }
-                                        
-                                    } 
+                                        //string sql = $"select value(c) from c where c.workId='{_id}'";
+                                        //await  foreach(var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS,Constant.Common).GetItemQueryIterator<Study>(queryText:sql,requestOptions:new QueryRequestOptions { PartitionKey= new PartitionKey($"Study-{homework.}")}))
+                                        //JJ 说 20223231139 暂不处理研修活动类型的作业
+                                        //string bizcode = "submitanswer";
+                                        //if (!string.IsNullOrWhiteSpace(homework.creatorId)) {
+                                        //    Notification notification = new Notification
+                                        //    {
+                                        //        hubName = "hita",
+                                        //        type = "msg",
+                                        //        from = $"ies5:{_option.Location}:private",
+                                        //        to = new List<string> { homework.creatorId },
+                                        //        label = $"{bizcode}_homework",
+                                        //        body = new { location = _option.Location, biz = bizcode, tmdid = one.id, tmdname = one.name, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
+                                        //        expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
+                                        //    };
+                                        //    var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");
+                                        //    var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
+                                        //    var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
+                                        //    var location = _option.Location;
+                                        //    var code = await _notificationService.SendNotification(clientID, clientSecret, location, url, notification);
+                                        //}
+
+                                        } 
                                 }
                             }
 
@@ -752,7 +755,7 @@ namespace TEAMModelOS.Controllers.Learn
                                         from = $"ies5:{_option.Location}:private",
                                         to = new List<string> { homework.creatorId },
                                         label = $"{bizcode}_homework",
-                                        body = new { location = _option.Location, biz = bizcode, tmdid = userid, tmdname = name, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
+                                        body = new { location = _option.Location, biz = bizcode, tmdid = userid, tmdname = name,sid= homework.id ,sname = homework.name, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
                                         expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
                                     };
                                     var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");