浏览代码

Merge branch 'dev' into dev_dss

Dun.Jason 11 月之前
父节点
当前提交
b5a4a73b33

+ 1 - 1
src/Hotline.Api/Controllers/KnowledgeCommonController.cs

@@ -132,7 +132,7 @@ namespace Hotline.Api.Controllers
         [HttpGet("treelist")]
         public async Task<List<KnowledgeType>> GetTreeList(bool? IsEnable)
         {
-            return await _knowledgeTypeRepository.Queryable().WhereIF(IsEnable.HasValue, p => p.IsEnable == IsEnable).ToTreeAsync(it => it.children, it => it.ParentId, null,it=> it.Id);
+            return await _knowledgeTypeRepository.Queryable().WhereIF(IsEnable.HasValue, p => p.IsEnable == IsEnable).OrderBy(p => p.Sort).ToTreeAsync(it => it.children, it => it.ParentId, null,it=> it.Id);
         }
 
         /// <summary>

+ 4 - 4
src/Hotline.Api/Controllers/KnowledgeController.cs

@@ -502,7 +502,7 @@ namespace Hotline.Api.Controllers
                 .WhereIF(!string.IsNullOrEmpty(pagedDto.Summary), x => x.Summary != null && x.Summary.Contains(pagedDto.Summary!))
                 .WhereIF(!string.IsNullOrEmpty(typeSpliceName), x => SqlFunc.JsonLike(x.KnowledgeType, typeSpliceName))
                 .WhereIF(!string.IsNullOrEmpty(hotspotHotSpotFullName), x => x.HotspotType.HotSpotFullName.EndsWith(hotspotHotSpotFullName!))
-                .WhereIF(!string.IsNullOrEmpty(pagedDto.CreateOrgId), x => x.CreatorOrgId != null && x.CreatorOrgId.EndsWith(pagedDto.CreateOrgId!))
+                .WhereIF(!string.IsNullOrEmpty(pagedDto.CreateOrgId), x => x.SourceOrganizeId != null && x.SourceOrganizeId.EndsWith(pagedDto.CreateOrgId!))
                 .OrderByDescending(d => d.CreationTime)
                 .ToPagedListAsync(pagedDto.PageIndex, pagedDto.PageSize, HttpContext.RequestAborted);
             //temp.ForEach(x => x.IsCanHandle = x.Workflow.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId));
@@ -590,9 +590,9 @@ namespace Hotline.Api.Controllers
         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))
-                .WhereIF(string.IsNullOrEmpty(dto.Summary), x => x.Title.Equals(dto.Summary))
-                .WhereIF(string.IsNullOrEmpty(dto.Content), x => x.Title.Equals(dto.Content))
+                .WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.Title.Equals(dto.Title))
+                .WhereIF(!string.IsNullOrEmpty(dto.Summary), x => x.Summary.Equals(dto.Summary))
+                .WhereIF(!string.IsNullOrEmpty(dto.Content), x => x.Content.Equals(dto.Content))
                 .AnyAsync();
             return any;
 		}

+ 1 - 1
src/Hotline/KnowledgeBase/KnowledgeDomainService.cs

@@ -47,7 +47,7 @@ namespace Hotline.KnowledgeBase
         /// <returns></returns>
         public async Task<Knowledge> KnowledgeInfo(string Id, CancellationToken cancellationToken)
         {
-            var know = await _knowledgeRepository.Queryable(false, false, false).Includes(x => x.Workflow).FirstAsync(p => p.Id == Id);
+            var know = await _knowledgeRepository.Queryable(false, false, false).Includes(x => x.Workflow).Includes(x=>x.SourceOrganize).FirstAsync(p => p.Id == Id);
             if (know is null)
                 throw UserFriendlyException.SameMessage("知识查询失败!");
             return know;