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

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

zhaoxian преди 4 години
родител
ревизия
e6176c6a94
променени са 21 файла, в които са добавени 387 реда и са изтрити 221 реда
  1. 149 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAccountSpeedExploreLogController.java
  2. 4 24
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  3. 2 2
      jeecg-boot-module-system/src/main/resources/application-test.yml
  4. 11 6
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  5. 2 6
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  6. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  7. 8 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMaterialsLoadJob.java
  8. 48 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaishouAccountSpeedExploreLog.java
  9. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouAccountSpeedExploreLogMapper.java
  10. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouAccountSpeedExploreLogMapper.xml
  11. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouAccountSpeedExploreLogService.java
  12. 82 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAccountSpeedExploreLogServiceImpl.java
  13. 6 53
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java
  14. 4 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  15. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  16. 4 108
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouGroupExploreController.java
  17. 4 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouGroupExploreService.java
  18. 14 9
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/AccountReportServiceImpl.java
  19. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/ByteDanceVideoInfoMapper.xml
  20. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceImageInfoMapper.xml
  21. 0 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java

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

@@ -0,0 +1,149 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountSpeedExploreLogService;
+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.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.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author jeecg-boot
+ * @date   2021-03-08
+ * @version V1.0
+ */
+@Slf4j
+@RestController
+@RequestMapping("/ctop/kuaishouAccountSpeedExploreLog")
+public class KuaishouAccountSpeedExploreLogController {
+	@Autowired
+	private IKuaishouAccountSpeedExploreLogService kuaishouAccountSpeedExploreLogService;
+
+	/**
+	  * 分页列表查询
+	 * @param kuaishouAccountSpeedExploreLog
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<KuaishouAccountSpeedExploreLog>> queryPageList(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog,
+																	   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																	   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																	   HttpServletRequest req) {
+		Result<IPage<KuaishouAccountSpeedExploreLog>> result = new Result<>();
+		QueryWrapper<KuaishouAccountSpeedExploreLog> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAccountSpeedExploreLog, req.getParameterMap());
+		Page<KuaishouAccountSpeedExploreLog> page = new Page<>(pageNo, pageSize);
+		IPage<KuaishouAccountSpeedExploreLog> pageList = kuaishouAccountSpeedExploreLogService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param kuaishouAccountSpeedExploreLog
+	 * @return
+	 */
+	@PostMapping(value = "/open")
+	public Map<String,Object> add(@RequestBody KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) {
+		Map<String,Object>result = new HashMap<>();
+		try {
+			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			kuaishouAccountSpeedExploreLog.setUserId(user.getId());
+			//1:查询此账户当前是否存在正在加速探索的账户
+			return kuaishouAccountSpeedExploreLogService.openSpeedExplore(kuaishouAccountSpeedExploreLog);
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
+			return result;
+		}
+	}
+
+	/**
+	  *  编辑
+	 * @param kuaishouAccountSpeedExploreLog
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<KuaishouAccountSpeedExploreLog> edit(@RequestBody KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) {
+		Result<KuaishouAccountSpeedExploreLog> result = new Result<>();
+		KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLogEntity = kuaishouAccountSpeedExploreLogService.getById(kuaishouAccountSpeedExploreLog.getId());
+		if(kuaishouAccountSpeedExploreLogEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = kuaishouAccountSpeedExploreLogService.updateById(kuaishouAccountSpeedExploreLog);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			kuaishouAccountSpeedExploreLogService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<KuaishouAccountSpeedExploreLog> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<KuaishouAccountSpeedExploreLog> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.kuaishouAccountSpeedExploreLogService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<KuaishouAccountSpeedExploreLog> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<KuaishouAccountSpeedExploreLog> result = new Result<>();
+		KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog = kuaishouAccountSpeedExploreLogService.getById(id);
+		if(kuaishouAccountSpeedExploreLog==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(kuaishouAccountSpeedExploreLog);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -23,7 +23,6 @@ import cn.com.ctop.toutiao.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -1367,35 +1366,16 @@ public class TestController {
         return result;
     }
 
-    private ExecutorService executor = Executors.newFixedThreadPool(10);
-    private CountDownLatch countDownLatch;
     @Autowired
     IBytedanceVideoReportService bytedanceVideoReportService;
     @Autowired
     IETLReportBytedanceVideoService etlReportBytedanceVideoService;
     @GetMapping("execute")
-    public Map<String,Object> execute(String date) throws Exception {
+    public Map<String,Object> execute(Long accountId) throws Exception {
         Map<String,Object>result = new HashMap<>();
-//        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
-//        countDownLatch = new CountDownLatch(tokens.size());
-//        tokens.forEach(token -> executor.submit(() -> {
-//            try {
-//                bytedanceVideoReportService.pullVideoReport(token,date,date,1);
-//            } catch (Exception e) {
-//                XxlJobHelper.log("头条视频报表基础数据拉取异常:{}",e.getMessage());
-//            } finally {
-//                countDownLatch.countDown();
-//            }
-//        }));
-//        try {
-//            countDownLatch.await();
-//        } catch (InterruptedException e) {
-//            e.printStackTrace();
-//        }
-        Map<String,Object> params = new HashMap<>();
-        params.put("stat_datetime",date);
-        etlReportBytedanceVideoService.removeByMap(params);
-        etlReportBytedanceVideoService.cleanETL(date);
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        kuaishouInterfaceService.getGroupList(token,new Date(),new Date());
+        kuaishouInterfaceService.getAdvertiserGroupReportDaily(token,new Date(),new Date());
         ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
         return result;
     }

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

@@ -1,5 +1,5 @@
 server:
-  port: 8804
+  port: 8806
   servlet:
     context-path: /jeecg-boot
     compression:
@@ -97,7 +97,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.151.174:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+          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

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

@@ -95,16 +95,21 @@ spring:
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
-        master:
-          url: jdbc:mysql://139.186.151.174: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
+#          url: jdbc:mysql://139.186.27.96:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
 #          username: data
 #          password: hcst@2021
 #          driver-class-name: com.mysql.jdbc.Driver
+#        master:
+#          url: jdbc:mysql://139.186.151.174: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

+ 2 - 6
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -583,11 +583,7 @@ public class SampleTest {
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
     @Test
     public void etlKuaishouVideoInfo(){
-        Date startDate = DateUtils.parseDate("2020-09-11","yyyy-MM-dd");
-        for(int i=0;i<365;i++){
-//            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
-            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
-        }
+        CtopOauthToken token = tokenService.getTokenByAccountId(9792538L);
+        kuaishouInterfaceService.getGroupList(token,new Date(),new Date());
     }
-
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -57,6 +57,8 @@ public enum StatusCode {
 
     BYTEDACNE_API_GROUP_CREATE_ERROR("头条API创建广告组异常",-4001,false),
 
+    KUAISHOU_API_ACCOUNT_SPEED_EXPLORING("此账户加速探索尚未完成",-5001,false),
+
     KUAISHOU_CRAWLER_APP_SUCCESS("爬虫运行正常", 0, true),
     KUAISHOU_CRAWLER_APP_TASK_END("爬虫任务运行结束", 1, true),
     KUAISHOU_CRAWLER_APP_JOB_StART("任务开始执行开始", 0, true),

+ 8 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMaterialsLoadJob.java

@@ -3,6 +3,8 @@ package cn.com.ctop.job.bytedance.handler;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +24,10 @@ public class BytedanceMaterialsLoadJob {
     static CountDownLatch countDownLatch = null;
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
+    @Autowired
+    private IByteDanceVideoInfoService videoInfoService;
+    @Autowired
+    private IBytedanceImageInfoService imageInfoService;
 
     @XxlJob("bytedanceMaterialsLoadJob")
     public void execute() throws Exception{
@@ -47,6 +53,8 @@ public class BytedanceMaterialsLoadJob {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
+        videoInfoService.updateMaterialType();
+        imageInfoService.updateType();
         XxlJobHelper.log("物料数据同步完成");
     }
 }

+ 48 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaishouAccountSpeedExploreLog.java

@@ -0,0 +1,48 @@
+package cn.com.ctop.kuaishou.modules.ai.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author jeecg-boot
+ * @date   2021-03-08
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_account_speed_explore_log")
+@EqualsAndHashCode(callSuper = false)
+public class KuaishouAccountSpeedExploreLog {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**accountId*/
+	private Long accountId;
+	/**groupAccount*/
+	private BigDecimal groupAccount;
+	/**groupCount*/
+	private Integer groupCount;
+	private Integer convertType;
+	/**convertCount*/
+	private Integer convertCount;
+	/**userId*/
+	private String userId;
+	/**
+	 * status
+	 * 0:默认
+	 * 1:探索中
+	 * 2:探索完成
+	 * */
+	private Integer status;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouAccountSpeedExploreLogMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author: jeecg-boot
+ * @date:   2021-03-08
+ * @cersion: V1.0
+ */
+public interface KuaishouAccountSpeedExploreLogMapper extends BaseMapper<KuaishouAccountSpeedExploreLog> {
+
+}

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

+ 19 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouAccountSpeedExploreLogService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * @Description: 快手账户加速探索触发记录信息
+ * @Author: jeecg-boot
+ * @Date:   2021-03-08
+ * @Version: V1.0
+ */
+public interface IKuaishouAccountSpeedExploreLogService extends IService<KuaishouAccountSpeedExploreLog> {
+
+    Map<String, Object> openSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog)throws Exception;
+
+    KuaishouAccountSpeedExploreLog getByParams(Long accountId, Integer status);
+}

