diff --git a/Tiobon.Core.Api/Controllers/Base/BaseController.cs b/Tiobon.Core.Api/Controllers/Base/BaseController.cs index d881be0d..d5a6fb67 100644 --- a/Tiobon.Core.Api/Controllers/Base/BaseController.cs +++ b/Tiobon.Core.Api/Controllers/Base/BaseController.cs @@ -76,12 +76,11 @@ public class BaseController> QueryById(long Id) { - var entity1 = await InvokeServiceAsync("QueryById", [Id]); - var entity = ConvertTo(entity1); + var entity = await InvokeServiceAsync("QueryById", [Id]); if (entity is null) return Failed("获取失败"); else - return Success(entity, "获取成功"); + return Success(ConvertTo(entity), "获取成功"); } /// /// 查询菜单表单信息 diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs index 5df7acdf..9ac55c02 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs @@ -87,7 +87,7 @@ namespace Tiobon.Core.Model.Models /// /// 预留字段1 /// - [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] + [Display(Name = "Reverse1"), Description("预留字段1")] public string Reverse1 { get; set; } /// diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs index b327dfdf..90bdfc43 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs @@ -86,7 +86,7 @@ namespace Tiobon.Core.Model.Models /// /// 预留字段1 /// - [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] + [Display(Name = "Reverse1"), Description("预留字段1")] public string Reverse1 { get; set; } /// diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs index 93d48f05..150be514 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs @@ -64,8 +64,11 @@ public class Ghre_ExamPaperServices : BaseServices QueryById(object objId) { var entity = await base.QueryById(objId); - entity.SetMethodLabel = await GetParaLabel("SetMethod", entity.SetMethod); - entity.ScoreMethodLabel = await GetParaLabel("ScoreMethod", entity.ScoreMethod); + if (entity != null) + { + entity.SetMethodLabel = await GetParaLabel("SetMethod", entity.SetMethod); + entity.ScoreMethodLabel = await GetParaLabel("ScoreMethod", entity.ScoreMethod); + } return entity; }