浏览代码

空数据返回无

qinchaoyue 3 月之前
父节点
当前提交
3a5b373023
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

+ 5 - 0
src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

@@ -202,6 +202,11 @@ public abstract class SnapshotApplicationBase
         if (indurstry.IndustryType == EIndustryType.Declare)
         {
             outDto.AreaTree = (await _systemAreaDomainService.GetAreaTree(parentId: "510300")).Adapt<List<SystemAreaOutDto>>();
+            outDto.AreaTree.ToList().ForEach(m => 
+            {
+                if (m.Children.IsNullOrEmpty())
+                    m.Children = new List<SystemAreaOutDto>() { new SystemAreaOutDto { Id = "0",  AreaName = "无"} };
+            });
             outDto.Files = (await _fileRepository.GetByKeyAsync(indurstry.Id, requestAborted)).Adapt<List<IndustryFileDto>>();
             outDto.Files.ToList().ForEach(m => m.Url = fileDownloadApi + m.AdditionId);
             outDto.WorkplaceName = _systemDicDataCacheManager.WorkplaceName;