@@ -238,9 +238,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
public async Task<List<SHRoleDocPrintListItem>> MyListtoOneSHRole([FromQuery] int serID)
|
||||
=> await _role.MyListtoOneSHRoleAsync(serID, SchSerID());
|
||||
|
||||
/// <summary>我的文印(旧 MyListSHRole)。</summary>
|
||||
/// <summary>我的文印(旧 MyListSHRole,分页返回 PageVO)。</summary>
|
||||
[HttpGet("MyListSHRole")]
|
||||
public async Task<List<SHRoleDocPrintListItem>> MyListSHRole(
|
||||
public async Task<PageVO<SHRoleDocPrintListItem>> MyListSHRole(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] string status = null,
|
||||
[FromQuery] string startDate = null,
|
||||
@@ -249,9 +249,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _role.MyListSHRoleAsync(name, status, startDate, endDate, pageSize, pageIndex, UserId(), SchSerID());
|
||||
|
||||
/// <summary>全部文印(旧 totalListSHRole)。</summary>
|
||||
/// <summary>全部文印(旧 totalListSHRole,分页返回 PageVO)。</summary>
|
||||
[HttpGet("totalListSHRole")]
|
||||
public async Task<List<SHRoleDocPrintListItem>> TotalListSHRole(
|
||||
public async Task<PageVO<SHRoleDocPrintListItem>> TotalListSHRole(
|
||||
[FromQuery] int flowid = 0,
|
||||
[FromQuery] int dwid = 0,
|
||||
[FromQuery] string name = null,
|
||||
@@ -262,9 +262,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _role.TotalListSHRoleAsync(flowid, dwid, name, stateid, starttime, endtime, pageSize, pageIndex, SchSerID());
|
||||
|
||||
/// <summary>抄送列表(旧 SendRdListSHRole)。</summary>
|
||||
/// <summary>抄送列表(旧 SendRdListSHRole,分页返回 PageVO)。</summary>
|
||||
[HttpGet("SendRdListSHRole")]
|
||||
public async Task<List<SHRoleDocPrintListItem>> SendRdListSHRole(
|
||||
public async Task<PageVO<SHRoleDocPrintListItem>> SendRdListSHRole(
|
||||
[FromQuery] int flowid = 0,
|
||||
[FromQuery] int dwid = 0,
|
||||
[FromQuery] string name = null,
|
||||
@@ -275,9 +275,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _role.SendRdListSHRoleAsync(flowid, dwid, name, status, startDate, endDate, UserId(), SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>审批列表(旧 SPListSHRole)。</summary>
|
||||
/// <summary>审批列表(旧 SPListSHRole,分页返回 PageVO)。</summary>
|
||||
[HttpGet("SPListSHRole")]
|
||||
public async Task<List<SHRoleDocPrintListItem>> SPListSHRole(
|
||||
public async Task<PageVO<SHRoleDocPrintListItem>> SPListSHRole(
|
||||
[FromQuery] int flowid = 0,
|
||||
[FromQuery] int dwid = 0,
|
||||
[FromQuery] string name = null,
|
||||
@@ -344,9 +344,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
return await _role.RegetJEAsync(SchSerID(), UserId(), ids, model.type);
|
||||
}
|
||||
|
||||
/// <summary>重提记录(旧 getRegetJERd)。</summary>
|
||||
/// <summary>重提记录(旧 getRegetJERd,分页返回 PageVO)。</summary>
|
||||
[HttpGet("getRegetJERd")]
|
||||
public async Task<List<SHRoleRegetJERdItem>> GetRegetJERd(
|
||||
public async Task<PageVO<SHRoleRegetJERdItem>> GetRegetJERd(
|
||||
[FromQuery] int pageSize = 10,
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _role.GetRegetJERdAsync(SchSerID(), pageSize, pageIndex);
|
||||
|
||||
@@ -8,6 +8,7 @@ using YhCore.Common;
|
||||
using YhCore.Common.UserContext;
|
||||
using YhCore.Entity;
|
||||
using YhCore.Model.Dto;
|
||||
using YhCore.Model.Vo;
|
||||
using YhCore.Service.Interfaces;
|
||||
|
||||
namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
@@ -150,9 +151,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
|
||||
#region 文印核心(第三批 D1:抄送 / 附件 / CRUD / 列表 / 审核 / 统计 / 指派)
|
||||
|
||||
/// <summary>抄送列表(旧 SendRdList)。</summary>
|
||||
/// <summary>抄送列表(旧 SendRdList,分页返回 PageVO)。</summary>
|
||||
[HttpGet("SendRdList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> SendRdList(
|
||||
public async Task<PageVO<DocPrintListItem>> SendRdList(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] string startDate = null,
|
||||
[FromQuery] string endDate = null,
|
||||
@@ -204,9 +205,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
return await _wy.RevokeAsync(model);
|
||||
}
|
||||
|
||||
/// <summary>我的文印列表(旧 MyList)。</summary>
|
||||
/// <summary>我的文印列表(旧 MyList,分页返回 PageVO)。</summary>
|
||||
[HttpGet("MyList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> MyList(
|
||||
public async Task<PageVO<DocPrintListItem>> MyList(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] string status = null,
|
||||
[FromQuery] string startDate = null,
|
||||
@@ -215,24 +216,24 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _wy.MyListAsync(name, status, startDate, endDate, UserId(), SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>全部文印列表(旧 AllList 四分类,返回 ctype)。</summary>
|
||||
/// <summary>全部文印列表(旧 AllList 四分类,返回 ctype;分页返回 PageVO)。</summary>
|
||||
[HttpGet("AllList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> AllList(
|
||||
public async Task<PageVO<DocPrintListItem>> AllList(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] int pageSize = 10,
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _wy.AllListAsync(name, UserId(), SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>文印审核列表(旧 ShenheList;旧 Name 过滤为死代码,保持不生效)。</summary>
|
||||
/// <summary>文印审核列表(旧 ShenheList;旧 Name 过滤为死代码,保持不生效;分页返回 PageVO)。</summary>
|
||||
[HttpGet("ShenheList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> ShenheList(
|
||||
public async Task<PageVO<DocPrintListItem>> ShenheList(
|
||||
[FromQuery] int pageSize = 10,
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _wy.ShenheListAsync(UserId(), SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>审批列表(旧 SPList)。</summary>
|
||||
/// <summary>审批列表(旧 SPList,分页返回 PageVO)。</summary>
|
||||
[HttpGet("SPList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> SPList(
|
||||
public async Task<PageVO<DocPrintListItem>> SPList(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] string status = null,
|
||||
[FromQuery] string startDate = null,
|
||||
@@ -241,17 +242,17 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _wy.SPListAsync(name, status, startDate, endDate, UserId(), SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>文印已审列表(旧 YishenList)。</summary>
|
||||
/// <summary>文印已审列表(旧 YishenList,分页返回 PageVO)。</summary>
|
||||
[HttpGet("YishenList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> YishenList(
|
||||
public async Task<PageVO<DocPrintListItem>> YishenList(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] int pageSize = 10,
|
||||
[FromQuery] int pageIndex = 0)
|
||||
=> await _wy.YishenListAsync(name, UserId(), SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>全部文印列表(旧 totalList)。</summary>
|
||||
/// <summary>全部文印列表(旧 totalList,分页返回 PageVO)。</summary>
|
||||
[HttpGet("totalList")]
|
||||
public async Task<System.Collections.Generic.List<DocPrintListItem>> TotalList(
|
||||
public async Task<PageVO<DocPrintListItem>> TotalList(
|
||||
[FromQuery] string name = null,
|
||||
[FromQuery] string stateid = null,
|
||||
[FromQuery] string starttime = null,
|
||||
@@ -306,30 +307,30 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
public async Task<System.Collections.Generic.List<MonthStatItem>> List1([FromQuery] string starttime = null, [FromQuery] string endtime = null)
|
||||
=> await _wy.List1Async(starttime, endtime, SchSerID());
|
||||
|
||||
/// <summary>文印详情统计列表(旧 List2)。</summary>
|
||||
/// <summary>文印详情统计列表(旧 List2,分页返回 PageVO)。</summary>
|
||||
[HttpGet("List2")]
|
||||
public async Task<System.Collections.Generic.List<DocDetailStatItem>> List2(
|
||||
public async Task<PageVO<DocDetailStatItem>> List2(
|
||||
[FromQuery] string starttime = null, [FromQuery] string endtime = null,
|
||||
[FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0)
|
||||
=> await _wy.List2Async(starttime, endtime, SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>文印数量按用户排名(旧 List3)。</summary>
|
||||
/// <summary>文印数量按用户排名(旧 List3,分页返回 PageVO)。</summary>
|
||||
[HttpGet("List3")]
|
||||
public async Task<System.Collections.Generic.List<UserRankItem>> List3(
|
||||
public async Task<PageVO<UserRankItem>> List3(
|
||||
[FromQuery] string starttime = null, [FromQuery] string endtime = null,
|
||||
[FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0)
|
||||
=> await _wy.List3Async(starttime, endtime, SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>按月份统计明细(旧 List4)。</summary>
|
||||
/// <summary>按月份统计明细(旧 List4,分页返回 PageVO)。</summary>
|
||||
[HttpGet("List4")]
|
||||
public async Task<System.Collections.Generic.List<StatListItem>> List4(
|
||||
public async Task<PageVO<StatListItem>> List4(
|
||||
[FromQuery] int year, [FromQuery] int month,
|
||||
[FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0)
|
||||
=> await _wy.List4Async(year, month, SchSerID(), pageSize, pageIndex);
|
||||
|
||||
/// <summary>按用户统计明细(旧 List5)。</summary>
|
||||
/// <summary>按用户统计明细(旧 List5,分页返回 PageVO)。</summary>
|
||||
[HttpGet("List5")]
|
||||
public async Task<System.Collections.Generic.List<StatListItem>> List5(
|
||||
public async Task<PageVO<StatListItem>> List5(
|
||||
[FromQuery] string userid = null, [FromQuery] string starttime = null, [FromQuery] string endtime = null,
|
||||
[FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0)
|
||||
=> await _wy.List5Async(userid, starttime, endtime, SchSerID(), pageSize, pageIndex);
|
||||
|
||||
@@ -81,6 +81,12 @@ namespace YhCore.WebApi.Middleware
|
||||
{
|
||||
sb.Append(" | exception=").Append(exceptionSummary);
|
||||
}
|
||||
else if (context.Items.TryGetValue("ExceptionSummary", out var inner)
|
||||
&& !string.IsNullOrEmpty(inner as string))
|
||||
{
|
||||
// GlobalExceptionMiddleware 在内侧把异常转成了 200 响应,摘要经 HttpContext.Items 递出
|
||||
sb.Append(" | exception=").Append(inner);
|
||||
}
|
||||
|
||||
Log.Info(sb.ToString());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using log4net;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
@@ -18,6 +19,8 @@ namespace YhCore.WebApi.Middleware
|
||||
/// </summary>
|
||||
public class GlobalExceptionMiddleware
|
||||
{
|
||||
private static readonly ILog Log = LogManager.GetLogger(typeof(GlobalExceptionMiddleware));
|
||||
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
public GlobalExceptionMiddleware(RequestDelegate next)
|
||||
@@ -53,9 +56,13 @@ namespace YhCore.WebApi.Middleware
|
||||
timeNow = TimeNow()
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 未捕获异常 → 平台兜底:200 + code:6 内部服务错误(对齐 Java GlobalExceptionHandler.handleException)
|
||||
// 本中间件位于 ApiAccessLogMiddleware 内侧,异常不会穿透到它的 catch,
|
||||
// 必须在此落日志,否则 code:6 无迹可寻(摘要随接口访问日志一并输出)
|
||||
context.Items["ExceptionSummary"] = ex.Message;
|
||||
Log.Error($"未捕获异常 {context.Request.Method} {context.Request.Path}{context.Request.QueryString}", ex);
|
||||
await WriteJsonAsync(context, StatusCodes.Status200OK, new
|
||||
{
|
||||
code = ErrorCode.InternalServerError.Code,
|
||||
|
||||
Reference in New Issue
Block a user