lvzb
11 months ago
12 changed files with 258 additions and 27 deletions
@ -0,0 +1,31 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace WY.NewJit.MsgBaseData |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 基础参数配置表
|
||||
|
/// </summary>
|
||||
|
[Serializable] |
||||
|
public class BaseConfigDto : EntityDto<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 参数名称
|
||||
|
/// </summary>
|
||||
|
public virtual string ParamName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 参数值
|
||||
|
/// </summary>
|
||||
|
public virtual string ParamValue { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
public virtual int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 备注
|
||||
|
/// </summary>
|
||||
|
public virtual int Remark { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Uow; |
||||
|
using WY.NewJit.Common; |
||||
|
|
||||
|
namespace WY.NewJit.MsgBaseData |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 通用字典应用服务实现
|
||||
|
/// </summary>
|
||||
|
[Route("api/newjit/baseconfig")] |
||||
|
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)] |
||||
|
public class BaseGonfigService : ApplicationService |
||||
|
{ |
||||
|
private readonly IRepository<BaseConfig, Guid> _repository; |
||||
|
/// <summary>
|
||||
|
/// 日志
|
||||
|
/// </summary>
|
||||
|
private ILogger<BaseGonfigService> _logger; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 错误信息前缀
|
||||
|
/// </summary>
|
||||
|
private string _errorMessagePrefix |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "."; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造函数
|
||||
|
/// </summary>
|
||||
|
public BaseGonfigService( |
||||
|
IRepository<BaseConfig, Guid> repository, |
||||
|
ILogger<BaseGonfigService> logger |
||||
|
) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
_logger = logger; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#region 公共方法
|
||||
|
/// <summary>
|
||||
|
/// 获取所有基本参数数据
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet] |
||||
|
[UnitOfWork(false)] |
||||
|
[Route("list")] |
||||
|
public virtual async Task<ListResultDto<BaseConfigDto>> GetBaseConfigListAsync() |
||||
|
{ |
||||
|
_logger.LogDebug(_errorMessagePrefix + "GetBaseConfigListAsync 进入"); |
||||
|
try |
||||
|
{ |
||||
|
var lst = await _repository.GetListAsync(); |
||||
|
|
||||
|
var items = ObjectMapper.Map<List<BaseConfig>, List<BaseConfigDto>>(lst); |
||||
|
|
||||
|
return new ListResultDto<BaseConfigDto>(items); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
string errMsg = _errorMessagePrefix + "GetBaseConfigListAsync 执行出错:" + ex.Message; |
||||
|
_logger.LogError(errMsg); |
||||
|
return new ListResultDto<BaseConfigDto>(new List<BaseConfigDto>()); |
||||
|
} |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
|
||||
|
namespace WY.NewJit.MsgBaseData |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 基础参数
|
||||
|
/// </summary>
|
||||
|
public class BaseConfig : AggregateRoot<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 参数名称
|
||||
|
/// </summary>
|
||||
|
public virtual string ParamName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 参数值
|
||||
|
/// </summary>
|
||||
|
public virtual string ParamValue { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
public virtual int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 备注
|
||||
|
/// </summary>
|
||||
|
public virtual int Remark { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
|
||||
|
namespace WY.NewJit.MsgBaseData |
||||
|
{ |
||||
|
public class BaseGonfigDomainService : DomainService |
||||
|
{ |
||||
|
private readonly IRepository<BaseConfig, Guid> _repository; |
||||
|
|
||||
|
public BaseGonfigDomainService(IRepository<BaseConfig, Guid> repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue