1
This commit is contained in:
parent
72b7ef4d7b
commit
6f4a8bb894
@ -54,7 +54,7 @@ namespace asg_form.Controllers
|
|||||||
[Route("api/v1/com/")]
|
[Route("api/v1/com/")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<string>> com_post(long gameid)
|
public async Task<ActionResult<object>> com_post(long gameid)
|
||||||
{
|
{
|
||||||
string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
||||||
var user = await userManager.FindByIdAsync(id);
|
var user = await userManager.FindByIdAsync(id);
|
||||||
@ -68,6 +68,7 @@ namespace asg_form.Controllers
|
|||||||
TestDbContext testDb = new TestDbContext();
|
TestDbContext testDb = new TestDbContext();
|
||||||
string chinaname = user.chinaname;
|
string chinaname = user.chinaname;
|
||||||
var teamgame = await testDb.team_Games.FirstAsync(a => a.id == gameid);
|
var teamgame = await testDb.team_Games.FirstAsync(a => a.id == gameid);
|
||||||
|
if (teamgame.isAllowChoose == 0) return Ok(new error_mb { code = 401, message = "无法选择该比赛" });
|
||||||
var com = JsonConvert.DeserializeObject<List<com_json>>(teamgame.commentary);
|
var com = JsonConvert.DeserializeObject<List<com_json>>(teamgame.commentary);
|
||||||
com.Add(new com_json { id = id.ToInt32(), chinaname = chinaname });
|
com.Add(new com_json { id = id.ToInt32(), chinaname = chinaname });
|
||||||
teamgame.commentary = JsonConvert.SerializeObject(com);
|
teamgame.commentary = JsonConvert.SerializeObject(com);
|
||||||
@ -133,6 +134,7 @@ namespace asg_form.Controllers
|
|||||||
foreach (var gameId in gameIdArray)
|
foreach (var gameId in gameIdArray)
|
||||||
{
|
{
|
||||||
var teamgame = await testDb.team_Games.FirstOrDefaultAsync(a => a.id == gameId);
|
var teamgame = await testDb.team_Games.FirstOrDefaultAsync(a => a.id == gameId);
|
||||||
|
if (teamgame.isAllowChoose == 0) return Ok(new error_mb { code = 401, message = "存在无法选择的比赛" });
|
||||||
if (teamgame != null)
|
if (teamgame != null)
|
||||||
{
|
{
|
||||||
teamgame.referee = chinaname;
|
teamgame.referee = chinaname;
|
||||||
|
@ -220,7 +220,11 @@ namespace asg_form.Controllers.Teamregistration
|
|||||||
var TotalRecords = await query.CountAsync();
|
var TotalRecords = await query.CountAsync();
|
||||||
|
|
||||||
var Tasks = await query
|
var Tasks = await query
|
||||||
.OrderBy(a => a.status)
|
.OrderByDescending(t => t.status == "1" ? 3 :
|
||||||
|
t.status == "5" ? 2 :
|
||||||
|
t.status == "3" ? 1 :
|
||||||
|
t.status == "2" ? 0 :
|
||||||
|
10)
|
||||||
.Skip((page - 1) * limit)
|
.Skip((page - 1) * limit)
|
||||||
.Take(limit)
|
.Take(limit)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
@ -7,6 +7,10 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using AsmResolver.DotNet.Resources;
|
using AsmResolver.DotNet.Resources;
|
||||||
using SharpCompress.Archives;
|
using SharpCompress.Archives;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
|
using Flandre.Core.Common;
|
||||||
|
using Flandre.Core.Messaging.Segments;
|
||||||
|
using Flandre.Core.Messaging;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace asg_form.Controllers {
|
namespace asg_form.Controllers {
|
||||||
public class FileDB
|
public class FileDB
|
||||||
@ -116,7 +120,7 @@ namespace asg_form.Controllers {
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var query2 = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == auditinfo.relativeId);
|
var query2 = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == auditinfo.relativeId);
|
||||||
if (query2 != null) query2.status = "5";
|
if (query2 != null && auditinfo.nowAuthPerson != "archive") query2.status = "5";
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -124,6 +128,12 @@ namespace asg_form.Controllers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub.SaveChanges();
|
sub.SaveChanges();
|
||||||
|
string mesg = $"[ASG管理系统]您有新的业务待办需要处理,请及时上后台系统推进流程。";
|
||||||
|
string qqgroup = "925510646";
|
||||||
|
var atuserqq = auditinfo.nowAuthPersonId.ToString();
|
||||||
|
if (atuserqq == null) return Ok(new { code = 500, message = "服务器错误" });
|
||||||
|
var message = new MessageBuilder().Add(new AtSegment(atuserqq)).Text(mesg).Build();
|
||||||
|
await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, qqgroup, null, message, qqgroup);
|
||||||
return Ok(new { code = 200, message = "成功修改" });
|
return Ok(new { code = 200, message = "成功修改" });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -156,7 +166,7 @@ namespace asg_form.Controllers {
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var query2 = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == auditinfo.relativeId);
|
var query2 = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == auditinfo.relativeId);
|
||||||
if (query2 != null) query2.status = "5";
|
if (query2 != null && auditinfo.nowAuthPerson != "archive") query2.status = "5";
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -165,6 +175,12 @@ namespace asg_form.Controllers {
|
|||||||
}
|
}
|
||||||
sub.T_Audit.Add(newAudit);
|
sub.T_Audit.Add(newAudit);
|
||||||
sub.SaveChanges();
|
sub.SaveChanges();
|
||||||
|
string mesg = $"[ASG管理系统]您有新的业务待办需要处理,请及时上后台系统推进流程。";
|
||||||
|
string qqgroup = "925510646";
|
||||||
|
var atuserqq = auditinfo.nowAuthPersonId.ToString();
|
||||||
|
if (atuserqq == null) return Ok(new { code = 500, message = "服务器错误" });
|
||||||
|
var message = new MessageBuilder().Add(new AtSegment(atuserqq)).Text(mesg).Build();
|
||||||
|
await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, qqgroup, null, message, qqgroup);
|
||||||
return Ok(new { code = 200, message = "成功新增" });
|
return Ok(new { code = 200, message = "成功新增" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
namespace asg_form.Controllers
|
|
||||||
{
|
|
||||||
public class game
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -45,9 +45,9 @@ namespace asg_form.Controllers
|
|||||||
{
|
{
|
||||||
var game = await testDb.team_Games.FirstOrDefaultAsync(a => a.id == gameid);
|
var game = await testDb.team_Games.FirstOrDefaultAsync(a => a.id == gameid);
|
||||||
game.team1_name = req.team1_name;
|
game.team1_name = req.team1_name;
|
||||||
game.judge_Id = req.judge_Id;
|
game.judge_Id = req.judge_Id;
|
||||||
game.referee_Id = req.referee_Id;
|
game.referee_Id = req.referee_Id;
|
||||||
game.Remarks = req.Remarks;
|
game.Remarks = req.Remarks;
|
||||||
game.team2_name = req.team2_name;
|
game.team2_name = req.team2_name;
|
||||||
game.opentime = req.opentime;
|
game.opentime = req.opentime;
|
||||||
game.bilibiliuri = req.bilibiliuri;
|
game.bilibiliuri = req.bilibiliuri;
|
||||||
@ -55,6 +55,7 @@ namespace asg_form.Controllers
|
|||||||
game.belong = req.belong;
|
game.belong = req.belong;
|
||||||
game.tag=req.tag;
|
game.tag=req.tag;
|
||||||
game.judge = req.judge;
|
game.judge = req.judge;
|
||||||
|
game.isAllowChoose = 1;
|
||||||
wp = 1;
|
wp = 1;
|
||||||
game.commentary = req.commentary;
|
game.commentary = req.commentary;
|
||||||
if(req.comLimit != null)
|
if(req.comLimit != null)
|
||||||
@ -109,21 +110,22 @@ namespace asg_form.Controllers
|
|||||||
{ wp = 0;
|
{ wp = 0;
|
||||||
var ins = new team_game
|
var ins = new team_game
|
||||||
{
|
{
|
||||||
team1_name = req.team1_name,
|
team1_name = req.team1_name,
|
||||||
team2_name = req.team2_name,
|
team2_name = req.team2_name,
|
||||||
opentime = req.opentime,
|
opentime = req.opentime,
|
||||||
team1_piaoshu = 0,
|
team1_piaoshu = 0,
|
||||||
team2_piaoshu = 0,
|
team2_piaoshu = 0,
|
||||||
commentary = req.commentary,
|
commentary = req.commentary,
|
||||||
referee = req.referee,
|
referee = req.referee,
|
||||||
belong = req.belong,
|
belong = req.belong,
|
||||||
tag = req.tag,
|
tag = req.tag,
|
||||||
judge = req.judge,
|
judge = req.judge,
|
||||||
judge_Id= req.judge_Id,
|
judge_Id = req.judge_Id,
|
||||||
referee_Id= req.referee_Id,
|
referee_Id = req.referee_Id,
|
||||||
Remarks= req.Remarks,
|
Remarks = req.Remarks,
|
||||||
com_limit = req.comLimit,
|
com_limit = req.comLimit,
|
||||||
person_type = req.personType,
|
person_type = req.personType,
|
||||||
|
isAllowChoose = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
wp = 1;
|
wp = 1;
|
||||||
@ -168,6 +170,7 @@ namespace asg_form.Controllers
|
|||||||
TestDbContext testDb = new TestDbContext();
|
TestDbContext testDb = new TestDbContext();
|
||||||
team_game game=testDb.team_Games.Include(a=>a.logs).First(a=>a.id==teamid);
|
team_game game=testDb.team_Games.Include(a=>a.logs).First(a=>a.id==teamid);
|
||||||
game.winteam = winteam;
|
game.winteam = winteam;
|
||||||
|
game.isAllowChoose = 0;
|
||||||
foreach(var log in game.logs)
|
foreach(var log in game.logs)
|
||||||
{
|
{
|
||||||
if (log.chickteam == winteam)
|
if (log.chickteam == winteam)
|
||||||
@ -488,6 +491,7 @@ namespace asg_form.Controllers
|
|||||||
public string? person_type { get; set; }
|
public string? person_type { get; set; }
|
||||||
public string? final_score { get; set; }
|
public string? final_score { get; set; }
|
||||||
public string? Remarks { get; set; }
|
public string? Remarks { get; set; }
|
||||||
|
public int isAllowChoose { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user