提交 5e8d1b75 作者: yanxin

手动新增数据可选择是否需要判重处理

上级 74b47ee7
...@@ -330,13 +330,17 @@ public class InformationController { ...@@ -330,13 +330,17 @@ public class InformationController {
displayInfo.setContent(Jsoup.parse(contentWithTag).text()); displayInfo.setContent(Jsoup.parse(contentWithTag).text());
} }
Integer category = (Integer) jsonObject.get("category"); Integer category = (Integer) jsonObject.get("category");
boolean modelFlag = pythonUtil.judgeDuplicate(displayInfo.getId(), displayInfo.getTitle(), displayInfo.getContent(), displayInfo.getSourceAddress(), displayInfo.getSubjectId()); //判断是否需要判重
if (modelFlag) { Integer isDuplicate = jsonObject.getInteger("isDuplicate");
return Result.FAIL(210, "判重存在重复资讯!"); if (isDuplicate == null || isDuplicate == 1) {
} else { boolean modelFlag = pythonUtil.judgeDuplicate(displayInfo.getId(), displayInfo.getTitle(), displayInfo.getContent(), displayInfo.getSourceAddress(), displayInfo.getSubjectId());
boolean repeat = informationService.duplicationByTitleOrSourceAddress(displayInfo); if (modelFlag) {
if (!repeat) { return Result.FAIL(210, "判重存在重复资讯!");
return Result.FAIL(211, "专题库存在重复资讯!"); } else {
boolean repeat = informationService.duplicationByTitleOrSourceAddress(displayInfo);
if (!repeat) {
return Result.FAIL(211, "专题库存在重复资讯!");
}
} }
} }
informationService.add(displayInfo, category, userVo); informationService.add(displayInfo, category, userVo);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论