...
|
...
|
@@ -13,7 +13,6 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.xml.bind.ValidationException;
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@Service
|
...
|
...
|
@@ -159,11 +158,7 @@ public class PublicArticleService { |
|
|
public Integer getPublicArticleIdByGrassArticleId(final Integer grassArticleId) {
|
|
|
final GrassArticle grassArticle = grassArticleService.getGrassArticleById(grassArticleId);
|
|
|
if (grassArticle == null) {
|
|
|
final List<PublicArticle> list = publicArticleRepository.findByArticleIdPlus(grassArticleId, ServiceConstant.articleTypesAll);
|
|
|
// 如果只有一条记录则返回
|
|
|
if (list != null && list.size() == 1) return list.get(0).getId();
|
|
|
log.error("the grass article data had deleted by someone, with grassArticleId {}, and in public database, there have more than one data, {}",
|
|
|
grassArticleId, list.toString());
|
|
|
log.error("the grass article data had deleted by someone, with grassArticleId {}, this operation may happen when sql delete", grassArticleId);
|
|
|
return null;
|
|
|
}
|
|
|
if (grassArticle != null && ServiceConstant.ARTICLE_TYPE_NOW.equals(grassArticle.getArticleType())) {
|
...
|
...
|
|