Explorar o código

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

zhaoxian %!s(int64=4) %!d(string=hai) anos
pai
achega
8603ae2280

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroupTarget.java

@@ -148,6 +148,8 @@ public class KuaiShouGroupTarget {
     @Excel(name = "APP行为-按APP名称", width = 15)
     @Excel(name = "APP行为-按APP名称", width = 15)
     @ApiModelProperty(value = "APP行为-按APP名称")
     @ApiModelProperty(value = "APP行为-按APP名称")
     private String appIds;
     private String appIds;
+
+    private Integer filterConvertedLevel;
     /**
     /**
      * 人群包定向
      * 人群包定向
      */
      */

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupTargetMapper.xml

@@ -26,6 +26,7 @@
         app_ids,
         app_ids,
         population,
         population,
         exclude_population,
         exclude_population,
+        filter_converted_level,
         is_open,
         is_open,
         no_age_break,
         no_age_break,
         no_gender_break,
         no_gender_break,
@@ -34,7 +35,6 @@
         values
         values
         <foreach collection="targets" item="targets" separator=",">
         <foreach collection="targets" item="targets" separator=",">
             (
             (
-
             #{targets.accountId},
             #{targets.accountId},
             #{targets.unitId},
             #{targets.unitId},
             #{targets.region},
             #{targets.region},
@@ -56,6 +56,7 @@
             #{targets.appIds},
             #{targets.appIds},
             #{targets.population},
             #{targets.population},
             #{targets.excludePopulation},
             #{targets.excludePopulation},
+            #{targets.filterConvertedLevel},
             #{targets.isOpen},
             #{targets.isOpen},
             #{targets.noAgeBreak},
             #{targets.noAgeBreak},
             #{targets.noGenderBreak},
             #{targets.noGenderBreak},

+ 46 - 38
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java

@@ -285,11 +285,15 @@ public class BatchServiceImpl implements IBatchService {
         if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
         if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
             targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
             targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
         }
         }
+        //设备价格
+        if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
+            targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+        }
 
 
         if (sceneId != 5) {
         if (sceneId != 5) {
-            //设备价格
-            if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
-                targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+            //过滤已转化人群纬度
+            if (!Check.isNull(requestJson.getInteger("filterConvertedLevel"))) {
+                targetJson.put("filter_converted_level", requestJson.getInteger("filterConvertedLevel"));
             }
             }
             //商业兴趣类型
             //商业兴趣类型
             if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
             if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
@@ -590,12 +594,14 @@ public class BatchServiceImpl implements IBatchService {
             if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
             if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
                 targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
                 targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
             }
             }
-            if (sceneId != 5) {
-
 
 
-                //设备价格
-                if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
-                    targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+            //设备价格
+            if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
+                targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+            }
+            if (sceneId != 5) {
+                if (!Check.isNull(requestJson.getInteger("filterConvertedLevel"))) {
+                    targetJson.put("filter_converted_level", requestJson.getInteger("filterConvertedLevel"));
                 }
                 }
                 //商业兴趣类型
                 //商业兴趣类型
                 if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
                 if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
@@ -886,12 +892,15 @@ public class BatchServiceImpl implements IBatchService {
                     if (!Check.isNull(groupTarget.getDeviceBrand())) {
                     if (!Check.isNull(groupTarget.getDeviceBrand())) {
                         targetJson.put("device_brand", JSONArray.parseArray(groupTarget.getDeviceBrand()));
                         targetJson.put("device_brand", JSONArray.parseArray(groupTarget.getDeviceBrand()));
                     }
                     }
+                    //设备价格
+                    if (!Check.isNull(groupTarget.getDevicePrice())) {
+                        targetJson.put("device_price", JSONArray.parseArray(groupTarget.getDevicePrice()));
+                    }
                     if (sceneId != 5) {
                     if (sceneId != 5) {
-
-                        //设备价格
-                        if (!Check.isNull(groupTarget.getDevicePrice())) {
-                            targetJson.put("device_price", JSONArray.parseArray(groupTarget.getDevicePrice()));
+                        if (!Check.isNull(groupTarget.getFilterConvertedLevel())) {
+                            targetJson.put("filter_converted_level", groupTarget.getFilterConvertedLevel());
                         }
                         }
+
                         //商业兴趣类型
                         //商业兴趣类型
                         if (!Check.isNull(groupTarget.getBusinessInterestType())) {
                         if (!Check.isNull(groupTarget.getBusinessInterestType())) {
                             targetJson.put("business_interest_type", groupTarget.getBusinessInterestType());
                             targetJson.put("business_interest_type", groupTarget.getBusinessInterestType());
@@ -1596,25 +1605,18 @@ public class BatchServiceImpl implements IBatchService {
             if (Check.isNull(unitId)) {
             if (Check.isNull(unitId)) {
                 throw new Exception("请选择广告组");
                 throw new Exception("请选择广告组");
             }
             }
-
-
             unitJson.put("unit_id", unitId);
             unitJson.put("unit_id", unitId);
-
-
             queryWrapper.eq("unit_id", unitId);
             queryWrapper.eq("unit_id", unitId);
             queryWrapper.last("limit 1");
             queryWrapper.last("limit 1");
             KuaiShouGroup kuaiShouGroup = groupMapper.selectOne(queryWrapper);
             KuaiShouGroup kuaiShouGroup = groupMapper.selectOne(queryWrapper);
             if (Check.isNull(kuaiShouGroup)) {
             if (Check.isNull(kuaiShouGroup)) {
                 throw new Exception("未获取到组信息");
                 throw new Exception("未获取到组信息");
-
             }
             }
-
             String sceneId = kuaiShouGroup.getSceneId();
             String sceneId = kuaiShouGroup.getSceneId();
             if (Check.isNull(sceneId)) {
             if (Check.isNull(sceneId)) {
                 throw new Exception("未获取资源位置");
                 throw new Exception("未获取资源位置");
             }
             }
 
 
-
             //  JSONObject jsonObject = JSONArr(sceneId);
             //  JSONObject jsonObject = JSONArr(sceneId);
             Integer scene = (Integer) JSONArray.parseArray(sceneId).get(0);
             Integer scene = (Integer) JSONArray.parseArray(sceneId).get(0);
 
 
@@ -1745,13 +1747,35 @@ public class BatchServiceImpl implements IBatchService {
             if (!Check.isNull(requestJson.getInteger("network"))) {
             if (!Check.isNull(requestJson.getInteger("network"))) {
                 targetJson.put("network", requestJson.getInteger("network"));
                 targetJson.put("network", requestJson.getInteger("network"));
             }
             }
+            // 设备品牌
+            if (!Check.isNull(requestJson.getJSONArray("deviceBrand"))) {
+                targetJson.put("device_brand", requestJson.getJSONArray("deviceBrand"));
+            }
+            // 设备价格
+            if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
+                targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+            }
 
 
+            if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
+                targetJson.put("app_interest", requestJson.getJSONArray("appInterest"));
+            }
+            // APP行为-按APP名称
+            if (!Check.isNull(requestJson.getJSONArray("appIds"))) {
+                targetJson.put("app_ids", requestJson.getJSONArray("appIds"));
+            }
 
 
+            if (!Check.isNull(requestJson.getJSONArray("population"))) {
+                targetJson.put("population", requestJson.getJSONArray("population"));
+            }
+            // 人群包排除
+            if (!Check.isNull(requestJson.getJSONArray("excludePopulation"))) {
+                targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
+            }
             if (scene != 5) {
             if (scene != 5) {
-                //设备价格
-                if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
-                    targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+                if (!Check.isNull(requestJson.getInteger("filterConvertedLevel"))) {
+                    targetJson.put("filter_converted_level", requestJson.getInteger("filterConvertedLevel"));
                 }
                 }
+
                 //商业兴趣类型
                 //商业兴趣类型
                 if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
                 if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
                     targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
                     targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
@@ -1769,22 +1793,6 @@ public class BatchServiceImpl implements IBatchService {
                     targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
                     targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
                 }
                 }
             }
             }
-            // APP行为-按分类
-            if (!Check.isNull(requestJson.getJSONArray("appInterest"))) {
-                targetJson.put("app_interest", requestJson.getJSONArray("appInterest"));
-            }
-            // APP行为-按APP名称
-            if (!Check.isNull(requestJson.getJSONArray("appIds"))) {
-                targetJson.put("app_ids", requestJson.getJSONArray("appIds"));
-            }
-            // 人群包定向
-            if (!Check.isNull(requestJson.getJSONArray("population"))) {
-                targetJson.put("population", requestJson.getJSONArray("population"));
-            }
-            // 人群包排除
-            if (!Check.isNull(requestJson.getJSONArray("excludePopulation"))) {
-                targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
-            }
 
 
             if (scene != 5) {
             if (scene != 5) {
                 JSONObject intelliExtendJson = new JSONObject();
                 JSONObject intelliExtendJson = new JSONObject();

+ 8 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java

@@ -86,7 +86,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
         JSONObject param = new JSONObject();
         JSONObject param = new JSONObject();
         param.put("advertiser_id", accountId);
         param.put("advertiser_id", accountId);
         param.put("campaign_id", campaignId);
         param.put("campaign_id", campaignId);
-        param.put("page_size", 200);
+        param.put("page_size", 500);
         param.put("page", page);
         param.put("page", page);
 
 
         Map<String, String> headers = new HashMap<>();
         Map<String, String> headers = new HashMap<>();
@@ -160,7 +160,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
             headers.put("Access-Token", accessToken);
             headers.put("Access-Token", accessToken);
             JSONObject param = new JSONObject();
             JSONObject param = new JSONObject();
             param.put("advertiser_id", accountId);
             param.put("advertiser_id", accountId);
-            param.put("page_size", 200);
+            param.put("page_size", 500);
 
 
 
 
             param.put("unit_id", unitId);
             param.put("unit_id", unitId);
@@ -368,7 +368,6 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     group.setUpdateTime(new Date());
                     group.setUpdateTime(new Date());
                     groups.add(group);
                     groups.add(group);
                     // 添加应用信息
                     // 添加应用信息
-
                     JSONObject diverseJson = detail.getJSONObject("diverse_data");
                     JSONObject diverseJson = detail.getJSONObject("diverse_data");
                     if (!Check.isNull(diverseJson)) {
                     if (!Check.isNull(diverseJson)) {
                         KuaiShouAppInfo appInfo = new KuaiShouAppInfo();
                         KuaiShouAppInfo appInfo = new KuaiShouAppInfo();
@@ -404,7 +403,6 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                         KuaiShouGroupTarget groupTarget = new KuaiShouGroupTarget();
                         KuaiShouGroupTarget groupTarget = new KuaiShouGroupTarget();
                         groupTarget.setAccountId(advertiserId);
                         groupTarget.setAccountId(advertiserId);
                         groupTarget.setUnitId(unitId);
                         groupTarget.setUnitId(unitId);
-
                         if (!Check.isNull(targetJson.getJSONArray("region"))) {
                         if (!Check.isNull(targetJson.getJSONArray("region"))) {
                             groupTarget.setRegion(targetJson.getJSONArray("region").toJSONString());
                             groupTarget.setRegion(targetJson.getJSONArray("region").toJSONString());
                         }
                         }
@@ -452,6 +450,12 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                             groupTarget.setAppIds(targetJson.getJSONArray("app_ids").toJSONString());
                             groupTarget.setAppIds(targetJson.getJSONArray("app_ids").toJSONString());
                         }
                         }
 
 
+
+                        if (!Check.isNull(targetJson.getInteger("filter_converted_level"))) {
+                            groupTarget.setFilterConvertedLevel(targetJson.getInteger("filter_converted_level"));
+                        }
+
+
                         if (!Check.isNull(targetJson.getJSONArray("population"))) {
                         if (!Check.isNull(targetJson.getJSONArray("population"))) {
                             groupTarget.setPopulation(targetJson.getJSONArray("population").toJSONString());
                             groupTarget.setPopulation(targetJson.getJSONArray("population").toJSONString());
                         }
                         }

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java

@@ -610,6 +610,7 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
             headers.put("Content-Type", "application/json");
             headers.put("Content-Type", "application/json");
             String result = HttpUtils.kuaiShouhttpPostRequest(url, unitJson.toJSONString(), headers);
             String result = HttpUtils.kuaiShouhttpPostRequest(url, unitJson.toJSONString(), headers);
             JSONObject resultJson = JSONObject.parseObject(result);
             JSONObject resultJson = JSONObject.parseObject(result);
+            log.info("修改广告组返回信息:{}", resultJson);
             if (!Check.isNull(resultJson)) {
             if (!Check.isNull(resultJson)) {
                 Integer code = resultJson.getInteger("code");
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
                 if (code == 0) {