Merge branch 'master' of https://dev.azure.com/luolan/ASG/_git/asg_backend
This commit is contained in:
		
						commit
						6fb76f5904
					
				@ -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
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -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 });
 | 
			
		||||
@ -277,5 +283,28 @@ namespace asg_form.Controllers.Teamregistration
 | 
			
		||||
            }
 | 
			
		||||
            return Ok(new error_mb { code = 401, message = "没有管理员,无法设置" });
 | 
			
		||||
        }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 根据主键id找申请表所有内容T_Comform
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        [Route("api/v1/admin/findFormById")]
 | 
			
		||||
        [HttpGet]
 | 
			
		||||
        [Authorize]
 | 
			
		||||
        public async Task<ActionResult<object>> 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 = "无权访问" });
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            using (TestDbContext sub = new TestDbContext())
 | 
			
		||||
            {
 | 
			
		||||
                var query = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == Id);
 | 
			
		||||
 | 
			
		||||
                return Ok(new { code = 200, data = query });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
@ -99,6 +105,12 @@ namespace asg_form.Controllers {
 | 
			
		||||
                    au.reason = auditinfo.reason;
 | 
			
		||||
                    au.start_person_id = auditinfo.startPersonId;
 | 
			
		||||
                    au.start_person = auditinfo.startPerson;                   
 | 
			
		||||
                    au.node_index = auditinfo.nodeIndex;
 | 
			
		||||
                    au.flow_config = auditinfo.flowConfig;
 | 
			
		||||
                    if(!query.Any(n => n.relative_id == auditinfo.relativeId))
 | 
			
		||||
                    {
 | 
			
		||||
                        au.relative_id = auditinfo.relativeId;
 | 
			
		||||
                    }                                                            
 | 
			
		||||
                    sub.SaveChanges();
 | 
			
		||||
                    return Ok(new { code = 200, message = "成功修改" });
 | 
			
		||||
                }
 | 
			
		||||
@ -123,6 +135,9 @@ namespace asg_form.Controllers {
 | 
			
		||||
                        reason = auditinfo.reason,
 | 
			
		||||
                        start_person_id = auditinfo.startPersonId,
 | 
			
		||||
                        start_person = auditinfo.startPerson,
 | 
			
		||||
                        relative_id = auditinfo.relativeId,
 | 
			
		||||
                        node_index = auditinfo.nodeIndex,
 | 
			
		||||
                        flow_config = auditinfo.flowConfig,
 | 
			
		||||
                    };
 | 
			
		||||
 | 
			
		||||
                    sub.T_Audit.Add(newAudit);
 | 
			
		||||
@ -138,7 +153,7 @@ namespace asg_form.Controllers {
 | 
			
		||||
        [Route("api/v1/admin/AuditFind")]
 | 
			
		||||
        [HttpGet]
 | 
			
		||||
        [Authorize]
 | 
			
		||||
        public async Task<ActionResult<object>> auditFind([FromQuery] string archive=null,string projName = null, string projNo = null, string bizType = null, string startPerson = null, string budgetUse = null, short page = 1, short limit = 10)
 | 
			
		||||
        public async Task<ActionResult<object>> auditFind([FromQuery] string archive,string projName, string projNo, string bizType, string startPerson, string budgetUse, short page = 1, short limit = 10)
 | 
			
		||||
        {
 | 
			
		||||
            string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
 | 
			
		||||
            var user = await userManager.FindByIdAsync(userId);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user