yumeng 5 سال پیش
والد
کامیت
03b6c2e446

+ 6 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -189,18 +189,18 @@ public class TestController {
                             public void run() {
                                 try {
                                     kuaishouInterfaceService.getSuZaoList(token.getAccessToken(), token.getAccountId(), 1, null, null);
-                                    String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+                                    kuaishouInterfaceService.getVideoList(token, null, null);
+                                     /*String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
                                     String videoEndDate = DateUtils.addDay(nowDate, -180);
-                                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                   SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
                                     Date end = simpleDateFormat.parse(nowDate);
                                     Date start = simpleDateFormat.parse(videoEndDate);
                                     List<Date> dates = DateUtils.findDates(start, end);
                                     for (int i = 0; i < dates.size(); i++) {
                                         String formatDate = simpleDateFormat.format(dates.get(i));
-                                        kuaishouInterfaceService.getVideoList(token, formatDate);
                                         kuaishouInterfaceService.getImageList(token, formatDate);
                                         Thread.sleep(500);
-                                    }
+                                    }*/
 
                                 } catch (Exception e) {
                                     e.printStackTrace();
@@ -234,6 +234,7 @@ public class TestController {
                     CtopOauthToken one = tokenService.getOne(tokenQueryWrapper);
                     try {
                         kuaishouInterfaceService.getSuZaoList(one.getAccessToken(), one.getAccountId(), 1, null, null);
+                        kuaishouInterfaceService.getVideoList(one, null, null);
                         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
                         String videoEndDate = DateUtils.addDay(nowDate, -180);
                         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
@@ -242,7 +243,7 @@ public class TestController {
                         List<Date> dates = DateUtils.findDates(start, end);
                         for (int i = 0; i < dates.size(); i++) {
                             String formatDate = simpleDateFormat.format(dates.get(i));
-                            kuaishouInterfaceService.getVideoList(one, formatDate);
+
                             kuaishouInterfaceService.getImageList(one, formatDate);
                             Thread.sleep(100);
                         }

+ 4 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouMaterialsLoadJob.java

@@ -10,7 +10,6 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -29,11 +28,10 @@ public class KuaishouMaterialsLoadJob implements Job {
         Thread thread = new Thread() {
             @Override
             public void run() {
-                //增加接口的开始和结束日期
-                Date startDate = DateUtils.addDay(new Date(), -1);
-                Date endDate = new Date();
-                //1:查询当日数据
+
                 List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+                String endDate = DateUtils.getNowDate("yyyy-MM-dd");
+                String startDate = DateUtils.getAnotherDay("yyyy-mm-dd", endDate, -1);
                 executorService = Executors.newFixedThreadPool(8);
                 tokens.forEach(token -> {
                     executorService.submit(new Runnable() {
@@ -42,7 +40,7 @@ public class KuaishouMaterialsLoadJob implements Job {
                             try {
 
                                 //获取全量视频素材数据
-                                kuaishouInterfaceService.getVideoList(token, DateUtils.getNowDate("yyyy-MM-dd"));
+                                kuaishouInterfaceService.getVideoList(token, startDate, endDate);
                                 // 获取图片信息数据
                                 kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
                             } catch (Exception e) {

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java

@@ -198,6 +198,11 @@ public class KuaishouInterfaceConstant {
      */
     public static final String ASYNC_TASK_DOWNLOAD = "/rest/openapi/v1/async_task/download";
 
+    /**
+     * 落地页查询
+     */
+    public static final String PAGE_LIST = "/rest/openapi/v2/lp/page/list";
+
 
     /**
      * 登录

+ 69 - 13
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -118,11 +117,8 @@ public class BatchController {
             result.setResult(spendVo);
 
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-            String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
-
-            List dateList = new ArrayList();
-            dateList.add(nowDate);
-            dateList.add(anotherDay);
+            String startDate = DateUtils.getAnotherDay("yyyy-mm-dd", nowDate, -1);
+            String endDate = DateUtils.getAnotherDay("yyyy-mm-dd", nowDate, 1);
 
 
             Thread planThread = new Thread() {
@@ -155,10 +151,8 @@ public class BatchController {
             Thread thread2 = new Thread() {
                 @Override
                 public void run() {
-                    for (int i = 0; i < dateList.size(); i++) {
-                        String date = (String) dateList.get(i);
-                        iKuaishouInterfaceService.getVideoList(oauthToken, date);
-                    }
+                    iKuaishouInterfaceService.getVideoList(oauthToken, startDate, nowDate);
+
                 }
             };
             thread2.start();
@@ -166,9 +160,7 @@ public class BatchController {
             Thread thread3 = new Thread() {
                 @Override
                 public void run() {
-                    String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-                    String endDate = DateUtils.getAnotherDay("yyyy-mm-dd", nowDate, 1);
-                    String startDate = DateUtils.getAnotherDay("yyyy-mm-dd", nowDate, -1);
+
                     iKuaishouInterfaceService.getSuZaoList(oauthToken.getAccessToken(), oauthToken.getAccountId(), 1, startDate, endDate);
                 }
             };
@@ -1126,6 +1118,7 @@ public class BatchController {
                 queryWrapper.between("stat_date", startDate, endDate);
             }
             queryWrapper.orderByDesc("stat_date");
+            queryWrapper.groupBy("signature");
             Page<KuaiShouVideoGet> page = new Page<>(pageNo, pageSize);
             IPage<KuaiShouVideoGet> pageList = kuaiShouVideoGetService.page(page, queryWrapper);
             result.setSuccess(true);
@@ -2130,4 +2123,67 @@ public class BatchController {
     }
 
 
+    /**
+     * 获取可选的动态词包
+     *
+     * @param accountId
+     * @return
+     */
+    @GetMapping(value = "/getPageList")
+    public Result<JSONArray> getPageList(Long accountId, Long appId, String viewComp) {
+        Result<JSONArray> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("入参为空");
+            }
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+            JSONArray pageArr = iKuaishouInterfaceService.getPageList(accountId, oauthToken.getAccessToken(), appId, viewComp);
+            result.setResult(pageArr);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 获取可选的动态词包
+     *
+     * @param accountId
+     * @return
+     */
+    @GetMapping(value = "/getAppId")
+    public Result<Long> getAppId(Long accountId, Long unitId) {
+        Result<Long> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("入参为空");
+            }
+            QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
+            groupQueryWrapper.eq("account_id", accountId);
+            groupQueryWrapper.eq("unit_id", unitId);
+            KuaiShouGroup one = kuaiShouGroupService.getOne(groupQueryWrapper);
+            if (!Check.isNull(one)) {
+                result.setResult(one.getAppId());
+                result.setSuccess(true);
+            } else {
+                result.setSuccess(false);
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
 }

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

@@ -96,4 +96,5 @@ public class KuaiShouVideoGet {
 
 
     private Integer channelType;
+    private Integer status;
 }

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

@@ -137,5 +137,5 @@ public interface IBatchService {
      * @param unitId
      * @param copyUnitId
      */
-    void copyCreative(Long accountId, Long unitId, Long copyUnitId) throws Exception;
+    void copyCreative(Long accountId, Long unitId, Long copyUnitId,JSONObject appJson) throws Exception;
 }

+ 14 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java

@@ -299,9 +299,9 @@ public interface IKuaishouInterfaceService {
      * 获取视频列表
      *
      * @param token
-     * @param statDate
+     * @param
      */
-    void getVideoList(CtopOauthToken token, String statDate);
+    void getVideoList(CtopOauthToken token, String startDate, String endDate);
 
 
     /**
@@ -458,7 +458,7 @@ public interface IKuaishouInterfaceService {
      * @param accountId
      * @param page
      */
-    void getSuZaoList(String token, Long accountId, int page, String startDate,String endDate);
+    void getSuZaoList(String token, Long accountId, int page, String startDate, String endDate);
 
     /**
      * 异步获取创意信息
@@ -489,6 +489,17 @@ public interface IKuaishouInterfaceService {
      * @return
      */
     JSONArray getCreativeWord(Long accountId, String accessToken);
+
+
+    /**
+     * 获取下载页id
+     *
+     * @param accountId
+     * @param appId
+     * @param viewComp
+     * @return
+     */
+    JSONArray getPageList(Long accountId, String token, Long appId, String viewComp);
 }
 
 

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

@@ -420,7 +420,8 @@ public class BatchServiceImpl implements IBatchService {
                                     @Override
                                     public void run() {
                                         try {
-                                            copyCreative(oauthToken.getAccountId(), unitId, copyUnitId);
+                                            JSONObject appJson = requestJson.getJSONObject("appJson"); // 是否修改应用
+                                            copyCreative(oauthToken.getAccountId(), unitId, copyUnitId, appJson);
                                         } catch (Exception e) {
                                             e.printStackTrace();
                                         }
@@ -649,11 +650,8 @@ public class BatchServiceImpl implements IBatchService {
                 throw new Exception("请输入需要创建的广告组");
             }
 
-
-            // 创建条数
-
-            JSONArray successArr = new JSONArray();
-            JSONArray failArr = new JSONArray();
+            // 是否修改应用
+            JSONObject appJson = requestJson.getJSONObject("appJson");
 
             if (!Check.isNull(groupJson)) {
 
@@ -705,7 +703,7 @@ public class BatchServiceImpl implements IBatchService {
                                     @Override
                                     public void run() {
                                         try {
-                                            copyCreative(oauthToken.getAccountId(), unitId, copyUnitId);
+                                            copyCreative(oauthToken.getAccountId(), unitId, copyUnitId, appJson);
                                         } catch (Exception e) {
                                             e.printStackTrace();
                                         }
@@ -978,7 +976,7 @@ public class BatchServiceImpl implements IBatchService {
                             @Override
                             public void run() {
                                 try {
-                                    copyCreative(group.getAccountId(), copyUnitId, group.getUnitId());
+                                    copyCreative(group.getAccountId(), copyUnitId, group.getUnitId(), null);
                                 } catch (Exception e) {
                                     e.printStackTrace();
                                 }
@@ -1014,7 +1012,7 @@ public class BatchServiceImpl implements IBatchService {
      * @param unitId
      */
     @Override
-    public void copyCreative(Long accountId, Long unitId, Long copyUnitId) throws Exception {
+    public void copyCreative(Long accountId, Long unitId, Long copyUnitId, JSONObject appJson) throws Exception {
         // 查询当前复制组下的所有非程序化创意
 
         QueryWrapper<KuaiShouCreative> queryWrapper = new QueryWrapper<>();
@@ -1062,10 +1060,26 @@ public class BatchServiceImpl implements IBatchService {
                 if (!Check.isNull(creative.getOverlayType())) {
                     creativeJson.put("overlay_type", creative.getOverlayType());
                 }
+
+                // 是否修改应用
+                if (!Check.isNull(appJson)) {
+                    Boolean isUpdate = appJson.getBoolean("isUpdate");
+                    if (isUpdate) {
+                        if (!Check.isNull(appJson.getLong("siteId"))) {
+                            creativeJson.put("site_id", appJson.getLong("siteId"));
+                        }
+                    } else {
+                        if (!Check.isNull(creative.getSiteId())) {
+                            creativeJson.put("site_id", creative.getSiteId());
+                        }
+                    }
+                } else {
+                    if (!Check.isNull(creative.getSiteId())) {
+                        creativeJson.put("site_id", creative.getSiteId());
+                    }
+                }
+
                 // 安卓下载中间页
-                /*if (!Check.isNull(creative.getSiteId())) {
-                    creativeJson.put("site_id", creative.getSiteId());
-                }*/
 
 
                 Map<String, Object> returnCreativeMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
@@ -1145,10 +1159,14 @@ public class BatchServiceImpl implements IBatchService {
         }
         String action_bar_text = requestJson.getString("actionBarText");
         String click_track_url = requestJson.getString("clickTrackUrl");
+        String site_id = requestJson.getString("siteId");
         JSONObject returnJson = new JSONObject();
         JSONArray successArr = new JSONArray();
         JSONArray failArr = new JSONArray();
         JSONArray dataJsons = requestJson.getJSONArray("dataJson");
+
+        Integer content = requestJson.getInteger("content");
+
         if (!Check.isNull(dataJsons)) {
             for (int i = 0; i < dataJsons.size(); i++) {
                 JSONObject dataJson = dataJsons.getJSONObject(i);
@@ -1160,13 +1178,16 @@ public class BatchServiceImpl implements IBatchService {
                         for (int j = 0; j < imageArr.size(); j++) {
                             JSONObject imageJson = imageArr.getJSONObject(j);
                             if (!Check.isNull(imageJson)) {
-                                String name = imageJson.getString("name");
+                                content += 1;
+                                String name = imageJson.getString("name") + content;
                                 creativeJson.put("action_bar_text", action_bar_text);
                                 creativeJson.put("description", description);
                                 creativeJson.put("creative_name", name);
                                 creativeJson.put("photo_id", photo_id);
                                 creativeJson.put("click_track_url", click_track_url);
-
+                                if (!Check.isNull(site_id)) {
+                                    creativeJson.put("site_id", site_id);
+                                }
                                 String imageToken = null;
                                 String signature = imageJson.getString("signature");
                                 if (!Check.isNull(signature)) {

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

@@ -56,7 +56,9 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
     @Override
     public void getKeyFrame(String token, Long accountId, String videoMd5, String photoId) {
         try {
-            log.info("开始素造抽帧,md5:{}", videoMd5);
+            if (Check.isNull(videoMd5)) {
+                return;
+            }
             QueryWrapper<MaterialCutFrame> cutFrameQueryWrapper = new QueryWrapper<>();
             cutFrameQueryWrapper.eq("video_signature", videoMd5);
             cutFrameQueryWrapper.last("limit 1");
@@ -64,6 +66,7 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
             if (!Check.isNull(one)) {
                 return;
             }
+            log.info("开始视频抽帧,md5:{}", videoMd5);
             String url = "https://ad.e.kuaishou.com/rest/openapi/v1/tool/key_frame";
             JSONArray photoArr = new JSONArray();
             photoArr.add(photoId);

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

@@ -17,6 +17,7 @@ import cn.com.ctop.kuaishou.modules.report.entity.*;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -181,11 +182,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
 
     @Override
-    public void getVideoList(CtopOauthToken token, String statDate) {
-        getVideoListByPage(token, statDate, 1);
+    public void getVideoList(CtopOauthToken token, String startDate, String endDate) {
+        getVideoListByPage(token, startDate, endDate, 1);
     }
 
-    private void getVideoListByPage(CtopOauthToken token, String statDate, int page) {
+    private void getVideoListByPage(CtopOauthToken token, String startDate, String endDate, int page) {
         try {
             log.info("获取视频数据,accountId:{}", token.getAccountId());
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
@@ -196,9 +197,9 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             param.put("advertiser_id", token.getAccountId());
             param.put("page_size", 500);
             param.put("page", page);
-            if (!Check.isNull(statDate)) {
-                param.put("start_date", statDate);
-                param.put("end_date", statDate);
+            if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
+                param.put("start_date", startDate);
+                param.put("end_date", endDate);
             }
             String result = HttpUtils.httpPostRequest(url, param, headers);
             JSONObject resultJson = JSONObject.parseObject(result);
@@ -223,15 +224,24 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 kuaiShouVideoGet.setId(token.getAccountId() + kuaiShouVideoGet.getPhotoId());
 
                 kuaiShouVideoGet.setAccountId(token.getAccountId());
-                kuaiShouVideoGet.setStatDate(DateUtils.parseDate(statDate, "yyyy-MM-dd"));
+                kuaiShouVideoGet.setStatDate(detailJson.getDate("upload_time"));
                 kuaiShouVideoGet.setUpdateTime(new Date());
                 Integer type = MaterialEnum.getTypeBySize(kuaiShouVideoGet.getWidth(), kuaiShouVideoGet.getHeight());
                 if (!Check.isNull(type)) {
                     kuaiShouVideoGet.setMaterialType(type);
                 }
                 kuaiShouVideoGetService.saveOrUpdate(kuaiShouVideoGet);
+
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        videoGetService.getKeyFrame(token.getAccessToken(), token.getAccountId(), kuaiShouVideoGet.getSignature(), kuaiShouVideoGet.getPhotoId());
+                    }
+                };
+                thread.start();
+
             }
-            getVideoListByPage(token, statDate, page + 1);
+            getVideoListByPage(token, startDate, endDate, page + 1);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -894,7 +904,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         String startDate = DateUtils.addMonth(endDateStr, -6);
 
         historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
-
+        getVideoList(token, null, null);
         getSuZaoList(token.getAccessToken(), token.getAccountId(), 1, null, null);
         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
         String videoEndDate = DateUtils.addDay(nowDate, -180);
@@ -904,7 +914,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         List<Date> dates = DateUtils.findDates(start, end);
         for (int i = 0; i < dates.size(); i++) {
             String formatDate = simpleDateFormat.format(dates.get(i));
-            getVideoList(token, formatDate);
             getImageList(token, formatDate);
         }
 
@@ -2865,11 +2874,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             param.put("start_date", startDate);
             param.put("end_date", endDate);
         }
-        System.err.println("入参:" + param);
-        System.err.println("headers:" + headers);
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
-        System.err.println(resultJson);
         Integer code = resultJson.getInteger("code");
         String message = resultJson.getString("message");
         if (null == code || code != 0) {
@@ -2887,7 +2893,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 if (!Check.isNull(jsonObject)) {
                     KuaiShouVideoGet kuaiShouVideoGet = new KuaiShouVideoGet();
                     Long photo_id = jsonObject.getLong("photo_id");
-                    kuaiShouVideoGet.setId(accountId + photo_id + "");
+                    kuaiShouVideoGet.setId(String.valueOf(accountId) + String.valueOf(photo_id));
                     kuaiShouVideoGet.setPhotoId(String.valueOf(photo_id));
                     kuaiShouVideoGet.setUrl(jsonObject.getString("watermark_url"));
                     kuaiShouVideoGet.setWidth(jsonObject.getInteger("width"));
@@ -2903,7 +2909,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         kuaiShouVideoGet.setMaterialType(type);
                     }
                     kuaiShouVideoGetService.saveOrUpdate(kuaiShouVideoGet);
-
                     Thread thread = new Thread() {
                         @Override
                         public void run() {
@@ -3115,4 +3120,73 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return null;
     }
 
+
+    /**
+     * 下载页
+     *
+     * @param accountId
+     * @param appId
+     * @param viewComp
+     * @return
+     */
+    @Override
+    public JSONArray getPageList(Long accountId, String token, Long appId, String viewComp) {
+        JSONArray returnArr = new JSONArray();
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.PAGE_LIST;
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token);
+            Map<String, Object> param = new HashMap<>();
+            JSONArray viewComps = new JSONArray();
+            viewComps.add(viewComp);
+            param.put("advertiser_id", accountId);
+            param.put("page_size", 500);
+            String result = HttpUtils.httpPostRequest(url, param, headers);
+            JSONObject resultJson = JSON.parseObject(result);
+            if (!Check.isNull(resultJson)) {
+                Integer code = resultJson.getInteger("code");
+                if (code == 0) {
+                    JSONObject dataJson = resultJson.getJSONObject("data");
+                    if (!Check.isNull(dataJson)) {
+                        JSONArray details = dataJson.getJSONArray("details");
+                        if (!Check.isNull(details)) {
+                            for (int i = 0; i < details.size(); i++) {
+                                JSONObject jsonObject = details.getJSONObject(i);
+                                if (!Check.isNull(jsonObject)) {
+                                    JSONArray compsArr = jsonObject.getJSONArray("comps");
+                                    if (!Check.isNull(compsArr)) {
+                                        for (int j = 0; j < compsArr.size(); j++) {
+                                            JSONObject compJson = compsArr.getJSONObject(j);
+                                            if (!Check.isNull(compJson)) {
+                                                Integer type = compJson.getInteger("type");
+                                                if (type == 7) {
+                                                    JSONObject props = compJson.getJSONObject("props");
+                                                    if (!Check.isNull(props)) {
+                                                        Long returnAppId = props.getLong("appId");
+                                                        if (returnAppId.equals(appId)) {
+                                                            JSONObject returnJson = new JSONObject();
+                                                            returnJson.put("siteId", jsonObject.getString("id"));
+                                                            returnJson.put("name", jsonObject.getString("name"));
+                                                            returnJson.put("appId", returnAppId);
+                                                            returnArr.add(returnJson);
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+        return returnArr;
+    }
+
 }