|
@@ -3,6 +3,7 @@ package com.tzld.longarticle.recommend.server.service.recommend;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishContentStatusEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.longArticle.ArticleVideoAuditStatusEnum;
|
|
|
+import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.longArticle.ArticleAuditMapper;
|
|
@@ -278,18 +279,35 @@ public class ArticleVideoAuditService {
|
|
|
audit.setAuditAccount(auditUser.get(per));
|
|
|
titleAuditRepository.save(audit);
|
|
|
}
|
|
|
- // 内容生成计划id处理
|
|
|
- List<LongArticleTitleAudit> list = titleAuditRepository.getByProducePlanIdIsNull();
|
|
|
- List<String> ids = list.stream().map(LongArticleTitleAudit::getContentId).collect(Collectors.toList());
|
|
|
- List<ProducePlanExeRecord> exeRecordList = producePlanExeRecordRepository.findByPlanExeIdIn(ids);
|
|
|
- Map<String, String> map = exeRecordList.stream().collect(Collectors.toMap(ProducePlanExeRecord::getPlanExeId, ProducePlanExeRecord::getPlanId));
|
|
|
- for (LongArticleTitleAudit titleAudit : list) {
|
|
|
- String planId = map.get(titleAudit.getContentId());
|
|
|
- if (StringUtils.hasText(planId)) {
|
|
|
- titleAudit.setProducePlanId(planId);
|
|
|
- titleAuditRepository.save(titleAudit);
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void addAudit(ArticleVideoAuditAddAuditParam param) {
|
|
|
+ ProducePlanExeRecord exeRecord = producePlanExeRecordRepository.getByPlanExeId(param.getContentId());
|
|
|
+ List<String> auditUser = Arrays.asList("a","b","c","d","e","f","g","h","i","j");
|
|
|
+ Random random = new Random();
|
|
|
+ int index = random.nextInt(auditUser.size());
|
|
|
+ String auditAccount = auditUser.get(index);
|
|
|
+ int status = ArticleVideoAuditStatusEnum.WAITING.getCode();
|
|
|
+ if (!Objects.equals(param.getFlowPoolLevel(), ContentPoolEnum.autoArticlePoolLevel4.getContentPool())) {
|
|
|
+ if (Objects.nonNull(exeRecord)) {
|
|
|
+ String channelContentId = exeRecord.getChannelContentId();
|
|
|
+ ArticlePoolPromotionSource source = articlePoolPromotionSourceRepository.getByChannelContentId(channelContentId);
|
|
|
+ if (Objects.nonNull(source) && source.getStatus() == 1 && source.getDeleted() == 0) {
|
|
|
+ status = ArticleVideoAuditStatusEnum.PASS.getCode();
|
|
|
+ auditAccount = "sys";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- return ReturnT.SUCCESS;
|
|
|
+ LongArticleTitleAudit item = new LongArticleTitleAudit();
|
|
|
+ item.setContentId(param.getContentId());
|
|
|
+ item.setStatus(status);
|
|
|
+ item.setFlowPoolLevel(param.getFlowPoolLevel());
|
|
|
+ item.setCreateTimestamp(System.currentTimeMillis());
|
|
|
+ if (Objects.nonNull(exeRecord)) {
|
|
|
+ item.setProducePlanId(exeRecord.getPlanId());
|
|
|
+ }
|
|
|
+ item.setAuditAccount(auditAccount);
|
|
|
+ titleAuditRepository.save(item);
|
|
|
}
|
|
|
}
|