|
@@ -623,6 +623,10 @@ namespace TEAMModelOS.Controllers.Research
|
|
return Ok(new { status = -1 });
|
|
return Ok(new { status = -1 });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ catch (CosmosException ex)
|
|
|
|
+ {
|
|
|
|
+ return Ok(new { status = -1 });
|
|
|
|
+ }
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
await _dingDing.SendBotMsg($"OS,{_option.Location},AbilityController/SubOpt()\n{ex.Message}{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
await _dingDing.SendBotMsg($"OS,{_option.Location},AbilityController/SubOpt()\n{ex.Message}{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
|
|
@@ -1559,7 +1563,10 @@ namespace TEAMModelOS.Controllers.Research
|
|
List<Ability> hadSubs = new List<Ability>();
|
|
List<Ability> hadSubs = new List<Ability>();
|
|
///订阅的学习记录
|
|
///订阅的学习记录
|
|
List<AbilitySub> rcdSubs = new List<AbilitySub>();
|
|
List<AbilitySub> rcdSubs = new List<AbilitySub>();
|
|
- List<Ability> currencyAb = new List<Ability>();
|
|
|
|
|
|
+ //必修
|
|
|
|
+ List<Ability> currencyAb1 = new List<Ability>();
|
|
|
|
+ //选修
|
|
|
|
+ List<Ability> currencyAb2 = new List<Ability>();
|
|
//tmdid
|
|
//tmdid
|
|
if (!request.TryGetProperty("tmdid", out JsonElement tmdid)) return Ok(new { error = 400 });
|
|
if (!request.TryGetProperty("tmdid", out JsonElement tmdid)) return Ok(new { error = 400 });
|
|
//学校编码
|
|
//学校编码
|
|
@@ -1583,7 +1590,11 @@ namespace TEAMModelOS.Controllers.Research
|
|
{
|
|
{
|
|
notSub.Add(item);
|
|
notSub.Add(item);
|
|
if (item.currency == 2) {
|
|
if (item.currency == 2) {
|
|
- currencyAb.Add(item);
|
|
|
|
|
|
+ currencyAb2.Add(item);
|
|
|
|
+ }
|
|
|
|
+ if (item.currency == 1)
|
|
|
|
+ {
|
|
|
|
+ currencyAb1.Add(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
|
|
@@ -1599,12 +1610,20 @@ namespace TEAMModelOS.Controllers.Research
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else { return Ok(new { error = 400 }); };
|
|
else { return Ok(new { error = 400 }); };
|
|
- foreach (var item in currencyAb) {
|
|
|
|
|
|
+ foreach (var item in currencyAb2) {
|
|
var had = hadSubs.Where(x => x.id.Equals(item.id)).FirstOrDefault();
|
|
var had = hadSubs.Where(x => x.id.Equals(item.id)).FirstOrDefault();
|
|
if (had == null) {
|
|
if (had == null) {
|
|
hadSubs.Add(item);
|
|
hadSubs.Add(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ foreach (var item in currencyAb1)
|
|
|
|
+ {
|
|
|
|
+ var had = hadSubs.Where(x => x.id.Equals(item.id)).FirstOrDefault();
|
|
|
|
+ if (had == null)
|
|
|
|
+ {
|
|
|
|
+ hadSubs.Add(item);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return Ok(new { rcdSubs, hadSubs });
|
|
return Ok(new { rcdSubs, hadSubs });
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|