Przeglądaj źródła

Merge branch 'master' into test

yumeng 4 lat temu
rodzic
commit
040f537531
13 zmienionych plików z 283 dodań i 81 usunięć
  1. 47 18
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  2. 1 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  3. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouCampaignController.java
  4. 93 49
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/MaterialRefuseController.java
  5. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java
  6. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml
  7. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCreativeService.java
  8. 12 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java
  9. 110 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeServiceImpl.java
  10. 3 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  11. 5 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java
  12. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  13. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouYiCheReportMapper.xml

+ 47 - 18
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -10,6 +10,7 @@ import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
@@ -33,6 +34,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -48,16 +50,39 @@ public class SampleTest {
     @Autowired
     private IByteDanceCreativeService creativeService;
 
+    @Autowired
+    private IKuaishouInterfaceService iKuaishouInterfaceService;
+
     @Test
     public void loadBytedanceCreativeData() {
         /**
          *
          */
-        CtopOauthToken token = oauthTokenService.getTokenByAccountId(1649600126891015L);
-        creativeService.getAdvertiserCreative(token,null,null);
+        CtopOauthToken token = oauthTokenService.getTokenByAccountId(23212L);
+        iKuaishouInterfaceService.getCampaignList(token, null, null);
+//        advertiserDataService.getMaterialList(token);
+    }
+
+
+    @Test
+    public void test() {
+        /**
+         *
+         */
+        // CtopOauthToken token = oauthTokenService.getTokenByAccountId(23212L);
+        //  iKuaishouInterfaceService.getCampaignList(token,null,null);
 //        advertiserDataService.getMaterialList(token);
+
+
+        // HttpUtils.httpPostRequest()
+        Map<String, Object> paramsMap = new HashMap<>();
+        paramsMap.put("campaignType",2);
+        String url = "https://ad.e.kuaishou.com/rest/dsp/control-panel/cover/list/actionBarText";
+        String s = HttpUtils.httpGet(url, paramsMap, null);
+        System.err.println(s);
     }
 
+
     @Autowired
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
@@ -78,7 +103,8 @@ public class SampleTest {
         log.info("总用时:{}毫秒", end - start);
     }
 
-    static ExecutorService executorService = Executors.newFixedThreadPool(10);;
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    ;
     static CountDownLatch countDownLatch = null;
 
     @Test
@@ -153,21 +179,24 @@ public class SampleTest {
             }
         }
     }
+
     @Autowired
     private IByteDanceCampaignService campaignService;
+
     @Test
