...
|
...
|
@@ -155,18 +155,14 @@ public class PublicArticleService { |
|
|
* @param grassArticleId
|
|
|
* @return
|
|
|
*/
|
|
|
public Integer getPublicArticleIdStage1(final Integer grassArticleId) {
|
|
|
public Integer getPublicArticleIdByGrassArticleId(final Integer grassArticleId) {
|
|
|
final GrassArticle grassArticle = grassArticleService.getGrassArticleById(grassArticleId);
|
|
|
return getPublicArticleIdStage2(grassArticle);
|
|
|
}
|
|
|
|
|
|
public Integer getPublicArticleIdStage2(final GrassArticle grassArticle) {
|
|
|
if (grassArticle != null && grassArticle.getArticleType() == ServiceConstant.ARTICLE_TYPE_NOW) {
|
|
|
if (grassArticle != null && ServiceConstant.ARTICLE_TYPE_NOW.equals(grassArticle.getArticleType())) {
|
|
|
final PublicArticle result = publicArticleRepository.findByRelateIdAndArticleType(grassArticle.getRelateId(), ServiceConstant.ARTICLE_TYPE_NOW);
|
|
|
return result == null ? null : result.getId();
|
|
|
} else {
|
|
|
return publicArticleRepository.findByArticleId(grassArticle.getId(), ServiceConstant.articleTypes);
|
|
|
return publicArticleRepository.findByArticleId(grassArticleId, ServiceConstant.articleTypes);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|