|
|
@@ -44,32 +44,37 @@ public class NewMatchVideoJob {
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
for (MatchContentItem matchContentItem : matchContentItemList) {
|
|
|
- NewMatchVideoExample example = new NewMatchVideoExample();
|
|
|
- example.createCriteria().andContentIdEqualTo(matchContentItem.getProduceContentId());
|
|
|
- List<NewMatchVideo> newMatchVideos = newMatchVideoMapper.selectByExample(example);
|
|
|
- if (CollectionUtils.isEmpty(newMatchVideos)) {
|
|
|
- newMatchVideoService.addMatchVideo(matchContentItem);
|
|
|
- } else {
|
|
|
- NewMatchVideo newMatchVideo = newMatchVideos.get(0);
|
|
|
- if (NewContentStatusEnum.isSuccess(newMatchVideo.getContentStatus())) {
|
|
|
- MatchContentStatusParam matchContentStatusParam = new MatchContentStatusParam();
|
|
|
- matchContentStatusParam.setProduceContentId(newMatchVideo.getContentId());
|
|
|
- matchContentStatusParam.setStatus(NewMatchResultStatusEnum.SUCCESS.getStatusCode());
|
|
|
- boolean res = aigcService.updateMatchContentStatus(matchContentStatusParam);
|
|
|
- if (res) {
|
|
|
- AuditContentRequest auditContentRequest = new AuditContentRequest();
|
|
|
- auditContentRequest.setContentId(newMatchVideo.getContentId());
|
|
|
- auditContentRequest.setFlowPoolLevel(newMatchVideo.getFlowPoolLevel());
|
|
|
- matchService.addAudit(auditContentRequest);
|
|
|
- }
|
|
|
+ try {
|
|
|
+ NewMatchVideoExample example = new NewMatchVideoExample();
|
|
|
+ example.createCriteria().andContentIdEqualTo(matchContentItem.getProduceContentId());
|
|
|
+ List<NewMatchVideo> newMatchVideos = newMatchVideoMapper.selectByExample(example);
|
|
|
+ if (CollectionUtils.isEmpty(newMatchVideos)) {
|
|
|
+ newMatchVideoService.addMatchVideo(matchContentItem);
|
|
|
+ } else {
|
|
|
+ NewMatchVideo newMatchVideo = newMatchVideos.get(0);
|
|
|
+ if (NewContentStatusEnum.isSuccess(newMatchVideo.getContentStatus())) {
|
|
|
+ MatchContentStatusParam matchContentStatusParam = new MatchContentStatusParam();
|
|
|
+ matchContentStatusParam.setProduceContentId(newMatchVideo.getContentId());
|
|
|
+ matchContentStatusParam.setStatus(NewMatchResultStatusEnum.SUCCESS.getStatusCode());
|
|
|
+ boolean res = aigcService.updateMatchContentStatus(matchContentStatusParam);
|
|
|
+ if (res) {
|
|
|
+ AuditContentRequest auditContentRequest = new AuditContentRequest();
|
|
|
+ auditContentRequest.setContentId(newMatchVideo.getContentId());
|
|
|
+ auditContentRequest.setFlowPoolLevel(newMatchVideo.getFlowPoolLevel());
|
|
|
+ matchService.addAudit(auditContentRequest);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ if (NewContentStatusEnum.isFail(newMatchVideo.getContentStatus())) {
|
|
|
+ MatchContentStatusParam matchContentStatusParam = new MatchContentStatusParam();
|
|
|
+ matchContentStatusParam.setProduceContentId(newMatchVideo.getContentId());
|
|
|
+ matchContentStatusParam.setStatus(NewMatchResultStatusEnum.FAIL.getStatusCode());
|
|
|
+ aigcService.updateMatchContentStatus(matchContentStatusParam);
|
|
|
+ }
|
|
|
}
|
|
|
- if (NewContentStatusEnum.isFail(newMatchVideo.getContentStatus())) {
|
|
|
- MatchContentStatusParam matchContentStatusParam = new MatchContentStatusParam();
|
|
|
- matchContentStatusParam.setProduceContentId(newMatchVideo.getContentId());
|
|
|
- matchContentStatusParam.setStatus(NewMatchResultStatusEnum.FAIL.getStatusCode());
|
|
|
- aigcService.updateMatchContentStatus(matchContentStatusParam);
|
|
|
- }
|
|
|
+ } catch (Exception e) {
|
|
|
+ LarkRobotUtil.sendMessage("matchContentJob异常,contentId:"+matchContentItem.getProduceContentId()+", 请及时查看,<at user_id=\"g6732afb\">王云鹏</at>");
|
|
|
+ log.error("matchContentJob error", e);
|
|
|
}
|
|
|
}
|
|
|
return ReturnT.SUCCESS;
|