|
@@ -29,7 +29,7 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
|
|
|
public HotspotController(IRepository<Hotspot> hotspotTypeRepository,
|
|
|
- IMapper mapper, ITimeLimitDomainService timeLimitDomainService, ITimeLimitRepository timeLimitRepository,ISystemDicDataCacheManager sysDicDataCacheManager)
|
|
|
+ IMapper mapper, ITimeLimitDomainService timeLimitDomainService, ITimeLimitRepository timeLimitRepository, ISystemDicDataCacheManager sysDicDataCacheManager)
|
|
|
{
|
|
|
_hotspotTypeRepository = hotspotTypeRepository;
|
|
|
_mapper = mapper;
|
|
@@ -47,7 +47,7 @@ namespace Hotline.Api.Controllers
|
|
|
{
|
|
|
return await _hotspotTypeRepository.Queryable()
|
|
|
.Where(x => x.ParentId == id)
|
|
|
- .OrderBy(d=>d.HotSpotName)
|
|
|
+ .OrderBy(d => d.HotSpotName)
|
|
|
.ToListAsync();
|
|
|
}
|
|
|
|
|
@@ -69,7 +69,7 @@ namespace Hotline.Api.Controllers
|
|
|
.Where(d => string.IsNullOrEmpty(d.ParentId) && !topIds.Contains(d.Id))
|
|
|
.ToListAsync();
|
|
|
hotspots.AddRange(targetList);
|
|
|
- return hotspots.OrderBy(d=>d.HotSpotName).ToList();
|
|
|
+ return hotspots.OrderBy(d => d.HotSpotName).ToList();
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -84,7 +84,8 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpGet("timelimit-basedata")]
|
|
|
public async Task<object> GetTimeLimitBaseData()
|
|
|
{
|
|
|
- return new {
|
|
|
+ return new
|
|
|
+ {
|
|
|
//ModuleOptions = WorkflowModule.Modules.ToList(),//todo
|
|
|
TimeType = EnumExts.GetDescriptions<ETimeType>(),
|
|
|
BaseData = TimeLimitBaseData.GetBaseData(),
|
|
@@ -94,7 +95,7 @@ namespace Hotline.Api.Controllers
|
|
|
//PushType = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.PushType),
|
|
|
SourceChannel = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.SourceChannel),
|
|
|
IdentityType = EnumExts.GetDescriptions<EIdentityType>(),
|
|
|
- OrderType = EnumExts.GetDescriptions<EOrderType>(),
|
|
|
+ OrderType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.OrderType),
|
|
|
CertType = _sysDicDataCacheManager.GetSysDicDataCache(TimeLimitBaseDataConsts.LicenceType),
|
|
|
EmergencyLevel = EnumExts.GetDescriptions<EEmergencyLevel>()
|
|
|
};
|
|
@@ -106,7 +107,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns>数据主键</returns>
|
|
|
[HttpPost("add-timelimit")]
|
|
|
- public async Task<string> AddTimeLimit([FromBody]AddTimeLimitDto dto)
|
|
|
+ public async Task<string> AddTimeLimit([FromBody] AddTimeLimitDto dto)
|
|
|
{
|
|
|
var model = _mapper.Map<TimeLimit>(dto);
|
|
|
model.TimeLimitState = ETimeLimitState.Draft;
|
|
@@ -120,7 +121,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("update-timelimit")]
|
|
|
- public async Task UpdateTimeLimit([FromBody]UpdateTimeLimitDto dto)
|
|
|
+ public async Task UpdateTimeLimit([FromBody] UpdateTimeLimitDto dto)
|
|
|
{
|
|
|
var model = _mapper.Map<TimeLimit>(dto);
|
|
|
await _timeLimitDomainService.UpdateAsync(model, HttpContext.RequestAborted);
|
|
@@ -149,7 +150,7 @@ namespace Hotline.Api.Controllers
|
|
|
var (total, items) = await _timeLimitRepository.Queryable()
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.TimeLimitName.Contains(dto.Keyword!))
|
|
|
.OrderByDescending(d => d.CreationTime)
|
|
|
- .ToPagedListAsync(dto.PageIndex,dto.PageSize, HttpContext.RequestAborted);
|
|
|
+ .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<TimeLimit>(total, _mapper.Map<IReadOnlyList<TimeLimit>>(items));
|
|
|
}
|
|
|
|
|
@@ -162,7 +163,7 @@ namespace Hotline.Api.Controllers
|
|
|
public async Task DelTimeLimit(string id)
|
|
|
{
|
|
|
var model = await _timeLimitRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
- if (model==null)
|
|
|
+ if (model == null)
|
|
|
{
|
|
|
throw UserFriendlyException.SameMessage("无效数据");
|
|
|
}
|
|
@@ -170,7 +171,7 @@ namespace Hotline.Api.Controllers
|
|
|
{
|
|
|
throw UserFriendlyException.SameMessage("无法删除,请刷新页面");
|
|
|
}
|
|
|
- await _timeLimitRepository.RemoveAsync(id,true,HttpContext.RequestAborted);
|
|
|
+ await _timeLimitRepository.RemoveAsync(id, true, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -182,7 +183,7 @@ namespace Hotline.Api.Controllers
|
|
|
public async Task EnableTimeLimit(string id)
|
|
|
{
|
|
|
var model = await _timeLimitRepository.GetAsync(id, HttpContext.RequestAborted);
|
|
|
- if (model==null)
|
|
|
+ if (model == null)
|
|
|
{
|
|
|
throw UserFriendlyException.SameMessage("无效数据");
|
|
|
}
|