...
|
...
|
@@ -142,7 +142,7 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
int pageSize = 100;
|
|
|
int totalPage = total % pageSize ==0 ? total / pageSize : (total / pageSize)+1;
|
|
|
int grass_praise_count=0;
|
|
|
List<Integer> publicArticleIds = Lists.newArrayList();
|
|
|
int public_praise_count=0;
|
|
|
for (int i = 0; i < totalPage; i++) {
|
|
|
Pageable pageReq = PageRequest.of(i, pageSize);
|
|
|
List<GrassArticle> grassArticleList = grassArticleRepository.findAllByCreateTimeAfterAndCreateTimeBeforeAndArticleTypeInAndAuthStatusIn(
|
...
|
...
|
@@ -156,7 +156,8 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
List<PublicArticle> nowPublicArticleList = publicArticleRepository.findAllByRelateIdInAndArticleTypeIn(nowArticleIds, Lists.newArrayList(5));
|
|
|
publicArticleId.addAll(nowPublicArticleList.stream().map(BaseEntity::getId).collect(Collectors.toList()));
|
|
|
}
|
|
|
publicArticleIds.addAll(publicArticleId);
|
|
|
int public_count = publicUserPraiseRepository.countByTargetIdInAndPraiseTypeIsAndSrcChannelIs(publicArticleId, UserPraiseConstant.ARTICLE_PRAISE , 1);
|
|
|
public_praise_count +=public_count;
|
|
|
grass_praise_count +=grass_count;
|
|
|
try {
|
|
|
Thread.sleep(200);
|
...
|
...
|
@@ -167,11 +168,10 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
|
|
|
|
|
|
|
|
|
int public_count = publicUserPraiseRepository.countByTargetIdInAndPraiseTypeIsAndSrcChannelIs(publicArticleIds, UserPraiseConstant.ARTICLE_PRAISE , 1);
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("checkPraiseResult", grass_praise_count == public_count? CHECK_SUCCESS : CHECK_FAIL);
|
|
|
result.put("checkPraiseResult", grass_praise_count == public_praise_count? CHECK_SUCCESS : CHECK_FAIL);
|
|
|
result.put("grass_praise_count", grass_praise_count );
|
|
|
result.put("public_praise_count", public_count );
|
|
|
result.put("public_praise_count", public_praise_count );
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -219,7 +219,7 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
int pageSize = 100;
|
|
|
int totalPage = total % pageSize ==0 ? total / pageSize : (total / pageSize)+1;
|
|
|
int grass_favorite_count = 0;
|
|
|
List<Integer> publicArticleIds = Lists.newArrayList();
|
|
|
int public_favorite_count = 0;
|
|
|
|
|
|
for (int i = 0; i < totalPage; i++) {
|
|
|
Pageable pageReq = PageRequest.of(i, pageSize);
|
...
|
...
|
@@ -236,16 +236,21 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
List<PublicArticle> nowPublicArticleList = publicArticleRepository.findAllByRelateIdInAndArticleTypeIn(nowArticleIds, Lists.newArrayList(5));
|
|
|
publicArticleId.addAll(nowPublicArticleList.stream().map(BaseEntity::getId).collect(Collectors.toList()));
|
|
|
}
|
|
|
publicArticleIds.addAll(publicArticleId);
|
|
|
int public_count = publicUserFavoriteRepository.countByTargetIdInAndFavoriteTypeIsAndSrcChannelIs(publicArticleId, 1 , 1);
|
|
|
grass_favorite_count += grass_count;
|
|
|
public_favorite_count += public_count;
|
|
|
try {
|
|
|
Thread.sleep(200);
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
int public_count = publicUserFavoriteRepository.countByTargetIdInAndFavoriteTypeIsAndSrcChannelIs(publicArticleIds, 1 , 1);
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("checkFavoriteResult", grass_favorite_count == public_count? CHECK_SUCCESS : CHECK_FAIL);
|
|
|
result.put("checkFavoriteResult", grass_favorite_count == public_favorite_count? CHECK_SUCCESS : CHECK_FAIL);
|
|
|
result.put("grass_favorite_count", grass_favorite_count );
|
|
|
result.put("public_favorite_count", public_count );
|
|
|
result.put("public_favorite_count", public_favorite_count );
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -324,7 +329,7 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
int total = grassArticleRepository.countByCreateTimeAfterAndCreateTimeBeforeAndArticleTypeInAndAuthStatusIn(startTimeLong, endTimeLong,needSyncArticleType,needSyncArticleStatus);
|
|
|
int totalPage = total % pageSize ==0 ? total / pageSize : (total / pageSize)+1;
|
|
|
int grass_comment_count = 0;
|
|
|
List<Integer> publicArticleIds = Lists.newArrayList();
|
|
|
int public_comment_count = 0;
|
|
|
|
|
|
for (int i = 0; i < totalPage; i++) {
|
|
|
Pageable pageReq = PageRequest.of(i, pageSize);
|
...
|
...
|
@@ -343,16 +348,22 @@ public class GrassInteractiveDataCheckServiceImpl implements IGrassInteractiveDa |
|
|
List<PublicArticle> nowPublicArticleList = publicArticleRepository.findAllByRelateIdInAndArticleTypeIn(nowArticleIds, Lists.newArrayList(5));
|
|
|
publicArticleId.addAll(nowPublicArticleList.stream().map(BaseEntity::getId).collect(Collectors.toList()));
|
|
|
}
|
|
|
publicArticleIds.addAll(publicArticleId);
|
|
|
int public_count = publicUserCommentRepository.countByArticleIdInAndSrcChannelIs(publicArticleId, 1);
|
|
|
|
|
|
grass_comment_count += grass_count;
|
|
|
public_comment_count += public_count;
|
|
|
try {
|
|
|
Thread.sleep(200);
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
int public_count = publicUserCommentRepository.countByArticleIdInAndSrcChannelIs(publicArticleIds, 1);
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("checkCommentResult", grass_comment_count == public_count? CHECK_SUCCESS : CHECK_FAIL);
|
|
|
result.put("checkCommentResult", grass_comment_count == public_comment_count? CHECK_SUCCESS : CHECK_FAIL);
|
|
|
result.put("grass_comment_count", grass_comment_count);
|
|
|
result.put("public_comment_count", public_count );
|
|
|
result.put("public_comment_count", public_comment_count );
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
|