|
@@ -587,7 +587,7 @@ namespace Hotline.Api.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("finding_duplicate")]
|
|
|
|
|
|
- public async Task<bool> FindingDuplicate([FromBody] KnowledgeFindingDuplicateDto dto)
|
|
|
+ public async Task<bool> FindingDuplicate([FromBody] KnowledgeFindingDuplicateDto dto)
|
|
|
{
|
|
|
var any = await _knowledgeRepository.Queryable().Where(x => x.Status == EKnowledgeStatus.Auditing || x.Status >= EKnowledgeStatus.OnShelf)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Title.Equals(dto.Title))
|
|
@@ -595,16 +595,16 @@ namespace Hotline.Api.Controllers
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Content), x => x.Content.Equals(dto.Content))
|
|
|
.AnyAsync();
|
|
|
return any;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
|
|
|
- #region 我的知识删除列表
|
|
|
- /// <summary>
|
|
|
- /// 我的知识删除列表页面枚举值
|
|
|
- /// </summary>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpGet("delete-status-data")]
|
|
|
+ #region 我的知识删除列表
|
|
|
+ /// <summary>
|
|
|
+ /// 我的知识删除列表页面枚举值
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("delete-status-data")]
|
|
|
public async Task<object> DeleteApplyStatus()
|
|
|
{
|
|
|
return EnumExts.GetDescriptions<EKnowledgeWorkFlowStatus>();
|
|
@@ -809,7 +809,7 @@ namespace Hotline.Api.Controllers
|
|
|
|
|
|
dto.DefinitionModuleCode = moduleCode;
|
|
|
dto.Title = knowledge.Title;
|
|
|
- await _workflowApplication.StartWorkflowAsync(dto, flowId, cancellationToken: HttpContext.RequestAborted);
|
|
|
+ await _workflowApplication.StartWorkflowAsync(dto, _sessionContext, flowId, cancellationToken: HttpContext.RequestAborted);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -976,17 +976,17 @@ namespace Hotline.Api.Controllers
|
|
|
public async Task<PagedDto<KnowledgeCorrectionDto>> List([FromQuery] KnowledgeCorrectionListDto dto)
|
|
|
{
|
|
|
var typeSpliceName = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(dto.KnowledgeTypeId))
|
|
|
- {
|
|
|
- var type = await _knowledgeTypeRepository.GetAsync(x => x.Id == dto.KnowledgeTypeId);
|
|
|
- typeSpliceName = type?.SpliceName;
|
|
|
- }
|
|
|
- var (total, items) = await _knowledgeCorrectionRepository.Queryable()
|
|
|
+ if (!string.IsNullOrEmpty(dto.KnowledgeTypeId))
|
|
|
+ {
|
|
|
+ var type = await _knowledgeTypeRepository.GetAsync(x => x.Id == dto.KnowledgeTypeId);
|
|
|
+ typeSpliceName = type?.SpliceName;
|
|
|
+ }
|
|
|
+ var (total, items) = await _knowledgeCorrectionRepository.Queryable()
|
|
|
.Includes(x => x.Knowledge)
|
|
|
//.WhereIF(!string.IsNullOrEmpty(dto.KnowledgeTypeId), x => x.Knowledge.KnowledgeTypeId == dto.KnowledgeTypeId!)
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.CreatorName), x => x.CreatorName == dto.CreatorName!)
|
|
|
.WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.Knowledge.KnowledgeType, typeSpliceName))
|
|
|
- .Where(x => !string.IsNullOrEmpty(x.Knowledge.Id))
|
|
|
+ .Where(x => !string.IsNullOrEmpty(x.Knowledge.Id))
|
|
|
.OrderByDescending(x => x.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
return new PagedDto<KnowledgeCorrectionDto>(total, _mapper.Map<IReadOnlyList<KnowledgeCorrectionDto>>(items));
|
|
@@ -1079,17 +1079,17 @@ namespace Hotline.Api.Controllers
|
|
|
[HttpGet("knowledge_questions/list")]
|
|
|
public async Task<PagedDto<KnowledgeQuestionsDto>> List([FromQuery] KnowledgeQuestionsListDto dto)
|
|
|
{
|
|
|
- var typeSpliceName = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(dto.KnowledgeTypeId))
|
|
|
- {
|
|
|
- var type = await _knowledgeTypeRepository.GetAsync(x => x.Id == dto.KnowledgeTypeId);
|
|
|
- typeSpliceName = type?.SpliceName;
|
|
|
- }
|
|
|
- var (total, items) = await _knowledgeQuestionsRepository.Queryable()
|
|
|
+ var typeSpliceName = string.Empty;
|
|
|
+ if (!string.IsNullOrEmpty(dto.KnowledgeTypeId))
|
|
|
+ {
|
|
|
+ var type = await _knowledgeTypeRepository.GetAsync(x => x.Id == dto.KnowledgeTypeId);
|
|
|
+ typeSpliceName = type?.SpliceName;
|
|
|
+ }
|
|
|
+ var (total, items) = await _knowledgeQuestionsRepository.Queryable()
|
|
|
.Includes(x => x.Knowledge)
|
|
|
- //.WhereIF(!string.IsNullOrEmpty(dto.KnowledgeTypeId), x => x.Knowledge.KnowledgeTypeId == dto.KnowledgeTypeId!)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.Knowledge.KnowledgeType, typeSpliceName))
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.CreatorName), x => x.CreatorName == dto.CreatorName!)
|
|
|
+ //.WhereIF(!string.IsNullOrEmpty(dto.KnowledgeTypeId), x => x.Knowledge.KnowledgeTypeId == dto.KnowledgeTypeId!)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.Knowledge.KnowledgeType, typeSpliceName))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.CreatorName), x => x.CreatorName == dto.CreatorName!)
|
|
|
.Where(x => !string.IsNullOrEmpty(x.Knowledge.Id))
|
|
|
.OrderByDescending(x => x.CreationTime)
|
|
|
.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|