|
@@ -1,6 +1,7 @@
|
|
|
package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.tzld.piaoquan.longarticle.common.enums.ContentStatusEnum;
|
|
|
import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
|
|
@@ -151,37 +152,27 @@ public class CoreServiceImpl implements CoreService {
|
|
|
continue;
|
|
|
}
|
|
|
//没有待匹配的文章 更新状态为1
|
|
|
- if (longArticleSystemContentVO.getTotalCount() == 0) {
|
|
|
- planAccountService.updateMatchStatus(1, planAccount.getId());
|
|
|
+ if (longArticleSystemContentVO.getTotalCount() == 0
|
|
|
+ || CollectionUtils.isEmpty(longArticleSystemContentVO.getContentItemList())) {
|
|
|
continue;
|
|
|
}
|
|
|
for (ContentItemVO contentItemVO : longArticleSystemContentVO.getContentItemList()) {
|
|
|
MatchVideo content = contentService.getContent(contentItemVO.getSourceId(), planAccount.getGhId());
|
|
|
if (content != null) {
|
|
|
Integer contentStatus = content.getContentStatus();
|
|
|
- if (contentStatus == 3 || contentStatus == 4) {
|
|
|
+ if (ContentStatusEnum.isSuccess(contentStatus)) {
|
|
|
MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
|
|
|
statusParam.setStatus(2);
|
|
|
statusParam.setPublishContentId(contentItemVO.getPublishContentId());
|
|
|
aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
continue;
|
|
|
}
|
|
|
- if (contentStatus == 95 || contentStatus == 96 || contentStatus == 97 || contentStatus == 99) {
|
|
|
+ if (ContentStatusEnum.isFail(contentStatus)) {
|
|
|
MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
|
|
|
statusParam.setStatus(3);
|
|
|
statusParam.setPublishContentId(contentItemVO.getPublishContentId());
|
|
|
- if (contentStatus == 95) {
|
|
|
- statusParam.setErrorMsg("KIMI识别文章风险不处理");
|
|
|
- }
|
|
|
- if (contentStatus == 96) {
|
|
|
- statusParam.setErrorMsg("文章品类处于账号的负向品类中");
|
|
|
- }
|
|
|
- if (contentStatus == 97) {
|
|
|
- statusParam.setErrorMsg("文章晋级或者退场");
|
|
|
- }
|
|
|
- if (contentStatus == 99) {
|
|
|
- statusParam.setErrorMsg("匹配视频失败");
|
|
|
- }
|
|
|
+ String errorMessage = ContentStatusEnum.getErrorMessage(contentStatus);
|
|
|
+ statusParam.setErrorMsg(errorMessage);
|
|
|
aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
}
|
|
|
} else {
|
|
@@ -210,10 +201,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
}
|
|
|
LocalTime currentTime = TimeZoneUtil
|
|
|
.currentTime(Optional.ofNullable(timezone).orElse(TimeZoneUtil.Timezone.china));
|
|
|
- if (currentTime.isAfter(LocalTime.parse(startWindow)) && currentTime.isBefore(LocalTime.parse(endWindow))) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
+ return currentTime.isAfter(LocalTime.parse(startWindow)) && currentTime.isBefore(LocalTime.parse(endWindow));
|
|
|
}
|
|
|
|
|
|
private boolean checkPlanAccount(PlanAccount planAccount) {
|