Browse Source

Merge remote-tracking branch 'origin/master'

yumeng 4 years ago
parent
commit
b85e846bbd
30 changed files with 987 additions and 33 deletions
  1. 21 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  2. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  3. 7 1
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  4. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  5. 34 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceVideoETLReportReloadJob.java
  6. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccount.java
  7. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyAccount.java
  8. 30 28
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml
  9. 8 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml
  10. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportHourlyAccountMapper.xml
  11. 247 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCreativeWordPackageController.java
  12. 202 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/BytedanceAccountCommonSlogenController.java
  13. 108 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreativeWordPackage.java
  14. 53 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceAccountCommonSlogen.java
  15. 4 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceVideoSlogenInfo.java
  16. 18 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/ByteDanceCreativeWordPackageMapper.java
  17. 17 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceAccountCommonSlogenMapper.java
  18. 29 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/ByteDanceCreativeWordPackageMapper.xml
  19. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceAccountCommonSlogenMapper.xml
  20. 21 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCreativeWordPackageService.java
  21. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceAccountCommonSlogenService.java
  22. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IEtlBytedanceVideoInfoService.java
  23. 66 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCreativeWordPackageServiceImpl.java
  24. 18 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceAccountCommonSlogenServiceImpl.java
  25. 5 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceVideoSlogenInfoServiceImpl.java
  26. 17 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/EtlBytedanceVideoInfoServiceImpl.java
  27. 4 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/EtlBytedanceReportVideoDailyMapper.java
  28. 34 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/EtlBytedanceReportVideoDailyMapper.xml
  29. 1 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java
  30. 1 0
      module-toutiao/src/main/resources/bytedance_config.properties

+ 21 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
@@ -540,6 +541,26 @@ public class MaterialInfoController {
         return result;
 
     }
