Browse Source

修改代码逻辑

syh 4 years ago
parent
commit
81690bd406

+ 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

+ 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);

+ 0 - 9
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;
 

+ 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);