Merge branch 'master' of ssh://home.bobandjuly.cyou:5122/ewide/ewide_core

This commit is contained in:
2021-04-27 10:19:10 +08:00
53 changed files with 8552 additions and 1028 deletions

View File

@@ -28,7 +28,7 @@ namespace Ewide.Core
/// 是否执行成功Y-是N-否)
/// </summary>
[Comment("是否执行成功")]
public string Success { get; set; }
public bool? Success { get; set; }
/// <summary>
/// 具体消息

View File

@@ -38,7 +38,7 @@ namespace Ewide.Core
{
Name = descAtt != null ? descAtt.Description : actionDescriptor.ActionName,
OpType = 1,
Success = isRequestSucceed ? YesOrNot.Y.ToString() : YesOrNot.N.ToString(),
Success = isRequestSucceed,
//Message = isRequestSucceed ? "成功" : "失败",
Ip = httpContext.GetRemoteIpAddressToIPv4(),
Location = httpRequest.GetRequestUrlAddress(),

View File

@@ -44,7 +44,7 @@ namespace Ewide.Core.Service
/// <summary>
/// 字典类型Id
/// </summary>
[Required(ErrorMessage = "字典类型Id不能为空"), DataValidation(ValidationTypes.Numeric)]
[Required(ErrorMessage = "字典类型Id不能为空")]
public string TypeId { get; set; }
}
@@ -53,7 +53,7 @@ namespace Ewide.Core.Service
/// <summary>
/// 字典类型Id
/// </summary>
[Required(ErrorMessage = "字典类型Id不能为空"), DataValidation(ValidationTypes.Numeric)]
[Required(ErrorMessage = "字典类型Id不能为空")]
public override string TypeId { get; set; }
/// <summary>
@@ -74,7 +74,7 @@ namespace Ewide.Core.Service
/// <summary>
/// 字典值Id
/// </summary>
[Required(ErrorMessage = "字典值Id不能为空"), DataValidation(ValidationTypes.Numeric)]
[Required(ErrorMessage = "字典值Id不能为空")]
public string Id { get; set; }
}
@@ -83,7 +83,7 @@ namespace Ewide.Core.Service
/// <summary>
/// 字典值Id
/// </summary>
[Required(ErrorMessage = "字典值Id不能为空"), DataValidation(ValidationTypes.Numeric)]
[Required(ErrorMessage = "字典值Id不能为空")]
public string Id { get; set; }
}

View File

@@ -8,6 +8,6 @@
/// <summary>
/// 字典Id
/// </summary>
public virtual long Id { get; set; }
public virtual string Id { get; set; }
}
}

View File

@@ -106,7 +106,6 @@ namespace Ewide.Core.Service
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/sysFileInfo/preview")]
[AllowAnonymous]
public async Task<IActionResult> PreviewFileInfo([FromQuery] QueryFileInoInput input)
{
return await DownloadFileInfo(input);

View File

@@ -20,7 +20,7 @@ namespace Ewide.Core.Service
/// <summary>
/// 是否执行成功Y-是N-否)
/// </summary>
public string Success { get; set; }
public bool? Success { get; set; }
/// <summary>
/// 具体消息

View File

@@ -33,12 +33,12 @@ namespace Ewide.Core.Service
public async Task<dynamic> QueryOpLogPageList([FromQuery] OpLogInput input)
{
var name = !string.IsNullOrEmpty(input.Name?.Trim());
var success = !string.IsNullOrEmpty(input.Success?.Trim());
var success = input.Success.HasValue;
var searchBeginTime = !string.IsNullOrEmpty(input.SearchBeginTime?.Trim());
var opLogs = await _sysOpLogRep.DetachedEntities
.Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")))
.Where(input.OpType > 0, u => u.OpType == input.OpType)
.Where(success, u => u.Success == input.Success.Trim())
.Where(success, u => u.Success == input.Success.Value)
.Where(searchBeginTime, u => u.OpTime >= DateTime.Parse(input.SearchBeginTime.Trim()) &&
u.OpTime <= DateTime.Parse(input.SearchEndTime.Trim()))
.OrderByDescending(u => u.Id)

View File

@@ -211,7 +211,7 @@ namespace Ewide.Core.Service
[UnitOfWork]
public async Task UpdateOrg(UpdateOrgInput input)
{
if (input.Pid != "0" && !string.IsNullOrEmpty(input.Pid))
if (!input.Pid.Equals(System.Guid.Empty.ToString()) && !string.IsNullOrEmpty(input.Pid))
{
var org = await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Pid);
_ = org ?? throw Oops.Oh(ErrorCode.D2000);

View File

@@ -8,7 +8,7 @@
/// <summary>
/// Id
/// </summary>
public long Id { get; set; }
public string Id { get; set; }
/// <summary>
/// 编码

View File

@@ -93,7 +93,7 @@ namespace Ewide.Core.Service
/// <summary>
/// 任务Id
/// </summary>
[Required(ErrorMessage = "任务Id不能为空"), DataValidation(ValidationTypes.Numeric)]
[Required(ErrorMessage = "任务Id不能为空")]
public string Id { get; set; }
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ewide.Database.Migrations.Migrations
{
public partial class Init20210426a : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<bool>(
name: "Success",
table: "sys_log_op",
type: "tinyint(1)",
nullable: true,
comment: "是否执行成功",
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldNullable: true,
oldComment: "是否执行成功");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Success",
table: "sys_log_op",
type: "longtext CHARACTER SET utf8mb4",
nullable: true,
comment: "是否执行成功",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldNullable: true,
oldComment: "是否执行成功");
}
}
}

View File

@@ -2681,8 +2681,8 @@ namespace Ewide.Database.Migrations.Migrations
.HasColumnType("longtext CHARACTER SET utf8mb4")
.HasComment("返回结果");
b.Property<string>("Success")
.HasColumnType("longtext CHARACTER SET utf8mb4")
b.Property<bool?>("Success")
.HasColumnType("tinyint(1)")
.HasComment("是否执行成功");
b.Property<string>("Url")

View File

@@ -26,7 +26,9 @@ namespace Ewide.Web.Core
.AddMvcFilter<RequestActionFilter>()
.AddInjectWithUnifyResult<XnRestfulResultProvider>()
// 在管道中增加NewtonsoftJson,防止参数类型严格验证
.AddNewtonsoftJson()
.AddNewtonsoftJson(options => {
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
})
.AddJsonOptions(options =>
{
//options.JsonSerializerOptions.DefaultBufferSize = 10_0000;//返回较大数据数据序列化时会截断原因默认缓冲区大小以字节为单位为16384。