Procházet zdrojové kódy

coding:广告线索绑定

zhangqin před 16 hodinami
rodič
revize
cca9cb4c15

+ 2 - 2
fs-ad-new-api/src/main/java/com/fs/app/controller/LandingPageController.java

@@ -31,7 +31,7 @@ public class LandingPageController {
      * 落地页访问
      */
     @PostMapping("/h5/home")
-    public Result<LandingIndexRes> track(
+    public Result<LandingIndexRes> h5Home(
             @RequestBody LandingIndexReq req) {
         log.info("落地页访问追踪:req={}", req);
         // 查询落地页模板
@@ -42,7 +42,7 @@ public class LandingPageController {
      * 小程序访问
      */
     @PostMapping("/mini/home")
-    public Result<LandingIndexRes> track(@RequestBody WeChatLandingIndexReq req) {
+    public Result<LandingIndexRes> miniHome(@RequestBody WeChatLandingIndexReq req) {
         return Result.success(facadeService.getWxLandingIndexBySiteId(req));
     }
 

+ 13 - 0
fs-ad-new-api/src/main/java/com/fs/app/controller/TrackingController.java

@@ -1,8 +1,10 @@
 package com.fs.app.controller;
 
 import com.fs.app.facade.CallbackProcessingFacadeService;
+import com.fs.app.facade.IConversionService;
 import com.fs.common.result.Result;
 import com.fs.newAdv.dto.req.QwExternalIdBindTrackReq;
+import com.fs.newAdv.enums.SystemEventTypeEnum;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -24,6 +26,8 @@ public class TrackingController {
     private CallbackProcessingFacadeService facadeService;
 
 
+    @Autowired
+    private IConversionService conversionService;
     /**
      * 监测链接端口
      *
@@ -56,4 +60,13 @@ public class TrackingController {
         return Result.success();
     }
 
+    /**
+     * 绑定企微用户与线索
+     */
+    @PostMapping("/bind/qwTrack/test/{id1}/{id2}")
+    public Result<String> qwExternalIdBindTrack1(@PathVariable String id1, @PathVariable String id2) {
+        boolean success = conversionService.reportTrackingToAdvertiser(SystemEventTypeEnum.getByCode(id1), id2);
+        return Result.success();
+    }
+
 }

+ 2 - 0
fs-ad-new-api/src/main/java/com/fs/app/facade/CallbackProcessingFacadeServiceImpl.java

@@ -91,6 +91,8 @@ public class CallbackProcessingFacadeServiceImpl implements CallbackProcessingFa
         switch (byCode) {
             case OCEANENGINE:
             case TENCENT:
+                traceId = allParams.get("clickid");
+                break;
             case OPPO:
                 traceId = allParams.get("click_id");
                 break;

+ 1 - 0
fs-service/src/main/java/com/fs/newAdv/constant/MqTopicConstant.java

@@ -24,4 +24,5 @@ public class MqTopicConstant {
      * 转化追踪consumer
      */
     public static final String CONVERSION_TRACKING_TOPIC_CONSUMER_GROUP = "conversion-topic-tracking-consumer-group";
+    public static final String CONVERSION_TRACKING_GROUP = "conversion-tracking-group";
 }

+ 8 - 8
fs-service/src/main/java/com/fs/newAdv/enums/SystemEventTypeEnum.java

@@ -5,14 +5,14 @@ import lombok.Getter;
 @Getter
 public enum SystemEventTypeEnum {
 
-    GROUP_TODAY("1", "当日加群"),
-    WEI_CHAT_TODAY("2", "当日加微"),
-    TO_CLASS_AND_GROUP_TODAY("3", "直播到课且当日加群"),
-    TO_CLASS_AND_WEI_CHAT_TODAY("4", "直播到课且当日加微"),
-    BUY_ORDER("5", "商品购买订单"),
-    AUTH_TODAY_CREATE("6", "微信授权且当日创建"),
-    COMPLETE_CLASS_AND_GROUP_TODAY("7", "直播完课且当日加群"),
-    COMPLETE_CLASS_AND_WEI_CHAT_TODAY("8", "直播完课且当日加微");
+    GROUP_TODAY("event1", "当日加群"),
+    WEI_CHAT_TODAY("event2", "当日加微"),
+    TO_CLASS_AND_GROUP_TODAY("event3", "直播到课且当日加群"),
+    TO_CLASS_AND_WEI_CHAT_TODAY("event4", "直播到课且当日加微"),
+    BUY_ORDER("event5", "商品购买订单"),
+    AUTH_TODAY_CREATE("event6", "微信授权且当日创建"),
+    COMPLETE_CLASS_AND_GROUP_TODAY("event7", "直播完课且当日加群"),
+    COMPLETE_CLASS_AND_WEI_CHAT_TODAY("event8", "直播完课且当日加微");
 
     private final String code;
     private final String description;

+ 1 - 1
fs-service/src/main/java/com/fs/newAdv/integration/client/AbstractApiClient.java

@@ -74,7 +74,7 @@ public abstract class AbstractApiClient implements IApiClient {
     protected String getAccessToken(Long promotionAccountId) {
         PromotionAccount byId = promotionAccountService.getById(promotionAccountId);
         // 判断token是否过期 提前1小时刷新
-        if (byId.getExpireTime().isBefore(LocalDateTime.now().plusHours(1))) {
+        if (ObjectUtil.isEmpty(byId.getExpireTime()) || byId.getExpireTime().isBefore(LocalDateTime.now().plusHours(1))) {
             // 获取请求参数
             IApiClient apiClient = advertiserHandlerFactory.getApiClient(AdvertiserTypeEnum.getByCode(byId.getAdvertiserId()));
             IAccessTokenClient tokenClient = (IAccessTokenClient) apiClient;

+ 1 - 1
fs-service/src/main/java/com/fs/newAdv/service/impl/SiteServiceImpl.java

@@ -25,7 +25,7 @@ public class SiteServiceImpl extends ServiceImpl<SiteMapper, Site> implements IS
     @Transactional(rollbackFor = Exception.class)
     public void createSite(Site site) {
         this.save(site);
-        site.setSiteUrl("https://" + site.getLaunchDomain() + "/#/pages/index/index?siteId=" + site.getId());
+        site.setSiteUrl("https://" + site.getLaunchDomain() + "/pages/index/index?siteId=" + site.getId());
         this.updateById(site);
     }