+ 82 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAccountSpeedExploreLogServiceImpl.java

@@ -0,0 +1,82 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouAccountSpeedExploreLogMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountSpeedExploreLogService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author jeecg-boot
+ * @date   2021-03-08
+ * @version V1.0
+ */
+@Service
+public class KuaishouAccountSpeedExploreLogServiceImpl extends ServiceImpl<KuaishouAccountSpeedExploreLogMapper, KuaishouAccountSpeedExploreLog> implements IKuaishouAccountSpeedExploreLogService {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Override
+    public Map<String, Object> openSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) throws Exception{
+        Map<String,Object> result = new HashMap<>();
+        //查询当前账户是否加速探索中
+        KuaishouAccountSpeedExploreLog getEntity = this.getByParams(kuaishouAccountSpeedExploreLog.getAccountId(),1);
+        if(null!=getEntity){
+            ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_API_ACCOUNT_SPEED_EXPLORING);
+            return result;
+        }
+        //创建加速探索记录
+        kuaishouAccountSpeedExploreLog.setStatus(1);
+        this.save(kuaishouAccountSpeedExploreLog);
+        //触发加速探索任务
+        this.startSpeedExplore(kuaishouAccountSpeedExploreLog);
+        return result;
+    }
+
+    private void startSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) throws Exception{
+        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(kuaishouAccountSpeedExploreLog.getAccountId());
+        //1: 拉取账户下所有的广告组信息
+        kuaishouInterfaceService.getGroupList(token, startDate, endDate);
+        //2: 查询处于学习期的广告组数据
+        kuaishouInterfaceService.getAdvertiserGroupReportDaily(token,startDate,endDate);
+        //3:根据转化目标查询相应的符合条件的广告组数据
+        //优化目标 2 行为数 180 激活数 53 表单数 190 付费 191 首日ROI
+        Integer convertType = kuaishouAccountSpeedExploreLog.getConvertType();
+
+
+
+    }
+
+    @Override
+    public KuaishouAccountSpeedExploreLog getByParams(Long accountId, Integer status) {
+        QueryWrapper<KuaishouAccountSpeedExploreLog> queryWrapper = new QueryWrapper<>();
+        if(null!=accountId&&accountId!=0){
+            queryWrapper.eq("account_id",accountId);
+        }
+        if(null!=status){
+            queryWrapper.eq("status",accountId);
+        }
+        queryWrapper.orderByDesc("id");
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 6 - 53
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java

@@ -3,14 +3,10 @@ package cn.com.ctop.kuaishou.modules.batch.entity;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
 
@@ -31,19 +27,14 @@ public class KuaiShouGroup {
      * id
      */
     @TableId
-    @ApiModelProperty(value = "id")
     private String id;
     /**
      * 账户ID
      */
-    @Excel(name = "账户ID", width = 15)
-    @ApiModelProperty(value = "账户ID")
     private Long accountId;
     /**
      * 广告活动ID
      */
-    @Excel(name = "广告活动ID", width = 15)
-    @ApiModelProperty(value = "广告活动ID")
     private Long campaignId;
 
     @TableField(exist = false)
@@ -51,46 +42,33 @@ public class KuaiShouGroup {
     /**
      * 广告组ID
      */
-    @Excel(name = "广告组ID", width = 15)
-    @ApiModelProperty(value = "广告组ID")
     private Long unitId;
     /**
      * 广告组名称
      */
-    @Excel(name = "广告组名称", width = 15)
-    @ApiModelProperty(value = "广告组名称")
     private String unitName;
     /**
      * 广告组状态
      */
-    @Excel(name = "广告组状态", width = 15)
-    @ApiModelProperty(value = "广告组状态")
     private Integer status;
     private Integer putStatus;
+    private Integer studyStatus;
     private Integer createChannel;
     /**
      * 审核拒绝理由
      */
-    @Excel(name = "审核拒绝理由", width = 15)
-    @ApiModelProperty(value = "审核拒绝理由")
     private String reviewDetail;
     /**
      * 出价类型
      */
-    @Excel(name = "出价类型", width = 15)
-    @ApiModelProperty(value = "出价类型")
     private Integer bidType;
     /**
      * 出价
      */
-    @Excel(name = "出价", width = 15)
-    @ApiModelProperty(value = "出价")
     private Long bid;
     /**
      * OCPC出价
      */
-    @Excel(name = "OCPC出价", width = 15)
-    @ApiModelProperty(value = "OCPC出价")
     private Long cpaBid;
 
     private Integer deepConversionType;
@@ -99,32 +77,22 @@ public class KuaiShouGroup {
     /**
      * OCPX行为类型   1: CPM, 2: CPC,
      */
-    @Excel(name = "OCPX行为类型   1: CPM, 2: CPC,", width = 15)
-    @ApiModelProperty(value = "OCPX行为类型   1: CPM, 2: CPC,")
     private Integer ocpxActionType;
     /**
      * 单日预算
      */
-    @Excel(name = "单日预算", width = 15)
-    @ApiModelProperty(value = "单日预算")
     private Long dayBudget;
     /**
      * 投放方式  0:未知, 1:正常投
      */
-    @Excel(name = "投放方式  0:未知, 1:正常投", width = 15)
-    @ApiModelProperty(value = "投放方式  0:未知, 1:正常投")
     private Integer speed;
     /**
      * 投放开始时间
      */
-    @Excel(name = "投放开始时间", width = 15)
-    @ApiModelProperty(value = "投放开始时间")
     private String beginTime;
     /**
      * 投放结束时间
      */
-    @Excel(name = "投放结束时间", width = 15)
-    @ApiModelProperty(value = "投放结束时间")
     private String endTime;
     private String scheduleTime;
     private String sceneId;
@@ -132,38 +100,31 @@ public class KuaiShouGroup {
     /**
      * 创意展现方式  0:未知, 1:轮播,
      */
-    @Excel(name = "创意展现方式  0:未知, 1:轮播,", width = 15)
-    @ApiModelProperty(value = "创意展现方式  0:未知, 1:轮播,")
     private Integer showMode;
     private Integer unitType;
     /**
      * url类型
      */
-    @Excel(name = "url类型 ", width = 15)
-    @ApiModelProperty(value = "url类型 ")
     private Integer urlType;
     /**
      * 落地页链接
      */
-    @Excel(name = "落地页链接", width = 15)
-    @ApiModelProperty(value = "落地页链接")
     private Object url;
     /**
      * APP ID
      */
-    @Excel(name = "APP ID", width = 15)
-    @ApiModelProperty(value = "APP ID")
     private Long appId;
     /**
      * APP图标存储地址
      */
-    @Excel(name = "APP图标存储地址", width = 15)
-    @ApiModelProperty(value = "APP图标存储地址")
     private String appIconUrl;
 
 
-    private Long convertId; // 转化目标
-    private Integer useAppMarket; // 转化目标
+
+    // 转化目标
+    private Long convertId;
+    // 转化目标
+    private Integer useAppMarket;
     private String groupCreateTime;
     private String groupUpdateTime;
 
@@ -174,18 +135,10 @@ public class KuaiShouGroup {
     /**
      * 创建时间
      */
-    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建时间")
     private Date createTime;
     /**
      * 修改时间
      */
-    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "修改时间")
     private Date updateTime;
 
     @TableField(exist = false)

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

@@ -36,7 +36,8 @@
         group_create_time,
         group_update_time,
         create_time,
-        update_time)
+        update_time,
+        study_status)
         values
         <foreach collection="groups" item="getGroup" separator=",">
             (
@@ -73,7 +74,8 @@
             #{getGroup.groupCreateTime},
             #{getGroup.groupUpdateTime},
             #{getGroup.createTime},
-            #{getGroup.updateTime})
+            #{getGroup.updateTime},
+            #{getGroup.studyStatus})
         </foreach>
     </insert>
 

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

@@ -1121,6 +1121,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
 
+    @Override
     public JSONArray getCampaignList(CtopOauthToken token, Date startDate, Date endDate, int timeFilterType) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_LIST;
         Map<String, String> headers = new HashMap<>();
@@ -1219,6 +1220,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         kuaiShouCampaignService.replaceBatch(campaigns);
     }
 
+    @Override
     public JSONArray getGroupList(CtopOauthToken token, Long campaignId, Date startDate,
                                   Date endDate, int time_filter_type) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
@@ -1371,10 +1373,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setUnitName(unit_name);
                     group.setStatus(status);
                     group.setPutStatus(put_status);
+                    group.setStudyStatus(detail.getInteger("study_status"));
                     group.setCreateChannel(detail.getInteger("create_channel"));
                     group.setReviewDetail(detail.getString("review_detail"));
                     group.setBidType(bid_type);
                     group.setBid(bid);
+                    group.setStudyStatus(detail.getInteger("study_status"));
                     group.setCpaBid(cpa_bid);
                     group.setOcpxActionType(ocpx_action_type);
                     group.setDeepConversionType(detail.getInteger("deep_conversion_type"));

+ 4 - 108
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouGroupExploreController.java

@@ -1,38 +1,20 @@
 package cn.com.ctop.kuaishou.modules.report.controller;
 
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.QueryGenerator;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouGroupExplore;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouGroupExploreService;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
 
 /**
  * 广告组的加速探索报表
@@ -58,8 +40,6 @@ public class KuaishouGroupExploreController {
      * @param req
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-分页列表查询")
-    @ApiOperation(value = "广告组的加速探索报表-分页列表查询", notes = "广告组的加速探索报表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<KuaishouGroupExplore>> queryPageList(KuaishouGroupExplore kuaishouGroupExplore,
                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -77,11 +57,9 @@ public class KuaishouGroupExploreController {
     /**
      * 查询加速探索信息接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "查询加速探索信息接口")
-    @ApiOperation(value = "查询加速探索信息接口", notes = "查询加速探索信息接口")
     @PostMapping(value = "/unitExploreInfoGet")
     public Result<Object> unitExploreInfoGet(@RequestBody JSONObject data) {
         try {
@@ -95,11 +73,9 @@ public class KuaishouGroupExploreController {
     /**
      * 广告组的加速探索预算设置接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "广告组的加速探索预算设置接口")
-    @ApiOperation(value = "广告组的加速探索预算设置接口", notes = "广告组的加速探索预算设置接口")
     @PostMapping(value = "/unitExploreBudgetUpdate")
     public Result<Object> unitExploreBudgetUpdate(@RequestBody JSONObject data) {
         try {
@@ -113,11 +89,9 @@ public class KuaishouGroupExploreController {
     /**
      * 暂停广告组的加速探索预算接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "暂停广告组的加速探索预算接口")
-    @ApiOperation(value = "暂停广告组的加速探索预算接口", notes = "暂停广告组的加速探索预算接口")
     @PostMapping(value = "/unitExploreStatusPause")
     public Result<Object> unitExploreStatusPause(@RequestBody JSONObject data) {
         try {
@@ -131,11 +105,9 @@ public class KuaishouGroupExploreController {
     /**
      * 查询广告组的加速探索报表接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "查询广告组的加速探索报表接口")
-    @ApiOperation(value = "查询广告组的加速探索报表接口", notes = "查询广告组的加速探索报表接口")
     @PostMapping(value = "/querySpeedExploreReport")
     public Result<Object> querySpeedExploreReport(@RequestBody JSONObject data) {
         try {
@@ -153,8 +125,6 @@ public class KuaishouGroupExploreController {
      * @param kuaishouGroupExplore
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-添加")
-    @ApiOperation(value = "广告组的加速探索报表-添加", notes = "广告组的加速探索报表-添加")
     @PostMapping(value = "/add")
     public Result<KuaishouGroupExplore> add(@RequestBody KuaishouGroupExplore kuaishouGroupExplore) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -174,8 +144,6 @@ public class KuaishouGroupExploreController {
      * @param kuaishouGroupExplore
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-编辑")
-    @ApiOperation(value = "广告组的加速探索报表-编辑", notes = "广告组的加速探索报表-编辑")
     @PutMapping(value = "/edit")
     public Result<KuaishouGroupExplore> edit(@RequestBody KuaishouGroupExplore kuaishouGroupExplore) {
         Result<KuaishouGroupExplore> result = new Result<KuaishouGroupExplore>();
@@ -198,8 +166,6 @@ public class KuaishouGroupExploreController {
      * @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 {
@@ -217,8 +183,6 @@ public class KuaishouGroupExploreController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-批量删除")
-    @ApiOperation(value = "广告组的加速探索报表-批量删除", notes = "广告组的加速探索报表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<KuaishouGroupExplore> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -237,8 +201,6 @@ public class KuaishouGroupExploreController {
      * @param id
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-通过id查询")
-    @ApiOperation(value = "广告组的加速探索报表-通过id查询", notes = "广告组的加速探索报表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<KuaishouGroupExplore> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -252,71 +214,5 @@ public class KuaishouGroupExploreController {
         return result;
     }
 
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<KuaishouGroupExplore> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                KuaishouGroupExplore kuaishouGroupExplore = JSON.parseObject(deString, KuaishouGroupExplore.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouGroupExplore, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<KuaishouGroupExplore> pageList = kuaishouGroupExploreService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "广告组的加速探索报表列表");
-        mv.addObject(NormalExcelConstants.CLASS, KuaishouGroupExplore.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("广告组的加速探索报表列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<KuaishouGroupExplore> listKuaishouGroupExplores = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouGroupExplore.class, params);
-                kuaishouGroupExploreService.saveBatch(listKuaishouGroupExplores);
-                return Result.ok("文件导入成功!数据行数:" + listKuaishouGroupExplores.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
-    }
 
 }

+ 4 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouGroupExploreService.java

@@ -13,11 +13,11 @@ import org.jeecg.common.api.vo.Result;
  */
 public interface IKuaishouGroupExploreService extends IService<KuaishouGroupExplore> {
 
-    public Result<Object> unitExploreInfoGet(JSONObject data);
+    Result<Object> unitExploreInfoGet(JSONObject data);
 
-    public Result<Object> unitExploreBudgetUpdate(JSONObject data);
+    Result<Object> unitExploreBudgetUpdate(JSONObject data);
 
-    public Result<Object> unitExploreStatusPause(JSONObject data);
+    Result<Object> unitExploreStatusPause(JSONObject data);
 
-    public Result<Object> querySpeedExploreReport(JSONObject data);
+    Result<Object> querySpeedExploreReport(JSONObject data);
 }

+ 14 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/AccountReportServiceImpl.java

@@ -6,15 +6,12 @@ import cn.com.ctop.kuaishou.modules.report.service.IAccountReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.util.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author yumeng
@@ -22,7 +19,7 @@ import java.util.Map;
  */
 @Service
 public class AccountReportServiceImpl implements IAccountReportService {
-    @Autowired
+    @Resource
     private AccountReportMapper accountReportMapper;
 
     /**
@@ -51,8 +48,9 @@ public class AccountReportServiceImpl implements IAccountReportService {
             String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
             if (type == 1) {
                 // 今日汇总
-                Integer maxHour = accountReportMapper.selectMaxHourByDate(nowDate);
-                if (Check.isNull(maxHour) || maxHour == 0) {
+                Calendar calendar = Calendar.getInstance();
+                int maxHour = calendar.get(Calendar.HOUR_OF_DAY);
+                if(maxHour == 0){
                     return null;
                 }
                 String maxHourStr = String.valueOf(maxHour - 1);
@@ -268,7 +266,8 @@ public class AccountReportServiceImpl implements IAccountReportService {
             if (type == 1) {
                 // 今日汇总
                 if (Check.isNull(statHour)) {
-                    Integer maxHour = accountReportMapper.selectMaxHourByDate(nowDate);
+                    Calendar calendar = Calendar.getInstance();
+                    int maxHour = calendar.get(Calendar.HOUR_OF_DAY);
                     hour = maxHour - 1;
                 } else {
                     hour = statHour;
@@ -686,4 +685,10 @@ public class AccountReportServiceImpl implements IAccountReportService {
         }
         return returnJson;
     }
+
+    public static void main(String[] args) {
+        Calendar calendar = Calendar.getInstance();
+        int maxHour = calendar.get(Calendar.HOUR_OF_DAY);
+        System.out.println(maxHour);
+    }
 }

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/ByteDanceVideoInfoMapper.xml

@@ -57,13 +57,13 @@
         update
             ctop_bytedance_video_info
         set type = 2
-        where height &gt; width
-        and (height between 1280 and 2560)  and (width between 720 and 1440);
+        where height &gt; width and type is null
+        and (height between 1280 and 2560)  and (width between 720 and 1440)
     </update>
     <update id="updateVideoHorizonType">
         update ctop_bytedance_video_info
             set type = 1
-        where height &lt; width
+        where height &lt; width and type is null
         and (width between 1280 and 2560)  and (height between 720 and 1440)
     </update>
 </mapper>

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceImageInfoMapper.xml

@@ -37,13 +37,13 @@
         update
             ctop_bytedance_image_info
         set type = 2
-        where height &gt; width
+        where height &gt; width and type is null
         and (height between 1280 and 2560)  and (width between 720 and 1440);
     </update>
     <update id="updateImageHorizonType">
         update ctop_bytedance_image_info
             set type = 1
-        where height &lt; width
+        where height &lt; width and type is null
         and (width between 1280 and 2560)  and (height between 720 and 1440)
     </update>
 </mapper>

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

@@ -639,8 +639,6 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     public void getMaterialList(CtopOauthToken token) {
         getVideoByPage(token, "", 1);
         getImageByPage(token, "", 1);
-        videoInfoService.updateMaterialType();
-        imageInfoService.updateType();
     }
 
     @Autowired