Pārlūkot izejas kodu

KuaishouMaterialsLoadJob添加图片方法增加,以及其他方法中对于时间的改造

hcst_sunzhen 5 gadi atpakaļ
vecāks
revīzija
e1be916eef

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

@@ -5,11 +5,13 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
 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;
@@ -25,6 +27,10 @@ public class KuaishouMaterialsLoadJob implements Job {
 
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        //增加接口的开始和结束日期
+        Date startDate = DateUtils.addDay(new Date(),-1);
+        Date endDate = new Date();
+
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
 
@@ -35,13 +41,15 @@ public class KuaishouMaterialsLoadJob implements Job {
                 public void run() {
                     try {
                         //1:获取全量广告计划数据
-                        kuaishouInterfaceService.getCampaignList(token);
+                        kuaishouInterfaceService.getCampaignList(token,startDate,endDate);
                         //1:获取全量广告组数据
-                        kuaishouInterfaceService.getGroupList(token);
+                        kuaishouInterfaceService.getGroupList(token,startDate,endDate);
                         //1:获取全量创意数据
-                        kuaishouInterfaceService.getCreativeList(token);
+                        kuaishouInterfaceService.getCreativeList(token,startDate,endDate);
                         //2:获取全量视频素材数据
-                        kuaishouInterfaceService.getVideoList(token);
+                        kuaishouInterfaceService.getVideoList(token,startDate,endDate);
+                        //3: 获取图片信息数据
+                        kuaishouInterfaceService.getImageList(token,startDate,endDate);
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {

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

@@ -126,6 +126,10 @@ public class KuaishouInterfaceConstant {
      */
     public static final String UPDATE_CREATIVE = "/rest/openapi/v2/creative/update";
 
+    /**
+     * 快手-查询图片列表
+     */
+    public static final String IMAGE_LIST  = "/rest/openapi/v1/file/ad/image/list";
 
     /**
      * 登录

+ 17 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouController.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -13,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -88,25 +90,25 @@ public class KuaiShouController {
 
     @RequestMapping("/getCampaignList")
     public void getCampaignList() {
-        String accessToken = "f60f51a8f7d8938d6147d38357fed70c";
-        Long advertiserId = 23212L;
-        kuaishouInterfaceService.getCampaignList(accessToken, advertiserId, 1);
+        String accessToken = "18cf38d50da314dcbd9cb6db9c43bcbf";
+        Long advertiserId = 1595407L;
+        kuaishouInterfaceService.getCampaignList(accessToken, advertiserId, DateUtils.addDay(new Date(),-1), new Date(), 1);
 
     }
 
     @RequestMapping("/getGroupList")
     public void getGroupList() {
-        String accessToken = "f60f51a8f7d8938d6147d38357fed70c";
-        Long advertiserId = 23212L;
-        kuaishouInterfaceService.getGroupList(accessToken, advertiserId, 1);
+        String accessToken = "604d2f2ffe5573c3500ffee358ba9b3c";
+        Long advertiserId = 1595407L;
+        kuaishouInterfaceService.getGroupList(accessToken, advertiserId, DateUtils.addDay(new Date(),-1), new Date(), 1);
 
     }
 
     @RequestMapping("/getCreativeList")
     public void getCreativeList() {
-        String accessToken = "cbe9caeffcc2c5ccd97a05bf909896da";
-        Long advertiserId = 23212L;
-        kuaishouInterfaceService.getCreativeList(accessToken, advertiserId, 1);
+        String accessToken = "604d2f2ffe5573c3500ffee358ba9b3c";
+        Long advertiserId = 1595407L;
+        kuaishouInterfaceService.getCreativeList(accessToken, advertiserId, DateUtils.addDay(new Date(),-1), new Date(), 1);
     }
 
     @RequestMapping("/getDeepConversionInfos")
@@ -242,5 +244,11 @@ public class KuaiShouController {
         kuaishouInterfaceService.advertiserInfo(23212L, "10b6ad966b7e958d1510a78a5315ec5c");
     }
 
+    @RequestMapping("getImageList")
+    public void getImageList() {
+        String accessToken = "604d2f2ffe5573c3500ffee358ba9b3c";
+        Long advertiserId = 1595407L;
+        kuaishouInterfaceService.getImageList(accessToken, advertiserId, new Date(), new Date(), 1);
+    }
 
 }

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

@@ -75,6 +75,12 @@ public class KuaiShouImageGet {
     @ApiModelProperty(value = "图片 token")
     private Object imageToken;
     /**
+     * 图片 md5
+     */
+    @Excel(name = "图片 md5", width = 15)
+    @ApiModelProperty(value = "图片 md5")
+    private String signature;
+    /**
      * 创建时间
      */
     @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouImageGetMapper.java

@@ -2,6 +2,9 @@ package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Description: 快手-获取图片接口
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KuaiShouImageGetMapper extends BaseMapper<KuaiShouImageGet> {
 
+    void replaceBatch(@Param(value = "images")List<KuaiShouImageGet>imagesGets);
 }

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

@@ -2,4 +2,34 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouImageGetMapper">
 
-</mapper>
+    <insert id="replaceBatch">
+        replace into ctop_kuaishou_image_get(
+        account_id,
+        url,
+        width,
+        height,
+        size,
+        format,
+        signature,
+        image_token,
+        create_time,
+        update_time
+        )
+        values
+        <foreach collection="images" item="image" separator=",">
+            (
+            #{image.accountId},
+            #{image.url},
+            #{image.width},
+            #{image.height},
+            #{image.size},
+            #{image.format},
+            #{image.signature},
+            #{image.imageToken},
+            #{image.createTime},
+            #{image.updateTime}
+            )
+        </foreach>
+    </insert>
+
+</mapper>

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

@@ -1,8 +1,12 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImage;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: 快手-获取图片接口
  * @Author: jeecg-boot
@@ -10,5 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Version: V1.0
  */
 public interface IKuaiShouImageGetService extends IService<KuaiShouImageGet> {
-
+    void replaceBatch(List<KuaiShouImageGet> imageGets);
 }

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

@@ -66,7 +66,7 @@ public interface IKuaishouInterfaceService {
      * @param accessToken
      * @param advertiserId
      */
-    void getCampaignList(String accessToken, Long advertiserId, Integer page);
+    void getCampaignList(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page);
 
 
     /**
@@ -84,7 +84,7 @@ public interface IKuaishouInterfaceService {
      * @param advertiserId
      * @param page
      */
-    void getGroupList(String accessToken, Long advertiserId, Integer page);
+    void getGroupList(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page);
 
     /**
      * 获取广告组信息 单条
@@ -96,7 +96,7 @@ public interface IKuaishouInterfaceService {
     void getGroup(String accessToken, Long advertiserId, Long unitId);
 
 
-    void getCreativeList(CtopOauthToken token);
+    void getCreativeList(CtopOauthToken token, Date startDate, Date endDate);
 
     void getVideoInfo(String accessToken, Long advertiserId, String photoId);
 
@@ -106,7 +106,7 @@ public interface IKuaishouInterfaceService {
      * @param accessToken
      * @param advertiserId
      */
-    void getCreativeList(String accessToken, Long advertiserId, Integer page);
+    void getCreativeList(String accessToken, Long advertiserId, Date startDate, Date endDate,Integer page);
 
     /**
      * 获取token
@@ -239,7 +239,7 @@ public interface IKuaishouInterfaceService {
      */
     Map<String, Object> advertiserInfo(Long accountId, String accessToken);
 
-    void getVideoList(CtopOauthToken token);
+    void getVideoList(CtopOauthToken token, Date startDate, Date endDate);
 
     void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate);
 
@@ -257,13 +257,31 @@ public interface IKuaishouInterfaceService {
 
     void getAdvertiserCreativeReportHourly(CtopOauthToken token, Date startDate, Date endDate);
 
-    void getCampaignList(CtopOauthToken token);
+    void getCampaignList(CtopOauthToken token, Date startDate, Date endDate);
 
-    void getGroupList(CtopOauthToken token);
+    void getGroupList(CtopOauthToken token,Date startDate, Date endDate);
 
     void loadData() throws InterruptedException;
 
     void updateCreativeReportHourlyStatistic(CtopOauthToken token, Date getDate);
 
     void deleteHourlyReport(Date deleteDate);
+
+    /**
+     * 获取快手图片列表
+     * @param token
+     * @param startDate
+     * @param endDate
+     */
+    void getImageList(CtopOauthToken token, Date startDate, Date endDate);
+
+    /**
+     * 获取快手图片列表--测试使用
+     * @param token
+     * @param accountId
+     * @param startDate
+     * @param endDate
+     * @param page
+     */
+    void getImageList(String token, Long accountId, Date startDate, Date endDate, int page);
 }

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

@@ -1,18 +1,30 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouImageGetMapper;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouVideoGetMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouImageGetService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * @Description: 快手-获取图片接口
  * @Author: jeecg-boot
- * @Date: 2019-07-25
+ * @Date: 2019-12-03
  * @Version: V1.0
  */
 @Service
 public class KuaiShouImageGetServiceImpl extends ServiceImpl<KuaiShouImageGetMapper, KuaiShouImageGet> implements IKuaiShouImageGetService {
+    @Autowired
+    private KuaiShouImageGetMapper imageGetMapper;
+
+    @Override
+    public void replaceBatch(List<KuaiShouImageGet> imageGets) {
+        imageGetMapper.replaceBatch(imageGets);
+    }
 
 }

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

@@ -28,6 +28,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.type.TypeFactory;
 import lombok.extern.slf4j.Slf4j;
 import lombok.var;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.http.ParseException;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -207,11 +208,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     @Override
-    public void getVideoList(CtopOauthToken token) {
-        getVideoListByPage(token, 1);
+    public void getVideoList(CtopOauthToken token, Date startDate, Date endDate) {
+        getVideoListByPage(token, startDate, endDate, 1);
     }
 
-    private void getVideoListByPage(CtopOauthToken token, int page) {
+    private void getVideoListByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
@@ -220,6 +221,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         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(new Date()));
+            param.put("end_date", DateUtils.formatDate(new Date()));
+        }
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
         Integer code = resultJson.getInteger("code");
@@ -244,7 +249,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             videoGets.add(kuaiShouVideoGet);
         }
         kuaiShouVideoGetService.replaceBatch(videoGets);
-        getVideoListByPage(token, page + 1);
+        getVideoListByPage(token, startDate, endDate, page + 1);
     }
 
     @Autowired
@@ -943,6 +948,17 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
             //4: 获取广告创意信息数据
             getAdvertiserCreativeReportDaily(token, getStartDate, getEndDate);
+
+            //获取全量广告计划数据
+            getCampaignList(token, null, null);
+            //获取全量广告主数据
+            getGroupList(token, null, null);
+            //获取全量创意数据
+            getCreativeList(token, null, null);
+            //获取全量视频素材数据
+            getVideoList(token, null, null);
+            //获取图片信息数据
+            getImageList(token, null, null);
         }
 
     }
@@ -1070,17 +1086,21 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     @Override
-    public void getCampaignList(CtopOauthToken token) {
-        getCampaignListByPage(token.getAccessToken(), token.getAccountId(), 1);
+    public void getCampaignList(CtopOauthToken token, Date startDate, Date endDate) {
+        getCampaignListByPage(token.getAccessToken(), token.getAccountId(), startDate, endDate, 1);
     }
 
-    private void getCampaignListByPage(String accessToken, Long accountId, int page) {
+    private void getCampaignListByPage(String accessToken, Long accountId, Date startDate, Date endDate, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_LIST;
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", accessToken);
         headers.put("Content-Type", " application/json");
         JSONObject param = new JSONObject();
         param.put("advertiser_id", accountId);
+        if(startDate != null && endDate != null){
+            param.put("start_date", DateUtils.formatDate(startDate));
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
         param.put("page", page);
         param.put("page_size", 200);
 
@@ -1102,7 +1122,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             return;
         }
         addCampaign(accountId, details);
-        getCampaignListByPage(accessToken, accountId, page + 1);
+        getCampaignListByPage(accessToken, accountId, startDate, endDate, page + 1);
     }
 
     /**
@@ -1113,13 +1133,17 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
      * @return
      */
     @Override
-    public void getCampaignList(String accessToken, Long advertiserId, Integer page) {
+    public void getCampaignList(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_LIST;
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", accessToken);
         headers.put("Content-Type", " application/json");
         JSONObject param = new JSONObject();
         param.put("advertiser_id", advertiserId);
+        if(startDate != null && endDate != null){
+            param.put("start_date", DateUtils.formatDate(startDate));
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
         param.put("page", page);
         param.put("page_size", 200);
         try {
@@ -1132,7 +1156,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     JSONArray details = dataJson.getJSONArray("details");
                     if (!Check.isNull(details)) {
                         addCampaign(advertiserId, details);
-                        getCampaignList(accessToken, advertiserId, page + 1);
+                        getCampaignList(accessToken, advertiserId, startDate, endDate, page + 1);
                     }
                 } else {
                     log.error("获取广告计划信息返回结果异常,advertiserId:{},异常信息:{}", advertiserId, resultJson);
@@ -1202,8 +1226,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     @Override
-    public void getGroupList(CtopOauthToken token) {
-        getGroupListByPage(token, 1);
+    public void getGroupList(CtopOauthToken token, Date startDate, Date endDate) {
+        getGroupListByPage(token, startDate, endDate, 1);
     }
 
     @Autowired
@@ -1228,13 +1252,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 @Override
                 public void run() {
                     //1:获取全量广告计划数据
-                    getCampaignList(token);
+                    getCampaignList(token,null,null);
                     //1:获取全量广告组数据
-                    getGroupList(token);
+                    getGroupList(token,null,null);
                     //1:获取全量创意数据
-                    getCreativeList(token);
+                    getCreativeList(token,null,null);
                     //2:获取全量视频素材数据
-                    getVideoList(token);
+                    getVideoList(token,null,null);
+                    //获取图片信息数据
+                    getImageList(token, null, null);
                     countDownLatch.countDown();
                 }
             });
@@ -1269,12 +1295,16 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         hourlyCreativeStatisticService.deleteHourlyReport(deleteDate);
     }
 
-    private void getGroupListByPage(CtopOauthToken token, int page) {
+    private void getGroupListByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
         JSONObject param = new JSONObject();
         param.put("advertiser_id", token.getAccountId());
         param.put("page_size", 200);
         param.put("page", page);
+        if(startDate != null && endDate != null){
+            param.put("start_date", DateUtils.formatDate(startDate));
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", token.getAccessToken());
         headers.put("Content-Type", " application/json");
@@ -1296,7 +1326,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             return;
         }
         addGroup(token.getAccountId(), details);
-        getGroupListByPage(token, page + 1);
+        getGroupListByPage(token, startDate, endDate, page + 1);
     }
 
     /**
@@ -1307,12 +1337,16 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
      * @return
      */
     @Override
-    public void getGroupList(String accessToken, Long advertiserId, Integer page) {
+    public void getGroupList(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
         JSONObject param = new JSONObject();
         param.put("advertiser_id", advertiserId);
         param.put("page_size", 200);
         param.put("page", page);
+        if(startDate != null && endDate != null){
+            param.put("start_date", DateUtils.formatDate(startDate));
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", accessToken);
         headers.put("Content-Type", " application/json");
@@ -1327,7 +1361,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         JSONArray details = dataJson.getJSONArray("details");
                         if (!Check.isNull(details)) {
                             addGroup(advertiserId, details);
-                            getGroupList(accessToken, advertiserId, page + 1);
+                            getGroupList(accessToken, advertiserId, startDate, endDate, page + 1);
                         }
 
                     } else {
@@ -1467,17 +1501,21 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     @Override
-    public void getCreativeList(CtopOauthToken token) {
-        getCreativeListByPage(token.getAccessToken(), token.getAccountId(), 1);
+    public void getCreativeList(CtopOauthToken token, Date startDate, Date endDate) {
+        getCreativeListByPage(token.getAccessToken(), token.getAccountId(), startDate, endDate, 1);
     }
 
-    public void getCreativeListByPage(String accessToken, Long advertiserId, Integer page) {
+    public void getCreativeListByPage(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page) {
         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", accessToken);
         JSONObject param = new JSONObject();
         param.put("advertiser_id", advertiserId);
+        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);
 
@@ -1527,7 +1565,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             }
         }
         creativeService.replaceBatch(creatives);
-        getCreativeListByPage(accessToken, advertiserId, page + 1);
+        getCreativeListByPage(accessToken, advertiserId, startDate, endDate, page + 1);
     }
 
     /**
@@ -1590,13 +1628,17 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
      * @param advertiserId
      */
     @Override
-    public void getCreativeList(String accessToken, Long advertiserId, Integer page) {
+    public void getCreativeList(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
         Map<String, String> headers = new HashMap<String, String>();
         headers.put("Content-Type", " application/json");
         headers.put("Access-Token", accessToken);
         JSONObject param = new JSONObject();
         param.put("advertiser_id", advertiserId);
+        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);
         try {
@@ -1635,7 +1677,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 }
 
                             }
-                            getCreativeList(accessToken, advertiserId, page + 1);
+                            getCreativeList(accessToken, advertiserId, startDate, endDate, page + 1);
                         }
                     }
                 } else {
@@ -2533,4 +2575,138 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         }
         return null;
     }
+
+    @Autowired IKuaiShouImageGetService kuaiShouImageGetService;
+
+    /**
+     * 查询图片列表
+     */
+    @Override
+    public void getImageList(CtopOauthToken token, Date startDate, Date endDate) {
+        getImageList(token, startDate, endDate, 1);
+    }
+
+    /**
+     * 查询图片列表
+     */
+    private void getImageList(CtopOauthToken token, Date startDate, Date endDate, int page ) {
+        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;
+        }
+        List<KuaiShouImageGet> imageGets = new ArrayList<>();
+        for (int i = 0; i < details.size(); i++) {
+            var detailJson = details.getJSONObject(i);
+            var kuaiShouImageGet = JSONObject.toJavaObject(detailJson, KuaiShouImageGet.class);
+
+            if(StringUtils.isBlank(String.valueOf(kuaiShouImageGet.getImageToken()))){
+                continue;
+            }
+            kuaiShouImageGet.setAccountId(token.getAccountId());
+            kuaiShouImageGet.setCreateTime(new Date());
+            kuaiShouImageGet.setUpdateTime(new Date());
+            imageGets.add(kuaiShouImageGet);
+        }
+        kuaiShouImageGetService.replaceBatch(imageGets);
+        getImageList(token, startDate, endDate, page + 1);
+    }
+
+    /**
+     * 查询图片列表---测试使用
+     */
+    public void getImageList(String token, Long accountId, Date startDate, Date endDate, int page ) {
+        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);
+
+        //传参
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", accountId);
+        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);
+
+        //test start
+        Map<String,Object> map = new HashMap<>();
+        Map<String,Object> map1 = new HashMap<>();
+
+        List<KuaiShouImageGet> list = new ArrayList<>();
+        KuaiShouImageGet kuaiShouImageGet1 = new KuaiShouImageGet();
+        kuaiShouImageGet1.setUrl("http://static.yximgs.com/udata/pkg/markb21f94845c4350.jpg");
+        kuaiShouImageGet1.setWidth(720L);
+        kuaiShouImageGet1.setHeight(1280L);
+        kuaiShouImageGet1.setSize(441029L);
+        kuaiShouImageGet1.setFormat("jpg");
+        kuaiShouImageGet1.setImageToken("market0a8a3104ee6b4f148ab21f94845c4350.jpg");
+        kuaiShouImageGet1.setSignature("44a20b91b0727fa2abb68b19c0456422");
+        list.add(kuaiShouImageGet1);
+
+        map1.put("details",list);
+        map1.put("total_count",4);
+        map.put("data",map1);
+        map.put("message","OK");
+        map.put("code",0);
+        String result = JSONObject.toJSONString(map);
+        //test end
+
+        JSONObject resultJson = JSONObject.parseObject(result);
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取快手图片列表数据异常:{},accountId:{}", message, accountId);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            log.info("快手图片列表信息为空=》accountId:{}", accountId);
+            return;
+        }
+        List<KuaiShouImageGet> imageGets = new ArrayList<>();
+        for (int i = 0; i < details.size(); i++) {
+            var detailJson = details.getJSONObject(i);
+            var kuaiShouImageGet = JSONObject.toJavaObject(detailJson, KuaiShouImageGet.class);
+
+            if(StringUtils.isBlank(String.valueOf(kuaiShouImageGet.getImageToken()))){
+                continue;
+            }
+            kuaiShouImageGet.setAccountId(accountId);
+            kuaiShouImageGet.setCreateTime(new Date());
+            kuaiShouImageGet.setUpdateTime(new Date());
+            imageGets.add(kuaiShouImageGet);
+        }
+        kuaiShouImageGetService.replaceBatch(imageGets);
+        getImageList(token, accountId, startDate, endDate, page+1 );
+    }
 }