|
@@ -468,10 +468,10 @@ public class ContentScreenJob {
|
|
|
SpiderContent updateContent = new SpiderContent();
|
|
SpiderContent updateContent = new SpiderContent();
|
|
|
updateContent.setId(content.getId());
|
|
updateContent.setId(content.getId());
|
|
|
updateContent.setStatus(SpiderContentStatusEnum.ABANDONED.getCode());
|
|
updateContent.setStatus(SpiderContentStatusEnum.ABANDONED.getCode());
|
|
|
- updateContent.setAiRoughStatus(SpiderContentScreenStatusEnum.ABANDONED.getCode());
|
|
|
|
|
- updateContent.setAiRoughResult("长时间未完成,自动放弃");
|
|
|
|
|
|
|
+ updateContent.setAiPrecisionStatus(SpiderContentScreenStatusEnum.ABANDONED.getCode());
|
|
|
|
|
+ updateContent.setAiPrecisionResult("长时间未完成,自动放弃");
|
|
|
updateContent.setUpdateTime(System.currentTimeMillis());
|
|
updateContent.setUpdateTime(System.currentTimeMillis());
|
|
|
- spiderContentMapper.updateByPrimaryKeySelective(updateContent);
|
|
|
|
|
|
|
+ spiderContentMapper.updateByPrimaryKeySelective(content);
|
|
|
}
|
|
}
|
|
|
if (Objects.isNull(content.getContent()) || content.getContent().trim().isEmpty()) {
|
|
if (Objects.isNull(content.getContent()) || content.getContent().trim().isEmpty()) {
|
|
|
continue;
|
|
continue;
|
|
@@ -517,6 +517,52 @@ public class ContentScreenJob {
|
|
|
spiderContentMapper.updateByPrimaryKeySelective(updateContent);
|
|
spiderContentMapper.updateByPrimaryKeySelective(updateContent);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ for (SpiderContent content : contentList) {
|
|
|
|
|
+ Long filterTime = DateUtils.getBeforeDayStart(2);
|
|
|
|
|
+ if (content.getCreateTime() < filterTime) {
|
|
|
|
|
+ content.setStatus(SpiderContentStatusEnum.ABANDONED.getCode());
|
|
|
|
|
+ content.setAiPrecisionStatus(SpiderContentScreenStatusEnum.ABANDONED.getCode());
|
|
|
|
|
+ content.setAiPrecisionResult("长时间未完成,自动放弃");
|
|
|
|
|
+ content.setUpdateTime(System.currentTimeMillis());
|
|
|
|
|
+ spiderContentMapper.updateByPrimaryKeySelective(content);
|
|
|
|
|
+ }
|
|
|
|
|
+ String prompt = precisionScreenPrompt.replace("{{title}}", content.getTitle())
|
|
|
|
|
+ .replace("{{content}}", content.getContent());
|
|
|
|
|
+ DeepSeekResult result = deepSeekApiService.requestOfficialApi(prompt, null, null, true);
|
|
|
|
|
+
|
|
|
|
|
+ PrecisionScreenEntity obj = null;
|
|
|
|
|
+ if (result.isSuccess()) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ obj = JSONObject.parseObject(result.getResponse().getChoices().get(0).getMessage().getContent(), PrecisionScreenEntity.class);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error(result.getResponse().getChoices().get(0).getMessage().getContent());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Objects.nonNull(obj)) {
|
|
|
|
|
+ Integer aiPrecisionStatus = checkPrecisionScreenStatus(obj);
|
|
|
|
|
+ content.setAiPrecisionStatus(aiPrecisionStatus);
|
|
|
|
|
+ content.setAiPrecisionResult(JSONObject.toJSONString(obj));
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(obj.getKeywords())) {
|
|
|
|
|
+ content.setKeyword(JSONObject.toJSONString(obj.getKeywords()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (aiPrecisionStatus == SpiderContentScreenStatusEnum.PASSED.getCode()) {
|
|
|
|
|
+ content.setStatus(SpiderContentStatusEnum.PASSED.getCode());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ content.setStatus(SpiderContentStatusEnum.ABANDONED.getCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ content.setUpdateTime(System.currentTimeMillis());
|
|
|
|
|
+ spiderContentMapper.updateByPrimaryKeySelective(content);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ content.setStatus(SpiderContentStatusEnum.ABANDONED.getCode());
|
|
|
|
|
+ content.setAiPrecisionStatus(SpiderContentScreenStatusEnum.ABANDONED.getCode());
|
|
|
|
|
+ content.setAiPrecisionResult(JSONObject.toJSONString(result));
|
|
|
|
|
+ content.setUpdateTime(System.currentTimeMillis());
|
|
|
|
|
+ spiderContentMapper.updateByPrimaryKeySelective(content);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return ReturnT.SUCCESS;
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
}
|
|
|
|
|
|