Selaa lähdekoodia

项目自动化调试,添加监测链接

zhaoxian 3 vuotta sitten
vanhempi
commit
572de06a29

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouAppPackageRelMapper.java

@@ -29,5 +29,5 @@ public interface KuaishouAppPackageRelMapper extends BaseMapper<KuaishouAppPacka
 
     List<JSONObject> getAppsDetail(@Param("ids") List<Long> ids);
 
-    Long queryAppId(@Param("appTemId") Long appTemId, @Param("accountId") Long accountId);
+    JSONObject queryAppId(@Param("appTemId") Long appTemId, @Param("accountId") Long accountId);
 }

+ 6 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouAppPackageRelMapper.xml

@@ -92,11 +92,12 @@
           AND t1.project_id = #{projectId}
     </select>
 
-    <select id="queryAppId" resultType="java.lang.Long">
-        SELECT app_id FROM  ctop_kuaishou_app_package_rel
-        where data_status = 1
-        AND account_id = #{accountId}
-        AND apptem_id = #{appTemId}
+    <select id="queryAppId" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT app_id,impression_url,actionbar_click_url,ad_photo_played_t3s_url,t2.track_url FROM  ctop_kuaishou_app_package_rel t1
+        LEFT JOIN ctop_kuaishou_app_package t2 ON t2.id = t1.apptem_id
+        where t1.data_status = 1
+        AND t1.account_id = #{accountId}
+        AND t1.apptem_id = #{appTemId}
     </select>
 
     <select id="getAppsDetail" resultType="com.alibaba.fastjson.JSONObject">

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouAppPackageService.java

@@ -41,5 +41,5 @@ public interface IKuaishouAppPackageService extends IService<KuaishouAppPackage>
 
     Result<Object> getAppsDetail(List<Long> list);
 
-    Long queryAppId(Long appTemId, Long accountId);
+    JSONObject queryAppId(Long appTemId, Long accountId);
 }

+ 18 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProjectCreateCreativeServiceImpl.java

@@ -213,11 +213,16 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                         insertAccountOperationRecord(strategy, "未获取到项目应用模板", operationType, 0);
                         return;
                     }
-                    appId = appPackageService.queryAppId(appTemId, token.getAccountId());
-                    if (Check.isNull(appTemId)) {
+                    JSONObject app = appPackageService.queryAppId(appTemId, token.getAccountId());
+                    if (Check.isNull(app) || Check.isNull(app.getLong("app_id"))) {
                         insertAccountOperationRecord(strategy, "未获取到appId", operationType, 0);
                         return;
                     }
+                    appId = app.getLong("app_id");
+                    strategy.setClickTrackUrl(app.getString("track_url"));
+                    strategy.setImpressionUrl(app.getString("impression_url"));
+                    strategy.setAdPhotoPlayedT3sUrl(app.getString("ad_photo_played_t3s_url"));
+                    strategy.setActionbarClickUrl(app.getString("actionbar_click_url"));
                 }
                 Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
                 if (null == newCampaignId) {
@@ -317,7 +322,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
             Long timeStart = null;
             Long timeEnd = null;
             Integer singleAppid = strategy.getSingleAppid();
-            if (null != singleAppid && singleAppid == 0) {
+            if (null != singleAppid && singleAppid == 1) {
                 timeStart = -7 * 60 * 24L;
                 timeEnd = -5L;
             } else {
@@ -347,11 +352,16 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                         insertAccountOperationRecord(strategy, "未获取到项t目应用模板", operationType, 0);
                         return;
                     }
-                    appId = appPackageService.queryAppId(appTemId, token.getAccountId());
-                    if (Check.isNull(appTemId)) {
+                    JSONObject app = appPackageService.queryAppId(appTemId, token.getAccountId());
+                    if (Check.isNull(app) || Check.isNull(app.getLong("app_id"))) {
                         insertAccountOperationRecord(strategy, "未获取到appId", operationType, 0);
                         return;
                     }
+                    appId = app.getLong("app_id");
+                    strategy.setClickTrackUrl(app.getString("track_url"));
+                    strategy.setImpressionUrl(app.getString("impression_url"));
+                    strategy.setAdPhotoPlayedT3sUrl(app.getString("ad_photo_played_t3s_url"));
+                    strategy.setActionbarClickUrl(app.getString("actionbar_click_url"));
                 }
                 Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
                 if (null == newCampaignId) {
@@ -506,7 +516,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
         JSONObject programJson = new JSONObject();
         programJson.put("advertiser_id", token.getAccountId());
         programJson.put("unit_id", unitId);
-        if (strategy.getSingleAppid() != null && strategy.getSingleAppid() == 0) {  // 多应用情况下 创意名称已app-versionMI命名
+        if (strategy.getSingleAppid() != null && strategy.getSingleAppid() == 1) {  // 多应用情况下 创意名称已app-versionMI命名
             if (!Check.isNull(appVersion)) {
                 programJson.put("package_name", appVersion);
             } else {
@@ -1339,8 +1349,8 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
         String HOUR = DateUtils.formatDate(date, DateUtils.TIME_FORMAT);
         if (wildcard.contains("{{时分}}")) {
             wildcard = wildcard.replace("{{时分}}", HOUR);
-        }else{
-            wildcard = wildcard.concat(HOUR.substring(0,4));
+        } else {
+            wildcard = wildcard.concat(HOUR.substring(0, 4));
         }
         String targetName = KuaishouProjectCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
         wildcard = wildcard.replace("{{自定义}}", targetName);

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAppPackageServiceImpl.java

@@ -193,7 +193,7 @@ public class KuaishouAppPackageServiceImpl extends ServiceImpl<KuaishouAppPackag
     }
 
     @Override
-    public Long queryAppId(Long appTemId, Long accountId) {
+    public JSONObject queryAppId(Long appTemId, Long accountId) {
         return relMapper.queryAppId(appTemId, accountId);
     }