|
@@ -1,4 +1,5 @@
|
|
|
using EasyCaching.Core;
|
|
|
+using Hotline.Application.ExportExcel;
|
|
|
using Hotline.Application.Systems;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.CallCenter.Ivrs;
|
|
@@ -14,6 +15,7 @@ using Hotline.Settings.CommonOpinions;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Dic;
|
|
|
using Hotline.Share.Dtos.Menu;
|
|
|
+using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Dtos.Settings;
|
|
|
using Hotline.Share.Enums.Settings;
|
|
|
using Hotline.Share.Requests;
|
|
@@ -58,6 +60,8 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly IRedisCachingProvider _redisCaching;
|
|
|
private readonly IEasyCachingProvider _easyCaching;
|
|
|
private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
+ private readonly ISystemLogApplication _systemLogApplication;
|
|
|
+ private readonly IExportApplication _exportApplication;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 系统管理相关接口
|
|
@@ -93,7 +97,9 @@ namespace Hotline.Api.Controllers
|
|
|
IRedisCachingProvider redisCaching,
|
|
|
IEasyCachingProvider easyCaching
|
|
|
,
|
|
|
- IOptionsSnapshot<AppConfiguration> appOptions)
|
|
|
+ IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
+ ISystemLogApplication systemLogApplication,
|
|
|
+ IExportApplication exportApplication)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_systemSettingsRepository = systemSettingsRepository;
|
|
@@ -112,6 +118,8 @@ namespace Hotline.Api.Controllers
|
|
|
_redisCaching = redisCaching;
|
|
|
_easyCaching = easyCaching;
|
|
|
_appOptions = appOptions;
|
|
|
+ _systemLogApplication = systemLogApplication;
|
|
|
+ _exportApplication = exportApplication;
|
|
|
}
|
|
|
|
|
|
#region 菜单管理
|
|
@@ -292,6 +300,18 @@ namespace Hotline.Api.Controllers
|
|
|
//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();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 根据字典类型ID获取字典列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("dictdata-type/export")]
|
|
|
+ public async Task<FileStreamResult> GetSysDicDataExport([FromBody]ExportExcelDto<GetSysDicDataDto> dto)
|
|
|
+ {
|
|
|
+ var items = await _sysDicDataRepository.Queryable().Where(x => x.DicTypeId == dto.QueryDto.typeid).OrderBy(x => x.Sort).ToTreeAsync(x => x.Children, x => x.ParentId, "");
|
|
|
+ return _exportApplication.GetExcelFile(dto, items, "字典列表");
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 根据字典类型Code获取字典列表
|
|
|
/// </summary>
|
|
@@ -369,6 +389,17 @@ namespace Hotline.Api.Controllers
|
|
|
return await _systemAreaDomainService.GetAreaTree(_appOptions.Value.IsZiGong ? 6 : 0);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取省市区树形
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("area/tree/export")]
|
|
|
+ public async Task<FileStreamResult> GetAreaTreeExport([FromBody]ExportExcelDto<string> dto)
|
|
|
+ {
|
|
|
+ var items = await _systemAreaDomainService.GetAreaTree(_appOptions.Value.IsZiGong ? 6 : 0);
|
|
|
+ return _exportApplication.GetExcelFile(dto, items, "行政区域");
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 新增省市区
|
|
|
/// </summary>
|
|
@@ -565,34 +596,17 @@ namespace Hotline.Api.Controllers
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("log_list")]
|
|
|
- public async Task<PagedDto<SystemLogDto>> List([FromQuery] SysLogPagedKeywordRequest dto)
|
|
|
- {
|
|
|
- var (total, items) = await _systemLogRepository.Queryable()
|
|
|
- .WhereIF(dto.IsAll.HasValue && !dto.IsAll.Value, x => !string.IsNullOrEmpty(x.Name))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Name), x => x.Name.Contains(dto.Name))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.CreatorName), x => x.CreatorName.Contains(dto.CreatorName))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.ExecuteUrl), x => x.ExecuteUrl.Contains(dto.ExecuteUrl))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.ExecuteParam),
|
|
|
- x => SqlFunc.JsonLike(x.ExecuteParam, dto.ExecuteParam))
|
|
|
- .WhereIF(dto.StartTime.HasValue && dto.EndTime.HasValue,
|
|
|
- x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.Keyword), x => x.Name.Contains(dto.Keyword!) || x.CreatorName.Contains(dto.Keyword!))
|
|
|
- .Select(x => new SystemLogDto
|
|
|
- {
|
|
|
- ExecuteParam = x.ExecuteParam
|
|
|
- }, true)
|
|
|
- .OrderByDescending(x => x.CreationTime)
|
|
|
- .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
- return new PagedDto<SystemLogDto>(total, items);
|
|
|
-
|
|
|
+ public async Task<PagedDto<SystemLogDto>> GetSystemLotItems([FromQuery] SysLogPagedKeywordRequest dto)
|
|
|
+ {
|
|
|
+ return (await _systemLogApplication.GetSystemLotItems(dto).ToPagedListAsync(dto)).ToPaged();
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 获取日志实体
|
|
|
- /// </summary>
|
|
|
- /// <param name="id"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("log/{id}")]
|
|
|
+ /// <summary>
|
|
|
+ /// 获取日志实体
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("log/{id}")]
|
|
|
public async Task<SystemLogDto> ItemEntity(string id)
|
|
|
{
|
|
|
var log = await _systemLogRepository.Queryable()
|