Преглед на файлове

Merge branch 'master' into V1.1.7

yumeng преди 4 години
родител
ревизия
b4282d01e1
променени са 34 файла, в които са добавени 1018 реда и са изтрити 764 реда
  1. 0 2
      jeecg-boot-module-system/pom.xml
  2. 0 70
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneToMainUtil.java
  3. 18 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java
  4. 217 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceCustomerDdTbtjDataController.java
  5. 133 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  6. 37 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/BytedanceCustomerDdTbtjData.java
  7. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/BytedanceCustomerDdTbtjDataMapper.java
  8. 24 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/BytedanceCustomerDdTbtjDataMapper.xml
  9. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IBytedanceCustomerDdTbtjDataService.java
  10. 28 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceCustomerDdTbtjDataServiceImpl.java
  11. 50 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/BytedanceCustomTbtjDataExcelListener.java
  12. 0 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/JhsBakendDataExcelListener.java
  13. 73 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/BytedanceCustomTbtjDataEntity.java
  14. 8 8
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  15. 4 11
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
  16. 3 3
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
  17. 4 4
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
  18. 1 1
      jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
  19. 1 18
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  20. 11 403
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  21. 20 13
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  22. 0 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  23. 3 0
      module-job-kuaishou/src/main/resources/application-jiaoyang.yml
  24. 66 64
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml
  25. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/xml/ETLReportBytedanceVideoMapper.xml
  26. 0 7
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/service/impl/ETLReportBytedanceVideoServiceImpl.java
  27. 144 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/BytedanceVideoSlogenInfoController.java
  28. 50 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceVideoSlogenInfo.java
  29. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceVideoSlogenInfoMapper.java
  30. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceVideoSlogenInfoMapper.xml
  31. 20 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceVideoSlogenInfoService.java
  32. 46 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceVideoSlogenInfoServiceImpl.java
  33. 0 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceVideoReportService.java
  34. 0 57
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java

+ 0 - 2
jeecg-boot-module-system/pom.xml

@@ -75,13 +75,11 @@
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-toutiao</artifactId>
             <version>2.0.2</version>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>cn.com.ctop</groupId>
             <artifactId>module-oa</artifactId>
             <version>2.0.2</version>
-            <scope>compile</scope>
         </dependency>
 
         <dependency>

+ 0 - 70
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneToMainUtil.java

