|
@@ -24,8 +24,8 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IRepository<SystemSetting> _systemSettingsRepository;
|
|
|
private readonly ISystemMenuRepository _systemMenuRepository;
|
|
|
- private readonly IRepository<SysDicType> _sysDicTypeRepository;
|
|
|
- private readonly IRepository<SysDicData> _sysDicDataRepository;
|
|
|
+ private readonly IRepository<SystemDicType> _sysDicTypeRepository;
|
|
|
+ private readonly IRepository<SystemDicData> _sysDicDataRepository;
|
|
|
private readonly ISystemAreaDomainService _systemAreaDomainService;
|
|
|
private readonly IRepository<SystemArea> _systemAreaRepository;
|
|
|
|
|
@@ -42,8 +42,8 @@ namespace Hotline.Api.Controllers
|
|
|
IMapper mapper,
|
|
|
IRepository<SystemSetting> systemSettingsRepository,
|
|
|
ISystemMenuRepository systemMenuRepository,
|
|
|
- IRepository<SysDicType> sysDicTypeRepository,
|
|
|
- IRepository<SysDicData> sysDicDataRepository,
|
|
|
+ IRepository<SystemDicType> sysDicTypeRepository,
|
|
|
+ IRepository<SystemDicData> sysDicDataRepository,
|
|
|
ISystemAreaDomainService systemAreaDomainService,
|
|
|
IRepository<SystemArea> systemAreaRepository
|
|
|
)
|
|
@@ -225,7 +225,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <returns></returns>
|
|
|
[Permission(EPermission.GetSysDicType)]
|
|
|
[HttpPost("dictype-list")]
|
|
|
- public async Task<List<SysDicType>> GetSysDicType()
|
|
|
+ public async Task<List<SystemDicType>> GetSysDicType()
|
|
|
{
|
|
|
return await _sysDicTypeRepository.Queryable().ToListAsync();
|
|
|
}
|
|
@@ -237,9 +237,9 @@ namespace Hotline.Api.Controllers
|
|
|
/// <returns></returns>
|
|
|
[Permission(EPermission.GetSysDicData)]
|
|
|
[HttpGet("dictdata-type")]
|
|
|
- public async Task<List<SysDicData>> GetSysDicData([FromQuery] GetSysDicDataDto dto)
|
|
|
+ public async Task<List<SystemDicData>> GetSysDicData([FromQuery] GetSysDicDataDto dto)
|
|
|
{
|
|
|
- return await _sysDicDataRepository.Queryable().Where(x => x.DicTypeId == dto.typeid)/*.WhereIF(!string.IsNullOrEmpty(dto.datavalue),x=>x.DicDataValue.Contains(dto.datavalue))*/.ToTreeAsync(x=>x.Children,x=>x.ParentId,"");
|
|
|
+ return await _sysDicDataRepository.Queryable().Where(x => x.DicTypeId == dto.typeid).OrderBy(x=>x.Sort)/*.WhereIF(!string.IsNullOrEmpty(dto.datavalue),x=>x.DicDataValue.Contains(dto.datavalue))*/.ToTreeAsync(x=>x.Children,x=>x.ParentId,"");
|
|
|
//return await _sysDicDataRepository.Queryable().Where(x => x.DicTypeId == dto.typeid).WhereIF(!string.IsNullOrEmpty(dto.datavalue), x => x.DicDataValue.Contains(dto.datavalue)).WhereIF(!string.IsNullOrEmpty(dto.ParentId), x => x.ParentId == dto.ParentId).ToListAsync();
|
|
|
}
|
|
|
|
|
@@ -249,9 +249,9 @@ namespace Hotline.Api.Controllers
|
|
|
/// <param name="code"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("dictdata-code/{code}")]
|
|
|
- public async Task<List<SysDicData>> GetSysDicDataByCode(string code)
|
|
|
+ public async Task<List<SystemDicData>> GetSysDicDataByCode(string code)
|
|
|
{
|
|
|
- return await _sysDicDataRepository.Queryable().Where(x => x.DicTypeCode == code).ToListAsync();
|
|
|
+ return await _sysDicDataRepository.Queryable().Where(x => x.DicTypeCode == code).OrderBy(x=>x.Sort).ToListAsync();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -261,7 +261,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <returns></returns>
|
|
|
[Permission(EPermission.SysDicDataModel)]
|
|
|
[HttpGet("dicdata/{id}")]
|
|
|
- public async Task<SysDicData> SysDicDataModel(string id)
|
|
|
+ public async Task<SystemDicData> SysDicDataModel(string id)
|
|
|
{
|
|
|
var dicData = await _sysDicDataRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
if (dicData is null)
|
|
@@ -281,7 +281,7 @@ namespace Hotline.Api.Controllers
|
|
|
var dicType = await _sysDicTypeRepository.GetAsync(dto.DicTypeId, HttpContext.RequestAborted);
|
|
|
if (dicType is null)
|
|
|
throw UserFriendlyException.SameMessage("无效字典类型");
|
|
|
- var dicData = _mapper.Map<SysDicData>(dto);
|
|
|
+ var dicData = _mapper.Map<SystemDicData>(dto);
|
|
|
dicData.DicTypeCode = dicType.DicTypeCode;
|
|
|
await _sysDicDataRepository.AddAsync(dicData);
|
|
|
}
|