Commit c85366e6 by xiongyuwen

no message

parent ae1cbf93
...@@ -225,6 +225,9 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -225,6 +225,9 @@ namespace Bailun.Discuz.Application.WeiPan
return apiOutput; return apiOutput;
} }
List<WeipanUserFiles> weipanUserFileList = null;
/// <summary> /// <summary>
/// 递归获取所有首页下的所有文件列表数据 /// 递归获取所有首页下的所有文件列表数据
/// </summary> /// </summary>
...@@ -240,7 +243,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -240,7 +243,7 @@ namespace Bailun.Discuz.Application.WeiPan
} }
else else
{ {
await _weipanUserFilesRepository.DeleteAsync(u => u.UserId ==userId&&u.FatherFileId==fildId); //await _weipanUserFilesRepository.DeleteAsync(u => u.UserId ==userId&&u.FatherFileId==fildId);
var token = GetQYWeChatToken(userId); var token = GetQYWeChatToken(userId);
var apiOutput = RequestFileList(userId, fildId, 0, token); var apiOutput = RequestFileList(userId, fildId, 0, token);
if (apiOutput.errcode == "0")//获取成功 if (apiOutput.errcode == "0")//获取成功
...@@ -269,7 +272,8 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -269,7 +272,8 @@ namespace Bailun.Discuz.Application.WeiPan
weipanUserFiles.UserId = userId; weipanUserFiles.UserId = userId;
weipanUserFiles.FatherFileId = fildId; weipanUserFiles.FatherFileId = fildId;
weipanUserFiles.File_Id = u.fileid; weipanUserFiles.File_Id = u.fileid;
await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true); weipanUserFileList.Add(weipanUserFiles);
//await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true);
} }
} }
} }
...@@ -302,6 +306,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -302,6 +306,7 @@ namespace Bailun.Discuz.Application.WeiPan
{ {
throw new Exception(apiOutput.errmsg); throw new Exception(apiOutput.errmsg);
} }
RedisHelper.HSet(redisKey, userId + "_" + fildId, fileListTreeDtos); RedisHelper.HSet(redisKey, userId + "_" + fildId, fileListTreeDtos);
} }
return fileListTreeDtos; return fileListTreeDtos;
...@@ -371,7 +376,8 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -371,7 +376,8 @@ namespace Bailun.Discuz.Application.WeiPan
weipanUserFiles.UserId = userId; weipanUserFiles.UserId = userId;
weipanUserFiles.FatherFileId = parentId; weipanUserFiles.FatherFileId = parentId;
weipanUserFiles.File_Id = i.fileid; weipanUserFiles.File_Id = i.fileid;
await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true); weipanUserFileList.Add(weipanUserFiles);
//await _weipanUserFilesRepository.AddAsync(weipanUserFiles, true);
} }
} }
} }
...@@ -530,7 +536,7 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -530,7 +536,7 @@ namespace Bailun.Discuz.Application.WeiPan
public async Task<string> ProcessWeiPanWorker() public async Task<string> ProcessWeiPanWorker()
{ {
await CreateUserFilesTreeRedis();
StringBuilder messageSb = new StringBuilder(); ; StringBuilder messageSb = new StringBuilder(); ;
string userId = "chenzekai"; string userId = "chenzekai";
List<WeiPanFileList> inserWeiPanFileList = new List<WeiPanFileList>(); List<WeiPanFileList> inserWeiPanFileList = new List<WeiPanFileList>();
...@@ -651,11 +657,14 @@ namespace Bailun.Discuz.Application.WeiPan ...@@ -651,11 +657,14 @@ namespace Bailun.Discuz.Application.WeiPan
var firstFiles = await GetFirstFileList(item.UserId); var firstFiles = await GetFirstFileList(item.UserId);
if (firstFiles.file_list != null) if (firstFiles.file_list != null)
{ {
weipanUserFileList = new List<WeipanUserFiles>();
await _weipanUserFilesRepository.DeleteAsync(u => u.UserId == item.UserId);
foreach (var file in firstFiles.file_list.item) foreach (var file in firstFiles.file_list.item)
{ {
await GetFileListTree(item.UserId, file.fileid); await GetFileListTree(item.UserId, file.fileid);
} }
await _weipanUserFilesRepository.BulkInsertAsync(weipanUserFileList.ToArray());
} }
} }
} }
......
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