|
@@ -35,11 +35,10 @@ public class AccountPreDistributeStrategy implements FilterStrategy {
|
|
|
List<Content> filterContents = new ArrayList<>();
|
|
|
String[] pools = accountContentPoolConfigService.getContentPools(param.getAccountName());
|
|
|
if (pools.length >= 3) {
|
|
|
- ArticlePreDistributeAccount articlePreDistributeAccount =
|
|
|
- articlePreDistributeAccountRepository.findByGhIdOrderByDate(param.getAccountId());
|
|
|
+ Optional<ArticlePreDistributeAccount> optional = articlePreDistributeAccountRepository.findTopByGhId(param.getGhId());
|
|
|
Set<String> articles = new HashSet<>();
|
|
|
- if (articlePreDistributeAccount != null && StringUtils.isNotEmpty(articlePreDistributeAccount.getArticleList())) {
|
|
|
- List<String[]> list = JSONUtils.fromJson(articlePreDistributeAccount.getArticleList(), new TypeToken<List<String[]>>() {
|
|
|
+ if (optional.isPresent() && StringUtils.isNotEmpty(optional.get().getArticleList())) {
|
|
|
+ List<String[]> list = JSONUtils.fromJson(optional.get().getArticleList(), new TypeToken<List<String[]>>() {
|
|
|
}, Collections.emptyList());
|
|
|
for (String[] s : list) {
|
|
|
articles.add(s[0]);
|
|
@@ -48,7 +47,7 @@ public class AccountPreDistributeStrategy implements FilterStrategy {
|
|
|
|
|
|
for (Content content : contents) {
|
|
|
if (StringUtils.equals(pools[2], content.getContentPoolType())) {
|
|
|
- if (articles.contains(content.getId())) {
|
|
|
+ if (articles.contains(content.getCrawlerChannelContentId())) {
|
|
|
result.add(content.getId());
|
|
|
}
|
|
|
} else {
|