Просмотр исходного кода

企微合作 pageUrl增加isSpecialLayer特殊手层标识

wangyunpeng 6 часов назад
Родитель
Сommit
94fda6e31b

+ 8 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformDatastatController.java

@@ -136,4 +136,12 @@ public class ContentPlatformDatastatController {
         return CommonResponse.success();
         return CommonResponse.success();
     }
     }
 
 
+    @ApiOperation(value = "企微合作账号层级类型同步任务", hidden = true)
+    @GetMapping("/job/syncQwHzAccountLayerTypeJob")
+    @JwtIgnore
+    public CommonResponse<String> syncQwHzAccountLayerTypeJob(String dateStr) {
+        job.syncQwHzAccountLayerTypeJob(dateStr);
+        return CommonResponse.success();
+    }
+
 }
 }

+ 23 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDatastatJob.java

@@ -14,6 +14,7 @@ import com.tzld.piaoquan.api.model.vo.WxAccountDatastatVO;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.OdpsUtil;
 import com.tzld.piaoquan.growth.common.utils.OdpsUtil;
+import com.tzld.piaoquan.growth.common.utils.RedisUtils;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -58,6 +59,9 @@ public class ContentPlatformDatastatJob {
     @Autowired
     @Autowired
     private ContentPlatformPlanService planService;
     private ContentPlatformPlanService planService;
 
 
+    @Autowired
+    private RedisUtils redisUtils;
+
     @ApolloJsonValue("${unit.price.min:{\"gzh_autoReply\":0.1,\"fwh_push\":0.1,\"qw\":0.15}}")
     @ApolloJsonValue("${unit.price.min:{\"gzh_autoReply\":0.1,\"fwh_push\":0.1,\"qw\":0.15}}")
     private Map<String, Double> unitPriceMinConfig;
     private Map<String, Double> unitPriceMinConfig;
 
 
@@ -1104,4 +1108,23 @@ public class ContentPlatformDatastatJob {
         }
         }
         return null;
         return null;
     }
     }
+
+    @XxlJob("syncQwHzAccountLayerTypeJob")
+    public ReturnT<String> syncQwHzAccountLayerTypeJob(String param) {
+        String sql = "SELECT partner_channel, layer_type FROM loghubods.feishu_wechat_qw_hz_account_base;";
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        if (CollectionUtils.isEmpty(dataList)) {
+            log.info("syncQwHzAccountLayerTypeJob no data found");
+            return ReturnT.SUCCESS;
+        }
+        for (Record record : dataList) {
+            String partnerChannel = (String) record.get(0);
+            String layerType = (String) record.get(1);
+            if (StringUtils.hasText(partnerChannel) && StringUtils.hasText(layerType)) {
+                redisUtils.set("cp:qw_hz_layer_type:" + partnerChannel, layerType, RedisUtils.DEFAULT_EXPIRE_TIME);
+            }
+        }
+        log.info("syncQwHzAccountLayerTypeJob done, size: {}", dataList.size());
+        return ReturnT.SUCCESS;
+    }
 }
 }

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

@@ -1727,6 +1727,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             String pageUrl = messageAttachmentService.getPage(loginUser.getChannel(), carrierId,
             String pageUrl = messageAttachmentService.getPage(loginUser.getChannel(), carrierId,
                     "dyyqw", "企微", QwPlanTypeEnum.from(param.getType()).getDescription(),
                     "dyyqw", "企微", QwPlanTypeEnum.from(param.getType()).getDescription(),
                     "位置1", videoParam.getVideoId(), videoParam.getExperimentId());
                     "位置1", videoParam.getVideoId(), videoParam.getExperimentId());
+            // 判断是否为特殊首层,追加 isSpecialLayer 参数
+            String layerType = redisUtils.getString("cp:qw_hz_layer_type:" + loginUser.getChannel());
+            if ("特殊".equals(layerType)) {
+                pageUrl = pageUrl + "%26isSpecialLayer%3D1";
+            }
             //pageUrl = videoMultiService.setVideoMultiTitleCoverPagePath(videoParam.getVideoId(), pageUrl,
             //pageUrl = videoMultiService.setVideoMultiTitleCoverPagePath(videoParam.getVideoId(), pageUrl,
             //        videoParam.getTitle(), videoParam.getCover());
             //        videoParam.getTitle(), videoParam.getCover());
             String rootSourceId = MessageUtil.getRootSourceId(pageUrl);
             String rootSourceId = MessageUtil.getRootSourceId(pageUrl);