|
@@ -58,14 +58,13 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
break;
|
|
|
case "going":
|
|
|
- var tcode = code.Replace("Vote-", "");
|
|
|
ActivityData data;
|
|
|
if (vote.scope == "school" || vote.scope == "teacher")
|
|
|
{
|
|
|
data = new ActivityData
|
|
|
{
|
|
|
id = vote.id,
|
|
|
- code = $"Activity-{tcode}",
|
|
|
+ code = $"Activity-{vote.owner}",
|
|
|
type = "vote",
|
|
|
name = vote.name,
|
|
|
startTime = vote.startTime,
|
|
@@ -74,7 +73,8 @@ namespace TEAMModelFunction
|
|
|
scope = vote.scope,
|
|
|
classes = vote.classes,
|
|
|
tmdids = vote.tmdids,
|
|
|
- owner=vote.owner
|
|
|
+ progress= "going",
|
|
|
+ owner =vote.owner
|
|
|
};
|
|
|
await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
}
|
|
@@ -90,6 +90,7 @@ namespace TEAMModelFunction
|
|
|
endTime = vote.endTime,
|
|
|
scode = vote.code,
|
|
|
scope = vote.scope,
|
|
|
+ progress = "going",
|
|
|
classes = vote.classes,
|
|
|
owner = vote.owner
|
|
|
// tmdids = vote.tmdids
|
|
@@ -155,6 +156,48 @@ namespace TEAMModelFunction
|
|
|
{
|
|
|
await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Vote>(vote, vote.id, new Azure.Cosmos.PartitionKey(vote.code));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //更新结束状态
|
|
|
+ if (vote.scope == "school" || vote.scope == "teacher")
|
|
|
+ {
|
|
|
+ data = new ActivityData
|
|
|
+ {
|
|
|
+ id = vote.id,
|
|
|
+ code = $"Activity-{vote.owner}",
|
|
|
+ type = "vote",
|
|
|
+ name = vote.name,
|
|
|
+ startTime = vote.startTime,
|
|
|
+ endTime = vote.endTime,
|
|
|
+ scode = vote.code,
|
|
|
+ scope = vote.scope,
|
|
|
+ classes = vote.classes,
|
|
|
+ tmdids = vote.tmdids,
|
|
|
+ progress = "finish",
|
|
|
+ owner = vote.owner
|
|
|
+ };
|
|
|
+ await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
+ }
|
|
|
+ else if (vote.scope == "private")
|
|
|
+ {
|
|
|
+ //更新结束状态
|
|
|
+ data = new ActivityData
|
|
|
+ {
|
|
|
+ id = vote.id,
|
|
|
+ code = $"Activity-Common",
|
|
|
+ type = "vote",
|
|
|
+ name = vote.name,
|
|
|
+ startTime = vote.startTime,
|
|
|
+ endTime = vote.endTime,
|
|
|
+ scode = vote.code,
|
|
|
+ scope = vote.scope,
|
|
|
+ progress = "finish",
|
|
|
+ classes = vote.classes,
|
|
|
+ owner = vote.owner
|
|
|
+ // tmdids = vote.tmdids
|
|
|
+ };
|
|
|
+ await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
}
|