@@ -1,70 +0,0 @@
-package org.jeecg;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jeecgframework.codegenerate.generate.impl.CodeGenerateOneToMany;
-import org.jeecgframework.codegenerate.generate.pojo.onetomany.MainTableVo;
-import org.jeecgframework.codegenerate.generate.pojo.onetomany.SubTableVo;
-
-/**
- * 代码生成器入口【一对多】
- * 【 GUI模式已弃用,请转移Online模式进行代码生成 】
- * @Author 张代浩
- * @site www.jeecg.org
- *
- */
-public class JeecgOneToMainUtil {
-
-	/**
-	 * 一对多(父子表)数据模型,生成方法
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		//第一步:设置主表配置
-		MainTableVo mainTable = new MainTableVo();
-		mainTable.setTableName("jeecg_order_main");//表名
-		mainTable.setEntityName("GuiTestOrderMain");	 //实体名
-		mainTable.setEntityPackage("gui");	 //包名
-		mainTable.setFtlDescription("GUI订单管理");	 //描述
-
-		//第二步:设置子表集合配置
-		List<SubTableVo> subTables = new ArrayList<SubTableVo>();
-		//[1].子表一
-		SubTableVo po = new SubTableVo();
-		po.setTableName("jeecg_order_customer");//表名
-		po.setEntityName("GuiTestOrderCustom");	    //实体名
-		po.setEntityPackage("gui");	        //包名
-		po.setFtlDescription("客户明细");       //描述
-		//子表外键参数配置
-		/*说明:
-		 * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
-		 * b) 主表和子表的外键字段名字,必须相同(除主键ID外);
-		 * c) 多个外键字段,采用逗号分隔;
-		 */
-		po.setForeignKeys(new String[]{"order_id"});
-		subTables.add(po);
-		//[2].子表二
-		SubTableVo po2 = new SubTableVo();
-		po2.setTableName("jeecg_order_ticket");		//表名
-		po2.setEntityName("GuiTestOrderTicket");			//实体名
-		po2.setEntityPackage("gui"); 				//包名
-		po2.setFtlDescription("产品明细");			//描述
-		//子表外键参数配置
-		/*说明:
-		 * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
-		 * b) 主表和子表的外键字段名字,必须相同(除主键ID外);
-		 * c) 多个外键字段,采用逗号分隔;
-		 */
-		po2.setForeignKeys(new String[]{"order_id"});
-		subTables.add(po2);
-		mainTable.setSubTables(subTables);
-
-		//第三步:一对多(父子表)数据模型,代码生成
-		try {
-			new CodeGenerateOneToMany(mainTable,subTables).generateCodeFile(null);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-}

+ 18 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java

@@ -62,7 +62,7 @@ public class AiKuaishouAdvertiserStrategyController {
         QueryWrapper<AiKuaishouAdvertiserStrategy> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouAdvertiserStrategy, req.getParameterMap());
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String roleCode = sysRoleService.getRoleCodeByUserId(user.getId());
-        if(!CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)){
+        if (!CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
             queryWrapper.eq("user_id", user.getId());
         }
         Page<AiKuaishouAdvertiserStrategy> page = new Page<>(pageNo, pageSize);
@@ -98,22 +98,25 @@ public class AiKuaishouAdvertiserStrategyController {
         try {
             Long accountId = aiKuaishouAdvertiserStrategy.getAccountId();
             AiKuaishouAdvertiserStrategy getEntity = aiKuaishouAdvertiserStrategyService.getByAccountId(accountId);
-            if(null!=getEntity){
+            if (null != getEntity) {
                 result.error500("该账户配置信息已经被创建");
                 return result;
             }
             UserAllocation allocation = allocationService.getByAccountId(accountId);
-            if(null!=allocation){
+            if (null != allocation) {
                 aiKuaishouAdvertiserStrategy.setUserId(allocation.getUserId());
             }
             aiKuaishouAdvertiserStrategy.setDescription(aiKuaishouAdvertiserStrategy.getDescription().trim());
             Integer singleAppId = aiKuaishouAdvertiserStrategy.getSingleAppid();
             if (null != singleAppId && singleAppId == 1) {
-                Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
-                aiKuaishouAdvertiserStrategy.setAppId(appId);
+                if (aiKuaishouAdvertiserStrategy.getCampaignType() == 2 || aiKuaishouAdvertiserStrategy.getCampaignType() == 7) {
+                    Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
+                    aiKuaishouAdvertiserStrategy.setAppId(appId);
+                }
+
             }
             aiKuaishouAdvertiserStrategyService.save(aiKuaishouAdvertiserStrategy);
-            Thread thread = new Thread(){
+            Thread thread = new Thread() {
                 @Override
                 public void run() {
                     kuaishouVideoRelateCreativesService.videoRelateCreatives(aiKuaishouAdvertiserStrategy.getAccountId());
@@ -127,6 +130,7 @@ public class AiKuaishouAdvertiserStrategyController {
         }
         return result;
     }
+
     /**
      * 编辑
      *
@@ -141,10 +145,13 @@ public class AiKuaishouAdvertiserStrategyController {
             result.error500("未找到对应实体");
         } else {
             Integer singleAppId = aiKuaishouAdvertiserStrategy.getSingleAppid();
-            if (null != singleAppId && singleAppId == 1) {
-                Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
-                aiKuaishouAdvertiserStrategy.setAppId(appId);
+            if (aiKuaishouAdvertiserStrategy.getCampaignType() == 2 || aiKuaishouAdvertiserStrategy.getCampaignType() == 7) {
+                if (null != singleAppId && singleAppId == 1) {
+                    Integer appId = Integer.parseInt(JSONArray.parseArray(aiKuaishouAdvertiserStrategy.getAppIdArray()).getString(0));
+                    aiKuaishouAdvertiserStrategy.setAppId(appId);
+                }
             }
+
             boolean ok = aiKuaishouAdvertiserStrategyService.updateById(aiKuaishouAdvertiserStrategy);
             if (ok) {
                 result.success("修改成功!");
@@ -261,12 +268,12 @@ public class AiKuaishouAdvertiserStrategyController {
     }
 
     @GetMapping(value = "testCreate")
-    public Map<String,Object> testCreate(Long accountId){
+    public Map<String, Object> testCreate(Long accountId) {
         return aiKuaishouAdvertiserStrategyService.testCreate(accountId);
     }
 
     @GetMapping(value = "aiHistoricalMissingMaterial")
-    public Map<String,Object> aiHistoricalMissingMaterial(Long accountId){
+    public Map<String, Object> aiHistoricalMissingMaterial(Long accountId) {
         return aiKuaishouAdvertiserStrategyService.aiHistoricalMissingMaterial(accountId);
     }
 }

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

@@ -0,0 +1,217 @@
+package org.jeecg.modules.ctop.controller;
+
+import java.io.FileInputStream;
+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.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.excel.event.AnalysisEventListener;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import java.util.Date;
+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.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.ctop.service.IBytedanceCustomerDdTbtjDataService;
+import org.jeecg.modules.excelutil.BytedanceCustomTbtjDataExcelListener;
+import org.jeecg.modules.excelutil.ExcelUtils;
+import org.jeecg.modules.excelutil.JhsBakendDataExcelListener;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+import org.jeecg.modules.excelutil.entity.JhsBakendDataEntity;
+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
+ * @date   2021-04-22
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="淘宝特价版客户反馈数据")
+@RestController
+@RequestMapping("/ctop/bytedanceCustomerDdTbtjData")
+public class BytedanceCustomerDdTbtjDataController {
+	@Autowired
+	private IBytedanceCustomerDdTbtjDataService bytedanceCustomerDdTbtjDataService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceCustomerDdTbtjData
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="淘宝特价版客户反馈数据-分页列表查询", notes="淘宝特价版客户反馈数据-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceCustomerDdTbtjData>> queryPageList(BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData,
+																	@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																	@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																	HttpServletRequest req) {
+		Result<IPage<BytedanceCustomerDdTbtjData>> result = new Result<>();
+		QueryWrapper<BytedanceCustomerDdTbtjData> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceCustomerDdTbtjData, req.getParameterMap());
+		Page<BytedanceCustomerDdTbtjData> page = new Page<BytedanceCustomerDdTbtjData>(pageNo, pageSize);
+		IPage<BytedanceCustomerDdTbtjData> pageList = bytedanceCustomerDdTbtjDataService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceCustomerDdTbtjData
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-添加")
+	@ApiOperation(value="淘宝特价版客户反馈数据-添加", notes="淘宝特价版客户反馈数据-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceCustomerDdTbtjData> add(@RequestBody BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<>();
+		try {
+			bytedanceCustomerDdTbtjDataService.save(bytedanceCustomerDdTbtjData);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceCustomerDdTbtjData
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-编辑")
+	@ApiOperation(value="淘宝特价版客户反馈数据-编辑", notes="淘宝特价版客户反馈数据-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceCustomerDdTbtjData> edit(@RequestBody BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<BytedanceCustomerDdTbtjData>();
+		BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjDataEntity = bytedanceCustomerDdTbtjDataService.getById(bytedanceCustomerDdTbtjData.getId());
+		if(bytedanceCustomerDdTbtjDataEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceCustomerDdTbtjDataService.updateById(bytedanceCustomerDdTbtjData);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-通过id删除")
+	@ApiOperation(value="淘宝特价版客户反馈数据-通过id删除", notes="淘宝特价版客户反馈数据-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceCustomerDdTbtjDataService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-批量删除")
+	@ApiOperation(value="淘宝特价版客户反馈数据-批量删除", notes="淘宝特价版客户反馈数据-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceCustomerDdTbtjData> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceCustomerDdTbtjDataService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "淘宝特价版客户反馈数据-通过id查询")
+	@ApiOperation(value="淘宝特价版客户反馈数据-通过id查询", notes="淘宝特价版客户反馈数据-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceCustomerDdTbtjData> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceCustomerDdTbtjData> result = new Result<>();
+		BytedanceCustomerDdTbtjData bytedanceCustomerDdTbtjData = bytedanceCustomerDdTbtjDataService.getById(id);
+		if(bytedanceCustomerDdTbtjData==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceCustomerDdTbtjData);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @PostMapping(value = "/importExcel")
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+	  //1.读Excel
+	  MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+	  Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+	  for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+		  FileInputStream fis = null;
+		  try {
+			  MultipartFile file = entity.getValue();
+			  fis = (FileInputStream) file.getInputStream();
+			  AnalysisEventListener listener = new BytedanceCustomTbtjDataExcelListener();
+			  Boolean flag = ExcelUtils.readExcel(fis, BytedanceCustomTbtjDataEntity.class, listener);
+			  System.out.println("导入是否成功:" + flag);
+		  } catch (Exception e) {
+			  e.printStackTrace();
+		  } finally {
+			  if (fis != null) {
+				  try {
+					  fis.close();
+				  } catch (IOException e) {
+					  e.printStackTrace();
+				  }
+			  }
+		  }
+	  }
+	  return Result.ok("文件导入成功!");
+  }
+
+}

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

@@ -6,7 +6,10 @@ import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.*;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoService;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -61,7 +64,15 @@ public class MaterialInfoController {
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
     @Autowired
-    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
+    private IProjectService projectService;
+    @Autowired
+    private IMessageTemplate messageTemplate;
+    @Autowired
+    private ISysRoleService roleService;
+    @Autowired
+    private ISendMessageService sendMessageService;
+    @Autowired
+    private IBytedanceVideoSlogenInfoService slogenInfoService;
 
 
     @GetMapping("/supplierWatermark")
@@ -104,12 +115,9 @@ public class MaterialInfoController {
         return result;
     }
 
-
     @PostMapping("/correlationUpload")
     public Map<String, Object> insertFile(@RequestBody JSONObject json) {
-        LoginUser user = (LoginUser) SecurityUtils.getSubject()
-                .getPrincipal();
-
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         json.put("userId", user.getId());
         return materialInfoService.correlationUpload(json);
     }
@@ -132,11 +140,9 @@ public class MaterialInfoController {
         return materialInfoService.report(userId);
     }
 
-
     @GetMapping(value = "/getDetail")
     public JSONObject getDetail(String materialId) {
         return materialInfoService.getDetail(materialId);
-
     }
 
     @PostMapping("watermark")
@@ -160,7 +166,6 @@ public class MaterialInfoController {
         return result;
     }
 
-
     @GetMapping("/excellent/list")
     public Result<IPage<MaterialInfo>> excellentList(MaterialInfo materialInfo,
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -189,23 +194,18 @@ public class MaterialInfoController {
         return result;
     }
 
-    @Autowired
-    private ISysRoleService roleService;
-
+    @Deprecated
     @GetMapping(value = "/list")
     public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo,
                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                      HttpServletRequest req) {
-
         Result<IPage<MaterialInfo>> result = new Result<>();
         String materialName = materialInfo.getMaterialName();
         String startDate = materialInfo.getStartDate();
         String endDate = materialInfo.getEndDate();
         materialInfo.setStartDate(null);
         materialInfo.setEndDate(null);
-
-
         materialInfo.setMaterialName(null);
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         materialInfo.setCreateTime(null);
@@ -272,7 +272,6 @@ public class MaterialInfoController {
                     material.setByteDance(JSONObject.parseObject(byteDanceString));
                 }
 
-
                 Project project = projectService.getById(material.getProjectId());
                 if (!Check.isNull(project)) {
                     material.setMediaId(project.getMediaId());
@@ -283,17 +282,9 @@ public class MaterialInfoController {
                 imageInfoQueryWrapper.eq("video_id", material.getCode());
                 imageInfoQueryWrapper.eq("status", 0);
                 List<MaterialImageInfo> imageInfoList = iMaterialImageInfoService.list(imageInfoQueryWrapper);
-                if (Check.isNull(imageInfoList)) {
-                    material.setWhetherUnaudited(false);
-                } else {
-                    material.setWhetherUnaudited(true);
-                }
-
+                material.setWhetherUnaudited(!Check.isNull(imageInfoList));
             }
-
-
         }
-
         result.setSuccess(true);
         result.setResult(pageList);
         return result;
@@ -337,7 +328,6 @@ public class MaterialInfoController {
         }
     }
 
-
     @AutoLog(value = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
     @GetMapping(value = "/supplierList")
@@ -345,8 +335,6 @@ public class MaterialInfoController {
                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                     HttpServletRequest req) {
-
-
         Result<IPage<MaterialInfo>> result = new Result<>();
         String materialName = materialInfo.getMaterialName();
         materialInfo.setMaterialName(null);
@@ -356,7 +344,6 @@ public class MaterialInfoController {
         materialInfo.setEndDate(null);
 
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
-
         if (!Check.isNull(materialInfo.getUserId())) {
             String roleCode = roleService.getRoleCodeByUserId(materialInfo.getUserId());
             if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
@@ -408,7 +395,6 @@ public class MaterialInfoController {
 
             }
 
-
         }
 
         result.setSuccess(true);
@@ -468,22 +454,12 @@ public class MaterialInfoController {
     }
 
     /**
-     * 编辑
-     *
+     * 头条素材信息编辑
      * @param materialInfo
      * @return
      */
-    @Autowired
-    private IProjectService projectService;
-    @Autowired
-    private IMessageTemplate messageTemplate;
-    @Autowired
-    private ISendMessageService sendMessageService;
-
-    @AutoLog(value = "素材信息-编辑")
-    @ApiOperation(value = "素材信息-编辑", notes = "素材信息-编辑")
-    @PutMapping(value = "/edit")
-    public Result<MaterialInfo> edit(@RequestBody MaterialInfo materialInfo) {
+    @PutMapping(value = "/bytedance/edit")
+    public Result<MaterialInfo> bytedanceEdit(@RequestBody MaterialInfo materialInfo) {
         Result<MaterialInfo> result = new Result<>();
         MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
         if (materialInfoEntity == null) {
@@ -517,7 +493,6 @@ public class MaterialInfoController {
             } else {
                 materialInfo.setCoverUrl(cutFrame.getUrl());
             }
-
         }
 
         //  修改素材库 相关联code
@@ -541,29 +516,14 @@ public class MaterialInfoController {
                 materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
             }
         }
-
-        //  审核通过自动同步到到媒体后台
-       /* Long projectId = materialInfoEntity.getProjectId();
-        Project project = projectService.getById(projectId);
-        if (!Check.isNull(projectId)) {
-            if ("2".equals(project.getMediaId())) {
-                if (!Check.isNull(materialInfo.getStatus())) {
-                    Integer status = materialInfo.getStatus();
-                    if (status == 1) {
-                        Thread thread = new Thread() {
-                            @Override
-                            public void run() {
-                                log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
-                                uploadService.upload(materialInfoEntity);
-                            }
-                        };
-                        thread.start();
-                    }
-                }
+        //添加视频文案信息
+        if(!Check.isNull(materialInfo.getSlogans())){
+            JSONArray slogans = materialInfo.getSlogans();
+            if(null!=slogans&&!slogans.isEmpty()){
+                LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+                slogenInfoService.insertSlogans(materialInfoEntity.getCode(),slogans,user.getId());
             }
-
-        }*/
-
+        }
         boolean ok = materialInfoService.updateById(materialInfo);
         if (ok) {
             result.success("修改成功!");
@@ -579,8 +539,6 @@ public class MaterialInfoController {
         return result;
 
     }
-
-
     /**
      * 通过id删除
      *
@@ -640,12 +598,19 @@ public class MaterialInfoController {
     @AutoLog(value = "素材信息-通过id查询")
     @ApiOperation(value = "素材信息-通过id查询", notes = "素材信息-通过id查询")
     @GetMapping(value = "/queryById")
-    public Result<MaterialInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+    public Result<MaterialInfo> queryById(@RequestParam(name = "id") String id) {
         Result<MaterialInfo> result = new Result<>();
         MaterialInfo materialInfo = materialInfoService.getById(id);
         if (materialInfo == null) {
             result.error500("未找到对应实体");
         } else {
+            //查询素材下关联的头条文案信息
+            List<BytedanceVideoSlogenInfo>slogenInfos = slogenInfoService.listByParams(materialInfo.getCode(),1);
+            JSONArray slogenArray = new JSONArray();
+            if(null!=slogenInfos&&!slogenInfos.isEmpty()){
+                slogenArray.addAll(slogenInfos);
+            }
+            materialInfo.setSlogans(slogenArray);
             result.setResult(materialInfo);
             result.setSuccess(true);
         }
@@ -696,6 +661,105 @@ public class MaterialInfoController {
         return result;
     }
 
+    @AutoLog(value = "素材信息-编辑")
+    @ApiOperation(value = "素材信息-编辑", notes = "素材信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<MaterialInfo> edit(@RequestBody MaterialInfo materialInfo) {
+        Result<MaterialInfo> result = new Result<>();
+        MaterialInfo materialInfoEntity = materialInfoService.getById(materialInfo.getId());
+        if (materialInfoEntity == null) {
+            return result.error500("未找到对应实体");
+        }
+        String url = materialInfo.getUrl();
+        if (!Check.isNull(url)) {
+            if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
+            }
+            materialInfo.setUrl(url);
+            materialInfo.setCreateTime(new Date());
+            MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(materialInfo.getCode());
+            if (Check.isNull(cutFrame)) {
+                String videoUrl = URLDecoder.decode(url).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
+                String loadImage = "cutFrame/" + materialInfo.getCode() + "/zero.jpg";
+                String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
+                materialInfo.setCoverUrl(coverUrl);
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        try {
+                            log.info("开始抽帧,code:{}", materialInfo.getCode());
+                            materialCutFrameService.getTencentCutFrame(videoUrl, materialInfo.getCode(), coverUrl);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                };
+                thread.start();
+            } else {
+                materialInfo.setCoverUrl(cutFrame.getUrl());
+            }
+
+        }
+
+        //  修改素材库 相关联code
+        if (!Check.isNull(materialInfo.getCode())) {
+            String code = materialInfoEntity.getCode();
+            if (!Check.isNull(code)) {
+                MaterialTag updateMaterialTag = new MaterialTag();
+                updateMaterialTag.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialTag> tagQueryWrapper = new QueryWrapper<>();
+                tagQueryWrapper.eq("material_id", code);
+                materialTagService.update(updateMaterialTag, tagQueryWrapper);
+                MaterialParameter updateParameter = new MaterialParameter();
+                updateParameter.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
+                parameterQueryWrapper.eq("material_id", code);
+                materialParameterService.update(updateParameter, parameterQueryWrapper);
+                MaterialAscription updateMaterialAscription = new MaterialAscription();
+                updateMaterialAscription.setMaterialId(materialInfo.getCode());
+                QueryWrapper<MaterialAscription> ascriptionQueryWrapper = new QueryWrapper<>();
+                ascriptionQueryWrapper.eq("material_id", code);
+                materialAscriptionService.update(updateMaterialAscription, ascriptionQueryWrapper);
+            }
+        }
+
+        //  审核通过自动同步到到媒体后台
+       /* Long projectId = materialInfoEntity.getProjectId();
+        Project project = projectService.getById(projectId);
+        if (!Check.isNull(projectId)) {
+            if ("2".equals(project.getMediaId())) {
+                if (!Check.isNull(materialInfo.getStatus())) {
+                    Integer status = materialInfo.getStatus();
+                    if (status == 1) {
+                        Thread thread = new Thread() {
+                            @Override
+                            public void run() {
+                                log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
+                                uploadService.upload(materialInfoEntity);
+                            }
+                        };
+                        thread.start();
+                    }
+                }
+            }
+
+        }*/
+
+        boolean ok = materialInfoService.updateById(materialInfo);
+        if (ok) {
+            result.success("修改成功!");
+        }
+
+        Integer status = materialInfo.getStatus();
+        // 如果状态为2 审核拒绝 给上传人发送消息
+        if (status == 2) {
+            Project project = projectService.getById(materialInfoEntity.getProjectId());
+            String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
+            sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
+        }
+        return result;
+    }
+
     /**
      * adlab 新加查询素材库接口
      */

+ 37 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/BytedanceCustomerDdTbtjData.java

@@ -0,0 +1,37 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author jeecg-boot
+ * @date   2021-04-22
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_bytedance_customer_ad_tbtj_data")
+public class BytedanceCustomerDdTbtjData {
+    
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**adId*/
+	private Long adId;
+	/**stateDate*/
+	private String stateDate;
+	/**loginCnt*/
+	private Integer loginCnt;
+	/**bugerCnt*/
+	private Integer buyerCnt;
+	/**nextDayStay*/
+	private Integer nextDayStay;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+}

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/BytedanceCustomerDdTbtjDataMapper.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.ctop.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author: jeecg-boot
+ * @date:   2021-04-22
+ * @cersion: V1.0
+ */
+public interface BytedanceCustomerDdTbtjDataMapper extends BaseMapper<BytedanceCustomerDdTbtjData> {
+
+    void replaceDatas(@Param(value = "datas") List<BytedanceCustomTbtjDataEntity> datas);
+}

+ 24 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/BytedanceCustomerDdTbtjDataMapper.xml

@@ -0,0 +1,24 @@
+<?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="org.jeecg.modules.ctop.mapper.BytedanceCustomerDdTbtjDataMapper">
+
+    <insert id="replaceDatas">
+        REPLACE INTO
+        ctop_bytedance_customer_ad_tbtj_data
+        (ad_id,
+        state_date,
+        login_cnt,
+        buyer_cnt,
+        next_day_stay)
+        values
+        <foreach collection="datas" item="data" separator=",">
+            (
+            #{data.adId},
+            #{data.dateString},
+            #{data.loginCnt},
+            #{data.buyerCnt},
+            #{data.nextDayStay}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IBytedanceCustomerDdTbtjDataService.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+
+import java.util.List;
+
+/**
+ * @Description: 淘宝特价版客户反馈数据
+ * @Author: jeecg-boot
+ * @Date:   2021-04-22
+ * @Version: V1.0
+ */
+public interface IBytedanceCustomerDdTbtjDataService extends IService<BytedanceCustomerDdTbtjData> {
+
+    void replaceEntityList(List<BytedanceCustomTbtjDataEntity> datas);
+}

+ 28 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceCustomerDdTbtjDataServiceImpl.java

@@ -0,0 +1,28 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import org.jeecg.modules.ctop.entity.BytedanceCustomerDdTbtjData;
+import org.jeecg.modules.ctop.mapper.BytedanceCustomerDdTbtjDataMapper;
+import org.jeecg.modules.ctop.service.IBytedanceCustomerDdTbtjDataService;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 淘宝特价版客户反馈数据
+ * @author jeecg-boot
+ * @date   2021-04-22
+ * @version V1.0
+ */
+@Service
+public class BytedanceCustomerDdTbtjDataServiceImpl extends ServiceImpl<BytedanceCustomerDdTbtjDataMapper, BytedanceCustomerDdTbtjData> implements IBytedanceCustomerDdTbtjDataService {
+    @Resource
+    private BytedanceCustomerDdTbtjDataMapper tbtjDataMapper;
+    @Override
+    public void replaceEntityList(List<BytedanceCustomTbtjDataEntity> datas) {
+        tbtjDataMapper.replaceDatas(datas);
+    }
+}

+ 50 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/BytedanceCustomTbtjDataExcelListener.java

@@ -0,0 +1,50 @@
+package org.jeecg.modules.excelutil;
+
+import cn.com.ctop.common.module.utils.SpringUtils;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.ctop.service.impl.BytedanceCustomerDdTbtjDataServiceImpl;
+import org.jeecg.modules.excelutil.entity.BytedanceCustomTbtjDataEntity;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class BytedanceCustomTbtjDataExcelListener extends AnalysisEventListener<BytedanceCustomTbtjDataEntity> {
+    //自定义用于暂时存储data。
+    //可以通过实例获取该值
+    private List<BytedanceCustomTbtjDataEntity> datas = new ArrayList<>();
+    private static final int BATCH_COUNT = 200;
+
+    @Override
+    public void invoke(BytedanceCustomTbtjDataEntity object, AnalysisContext context) {
+        //数据存储到list,供批量处理,或后续自己业务逻辑处理。
+        Date date = object.getStateDate();
+        object.setDateString(DateUtils.formatDate(date,"yyyy-MM-dd HH:mm:ss"));
+        datas.add(object);
+        if(null!=datas&&datas.size()>=BATCH_COUNT){
+            saveDate();
+            datas.clear();
+        }
+    }
+
+    private void saveDate() {
+        BytedanceCustomerDdTbtjDataServiceImpl dataService = SpringUtils.getApplicationContext().getBean(BytedanceCustomerDdTbtjDataServiceImpl.class);
+        dataService.replaceEntityList(datas);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+        // 解析结束销毁不用的资源
+         datas.clear();
+    }
+
+    public List<BytedanceCustomTbtjDataEntity> getDatas() {
+        return datas;
+    }
+
+    public void setDatas(List<BytedanceCustomTbtjDataEntity> datas) {
+        this.datas = datas;
+    }
+}

+ 0 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/JhsBakendDataExcelListener.java

@@ -38,23 +38,6 @@ public class JhsBakendDataExcelListener extends AnalysisEventListener<JhsBakendD
         dataService.replaceEntityList(datas);
     }
 
-    private void doSomething(Object object) {
-        //入库调用接口
-        JhsBakendDataEntity dataEntity = (JhsBakendDataEntity) object;
-        dataEntity.setCreateTime(new Date());
-        dataEntity.setUpdateTime(new Date());
-        String date = dataEntity.getStateDate();
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
-        try {
-            date = DateUtils.formatDate(dateFormat.parse(date));
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-        dataEntity.setStateDate(date);
-        JhsBakendDataServiceImpl dataService = SpringUtils.getApplicationContext().getBean(JhsBakendDataServiceImpl.class);
-        dataService.replaceEntity(dataEntity);
-    }
-
     @Override
     public void doAfterAllAnalysed(AnalysisContext context) {
         // datas.clear();//解析结束销毁不用的资源

+ 73 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/excelutil/entity/BytedanceCustomTbtjDataEntity.java

@@ -0,0 +1,73 @@
+package org.jeecg.modules.excelutil.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.util.Date;
+
+public class BytedanceCustomTbtjDataEntity extends BaseRowModel {
+    /**日期*/
+    @ExcelProperty(value = "日期", index = 0)
+    private Date stateDate;
+    /**计划id*/
+    @ExcelProperty(value = "计划id", index = 1)
+    private Long adId;
+    @ExcelProperty(value = "登录人数", index = 2)
+    private Integer loginCnt;
+    /**bugerCnt*/
+    @ExcelProperty(value = "首购人数", index = 3)
+    private Integer buyerCnt;
+    /**nextDayStay*/
+    @ExcelProperty(value = "次留数", index = 4)
+    private Integer nextDayStay;
+    
+    private String dateString;
+
+    public Date getStateDate() {
+        return stateDate;
+    }
+
+    public void setStateDate(Date stateDate) {
+        this.stateDate = stateDate;
+    }
+
+    public Long getAdId() {
+        return adId;
+    }
+
+    public void setAdId(Long adId) {
+        this.adId = adId;
+    }
+
+    public Integer getLoginCnt() {
+        return loginCnt;
+    }
+
+    public void setLoginCnt(Integer loginCnt) {
+        this.loginCnt = loginCnt;
+    }
+
+    public Integer getBuyerCnt() {
+        return buyerCnt;
+    }
+
+    public void setBuyerCnt(Integer buyerCnt) {
+        this.buyerCnt = buyerCnt;
+    }
+
+    public Integer getNextDayStay() {
+        return nextDayStay;
+    }
+
+    public void setNextDayStay(Integer nextDayStay) {
+        this.nextDayStay = nextDayStay;
+    }
+
+    public String getDateString() {
+        return dateString;
+    }
+
+    public void setDateString(String dateString) {
+        this.dateString = dateString;
+    }
+}

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

@@ -100,16 +100,16 @@ spring:
 #          username: data
 #          password: hcst@2021
 #          driver-class-name: com.mysql.jdbc.Driver
-#        master:
-#          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
-#          username: hcst
-#          password: hcst@2020
-#          driver-class-name: com.mysql.jdbc.Driver
         master:
-          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: data
-          password: hcst@2021
+          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+          username: hcst
+          password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver
+#        master:
+#          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+#          username: data
+#          password: hcst@2021
+#          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0

+ 4 - 11
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai

@@ -9,8 +9,7 @@ import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import ${bussiPackage}.${entityPackage}.entity.${entityName};
 import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
@@ -57,7 +56,6 @@ public class ${entityName}Controller {
 	 * @param req
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
 	@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
 	@GetMapping(value = "/list")
 	public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
@@ -78,7 +76,6 @@ public class ${entityName}Controller {
 	 * @param ${entityName?uncap_first}
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-添加")
 	@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
 	@PostMapping(value = "/add")
 	public Result<${entityName}> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
@@ -98,7 +95,6 @@ public class ${entityName}Controller {
 	 * @param ${entityName?uncap_first}
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-编辑")
 	@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
 	@PutMapping(value = "/edit")
 	public Result<${entityName}> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
@@ -121,10 +117,9 @@ public class ${entityName}Controller {
 	 * @param id
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
 	@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
 	@DeleteMapping(value = "/delete")
-	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+	public Result<?> delete(@RequestParam(name="id") String id) {
 		try {
 			${entityName?uncap_first}Service.removeById(id);
 		} catch (Exception e) {
@@ -135,14 +130,13 @@ public class ${entityName}Controller {
 	}
 
 	/**
-	  *  批量删除
+	 *  批量删除
 	 * @param ids
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
 	@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
-	public Result<${entityName}> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+	public Result<${entityName}> deleteBatch(@RequestParam(name="ids") String ids) {
 		Result<${entityName}> result = new Result<>();
 		if(ids==null || "".equals(ids.trim())) {
 			result.error500("参数不识别!");
@@ -158,7 +152,6 @@ public class ${entityName}Controller {
 	 * @param id
 	 * @return
 	 */
-	@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
 	@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
 	@GetMapping(value = "/queryById")
 	public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {

+ 3 - 3
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai

@@ -8,9 +8,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * ${tableVo.ftlDescription}
- * @author: jeecg-boot
- * @date:   ${.now?string["yyyy-MM-dd"]}
- * @cersion: V1.0
+ * @author jeecg-boot
+ * ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
  */
 public interface ${entityName}Mapper extends BaseMapper<${entityName}> {
 

+ 4 - 4
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai

@@ -4,10 +4,10 @@ import ${bussiPackage}.${entityPackage}.entity.${entityName};
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
- * @Description: ${tableVo.ftlDescription}
- * @Author: jeecg-boot
- * @Date:   ${.now?string["yyyy-MM-dd"]}
- * @Version: V1.0
+ * ${tableVo.ftlDescription}
+ * @author jeecg-boot
+ * ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
  */
 public interface I${entityName}Service extends IService<${entityName}> {
 

+ 1 - 1
jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai

@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 /**
  * ${tableVo.ftlDescription}
  * @author jeecg-boot
- * @date   ${.now?string["yyyy-MM-dd"]}
+ * ${.now?string["yyyy-MM-dd"]}
  * @version V1.0
  */
 @Service

+ 1 - 18
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -7,21 +7,4 @@ url=jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicod
 username=data
 password=hcst@2021
 database_name=jeecg-boot
-#oracle
-#diver_name=oracle.jdbc.driver.OracleDriver
-#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
-#username=scott
-#password=tiger
-#database_name=ORCL
-#postgre
-#diver_name=org.postgresql.Driver
-#url=jdbc:postgresql://localhost:5432/jeecg
-#username=postgres
-#password=postgres
-#database_name=jeecg
-#SQLServer2005\u4ee5\u4e0a
-#diver_name=org.hibernate.dialect.SQLServerDialect
-#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=jeecg
-#username=sa
-#password=SA
-#database_name=jeecg
+

+ 11 - 403
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -17,6 +17,7 @@ import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatUserListService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 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.entity.BytedanceAccountReportTaskRecord;
 import cn.com.ctop.toutiao.modules.report.service.*;
 import lombok.extern.slf4j.Slf4j;
@@ -46,112 +47,11 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 @Slf4j
 public class SampleTest {
     @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-    @Autowired
-    private IReportService reportService;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired
-    private IKuaiShouVideoGetService videoGetService;
-    @Autowired
-    private IKuaishouVideoRelateCreativesService kuaishouVideoRelateCreativesService;
-    @Autowired
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
-    /*   @Autowired
-       private IByteDanceAdvertiserDataService advertiserDataService;
-
-   */
-    @Autowired
-    private IKuaishouReportDailyGroupService reportDailyGroupService;
-    @Autowired
-    private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
-    @Autowired
-    private IKuaiShouGroupService kuaiShouGroupService;
-    @Autowired
-    private IKuaishouReportHourlyGroupService groupService;
-    @Autowired
-    private IKuaiShouReportDailyMaterialService reportDailyMaterialService;
-    @Autowired
-    private IKuaiShouActionBarTextService actionBarTextService;
-
-    @Test
-    public void loadBytedanceCreativeData() throws ParseException {
-
-        actionBarTextService.getActionBarText();
-
-        // groupService.getAdvertiserGroupReportHourly(9677284L, "b88c5f0d80c518fc80174a4dabbcd180", "2021-04-19", "2021-04-19");
-    //    reportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(9677284L, "b88c5f0d80c518fc80174a4dabbcd180", "2021-04-19", "2021-04-19", "DAILY", 1);
-
-     /*   Date getDate = DateUtils.addDay(new Date(), -1);
-        Date getDate2 = DateUtils.addDay(new Date(), -2);
-
-        CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9901975L);
-        token.setAccessToken("1c7cebebc3174c39fe941d136df65b1d");
-
-        kuaiShouGroupService.getGroupListByPage("90f31a01c2137aa11c8686e86064b630",9845316L,null,1);*/
-
-//        kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
-
-     /*   JSONObject materialOverview = kuaiShouAccountMaterialOverviewService.getMaterialOverview(5473041L, "2021-03-09");
-        System.err.println(materialOverview);*/
-
-      /*  CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9901975L);
-        token.setAccessToken("e609f9d3f56f3d6b4653f32c98a6d119");
-        kuaiShouAccountMaterialOverviewService.cleanAccountMaterialOverview(9901975L, "2021-03-09");
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse("2021-03-09");
-        reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse);*/
-
-        //    1662234704806924
-       /* CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9549277L);
-        token.setAccessToken("bc5327c8f2bd8a67513e51148c9206c8");
-
-
-
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse("2021-02-02");
-        kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
-
-     /*   CtopOauthToken token = new CtopOauthToken();
-        token.setAccountId(9767055L);
-        token.setAccessToken("28e4e6b124e1443d6971ba4c699de6c9");
-
-        kuaishouInterfaceService.getVideoList(token, null, null);
-        kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9", 9767055L, "5208131540349742192");*/
-
-     /*   CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1662234704806924L);
-        advertiserDataService.getMaterialList(tokenByAccountId);*/
-       /* getVideoByPage(token, "", 1);
-        List<KuaiShouVideoGet> KuaiShouVideoGets = videoGetService.selectPhotoIdsByAccountId(9743746L);
-        if (!Check.isNull(KuaiShouVideoGets)) {
-            JSONArray dateList = new JSONArray();
-            JSONArray photoIds = new JSONArray();
-            Map<String, Object> statdateMap = new HashMap<>();
-            int count = 0;
-            for (KuaiShouVideoGet video : KuaiShouVideoGets) {
-                count++;
-                if (count < 10) {
-                    photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
-                } else {
-                    photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
-                    dateList.add(photoIds);
-                    photoIds = new JSONArray();
-                    count = 0;
-                }
-            }
-            dateList.add(photoIds);
-            kuaishouVideoRelateCreativesService.videoRelateCreatives(9743746L, dateList, statdateMap);
-        }*/
-    }
 
     @Test
     public void loadKuaishouCookie() {
@@ -167,15 +67,6 @@ public class SampleTest {
         }
     }
 
-    @Test
-    public void loadKuaishouCamgaignData() {
-        Date getDate = DateUtils.parseDate("2021-03-24", "yyyy-MM-dd");
-        List<UserAllocation> list = allocationService.getByParams(50L, null, 0);
-        list.forEach(userAllocation -> {
-            CtopOauthToken token = tokenService.getOauthTokenByAccountId(userAllocation.getAccountId().toString());
-            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
-        });
-    }
 
     static ExecutorService executorService = null;
     static CountDownLatch countDownLatch = null;
@@ -205,150 +96,6 @@ public class SampleTest {
             log.info("快手删评论所用时长:{}毫秒", end - start);
         }
     }
-
-    @Autowired
-    private IUserAllocationService allocationService;
-
-    @Test
-    public void testLoadBytedanceData() {
-        List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
-        if (null != allocations && !allocations.isEmpty()) {
-            for (UserAllocation allocation : allocations) {
-                CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
-                String startDate = "2020-11-10";
-                String endDate = "2020-11-10";
-                reportService.getAdvertiserReport(token, DateUtils.parseDate(startDate, "yyyy-MM-dd"), DateUtils.parseDate(endDate, "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-            }
-        }
-        System.out.println("任务结束");
-    }
-
-    @Test
-    public void loadKuaishouPlanData() {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate));
-    }
-
-    @Autowired
-    private IBytedanceFundDailyService bytedanceFundDailyService;
-
-    @Test
-    public void loadFoudData() {
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        for (CtopOauthToken token : tokens) {
-            System.out.println(token.getAccountId() + "############################");
-            for (int i = 20; i < 130; i++) {
-                Date date = DateUtils.addDay(new Date(), -i);
-                bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(date), DateUtils.formatDate(date), 1);
-                System.out.println(i + "############################");
-            }
-        }
-    }
-
-    @Autowired
-    private IKuaiShouHistoryReportTaskService reportTaskService;
-
-    /**
-     * 测试获取快手图片消耗数据任务
-     */
-    @Test
-    public void loadKuaishouImageTask() {
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for (int i = 1; i < 130; i++) {
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            String getDateStr = DateUtils.formatDate(getDate);
-            tokens.forEach(token -> reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY));
-        }
-    }
-
-    @Autowired
-    private IKuaiShouDailyReportTaskService dailyReportTaskService;
-
-    /**
-     * 测试获取快手图片消耗数据入库
-     */
-    @Test
-    public void loadKuaishouImageTaskFile() {
-        String nowDate = DateUtils.getDate("yyyy-MM-dd");
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for (int i = 1; i < 15; i++) {
-            String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -i);
-            tokens.forEach(token -> dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate));
-        }
-        //  查询快手token
-    }
-
-    @Test
-    public void testLoadBytedanceImageData() {
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        countDownLatch = new CountDownLatch(tokens.size());
-        executorService = Executors.newFixedThreadPool(8);
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                advertiserDataService.getMaterialList(token);
-            } catch (Exception e) {
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        System.out.println("素材数据获取完成");
-
-    }
-
-    @Autowired
-    private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
-
-    @Test
-    public void testData() {
-        Date date = new Date();
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        executorService = Executors.newFixedThreadPool(10);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                reportService.getAdvertiserPlanRuleData(token, date, date, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-            } catch (Exception e) {
-
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void loadKuaishouAgentData() {
-        kuaishouReportDailyAgentService.loginAgent();
-        try {
-            for (int i = 1; i < 30; i++) {
-                kuaishouReportDailyAgentService.getAccount(i);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void loadKuaishouData() {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        for (CtopOauthToken token : tokens) {
-            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
-        }
-    }
-
     @Autowired
     private IBytedanceReportService bytedanceReportService;
 
@@ -362,50 +109,6 @@ public class SampleTest {
         }
     }
 
-    @Test
-    public void loadKuaishouHourlyReportData() {
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        if ("00".equals(hour)) {
-            getDate = DateUtils.addDay(getDate, -1);
-        }
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        Date finalGetDate = getDate;
-        tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate));
-    }
-
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    @Test
-    public void loadKuaishouGroupData() throws ParseException {
-        Date endDate = new Date();
-        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
-        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-        Date startDate = sim.parse(anotherDay);
-        CtopOauthToken token = tokenService.getTokenByAccountId(7087890L);
-        kuaishouInterfaceService.getGroupList(token, startDate, endDate);
-    }
-
-
-    @Test
-    public void loadAccountData() {
-//        List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
-//        for (UserAllocation allocation:allocations) {
-        CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
-        for (int i = 92; i < 100; i++) {
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        }
-//        }
-    }
-
-    @Autowired
-    private IWechatCheckinDataService wechatCheckinDataService;
-    @Autowired
-    private IWechatUserListService wechatUserInfoService;
     @Autowired
     private IWechatNoListService wechatNoListService;
 
@@ -423,20 +126,12 @@ public class SampleTest {
         wechatNoListService.getNoDateByNo("2021-03-01 00:00:00", "2021-03-31 23:59:59", "1");
     }
 
-    @Autowired
-    private IKuaiShouCommentService kuaiShouCommentService;
-
-    @Test
-    public void kuaishouDeleteComment() {
-        kuaiShouCommentService.shieldComment(8018853L);
-    }
 
     @Autowired
     private IByteDanceVideoReportDailyService videoReportDailyService;
 
     @Test
-    synchronized public void formatVideoReportData() {
-
+    public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
             Date getDate = DateUtils.addDay(new Date(), -i);
             String date = DateUtils.formatDate(getDate);
@@ -454,25 +149,6 @@ public class SampleTest {
     IKuaishouReportDailyImageService kuaishouReportDailyImageService;
     @Autowired
     IRuleByteDanceAccountService ruleByteDanceAccountService;
-    @Autowired
-    private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
-    @Autowired
-    private IBytedanceAccountReportTaskRecordService reportTaskRecordService;
-
-
-    @Test
-    public void execute() {
-        List<UserAllocation> allocations = allocationService.listByMediaId("3", 0);
-        for (UserAllocation allocation : allocations) {
-            BytedanceAccountReportTaskRecord reportTaskRecord1 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-10-01", "2020-10-31");
-            reportTaskRecordService.save(reportTaskRecord1);
-            BytedanceAccountReportTaskRecord reportTaskRecord2 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-11-01", "2020-11-30");
-            reportTaskRecordService.save(reportTaskRecord2);
-            BytedanceAccountReportTaskRecord reportTaskRecord3 = new BytedanceAccountReportTaskRecord(allocation.getAccountId(), "2020-12-01", "2020-12-31");
-            reportTaskRecordService.save(reportTaskRecord3);
-        }
-    }
-
     @Test
     public void loadBDAccoutData() {
         Date startDate = DateUtils.addDay(new Date(), -2000);
@@ -481,82 +157,6 @@ public class SampleTest {
             bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
         }
     }
-
-
-    @Test
-    public void etlKuaishouData() {
-        String dateString = "2021-01-05";
-        Date startDate = DateUtils.parseDate(dateString, "yyyy-MM-dd");
-        for (int i = 0; i <= 10; i++) {
-            Date getDate = DateUtils.addDay(startDate, i);
-            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
-            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
-        }
-    }
-
-    @Test
-    public void loadBytedanceVideo() {
-        CtopOauthToken token = tokenService.getTokenByAccountId(1673731601820686L);
-        for (int i = 15; i < 60; i++) {
-            reportService.getAdvertiserReport(token, DateUtils.addDay(new Date(), -i), DateUtils.addDay(new Date(), -i), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        }
-    }
-
-    @Test
-    public void loadKuaishouVideo() {
-        Date date = new Date();
-        CtopOauthToken token = tokenService.getTokenByAccountId(9556344L);
-//        kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, new Date(), new Date(), null, null);
-        kuaishouInterfaceService.getVideoList(token, DateUtils.formatDate(DateUtils.addDay(date, -5)), DateUtils.formatDate(date));
-        // 获取图片信息数据
-//        kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
-    }
-
-
-    @Test
-    public void testLoadBytedanceDataV2() {
-        String accountIds = "1675440464386062";
-        String[] accountArray = accountIds.split(",");
-        for (int i = 0; i < accountArray.length; i++) {
-            CtopOauthToken token = tokenService.getTokenByAccountId(Long.parseLong(accountArray[i]));
-            reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        }
-    }
-
-    @Test
-    public void loadKuaiShouImage() {
-        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
-        executorService = Executors.newFixedThreadPool(22);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                kuaishouReportDailyImageService.getMaterialImageReport(token.getAccountId(), token.getAccessToken(), "2021-01-17", "2021-01-31", 1);
-            } catch (Exception e) {
-
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Autowired
-    private IEtlKuaishouAccountMaterialReportDailyService dailyService;
-
-    @Test
-    public void etlKuaishouInfo() {
-        Date startDate = DateUtils.parseDate("2020-05-03", "yyyy-MM-dd");
-        for (int i = 0; i < 365; i++) {
-            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
-        }
-    }
-
-    @Autowired
-    private IEtlKuaishouVideoInfoService videoEtlInfoService;
     @Resource
     private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
 
@@ -564,6 +164,14 @@ public class SampleTest {
     public void etlKuaishouVideoInfo() {
         etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
     }
-
+    @Autowired
+    private IByteDanceCampaignService campaignService;
+    @Test
+    public void testLoadBytedanceCampaign(){
+        List<CtopOauthToken>tokens = tokenService.selectToutiaoToken();
+        for(CtopOauthToken token :tokens){
+            campaignService.getAdvertiserCampaign(token, null, null);
+        }
+    }
 
 }

+ 20 - 13
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -126,15 +127,21 @@ public class MaterialInfo {
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     private Date updateTime;
 
-    private Integer toutiaoEffiType; //判断是否为头条有效素材0否_1是
+    //判断是否为头条有效素材0否_1是
+    private Integer toutiaoEffiType;
+    // 素造供应商
+    private String supplierCode;
 
-    private Integer kuaishouEffiType; //判断是否为快手有效素材0否_1是
+    //判断是否为快手有效素材0否_1是
+    private Integer kuaishouEffiType;
 
+    //判断是否已经同步到快手平台0否_1是
     @TableField(exist = false)
-    private Integer kuaishouVideoIsUp;  //判断是否已经同步到快手平台0否_1是
+    private Integer kuaishouVideoIsUp;
 
+    //判断是否已经同步到头条平台0否_1是
     @TableField(exist = false)
-    private Integer toutiaoVideoIsUp;  //判断是否已经同步到头条平台0否_1是
+    private Integer toutiaoVideoIsUp;
 
     @TableField(exist = false)
     private JSONObject byteDance;
@@ -142,11 +149,13 @@ public class MaterialInfo {
     @TableField(exist = false)
     private JSONObject kuaiShou;
 
+    //拍摄时候担任的角色
     @TableField(exist = false)
-    private String videoRoleCode;  //拍摄时候担任的角色
+    private String videoRoleCode;
 
+    //原本的角色
     @TableField(exist = false)
-    private String originRoleName;  //原本的角色
+    private String originRoleName;
 
     @TableField(exist = false)
     private BigDecimal cost;
@@ -157,9 +166,9 @@ public class MaterialInfo {
     @TableField(exist = false)
     private String realname;
 
+    // 是否有未审核封面
     @TableField(exist = false)
-    private Boolean whetherUnaudited;  // 是否有未审核封面
-
+    private Boolean whetherUnaudited;
 
     @TableField(exist = false)
     private String mediaId;  // 是否有未审核封面
@@ -167,15 +176,13 @@ public class MaterialInfo {
     @TableField(exist = false)
     private String projectName;  // 是否有未审核封面
 
-
-    private String supplierCode; // 素造供应商
-
-
     @TableField(exist = false)
     private String startDate;  // 是否有未审核封面
 
     @TableField(exist = false)
     private String endDate;  // 是否有未审核封面
 
-
+    //视频关联广告语信息--头条
+    @TableField(exist = false)
+    private JSONArray slogans;
 }

+ 0 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -309,7 +309,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     @Override
     public JSONObject getDetail(String materialId) {
         JSONObject json = new JSONObject();
-
         MaterialInfo materialInfo = this.getById(materialId);
         if (!Check.isNull(materialInfo.getAuditorId())) {
             String auditorName = materialInfoMapper.selectUserNameById(materialInfo.getAuditorId());
@@ -336,7 +335,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         if (!Check.isNull(ascriptionJson)) {
             json.put("ascription", ascriptionJson);
         }
-
         return json;
     }
 

+ 3 - 0
module-job-kuaishou/src/main/resources/application-jiaoyang.yml

@@ -232,3 +232,6 @@ ai:
   callback:
     callback-unit-url: http://192.168.1.193:31012/ai_callback_add_group
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
+zip:
+  local:
+    download-path: /data/unzip/

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

@@ -4,74 +4,76 @@
 
     <insert id="etlKuaishouAccountMaterialReportDailyData">
         replace into ctop_etl_kuaishou_account_material_report_daily (
-            company_id ,
-            company_name ,
-            project_id ,
+            company_id,
+            company_name,
+            project_id,
             project_name,
             account_id,
             signature,
-            charge ,
-            photo_show ,
-            aclick ,
-            bclick ,
-            download_started ,
-            download_completed ,
-            activation ,
-           submit ,
-           stat_date ,
-           photo_click ,
-           event_pay_first_day ,
-           event_pay_purchase_amount_first_day ,
-           event_pay ,
-           event_pay_purchase_amount ,
-           event_register ,
-           event_jin_jian_app ,
-           event_credit_grant_app ,
-           event_order_paid ,
-           event_order_paid_purchase_amount ,
-           event_jin_jian_landing_page ,
-           event_credit_grant_landing_page ,
-           event_next_day_stay ,
-           form_count,
-           play_3s_count)
-   select
-    c.company_id ,
-    c.company_name ,
-    u.project_id ,
-    p.project_name,
-    m.account_id,
-    m.signature,
-    sum(m.charge)as charge ,
-    sum(m.photo_show)as photo_show ,
-    sum(m.aclick)as aclick ,
-    sum(m.bclick)as bclick ,
-    sum(m.download_started)as download_started ,
-    sum(m.download_completed)as download_completed,
-    sum(m.activation)as activation ,
-    sum(m.submit)as submit,
-    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,
-    sum(m.event_pay)as event_pay,
-    sum(m.event_pay_purchase_amount)as event_pay_purchase_amount,
-    sum(m.event_register)as event_register,
-    sum(m.event_jin_jian_app)as event_jin_jian_app,
-    sum(m.event_credit_grant_app)as event_credit_grant_app,
-    sum(m.event_order_paid)as event_order_paid,
-    sum(m.event_order_paid_purchase_amount)as event_order_paid_purchase_amount,
-    sum(m.event_jin_jian_landing_page)as event_jin_jian_landing_page,
-    sum(m.event_credit_grant_landing_page )as event_credit_grant_landing_page,
-    sum(m.event_next_day_stay)as event_next_day_stay,
-    sum(m.form_count)as form_count,
-     round(sum(m.play_3s_ratio*m.photo_show))as play_3s_count
-    from ctop_kuaishou_report_daily_material m left join ctop_user_allocation u on u.account_id = m.account_id
-left join ctop_project p on p.id = u.project_id
-left join user_company c on c.user_id = u.account_id
-where m.signature is not null
-and m.stat_date = #{date}
-group by m.account_id,m.signature
+            charge,
+            photo_show,
+            aclick,
+            bclick,
+            download_started,
+            download_completed,
+            activation,
+            submit,
+            stat_date,
+            photo_click,
+            event_pay_first_day ,
+            event_pay_purchase_amount_first_day,
+            event_pay,
+            event_pay_purchase_amount,
+            event_register,
+            event_jin_jian_app,
+            event_credit_grant_app,
+            event_order_paid,
+            event_order_paid_purchase_amount,
+            event_jin_jian_landing_page,
+            event_credit_grant_landing_page,
+            event_next_day_stay,
+            form_count,
+            play_3s_count)
+     select
+     c.company_id,
+     c.company_name,
+     u.project_id,
+     p.project_name,
+     m.account_id,
+     m.signature,
+     sum(m.charge) as charge,
+     sum(m.photo_show) as photo_show,
+     sum(m.aclick) as aclick,
+     sum(m.bclick) as bclick,
+     sum(m.download_started) as download_started ,
+     sum(m.download_completed) as download_completed,
+     sum(m.activation) as activation,
+     sum(m.submit) as submit,
+     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,
+     sum(m.event_pay) as event_pay,
+     sum(m.event_pay_purchase_amount) as event_pay_purchase_amount,
+     sum(m.event_register) as event_register,
+     sum(m.event_jin_jian_app) as event_jin_jian_app,
+     sum(m.event_credit_grant_app) as event_credit_grant_app,
+     sum(m.event_order_paid) as event_order_paid,
+     sum(m.event_order_paid_purchase_amount) as event_order_paid_purchase_amount,
+     sum(m.event_jin_jian_landing_page) as event_jin_jian_landing_page,
+     sum(m.event_credit_grant_landing_page) as event_credit_grant_landing_page,
+     sum(m.event_next_day_stay) as event_next_day_stay,
+     sum(m.form_count)as form_count,
+     round(sum(m.play_3s_ratio * m.photo_show),0) as play_3s_count
+     from ctop_kuaishou_report_daily_material m left join ctop_user_allocation u on u.account_id = m.account_id
+     left join ctop_project p on p.id = u.project_id
+     left join user_company c on c.user_id = u.account_id
+     where m.signature is not null
+     and m.stat_date = #{date}
+     group by m.account_id,m.signature
     </insert>
+
+
     <insert id="replaceBatch">
         replace into ctop_etl_kuaishou_account_material_report_daily(
         company_id ,

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/xml/ETLReportBytedanceVideoMapper.xml

@@ -298,7 +298,7 @@
             t2.signature AS md5,
             t2.video_url AS toutiaoUrl
         FROM
-            (SELECT * from base_report_bytedance_video_daily where stat_datetime=#{statDate}) t1
+            (SELECT * from ctop_bytedance_report_material_daily where stat_datetime=#{statDate}) t1
                 LEFT JOIN (select material_id,signature,video_url from ctop_bytedance_video_info where material_id in (SELECT DISTINCT material_id from base_report_bytedance_video_daily where stat_datetime=#{statDate})
             ) t2 ON t1.material_id = t2.material_id
                 LEFT JOIN ctop_material_ascription t3 on t2.signature=t3.material_id

+ 0 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/service/impl/ETLReportBytedanceVideoServiceImpl.java

@@ -5,21 +5,14 @@ import cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo;
 import cn.com.ctop.toutiao.modules.link.mapper.ETLReportBytedanceVideoMapper;
 import cn.com.ctop.toutiao.modules.link.service.IBaseReportBytedanceVideoDailyService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import javax.naming.ldap.HasControls;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 头条视频报表ETL

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

@@ -0,0 +1,144 @@
+package cn.com.ctop.toutiao.modules.material.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoService;
+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.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+
+/**
+ * 头条视频文案信息
+ * @author jeecg-boot
+ * 2021-04-19
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="头条视频文案信息")
+@RestController
+@RequestMapping("/ctop/bytedanceVideoSlogenInfo")
+public class BytedanceVideoSlogenInfoController {
+	@Autowired
+	private IBytedanceVideoSlogenInfoService bytedanceVideoSlogenInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param slogenInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="头条视频文案信息-分页列表查询", notes="头条视频文案信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceVideoSlogenInfo>> queryPageList(BytedanceVideoSlogenInfo slogenInfo,
+																 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																 HttpServletRequest req) {
+		Result<IPage<BytedanceVideoSlogenInfo>> result = new Result<>();
+		slogenInfo.setStatus(1);
+		QueryWrapper<BytedanceVideoSlogenInfo> queryWrapper = QueryGenerator.initQueryWrapper(slogenInfo, req.getParameterMap());
+		Page<BytedanceVideoSlogenInfo> page = new Page<>(pageNo, pageSize);
+		IPage<BytedanceVideoSlogenInfo> pageList = bytedanceVideoSlogenInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param slogenInfo
+	 * @return
+	 */
+	@ApiOperation(value="头条视频文案信息-添加", notes="头条视频文案信息-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceVideoSlogenInfo> add(@RequestBody BytedanceVideoSlogenInfo slogenInfo) {
+		Result<BytedanceVideoSlogenInfo> result = new Result<>();
+		try {
+			bytedanceVideoSlogenInfoService.save(slogenInfo);
+			result.success("添加成功!");
+			return result;
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+			return result;
+		}
+	}
+
+	/**
+	 *  编辑
+	 * @param slogenInfo 文案信息
+	 * @return
+	 */
+	@ApiOperation(value="头条视频文案信息-编辑", notes="头条视频文案信息-编辑")
+	@PostMapping(value = "/edit")
+	public Result<BytedanceVideoSlogenInfo> edit(@RequestBody BytedanceVideoSlogenInfo slogenInfo) {
+		Result<BytedanceVideoSlogenInfo> result = new Result<>();
+		BytedanceVideoSlogenInfo bytedanceVideoSlogenInfoEntity = bytedanceVideoSlogenInfoService.getById(slogenInfo.getId());
+		if(bytedanceVideoSlogenInfoEntity==null) {
+			result.error500("未找到对应实体");
+			return result;
+		}
+		LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		slogenInfo.setUpdateBy(user.getId());
+		slogenInfo.setUpdateTime(new Date());
+		bytedanceVideoSlogenInfoService.updateById(slogenInfo);
+		result.success("修改成功!");
+		return result;
+	}
+
+	/**
+	 *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="头条视频文案信息-通过id删除", notes="头条视频文案信息-通过id删除")
+	@PostMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id") String id) {
+		try {
+			BytedanceVideoSlogenInfo slogenInfo = bytedanceVideoSlogenInfoService.getById(id);
+			if(null == slogenInfo||slogenInfo.getStatus() == 0){
+				return Result.ok("此文案不存在或者已经被删除");
+			}
+			slogenInfo.setStatus(0);
+			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			slogenInfo.setUpdateTime(new Date());
+			slogenInfo.setCreateBy(user.getId());
+			bytedanceVideoSlogenInfoService.updateById(slogenInfo);
+			return Result.ok("删除成功!");
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+	}
+
+	/**
+	 * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="头条视频文案信息-通过id查询", notes="头条视频文案信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceVideoSlogenInfo> queryById(@RequestParam(name="id") String id) {
+		Result<BytedanceVideoSlogenInfo> result = new Result<>();
+		BytedanceVideoSlogenInfo bytedanceVideoSlogenInfo = bytedanceVideoSlogenInfoService.getById(id);
+		if(bytedanceVideoSlogenInfo==null) {
+			result.error500("未找到对应实体");
+			return result;
+		}
+		result.setResult(bytedanceVideoSlogenInfo);
+		result.setSuccess(true);
+		return result;
+	}
+}

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

@@ -0,0 +1,50 @@
+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 lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 头条视频文案信息
+ * @author jeecg-boot
+ * 2021-04-19
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_bytedance_video_slogen_info")
+public class BytedanceVideoSlogenInfo {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**videoCode*/
+	private String videoCode;
+	/**slogan*/
+	private String slogan;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+	/**createBy*/
+	private String createBy;
+	/**updateBy*/
+	private String updateBy;
+	/**status*/
+	private Integer status;
+
+	public BytedanceVideoSlogenInfo(String videoCode, String slogan, String userId) {
+		this.videoCode = videoCode;
+		this.slogan = slogan;
+		this.createBy = userId;
+		this.updateBy = userId;
+		this.createTime = new Date();
+		this.updateTime = new Date();
+		this.status = 1;
+	}
+
+	public BytedanceVideoSlogenInfo() {
+	}
+}

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.material.mapper;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 头条视频文案信息
+ * @author jeecg-boot
+ * 2021-04-19
+ * @version V1.0
+ */
+public interface BytedanceVideoSlogenInfoMapper extends BaseMapper<BytedanceVideoSlogenInfo> {
+
+}

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceVideoSlogenInfoMapper.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.BytedanceVideoSlogenInfoMapper">
+
+</mapper>

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

@@ -0,0 +1,20 @@
+package cn.com.ctop.toutiao.modules.material.service;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceVideoSlogenInfo;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 头条视频文案信息
+ * @author jeecg-boot
+ * 2021-04-19
+ * @version V1.0
+ */
+public interface IBytedanceVideoSlogenInfoService extends IService<BytedanceVideoSlogenInfo> {
+
+    void insertSlogans(String videoCode, JSONArray slogans, String userId);
+
+    List<BytedanceVideoSlogenInfo> listByParams(String code, Integer status);
+}

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

@@ -0,0 +1,46 @@
+package cn.com.ctop.toutiao.modules.material.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 头条视频文案信息
+ * @author jeecg-boot
+ * 2021-04-19
+ * @version V1.0
+ */
+@Service
+public class BytedanceVideoSlogenInfoServiceImpl extends ServiceImpl<BytedanceVideoSlogenInfoMapper, BytedanceVideoSlogenInfo> implements IBytedanceVideoSlogenInfoService {
+    @Override
+    public void insertSlogans(String videoCode, JSONArray slogans,String userId){
+        if(null==slogans||slogans.isEmpty()){
+            return;
+        }
+        for(int i=0;i<slogans.size();i++){
+            String slogan = slogans.getString(i);
+            BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,slogan,userId);
+            this.save(slogenInfo);
+        }
+    }
+
+    @Override
+    public List<BytedanceVideoSlogenInfo> listByParams(String code, Integer status) {
+        QueryWrapper<BytedanceVideoSlogenInfo>queryWrapper =new QueryWrapper<>();
+        if(!Check.isNull(code)){
+            queryWrapper.eq("video_code",code);
+        }
+        if(!Check.isNull(status)){
+            queryWrapper.eq("status",status);
+        }
+        queryWrapper.orderByDesc("id");
+        return this.list(queryWrapper);
+    }
+}

+ 0 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceVideoReportService.java

@@ -16,7 +16,4 @@ public interface IBytedanceVideoReportService {
     List<JSONObject> exportExcelReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan);
 
     void pullVideoReport(CtopOauthToken oauthToken,String startDate, String endDate,int page);
-
-    void pullVideoReportByMaterialId(CtopOauthToken oauthToken, String startDate, String endDate,Long[] materialIds, int page);
-
 }

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

@@ -101,61 +101,4 @@ public class BytedanceVideoReportServiceImpl implements IBytedanceVideoReportSer
             pullVideoReport(oauthToken, startDate, endDate, page + 1);
         }
     }
-
-    @Override
-    public void pullVideoReportByMaterialId(CtopOauthToken oauthToken, String startDate, String endDate,Long[] materialIds, int page) {
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", " application/json");
-        headers.put("Access-Token", oauthToken.getAccessToken());
-
-        JSONObject param = new JSONObject();
-        param.put("advertiser_id", oauthToken.getAccountId());
-        param.put("start_date",startDate);
-        param.put("end_date",endDate);
-        JSONObject filtering = new JSONObject();
-        filtering.put("material_id",materialIds);
-        param.put("filtering",filtering);
-        param.put("page_size", 200);
-        param.put("page", page);
-
-        JSONObject resultJson = JSONObject.parseObject(HttpUtils.httpGetRequest("https://ad.oceanengine.com/open_api/2/report/video/get/", headers, param));
-        if (Check.isNull(resultJson)) {
-            log.warn("拉取头条视频报表返回结果为空,advertiserId:{}", oauthToken.getAccountId());
-            return;
-        }
-        if(resultJson.getInteger("code")!=0){
-            log.error("拉取头条视频表异常,advertiserId:{},message:{}", oauthToken.getAccountId(),resultJson.getString("message"));
-            return;
-        }
-        JSONObject data = resultJson.getJSONObject("data");
-        if (null == data || data.size() <= 0) {
-            log.error("拉取头条视频表异常,data is null");
-            return;
-        }
-
-        JSONArray list= data.getJSONArray("list");
-        if(list.isEmpty()){
-            log.warn("拉取头条视频表,数据为空advertiserId:{}", oauthToken.getAccountId());
-            return;
-        }
-        List<BaseReportBytedanceVideoDaily> batch =new ArrayList<>();
-        list.forEach(videoReport->{
-            JSONObject videoReportJSONObject= (JSONObject)videoReport;
-            Long materialId= videoReportJSONObject.getJSONObject("dimensions").getLong("material_id");
-            JSONObject metrics= videoReportJSONObject.getJSONObject("metrics");
-            BaseReportBytedanceVideoDaily temp= JSONObject.toJavaObject(metrics,BaseReportBytedanceVideoDaily.class);
-            temp.setMaterialShow(metrics.getLong("show"));
-            temp.setConvertMaterial(metrics.getLong("convert"));
-            temp.setAccountId(oauthToken.getAccountId());
-            temp.setMaterialId(materialId);
-            temp.setStatDatetime(startDate);
-            batch.add(temp);
-        });
-        baseReportBytedanceVideoDailyService.saveBatch(batch);
-
-        if(resultJson.getJSONObject("data").getJSONObject("page_info").getInteger("total_page")>page){
-            pullVideoReport(oauthToken, startDate, endDate, page + 1);
-        }
-    }
-
 }