Browse Source

落地页绑定 添加非空判断

zhaoxian 4 năm trước cách đây
mục cha
commit
6fa2b6267a

+ 6 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/CrossAccountBatchServiceImpl.java

@@ -640,9 +640,12 @@ public class CrossAccountBatchServiceImpl implements ICrossAccountBatchService {
         JSONArray creatives = programJson.getJSONArray("creatives");
         if (creatives != null && !creatives.isEmpty()) {
             JSONObject jsonObject = creatives.getJSONObject(0);
-            if (!Check.isNull(jsonObject)) {
-                for (Object creativeId : add_creative_ids) {
-                    landpagePackageService.createLandPageAndUnit(jsonObject.getLong("site_id"), Long.valueOf(String.valueOf(creativeId)), jsonObject.getLong("unit_id"), jsonObject.getLong("advertiser_id"));
+            Long siteId = jsonObject.getLong("site_id");
+            if (!Check.isNull(siteId)) {
+                if (!Check.isNull(jsonObject)) {
+                    for (Object creativeId : add_creative_ids) {
+                        landpagePackageService.createLandPageAndUnit(siteId, Long.valueOf(String.valueOf(creativeId)), jsonObject.getLong("unit_id"), jsonObject.getLong("advertiser_id"));
+                    }
                 }
             }
         }

+ 6 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -2155,9 +2155,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         JSONArray creatives = programJson.getJSONArray("creatives");
         if (creatives != null && !creatives.isEmpty()) {
             JSONObject jsonObject = creatives.getJSONObject(0);
-            if (!Check.isNull(jsonObject)) {
-                for (Object creativeId : add_creative_ids) {
-                    landpagePackageService.createLandPageAndUnit(jsonObject.getLong("site_id"), Long.valueOf(String.valueOf(creativeId)), programJson.getLong("unit_id"), programJson.getLong("advertiser_id"));
+            Long siteId = jsonObject.getLong("site_id");
+            if (!Check.isNull(siteId)) {
+                if (!Check.isNull(jsonObject)) {
+                    for (Object creativeId : add_creative_ids) {
+                        landpagePackageService.createLandPageAndUnit(siteId, Long.valueOf(String.valueOf(creativeId)), programJson.getLong("unit_id"), programJson.getLong("advertiser_id"));
+                    }
                 }
             }
         }