Forráskód Böngészése

Merge branch 'test' of http://git.tjyourong.com.cn/ctop/adsp-boot into test

hcst_sunzhen 4 éve
szülő
commit
88f01566f7

+ 0 - 2
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -57,7 +57,6 @@ spring:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
     url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#    url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
     username: hcst
     password: test@20190531
     driver-class-name: com.mysql.jdbc.Driver
@@ -97,7 +96,6 @@ spring:
       datasource:
         master:
           url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver

+ 9 - 13
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -10,11 +10,10 @@ 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;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
@@ -47,19 +46,16 @@ public class SampleTest {
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
     @Autowired
-    private IReportService reportService;
-    @Autowired
-    private IKuaishouInterfaceService interfaceService;
+    private IByteDanceCreativeService creativeService;
 
     @Test
-    public void loadBytedanceCampaignData() {
-
-
-       // CorpWexinUtils.sendMessageByWeChatId("34585ddd4bd86e57756cf6a51b9443a5","测试消息发送");
-        interfaceService.getAppList(23212L,"493aedfee07d9c500c50077e7c808145");
-
-
-
+    public void loadBytedanceCreativeData() {
+        /**
+         *
+         */
+        CtopOauthToken token = oauthTokenService.getTokenByAccountId(1649600126891015L);
+        creativeService.getAdvertiserCreative(token,null,null);
+//        advertiserDataService.getMaterialList(token);
     }
 
     @Autowired

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertisePlanController.java

@@ -59,9 +59,9 @@ public class ByteDanceAdvertisePlanController {
         if (!pageList.getRecords().isEmpty()) {
             pageList.getRecords().forEach(it -> {
                 if (it.getToutiaoStatus().equals("AD_STATUS_DELIVERY_OK")) {
-                    it.setStatus(true);
+                    it.setPlanStatus(true);
                 } else {
-                    it.setStatus(false);
+                    it.setPlanStatus(false);
                 }
             });
         }

+ 0 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java

@@ -40,8 +40,6 @@ public class ByteDanceCampaignController {
 
     /**
      * 分页列表查询
-     *
-     * @param byteDanceCampaign
      * @param pageNo
      * @param pageSize
      * @param req

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCreativeController.java

@@ -69,13 +69,13 @@ public class ByteDanceCreativeController {
             queryWrapper.like("title",name);
         }
         if(null!=status&&!status.trim().equals("")){
-            queryWrapper.eq("status","CREATIVE_STATUS_AD_"+status);
+            queryWrapper.eq("opt_status","CREATIVE_STATUS_"+status);
         }
         Page<ByteDanceCreative> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceCreative> pageList = byteDanceCreativeService.page(page, queryWrapper);
         List<ByteDanceCreative> records = pageList.getRecords();
         if(null!=records&&!records.isEmpty()){
-            List<ByteDanceCreative> creatives = records.stream().map(creative-> creative.setCreateStatus(creative.getStatus().equalsIgnoreCase("CAMPAIGN_STATUS_ENABLE"))).collect(Collectors.toList());
+            List<ByteDanceCreative> creatives = records.stream().map(creative-> creative.setCreateStatus(creative.getOptStatus().equalsIgnoreCase("CREATIVE_STATUS_ENABLE"))).collect(Collectors.toList());
             pageList.setRecords(creatives);
         }
         result.setSuccess(true);

+ 1 - 10
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java

@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -29,16 +28,9 @@ import java.util.Date;
 @Accessors(chain = true)
 @ApiModel(value = "ctop_bytedance_advertise_plan对象", description = "今日头条广告计划信息")
 public class ByteDanceAdvertisePlan {
-
-    /**
-     * 头条平台广告计划id
-     */
     @TableId
-    @ApiModelProperty(value = "头条平台广告计划id")
     private Long id;
 
-
-    // 账户Id
     @Dict(dicCode = "account_id",dictTable="ctop_user_allocation",dicText="auth_name")
     private String accountId;
 
@@ -51,7 +43,6 @@ public class ByteDanceAdvertisePlan {
     @TableField(exist=false)
     private String landingType;
 
-    // 广告组id
     @Dict(dicCode = "id",dictTable="ctop_bytedance_campaign",dicText="name")
     private Long campaignId;
 
@@ -81,7 +72,7 @@ public class ByteDanceAdvertisePlan {
     private String toutiaoStatus;
 
     //true:投放中 false:暂停
-    private Boolean status;
+    private Boolean planStatus;
 
     // 广告计划操作状态
     private String optStatus;

+ 1 - 11
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCampaign.java

@@ -34,20 +34,15 @@ public class ByteDanceCampaign {
      * 今日头条广告组id
      */
     @TableId
-    @ApiModelProperty(value = "今日头条广告组id")
     private Long id;
     private Long accountId;
     /**
      * 广告组名称
      */
-    @Excel(name = "广告组名称", width = 15)
-    @ApiModelProperty(value = "广告组名称")
     private String name;
     /**
      * 广告组预算
      */
-    @Excel(name = "广告组预算", width = 15)
-    @ApiModelProperty(value = "广告组预算")
     private BigDecimal budget;
     /**
      * 广告组预算类型
@@ -56,8 +51,6 @@ public class ByteDanceCampaign {
     private String budgetMode;
     /**
      * 广告组推广目的
-     */
-    /**
      * extendsValue在此处为固定值,切忌胡乱修改
      */
     @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "181afbae847dd3bc7e27795d89538c9c")
@@ -68,19 +61,16 @@ public class ByteDanceCampaign {
     @Excel(name = "广告组时间戳,用于更新时提交,服务端判断是否基于最新信息修改", width = 15)
     @ApiModelProperty(value = "广告组时间戳,用于更新时提交,服务端判断是否基于最新信息修改")
     private String modifyTime;
+
     @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "fbc3e2fc9e6f5cfa5f6aeddd4c3bf818")
     private String status;
     /**
      * 广告组创建时间
      */
-    @Excel(name = "广告组创建时间", width = 15)
-    @ApiModelProperty(value = "广告组创建时间")
     private String campaignCreateTime;
     /**
      * 广告组修改时间
      */
-    @Excel(name = "广告组修改时间", width = 15)
-    @ApiModelProperty(value = "广告组修改时间")
     private String campaignModifyTime;
     /**
      * createTime

+ 7 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreative.java

@@ -61,6 +61,7 @@ public class ByteDanceCreative {
      */
     @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "57b60cec65bbc7cd3d6da4fbda589594")
     private String status;
+    private String optStatus;
     /**
      * 创意素材类型
      */
@@ -76,14 +77,12 @@ public class ByteDanceCreative {
     /**
      * 视频素材封面
      */
-    @Excel(name = "视频素材封面", width = 15)
-    @ApiModelProperty(value = "视频素材封面")
+    @Dict(dicCode = "id",dictTable="ctop_bytedance_image_info",dicText="image_url")
     private String imageId;
     /**
      * 视频id
      */
-    @Excel(name = "视频id", width = 15)
-    @ApiModelProperty(value = "视频id")
+    @Dict(dicCode = "id",dictTable="ctop_bytedance_video_info",dicText="video_url")
     private String videoId;
     /**
      * 创意审核信息
@@ -142,6 +141,10 @@ public class ByteDanceCreative {
         if (null != status && !"".equals(status.trim())) {
             this.status = status;
         }
+        String optStatus = dataObject.getString("opt_status");
+        if(null!=optStatus&&!"".equals(optStatus.trim())){
+            this.optStatus = optStatus;
+        }
         String imageMode = dataObject.getString("image_mode");
         if (null != imageMode && !"".equals(imageMode.trim())) {
             this.imageMode = imageMode;

+ 0 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCampaignServiceImpl.java

@@ -124,7 +124,6 @@ public class ByteDanceCampaignServiceImpl extends ServiceImpl<ByteDanceCampaignM
             return resultMap;
         }
         this.getAdvertiserCampaign(token,campaignId+"",null);
-
         resultMap.put("code", 0);
         resultMap.put("message", "广告组信息修改成功");
         resultMap.put("success",true);

+ 47 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/tool/controller/ByteDanceQueryToolController.java

@@ -2,6 +2,7 @@ package cn.com.ctop.toutiao.modules.tool.controller;
 
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.toutiao.modules.tool.service.IByteDanceConvertToolService;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
 import java.util.Map;
 
 @Slf4j
@@ -35,10 +37,52 @@ public class ByteDanceQueryToolController {
                 landingType, appType, downloadType, externalUrl, toutiaoPackage, downloadUrl);
         if(!convertQueryMap.get("code").equals(0)){
             result.error500("查询转化目标结果失败");
-            return result;
+        }else{
+            ((List)((JSONObject)convertQueryMap.get("data")).get("list")).forEach(it->{
+                if(((Map)it).get("convert_type")!=null){
+                    ((Map)it).put("name",getName(((Map)it).get("convert_type").toString()));
+                }
+            });
+            result.setSuccess(true);
+            result.setResult(convertQueryMap);
         }
-        result.setSuccess(true);
-        result.setResult(convertQueryMap);
         return result;
     }
+
+    private String getName(String convertType){
+        String convertName="";
+        switch (convertType) {
+            case "AD_CONVERT_SOURCE_TYPE_INTERNAL":
+                convertName = "线索通";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_JS":
+                convertName = "代码检测转化";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_XPATH":
+                convertName = "应用下载API";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_H5_API":
+                convertName = "落地页API(H5)";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_SDK":
+                convertName = "应用下载SDK";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_OPEN_URL":
+                convertName = "应用直达API(应用直达链接)";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_NORMAL_APP_DOWNLOAD":
+                convertName = "普通应用下载";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_CONFIG":
+                convertName = "无转化跟踪";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_CPS_GAME":
+                convertName = "内部游戏cps应用下载";
+                break;
+            case "AD_CONVERT_SOURCE_TYPE_APP_API_TEMAI":
+                convertName = "落地页API(支持特卖)";
+                break;
+        }
+        return convertName;
+    }
 }