|  | @@ -209,6 +209,62 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 | 
	
		
			
				|  |  |          return kuaishouResult;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void getVideoList2(CtopOauthToken token, Date startDate, Date endDate, Integer page) {
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
 | 
	
		
			
				|  |  | +            Map<String, String> headers = new HashMap<>();
 | 
	
		
			
				|  |  | +            headers.put("Content-Type", "application/json");
 | 
	
		
			
				|  |  | +            headers.put("Access-Token", token.getAccessToken());
 | 
	
		
			
				|  |  | +            Map<String, Object> param = new HashMap<>();
 | 
	
		
			
				|  |  | +            param.put("advertiser_id", token.getAccountId());
 | 
	
		
			
				|  |  | +            param.put("page_size", 500);
 | 
	
		
			
				|  |  | +            param.put("page", page);
 | 
	
		
			
				|  |  | +            if (startDate != null && endDate != null) {
 | 
	
		
			
				|  |  | +                param.put("start_date", DateUtils.formatDate(startDate));
 | 
	
		
			
				|  |  | +                param.put("end_date", DateUtils.formatDate(endDate));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            String result = HttpUtils.httpPostRequest(url, param, headers);
 | 
	
		
			
				|  |  | +            JSONObject resultJson = JSONObject.parseObject(result);
 | 
	
		
			
				|  |  | +            Integer code = resultJson.getInteger("code");
 | 
	
		
			
				|  |  | +            String message = resultJson.getString("message");
 | 
	
		
			
				|  |  | +            if (null == code || code != 0) {
 | 
	
		
			
				|  |  | +                log.error("获取快手视频列表数据异常:{},accountId:{}", message, token.getAccountId());
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
 | 
	
		
			
				|  |  | +            if (null == details || details.size() <= 0) {
 | 
	
		
			
				|  |  | +                log.info("快手视频列表信息为空=》accountId:{}", token.getAccountId());
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            for (int i = 0; i < details.size(); i++) {
 | 
	
		
			
				|  |  | +                var detailJson = details.getJSONObject(i);
 | 
	
		
			
				|  |  | +                if (Check.isNull(detailJson.getString("signature"))) {
 | 
	
		
			
				|  |  | +                    continue;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                var kuaiShouVideoGet = JSONObject.toJavaObject(detailJson, KuaiShouVideoGet.class);
 | 
	
		
			
				|  |  | +                kuaiShouVideoGet.setAccountId(token.getAccountId());
 | 
	
		
			
				|  |  | +                kuaiShouVideoGet.setId(token.getAccountId() + kuaiShouVideoGet.getSignature());
 | 
	
		
			
				|  |  | +                kuaiShouVideoGet.setCreateTime(new Date());
 | 
	
		
			
				|  |  | +                kuaiShouVideoGet.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | +                Integer type = MaterialEnum.getTypeBySize(kuaiShouVideoGet.getWidth(), kuaiShouVideoGet.getHeight());
 | 
	
		
			
				|  |  | +                if (!Check.isNull(type)) {
 | 
	
		
			
				|  |  | +                    kuaiShouVideoGet.setMaterialType(type);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                kuaiShouVideoGetService.saveOrUpdate(kuaiShouVideoGet);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            getVideoList2(token, startDate, endDate, page + 1);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public void getVideoList(CtopOauthToken token, Date startDate, Date endDate) {
 | 
	
		
			
				|  |  |          getVideoListByPage(token, startDate, endDate, 1);
 | 
	
	
		
			
				|  | @@ -1644,6 +1700,93 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 | 
	
		
			
				|  |  |          getCreativeListByPage(token.getAccessToken(), token.getAccountId(), startDate, endDate, 1);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void getCreativeList2(CtopOauthToken token, Date startDate, Date endDate, Integer page) {
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
 | 
	
		
			
				|  |  | +            Map<String, String> headers = new HashMap<>();
 | 
	
		
			
				|  |  | +            headers.put("Content-Type", " application/json");
 | 
	
		
			
				|  |  | +            headers.put("Access-Token", token.getAccessToken());
 | 
	
		
			
				|  |  | +            JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  | +            param.put("advertiser_id", token.getAccountId());
 | 
	
		
			
				|  |  | +            if (startDate != null && endDate != null) {
 | 
	
		
			
				|  |  | +                param.put("start_date", DateUtils.formatDate(startDate));
 | 
	
		
			
				|  |  | +                param.put("end_date", DateUtils.formatDate(endDate));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            param.put("page_size", 200);
 | 
	
		
			
				|  |  | +            param.put("page", page);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
 | 
	
		
			
				|  |  | +            JSONObject resultJson = JSONObject.parseObject(result);
 | 
	
		
			
				|  |  | +            if (Check.isNull(resultJson)) {
 | 
	
		
			
				|  |  | +                log.error("获取广告创意返回结果为空,advertiserId:{}", token.getAccountId());
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            Integer code = resultJson.getInteger("code");
 | 
	
		
			
				|  |  | +            String message = resultJson.getString("message");
 | 
	
		
			
				|  |  | +            if (null == code || code != 0) {
 | 
	
		
			
				|  |  | +                log.error("获取广告创意返回结果异常,advertiserId:{},message:{}", token.getAccountId(), message);
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
 | 
	
		
			
				|  |  | +            if (null == details || details.size() <= 0) {
 | 
	
		
			
				|  |  | +//            log.error("获取广告创意返回结果数据为空,advertiserId:{}", advertiserId);
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            List<KuaiShouCreative> creatives = new ArrayList<>();
 | 
	
		
			
				|  |  | +            for (int i = 0; i < details.size(); i++) {
 | 
	
		
			
				|  |  | +                JSONObject detailJson = JSONObject.parseObject(details.get(i).toString());
 | 
	
		
			
				|  |  | +                if (!Check.isNull(detailJson)) {
 | 
	
		
			
				|  |  | +                    KuaiShouCreative creative = new KuaiShouCreative();
 | 
	
		
			
				|  |  | +                    creative.setId("" + token.getAccountId() + detailJson.getLong("creative_id"));
 | 
	
		
			
				|  |  | +                    creative.setAccountId(token.getAccountId());
 | 
	
		
			
				|  |  | +                    creative.setCampaignId(detailJson.getLong("campaign_id"));
 | 
	
		
			
				|  |  | +                    creative.setUnitId(detailJson.getLong("unit_id"));
 | 
	
		
			
				|  |  | +                    creative.setCreativeId(detailJson.getLong("creative_id"));
 | 
	
		
			
				|  |  | +                    creative.setCreativeName(detailJson.getString("creative_name"));
 | 
	
		
			
				|  |  | +                    creative.setCreativeMaterialType(detailJson.getInteger("creative_material_type"));
 | 
	
		
			
				|  |  | +                    creative.setPhotoId(detailJson.getString("photo_id"));
 | 
	
		
			
				|  |  | +                    if (!Check.isNull(detailJson.getJSONArray("material_url"))) {
 | 
	
		
			
				|  |  | +                        creative.setMaterialUrl(detailJson.getJSONArray("material_url").toJSONString());
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                    if (!Check.isNull(detailJson.getJSONArray("image_tokens"))) {
 | 
	
		
			
				|  |  | +                        creative.setImageTokens(detailJson.getJSONArray("image_tokens").toJSONString());
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    creative.setStatus(detailJson.getInteger("status"));
 | 
	
		
			
				|  |  | +                    creative.setPutStatus(detailJson.getInteger("put_status"));
 | 
	
		
			
				|  |  | +                    creative.setCreateChannel(detailJson.getInteger("create_channel"));
 | 
	
		
			
				|  |  | +                    creative.setReviewDetail(detailJson.getString("review_detail"));
 | 
	
		
			
				|  |  | +                    creative.setCoverUrl(detailJson.getString("cover_url"));
 | 
	
		
			
				|  |  | +                    creative.setImageToken(detailJson.getString("image_token"));
 | 
	
		
			
				|  |  | +                    creative.setCoverWidth(detailJson.getString("cover_width"));
 | 
	
		
			
				|  |  | +                    creative.setCoverHeight(detailJson.getString("cover_height"));
 | 
	
		
			
				|  |  | +                    creative.setOverlayBgUrl(detailJson.getString("overlay_bg_url"));
 | 
	
		
			
				|  |  | +                    creative.setOverlayBgImageToken(detailJson.getString("overlay_bg_image_token"));
 | 
	
		
			
				|  |  | +                    creative.setStickerTitle(detailJson.getString("sticker_title"));
 | 
	
		
			
				|  |  | +                    creative.setOverlayType(detailJson.getString("overlay_type"));
 | 
	
		
			
				|  |  | +                    creative.setClickTrackUrl(detailJson.getString("click_track_url"));
 | 
	
		
			
				|  |  | +                    creative.setImpressionUrl(detailJson.getString("impression_url"));
 | 
	
		
			
				|  |  | +                    creative.setAdPhotoPlayedT3sUrl(detailJson.getString("ad_photo_played_t3s_url"));
 | 
	
		
			
				|  |  | +                    JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
 | 
	
		
			
				|  |  | +                    if (!Check.isNull(displayInfoJson)) {
 | 
	
		
			
				|  |  | +                        creative.setDescription(displayInfoJson.getString("description"));
 | 
	
		
			
				|  |  | +                        creative.setActionBarText(displayInfoJson.getString("action_bar_text"));
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    creative.setCreateTime(new Date());
 | 
	
		
			
				|  |  | +                    creative.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | +                    creatives.add(creative);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            creativeService.replaceBatch(creatives);
 | 
	
		
			
				|  |  | +            getCreativeList2(token, startDate, endDate, page + 1);
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      public void getCreativeListByPage(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page) {
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  |              String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
 | 
	
	
		
			
				|  | @@ -2920,6 +3063,77 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  | +     * 待删除
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param token
 | 
	
		
			
				|  |  | +     * @param startDate
 | 
	
		
			
				|  |  | +     * @param endDate
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void getImageList2(CtopOauthToken token, Date startDate, Date endDate, Integer page) {
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.IMAGE_LIST;
 | 
	
		
			
				|  |  | +            Map<String, String> headers = new HashMap<String, String>();
 | 
	
		
			
				|  |  | +            headers.put("Content-Type", " application/json");
 | 
	
		
			
				|  |  | +            headers.put("Access-Token", token.getAccessToken());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //传参
 | 
	
		
			
				|  |  | +            JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  | +            param.put("advertiser_id", token.getAccountId());
 | 
	
		
			
				|  |  | +            if (startDate != null && endDate != null) {
 | 
	
		
			
				|  |  | +                param.put("startDate", DateUtils.formatDate(startDate));
 | 
	
		
			
				|  |  | +                param.put("endDate", DateUtils.formatDate(endDate));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            param.put("page_size", 500);
 | 
	
		
			
				|  |  | +            param.put("page", page);
 | 
	
		
			
				|  |  | +            //
 | 
	
		
			
				|  |  | +            String result = HttpUtils.httpPostRequest(url, param, headers);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            JSONObject resultJson = JSONObject.parseObject(result);
 | 
	
		
			
				|  |  | +            Integer code = resultJson.getInteger("code");
 | 
	
		
			
				|  |  | +            String message = resultJson.getString("message");
 | 
	
		
			
				|  |  | +            if (null == code || code != 0) {
 | 
	
		
			
				|  |  | +                log.error("获取快手图片列表数据异常:{},accountId:{}", message, token.getAccountId());
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
 | 
	
		
			
				|  |  | +            if (null == details || details.size() <= 0) {
 | 
	
		
			
				|  |  | +                log.info("快手图片列表信息为空=》accountId:{}", token.getAccountId());
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            for (int i = 0; i < details.size(); i++) {
 | 
	
		
			
				|  |  | +                var detailJson = details.getJSONObject(i);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if (Check.isNull(detailJson.getString("signature"))) {
 | 
	
		
			
				|  |  | +                    continue;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                var kuaiShouImageGet = JSONObject.toJavaObject(detailJson, KuaiShouImageGet.class);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if (StringUtils.isBlank(String.valueOf(kuaiShouImageGet.getImageToken()))) {
 | 
	
		
			
				|  |  | +                    continue;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                kuaiShouImageGet.setId(token.getAccountId() + kuaiShouImageGet.getSignature());
 | 
	
		
			
				|  |  | +                kuaiShouImageGet.setAccountId(token.getAccountId());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                Integer type = MaterialEnum.getTypeBySize(kuaiShouImageGet.getWidth(), kuaiShouImageGet.getHeight());
 | 
	
		
			
				|  |  | +                if (!Check.isNull(type)) {
 | 
	
		
			
				|  |  | +                    kuaiShouImageGet.setMaterialType(type);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                kuaiShouImageGet.setCreateTime(new Date());
 | 
	
		
			
				|  |  | +                kuaiShouImageGet.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | +                kuaiShouImageGetService.saveOrUpdate(kuaiShouImageGet);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            getImageList2(token, startDate, endDate, page + 1);
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  |       * 查询图片列表
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      private void getImageList(CtopOauthToken token, Date startDate, Date endDate, int page) {
 |