|
@@ -1,14 +1,6 @@
|
|
|
-using Azure.Storage.Blobs.Models;
|
|
|
-using DocumentFormat.OpenXml.Office2010.Excel;
|
|
|
-using HTEX.Lib.ETL;
|
|
|
-using HTEX.Lib.ETL.Lesson;
|
|
|
+using HTEX.Lib.ETL.Lesson;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.Azure.Cosmos;
|
|
|
-using Microsoft.OData.UriParser;
|
|
|
-using System.CodeDom;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.IO;
|
|
|
-using System.Runtime.InteropServices;
|
|
|
using System.Text.Json;
|
|
|
using System.Xml;
|
|
|
using TEAMModelOS.SDK;
|
|
@@ -16,9 +8,7 @@ using TEAMModelOS.SDK.DI;
|
|
|
using TEAMModelOS.SDK.Extension;
|
|
|
using TEAMModelOS.SDK.Helper.Common.FileHelper;
|
|
|
using TEAMModelOS.SDK.Models;
|
|
|
-using TEAMModelOS.SDK.Models.Cosmos.BI;
|
|
|
using TEAMModelOS.SDK.Models.Cosmos.Common;
|
|
|
-using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
|
|
|
|
|
|
namespace HTEX.DataETL.Controllers
|
|
|
{
|
|
@@ -31,7 +21,7 @@ namespace HTEX.DataETL.Controllers
|
|
|
private readonly AzureStorageFactory _azureStorage;
|
|
|
private readonly IConfiguration _configuration;
|
|
|
private readonly IWebHostEnvironment _webHostEnvironment;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public LessonRecordController(ILogger<LessonRecordController> logger, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage
|
|
|
, IConfiguration configuration, IWebHostEnvironment environment)
|
|
@@ -41,7 +31,7 @@ namespace HTEX.DataETL.Controllers
|
|
|
_azureStorage = azureStorage;
|
|
|
_configuration = configuration;
|
|
|
_webHostEnvironment = environment;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
[HttpPost("process-local")]
|
|
|
public async Task<IActionResult> ProcessLocal(JsonElement json)
|
|
@@ -50,7 +40,7 @@ namespace HTEX.DataETL.Controllers
|
|
|
string? id = json.GetProperty("id").GetString();
|
|
|
if (!string.IsNullOrWhiteSpace(id))
|
|
|
{
|
|
|
- string? lessonPath= _configuration.GetValue<string>("LessonPath");
|
|
|
+ string? lessonPath = _configuration.GetValue<string>("LessonPath");
|
|
|
string? path = $"{lessonPath}\\locals\\{id}";
|
|
|
var files = FileHelper.ListAllFiles(path);
|
|
|
// var sampleJson =System.IO. File.ReadAllTextAsync(path);
|
|
@@ -134,23 +124,23 @@ namespace HTEX.DataETL.Controllers
|
|
|
if (lessonBase!=null && timeLineData!=null)
|
|
|
{
|
|
|
studentLessonDatas = localStudents.ToJsonString().ToObject<List<StudentLessonData>>();
|
|
|
- studentLessonDatas = LessonETLService.GetBaseInfo( lessonBase!, studentLessonDatas, id);
|
|
|
+ studentLessonDatas = LessonETLService.GetBaseInfo(lessonBase!, studentLessonDatas, id);
|
|
|
studentLessonDatas = LessonETLService.GetIRSData(lessonBase, timeLineData, irsDatas, studentLessonDatas, examDatas, id);
|
|
|
- studentLessonDatas = LessonETLService.GetCoworkData(lessonBase, timeLineData, coworkDatas, studentLessonDatas,id);
|
|
|
+ studentLessonDatas = LessonETLService.GetCoworkData(lessonBase, timeLineData, coworkDatas, studentLessonDatas, id);
|
|
|
studentLessonDatas = LessonETLService.GetExamData(lessonBase, timeLineData, examDatas, studentLessonDatas, Constant.objectiveTypes, id);
|
|
|
studentLessonDatas = LessonETLService.GetSmartRatingData(lessonBase, timeLineData, smartRatingDatas, studentLessonDatas, id);
|
|
|
- studentLessonDatas = LessonETLService.GetTaskData(lessonBase, timeLineData, taskDatas, studentLessonDatas,id);
|
|
|
- var pickupData = LessonETLService.GetPickupData(lessonBase, timeLineData, studentLessonDatas, id);
|
|
|
+ studentLessonDatas = LessonETLService.GetTaskData(lessonBase, timeLineData, taskDatas, studentLessonDatas, id);
|
|
|
+ var pickupData = LessonETLService.GetPickupData(lessonBase, timeLineData, studentLessonDatas, id);
|
|
|
studentLessonDatas= pickupData.studentLessonDatas;
|
|
|
|
|
|
await System.IO.File.WriteAllTextAsync(Path.Combine(path, $"student-analysis.json"), studentLessonDatas.ToJsonString());
|
|
|
string jsons = await System.IO.File.ReadAllTextAsync($"{lessonPath}\\analysis\\analysis.json");
|
|
|
LessonDataAnalysisCluster lessonDataAnalysis = jsons.ToObject<LessonDataAnalysisCluster>();
|
|
|
- var lessonItems= LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
|
|
|
+ var lessonItems = LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
|
|
|
XmlDocument xmlDocument = new XmlDocument();
|
|
|
- var runtimePath= System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
|
|
+ var runtimePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
|
|
xmlDocument.Load($"{runtimePath}\\summary.xml");
|
|
|
- await LessonETLService. ExportToExcelLocal(lessonItems, $"{path}\\analysis.xlsx", xmlDocument);
|
|
|
+ await LessonETLService.ExportToExcelLocal(lessonItems, $"{path}\\analysis.xlsx", xmlDocument);
|
|
|
}
|
|
|
}
|
|
|
return Ok();
|
|
@@ -174,7 +164,7 @@ namespace HTEX.DataETL.Controllers
|
|
|
{
|
|
|
string stujson = await System.IO.File.ReadAllTextAsync(stu);
|
|
|
var studentSemester = stujson.ToObject<StudentSemesterRecord>();
|
|
|
- await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(studentSemester,new PartitionKey(studentSemester.code));
|
|
|
+ await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(studentSemester, new PartitionKey(studentSemester.code));
|
|
|
index++;
|
|
|
}
|
|
|
return Ok();
|
|
@@ -192,117 +182,122 @@ namespace HTEX.DataETL.Controllers
|
|
|
string? pathAnalysis = $"{lessonBasePath}\\analysis";
|
|
|
string jsons = await System.IO.File.ReadAllTextAsync($"{pathAnalysis}\\analysis.json");
|
|
|
LessonDataAnalysisCluster lessonDataAnalysis = jsons.ToObject<LessonDataAnalysisCluster>();
|
|
|
- List<string> filesLessons = FileHelper.ListAllFiles(pathLessons, "-local.json");
|
|
|
+ List<string> filesLessons = FileHelper.ListAllFiles(pathLessons, "-local.json");
|
|
|
var runtimePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
|
|
XmlDocument xmlDocument = new XmlDocument();
|
|
|
xmlDocument.Load($"{runtimePath}\\summary.xml");
|
|
|
List<StudentSemesterRecord> students = new List<StudentSemesterRecord>();
|
|
|
List<School> schools = new List<School>();
|
|
|
- await Parallel.ForEachAsync(filesLessons, async (fileLesson, _) =>
|
|
|
- {
|
|
|
- try {
|
|
|
- string localjson = await System.IO.File.ReadAllTextAsync(fileLesson);
|
|
|
- var lessonLocal = localjson.ToObject<LessonLocal>();
|
|
|
- List<StudentLessonData> studentLessonDatas = lessonLocal.studentLessonDatas.ToJsonString().ToObject<List<StudentLessonData>>();
|
|
|
- studentLessonDatas = LessonETLService.GetBaseInfo(lessonLocal.lessonBase!, studentLessonDatas, lessonLocal?.lessonRecord?.id);
|
|
|
- studentLessonDatas = LessonETLService.GetIRSData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.irsDatas, studentLessonDatas, lessonLocal.examDatas, lessonLocal?.lessonRecord?.id);
|
|
|
- studentLessonDatas = LessonETLService.GetCoworkData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.coworkDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
- studentLessonDatas = LessonETLService.GetExamData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.examDatas, studentLessonDatas, Constant.objectiveTypes, lessonLocal.lessonRecord.id);
|
|
|
- studentLessonDatas = LessonETLService.GetSmartRatingData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.smartRatingDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
- studentLessonDatas = LessonETLService.GetTaskData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.taskDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
- var pickupData = LessonETLService.GetPickupData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
- studentLessonDatas= pickupData.studentLessonDatas;
|
|
|
- string owner = lessonLocal.lessonRecord.scope.Equals("school") ? lessonLocal.lessonRecord.school : lessonLocal.lessonRecord.tmdid;
|
|
|
- var lessonItems = LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
|
|
|
- if (lessonLocal.lessonRecord.scope.Equals("school")&& !string.IsNullOrWhiteSpace(lessonLocal.lessonRecord.school))
|
|
|
- {
|
|
|
- var school = schools.Find(x => x.id.Equals(lessonLocal.lessonRecord.school));
|
|
|
- if (school==null)
|
|
|
- {
|
|
|
- ResponseMessage response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemStreamAsync(lessonLocal.lessonRecord.school, new PartitionKey("Base"));
|
|
|
- if (response.IsSuccessStatusCode)
|
|
|
- {
|
|
|
- school = JsonDocument.Parse(response.Content).RootElement.ToObject<School>();
|
|
|
- }
|
|
|
- }
|
|
|
- string? periodId = !string.IsNullOrWhiteSpace(lessonLocal.lessonRecord.periodId) ? lessonLocal.lessonRecord.periodId : school.period.FirstOrDefault()?.id;
|
|
|
- var period = school.period.Find(x => x.id.Equals(periodId));
|
|
|
- var semester = SchoolService.GetSemester(period, lessonLocal.lessonRecord.startTime);
|
|
|
- string pre_id = $"{semester.studyYear}-{semester.currSemester.id}";
|
|
|
- string code = $"StudentSemesterRecord-{school.id}";
|
|
|
- foreach (var studentLessonData in studentLessonDatas)
|
|
|
- {
|
|
|
- StudentSemesterRecord studentSemester = students.Find(x => x.stuid.Equals(studentLessonData.id) &&x.id.Equals($"{pre_id}-{studentLessonData.id}") && x.code.Equals(code));
|
|
|
- if (studentSemester==null)
|
|
|
- {
|
|
|
- studentSemester= new StudentSemesterRecord
|
|
|
- {
|
|
|
- id= $"{pre_id}-{studentLessonData.id}",
|
|
|
- code=code,
|
|
|
- stuid= studentLessonData.id,
|
|
|
- userType=Constant.ScopeStudent,
|
|
|
- school=school.id,
|
|
|
- studyYear=semester.studyYear,
|
|
|
- semesterId=semester.currSemester.id,
|
|
|
- period= period?.id,
|
|
|
- pk="StudentSemesterRecord"
|
|
|
- };
|
|
|
- students.Add(studentSemester);
|
|
|
- }
|
|
|
- string lessonId = string.Empty;
|
|
|
- StuLesson lesson = new StuLesson()
|
|
|
- {
|
|
|
- id= lessonLocal.lessonRecord.id,
|
|
|
- time= lessonLocal.lessonRecord.startTime,
|
|
|
- attend=0
|
|
|
- };
|
|
|
- if (studentLessonData.cooperation>0 || studentLessonData.achieve>0|| studentLessonData.attitude>0 || studentLessonData.cowork>0 || studentLessonData.appraise>0)
|
|
|
- {
|
|
|
- lesson.attend=1;
|
|
|
+ // await Parallel.ForEachAsync(filesLessons, async (fileLesson, _) =>
|
|
|
+ foreach (var fileLesson in filesLessons)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string localjson = await System.IO.File.ReadAllTextAsync(fileLesson);
|
|
|
+ var lessonLocal = localjson.ToObject<LessonLocal>();
|
|
|
+ List<StudentLessonData> studentLessonDatas = lessonLocal.studentLessonDatas.ToJsonString().ToObject<List<StudentLessonData>>();
|
|
|
+ studentLessonDatas = LessonETLService.GetBaseInfo(lessonLocal.lessonBase!, studentLessonDatas, lessonLocal?.lessonRecord?.id);
|
|
|
+ studentLessonDatas = LessonETLService.GetIRSData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.irsDatas, studentLessonDatas, lessonLocal.examDatas, lessonLocal?.lessonRecord?.id);
|
|
|
+ studentLessonDatas = LessonETLService.GetCoworkData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.coworkDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
+ studentLessonDatas = LessonETLService.GetExamData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.examDatas, studentLessonDatas, Constant.objectiveTypes, lessonLocal.lessonRecord.id);
|
|
|
+ studentLessonDatas = LessonETLService.GetSmartRatingData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.smartRatingDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
+ studentLessonDatas = LessonETLService.GetTaskData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.taskDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
+ var pickupData = LessonETLService.GetPickupData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, studentLessonDatas, lessonLocal.lessonRecord.id);
|
|
|
+ studentLessonDatas= pickupData.studentLessonDatas;
|
|
|
+ string owner = lessonLocal.lessonRecord.scope.Equals("school") ? lessonLocal.lessonRecord.school : lessonLocal.lessonRecord.tmdid;
|
|
|
+ var lessonItems = LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
|
|
|
+ if (lessonLocal.lessonRecord.scope.Equals("school")&& !string.IsNullOrWhiteSpace(lessonLocal.lessonRecord.school))
|
|
|
+ {
|
|
|
+ var school = schools.Find(x => x.id.Equals(lessonLocal.lessonRecord.school));
|
|
|
+ if (school==null)
|
|
|
+ {
|
|
|
+ ResponseMessage response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemStreamAsync(lessonLocal.lessonRecord.school, new PartitionKey("Base"));
|
|
|
+ if (response.IsSuccessStatusCode)
|
|
|
+ {
|
|
|
+ school = JsonDocument.Parse(response.Content).RootElement.ToObject<School>();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ string? periodId = !string.IsNullOrWhiteSpace(lessonLocal.lessonRecord.periodId) ? lessonLocal.lessonRecord.periodId : school.period.FirstOrDefault()?.id;
|
|
|
+ var period = school.period.Find(x => x.id.Equals(periodId));
|
|
|
+ var semester = SchoolService.GetSemester(period, lessonLocal.lessonRecord.startTime);
|
|
|
+ string pre_id = $"{semester.studyYear}-{semester.currSemester.id}";
|
|
|
+ string code = $"StudentSemesterRecord-{school.id}";
|
|
|
+ foreach (var studentLessonData in studentLessonDatas)
|
|
|
+ {
|
|
|
+ StudentSemesterRecord studentSemester = students.Find(x => x.stuid.Equals(studentLessonData.id) &&x.id.Equals($"{pre_id}-{studentLessonData.id}") && x.code.Equals(code));
|
|
|
+ if (studentSemester==null)
|
|
|
+ {
|
|
|
+ studentSemester= new StudentSemesterRecord
|
|
|
+ {
|
|
|
+ id= $"{pre_id}-{studentLessonData.id}",
|
|
|
+ code=code,
|
|
|
+ stuid= studentLessonData.id,
|
|
|
+ userType=Constant.ScopeStudent,
|
|
|
+ school=school.id,
|
|
|
+ studyYear=semester.studyYear,
|
|
|
+ semesterId=semester.currSemester.id,
|
|
|
+ period= period?.id,
|
|
|
+ pk="StudentSemesterRecord"
|
|
|
+ };
|
|
|
+ students.Add(studentSemester);
|
|
|
+ }
|
|
|
+ string lessonId = string.Empty;
|
|
|
+ StuLesson lesson = new StuLesson()
|
|
|
+ {
|
|
|
+ id= lessonLocal.lessonRecord.id,
|
|
|
+ time= lessonLocal.lessonRecord.startTime,
|
|
|
+ attend=0
|
|
|
+ };
|
|
|
+ if (studentLessonData.cooperation>0 || studentLessonData.achieve>0|| studentLessonData.attitude>0 || studentLessonData.cowork>0 || studentLessonData.appraise>0)
|
|
|
+ {
|
|
|
+ lesson.attend=1;
|
|
|
|
|
|
- studentSemester.lessons.Add(new StuLessonLite
|
|
|
- {
|
|
|
- id=lessonLocal.lessonRecord.id,
|
|
|
- tmdid=lessonLocal.lessonRecord.tmdid,
|
|
|
- sid= lessonLocal.lessonRecord.subjectId,
|
|
|
- cid= lessonLocal.lessonRecord.courseId,
|
|
|
- hrate=studentLessonData.cooperation,
|
|
|
- crate=studentLessonData.achieve,
|
|
|
- trate=studentLessonData.attitude,
|
|
|
- xrate=studentLessonData.cowork,
|
|
|
- prate=studentLessonData.appraise
|
|
|
- });
|
|
|
- }
|
|
|
- else {
|
|
|
- if (studentLessonData.attend==1)
|
|
|
- {
|
|
|
- lesson.attend=1;
|
|
|
- }
|
|
|
- else {
|
|
|
- lesson.attend=0;
|
|
|
- }
|
|
|
- }
|
|
|
- studentSemester.les.Add(lesson);
|
|
|
+ studentSemester.lessons.Add(new StuLessonLite
|
|
|
+ {
|
|
|
+ id=lessonLocal.lessonRecord.id,
|
|
|
+ tmdid=lessonLocal.lessonRecord.tmdid,
|
|
|
+ sid= lessonLocal.lessonRecord.subjectId,
|
|
|
+ cid= lessonLocal.lessonRecord.courseId,
|
|
|
+ hrate=studentLessonData.cooperation,
|
|
|
+ crate=studentLessonData.achieve,
|
|
|
+ trate=studentLessonData.attitude,
|
|
|
+ xrate=studentLessonData.cowork,
|
|
|
+ prate=studentLessonData.appraise
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (studentLessonData.attend==1)
|
|
|
+ {
|
|
|
+ lesson.attend=1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lesson.attend=0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ studentSemester.les.Add(lesson);
|
|
|
// studentSemester.lessonIds.Add(lessonId);
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
// await LessonETLService.ExportToExcelAzureBlob(lessonItems, _azureStorage, owner, $"{lessonLocal.lessonRecord.id}/student-analysis.xlsx", xmlDocument);
|
|
|
// await _azureStorage.GetBlobContainerClient(owner).UploadFileByContainer(studentLessonDatas.ToJsonString(), "records", $"{lessonLocal.lessonRecord.id}/student-analysis.json");
|
|
|
- } catch (Exception ex)
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
throw new Exception($"{fileLesson}", ex);
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
string studentsPath = $"{lessonBasePath}\\students";
|
|
|
- foreach (var stu in students)
|
|
|
+ foreach (var stu in students)
|
|
|
{
|
|
|
await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(stu, new PartitionKey(stu.code));
|
|
|
// string path = $"{studentsPath}\\{stu.school}\\{stu.studyYear}\\{stu.semesterId}";
|
|
|
// if (!Directory.Exists(path))
|
|
|
{
|
|
|
- // Directory.CreateDirectory(path);
|
|
|
+ // Directory.CreateDirectory(path);
|
|
|
}
|
|
|
- // await System.IO.File.WriteAllTextAsync($"{path}\\{stu.stuid}.json", stu.ToJsonString());
|
|
|
+ // await System.IO.File.WriteAllTextAsync($"{path}\\{stu.stuid}.json", stu.ToJsonString());
|
|
|
}
|
|
|
string schoolsPath = $"{lessonBasePath}\\schools";
|
|
|
await System.IO.File.WriteAllTextAsync($"{schoolsPath}\\school.json", schools.ToJsonString());
|
|
@@ -317,9 +312,9 @@ namespace HTEX.DataETL.Controllers
|
|
|
/// <param name="json"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("process-history")]
|
|
|
- public async Task<IActionResult> ProcessHistory(JsonElement json)
|
|
|
+ public async Task<IActionResult> ProcessHistory(JsonElement json)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
List<string> localIds = new List<string>();
|
|
|
string? lessonBasePath = _configuration.GetValue<string>("LessonPath");
|
|
|
string? pathLessons = $"{lessonBasePath}\\lessons";
|
|
@@ -337,7 +332,8 @@ namespace HTEX.DataETL.Controllers
|
|
|
List<LessonDataAnalysisMonth> lessonDataAnalysisMonths = new List<LessonDataAnalysisMonth>();
|
|
|
var filesAnalysis = FileHelper.ListAllFiles(pathAnalysis);
|
|
|
long stime = 1690819200000;//2023-08-01 00:00:00
|
|
|
- foreach (var file in filesAnalysis) {
|
|
|
+ foreach (var file in filesAnalysis)
|
|
|
+ {
|
|
|
//读取每月的数据
|
|
|
if (file.EndsWith("-m-analysis.json"))
|
|
|
{
|
|
@@ -346,7 +342,8 @@ namespace HTEX.DataETL.Controllers
|
|
|
lessonDataAnalysisMonths.Add(lessonDataAnalysis);
|
|
|
}
|
|
|
}
|
|
|
- if (lessonDataAnalysisMonths.IsNotEmpty()) {
|
|
|
+ if (lessonDataAnalysisMonths.IsNotEmpty())
|
|
|
+ {
|
|
|
var maxUpdateTime = lessonDataAnalysisMonths.Max(x => x.updateTime);
|
|
|
if (maxUpdateTime>0)
|
|
|
{
|
|
@@ -370,7 +367,7 @@ namespace HTEX.DataETL.Controllers
|
|
|
{
|
|
|
force= _force.GetBoolean();
|
|
|
}
|
|
|
- // if (loadLocal ||force)
|
|
|
+ // if (loadLocal ||force)
|
|
|
{
|
|
|
List<LessonRecord> lessonRecords = new List<LessonRecord>();
|
|
|
var resultSchool = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School)
|
|
@@ -431,11 +428,11 @@ namespace HTEX.DataETL.Controllers
|
|
|
{
|
|
|
techCounts.Add(item);
|
|
|
}
|
|
|
- LessonETLService. GenAnalysisData(pathAnalysis, newest, techCounts);
|
|
|
+ LessonETLService.GenAnalysisData(pathAnalysis, newest, techCounts);
|
|
|
}
|
|
|
return Ok(new { yearMonth });
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|