Bläddra i källkod

Merge branch 'dev-xym-update-match' of Server/long-article-manage into master

xueyiming 1 månad sedan
förälder
incheckning
55152f45a8

+ 27 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -89,6 +89,9 @@ public class CoreServiceImpl implements CoreService {
     @Autowired
     private GroupSendResultMapper groupSendResultMapper;
 
+    @Autowired
+    private MatchVideoServiceImpl matchVideoService;
+
     @ApolloJsonValue("${fwhGhIdList:[]}")
     private List<String> fwhGhIdList;
 
@@ -355,8 +358,7 @@ public class CoreServiceImpl implements CoreService {
                             MatchVideo matchVideo = contentService.getContent(matchContent.getSourceId(),
                                     matchContent.getGhId(), PublicFlagEnum.NOT_PUBLIC.getStatusCode());
                             if (matchVideo != null) {
-                                Integer contentStatus = matchVideo.getContentStatus();
-                                if (ContentStatusEnum.isSuccess(contentStatus)) {
+                                if (ContentStatusEnum.isSuccess(matchVideo.getContentStatus())) {
                                     MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
                                     statusParam.setStatus(MatchResultStatusEnum.SUCCESS.getStatusCode());
                                     statusParam.setPublishContentId(matchContent.getPublishContentId());
@@ -364,15 +366,36 @@ public class CoreServiceImpl implements CoreService {
                                     contentService.addMatchContent(matchVideo, matchContent.getPublishContentId());
                                     continue;
                                 }
-                                if (ContentStatusEnum.isFail(contentStatus)) {
+                                if (ContentStatusEnum.isFail(matchVideo.getContentStatus())) {
                                     MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
                                     statusParam.setStatus(MatchResultStatusEnum.FAIL.getStatusCode());
                                     statusParam.setPublishContentId(matchContent.getPublishContentId());
-                                    String errorMessage = ContentStatusEnum.getErrorMessage(contentStatus);
+                                    String errorMessage = ContentStatusEnum.getErrorMessage(matchVideo.getContentStatus());
                                     statusParam.setErrorMsg(errorMessage);
                                     aigcService.updateMatchMiniprogramStatus(statusParam);
                                     contentService.addMatchContent(matchVideo, matchContent.getPublishContentId());
                                 }
+                                if (matchVideoService.existMatchVideoResult(matchVideo)) {
+                                    MatchVideo matchVideo1 = contentService.getContent(matchContent.getSourceId(),
+                                            matchContent.getGhId(), PublicFlagEnum.NOT_PUBLIC.getStatusCode());
+                                    if (ContentStatusEnum.isSuccess(matchVideo1.getContentStatus())) {
+                                        MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
+                                        statusParam.setStatus(MatchResultStatusEnum.SUCCESS.getStatusCode());
+                                        statusParam.setPublishContentId(matchContent.getPublishContentId());
+                                        aigcService.updateMatchMiniprogramStatus(statusParam);
+                                        contentService.addMatchContent(matchVideo, matchContent.getPublishContentId());
+                                        continue;
+                                    }
+                                    if (ContentStatusEnum.isFail(matchVideo1.getContentStatus())) {
+                                        MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
+                                        statusParam.setStatus(MatchResultStatusEnum.FAIL.getStatusCode());
+                                        statusParam.setPublishContentId(matchContent.getPublishContentId());
+                                        String errorMessage = ContentStatusEnum.getErrorMessage(matchVideo1.getContentStatus());
+                                        statusParam.setErrorMsg(errorMessage);
+                                        aigcService.updateMatchMiniprogramStatus(statusParam);
+                                        contentService.addMatchContent(matchVideo, matchContent.getPublishContentId());
+                                    }
+                                }
                             } else {
                                 MiniprogramCardRequest request = new MiniprogramCardRequest();
                                 request.setGhId(matchContent.getGhId());

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/MatchVideoServiceImpl.java

@@ -642,7 +642,7 @@ public class MatchVideoServiceImpl {
         matchVideoMapper.updateByPrimaryKeySelective(matchVideo);
     }
 
-    private boolean existMatchVideoResult(MatchVideo matchVideo) {
+    public boolean existMatchVideoResult(MatchVideo matchVideo) {
 
         //先查询缓存  缓存中存在直接返回结果
         String key = String.format(EXIST_RESULT_KEY, matchVideo.getContentId());