|
@@ -83,7 +83,7 @@ namespace TEAMModelOS.Services.Common
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- msgid = 1;
|
|
|
|
|
|
+ msgid = await VoteIng(vote, new RedisValue(), msgid, option, Field, curr, _azureRedis, userid);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "day": //周期内每天
|
|
case "day": //周期内每天
|
|
@@ -139,7 +139,6 @@ namespace TEAMModelOS.Services.Common
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Vote:Count:{vote.id}_{vote.code}", opt.Key, opt.Count());
|
|
await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Vote:Count:{vote.id}_{vote.code}", opt.Key, opt.Count());
|
|
}
|
|
}
|
|
msgid = 1;
|
|
msgid = 1;
|
|
-
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -148,18 +147,24 @@ namespace TEAMModelOS.Services.Common
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //保存投票记录
|
|
|
|
- VoteRecord record = new VoteRecord { opt = option, time = curr,userid= userid };
|
|
|
|
- bool status = await _azureRedis.GetRedisClient(8).HashSetAsync($"Vote:Record:{vote.id}_{vote.code}", Field, record.ToJsonString());
|
|
|
|
- //当前投票分组计数存入活动的Redis
|
|
|
|
- var group_opt = option.GroupBy(x => x);
|
|
|
|
- foreach (var opt in group_opt)
|
|
|
|
|
|
+ if (option.Count <= vote.voteNum)
|
|
{
|
|
{
|
|
- await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Vote:Count:{vote.id}_{vote.code}", opt.Key, opt.Count());
|
|
|
|
|
|
+ //保存投票记录
|
|
|
|
+ VoteRecord record = new VoteRecord { opt = option, time = curr, userid = userid };
|
|
|
|
+ bool status = await _azureRedis.GetRedisClient(8).HashSetAsync($"Vote:Record:{vote.id}_{vote.code}", Field, record.ToJsonString());
|
|
|
|
+ //当前投票分组计数存入活动的Redis
|
|
|
|
+ var group_opt = option.GroupBy(x => x);
|
|
|
|
+ foreach (var opt in group_opt)
|
|
|
|
+ {
|
|
|
|
+ await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Vote:Count:{vote.id}_{vote.code}", opt.Key, opt.Count());
|
|
|
|
+ }
|
|
|
|
+ if (status)
|
|
|
|
+ {
|
|
|
|
+ msgid = 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if (status)
|
|
|
|
- {
|
|
|
|
- msgid = 1;
|
|
|
|
|
|
+ else {
|
|
|
|
+ msgid = 5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return msgid;
|
|
return msgid;
|