Browse Source

调整修改错误

yumeng 4 years ago
parent
commit
a8961652b9

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

@@ -1438,13 +1438,36 @@ public class BatchServiceImpl implements IBatchService {
 
             JSONObject unitJson = new JSONObject();
             unitJson.put("advertiser_id", token.getAccountId());
+            QueryWrapper<KuaiShouGroup> queryWrapper = new QueryWrapper();
+            queryWrapper.eq("account_id", token.getAccountId());
+
 
             Long unitId = requestJson.getLong("unitId");
             if (Check.isNull(unitId)) {
                 throw new Exception("请选择广告组");
             }
 
+
             unitJson.put("unit_id", unitId);
+
+
+            queryWrapper.eq("unit_id", unitId);
+            queryWrapper.last("limit 1");
+            KuaiShouGroup kuaiShouGroup = groupMapper.selectOne(queryWrapper);
+            if (Check.isNull(kuaiShouGroup)) {
+                throw new Exception("未获取到组信息");
+
+            }
+
+            String sceneId = kuaiShouGroup.getSceneId();
+            if (Check.isNull(sceneId)) {
+                throw new Exception("未获取资源位置");
+            }
+
+
+            //  JSONObject jsonObject = JSONArr(sceneId);
+            Integer scene = (Integer) JSONArray.parseArray(sceneId).get(0);
+
             // 广告组名称
             if (!Check.isNull(requestJson.getString("unitName"))) {
                 unitJson.put("unit_name", requestJson.getString("unitName"));
@@ -1456,10 +1479,6 @@ public class BatchServiceImpl implements IBatchService {
                 unitJson.put("scene_id", scene_id);
             }
 
-           /* if (!Check.isNull(scene_id)) {
-                Integer sceneId = Integer.valueOf(scene_id.get(0).toString());
-            }*/
-
 
             // 出价
             if (!Check.isNull(requestJson.getLong("bid"))) {
@@ -1578,36 +1597,32 @@ public class BatchServiceImpl implements IBatchService {
             }
 
 
-            //设备品牌
-            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.getInteger("businessInterestType"))) {
-                targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
-            }
-            // 商业兴趣
-            if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
-                targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
-            }
-            //网红粉丝
-            if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
-                targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
-            }
-            //兴趣视频用户
-            if (!Check.isNull(requestJson.getJSONArray("interestVideo"))) {
-                targetJson.put("interest_video", requestJson.getJSONArray("interestVideo"));
+            if (scene != 5) {
+                //设备价格
+                if (!Check.isNull(requestJson.getJSONArray("devicePrice"))) {
+                    targetJson.put("device_price", requestJson.getJSONArray("devicePrice"));
+                }
+                //商业兴趣类型
+                if (!Check.isNull(requestJson.getInteger("businessInterestType"))) {
+                    targetJson.put("business_interest_type", requestJson.getInteger("businessInterestType"));
+                }
+                // 商业兴趣
+                if (!Check.isNull(requestJson.getJSONArray("businessInterest"))) {
+                    targetJson.put("business_interest", requestJson.getJSONArray("businessInterest"));
+                }
+                //网红粉丝
+                if (!Check.isNull(requestJson.getJSONArray("fansStar"))) {
+                    targetJson.put("fans_star", requestJson.getJSONArray("fansStar"));
+                }
+                //兴趣视频用户
+                if (!Check.isNull(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"));
@@ -1621,27 +1636,28 @@ public class BatchServiceImpl implements IBatchService {
                 targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
             }
 
+            if (scene != 5) {
+                JSONObject intelliExtendJson = new JSONObject();
 
-            JSONObject intelliExtendJson = new JSONObject();
-
-            // 开启智能扩量
-            if (!Check.isNull(requestJson.getInteger("isOpen"))) {
-                intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
-            }
-            //不可突破年龄
-            if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
-                intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
-            }
-            //不可突破性别
-            if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
-                intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
-            }
-            // 不可突破地域
-            if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
-                intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
-            }
-            if (!Check.isNull(intelliExtendJson)) {
-                targetJson.put("intelli_extend", intelliExtendJson);
+                // 开启智能扩量
+                if (!Check.isNull(requestJson.getInteger("isOpen"))) {
+                    intelliExtendJson.put("is_open", requestJson.getInteger("isOpen"));
+                }
+                //不可突破年龄
+                if (!Check.isNull(requestJson.getInteger("noAgeBreak"))) {
+                    intelliExtendJson.put("no_age_break", requestJson.getInteger("noAgeBreak"));
+                }
+                //不可突破性别
+                if (!Check.isNull(requestJson.getInteger("noGenderBreak"))) {
+                    intelliExtendJson.put("no_gender_break", requestJson.getInteger("noGenderBreak"));
+                }
+                // 不可突破地域
+                if (!Check.isNull(requestJson.getInteger("noAreaBreak"))) {
+                    intelliExtendJson.put("no_area_break", requestJson.getInteger("noAreaBreak"));
+                }
+                if (!Check.isNull(intelliExtendJson)) {
+                    targetJson.put("intelli_extend", intelliExtendJson);
+                }
             }