diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index f85de211..05588e00 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -105658,10 +105658,10 @@ LABL 0 Arial Unicode MS,8,N 2A7151E4-7A47-4EC7-926D-46F18A4EB848 题目编号 -QuestionINo +QuestionNo 1713840195 Administrator -1714290772 +1714468178 Administrator 题目编号 nvarchar(32) diff --git a/Tiobon.Core.Api/Controllers/Base/BaseController.cs b/Tiobon.Core.Api/Controllers/Base/BaseController.cs index 18ef87b9..f425ad58 100644 --- a/Tiobon.Core.Api/Controllers/Base/BaseController.cs +++ b/Tiobon.Core.Api/Controllers/Base/BaseController.cs @@ -32,7 +32,7 @@ public class BaseController /// 条件 /// - [HttpGet] + [HttpPost, Route("Query")] public virtual async Task> QueryByFilter([FromFilter] QueryFilter filter) { var data = (await InvokeServiceAsync("QueryFilterPage", [filter])) as ServicePageResult; @@ -73,7 +73,7 @@ public class BaseController /// 主键ID /// - [HttpGet("{Id}")] + [HttpPost("Query/{Id}")] public virtual async Task> QueryById(long Id) { var entity1 = await InvokeServiceAsync("QueryById", [Id]); @@ -91,7 +91,7 @@ public class BaseController /// /// - [HttpPost] + [HttpPost("Insert")] public virtual async Task> Insert([FromBody] TInsertDto insertModel) { var data = Success(null, "新增成功"); @@ -132,7 +132,7 @@ public class BaseController主键ID /// /// - [HttpPut("{Id}")] + [HttpPost("Update/{Id}")] public virtual async Task Put(long Id, [FromBody] TEditDto editModel) { var data = Success("更新成功"); @@ -145,7 +145,7 @@ public class BaseController /// - [HttpPut, Route("BulkUpdate")] + [HttpPost, Route("BulkUpdate")] public virtual async Task BulkUpdate([FromBody] Dictionary editModels) { var data = Success("更新成功"); @@ -162,7 +162,7 @@ public class BaseController /// 主键ID /// - [HttpDelete("{Id}")] + [HttpPost("Delete/{Id}")] public virtual async Task Delete(long Id) { var data = Success("删除成功"); @@ -180,7 +180,7 @@ public class BaseController /// 主键IDs /// - [HttpDelete, Route("BulkDelete")] + [HttpPost, Route("BulkDelete")] public virtual async Task BulkDelete([FromBody] long[] Ids) { var data = Success("删除成功"); diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs index 08027af8..df07e413 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_QuestionController.cs @@ -23,7 +23,7 @@ public class Ghre_QuestionController : BaseController /// 条件 /// - [HttpGet] + [HttpPost, Route("Query")] public override async Task> QueryByFilter([FromFilter] QueryFilter filter) { var data = await _service.QueryFilterPage(filter); @@ -35,7 +35,7 @@ public class Ghre_QuestionController : BaseController /// 主键ID /// - [HttpGet("{Id}")] + [HttpPost("Query/{Id}")] public override async Task> QueryById(long Id) { var entity = await _service.QueryById(Id); @@ -52,7 +52,7 @@ public class Ghre_QuestionController : BaseController /// /// - [HttpPost] + [HttpPost("Insert")] public override async Task> Insert([FromBody] InsertGhre_QuestionInput insertModel) { insertModel.CourseIds = string.Join(";", insertModel.CourseId.Select(x => x)); @@ -87,7 +87,7 @@ public class Ghre_QuestionController : BaseController主键ID /// /// - [HttpPut("{Id}")] + [HttpPost("Update/{Id}")] public override async Task Put(long Id, [FromBody] EditGhre_QuestionInput editModel) { await _ghre_QuestionAnswerServices.Delete(x=>x.QuestionId == Id); diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 3fa80aff..882a816e 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -721,7 +721,7 @@ 课程Ids - + 题目编号 @@ -2079,7 +2079,7 @@ 课程Ids - + 题目编号 @@ -3695,14 +3695,14 @@ - + - 服务层分页响应实体(泛型) + 返回数据 - + - 状态码 + 服务层分页响应实体(泛型) @@ -3710,36 +3710,11 @@ 操作是否成功 - + 返回信息 - - - 当前页标 - - - - - 总页数 - - - - - 数据总数 - - - - - 每页大小 - - - - - 返回数据 - - 数据库读取类型 diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index ac0b42c8..bdf3be3c 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -232,7 +232,7 @@ - 获取菜单 + 获取模块信息接口 diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_Question.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_Question.Dto.Base.cs index 74ce32a8..4983df62 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_Question.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_Question.Dto.Base.cs @@ -35,8 +35,8 @@ namespace Tiobon.Core.Model.Models /// /// 题目编号 /// - [Display(Name = "QuestionINo"), Description("题目编号"), MaxLength(32, ErrorMessage = "题目编号 不能超过 32 个字符")] - public string QuestionINo { get; set; } + [Display(Name = "QuestionNo"), Description("题目编号"), MaxLength(32, ErrorMessage = "题目编号 不能超过 32 个字符")] + public string QuestionNo { get; set; } /// /// 难易程度 diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_Question.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_Question.cs index 51f62764..46bdb23f 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_Question.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_Question.cs @@ -37,8 +37,8 @@ namespace Tiobon.Core.Model.Models /// /// 题目编号 /// - [Display(Name = "QuestionINo"), Description("题目编号"), MaxLength(32, ErrorMessage = "题目编号 不能超过 32 个字符")] - public string QuestionINo { get; set; } + [Display(Name = "QuestionNo"), Description("题目编号"), MaxLength(32, ErrorMessage = "题目编号 不能超过 32 个字符")] + public string QuestionNo { get; set; } /// /// 难易程度 diff --git a/Tiobon.Core.Model/ServiceResult.cs b/Tiobon.Core.Model/ServiceResult.cs index b34f2438..40d83e14 100644 --- a/Tiobon.Core.Model/ServiceResult.cs +++ b/Tiobon.Core.Model/ServiceResult.cs @@ -134,16 +134,109 @@ public class ServiceResult } } +//public class ServicePageResult +//{ +// /// +// /// 状态码 +// /// +// public int Status { get; set; } = 200; +// /// +// /// 操作是否成功 +// /// +// public bool Success { get; set; } = true; +// /// +// /// 返回信息 +// /// +// public string Message { get; set; } = null; +// /// +// /// 当前页标 +// /// +// public int Page { get; set; } = 1; +// /// +// /// 总页数 +// /// +// public int PageCount => (int)Math.Ceiling((decimal)TotalCount / PageSize); +// /// +// /// 数据总数 +// /// +// public int TotalCount { get; set; } = 0; +// /// +// /// 每页大小 +// /// +// public int PageSize { set; get; } = 20; +// /// +// /// 返回数据 +// /// +// public List Data { get; set; } + +// public ServicePageResult() { } + +// public ServicePageResult(int page, int totalCount, int pageSize, List data) +// { +// this.Page = page; +// this.TotalCount = totalCount; +// PageSize = pageSize; +// this.Data = data; +// } + +// public PageModel ConvertTo() +// { +// return new PageModel(Page, TotalCount, PageSize, default); +// } + + +// public PageModel ConvertTo(IMapper mapper) +// { +// var model = ConvertTo(); + +// if (Data != null) +// { +// model.data = mapper.Map>(Data); +// } + +// return model; +// } + + +// public PageModel ConvertTo(IMapper mapper, Action options) +// { +// var model = ConvertTo(); +// if (Data != null) +// { +// model.data = mapper.Map>(Data, options); +// } + +// return model; + +// } + +//} + + +public class DT_TableDataT +{ + /// + /// 返回数据 + /// + public List DT_TableDataT1 { get; set; } = new List(); + + public DT_TablePageInfoT DT_TablePageInfoT1 { get; set; } = new DT_TablePageInfoT(); +} +public class DT_TablePageInfoT +{ + public int PageNum { get; set; } + public int PageSize { get; set; } + public int TotalCount { get; set; } + +} /// /// 服务层分页响应实体(泛型) /// public class ServicePageResult { - /// - /// 状态码 - /// - public int Status { get; set; } = 200; + public int code { get; set; } = 0; + public string type { get; set; } = "success"; /// /// 操作是否成功 /// @@ -151,67 +244,18 @@ public class ServicePageResult /// /// 返回信息 /// - public string Message { get; set; } = null; - /// - /// 当前页标 - /// - public int Page { get; set; } = 1; - /// - /// 总页数 - /// - public int PageCount => (int)Math.Ceiling((decimal)TotalCount / PageSize); - /// - /// 数据总数 - /// - public int TotalCount { get; set; } = 0; - /// - /// 每页大小 - /// - public int PageSize { set; get; } = 20; - /// - /// 返回数据 - /// - public List Data { get; set; } - - public ServicePageResult() { } - - public ServicePageResult(int page, int totalCount, int pageSize, List data) - { - this.Page = page; - this.TotalCount = totalCount; - PageSize = pageSize; - this.Data = data; - } + public string message { get; set; } = null; - public PageModel ConvertTo() - { - return new PageModel(Page, TotalCount, PageSize, default); - } - - - public PageModel ConvertTo(IMapper mapper) - { - var model = ConvertTo(); - - if (Data != null) - { - model.data = mapper.Map>(Data); - } + public DT_TableDataT result { get; set; } - return model; - } - - - public PageModel ConvertTo(IMapper mapper, Action options) + public ServicePageResult(int page, int totalCount, int pageSize, List data, string message = "查询成功!") { - var model = ConvertTo(); - if (Data != null) - { - model.data = mapper.Map>(Data, options); - } - - return model; - + var result = new DT_TableDataT(); + result.DT_TableDataT1 = data; + result.DT_TablePageInfoT1.PageNum = page; + result.DT_TablePageInfoT1.PageSize = pageSize; + result.DT_TablePageInfoT1.TotalCount = totalCount; + this.message = message; + this.result = result; } - } \ No newline at end of file diff --git a/Tiobon.Core.Model/ViewModels/Menu.cs b/Tiobon.Core.Model/ViewModels/Menu.cs index 30d567a8..72d2e5ed 100644 --- a/Tiobon.Core.Model/ViewModels/Menu.cs +++ b/Tiobon.Core.Model/ViewModels/Menu.cs @@ -82,30 +82,37 @@ public class TableColumn public string dataSource { get; set; } public bool? sortable { get; set; } public string sortOrder { get; set; } - public string defaultHidden { get; set; } - public string ConfigIsShow { get; set; } + public bool? defaultHidden { get; set; } + public bool? ConfigIsShow { get; set; } public string filterable { get; set; } public int width { get; set; } public string align { get; set; } public string fixed1 { get; set; } public bool? editable { get; set; } - public string searchable { get; set; } - public string searchRequired { get; set; } + public bool? searchable { get; set; } + public bool? searchRequired { get; set; } public string searchColumnSeq { get; set; } public string multipleSearchValue { get; set; } public string maxTagCount { get; set; } public string selfDefine { get; set; } public string selectUI { get; set; } public string isPrimaryKey { get; set; } - public bool? isSorted { get; set; } + public bool? isSorted { get; set; } public bool? isHidden { get; set; } public bool? isSearched { get; set; } public int SortNo { get; set; } - public string searchCanOperator { get; set; } + public string searchOperator1 { get; set; } + public List searchOperator { get; set; } public string searchColumnDefaultValue { get; set; } public string AppColumnType { get; set; } public int pageColumnID { get; set; } } +public class searchOperator +{ + public string @operator { get; set; } + public string operatorDesc { get; set; } + public string operatorIcon { get; set; } +} public class TableColumn1 { public string PageSettingQueryId { get; set; } @@ -140,7 +147,7 @@ public class TableColumn1 public string isHidden { get; set; } public string isSearched { get; set; } public int SortNo { get; set; } - public string searchCanOperator { get; set; } + public string searchOperator1 { get; set; } public string searchColumnDefaultValue { get; set; } public string AppColumnType { get; set; } public int pageColumnID { get; set; } diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index 40fca34b..23c8be48 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -785,7 +785,7 @@ public class BaseServices : IBaseServ { var data = await BaseDal.QueryFilterPage(filter); - return new ServicePageResult(filter.PageIndex, data.TotalCount, filter.PageSize, Mapper.Map(data.Data).ToANew>()); + return new ServicePageResult(filter.PageIndex, data.result.DT_TablePageInfoT1.TotalCount, filter.PageSize, Mapper.Map(data.result.DT_TableDataT1).ToANew>()); } diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 03f53bc3..fefb4016 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1,13 +1,16 @@ using System.Data; using AgileObjects.AgileMapper; +using AgileObjects.AgileMapper.Extensions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using SqlSugar; using Tiobon.Core.Common; using Tiobon.Core.Common.DB.Dapper; using Tiobon.Core.IServices; using Tiobon.Core.Model; +using Tiobon.Core.Model.Models; using Tiobon.Core.Services.BASE; namespace Tiobon.Core.Services; @@ -797,7 +800,7 @@ public partial class CommonServices : BaseServices>, ICommon and ParaDetailNo in (select Value from dbo.Fs1_GHR30_SplitString2(searchOperator,',')) order by (select positon from dbo.Fs1_GHR30_SplitString2(searchOperator,',') where value= ParaDetailNo) - FOR JSON Path ) searchOperator , + FOR JSON Path ) searchOperator1 , iif(ISJSON(searchColumnDefaultValue)=1,JSON_QUERY(searchColumnDefaultValue),null) searchColumnDefaultValue , AppColumnType from [dbo].[#TmpInitPageSettingQuery] @@ -805,6 +808,12 @@ public partial class CommonServices : BaseServices>, ICommon sql = string.Format(sql, param.menuName, App.User.ID, param.langId); var TableColumn = Db.Ado.SqlQuery(sql); result.JM_TableColumnT1.TableColumn = Mapper.Map(TableColumn).ToANew>(); + result.JM_TableColumnT1.TableColumn.ForEach(x => + { + if (!string.IsNullOrWhiteSpace(x.searchOperator1)) + x.searchOperator = JsonConvert.DeserializeObject>(x.searchOperator1); + x.searchOperator1 = null; + }); Db.Ado.CommitTran(); sql = @"SELECT Langkey field, diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 3fa80aff..882a816e 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -721,7 +721,7 @@ 课程Ids - + 题目编号 @@ -2079,7 +2079,7 @@ 课程Ids - + 题目编号 @@ -3695,14 +3695,14 @@ - + - 服务层分页响应实体(泛型) + 返回数据 - + - 状态码 + 服务层分页响应实体(泛型) @@ -3710,36 +3710,11 @@ 操作是否成功 - + 返回信息 - - - 当前页标 - - - - - 总页数 - - - - - 数据总数 - - - - - 每页大小 - - - - - 返回数据 - - 数据库读取类型 diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index ac0b42c8..bdf3be3c 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -232,7 +232,7 @@ - 获取菜单 + 获取模块信息接口