|
@@ -1,4 +1,4 @@
|
|
|
-using System;
|
|
|
+锘縰sing System;
|
|
|
using System.Threading.Tasks;
|
|
|
using Azure.Messaging.ServiceBus;
|
|
|
using DinkToPdf.Contracts;
|
|
@@ -98,11 +98,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()\n{ex.Message}\n{ex.StackTrace}\n\n{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()\n{ex.Message}\n{ex.StackTrace}\n\n{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -138,11 +138,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -179,11 +179,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -220,11 +220,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -261,11 +261,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -303,11 +303,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -345,11 +345,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Art()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Art()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Art()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Art()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -385,11 +385,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -419,12 +419,12 @@ namespace TEAMModelOS.Function
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
|
|
|
List<TeacherTrain> trains = new List<TeacherTrain>();
|
|
|
- //redis锁
|
|
|
+ //redis锁
|
|
|
bool lockKey = await _azureRedis.GetRedisClient(8).KeyExistsAsync($"Train:Statistics:Lock:{data.areaId}");
|
|
|
if (!lockKey)
|
|
|
{
|
|
|
await _azureRedis.GetRedisClient(8).SetAddAsync($"Train:Statistics:Lock:{data.areaId}", new RedisValue(data.areaId));
|
|
|
- DateTime minutes = DateTime.UtcNow.AddMinutes(15); //15分钟
|
|
|
+ DateTime minutes = DateTime.UtcNow.AddMinutes(15); //15鍒嗛挓
|
|
|
await _azureRedis.GetRedisClient(8).KeyExpireAsync($"Train:Statistics:Lock:{data.areaId}", minutes);
|
|
|
Area area = await client.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<Area>($"{data.areaId}", new PartitionKey("Base-Area"));
|
|
|
AreaSetting setting = null;
|
|
@@ -477,7 +477,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-TeacherTrainChange\n{ex.Message}\n{ex.StackTrace}\n\n{message.Body}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-TeacherTrainChange\n{ex.Message}\n{ex.StackTrace}\n\n{message.Body}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -485,7 +485,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
|
- /// 完善课程变更,StuListChange, originCode是学校编码 则表示名单是学校自定义名单,如果是tmdid则表示醍摩豆的私有名单,scope=school,private。
|
|
|
+ /// 完善课程变更,StuListChange, originCode是学校编码 则表示名单是学校自定义名单,如果是tmdid则表示醍摩豆的私有名单,scope=school,private。
|
|
|
/// </summary>
|
|
|
/// <data msg>
|
|
|
/// CourseChange
|
|
@@ -509,8 +509,8 @@ namespace TEAMModelOS.Function
|
|
|
|
|
|
_backgroundWorkerQueue.QueueBackgroundWorkItem(async task => {
|
|
|
|
|
|
- //await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-名单成员变更-GroupChange\n{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
- //await _dingDing.SendBotMsg($"名单变化{msg}", GroupNames.成都开发測試群組);
|
|
|
+ //await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-名单成员变更-GroupChange\n{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ //await _dingDing.SendBotMsg($"名单变化{msg}", GroupNames.成都开发測試群組);
|
|
|
|
|
|
int add = groupChange.tmdjoin.Count-groupChange.tmdleave.Count+groupChange.stujoin.Count-groupChange.stuleave.Count;
|
|
|
if (groupChange.scope.Equals("private") && (groupChange.type.Equals("student") || groupChange.type.Equals("class") || groupChange.type.Equals("teach")))
|
|
@@ -521,39 +521,39 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new Accumulate { client=groupChange.client, count=add, id= groupChange.listid, scope="school", key= "grouplist", name=groupChange.name, target=groupChange.school });
|
|
|
}
|
|
|
- //名单变动修改学生课程关联信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓璇剧▼鍏宠仈淇℃伅
|
|
|
//await StuListService.FixStuCourse(client, stuListChange);
|
|
|
- //Vote投票 Survey问卷 Exam评测 Learn学习活动 Homework作业活动
|
|
|
- //名单变动修改学生问卷关联信息
|
|
|
+ //Vote鎶曠エ Survey闂�嵎 Exam璇勬祴 Learn瀛︿範娲诲姩 Homework浣滀笟娲诲姩
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓闂�嵎鍏宠仈淇℃伅
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "Survey");
|
|
|
- //名单变动修改学生投票关联信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓鎶曠エ鍏宠仈淇℃伅
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "Vote");
|
|
|
- //名单变动修改学生评测关联信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓璇勬祴鍏宠仈淇℃伅
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "Exam");
|
|
|
- //名单变动修改学生研修关联信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓鐮斾慨鍏宠仈淇℃伅
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "Study");
|
|
|
- //名单变动修改学生简易评测关联信息
|
|
|
+ //名单变动修改学生简易评测关联信息
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "ExamLite");
|
|
|
- //名单变动修改学生作业活动信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓浣滀笟娲诲姩淇℃伅
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "Homework");
|
|
|
- //名单变动修改学生艺术评价活动信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼瀛︾敓鑹烘湳璇勪环娲诲姩淇℃伅
|
|
|
//await IESActivityService.FixActivity(client, _dingDing, groupChange, "Art");
|
|
|
- //TODO学习活动
|
|
|
+ //TODO瀛︿範娲诲姩
|
|
|
//await FixActivity(client, stuListChange, "Learn");
|
|
|
if (groupChange.type == null || !groupChange.type.Equals("research") || !groupChange.type.Equals("yxtrain") || !groupChange.type.Equals("activity"))
|
|
|
{
|
|
|
- //课程名单变动修改学生课程关联信息
|
|
|
+ //璇剧▼鍚嶅崟鍙樺姩淇�敼瀛︾敓璇剧▼鍏宠仈淇℃伅
|
|
|
// await IESActivityService.FixStuCourse(client, _dingDing, groupChange);
|
|
|
- //名单变动修改课例关联信息
|
|
|
+ //鍚嶅崟鍙樺姩淇�敼璇句緥鍏宠仈淇℃伅
|
|
|
//await ActivityService.FixLessonRecord(client, _dingDing, groupChange);
|
|
|
}
|
|
|
if (groupChange.type.Equals("class") || groupChange.type.Equals("teach") || groupChange.type.Equals("student"))
|
|
|
{
|
|
|
await _httpTrigger.RequestHttpTrigger(new { data = groupChange }, Environment.GetEnvironmentVariable("Option:Location"), "webhook/group-member-change");
|
|
|
if (groupChange.stujoin.Count > 0)
|
|
|
- await BIStats.SetTypeAddStats(client, _dingDing, groupChange.school, "Student", groupChange.stujoin.Count);//BI统计增/减量
|
|
|
+ await BIStats.SetTypeAddStats(client, _dingDing, groupChange.school, "Student", groupChange.stujoin.Count);//BI统计增/减量
|
|
|
if (groupChange.stuleave.Count > 0)
|
|
|
- await BIStats.SetTypeAddStats(client, _dingDing, groupChange.school, "Student", -groupChange.stuleave.Count);//BI统计增/减量
|
|
|
+ await BIStats.SetTypeAddStats(client, _dingDing, groupChange.school, "Student", -groupChange.stuleave.Count);//BI统计增/减量
|
|
|
}
|
|
|
if ((groupChange.type.Equals("class") || groupChange.type.Equals("teach") || groupChange.type.Equals("student")) && "school".Equals(groupChange.scope) && "upsert".Equals(groupChange.status) && !string.IsNullOrWhiteSpace(groupChange.school))
|
|
|
{
|
|
@@ -585,7 +585,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-GroupChange\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-GroupChange\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -608,7 +608,7 @@ namespace TEAMModelOS.Function
|
|
|
_logger.LogInformation("Message ID: {id}", message.MessageId);
|
|
|
_logger.LogInformation("Message Body: {body}", message.Body);
|
|
|
_logger.LogInformation("Message Content-Type: {contentType}", message.ContentType);
|
|
|
- await _dingDing.SendBotMsg($"{message.Body}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{message.Body}", GroupNames.成都开发測試群組);
|
|
|
// Complete the message
|
|
|
await messageActions.CompleteMessageAsync(message);
|
|
|
}
|
|
@@ -689,11 +689,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ItemCond()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ItemCond()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ItemCond()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ItemCond()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{ // Complete the message
|
|
@@ -726,8 +726,8 @@ namespace TEAMModelOS.Function
|
|
|
jsonMsg.RootElement.TryGetProperty("prodId", out JsonElement prodId);
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
string strQuery = string.Empty;
|
|
|
- //取得所有學校產品
|
|
|
- ////序號
|
|
|
+ //取得所有學校產品
|
|
|
+ ////搴忚櫉
|
|
|
List<SchoolProductSumData> serialsProductSumOrg = new List<SchoolProductSumData>();
|
|
|
strQuery = $"SELECT * FROM c WHERE c.dataType = 'serial'";
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: strQuery, requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Product-{schoolId}") }))
|
|
@@ -758,9 +758,9 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- ////服務
|
|
|
+ ////鏈嶅嫏
|
|
|
List<SchoolProductSumDataService> servicesProductSumOrg = new List<SchoolProductSumDataService>();
|
|
|
- //////取得學校產品 授權週期:授權中 條件: startDate <= now <= endDate
|
|
|
+ //////取得學校產品 授權週期:授權中 條件: startDate <= now <= endDate
|
|
|
long timestampToday = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
|
|
string strQueryM = $"SELECT * FROM c WHERE c.dataType = 'servicePeriod' AND c.startDate <= {timestampToday} AND {timestampToday} <= c.endDate AND c.ttl < 0";
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: strQueryM, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolId}") }))
|
|
@@ -794,18 +794,18 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- ////服務產品特別對應項
|
|
|
- School school = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{schoolId}", new PartitionKey("Base")); //學校基本資料取得
|
|
|
- bool updSchool = false; //是否變更學校基本資料
|
|
|
- int chgSchSizeCnt = 0; //變更學校空間的次數 若為0表示現時間點沒有任何空間可使用 => 回復學校空間為初始值
|
|
|
- int schoolDefaultSize = 1; //學校空間初始值:1
|
|
|
+ ////服務產品特別對應項
|
|
|
+ School school = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{schoolId}", new PartitionKey("Base")); //瀛告牎鍩烘湰璩囨枡鍙栧緱
|
|
|
+ bool updSchool = false; //鏄�惁璁婃洿瀛告牎鍩烘湰璩囨枡
|
|
|
+ int chgSchSizeCnt = 0; //變更學校空間的次數 若為0表示現時間點沒有任何空間可使用 => 回復學校空間為初始值
|
|
|
+ int schoolDefaultSize = 1; //學校空間初始值:1
|
|
|
if (!string.IsNullOrWhiteSpace(school.id))
|
|
|
{
|
|
|
if (servicesProductSumOrg.Count > 0)
|
|
|
{
|
|
|
foreach (SchoolProductSumDataService servicesProductSumOrgRow in servicesProductSumOrg)
|
|
|
{
|
|
|
- //更新學校空間
|
|
|
+ //鏇存柊瀛告牎绌洪枔
|
|
|
if (servicesProductSumOrgRow.prodCode.Equals("IPALJ6NY"))
|
|
|
{
|
|
|
school.size = (servicesProductSumOrgRow.avaliable < 1) ? 1 : servicesProductSumOrgRow.avaliable;
|
|
@@ -818,17 +818,17 @@ namespace TEAMModelOS.Function
|
|
|
if (chgSchSizeCnt.Equals(0) && !school.size.Equals(schoolDefaultSize))
|
|
|
{
|
|
|
school.size = schoolDefaultSize;
|
|
|
- //updSchool = true; //關於學校空間初始式樣未定,目前暫定:若需要Reset空間,則先維持原空間數不更動
|
|
|
+ //updSchool = true; //闂滄柤瀛告牎绌洪枔鍒濆�寮忔ǎ鏈�畾锛岀洰鍓嶆毇瀹氾細鑻ラ渶瑕丷eset绌洪枔锛屽墖鍏堢董鎸佸師绌洪枔鏁镐笉鏇村嫊
|
|
|
updSchool = false;
|
|
|
}
|
|
|
}
|
|
|
- //變更學校基本資料
|
|
|
+ //璁婃洿瀛告牎鍩烘湰璩囨枡
|
|
|
if (updSchool)
|
|
|
{
|
|
|
await client.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<School>(school, $"{schoolId}", new PartitionKey("Base"));
|
|
|
}
|
|
|
|
|
|
- ////硬體
|
|
|
+ ////纭�珨
|
|
|
List<SchoolProductSumDataHard> hardsProductSumOrg = new List<SchoolProductSumDataHard>();
|
|
|
strQuery = $"SELECT * FROM c WHERE c.dataType = 'hard'";
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: strQuery, requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Product-{schoolId}") }))
|
|
@@ -860,7 +860,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //更新學校產品一覽表
|
|
|
+ //鏇存柊瀛告牎鐢㈠搧涓€瑕借〃
|
|
|
SchoolProductSum prodSum = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<SchoolProductSum>(schoolId.ToString(), new PartitionKey($"ProductSum"));
|
|
|
prodSum.serial = serialsProductSumOrg;
|
|
|
prodSum.service = servicesProductSumOrg;
|
|
@@ -869,11 +869,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Product()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Product()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Product()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Product()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
@@ -884,7 +884,7 @@ namespace TEAMModelOS.Function
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 更新开课数据事件
|
|
|
+ /// 更新开课数据事件
|
|
|
/// </summary>
|
|
|
/// <param name="msg"></param>
|
|
|
/// <returns></returns>
|
|
@@ -910,7 +910,7 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
_backgroundWorkerQueue.QueueBackgroundWorkItem(async task => {
|
|
|
|
|
|
- //更新课堂记录
|
|
|
+ //鏇存柊璇惧爞璁板綍
|
|
|
if (data.TryGetProperty("lesson_id", out JsonElement _lessonId) && !string.IsNullOrEmpty($"{_lessonId}"))
|
|
|
{
|
|
|
if (!data.TryGetProperty("tmdid", out JsonElement _tmdid)) return;
|
|
@@ -923,7 +923,7 @@ namespace TEAMModelOS.Function
|
|
|
lessonId = $"{_lessonId}";
|
|
|
updates = _grant_types.ToObject<List<LessonUpdate>>();
|
|
|
|
|
|
- }//创建课堂记录
|
|
|
+ }//鍒涘缓璇惧爞璁板綍
|
|
|
else if (data.TryGetProperty("id", out JsonElement _id) && !string.IsNullOrEmpty($"{_id}")
|
|
|
&& data.TryGetProperty("tmdid", out JsonElement _tmdid) && !string.IsNullOrEmpty($"{_tmdid}")
|
|
|
&& data.TryGetProperty("scope", out JsonElement _scope) && !string.IsNullOrEmpty($"{_scope}"))
|
|
@@ -934,7 +934,7 @@ namespace TEAMModelOS.Function
|
|
|
tmdid = $"{_tmdid}";
|
|
|
lessonId = $"{_id}";
|
|
|
updates.Add(new LessonUpdate { grant_type = "create" });
|
|
|
- }//删除课堂记录
|
|
|
+ }//鍒犻櫎璇惧爞璁板綍
|
|
|
else if (data.TryGetProperty("delete_id", out JsonElement _delete_id) && !string.IsNullOrEmpty($"{_delete_id}")
|
|
|
&& data.TryGetProperty("tmdid", out JsonElement _dtmdid) && !string.IsNullOrEmpty($"{_dtmdid}")
|
|
|
&& data.TryGetProperty("scope", out JsonElement _dscope) && !string.IsNullOrEmpty($"{_dscope}")
|
|
@@ -957,7 +957,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
//if (!string.IsNullOrWhiteSpace(school) && school.Equals("habook"))
|
|
|
//{
|
|
|
- // await _dingDing.SendBotMsg($"研发学校课堂记录事件触发:\n{msg}", GroupNames.成都开发測試群組);
|
|
|
+ // await _dingDing.SendBotMsg($"研发学校课堂记录事件触发:\n{msg}", GroupNames.成都开发測試群組);
|
|
|
//}
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
|
|
@@ -1002,7 +1002,7 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
switch (update.grant_type)
|
|
|
{
|
|
|
- //更新课堂时长
|
|
|
+ //鏇存柊璇惧爞鏃堕暱
|
|
|
case "up-duration":
|
|
|
double.TryParse($"{update.data}", out double duration);
|
|
|
lessonRecord.duration = duration;
|
|
@@ -1026,38 +1026,38 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- // await _dingDing.SendBotMsg($"{_option.Location}/LessonRecordEvent/课堂记录更新课堂时长出错records/{_lessonId}/Record/.Recording.json\n{ex.Message}\n{ex.StackTrace}{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ // await _dingDing.SendBotMsg($"{_option.Location}/LessonRecordEvent/课堂记录更新课堂时长出错records/{_lessonId}/Record/.Recording.json\n{ex.Message}\n{ex.StackTrace}{msg}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
isReplace = true;
|
|
|
break;
|
|
|
- //更新T分
|
|
|
+ //更新T分
|
|
|
case "up-tScore":
|
|
|
var tScore = int.Parse($"{update.data}");
|
|
|
lessonRecord.tScore = tScore;
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- //更新课P分
|
|
|
+ //更新课P分
|
|
|
case "up-pScore":
|
|
|
var pScore = int.Parse($"{update.data}");
|
|
|
lessonRecord.pScore = pScore;
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- //更新 学生人数
|
|
|
+ //鏇存柊 瀛︾敓浜烘暟
|
|
|
case "up-mCount":
|
|
|
var mCount = int.Parse($"{update.data}");
|
|
|
lessonRecord.mCount = mCount;
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- //更新 议课次数
|
|
|
+ //鏇存柊 璁��娆℃暟
|
|
|
case "up-techCount":
|
|
|
var techCount = int.Parse($"{update.data}");
|
|
|
lessonRecord.mCount = techCount;
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- //更新 基础统计信息
|
|
|
+ //鏇存柊 鍩虹�缁熻�淇℃伅
|
|
|
case "up-base":
|
|
|
|
|
|
- //读取TimeLine.json
|
|
|
+ //璇诲彇TimeLine.json
|
|
|
List<int> PickupMemberIds = new List<int>();
|
|
|
try
|
|
|
{
|
|
@@ -1079,10 +1079,10 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},TimeLine.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{_option.Location},TimeLine.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
- //读取Task.json
|
|
|
+ //璇诲彇Task.json
|
|
|
List<TaskData> taskDatas = new List<TaskData>();
|
|
|
try
|
|
|
{
|
|
@@ -1093,10 +1093,10 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},Task.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{_option.Location},Task.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
- //读取IRS.json
|
|
|
+ //璇诲彇IRS.json
|
|
|
List<IRSData> iRSDatas = new List<IRSData>();
|
|
|
try
|
|
|
{
|
|
@@ -1108,14 +1108,14 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},IRS.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{_option.Location},IRS.json转换异常,{ex.Message}{ex.StackTrace},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //如果有更新 则去读取/{_lessonId}/IES/base.json
|
|
|
+ //如果有更新 则去读取/{_lessonId}/IES/base.json
|
|
|
try
|
|
|
{
|
|
|
- // await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} 收到更新", GroupNames.醍摩豆服務運維群組);
|
|
|
+ // await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} 收到更新", GroupNames.醍摩豆服務運維群組);
|
|
|
BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/records/{_lessonId}/IES/base.json").DownloadContentAsync();
|
|
|
//attendState
|
|
|
string basejson = baseblobDownload.Content.ToString().Replace("\"Uncall\"", "0").Replace("Uncall", "0");
|
|
@@ -1126,10 +1126,10 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_option.Location},base.json转换异常,{ex.Message}{ex.StackTrace}{basejson},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{_option.Location},base.json转换异常,{ex.Message}{ex.StackTrace}{basejson},{lessonRecord.id}", GroupNames.成都开发測試群組);
|
|
|
//lessonBase = baseblobDownload.Content.ToObjectFromJson<LessonBase>();
|
|
|
}
|
|
|
- //await _dingDing.SendBotMsg($"课例记录文件base.json:{lessonBase.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
+ //await _dingDing.SendBotMsg($"课例记录文件base.json:{lessonBase.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
if (lessonBase != null && lessonBase.summary != null)
|
|
|
{
|
|
|
//lessonRecord.name = lessonBase.summary.activityName;
|
|
@@ -1170,7 +1170,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- //计算TP灯
|
|
|
+ //计算TP灯
|
|
|
{
|
|
|
int T = -1;
|
|
|
int P = -1;
|
|
@@ -1189,7 +1189,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
//if (lessonRecord.examCount > 0)
|
|
|
//{
|
|
|
- // //有评测次数大于0则P是直接绿灯
|
|
|
+ // //有评测次数大于0则P是直接绿灯
|
|
|
// P = 2;
|
|
|
//}
|
|
|
//else {
|
|
@@ -1240,9 +1240,9 @@ namespace TEAMModelOS.Function
|
|
|
//};
|
|
|
//await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS,Constant.Student).UpsertItemAsync<LessonStudentRecord>(lessonStudentRecord, new PartitionKey("LessonStudentRecord"));
|
|
|
}
|
|
|
- //有上传 base.josn.
|
|
|
+ //有上传 base.josn.
|
|
|
lessonRecord.upload = 1;
|
|
|
- // await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} 更新完成", GroupNames.醍摩豆服務運維群組);
|
|
|
+ // await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} 更新完成", GroupNames.醍摩豆服務運維群組);
|
|
|
|
|
|
LessonService.DoAutoDeleteSchoolLessonRecord(lessonRecord, scope, client, school, tmdid, teacher, _serviceBus, _azureStorage, _configuration, _coreAPIHttpService, _dingDing, _azureRedis);
|
|
|
long? size = await _azureStorage.GetBlobContainerClient(blobname).GetBlobsSize($"records/{_lessonId}");
|
|
@@ -1260,7 +1260,7 @@ namespace TEAMModelOS.Function
|
|
|
size = size.HasValue ? size.Value : 0,
|
|
|
};
|
|
|
await client.GetContainer(Constant.TEAMModelOS, tbname).UpsertItemAsync(bloblog);
|
|
|
- //await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} blob刷新完成!", GroupNames.醍摩豆服務運維群組);
|
|
|
+ //await _dingDing.SendBotMsg($"{_option.Location},课堂id:{_lessonId} blob刷新完成!", GroupNames.醍摩豆服務運維群組);
|
|
|
|
|
|
await BlobService.RefreshBlobRoot(new BlobRefreshMessage { progress = "update", root = "records", name = $"{blobname}" }, _serviceBus, _configuration, _azureRedis);
|
|
|
msgs.Add(update);
|
|
@@ -1271,29 +1271,29 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
if (!ex.Message.Contains("The specified blob does not exist"))
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}课程读取base.json,{_lessonId}\n{ex.Message}\n{ex.StackTrace}\n\n{lessonRecord.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}课程读取base.json,{_lessonId}\n{ex.Message}\n{ex.StackTrace}\n\n{lessonRecord.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- await BIStats.SetTypeAddStats(client, _dingDing, lessonRecord.school, "Less", 0, 1, lessonRecord.clientInteractionCount);//BI统计增/减量
|
|
|
+ await BIStats.SetTypeAddStats(client, _dingDing, lessonRecord.school, "Less", 0, 1, lessonRecord.clientInteractionCount);//BI统计增/减量
|
|
|
break;
|
|
|
- //更新 时间线
|
|
|
+ //更新 时间线
|
|
|
case "up-TimeLine":
|
|
|
//BlobDownloadResult TimeLineblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/{_lessonId}/IES/TimeLine.json").DownloadContentAsync();
|
|
|
//var timeline = TimeLineblobDownload.Content.ToObjectFromJson<List<LessonTimeLine>>();
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- //更新 课堂总览信息
|
|
|
+ //鏇存柊 璇惧爞鎬昏�淇℃伅
|
|
|
case "up-ActivityInfo":
|
|
|
//BlobDownloadResult ActivityInfoblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/{_lessonId}/IES/ActivityInfo.json").DownloadContentAsync();
|
|
|
//var activityInfos = ActivityInfoblobDownload.Content.ToObjectFromJson<List<LessonActivityInfo>>();
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- case "up-baseinfo":///更新基础信息,名称科目,年级,分类等,不能删除 ,由update-lesson-baseinfo 触发。
|
|
|
+ case "up-baseinfo":///更新基础信息,名称科目,年级,分类等,不能删除 ,由update-lesson-baseinfo 触发。
|
|
|
isReplace = true;
|
|
|
msgs.Add(update);
|
|
|
break;
|
|
|
- case "up-expire"://消除过期时间,消除后需要取消已经排程的通知订阅
|
|
|
+ case "up-expire"://娑堥櫎杩囨湡鏃堕棿,娑堥櫎鍚庨渶瑕佸彇娑堝凡缁忔帓绋嬬殑閫氱煡璁㈤槄
|
|
|
try
|
|
|
{
|
|
|
var table = _azureStorage.GetCloudTableClient().GetTableReference("ChangeRecord");
|
|
@@ -1354,7 +1354,7 @@ namespace TEAMModelOS.Function
|
|
|
break;
|
|
|
case "create":
|
|
|
oldlessonRecord = null;
|
|
|
- //处理课堂选用的课程信息
|
|
|
+ //处理课堂选用的课程信息
|
|
|
|
|
|
lessonRecord.show = teacher.lessonShow;
|
|
|
lessonRecord.upload = 0;
|
|
@@ -1387,7 +1387,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-查询课程-CosmosDB异常{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-查询课程-CosmosDB异常{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
/*catch (CosmosException ex) when (ex.Status != 404)
|
|
|
{
|
|
@@ -1407,7 +1407,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //处理课堂选用的名单
|
|
|
+ //处理课堂选用的名单
|
|
|
if (lessonRecord.groupIds.IsNotEmpty())
|
|
|
{
|
|
|
List<GroupListDto> groups = await GroupListService.GetGroupListByListids(client, _dingDing, lessonRecord.groupIds, lessonRecord.school);
|
|
@@ -1438,7 +1438,7 @@ namespace TEAMModelOS.Function
|
|
|
await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate
|
|
|
{ client="hiteach", count=1, id=schoolBase.id, key="lesson-create", name=schoolBase.name, scope="school", target=schoolBase.id });
|
|
|
await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate
|
|
|
- { client="hiteach", count=1, id=lessonRecord.tmdid, key="lesson-create", name="课例", scope="teacher", target=lessonRecord.tmdid });
|
|
|
+ { client="hiteach", count=1, id=lessonRecord.tmdid, key="lesson-create", name="璇句緥", scope="teacher", target=lessonRecord.tmdid });
|
|
|
}
|
|
|
var space = await BlobService.GetSurplusSpace(school, scope, $"{Environment.GetEnvironmentVariable("Option:Location")}", _azureCosmos, _azureRedis, _azureStorage, _dingDing, _httpTrigger);
|
|
|
SchoolSetting setting = null;
|
|
@@ -1448,7 +1448,7 @@ namespace TEAMModelOS.Function
|
|
|
setting = JsonDocument.Parse(schoolSetting.Content).RootElement.Deserialize<SchoolSetting>();
|
|
|
if (setting.lessonSetting != null)
|
|
|
{
|
|
|
- //两种状态都不属于,则默认未开启。
|
|
|
+ //两种状态都不属于,则默认未开启。
|
|
|
if (setting.lessonSetting.openAutoClean != 0 && setting.lessonSetting.openAutoClean != 1)
|
|
|
{
|
|
|
setting.lessonSetting.openAutoClean = 0;
|
|
@@ -1456,7 +1456,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //属于 要么开启1,要么关闭0
|
|
|
+ //属于 要么开启1,要么关闭0
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1482,24 +1482,24 @@ namespace TEAMModelOS.Function
|
|
|
|
|
|
if (!save && school_lesson_expire > 0)
|
|
|
{
|
|
|
- // 1-时间戳,7-时间戳
|
|
|
+ // 1-时间戳,7-时间戳
|
|
|
Dictionary<int, ExpireTag> result = new Dictionary<int, ExpireTag>();
|
|
|
- //暂定7天
|
|
|
+ //暂定7天
|
|
|
var now = DateTimeOffset.UtcNow;
|
|
|
- //剩余3天的通知
|
|
|
+ //鍓╀綑3澶╃殑閫氱煡
|
|
|
//var day3= now.AddDays(school_lesson_expire - 3).ToUnixTimeMilliseconds();
|
|
|
//result.Add(3, day3);
|
|
|
- //剩余1天的通知
|
|
|
+ //鍓╀綑1澶╃殑閫氱煡
|
|
|
var day1 = now.AddDays(school_lesson_expire - (school_lesson_expire - 1)).ToUnixTimeMilliseconds();
|
|
|
result.Add(1, new ExpireTag { expire = day1, tag = "notification" });
|
|
|
- //到期通知
|
|
|
- //不到五点上传的课例,七天之后直接删除。
|
|
|
+ //鍒版湡閫氱煡
|
|
|
+ //不到五点上传的课例,七天之后直接删除。
|
|
|
int addSecond = 0;
|
|
|
if (now.Hour > 5)
|
|
|
{
|
|
|
- // 到凌晨00点还差 (24 - now.Hour) *60 * 60 分钟,再加天数;
|
|
|
+ // 到凌晨00点还差 (24 - now.Hour) *60 * 60 分钟,再加天数;
|
|
|
addSecond = school_lesson_expire * 86400 + (24 - now.Hour) * 3600 - (now.Hour * 3600);
|
|
|
- //再加 00到05小时内的 随机秒数
|
|
|
+ //再加 00到05小时内的 随机秒数
|
|
|
Random rand = new Random();
|
|
|
int randInt = rand.Next(0, 18000);
|
|
|
addSecond += randInt;
|
|
@@ -1525,8 +1525,8 @@ namespace TEAMModelOS.Function
|
|
|
foreach (var item in result)
|
|
|
{
|
|
|
string PartitionKey = string.Format("{0}{1}{2}", lessonRecord.code, "-", $"expire-{item.Key}");
|
|
|
- //课堂的id ,
|
|
|
- //课堂的通知时间类型progress, 默认就会发送一条,到期前一天发送一条,最后已到期发送一条。
|
|
|
+ //璇惧爞鐨刬d ,
|
|
|
+ //课堂的通知时间类型progress, 默认就会发送一条,到期前一天发送一条,最后已到期发送一条。
|
|
|
var servicebus_message = new ServiceBusMessage(new
|
|
|
{
|
|
|
id = lessonRecord.id,
|
|
@@ -1556,21 +1556,21 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //个人课例保存规则
|
|
|
+ //涓�汉璇句緥淇濆瓨瑙勫垯
|
|
|
if (scope.Equals("private"))
|
|
|
{
|
|
|
int lessonLimit = teacher.lessonLimit;
|
|
|
var space = await BlobService.GetSurplusSpace(tmdid, scope, $"{Environment.GetEnvironmentVariable("Option:Location")}", _azureCosmos, _azureRedis, _azureStorage, _dingDing, _httpTrigger);
|
|
|
- //20230208调整之前 if (blobTotal * 1073741824 - blobsize > 2147483648) //剩余空间大于2G
|
|
|
- //剩余空间不足,则开启自动清理机制
|
|
|
+ //20230208璋冩暣涔嬪墠 if (blobTotal * 1073741824 - blobsize > 2147483648) //鍓╀綑绌洪棿澶т簬2G
|
|
|
+ //剩余空间不足,则开启自动清理机制
|
|
|
if (space.surplus> 0)
|
|
|
{
|
|
|
- //大于0则表示空间充足
|
|
|
+ //大于0则表示空间充足
|
|
|
lessonLimit = -1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //20230208调整增加逻辑,之前lessonLimit用于处理默认保存50条,现在用于处理标记是否空间不足,不足则标记清理。
|
|
|
+ //20230208调整增加逻辑,之前lessonLimit用于处理默认保存50条,现在用于处理标记是否空间不足,不足则标记清理。
|
|
|
if ($"{Environment.GetEnvironmentVariable("Option:Location")}".Contains("Test", StringComparison.OrdinalIgnoreCase))
|
|
|
{
|
|
|
lessonLimit = 0;
|
|
@@ -1582,27 +1582,27 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
if (lessonLimit != -1)
|
|
|
{
|
|
|
- #region 20230208 调整之后
|
|
|
+ #region 20230208 璋冩暣涔嬪悗
|
|
|
{
|
|
|
- // 1-时间戳,7-时间戳
|
|
|
+ // 1-时间戳,7-时间戳
|
|
|
Dictionary<int, ExpireTag> result = new Dictionary<int, ExpireTag>();
|
|
|
- //暂定7天
|
|
|
+ //暂定7天
|
|
|
var now = DateTimeOffset.UtcNow;
|
|
|
- //剩余3天的通知
|
|
|
+ //鍓╀綑3澶╃殑閫氱煡
|
|
|
//var day3= now.AddDays(Constant.private_lesson_expire - 3).ToUnixTimeMilliseconds();
|
|
|
//result.Add(3, day3);
|
|
|
- //剩余1天的通知
|
|
|
+ //鍓╀綑1澶╃殑閫氱煡
|
|
|
var day1 = now.AddDays(Constant.private_lesson_expire - (Constant.private_lesson_expire - 1)).ToUnixTimeMilliseconds();
|
|
|
result.Add(1, new ExpireTag { expire = day1, tag = "notification" });
|
|
|
- //到期通知
|
|
|
+ //鍒版湡閫氱煡
|
|
|
|
|
|
- //不到五点上传的课例,七天之后直接删除。
|
|
|
+ //不到五点上传的课例,七天之后直接删除。
|
|
|
int addSecond = 0;
|
|
|
if (now.Hour > 5)
|
|
|
{
|
|
|
- // 到凌晨00点还差 (24 - now.Hour) *60 * 60 分钟,再加天数;
|
|
|
+ // 到凌晨00点还差 (24 - now.Hour) *60 * 60 分钟,再加天数;
|
|
|
addSecond = Constant.private_lesson_expire * 86400 + (24 - now.Hour) * 3600;
|
|
|
- //再加 00到05小时内的 随机秒数
|
|
|
+ //再加 00到05小时内的 随机秒数
|
|
|
Random rand = new Random();
|
|
|
int randInt = rand.Next(0, 18000);
|
|
|
addSecond += randInt;
|
|
@@ -1611,7 +1611,7 @@ namespace TEAMModelOS.Function
|
|
|
{
|
|
|
addSecond = Constant.private_lesson_expire * 24 * 60 * 60;
|
|
|
}
|
|
|
- //将当前课例标记为 自动清理
|
|
|
+ //灏嗗綋鍓嶈�渚嬫爣璁颁负 鑷�姩娓呯悊
|
|
|
|
|
|
|
|
|
lessonRecord.expire = now.AddSeconds(addSecond).ToUnixTimeMilliseconds();
|
|
@@ -1628,8 +1628,8 @@ namespace TEAMModelOS.Function
|
|
|
foreach (var item in result)
|
|
|
{
|
|
|
string PartitionKey = string.Format("{0}{1}{2}", lessonRecord.code, "-", $"expire-{item.Key}");
|
|
|
- //课堂的id ,
|
|
|
- //课堂的通知时间类型progress, 默认就会发送一条,到期前一天发送一条,最后已到期发送一条。
|
|
|
+ //璇惧爞鐨刬d ,
|
|
|
+ //课堂的通知时间类型progress, 默认就会发送一条,到期前一天发送一条,最后已到期发送一条。
|
|
|
var servicebus_message = new ServiceBusMessage(new
|
|
|
{
|
|
|
id = lessonRecord.id,
|
|
@@ -1660,12 +1660,12 @@ namespace TEAMModelOS.Function
|
|
|
await client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync(lessonRecord, lessonRecord.id, new PartitionKey(lessonRecord.code));
|
|
|
|
|
|
}
|
|
|
- #endregion 20230208 调整之后
|
|
|
+ #endregion 20230208 璋冩暣涔嬪悗
|
|
|
|
|
|
- #region 20230208 调整之前
|
|
|
- /** 20230208 调整之前
|
|
|
+ #region 20230208 璋冩暣涔嬪墠
|
|
|
+ /** 20230208 璋冩暣涔嬪墠
|
|
|
HashSet<string> ids = new HashSet<string>();
|
|
|
- //未定义的 以及过期时间小于等于0 的 课例
|
|
|
+ //未定义的 以及过期时间小于等于0 的 课例
|
|
|
string private_count_sql = $"select value(c.id) from c where ( c.expire<=0 or IS_DEFINED(c.expire) = false ) and c.tmdid='{tmdid}' ";
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetItemQueryIterator<string>(
|
|
|
queryText: private_count_sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey(code) }))
|
|
@@ -1674,8 +1674,8 @@ namespace TEAMModelOS.Function
|
|
|
ids.Add(item);
|
|
|
}
|
|
|
|
|
|
- // 220601 收藏不限條數,但空間不足時,僅保留最後一次上傳的課例 ()
|
|
|
- //包含收藏的本人的个人课例
|
|
|
+ // 220601 鏀惰棌涓嶉檺姊濇暩锛屼絾绌洪枔涓嶈冻鏅傦紝鍍呬繚鐣欐渶寰屼竴娆′笂鍌崇殑瑾蹭緥 锛堬級
|
|
|
+ //鍖呭惈鏀惰棌鐨勬湰浜虹殑涓�汉璇句緥
|
|
|
//string favorite_count_sql = $"select value(c.id) from c where c.type='LessonRecord' and c.owner='{tmdid}' and c.scope='private' ";
|
|
|
//await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetItemQueryIterator<string>(
|
|
|
// queryText: favorite_count_sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Favorite-{tmdid}") }))
|
|
@@ -1683,19 +1683,19 @@ namespace TEAMModelOS.Function
|
|
|
// ids.Add(item);
|
|
|
//}
|
|
|
|
|
|
- //教师个人预设的,可以通过设置的方式增加
|
|
|
+ //教师个人预设的,可以通过设置的方式增加
|
|
|
int limit = teacher.lessonLimit;
|
|
|
if (teacher.lessonLimit == 0)
|
|
|
{
|
|
|
- //未设置的的采用系统设置的默认值50
|
|
|
+ //未设置的的采用系统设置的默认值50
|
|
|
limit = Constant.private_lesson_limit;
|
|
|
}
|
|
|
|
|
|
if (ids.Count >= limit)
|
|
|
{
|
|
|
LessonRecord lessonRecordExpire = null;
|
|
|
- //获取一条最新的 且没有被收藏,且没有被标记为过期的记录,且不是当前触发的id 。
|
|
|
- //220712 讨论,将desc去掉,获取最旧的那一笔数据。删除最旧的
|
|
|
+ //获取一条最新的 且没有被收藏,且没有被标记为过期的记录,且不是当前触发的id 。
|
|
|
+ //220712 璁ㄨ�锛屽皢desc鍘绘帀锛岃幏鍙栨渶鏃х殑閭d竴绗旀暟鎹�€傚垹闄ゆ渶鏃х殑
|
|
|
string sql = $"SELECT top 1 value(c) FROM c where ( c.expire<=0 or IS_DEFINED(c.expire) = false ) and c.tmdid='{tmdid}' " +
|
|
|
$"and c.favorite<=0 and c.id<>'{lessonRecord.id}' and c.status<>404 order by c.startTime ";
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetItemQueryIterator<LessonRecord>(
|
|
@@ -1705,25 +1705,25 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
if (lessonRecordExpire != null)
|
|
|
{
|
|
|
- // 1-时间戳,7-时间戳
|
|
|
+ // 1-时间戳,7-时间戳
|
|
|
Dictionary<int, ExpireTag> result = new Dictionary<int, ExpireTag>();
|
|
|
- //暂定7天
|
|
|
+ //暂定7天
|
|
|
var now = DateTimeOffset.UtcNow;
|
|
|
- //剩余3天的通知
|
|
|
+ //鍓╀綑3澶╃殑閫氱煡
|
|
|
//var day3= now.AddDays(Constant.private_lesson_expire - 3).ToUnixTimeMilliseconds();
|
|
|
//result.Add(3, day3);
|
|
|
- //剩余1天的通知
|
|
|
+ //鍓╀綑1澶╃殑閫氱煡
|
|
|
var day1 = now.AddDays(Constant.private_lesson_expire - (Constant.private_lesson_expire - 1)).ToUnixTimeMilliseconds();
|
|
|
result.Add(1, new ExpireTag { expire = day1, tag = "notification" });
|
|
|
- //到期通知
|
|
|
+ //鍒版湡閫氱煡
|
|
|
|
|
|
- //不到五点上传的课例,七天之后直接删除。
|
|
|
+ //不到五点上传的课例,七天之后直接删除。
|
|
|
int addSecond = 0;
|
|
|
if (now.Hour > 5)
|
|
|
{
|
|
|
- // 到凌晨00点还差 (24 - now.Hour) *60 * 60 分钟,再加天数;
|
|
|
+ // 到凌晨00点还差 (24 - now.Hour) *60 * 60 分钟,再加天数;
|
|
|
addSecond = Constant.private_lesson_expire * 86400 + (24 - now.Hour) * 3600;
|
|
|
- //再加 00到05小时内的 随机秒数
|
|
|
+ //再加 00到05小时内的 随机秒数
|
|
|
Random rand = new Random();
|
|
|
int randInt = rand.Next(0, 18000);
|
|
|
addSecond += randInt;
|
|
@@ -1747,8 +1747,8 @@ namespace TEAMModelOS.Function
|
|
|
foreach (var item in result)
|
|
|
{
|
|
|
string PartitionKey = string.Format("{0}{1}{2}", lessonRecordExpire.code, "-", $"expire-{item.Key}");
|
|
|
- //课堂的id ,
|
|
|
- //课堂的通知时间类型progress, 默认就会发送一条,到期前一天发送一条,最后已到期发送一条。
|
|
|
+ //璇惧爞鐨刬d ,
|
|
|
+ //课堂的通知时间类型progress, 默认就会发送一条,到期前一天发送一条,最后已到期发送一条。
|
|
|
var message = new ServiceBusMessage(new
|
|
|
{
|
|
|
id = lessonRecordExpire.id,
|
|
@@ -1780,34 +1780,34 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
|
|
|
}**/
|
|
|
- #endregion 20230208 调整之前
|
|
|
+ #endregion 20230208 璋冩暣涔嬪墠
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //=-1 则表示不限制上传数量
|
|
|
+ //=-1 鍒欒〃绀轰笉闄愬埗涓婁紶鏁伴噺
|
|
|
}
|
|
|
await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate
|
|
|
- { client="hiteach", count=1, id=lessonRecord.tmdid, key="lesson-create", name="课例", scope="teacher", target=lessonRecord.tmdid });
|
|
|
+ { client="hiteach", count=1, id=lessonRecord.tmdid, key="lesson-create", name="璇句緥", scope="teacher", target=lessonRecord.tmdid });
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-处理课堂记录的-CosmosDB异常{e.Message}\n{e.StackTrace}\n\n{lessonRecord.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-处理课堂记录的-CosmosDB异常{e.Message}\n{e.StackTrace}\n\n{lessonRecord.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
|
|
|
msgs.Add(update);
|
|
|
- await BIStats.SetTypeAddStats(client, _dingDing, lessonRecord.school, "Less", 1, 0);//BI统计增/减量
|
|
|
+ await BIStats.SetTypeAddStats(client, _dingDing, lessonRecord.school, "Less", 1, 0);//BI统计增/减量
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- //如果被删除则不能再被更新
|
|
|
+ //濡傛灉琚�垹闄ゅ垯涓嶈兘鍐嶈�鏇存柊
|
|
|
if (isReplace)
|
|
|
{
|
|
|
await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).ReplaceItemAsync<LessonRecord>(lessonRecord, lessonId, new PartitionKey(code));
|
|
|
}
|
|
|
- //计算课堂更新前后的差值
|
|
|
+ //计算课堂更新前后的差值
|
|
|
lessonDis = LessonService.DisLessonCount(oldlessonRecord, lessonRecord, lessonDis);
|
|
|
await LessonService.FixLessonCount(client, _dingDing, lessonRecord, oldlessonRecord, lessonDis);
|
|
|
}
|
|
@@ -1816,11 +1816,11 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-更新课堂记录出错-CosmosDB异常{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-更新课堂记录出错-CosmosDB异常{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-更新课堂记录出错\n{ex.Message}\n{ex.StackTrace}\n\n{data}\n{code}\n{updates}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-更新课堂记录出错\n{ex.Message}\n{ex.StackTrace}\n\n{data}\n{code}\n{updates}\n", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
@@ -1861,7 +1861,7 @@ namespace TEAMModelOS.Function
|
|
|
jsonMsg.TryGetProperty("school", out JsonElement _school);
|
|
|
jsonMsg.TryGetProperty("tag", out JsonElement _tag);
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
- //处理到期删除
|
|
|
+ //澶勭悊鍒版湡鍒犻櫎
|
|
|
if (_tag.ValueKind.Equals(JsonValueKind.String) && $"{_tag}".Equals("delete"))
|
|
|
{
|
|
|
string lessonId = $"{id}";
|
|
@@ -1894,8 +1894,8 @@ namespace TEAMModelOS.Function
|
|
|
var messageChange = new ServiceBusMessage(new { delete_id = lessonId, tmdid = tmdid, scope = scope, opt = "delete", school = school }.ToJsonString());
|
|
|
messageChange.ApplicationProperties.Add("name", "LessonRecordEvent");
|
|
|
await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
|
|
|
- await _dingDing.SendBotMsg($"课例:【{lessonRecord.name}】\n课例ID:【{lessonRecord.id}】\n因时间到期,即将被自动删除,到期时间:" +
|
|
|
- $"{lessonRecord.expire}\n{lessonRecord.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"课例:【{lessonRecord.name}】\n课例ID:【{lessonRecord.id}】\n因时间到期,即将被自动删除,到期时间:" +
|
|
|
+ $"{lessonRecord.expire}\n{lessonRecord.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
string biz = "expire";
|
|
@@ -1906,7 +1906,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,LessonRecordExpire()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,LessonRecordExpire()\n{ex.Message}\n{ex.StackTrace}\n\n{jsonMsg.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
@@ -1934,7 +1934,7 @@ namespace TEAMModelOS.Function
|
|
|
var json = JsonDocument.Parse(message.Body);
|
|
|
try
|
|
|
{
|
|
|
- //await _dingDing.SendBotMsg($"IES5,{Environment.GetEnvironmentVariable("Option:Location")},Imei AF call\n{msg.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
+ //await _dingDing.SendBotMsg($"IES5,{Environment.GetEnvironmentVariable("Option:Location")},Imei AF call\n{msg.ToJsonString()}", GroupNames.成都开发測試群組);
|
|
|
|
|
|
if (json.RootElement.TryGetProperty("channel", out JsonElement channel) &&
|
|
|
json.RootElement.TryGetProperty("userid", out JsonElement userid) &&
|
|
@@ -1979,7 +1979,7 @@ namespace TEAMModelOS.Function
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"IES5,{_option.Location},Imei AF error\n{ex.Message}\n{ex.StackTrace}{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"IES5,{_option.Location},Imei AF error\n{ex.Message}\n{ex.StackTrace}{json.RootElement.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
@@ -2058,9 +2058,9 @@ namespace TEAMModelOS.Function
|
|
|
long timeout = 60 * 5;
|
|
|
if (dis > timeout)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"ServiceBus,RefreshBlob:空间计算已经超过{timeout}秒\n容器名:{name}\n文件夹:{u}\n计算时长:{dis}\n文件夹大小:{blobsize}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"ServiceBus,RefreshBlob:空间计算已经超过{timeout}秒\n容器名:{name}\n文件夹:{u}\n计算时长:{dis}\n文件夹大小:{blobsize}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
- //await _dingDing.SendBotMsg($"ServiceBus,RefreshBlob:\n容器名:{name}\n文件夹:{u}\n计算时长:{dis}\n文件夹大小:{blobsize}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ //await _dingDing.SendBotMsg($"ServiceBus,RefreshBlob:\n容器名:{name}\n文件夹:{u}\n计算时长:{dis}\n文件夹大小:{blobsize}", GroupNames.醍摩豆服務運維群組);
|
|
|
}
|
|
|
|
|
|
}
|