Browse Source

落地页

yumeng 4 years ago
parent
commit
b72146a59b

+ 17 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -58,6 +58,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
     private IAiKuaishouUnitLevelOperationRecordService unitLevelOperationRecordService;
     @Autowired
     private IAiKuaishouCreativeLevelOperationRecordService creativeLevelOperationRecordService;
+    @Autowired
+    private IKuaishouLandpagePackageService landpagePackageService;
 
 
     /**
@@ -475,6 +477,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
 
         Long unitId = creativeParams.getLong("unit_id");
         if (code == 0) {
+            createLandPageAndUnit(creativeParams, resultJson.getJSONObject("data"));
+
             log.info("创建程序化创意成功,accountId:{},unit:{}", token.getAccountId(), unitId);
 
         } else {
@@ -491,6 +495,19 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
 
     }
 
+    //绑定落地页与广告组、创意的关系
+    private void createLandPageAndUnit(JSONObject programJson, JSONObject data) {
+        if (!Check.isNull(data) && !Check.isNull(programJson.getLong("site_id"))) {
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    landpagePackageService.createLandPageAndUnit(programJson.getLong("site_id"), data.getLong("creative_id"), programJson.getLong("unit_id"), programJson.getLong("advertiser_id"));
+                }
+            };
+            thread.start();
+        }
+    }
+
     private JSONObject programCreativeParams(CtopOauthToken token, Long unitId, List<KuaiShouVideoGet> list, AiKuaishouAdvertiserStrategy strategy, Integer creativeCnt, String appVersion) {
         JSONObject programJson = new JSONObject();
         programJson.put("advertiser_id", token.getAccountId());