|
|
@@ -1,8 +1,8 @@
|
|
|
package com.tzld.supply.job;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
-import com.hankcs.hanlp.HanLP;
|
|
|
import com.tzld.supply.api.DeepSeekApiService;
|
|
|
import com.tzld.supply.common.enums.SpiderContentScreenStatusEnum;
|
|
|
import com.tzld.supply.common.enums.SpiderContentStatusEnum;
|
|
|
@@ -45,7 +45,11 @@ public class ContentScreenJob {
|
|
|
@Value("${deepseek.pq-improve-narration-script-prompt}")
|
|
|
private String pqNarrationScriptPrompt;
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 粗筛
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@XxlJob("contentRoughScreenJob")
|
|
|
public ReturnT<String> contentRoughScreenJob(String param) {
|
|
|
List<SpiderContent> contentList = getRoughScreenSpiderContent();
|
|
|
@@ -94,6 +98,11 @@ public class ContentScreenJob {
|
|
|
return spiderContentMapper.selectByExample(example);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 精筛
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@XxlJob("contentPrecisionScreenJob")
|
|
|
public ReturnT<String> contentPrecisionScreenJob(String param) {
|
|
|
List<SpiderContent> contentList = spiderMapperExt.getRoughScreenSpiderContentHasContent();
|
|
|
@@ -117,6 +126,9 @@ public class ContentScreenJob {
|
|
|
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 {
|
|
|
@@ -139,6 +151,11 @@ public class ContentScreenJob {
|
|
|
return SpiderContentScreenStatusEnum.PASSED.getCode();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 票圈标题改写生成
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@XxlJob("contentTitleProduceJob")
|
|
|
public ReturnT<String> contentTitleProduceJob(String param) {
|
|
|
Long startTime = DateUtils.getTodayStart();
|
|
|
@@ -147,7 +164,7 @@ public class ContentScreenJob {
|
|
|
}
|
|
|
Long endTime = startTime + 86400 * 1000;
|
|
|
List<SpiderContent> contentList = spiderMapperExt.getExportContentList(
|
|
|
- Lists.newArrayList(SpiderContentStatusEnum.PASSED.getCode(), SpiderContentStatusEnum.ABANDONED.getCode()),
|
|
|
+ Lists.newArrayList(SpiderContentStatusEnum.PASSED.getCode()),
|
|
|
SpiderContentScreenStatusEnum.PASSED.getCode(), startTime, endTime);
|
|
|
if (contentList.isEmpty()) {
|
|
|
return ReturnT.SUCCESS;
|
|
|
@@ -177,6 +194,11 @@ public class ContentScreenJob {
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 口播生成
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@XxlJob("contentNarrationScriptProduceJob")
|
|
|
public ReturnT<String> contentNarrationScriptProduceJob(String param) {
|
|
|
Long startTime = DateUtils.getTodayStart();
|
|
|
@@ -185,7 +207,7 @@ public class ContentScreenJob {
|
|
|
}
|
|
|
Long endTime = startTime + 86400 * 1000;
|
|
|
List<SpiderContent> contentList = spiderMapperExt.getExportContentList(
|
|
|
- Lists.newArrayList(SpiderContentStatusEnum.PASSED.getCode(), SpiderContentStatusEnum.ABANDONED.getCode()),
|
|
|
+ Lists.newArrayList(SpiderContentStatusEnum.PASSED.getCode()),
|
|
|
SpiderContentScreenStatusEnum.PASSED.getCode(), startTime, endTime);
|
|
|
if (contentList.isEmpty()) {
|
|
|
return ReturnT.SUCCESS;
|
|
|
@@ -206,10 +228,8 @@ public class ContentScreenJob {
|
|
|
log.error(result.getResponse().getChoices().get(0).getMessage().getContent());
|
|
|
}
|
|
|
}
|
|
|
- List<String> keyWords = HanLP.extractKeyword(content.getContent(), 3);
|
|
|
if (StringUtils.isNotBlank(narrationScript)) {
|
|
|
content.setPqImproveNarrationScript(narrationScript);
|
|
|
- content.setKeyword(JSONObject.toJSONString(keyWords));
|
|
|
content.setUpdateTime(System.currentTimeMillis());
|
|
|
spiderContentMapper.updateByPrimaryKeySelective(content);
|
|
|
}
|