|
|
@@ -47,7 +47,7 @@ public class GetEcigaretteService {
|
|
|
private SourceInfoMapper sourceInfoMapper;
|
|
|
|
|
|
|
|
|
-// @Scheduled(cron = "0 0 5 * * ?")
|
|
|
+ // @Scheduled(cron = "0 0 5 * * ?")
|
|
|
// @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
|
public void execute() {
|
|
|
System.out.println(new Date() + "-------AddArticle-Begin");
|
|
|
@@ -158,23 +158,17 @@ public class GetEcigaretteService {
|
|
|
* 检查是否需要跳过当前标题(适用于"两个至上-诉讼"来源)
|
|
|
*/
|
|
|
private static boolean shouldSkipTobaccoTitle(String sourceName, String title) {
|
|
|
- if (!StringUtils.equals(sourceName, "两个至上-诉讼")) {
|
|
|
- return false;
|
|
|
+ if (StringUtils.equals(sourceName, "两个至上-诉讼")) {
|
|
|
+ // 跳过条件:
|
|
|
+ // 1. 标题为空
|
|
|
+ // 2. 标题不包含 "烟"
|
|
|
+ // 3. 标题包含任意需要排除的关键词
|
|
|
+ String[] excludedKeywords = {"烟店", "零售商", "囚犯", "未成年", "嫌疑人"};
|
|
|
+ return StringUtils.isEmpty(title)
|
|
|
+ || !title.contains("烟")
|
|
|
+ || Arrays.stream(excludedKeywords).anyMatch(title::contains);
|
|
|
}
|
|
|
-
|
|
|
- if (StringUtils.isEmpty(title) || !title.contains("烟")) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // 排除关键词
|
|
|
- String[] excludedKeywords = {"烟店", "零售商", "囚犯","未成年","嫌疑人"};
|
|
|
- for (String keyword : excludedKeywords) {
|
|
|
- if (title.contains(keyword)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false; // 满足所有条件,不跳过
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
public Map<String, String> getDigest(String url) throws IOException {
|