Browse Source

公众号计划修改

wangyunpeng 2 months ago
parent
commit
e57cfed18b

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java

@@ -36,4 +36,6 @@ public interface ContentPlatformCooperateAccountService {
     void gzhImport(List<String> channels);
 
     ContentPlatformGzhAccount getGzhAccount(String ghId);
+
+    List<ContentPlatformGzhAccount> getAccountListByCreatorId(Long creatorId);
 }

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java

@@ -66,6 +66,8 @@ public interface ContentPlatformPlanService {
 
     void gzhPlanImport(List<String> channels);
 
+    void fwhPlanImport(List<String> channels);
+
     void qwPlanImport(List<String> channels);
 
     void gzhUpdateStagePublishStatus(Long id, Integer stagePublishStatus);

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java

@@ -248,4 +248,11 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
         }
         return null;
     }
+
+    @Override
+    public List<ContentPlatformGzhAccount> getAccountListByCreatorId(Long creatorId) {
+        ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
+        example.createCriteria().andCreateAccountIdEqualTo(creatorId).andStatusEqualTo(1);
+        return gzhAccountMapper.selectByExample(example);
+    }
 }

+ 22 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -157,9 +157,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     videoItemVO.setCustomCover(video.getCustomCover());
                     videoItemVO.setCustomCoverType(video.getCustomCoverType());
                     videoItemVO.setVideo(video.getVideo());
-                    CgiReplyBucketData bucketData = bucketDataMapByGhId.get(video.getVideoId());
-                    if (Objects.nonNull(bucketData)) {
-                        videoItemVO.setPageUrl(bucketData.getMiniPagePath());
+                    if (Objects.nonNull(bucketDataMapByGhId)) {
+                        CgiReplyBucketData bucketData = bucketDataMapByGhId.get(video.getVideoId());
+                        if (Objects.nonNull(bucketData)) {
+                            videoItemVO.setPageUrl(bucketData.getMiniPagePath());
+                        }
                     }
                     videoVOList.add(videoItemVO);
                 }
@@ -616,9 +618,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     continue;
                 }
                 gzhPlan.setAccountId(gzhAccount.getId());
-                gzhPlan.setType(0);
+                gzhPlan.setType(ContentPlatformGzhPlanTypeEnum.AUTO_REPLY.getVal());
                 gzhPlan.setScene(0);
-                gzhPlan.setSelectVideoType(1);
+                gzhPlan.setSelectVideoType(ghDetail.getStrategyStatus());
                 gzhPlan.setPublishStage(PublishStageEnum.USER.getVal());
                 if (StringUtils.hasText(gzhAccount.getExternalId())) {
                     aigcApiService.closeAccountMessagePublishPlan(gzhAccount.getExternalId());
@@ -653,6 +655,21 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
+    @Override
+    public void fwhPlanImport(List<String> channels) {
+        List<ContentPlatformAccount> accountList = accountService.getAccountListByChannels(channels);
+        for (ContentPlatformAccount account : accountList) {
+            Long now = System.currentTimeMillis();
+            List<ContentPlatformGzhAccount> gzhAccountList = cooperateAccountService.getAccountListByCreatorId(account.getId());
+            for (ContentPlatformGzhAccount gzhAccount : gzhAccountList) {
+                if (!StringUtils.hasText(gzhAccount.getExternalId())) {
+                    continue;
+                }
+
+            }
+        }
+    }
+
     @Override
     public void qwPlanImport(List<String> channels) {
         List<AdPutFlowRecordTencent> list = new ArrayList<>();

+ 6 - 0
api-module/src/test/java/com/tzld/piaoquan/api/ContentPlatformTest.java

@@ -32,6 +32,12 @@ public class ContentPlatformTest {
         planService.gzhPlanImport(channels);
     }
 
+    @Test
+    public void testImportFwhPlan() {
+        List<String> channels = Arrays.asList("ml","yy","zh","llf","wxm","hc","xs","wx","yqst","lq","bh","qd","bz","sw","pj","cy","xsy","ls","zqh");
+        planService.fwhPlanImport(channels);
+    }
+
     @Test
     public void testImportQwPlan() {
         List<String> channels = Arrays.asList("ml2025", "mj", "nh", "qc", "tczy", "wb", "xj", "wxm", "xycsd", "shy");