-    public void testGetCampaign(){
+    public void testGetCampaign() {
         CtopOauthToken token = oauthTokenService.getOauthTokenByAccountId("1649600126891015");
-        campaignService.getAdvertiserCampaign(token,"1672261893872756",null);
+        campaignService.getAdvertiserCampaign(token, "1672261893872756", null);
     }
 
     @Autowired
     private IKuaishouEffectVideoInfoService effectVideoInfoService;
+
     @Test
-    public void loadKuaishouEffectVideoInfo(){
-        List<KuaishouEffectVideoInfo>videoInfos = effectVideoInfoService.list();
-        for (KuaishouEffectVideoInfo video:videoInfos) {
-            if(null!=video.getSignature()&&!"".equals(video.getSignature())){
+    public void loadKuaishouEffectVideoInfo() {
+        List<KuaishouEffectVideoInfo> videoInfos = effectVideoInfoService.list();
+        for (KuaishouEffectVideoInfo video : videoInfos) {
+            if (null != video.getSignature() && !"".equals(video.getSignature())) {
                 effectVideoInfoService.updateFinalCostDateBySignature(video.getSignature());
                 effectVideoInfoService.updateInitialCostDateBySignature(video.getSignature());
                 effectVideoInfoService.updateTotalCostBySignature(video.getSignature());
@@ -177,7 +206,7 @@ public class SampleTest {
     }
 
     @Test
-    public void getIndustryInfo(){
+    public void getIndustryInfo() {
         String access_token = "cbdf6502c04978ae401cb92a64530fb73a8c7dbe";
         // 请求地址
         String url = "https://ad.oceanengine.com/open_api/2/tools/industry/get/";
@@ -186,10 +215,10 @@ public class SampleTest {
     }
 
     @Test
-    public void loadImageInfo()throws Exception{
-        List<CtopOauthToken>tokens = oauthTokenService.selectToutiaoToken();
-        for (CtopOauthToken token:tokens) {
-            advertiserDataService.getImageByPage(token,null,1);
+    public void loadImageInfo() throws Exception {
+        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
+        for (CtopOauthToken token : tokens) {
+            advertiserDataService.getImageByPage(token, null, 1);
             Thread.sleep(1000L);
         }
     }
@@ -197,14 +226,14 @@ public class SampleTest {
     @Resource
     private KieSession kieSession;
     @Autowired
-    private IRuleEngineService ruleEngineService ;
+    private IRuleEngineService ruleEngineService;
 
     @Test
-    public void testEngine(){
-        QueryParam queryParam1 = new QueryParam() ;
+    public void testEngine() {
+        QueryParam queryParam1 = new QueryParam();
         queryParam1.setParamId("1");
         queryParam1.setParamSign("+");
-        QueryParam queryParam2 = new QueryParam() ;
+        QueryParam queryParam2 = new QueryParam();
         queryParam2.setParamId("2");
         queryParam2.setParamSign("-");
         // 入参

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

@@ -125,14 +125,7 @@ public class BatchController {
             String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, 1);
 
 
-            Thread planThread = new Thread() {
-                @Override
-                public void run() {
-                    iKuaishouInterfaceService.getCampaignList(oauthToken, new java.util.Date(), new java.util.Date());
-
-                }
-            };
-            planThread.start();
+            iKuaishouInterfaceService.getCampaignList(oauthToken, new java.util.Date(), new java.util.Date());
 
 
             Thread thread = new Thread() {

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

@@ -66,6 +66,7 @@ public class KuaiShouCampaignController {
                                                          HttpServletRequest req) {
         Result<IPage<KuaiShouCampaign>> result = new Result<>();
         QueryWrapper<KuaiShouCampaign> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouCampaign, req.getParameterMap());
+        queryWrapper.orderByDesc("put_create_time");
         Page<KuaiShouCampaign> page = new Page<KuaiShouCampaign>(pageNo, pageSize);
         IPage<KuaiShouCampaign> pageList = kuaiShouCampaignService.page(page, queryWrapper);
         result.setSuccess(true);

+ 93 - 49
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/MaterialRefuseController.java

@@ -19,12 +19,13 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @Slf4j
 @RestController
-@RequestMapping("/MaterialRefuse")
+@RequestMapping("/MaterialRefuse/")
 public class MaterialRefuseController {
     @Autowired
     private IMaterialRefuseService materialRefuseService;
@@ -34,9 +35,10 @@ public class MaterialRefuseController {
     private IKuaiShouUpdateService updateService;
     @Autowired
     private IKuaiShouCreativeService creativeService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(15);
 
 
-    @GetMapping(value = "/getRefuseCreative")
+    @GetMapping(value = "getRefuseCreative")
     public Result<IPage<KuaiShouCreative>> getRefuseCreative(KuaiShouCreative creative,
                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@@ -58,13 +60,36 @@ public class MaterialRefuseController {
         return result;
     }
 
-    @PostMapping(value = "/updateCreative")
-    public Map<String, Object> updateCreative(@RequestBody JSONObject jsonObject) {
-        Map<String, Object> map = new HashMap<>();
+
+    @GetMapping(value = "syncCreative")
+    public Result<Boolean> syncCreative(Long accountId, Long campaignId) {
+        Result<Boolean> result = new Result<>();
+        try {
+            QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("account_id", accountId);
+            queryWrapper.eq("media_id", 2);
+            queryWrapper.orderByDesc("create_time");
+            queryWrapper.last("limit 1");
+            CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(queryWrapper);
+            if (Check.isNull(ctopOauthToken)) {
+                throw new Exception("未获取到授权信息");
+            }
+            creativeService.syncCreative(accountId, ctopOauthToken.getAccessToken(), campaignId);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+    @PostMapping(value = "updateCreative")
+    public Result<Boolean> updateCreative(@RequestBody JSONObject jsonObject) {
+        Result<Boolean> result = new Result<>();
         if (Check.isNull(jsonObject)) {
-            map.put("code", -1);
-            map.put("message", "入参为空");
-            return map;
+            result.setSuccess(false);
+            result.setMessage("入参为空");
+            return result;
         }
 
         Long accountId = jsonObject.getLong("accountId");
@@ -75,34 +100,33 @@ public class MaterialRefuseController {
         queryWrapper.last("limit 1");
         CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(queryWrapper);
         if (Check.isNull(ctopOauthToken)) {
-            map.put("code", -1);
-            map.put("message", "未获取授权信息");
-            return map;
+            result.setSuccess(false);
+            result.setMessage("未获取到授权信息");
+            return result;
         }
 
         Map<String, Object> creativeMap = updateService.updateCreative(ctopOauthToken.getAccessToken(), accountId, jsonObject);
         if (Check.isNullMap(creativeMap)) {
-
-            map.put("code", -1);
-            map.put("message", "修改失败,返回为空");
-            return map;
+            result.setSuccess(false);
+            result.setMessage("修改失败,返回为空");
+            return result;
         }
 
         if ((Integer) creativeMap.get("code") != 0) {
-            map.put("code", -1);
-            map.put("message", creativeMap.get("message"));
-            return map;
+            result.setSuccess(false);
+            result.setMessage((String) creativeMap.get("message"));
+            return result;
         }
+        result.setSuccess(true);
 
-        return null;
+        return result;
     }
 
 
-    @PostMapping(value = "/batchUpdateCreative")
-    public Result<JSONObject> batchUpdateCreative(@RequestBody JSONObject jsonObject) {
+    @PostMapping(value = "batchUpdateCreative")
+    public Result<Boolean> batchUpdateCreative(@RequestBody JSONObject jsonObject) {
 
-        Result<JSONObject> result = new Result<>();
-        JSONObject returnJson = new JSONObject();
+        Result<Boolean> result = new Result<>();
         if (Check.isNull(jsonObject)) {
             result.setSuccess(false);
             result.setMessage("入参为空");
@@ -122,42 +146,62 @@ public class MaterialRefuseController {
             return result;
         }
 
+        Integer type = jsonObject.getInteger("type");
+        if (Check.isNull(type)) {
+            result.setSuccess(false);
+            result.setMessage("请选择修改类型");
+            return result;
+        }
+
+
         JSONArray creativeArr = jsonObject.getJSONArray("creativeArr");
-        Integer successCount = 0;
-        Integer failCount = 0;
-        if (!Check.isNull(creativeArr)) {
-
-            for (int i = 0; i < creativeArr.size(); i++) {
-                JSONObject creativeJson = creativeArr.getJSONObject(i);
-                if (!Check.isNull(creativeJson)) {
-                    Long creativeId = creativeJson.getLong("creativeId");
-                    JSONObject requestJson = new JSONObject();
-                    requestJson.put("creativeId", creativeId);
+        if (Check.isNull(creativeArr)) {
+            result.setSuccess(false);
+            result.setMessage("请选择修改创意");
+            return result;
+        }
+
+
+        for (int i = 0; i < creativeArr.size(); i++) {
+            JSONObject creativeJson = creativeArr.getJSONObject(i);
+            if (!Check.isNull(creativeJson)) {
+                Long creativeId = creativeJson.getLong("creativeId");
+                JSONObject requestJson = new JSONObject();
+                requestJson.put("creativeId", creativeId);
+                if (type == 0) {  // 替换修改广告语
                     String description = creativeJson.getString("description");
-                    if (!Check.isNull(description)) {
-                        requestJson.put("description", convertMoString(description));
-                        Map<String, Object> creativeMap = updateService.updateCreative(ctopOauthToken.getAccessToken(), accountId, requestJson);
-                        Integer code = (Integer) creativeMap.get("code");
-                        if (code == 0) {
-                            log.info("拒审重提成功,accountId:{},creativeId:{}", accountId, creativeId);
-                            successCount += 1;
-
-                        } else {
-                            log.info("拒审重提失败,accountId:{},creativeId:{}", accountId, creativeId);
-                            failCount += 1;
-                        }
+                    requestJson.put("description", convertMoString(description));
+                } else if (type == 1) { // 替换广告语
+                    String updateDescription = jsonObject.getString("updateDescription");
+                    String updateActionBarText = jsonObject.getString("updateActionBarText");
+                    if (Check.isNull(updateDescription) && Check.isNull(updateActionBarText)) {
+                        result.setSuccess(false);
+                        result.setMessage("广告语和行动号召按钮不能同时为空");
+                        return result;
+                    }
+                    if (!Check.isNull(updateDescription)) {
+                        requestJson.put("description", updateDescription);
+                    }
+                    if (!Check.isNull(updateActionBarText)) {
+                        requestJson.put("actionBarText", updateActionBarText);
                     }
 
                 }
 
+                executorService.submit(new Runnable() {
+                    @Override
+                    public  void run() {
+                        updateService.updateCreative(ctopOauthToken.getAccessToken(), accountId, requestJson);
+                    }
+                });
+
+
             }
 
         }
-        returnJson.put("successCount", successCount);
-        returnJson.put("failCount", failCount);
 
         result.setSuccess(true);
-        result.setResult(returnJson);
+        result.setMessage("异步执行中,请稍后查看");
         return result;
     }
 

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

@@ -189,8 +189,9 @@ public class KuaiShouCreative {
      */
     @Excel(name = "第三方有效播放监测链接", width = 15)
     @ApiModelProperty(value = "第三方有效播放监测链接")
-    private String adPhotoPlayedT3sUrl;
+    private String adPhotoPlayedT3sUrl; // 第三方有效播放监测链接
     private String shortSlogan;
+    private String actionbarClickUrl; // 第三方点击按钮监测链接
     /**
      * 创建时间
      */

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml

@@ -34,6 +34,7 @@
         programmed_creative_material,
         photo_ids,
         short_slogan,
+        actionbar_click_url,
         creative_create_time,
         creative_update_time,
         create_time,
@@ -72,6 +73,7 @@
             #{creative.programmedCreativeMaterial},
             #{creative.photoIds},
             #{creative.shortSlogan},
+            #{creative.actionbarClickUrl},
             #{creative.creativeCreateTime},
             #{creative.creativeUpdateTime},
             #{creative.createTime},

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCreativeService.java

@@ -31,4 +31,6 @@ public interface IKuaiShouCreativeService extends IService<KuaiShouCreative> {
      * @return
      */
     Integer checkCreativeCount(Long accountId, Long unitId);
+
+    void syncCreative(Long accountId, String accessToken, Long campaignId);
 }

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

@@ -1077,6 +1077,18 @@ public class BatchServiceImpl implements IBatchService {
                 if (!Check.isNull(creative.getOverlayType())) {
                     creativeJson.put("overlay_type", creative.getOverlayType());
                 }
+                // 第三方开始播放监测链接
+                if (!Check.isNull(creative.getImpressionUrl())) {
+                    creativeJson.put("impression_url", creative.getImpressionUrl());
+                }
+                // 第三方有效播放监测链接
+                if (!Check.isNull(creative.getAdPhotoPlayedT3sUrl())) {
+                    creativeJson.put("ad_photo_played_t3s_url", creative.getAdPhotoPlayedT3sUrl());
+                }
+                // 第三方点击按钮监测链接
+                if (!Check.isNull(creative.getActionbarClickUrl())) {
+                    creativeJson.put("actionbar_click_url", creative.getActionbarClickUrl());
+                }
 
                 // 是否修改应用
                 if (!Check.isNull(appJson)) {

+ 110 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeServiceImpl.java

@@ -1,17 +1,26 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCreativeMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouVideoGetMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 快手-创意信息
@@ -19,6 +28,7 @@ import java.util.List;
  * @Date: 2019-07-23
  * @Version: V1.0
  */
+@Slf4j
 @Service
 public class KuaiShouCreativeServiceImpl extends ServiceImpl<KuaiShouCreativeMapper, KuaiShouCreative> implements IKuaiShouCreativeService {
     @Autowired
@@ -65,4 +75,104 @@ public class KuaiShouCreativeServiceImpl extends ServiceImpl<KuaiShouCreativeMap
     public Integer checkCreativeCount(Long accountId, Long unitId) {
         return kuaiShouCreativeMapper.checkCreativeCount(accountId, unitId);
     }
+
+    @Override
+    public void syncCreative(Long accountId, String accessToken, Long campaignId) {
+
+
+        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", accountId);
+        param.put("page_size", 200);
+
+        String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        if (Check.isNull(resultJson)) {
+            log.error("获取广告创意返回结果为空,advertiserId:{}", accountId);
+            return;
+        }
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取广告创意返回结果异常,advertiserId:{},message:{}", accountId, message);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            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("" + accountId + detailJson.getLong("creative_id"));
+                creative.setAccountId(accountId);
+                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"));
+                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"));
+                creative.setCreativeCreateTime(detailJson.getDate("create_time"));
+                creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
+                creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                creative.setShortSlogan(detailJson.getString("short_slogan"));
+                creative.setActionbarClickUrl(detailJson.getString("actionbar_click_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 java.util.Date());
+                creative.setUpdateTime(new java.util.Date());
+                creative.setSiteId(detailJson.getLong("site_id"));
+                creative.setPhotoId(detailJson.getString("photo_id"));
+                if (detailJson.getLong("photo_id") == 0) {
+                    JSONArray photoIds = new JSONArray();
+                    JSONObject programmed_creative_material = detailJson.getJSONObject("programmed_creative_material");
+                    if (!Check.isNull(programmed_creative_material)) {
+                        creative.setProgrammedCreativeMaterial(programmed_creative_material.toJSONString());
+                        JSONArray materials = programmed_creative_material.getJSONArray("materials");
+                        if (!Check.isNull(materials)) {
+                            for (int j = 0; j < materials.size(); j++) {
+                                JSONObject materialJson = materials.getJSONObject(j);
+                                if (!Check.isNull(materialJson)) {
+                                    Long photo_id = materialJson.getLong("photo_id");
+                                    photoIds.add(String.valueOf(photo_id));
+                                }
+                            }
+                            creative.setPhotoIds(photoIds.toJSONString());
+                        }
+                    }
+                }
+                creatives.add(creative);
+            }
+        }
+        this.replaceBatch(creatives);
+    }
 }

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

@@ -59,8 +59,8 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
     public void getGroupList(String accessToken, Long accountId) {
         QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
         campaignQueryWrapper.eq("account_id", accountId);
-        campaignQueryWrapper.eq("status", 4);
-        campaignQueryWrapper.eq("put_status", 1);
+        /*campaignQueryWrapper.eq("status", 4);
+        campaignQueryWrapper.eq("put_status", 1);*/
         campaignQueryWrapper.orderByDesc("put_create_time");
         campaignQueryWrapper.last("limit 15");
         List<KuaiShouCampaign> list = kuaiShouCampaignService.list(campaignQueryWrapper);
@@ -216,6 +216,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                     creative.setShortSlogan(detailJson.getString("short_slogan"));
+                    creative.setActionbarClickUrl(detailJson.getString("actionbar_click_url"));
                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                     if (!Check.isNull(displayInfoJson)) {
                         creative.setDescription(displayInfoJson.getString("description"));

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

@@ -489,6 +489,7 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
             String creativeId = requestJson.getString("creativeId");
             String creativeName = requestJson.getString("creativeName");
             String description = requestJson.getString("description");
+            String action_bar_text = requestJson.getString("actionBarText");
             if (!Check.isNull(creativeId)) {
                 params.put("creative_id", creativeId);
             }
@@ -498,6 +499,9 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
             if (!Check.isNull(description)) {
                 params.put("description", description);
             }
+            if (!Check.isNull(action_bar_text)) {
+                params.put("action_bar_text", action_bar_text);
+            }
 
 
             String result = HttpUtils.httpPostRequest(url, params, header);
@@ -508,7 +512,7 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
                     returnMap.put("code", 0);
                     returnMap.put("success", true);
                     returnMap.put("message", "修改成功");
-                    Thread.sleep(100);
+                    Thread.sleep(50);
                     interfaceService.getCreativeByCreativeId(token, advertiserId, Long.valueOf(creativeId));
 
                 } else {

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

@@ -1348,6 +1348,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                     creative.setShortSlogan(detailJson.getString("short_slogan"));
+                    creative.setActionbarClickUrl(detailJson.getString("actionbar_click_url"));
                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                     if (!Check.isNull(displayInfoJson)) {
                         creative.setDescription(displayInfoJson.getString("description"));
@@ -1528,6 +1529,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                                     creative.setShortSlogan(detailJson.getString("short_slogan"));
+                                    creative.setActionbarClickUrl(detailJson.getString("actionbar_click_url"));
                                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                                     if (!Check.isNull(displayInfoJson)) {
                                         creative.setDescription(displayInfoJson.getString("description"));
@@ -3049,6 +3051,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                                     creative.setShortSlogan(detailJson.getString("short_slogan"));
+                                    creative.setActionbarClickUrl(detailJson.getString("actionbar_click_url"));
                                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                                     if (!Check.isNull(displayInfoJson)) {
                                         creative.setDescription(displayInfoJson.getString("description"));

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouYiCheReportMapper.xml

@@ -34,7 +34,7 @@
         case
         when t1.system_type = 'android'
         then 16
-        when t1.system_type = 'IOS'
+        when t1.system_type = 'ios'
         then 23
         else 0
         end
@@ -446,7 +446,7 @@
             and t1.stat_date = #{statDate}
         </if>
         ) t2
-        WHERE t2.campaignName in(680,681,845,846,847,848,849,850,1070,1071,1072,1066,1069,1064)
+        WHERE t2.campaignName in(581,582,583,584,552,553,554,680,681,845,846,847,848,849,850,1070,1071,1072,1066,1069,1064)
 
     </select>