+
+    /**
+     * 头条素材信息编辑 -- 批量通过审核
+     * @param materialInfo
+     * @return
+     */
+    @PutMapping(value = "/bytedance/batchedit")
+    public Result<MaterialInfo> bytedanceBatchEdit(@RequestBody MaterialInfo materialInfo) {
+        Result<MaterialInfo> result = new Result<>();
+        String[] ids = materialInfo.getIds();
+        int successNum = 0;
+        for (String id : ids) {
+            materialInfo.setId(id);
+            Result<MaterialInfo> materialInfoResult = bytedanceEdit(materialInfo);
+            if(materialInfoResult.getCode().equals(CommonConstant.SC_OK_200)){ successNum++;}
+        }
+        return result.success("批量修改成功"+successNum+"个");
+
+    }
+
     /**
      * 通过id删除
      *

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -1441,7 +1441,7 @@ public class TestController {
     public Map<String, Object> getData(Long accountId) {
         Map<String, Object> result = new HashMap<>();
         CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-03-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-03-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }

+ 7 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -14,6 +14,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -29,7 +30,7 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @ApiModel(value = "ctop_material_info对象", description = "素材信息")
-public class MaterialInfo {
+public class MaterialInfo implements Serializable {
 
     /**
      * id
@@ -38,6 +39,11 @@ public class MaterialInfo {
     @ApiModelProperty(value = "id")
     private String id;
     /**
+     * 存放id的数组
+     */
+    @TableField(exist = false)
+    private String[] ids;
+    /**
      * code
      */
     @Excel(name = "code", width = 15)

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -73,6 +73,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
                 Integer code = jsonObject.getInteger("code");
                 if (code == 0) {
                     log.info("头条上传素材成功,返回信息:{},accountId:{}", jsonObject, accountId);
+                    //TODO 信息返回之后同步入库
                 } else {
                     log.error("头条上传素材失败,返回信息:{},accountId:{}", jsonObject, accountId);
                     UserAllocation allocation = userAllocationService.getByAccountId(Long.valueOf(accountId));

+ 34 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceVideoETLReportReloadJob.java

@@ -0,0 +1,34 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
+import cn.com.ctop.toutiao.modules.material.service.IEtlBytedanceVideoInfoService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * 头条视频报表etl剪辑员信息二次再刷新
+ * @author 黄学超
+ */
+public class BytedanceVideoETLReportReloadJob {
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+    @Autowired
+    private IEtlBytedanceVideoInfoService iEtlBytedanceVideoInfoService;
+
+    @XxlJob("bytedanceETLReportData")
+    public void execute() throws Exception {
+        //查询素材归属表所有的信息md5,clip_id,clip_name,shot_id,shot_name,plan_id,plan_name
+        List<ETLReportBytedanceVideo> etlReportBytedanceVideoList = iEtlBytedanceVideoInfoService.selectAllETLReportBytedanceVideo();
+        if (null == etlReportBytedanceVideoList || etlReportBytedanceVideoList.isEmpty()) {
+            XxlJobHelper.log("定时获取头条报表数据异常:未获取到素材归属信息");
+            XxlJobHelper.handleFail();
+            return ;
+        }
+        //动态sql更新md5,clip_id,clip_name,shot_id,shot_name,plan_id,plan_name不为空的数据
+        etlReportBytedanceVideoList.forEach(etlReportBytedanceVideo -> executorService.submit(() -> iEtlBytedanceVideoInfoService.updateETLReportNameIsNull(etlReportBytedanceVideo)));
+    }
+}

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

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonProperty;
@@ -176,6 +177,11 @@ public class KuaishouReportDailyAccount implements Serializable {
 
     @JsonProperty("play_3s_ratio")
     private Double play3sRatio;
+    @JsonProperty("play_5s_ratio")
+    @TableField("play_5s_ratio")
+    private Double play5sRatio;
+    @JsonProperty("play_end_ratio")
+    private Double playEndRatio;
     @JsonProperty("event_app_invoked")
     private Long eventAppInvoked;
 

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

@@ -108,6 +108,12 @@ public class KuaishouReportHourlyAccount implements Serializable {
     @TableField("play_3s_ratio")
     private BigDecimal play3sRatio;
 
+    @JsonProperty("play_5s_ratio")
+    @TableField("play_5s_ratio")
+    private Double play5sRatio;
+     @JsonProperty("play_end_ratio")
+    private Double playEndRatio;
+
     @JsonProperty
     private Long share;
     @JsonProperty

+ 30 - 28
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml

@@ -108,36 +108,38 @@
         play_3s_count)
         values
         <foreach collection="records" item="record" separator=",">
-            (#{record.companyId} ,
-            #{record.companyName} ,
-            #{record.projectId} ,
-            #{record.projectName} ,
-            #{record.accountId} ,
-            #{record.signature} ,
-            #{record.charge} ,
-            #{record.photoShow} ,
-            #{record.aclick} ,
-            #{record.bclick} ,
+            (
+            #{record.companyId},
+            #{record.companyName},
+            #{record.projectId},
+            #{record.projectName},
+            #{record.accountId},
+            #{record.signature},
+            #{record.charge},
+            #{record.photoShow},
+            #{record.aclick},
+            #{record.bclick},
             #{record.downloadStarted} ,
             #{record.downloadCompleted} ,
-            #{record.activation} ,
-            #{record.submit} ,
-            #{record.statDate} ,
-            #{record.photoClick} ,
-            #{record.eventPayFirstDay} ,
-            #{record.eventPayPurchaseAmountFirstDay} ,
-            #{record.eventPay} ,
-            #{record.eventPayPurchaseAmount} ,
-            #{record.eventRegister} ,
-            #{record.eventJinJianApp} ,
-            #{record.eventCreditGrantApp} ,
-            #{record.eventOrderPaid} ,
-            #{record.eventOrderPaidPurchaseAmount} ,
-            #{record.eventJinJianLandingPage} ,
+            #{record.activation},
+            #{record.submit},
+            #{record.statDate},
+            #{record.photoClick},
+            #{record.eventPayFirstDay},
+            #{record.eventPayPurchaseAmountFirstDay},
+            #{record.eventPay},
+            #{record.eventPayPurchaseAmount},
+            #{record.eventRegister},
+            #{record.eventJinJianApp},
+            #{record.eventCreditGrantApp},
+            #{record.eventOrderPaid},
+            #{record.eventOrderPaidPurchaseAmount},
+            #{record.eventJinJianLandingPage},
             #{record.eventCreditGrantLandingPage} ,
-            #{record.eventNextDayStay} ,
-            #{record.formCount} ,
-            #{record.play3sCount})
+            #{record.eventNextDayStay},
+            #{record.formCount},
+            #{record.play3sCount}
+            )
         </foreach>
     </insert>
     <select id="etlKuaishouAccountMaterialReportDailyList"
@@ -157,7 +159,7 @@
     sum(m.download_completed)as download_completed,
     sum(m.activation)as activation ,
     sum(m.submit)as submit,
-    date_format(m.stat_date,'%Y-%m-%d') as stat_date,
+    date_format(m.stat_date,'%Y-%m-%d')as stat_date,
     sum(m.photo_click)as photo_click,
     sum(m.event_pay_first_day)as event_pay_first_day,
     sum(m.event_pay_purchase_amount_first_day)as event_pay_purchase_amount_first_day,

+ 8 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -139,6 +139,8 @@
         form_cost,
         form_count,
         play_3s_ratio,
+        play_5s_ratio,
+        play_end_ratio,
         event_app_invoked,
         event_new_user_pay,
         event_new_user_pay_cost,
@@ -201,6 +203,8 @@
             #{add.formCost},
             #{add.formCount},
             #{add.play3sRatio},
+            #{add.play5sRatio},
+            #{add.playEndRatio},
             #{add.eventAppInvoked},
             #{add.eventNewUserPay},
             #{add.eventNewUserPayCost},
@@ -267,6 +271,8 @@
         form_cost,
         form_count,
         play_3s_ratio,
+        play_5s_ratio,
+        play_end_ratio,
         event_app_invoked,
         event_new_user_pay,
         event_new_user_pay_cost,
@@ -330,6 +336,8 @@
             #{add.formCost},
             #{add.formCount},
             #{add.play3sRatio},
+            #{add.play5sRatio},
+            #{add.playEndRatio},
             #{add.eventAppInvoked},
             #{add.eventNewUserPay},
             #{add.eventNewUserPayCost},

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportHourlyAccountMapper.xml

@@ -54,6 +54,8 @@
         form_cost,
         form_count,
         play_3s_ratio,
+        play_5s_ratio,
+        play_end_ratio,
         event_app_invoked,
         event_new_user_pay,
         event_new_user_pay_cost,
@@ -113,6 +115,8 @@
             #{add.formCost},
             #{add.formCount},
             #{add.play3sRatio},
+            #{add.play5sRatio},
+            #{add.playEndRatio},
             #{add.eventAppInvoked},
             #{add.eventNewUserPay},
             #{add.eventNewUserPayCost},

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

@@ -0,0 +1,247 @@
+package cn.com.ctop.toutiao.modules.material.controller;
+
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreativeWordPackage;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeWordPackageService;
+import org.jeecg.common.api.vo.Result;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 创意动态词包信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-05-19
+ */
+@Slf4j
+@Api(tags = "创意动态词包信息")
+@RestController
+@RequestMapping("/ctop/ByteDanceCreativeWordPackage")
+public class ByteDanceCreativeWordPackageController {
+    @Autowired
+    private IByteDanceCreativeWordPackageService ByteDanceCreativeWordPackageService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param ByteDanceCreativeWordPackage
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "创意动态词包信息-分页列表查询", notes = "创意动态词包信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<ByteDanceCreativeWordPackage>> queryPageList(ByteDanceCreativeWordPackage ByteDanceCreativeWordPackage,
+                                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                     @RequestParam(name = "pageSize", defaultValue = "100") Integer pageSize,
+                                                                     HttpServletRequest req) {
+        Result<IPage<ByteDanceCreativeWordPackage>> result = new Result<>();
+        QueryWrapper<ByteDanceCreativeWordPackage> queryWrapper = QueryGenerator.initQueryWrapper(ByteDanceCreativeWordPackage, req.getParameterMap());
+        Page<ByteDanceCreativeWordPackage> page = new Page<ByteDanceCreativeWordPackage>(pageNo, pageSize);
+        IPage<ByteDanceCreativeWordPackage> pageList = ByteDanceCreativeWordPackageService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param ByteDanceCreativeWordPackage
+     * @return
+     */
+    @ApiOperation(value = "创意动态词包信息-添加", notes = "创意动态词包信息-添加")
+    @PostMapping(value = "/add")
+    public Result<ByteDanceCreativeWordPackage> add(@RequestBody ByteDanceCreativeWordPackage ByteDanceCreativeWordPackage) {
+        Result<ByteDanceCreativeWordPackage> result = new Result<>();
+        try {
+            ByteDanceCreativeWordPackageService.save(ByteDanceCreativeWordPackage);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param ByteDanceCreativeWordPackage
+     * @return
+     */
+    @ApiOperation(value = "创意动态词包信息-编辑", notes = "创意动态词包信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<ByteDanceCreativeWordPackage> edit(@RequestBody ByteDanceCreativeWordPackage ByteDanceCreativeWordPackage) {
+        Result<ByteDanceCreativeWordPackage> result = new Result<ByteDanceCreativeWordPackage>();
+        ByteDanceCreativeWordPackage ByteDanceCreativeWordPackageEntity = ByteDanceCreativeWordPackageService.getById(ByteDanceCreativeWordPackage.getId());
+        if (ByteDanceCreativeWordPackageEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = ByteDanceCreativeWordPackageService.updateById(ByteDanceCreativeWordPackage);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "创意动态词包信息-通过id删除", notes = "创意动态词包信息-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            ByteDanceCreativeWordPackageService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "创意动态词包信息-批量删除", notes = "创意动态词包信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<ByteDanceCreativeWordPackage> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<ByteDanceCreativeWordPackage> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.ByteDanceCreativeWordPackageService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "创意动态词包信息-通过id查询", notes = "创意动态词包信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<ByteDanceCreativeWordPackage> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<ByteDanceCreativeWordPackage> result = new Result<>();
+        ByteDanceCreativeWordPackage ByteDanceCreativeWordPackage = ByteDanceCreativeWordPackageService.getById(id);
+        if (ByteDanceCreativeWordPackage == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(ByteDanceCreativeWordPackage);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<ByteDanceCreativeWordPackage> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                ByteDanceCreativeWordPackage ByteDanceCreativeWordPackage = JSON.parseObject(deString, ByteDanceCreativeWordPackage.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(ByteDanceCreativeWordPackage, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<ByteDanceCreativeWordPackage> pageList = ByteDanceCreativeWordPackageService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "创意动态词包信息列表");
+        mv.addObject(NormalExcelConstants.CLASS, ByteDanceCreativeWordPackage.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("创意动态词包信息列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<ByteDanceCreativeWordPackage> listByteDanceCreativeWordPackages = ExcelImportUtil.importExcel(file.getInputStream(), ByteDanceCreativeWordPackage.class, params);
+                ByteDanceCreativeWordPackageService.saveBatch(listByteDanceCreativeWordPackages);
+                return Result.ok("文件导入成功!数据行数:" + listByteDanceCreativeWordPackages.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}
+

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

@@ -0,0 +1,202 @@
+package cn.com.ctop.toutiao.modules.material.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceAccountCommonSlogen;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceAccountCommonSlogenService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 头条账户通用文案数据
+ * @author jeecg-boot
+ * @date   2021-05-24
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="头条账户通用文案数据")
+@RestController
+@RequestMapping("/ctop/bytedanceAccountCommonSlogen")
+public class BytedanceAccountCommonSlogenController {
+	@Autowired
+	private IBytedanceAccountCommonSlogenService bytedanceAccountCommonSlogenService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceAccountCommonSlogen
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="头条账户通用文案数据-分页列表查询", notes="头条账户通用文案数据-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceAccountCommonSlogen>> queryPageList(BytedanceAccountCommonSlogen bytedanceAccountCommonSlogen,
+																	 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																	 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																	 HttpServletRequest req) {
+		Result<IPage<BytedanceAccountCommonSlogen>> result = new Result<>();
+		QueryWrapper<BytedanceAccountCommonSlogen> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceAccountCommonSlogen, req.getParameterMap());
+		Page<BytedanceAccountCommonSlogen> page = new Page<>(pageNo, pageSize);
+		IPage<BytedanceAccountCommonSlogen> pageList = bytedanceAccountCommonSlogenService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceAccountCommonSlogen
+	 * @return
+	 */
+	@ApiOperation(value="头条账户通用文案数据-添加", notes="头条账户通用文案数据-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceAccountCommonSlogen> add(@RequestBody BytedanceAccountCommonSlogen bytedanceAccountCommonSlogen) {
+		Result<BytedanceAccountCommonSlogen> result = new Result<>();
+		try {
+			bytedanceAccountCommonSlogenService.save(bytedanceAccountCommonSlogen);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceAccountCommonSlogen
+	 * @return
+	 */
+	@ApiOperation(value="头条账户通用文案数据-编辑", notes="头条账户通用文案数据-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceAccountCommonSlogen> edit(@RequestBody BytedanceAccountCommonSlogen bytedanceAccountCommonSlogen) {
+		Result<BytedanceAccountCommonSlogen> result = new Result<>();
+		BytedanceAccountCommonSlogen bytedanceAccountCommonSlogenEntity = bytedanceAccountCommonSlogenService.getById(bytedanceAccountCommonSlogen.getId());
+		if(bytedanceAccountCommonSlogenEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceAccountCommonSlogenService.updateById(bytedanceAccountCommonSlogen);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="头条账户通用文案数据-通过id删除", notes="头条账户通用文案数据-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id") String id) {
+		try {
+			bytedanceAccountCommonSlogenService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="头条账户通用文案数据-批量删除", notes="头条账户通用文案数据-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceAccountCommonSlogen> deleteBatch(@RequestParam(name="ids") String ids) {
+		Result<BytedanceAccountCommonSlogen> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceAccountCommonSlogenService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="头条账户通用文案数据-通过id查询", notes="头条账户通用文案数据-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceAccountCommonSlogen> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceAccountCommonSlogen> result = new Result<>();
+		BytedanceAccountCommonSlogen bytedanceAccountCommonSlogen = bytedanceAccountCommonSlogenService.getById(id);
+		if(bytedanceAccountCommonSlogen==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceAccountCommonSlogen);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+   * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<BytedanceAccountCommonSlogen> listBytedanceAccountCommonSlogens = ExcelImportUtil.importExcel(file.getInputStream(), BytedanceAccountCommonSlogen.class, params);
+              bytedanceAccountCommonSlogenService.saveBatch(listBytedanceAccountCommonSlogens);
+              return Result.ok("文件导入成功!数据行数:" + listBytedanceAccountCommonSlogens.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 108 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreativeWordPackage.java

@@ -0,0 +1,108 @@
+package cn.com.ctop.toutiao.modules.material.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+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;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+@Data
+@TableName("ctop_bytedance_creative_word_package")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_bytedance_creative_word_package对象", description = "今日头条创意词包")
+public class ByteDanceCreativeWordPackage {
+
+
+    /**id*/
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private java.lang.Integer id;
+    /**creativeWordId*/
+    @Excel(name = "creativeWordId", width = 15)
+    @ApiModelProperty(value = "creativeWordId")
+    private java.lang.Integer creativeWordId;
+    /**name*/
+    @Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+    private java.lang.String name;
+    /**defaultWord*/
+    @Excel(name = "defaultWord", width = 15)
+    @ApiModelProperty(value = "defaultWord")
+    private java.lang.String defaultWord;
+    /**words*/
+    @Excel(name = "words", width = 15)
+    @ApiModelProperty(value = "words")
+    private java.lang.Object words;
+    /**contentType*/
+    @Excel(name = "contentType", width = 15)
+    @ApiModelProperty(value = "contentType")
+    private java.lang.String contentType;
+    /**maxWordLen*/
+    @Excel(name = "maxWordLen", width = 15)
+    @ApiModelProperty(value = "maxWordLen")
+    private java.lang.Integer maxWordLen;
+    /**status*/
+    @Excel(name = "status", width = 15)
+    @ApiModelProperty(value = "status")
+    private java.lang.String status;
+    /**userRate*/
+    @Excel(name = "userRate", width = 15)
+    @ApiModelProperty(value = "userRate")
+    private Float userRate;
+    /**createTime*/
+    @ApiModelProperty(value = "createTime")
+    private java.util.Date createTime;
+    /**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+    private java.util.Date updateTime;
+
+
+
+    public ByteDanceCreativeWordPackage(){}
+
+    public ByteDanceCreativeWordPackage(JSONObject jsonObject){
+        int creativeWordId = jsonObject.getInteger("creative_word_id");
+        this.creativeWordId = creativeWordId;
+
+        int maxWordLen = jsonObject.getInteger("max_word_len");
+        this.maxWordLen = maxWordLen;
+
+        String name = jsonObject.getString("name");
+        if (null != name && !"".equals(name.trim())) {
+            this.name = name;
+        }
+
+        String defaultWord = jsonObject.getString("default_word");
+        if (null != defaultWord && !"".equals(defaultWord.trim())) {
+            this.defaultWord = defaultWord;
+        }
+
+        String words = jsonObject.getString("words");
+        if (null != words && !"".equals(words.trim())) {
+            this.words = words;
+        }
+
+        String contentType = jsonObject.getString("content_type");
+        if (null != contentType && !"".equals(contentType.trim())) {
+            this.contentType = contentType;
+        }
+
+        String status = jsonObject.getString("status");
+        if (null != status && !"".equals(status.trim())) {
+            this.status = status;
+        }
+
+        Float userRate = jsonObject.getFloat("user_rate");
+        this.userRate = userRate;
+    }
+
+
+}

+ 53 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceAccountCommonSlogen.java

@@ -0,0 +1,53 @@
+package cn.com.ctop.toutiao.modules.material.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 头条账户通用文案数据
+ * @author jeecg-boot
+ * @date   2021-05-24
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_bytedance_account_common_slogen")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_bytedance_account_common_slogen对象", description="头条账户通用文案数据")
+public class BytedanceAccountCommonSlogen {
+    
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**slogen*/
+	@Excel(name = "slogen", width = 15)
+    @ApiModelProperty(value = "slogen")
+	private String slogen;
+	/**accountId*/
+	@Excel(name = "accountId", width = 15)
+    @ApiModelProperty(value = "accountId")
+	private Integer accountId;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+	/**status*/
+	@Excel(name = "status", width = 15)
+    @ApiModelProperty(value = "status")
+	private Integer status;
+}

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

@@ -35,7 +35,9 @@ public class BytedanceVideoSlogenInfo {
 	/**status*/
 	private Integer status;
 
-	public BytedanceVideoSlogenInfo(String videoCode, String slogan, String userId) {
+	private String creativeWordIds;
+
+	public BytedanceVideoSlogenInfo(String videoCode, String slogan, String userId, String creativeWordIds) {
 		this.videoCode = videoCode;
 		this.slogan = slogan;
 		this.createBy = userId;
@@ -43,6 +45,7 @@ public class BytedanceVideoSlogenInfo {
 		this.createTime = new Date();
 		this.updateTime = new Date();
 		this.status = 1;
+		this.creativeWordIds = creativeWordIds;
 	}
 
 	public BytedanceVideoSlogenInfo() {

+ 18 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/ByteDanceCreativeWordPackageMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.toutiao.modules.material.mapper;
+
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreativeWordPackage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @Description: 今日头条创意信息
+ * @Author: jeecg-boot
+ * @Date: 2019-07-22
+ * @Version: V1.0
+ */
+public interface ByteDanceCreativeWordPackageMapper extends BaseMapper<ByteDanceCreativeWordPackage> {
+    void replaceBatch(@Param(value = "creativeWordPackages") List<ByteDanceCreativeWordPackage> creativeWordPackages);
+}

+ 17 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceAccountCommonSlogenMapper.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.toutiao.modules.material.mapper;
+
+import java.util.List;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceAccountCommonSlogen;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 头条账户通用文案数据
+ * @author jeecg-boot
+ * 2021-05-24
+ * @version V1.0
+ */
+public interface BytedanceAccountCommonSlogenMapper extends BaseMapper<BytedanceAccountCommonSlogen> {
+
+}

+ 29 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/ByteDanceCreativeWordPackageMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.toutiao.modules.material.mapper.ByteDanceCreativeWordPackageMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_bytedance_creative_word_package(
+        creative_word_id,
+        name,
+        default_word,
+        words,
+        content_type,
+        max_word_len,
+        status,
+        user_rate)
+        values
+        <foreach collection="creativeWordPackages" item="report" separator=",">
+            (
+            #{report.creativeWordId},
+            #{report.name},
+            #{report.defaultWord},
+            #{report.words},
+            #{report.contentType},
+            #{report.maxWordLen},
+            #{report.status},
+            #{report.userRate}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceAccountCommonSlogenMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.toutiao.modules.material.mapper.BytedanceAccountCommonSlogenMapper">
+
+</mapper>

+ 21 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCreativeWordPackageService.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.toutiao.modules.material.service;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreativeWordPackage;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 今日头条创意词包
+ * @Author: jeecg-boot
+ * @Date: 2021-05-18
+ * @Version: test
+ */
+public interface IByteDanceCreativeWordPackageService extends IService<ByteDanceCreativeWordPackage> {
+    Map<String, Object> getCreativeWordPackage();
+
+}

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceAccountCommonSlogenService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.material.service;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceAccountCommonSlogen;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 头条账户通用文案数据
+ * @author jeecg-boot
+ * 2021-05-24
+ * @version V1.0
+ */
+public interface IBytedanceAccountCommonSlogenService extends IService<BytedanceAccountCommonSlogen> {
+
+}

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IEtlBytedanceVideoInfoService.java

@@ -1,8 +1,11 @@
 package cn.com.ctop.toutiao.modules.material.service;
 
+import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
 import cn.com.ctop.toutiao.modules.material.entity.EtlBytedanceVideoInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: 头条视频报表信息
  * @Author: jeecg-boot
@@ -10,5 +13,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Version: V1.0
  */
 public interface IEtlBytedanceVideoInfoService extends IService<EtlBytedanceVideoInfo> {
+    List<ETLReportBytedanceVideo> selectAllETLReportBytedanceVideo();
 
+    void updateETLReportNameIsNull(ETLReportBytedanceVideo etlReportBytedanceVideo);
 }

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

@@ -0,0 +1,66 @@
+package cn.com.ctop.toutiao.modules.material.service.impl;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreativeWordPackage;
+import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceCreativeWordPackageMapper;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeWordPackageService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+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 javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+@Slf4j
+@Service
+public class ByteDanceCreativeWordPackageServiceImpl extends ServiceImpl<ByteDanceCreativeWordPackageMapper, ByteDanceCreativeWordPackage> implements IByteDanceCreativeWordPackageService {
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Resource
+    private ByteDanceCreativeWordPackageMapper byteDanceCreativeWordPackageMapper;
+
+    @Override
+    public Map<String, Object> getCreativeWordPackage(){
+        String accountId = "1649600126891015";
+        JSONObject data = new JSONObject();
+
+        //1:获取token
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", "application/json");
+        headers.put("Access-Token", token.getAccessToken());
+
+        data.put("advertiser_id", token.getAccountId());
+//        data.put("creative_word_ids","");  不填,默认返回所有创意词包
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_word_select");
+        String result = HttpUtils.httpGetRequest(url,headers,data);
+        JSONObject jsonObject = JSONObject.parseObject(result);
+        saveCreativeWordPackageToDb(jsonObject);
+        return null;
+    }
+
+    public void saveCreativeWordPackageToDb(JSONObject result){
+        List<ByteDanceCreativeWordPackage> resultList = new ArrayList<ByteDanceCreativeWordPackage>();
+        Integer code = result.getInteger("code");
+        if(code != null && 0 == code){
+            JSONObject data = result.getJSONObject("data");
+            JSONArray dataJSONArray = data.getJSONArray("creative_word");
+            for (int i = 0 ; i < dataJSONArray.size() ; i++) {
+                JSONObject creativeWord = (JSONObject)dataJSONArray.get(i);
+                ByteDanceCreativeWordPackage byteDanceCreativeWordPackage = new ByteDanceCreativeWordPackage(creativeWord);
+                resultList.add(byteDanceCreativeWordPackage);
+            }
+            byteDanceCreativeWordPackageMapper.replaceBatch(resultList);
+        }
+    }
+
+}

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

@@ -0,0 +1,18 @@
+package cn.com.ctop.toutiao.modules.material.service.impl;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceAccountCommonSlogen;
+import cn.com.ctop.toutiao.modules.material.mapper.BytedanceAccountCommonSlogenMapper;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceAccountCommonSlogenService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 头条账户通用文案数据
+ * @author jeecg-boot
+ * 2021-05-24
+ * @version V1.0
+ */
+@Service
+public class BytedanceAccountCommonSlogenServiceImpl extends ServiceImpl<BytedanceAccountCommonSlogenMapper, BytedanceAccountCommonSlogen> implements IBytedanceAccountCommonSlogenService {
+
+}

+ 5 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceVideoSlogenInfoServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
 import cn.com.ctop.toutiao.modules.material.mapper.BytedanceVideoSlogenInfoMapper;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoService;
 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 org.springframework.stereotype.Service;
@@ -25,8 +26,10 @@ public class BytedanceVideoSlogenInfoServiceImpl extends ServiceImpl<BytedanceVi
             return;
         }
         for(int i=0;i<slogans.size();i++){
-            String slogan = slogans.getString(i);
-            BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,slogan,userId);
+            JSONObject sloganObject = slogans.getJSONObject(i);
+            String title = sloganObject.getString("title");
+            String creativeWordIds = Check.isNull(sloganObject.getJSONArray("creative_word_ids")) ? "" : sloganObject.getJSONArray("creative_word_ids").toJSONString();
+            BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,title,userId,creativeWordIds);
             this.save(slogenInfo);
         }
     }

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

@@ -1,11 +1,16 @@
 package cn.com.ctop.toutiao.modules.material.service.impl;
 
+import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
 import cn.com.ctop.toutiao.modules.material.entity.EtlBytedanceVideoInfo;
 import cn.com.ctop.toutiao.modules.material.mapper.EtlBytedanceVideoInfoMapper;
 import cn.com.ctop.toutiao.modules.material.service.IEtlBytedanceVideoInfoService;
+import cn.com.ctop.toutiao.modules.report.mapper.EtlBytedanceReportVideoDailyMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 头条视频报表信息
  * @author jeecg-boot
@@ -15,4 +20,16 @@ import org.springframework.stereotype.Service;
 @Service
 public class EtlBytedanceVideoInfoServiceImpl extends ServiceImpl<EtlBytedanceVideoInfoMapper, EtlBytedanceVideoInfo> implements IEtlBytedanceVideoInfoService {
 
+    @Autowired
+    EtlBytedanceReportVideoDailyMapper etlBytedanceReportVideoDailyMapper;
+
+    @Override
+    public List<ETLReportBytedanceVideo> selectAllETLReportBytedanceVideo(){
+        List<ETLReportBytedanceVideo> etlReportBytedanceVideoList = etlBytedanceReportVideoDailyMapper.getCtopMaterialAscriptionInfo();
+        return etlReportBytedanceVideoList;
+    }
+    @Override
+    public void updateETLReportNameIsNull(ETLReportBytedanceVideo etlReportBytedanceVideo){
+        etlBytedanceReportVideoDailyMapper.updateOneBytedanceVideoInfo(etlReportBytedanceVideo);
+    }
 }

+ 4 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/EtlBytedanceReportVideoDailyMapper.java

@@ -25,4 +25,8 @@ public interface EtlBytedanceReportVideoDailyMapper extends BaseMapper<EtlByteda
     List<ETLReportBytedanceVideo> etlBytedanceVideoInfo(@Param(value = "date") String date);
 
     void replaceEtlVideoInfo(@Param(value = "videoInfo") ETLReportBytedanceVideo videoInfo);
+
+    List<ETLReportBytedanceVideo> getCtopMaterialAscriptionInfo();
+
+    void updateOneBytedanceVideoInfo(@Param(value = "etlReportBytedanceVideo") ETLReportBytedanceVideo etlReportBytedanceVideo);
 }

+ 34 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/EtlBytedanceReportVideoDailyMapper.xml

@@ -2,6 +2,40 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.toutiao.modules.report.mapper.EtlBytedanceReportVideoDailyMapper">
 
+    <select id="getCtopMaterialAscriptionInfo" resultType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">
+        SELECT DISTINCT
+            md5,
+            cma.clip_id,
+            cma.clip_name,
+            cma.shot_id,
+            cma.shot_name,
+            cma.plan_id,
+            cma.plan_name
+        FROM
+            etl_report_bytedance_video video
+        LEFT JOIN ctop_material_ascription cma ON cma. CODE = video.md5
+        where
+		cma.clip_id is not null or
+		cma.clip_name is not null or
+		cma.shot_id is not null or
+		cma.shot_name is not null or
+		cma.plan_id is not null or
+		cma.plan_name is not null;
+    </select>
+
+    <update id="updateOneBytedanceVideoInfo"  parameterType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">
+        UPDATE etl_report_bytedance_video
+        <trim prefix="set" suffixOverrides=",">
+            <if test="etlReportBytedanceVideo.clipId!=null">clip_id=#{etlReportBytedanceVideo.clipId},</if>
+            <if test="etlReportBytedanceVideo.clipName!=null">clip_name=#{etlReportBytedanceVideo.clipName},</if>
+            <if test="etlReportBytedanceVideo.shotId!=null">shot_id=#{etlReportBytedanceVideo.shotId},</if>
+            <if test="etlReportBytedanceVideo.shotName!=null">shot_name=#{etlReportBytedanceVideo.shotName},</if>
+            <if test="etlReportBytedanceVideo.planId!=null">plan_id=#{etlReportBytedanceVideo.planId},</if>
+            <if test="etlReportBytedanceVideo.planName!=null">plan_name=#{etlReportBytedanceVideo.planName},</if>
+        </trim>
+        WHERE md5=#{etlReportBytedanceVideo.md5}
+    </update>
+
 
     <select id="getBytedanceVideoInfo" resultType="java.util.Map">
         SELECT

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

@@ -86,6 +86,7 @@ public class ReportServiceImpl implements IReportService {
         config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
         JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
         JSONObject getObject = getAdvertiserStat(token, jsonObject);
+        System.out.println(getObject);
         if(null == getObject){
             XxlJobHelper.log("头条广告主数据获取异常");
             return;

+ 1 - 0
module-toutiao/src/main/resources/bytedance_config.properties

@@ -32,3 +32,4 @@ bytedance_v2_advertiser_report_get=/2/report/advertiser/get/
 bytedance_v2_campaign_report_get=/2/report/campaign/get/
 bytedance_v2_ad_report_get=/2/report/ad/get/
 bytedance_v2_ad_creative_get=/2/report/creative/get/
+bytedance_v2_creative_word_select=/2/tools/creative_word/select/