|
@@ -39,24 +39,22 @@ namespace GxPress.Repository.Implement.RecordFolder
|
|
query.Where(nameof(Entity.RecordFolder.RecordFolder.FolderType), folderType);
|
|
query.Where(nameof(Entity.RecordFolder.RecordFolder.FolderType), folderType);
|
|
query.OrderByDesc(nameof(Entity.RecordFolder.RecordFolder.CreatedDate));
|
|
query.OrderByDesc(nameof(Entity.RecordFolder.RecordFolder.CreatedDate));
|
|
var recordFolder = await _repository.GetAsync(query);
|
|
var recordFolder = await _repository.GetAsync(query);
|
|
- if (recordFolder == null)
|
|
|
|
- {
|
|
|
|
- recordFolder = new Entity.RecordFolder.RecordFolder();
|
|
|
|
- recordFolder.FolderId = 0;
|
|
|
|
- }
|
|
|
|
|
|
+ if (recordFolder != null)
|
|
|
|
+ return recordFolder;
|
|
|
|
+ recordFolder = new Entity.RecordFolder.RecordFolder();
|
|
//获取文件夹
|
|
//获取文件夹
|
|
- query = Q.NewQuery();
|
|
|
|
- query.Where(nameof(Entity.Middle.Middle.Id), recordFolder.FolderId);
|
|
|
|
- query.Where(nameof(Entity.Middle.Middle.IsDelete), false);
|
|
|
|
|
|
+ var middle = new Entity.Middle.Middle();
|
|
if (folderType == GxPress.EnumConst.AllTypeConst.TopicNote.GetHashCode())
|
|
if (folderType == GxPress.EnumConst.AllTypeConst.TopicNote.GetHashCode())
|
|
- query.WhereIn(nameof(Entity.Middle.Middle.RoleId), new List<int> { 1, 3 });
|
|
|
|
- if (folderType == GxPress.EnumConst.AllTypeConst.Note.GetHashCode())
|
|
|
|
- query.Where(nameof(Entity.Middle.Middle.RoleId), 2);
|
|
|
|
- var middle = await _middleRepository.GetAsync(query);
|
|
|
|
- if (folderType == GxPress.EnumConst.AllTypeConst.TopicNote.GetHashCode() && middle == null)
|
|
|
|
- middle = await _middleRepository.GetAsync(Q.Where(nameof(Entity.Middle.Middle.FolderType), folderType).Where(nameof(Entity.Middle.Middle.IsSystemDefault), true));
|
|
|
|
|
|
+ {
|
|
|
|
+ query = Q.NewQuery();
|
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.FolderType), folderType);
|
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.IsSystemDefault), true);
|
|
|
|
+ query.Where(nameof(Entity.Middle.Middle.UserId), userId);
|
|
|
|
+ middle = await _middleRepository.GetAsync(query);
|
|
|
|
+ }
|
|
recordFolder.FolderName = middle != null ? middle.FolderName : "";
|
|
recordFolder.FolderName = middle != null ? middle.FolderName : "";
|
|
recordFolder.FolderId = middle != null ? middle.Id : 0;
|
|
recordFolder.FolderId = middle != null ? middle.Id : 0;
|
|
|
|
+ recordFolder.FolderType = folderType;
|
|
return recordFolder;
|
|
return recordFolder;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|