Commit e4122f45 by xiongyuwen

no message

parent 47596c0e
...@@ -146,6 +146,30 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -146,6 +146,30 @@ namespace Bailun.Discuz.Application.WeiPan
} }
return userId; return userId;
} }
/// <summary>
/// 判断当前微盘文件夹是否为公司制度,如果是则userid统一为:fengxiaoyin的缓存中获取,加快加载速度
/// </summary>
/// <param name="userId"></param>
/// <param name="companyName"></param>
/// <returns></returns>
public string GetBailunShareFileUserId(string userId,string fileId)
{
if (fileId == "s.ww833808f6b8dc0745.610693393XlV_d.611837185H935")//公司制度及资讯--固定的fileId
{
return "fengxiaoyin";
}
return userId;
}
public async void RefreshWeiPanListRedis(string companyName)
{
Console.WriteLine("开始刷新【公司制度及资讯】缓存中");
var userId=(companyName== "广州百伦供应链科技有限公司"? "fengxiaoyin": "gaodesheng");
await GetFirstFileList(userId, companyName, false, true);
var fileId = companyName == "广州百伦供应链科技有限公司" ? "s.ww833808f6b8dc0745.610693393XlV_d.611837185H935" : "s.ww4e7dd5ae312eb101.614679173dzT_d.619409339X1T9";
await GetFileListTree(userId, companyName, fileId, false, true);
Console.WriteLine("刷新【公司制度及资讯】缓存完毕");
}
///// <summary> ///// <summary>
///// 获取首层文件列表 ///// 获取首层文件列表
...@@ -272,6 +296,8 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -272,6 +296,8 @@ namespace Bailun.Discuz.Application.WeiPan
public async Task<List<FileListTreeDto>> GetFileListTree(string userId,string companyName, string fildId, bool isGetRedis = true,bool isDelCaching = false) public async Task<List<FileListTreeDto>> GetFileListTree(string userId,string companyName, string fildId, bool isGetRedis = true,bool isDelCaching = false)
{ {
userId = GetVisitFourKUserId(userId, companyName); userId = GetVisitFourKUserId(userId, companyName);
//判断当前微盘文件夹是否为公司制度,如果是则userid统一为:fengxiaoyin的缓存中获取,加快加载速度
userId=GetBailunShareFileUserId(userId, fildId);
List<FileListTreeDto> fileListTreeDtos = new List<FileListTreeDto>(); List<FileListTreeDto> fileListTreeDtos = new List<FileListTreeDto>();
List<FileListTreeDto> cachingResponse = null; List<FileListTreeDto> cachingResponse = null;
//判断缓存中是否有值,如果有值直接读取 //判断缓存中是否有值,如果有值直接读取
...@@ -808,6 +834,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -808,6 +834,7 @@ namespace Bailun.Discuz.Application.WeiPan
RedisHelper.Del(Constants.File_List_Tree + $"_{companyName}");//清除缓存 RedisHelper.Del(Constants.File_List_Tree + $"_{companyName}");//清除缓存
RedisHelper.Del(Constants.First_File_List + $"_{companyName}");//清除缓存 RedisHelper.Del(Constants.First_File_List + $"_{companyName}");//清除缓存
await CreateUserFilesTreeRedis(companyName); await CreateUserFilesTreeRedis(companyName);
RefreshWeiPanListRedis(companyName);
} }
var noTieZilist=await _weiPanFileListRepository.Query().AsNoTracking().Where(u => u.ThreadId == 0&&u.CompanyName==companyName&&!u.QiniuUrl.IsNullOrEmpty()).ToListAsync(); var noTieZilist=await _weiPanFileListRepository.Query().AsNoTracking().Where(u => u.ThreadId == 0&&u.CompanyName==companyName&&!u.QiniuUrl.IsNullOrEmpty()).ToListAsync();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment