|
@@ -459,32 +459,32 @@ namespace Hotline.Api.Controllers
|
|
|
await _knowledgeRepository.Updateable(kns)
|
|
|
.UpdateColumns(d => d.IsPublic)
|
|
|
.Where(d => d.Status == EKnowledgeStatus.OnShelf)
|
|
|
- .ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 批量下架
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("unshelve-batch")]
|
|
|
- public async Task UnshelveBatch([FromBody] UnshelveBatchRequest request)
|
|
|
- {
|
|
|
- var kns = request.KnowledgeIds.Select(d => new Knowledge
|
|
|
- {
|
|
|
- Id = d,
|
|
|
- Status = EKnowledgeStatus.OffShelf
|
|
|
- }).ToList();
|
|
|
- await _knowledgeRepository.Updateable(kns)
|
|
|
- .UpdateColumns(d => d.Status)
|
|
|
- .ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 批量审核
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost("batch_audit")]
|
|
|
+ .ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 批量下架
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("unshelve-batch")]
|
|
|
+ public async Task UnshelveBatch([FromBody] UnshelveBatchRequest request)
|
|
|
+ {
|
|
|
+ var kns = request.KnowledgeIds.Select(d => new Knowledge
|
|
|
+ {
|
|
|
+ Id = d,
|
|
|
+ Status = EKnowledgeStatus.OffShelf
|
|
|
+ }).ToList();
|
|
|
+ await _knowledgeRepository.Updateable(kns)
|
|
|
+ .UpdateColumns(d => d.Status)
|
|
|
+ .ExecuteCommandAsync(HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 批量审核
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("batch_audit")]
|
|
|
public async Task<string> KnowledgeBatchAuditAsync([FromBody] KnowledgeBatchAuditInDto dto)
|
|
|
{
|
|
|
var result = new StringBuilder();
|
|
@@ -566,7 +566,7 @@ namespace Hotline.Api.Controllers
|
|
|
var knowledge = await _knowledgeRepository.GetAsync(dto.Data.Id, HttpContext.RequestAborted);
|
|
|
if (knowledge == null)
|
|
|
throw UserFriendlyException.SameMessage("无效知识库数据");
|
|
|
- if ((knowledge.Status == EKnowledgeStatus.OnShelf && knowledge.ExpiredTime >= DateTime.Now) || knowledge.Status == EKnowledgeStatus.Auditing)
|
|
|
+ if ((knowledge.Status == EKnowledgeStatus.OnShelf && knowledge.ExpiredTime >= DateTime.Now) || knowledge.Status == EKnowledgeStatus.Auditing)
|
|
|
throw UserFriendlyException.SameMessage("知识库数据不可删除");
|
|
|
if (knowledge.Status == EKnowledgeStatus.Drafts || knowledge.Status == EKnowledgeStatus.Revert)
|
|
|
{
|
|
@@ -640,7 +640,8 @@ namespace Hotline.Api.Controllers
|
|
|
var query = _knowledgeRepository.Queryable()
|
|
|
.Where(x => x.Status == EKnowledgeStatus.OnShelf)
|
|
|
.Where(x => (x.ExpiredTime != null && x.ExpiredTime >= DateTime.Now) || x.ExpiredTime == null)
|
|
|
- .OrderByDescending(x => x.SearchNum);
|
|
|
+ .OrderByIF(_appOptions.Value.IsZiGong == true, p => p.PageView, OrderByType.Desc)
|
|
|
+ .OrderByIF(_appOptions.Value.IsZiGong == false, p => p.SearchNum, OrderByType.Desc);
|
|
|
|
|
|
if (_sessionContext.OrgIsCenter == false)
|
|
|
{
|
|
@@ -698,7 +699,7 @@ namespace Hotline.Api.Controllers
|
|
|
var knowledge = await _knowledgeRepository.Queryable()
|
|
|
.Includes(x => x.SourceOrganize)
|
|
|
.Includes(x => x.KnowledgeTypes)
|
|
|
- .Includes(x=>x.KnowledgeOrganizes)
|
|
|
+ .Includes(x => x.KnowledgeOrganizes)
|
|
|
.Includes(x => x.HotspotType)
|
|
|
.FirstAsync(p => p.Id == Id, HttpContext.RequestAborted);
|
|
|
if (knowledge is null)
|
|
@@ -752,8 +753,8 @@ namespace Hotline.Api.Controllers
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("info/export")]
|
|
|
- [LogFilterAlpha("导出日志")]
|
|
|
- public async Task<IActionResult> KnowledgeInfoExport([FromBody] KnowledgeInfoExportInDto dto)
|
|
|
+ [LogFilterAlpha("导出日志")]
|
|
|
+ public async Task<IActionResult> KnowledgeInfoExport([FromBody] KnowledgeInfoExportInDto dto)
|
|
|
{
|
|
|
if (dto.Ids.Length > 1)
|
|
|
{
|
|
@@ -1838,8 +1839,8 @@ namespace Hotline.Api.Controllers
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("pageview/export")]
|
|
|
- [LogFilterAlpha("导出日志")]
|
|
|
- public async Task<FileStreamResult> GetPageViewListAsync([FromBody] ExportExcelDto<PageViewInDto> dto)
|
|
|
+ [LogFilterAlpha("导出日志")]
|
|
|
+ public async Task<FileStreamResult> GetPageViewListAsync([FromBody] ExportExcelDto<PageViewInDto> dto)
|
|
|
{
|
|
|
var items = (await _knowApplication.GetPageViewListAsync(dto.QueryDto, HttpContext.RequestAborted))
|
|
|
.Item2;
|