diff --git a/asg_form/Controllers/AssignmentController.cs b/asg_form/Controllers/AssignmentController.cs index 5896860..4997f70 100644 --- a/asg_form/Controllers/AssignmentController.cs +++ b/asg_form/Controllers/AssignmentController.cs @@ -5,26 +5,13 @@ using Manganese.Array; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SignalR; -using NPOI.HPSF; using System.Security.Claims; -using static Microsoft.EntityFrameworkCore.DbLoggerCategory; -using System.Web; -using System.Net.NetworkInformation; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; -using NPOI.SS.Formula.Functions; using Microsoft.EntityFrameworkCore; -using Flandre.Core.Models; -using Mirai.Net.Sessions.Http.Managers; using Mirai.Net.Utils.Scaffolds; using Flandre.Core.Messaging.Segments; using Flandre.Core.Messaging; using Flandre.Core.Common; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using static asg_form.Controllers.InviteReferee; -using static Microsoft.ApplicationInsights.MetricDimensionNames.TelemetryContext; -using AngleSharp.Css; + namespace asg_form.Controllers { diff --git a/asg_form/Controllers/Teamregistration/RegisterController.cs b/asg_form/Controllers/Teamregistration/RegisterController.cs index 532e4cd..c0344ab 100644 --- a/asg_form/Controllers/Teamregistration/RegisterController.cs +++ b/asg_form/Controllers/Teamregistration/RegisterController.cs @@ -10,6 +10,7 @@ using Flandre.Core.Common; using Flandre.Core.Messaging.Segments; using Flandre.Core.Messaging; using static asg_form.Controllers.InviteReferee; +using asg_form.Controllers.Store; namespace asg_form.Controllers.Teamregistration { @@ -29,6 +30,7 @@ namespace asg_form.Controllers.Teamregistration public string approval_time { get; set; } public string status { get; set; } public string biz_type { get; set; } + public string req_role { get; set; } } public class userMsg { @@ -42,6 +44,7 @@ namespace asg_form.Controllers.Teamregistration public string? contactNumber { get; set; } public int? id { get; set; } public string bizType { get; set; } + public string reqRole { get; set; } } public class RegisterController : ControllerBase { @@ -90,6 +93,7 @@ namespace asg_form.Controllers.Teamregistration approval_person = "未审核", approval_time = "未审核", biz_type = msg.bizType, + req_role = msg.reqRole, }; sub.T_Comform.Add(rgst); await sub.SaveChangesAsync(); @@ -125,6 +129,7 @@ namespace asg_form.Controllers.Teamregistration query.create_time = dateString; query.status = "1"; query.biz_type = msg.bizType; + query.req_role = msg.reqRole; await sub.SaveChangesAsync(); string mesg = $"[ASG管理系统]有新解说申请,请及时上后台系统审批。"; string qqgroup = "925510646"; @@ -183,7 +188,8 @@ namespace asg_form.Controllers.Teamregistration createTime = form.create_time, approvalPerson = form.approval_person, approvalTime = form.approval_time, - status = form.status + status = form.status, + reqRole = form.req_role, }; await sub.SaveChangesAsync(); return Ok(new { code = 200, message = "成功修改", data = result }); @@ -278,4 +284,21 @@ namespace asg_form.Controllers.Teamregistration return Ok(new error_mb { code = 401, message = "没有管理员,无法设置" }); } } + /// + /// 根据主键id找申请表所有内容T_Comform + /// + [Route("api/v1/admin/findFormById")] + [HttpGet] + [Authorize] + public async Task> find_by_id(int Id) + { + string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; + var user = await userManager.FindByIdAsync(userId); + if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) + { + return Ok(new error_mb { code = 401, message = "无权访问" }); + + } + + } } diff --git a/asg_form/Controllers/auditAndFilingController.cs b/asg_form/Controllers/auditAndFilingController.cs index 2161980..7acbcbb 100644 --- a/asg_form/Controllers/auditAndFilingController.cs +++ b/asg_form/Controllers/auditAndFilingController.cs @@ -28,6 +28,9 @@ namespace asg_form.Controllers { public string reason { get; set; } public string supplementary_info { get; set; } public string status { get; set; } + public int? relative_id { get; set; } + public int node_index { get; set; } + public string flow_config { get; set; } } public class FileFront @@ -49,6 +52,9 @@ namespace asg_form.Controllers { public string reason { get; set; } public string supplementaryInfo { get; set; } public string status { get; set; } + public int? relativeId { get; set; } + public int nodeIndex { get; set; } + public string flowConfig { get; set; } } public class auditAndFilingController : ControllerBase @@ -98,7 +104,16 @@ namespace asg_form.Controllers { au.description = auditinfo.description; au.reason = auditinfo.reason; au.start_person_id = auditinfo.startPersonId; - au.start_person = auditinfo.startPerson; + au.start_person = auditinfo.startPerson; + if(auditinfo.relativeId != null) + { + if(!query.Any(n => n.relative_id == auditinfo.relativeId)) + { + au.relative_id = auditinfo.relativeId; + } + au.node_index = auditinfo.nodeIndex; + au.flow_config = auditinfo.flowConfig; + } sub.SaveChanges(); return Ok(new { code = 200, message = "成功修改" }); }