/// <summary> /// 分批执行 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> private static void ExecuteByPage(int pageIndex, int pageSize) { #region 批量更新 List <int> commentIDs = DalProductStatistics.SelectAdditionComment_Page(pageIndex, pageSize).ToList(); if (commentIDs == null || !commentIDs.Any()) { return; } using (var client = new ProductCommentClient()) { var result = client.RefreshCommentToESByCommentIds(commentIDs); if (result.Success && result.Result) { exeCount += commentIDs.Count; Logger.Info($"更新 追评评论 成功 pageIndex ={pageIndex} & exeCount{exeCount}"); } else { Logger.Info($"更新 追评评论 失败 pageIndex ={pageIndex} 异常 message={result.ErrorMessage} & maxid={commentIDs.Max()}&minid={commentIDs.Min()} "); } } #endregion }
private static void BatchUpdateProductCommentLabel(int pageIndex, int pageSize) { #region 批量更新 List <EsProductCommentModel> comments = DalProductStatistics.SelectCommentsByPage(pageIndex, pageSize).Result.ToList(); count += comments.Count; if (comments == null || !comments.Any()) { return; } using (var client = new ProductCommentClient()) { var result = client.RefreshCommentToESByCommentIds(comments.Select(p => p.Id).ToList()); if (result.Success && result.Result) { Logger.Info($"更新 产品评论的标签 BatchUpdateProductCommentLabel pageIndex ={pageIndex} 有效的 comment 数目 ={comments.Count()} & 总次数count{count}"); } else { Logger.Info($"更新 产品评论的标签 更新失败 BatchUpdateProductCommentLabel pageIndex ={pageIndex} 异常 message={result.ErrorMessage} & ={comments.Count()}"); } } #endregion }