yumeng 4 роки тому
батько
коміт
deef3d9028

+ 60 - 35
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -6,14 +6,13 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountTargetTemplateService;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouNewCreateCampaign;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCommentService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
+import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
@@ -23,6 +22,7 @@ import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.oa.modules.service.IWechatUserListService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.*;
+import com.alibaba.fastjson.JSONArray;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -37,6 +37,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -60,14 +61,37 @@ public class SampleTest {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouInterfaceService iKuaishouInterfaceService;
+    @Autowired
+    private IKuaiShouVideoGetService videoGetService;
+    @Autowired
+    private IKuaishouVideoRelateCreativesService kuaishouVideoRelateCreativesService;
 
     @Test
     public void loadBytedanceCreativeData() throws ParseException {
 
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse("2020-12-11");
-        CtopOauthToken tokenByAccountId = oauthTokenService.getTokenByAccountId(5982133L);
-        iKuaishouInterfaceService.getAdvertiserGroupReportDaily(tokenByAccountId, parse, parse);
+        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);
+        }
+
 
       /*  QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("media_id", 2);
@@ -247,12 +271,12 @@ public class SampleTest {
     }
 
     @Test
-    public void testData11(){
-        CtopOauthToken token =tokenService.getTokenByAccountId(9556344L);
+    public void testData11() {
+        CtopOauthToken token = tokenService.getTokenByAccountId(9556344L);
         int dimeDiff = 5;
         Date now = new Date();
         String startTime = DateUtils.formatDate("2021-01-11 18:25:00");
-        String endTime = DateUtils.formatDate(now,"2021-01-11 18:35:00");
+        String endTime = DateUtils.formatDate(now, "2021-01-11 18:35:00");
         kuaishouInterfaceService.getSuZaoList(token.getAccessToken(), token.getAccountId(), 1, startTime, endTime);
     }
 
@@ -379,7 +403,7 @@ public class SampleTest {
     public void execute() {
         String accountIds = "1675239584963662,1676540490482759,1675237415468045";
         String[] arrays = accountIds.split(",");
-        for(int i=0;i<arrays.length;i++){
+        for (int i = 0; i < arrays.length; i++) {
             Long accountId = Long.parseLong(arrays[i]);
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             load12Data(token);
@@ -388,35 +412,37 @@ public class SampleTest {
     }
 
     @Test
-    public void loadBytedanceData(){
+    public void loadBytedanceData() {
         String accountIds = "1676540490482759";
         String[] arrays = accountIds.split(",");
-        for(int i=0;i<arrays.length;i++){
+        for (int i = 0; i < arrays.length; i++) {
             Long accountId = Long.parseLong(arrays[i]);
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             load12Data(token);
         }
     }
 
-    private void load12AccountData(CtopOauthToken token){
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-01","yyyy-MM-dd"), DateUtils.parseDate("2020-12-11","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-11","yyyy-MM-dd"), DateUtils.parseDate("2020-12-21","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-21","yyyy-MM-dd"), DateUtils.parseDate("2020-12-31","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+    private void load12AccountData(CtopOauthToken token) {
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-01", "yyyy-MM-dd"), DateUtils.parseDate("2020-12-11", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-11", "yyyy-MM-dd"), DateUtils.parseDate("2020-12-21", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-21", "yyyy-MM-dd"), DateUtils.parseDate("2020-12-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
     }
 
-    private void load12Data(CtopOauthToken token){
+    private void load12Data(CtopOauthToken token) {
         bytedanceReportService.bytedanceMaterialReport(token, "2020-12-01", "2020-12-11");
         bytedanceReportService.bytedanceMaterialReport(token, "2020-12-11", "2020-12-21");
         bytedanceReportService.bytedanceMaterialReport(token, "2020-12-21", "2020-12-31");
     }
+
     @Autowired
     private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
+
     @Test
-    public void etlKuaishouData(){
+    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);
+        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);
         }
@@ -426,34 +452,32 @@ public class SampleTest {
     private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
 
     @Test
-    public void loadBytedanceVideo(){
+    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);
+        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(){
+    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.getVideoList(token, DateUtils.formatDate(DateUtils.addDay(date, -5)), DateUtils.formatDate(date));
         // 获取图片信息数据
 //        kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
     }
 
 
-
-
     @Autowired
     IRuleByteDanceAccountService ruleByteDanceAccountService;
 
     @Test
-    public void cleanRuleDataAccount(){
+    public void cleanRuleDataAccount() {
         List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
-        for(CtopOauthToken oauthToken:tokens){
-            ruleKuaiShouPlanService.cleanRuleDataTarget(oauthToken.getAccountId(),1);
+        for (CtopOauthToken oauthToken : tokens) {
+            ruleKuaiShouPlanService.cleanRuleDataTarget(oauthToken.getAccountId(), 1);
         }
     }
 
@@ -461,10 +485,11 @@ public class SampleTest {
     IAiKuaishouNewCreateCampaign aiKuaishouNewCreateCampaign;
     @Autowired
     private IAiKuaishouAccountTargetTemplateService aiKuaishouAccountTargetTemplateService;
+
     @Test
-    public void createPlan(){
+    public void createPlan() {
         List<AiKuaishouAccountTargetTemplate> accountTargetTemplates = aiKuaishouAccountTargetTemplateService.getAllEffectTemplate();
-        if(null==accountTargetTemplates||accountTargetTemplates.isEmpty()){
+        if (null == accountTargetTemplates || accountTargetTemplates.isEmpty()) {
             return;
         }
         accountTargetTemplates.forEach(targetTemplate -> aiKuaishouNewCreateCampaign.kuaishouAiAdsNewMaterialCreativity(targetTemplate));

+ 106 - 22
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java

@@ -5,8 +5,10 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouVideoLastTime;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouVideoLastTimeService;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
@@ -35,6 +37,8 @@ public class KuaiShouMaterialControer {
     private IKuaiShouVideoLastTimeService lastTimeService;
     @Autowired
     private IKuaiShouVideoGetService videoGetService;
+    @Autowired
+    private IKuaishouVideoRelateCreativesService relateCreativesService;
 
     /**
      * 查询上新素材
@@ -111,37 +115,117 @@ public class KuaiShouMaterialControer {
             if (Check.isNull(accountId)) {
                 throw new Exception("账户id不能为空");
             }
-            CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
-            if (Check.isNull(token)) {
-                throw new Exception("未获取账号授权信息");
+
+
+            String startDate = requestJson.getString("startDate");
+            if (Check.isNull(startDate)) {
+                throw new Exception("请输入开始查询时间");
             }
-            String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-            iKuaishouInterfaceService.getVideoList(token, nowDate, nowDate);
-            iKuaishouInterfaceService.getSuZaoList(token.getAccessToken(), accountId, 1, nowDate, nowDate);
-            KuaiShouVideoLastTime videoLastTime = lastTimeService.getById(accountId);
-            Date startTime;
-            Date endDate = new Date();
-            if (!Check.isNull(videoLastTime)) {
-                startTime = videoLastTime.getLastTime();
+
+            String endDate = requestJson.getString("endDate");
+            if (Check.isNull(endDate)) {
+                throw new Exception("请输入结束查询时间");
+            }
+
+            Integer createCount = requestJson.getInteger("createCount");
+            if (Check.isNull(createCount) || createCount == 0) {
+                throw new Exception("请输入最小关联数");
+            }
+
+            Integer num = requestJson.getInteger("num");
+            if (Check.isNull(num) || num == 0) {
+                throw new Exception("请输入查询条数");
+            }
+
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("startTime", startDate);
+            requestMap.put("endTime", endDate);
+            requestMap.put("accountId", accountId);
+            requestMap.put("num", num);
+            requestMap.put("createCount", createCount);
+            List<JSONObject> materialList = relateCreativesService.getVideoListByMap(requestMap);
+            if (!Check.isNull(materialList)) {
+                for (int i = 0; i < materialList.size(); i++) {
+                    JSONObject materialJson = materialList.get(i);
+                    KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(materialJson.getLong("photo_id"));
+                    if (!Check.isNull(videoGet)) {
+                        String signature = videoGet.getSignature();
+                        materialJson.put("signature", signature);
+                        materialJson.put("video_url", videoGet.getUrl());
+                        materialJson.put("channel_type", videoGet.getChannelType());
+                        List<String> imageList = lastTimeService.getImageListByMd5(signature);
+                        materialJson.put("imageList", imageList);
+                    }
+                }
+                returnJson.put("code", 0);
+                returnJson.put("message", "SUCCESS");
+                returnJson.put("data", materialList);
             } else {
-                startTime = DateUtils.addTime(endDate, 5);
+                returnJson.put("code", -1);
+                returnJson.put("message", "暂未新上素材");
             }
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
+    @PostMapping(value = "/getHistoryTopVideoList")
+    public JSONObject getHistoryTopVideoList(@RequestBody JSONObject requestJson) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("入参不能为空");
+            }
+            Long accountId = requestJson.getLong("accountId");
+            if (Check.isNull(accountId)) {
+                throw new Exception("账户id不能为空");
+            }
+
+
+            String startDate = requestJson.getString("startDate");
+            if (Check.isNull(startDate)) {
+                throw new Exception("请输入开始查询时间");
+            }
+
+            String endDate = requestJson.getString("endDate");
+            if (Check.isNull(endDate)) {
+                throw new Exception("请输入结束查询时间");
+            }
+
+            Integer createCount = requestJson.getInteger("createCount");
+            if (Check.isNull(createCount) || createCount == 0) {
+                throw new Exception("请输入最小关联数");
+            }
+
+            Integer num = requestJson.getInteger("num");
+            if (Check.isNull(num) || num == 0) {
+                throw new Exception("请输入查询条数");
+            }
+
             Map<String, Object> requestMap = new HashMap<>();
-            requestMap.put("startTime", DateUtils.formatDate(startTime, "yyyy-MM-dd HH:mm:ss"));
-            requestMap.put("endTime", DateUtils.formatDate(endDate, "yyyy-MM-dd HH:mm:ss"));
+            requestMap.put("startTime", startDate);
+            requestMap.put("endTime", endDate);
             requestMap.put("accountId", accountId);
-            List<JSONObject> materialList = videoGetService.getVideoListByMap(requestMap);
+            requestMap.put("num", num);
+            requestMap.put("createCount", createCount);
+            List<JSONObject> materialList = relateCreativesService.getVideoListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 for (int i = 0; i < materialList.size(); i++) {
                     JSONObject materialJson = materialList.get(i);
-                    String signature = materialJson.getString("signature");
-                    List<String> imageList = lastTimeService.getImageListByMd5(signature);
-                    materialJson.put("imageList", imageList);
+                    KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(materialJson.getLong("photo_id"));
+                    if (!Check.isNull(videoGet)) {
+                        String signature = videoGet.getSignature();
+                        materialJson.put("signature", signature);
+                        materialJson.put("video_url", videoGet.getUrl());
+                        materialJson.put("channel_type", videoGet.getChannelType());
+                        List<String> imageList = lastTimeService.getImageListByMd5(signature);
+                        materialJson.put("imageList", imageList);
+                    }
                 }
-                KuaiShouVideoLastTime lastTime = new KuaiShouVideoLastTime();
-                lastTime.setId(accountId);
-                lastTime.setLastTime(endDate);
-                lastTimeService.saveOrUpdate(lastTime);
                 returnJson.put("code", 0);
                 returnJson.put("message", "SUCCESS");
                 returnJson.put("data", materialList);

+ 1 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java

@@ -22,8 +22,7 @@ public interface KuaiShouVideoGetMapper extends BaseMapper<KuaiShouVideoGet> {
     List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 
     List<KuaiShouVideoGet> getHighQualityVideo(long accountId,int days,int num);
-
     List<KuaiShouVideoGet> selectPhotoIdsByAccountId(Long accountId);
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
-    List<KuaiShouVideoGet> selectPhotoIdsByAccountId(Long accountId);
+
 }

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouVideoRelateCreativesMapper.java

@@ -1,10 +1,12 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouVideoRelateCreatives;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 频库-视频关联创意数查询
@@ -16,4 +18,6 @@ import java.util.List;
 public interface KuaishouVideoRelateCreativesMapper extends BaseMapper<KuaishouVideoRelateCreatives> {
 
     void insertBatch(@Param(value = "videolist") List<KuaishouVideoRelateCreatives> videolist);
+
+    List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
 }

+ 29 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml

@@ -20,4 +20,33 @@
         </foreach>
     </insert>
 
+
+    <select id="getVideoListByMap" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        photo_id as 'photo_id',
+        stat_date as 'stat_date',
+        creative_count as 'creative_count'
+        FROM ctop_kuaishou_video_relate_creatives AS t1
+        JOIN (SELECT ROUND(RAND() * (SELECT MAX(id) FROM
+        ctop_kuaishou_video_relate_creatives
+        where 1 = 1
+        <if test="accountId != null and accountId != '' ">
+            and account_id = #{accountId}
+        </if>
+        <if test="startTime != null and startTime != '' ">
+            and DATE_FORMAT(stat_date,'%Y-%m-%d') &gt;= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != '' ">
+            and DATE_FORMAT(stat_date,'%Y-%m-%d') &lt;= #{endTime}
+        </if>
+        )) AS id) AS t2
+        WHERE t1.id >= t2.id
+        <if test="accountId != null and accountId != '' ">
+            and account_id = #{accountId}
+        </if>
+        <if test="createCount != null and createCount != '' ">
+            AND creative_count &lt;= #{createCount}
+        </if>
+        ORDER BY t1.id ASC LIMIT #{num}
+    </select>
 </mapper>

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java

@@ -32,4 +32,6 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
 
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
     List<KuaiShouVideoGet> selectPhotoIdsByAccountId(Long accountId);
+
+    KuaiShouVideoGet getVideoByPhotoId(Long photo_id);
 }

+ 4 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouVideoRelateCreativesService.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -16,8 +17,9 @@ import java.util.Map;
  */
 public interface IKuaishouVideoRelateCreativesService extends IService<KuaishouVideoRelateCreatives> {
 
-    public Result pushVideo(JSONObject data);
+    Result pushVideo(JSONObject data);
 
-    public void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String,Object> statdateMap);
+    void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, Object> statdateMap);
 
+    List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
 }

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

@@ -289,6 +289,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
             executorService.submit(new Runnable() {
                 @Override
                 public void run() {
+
                     Long accountId = template.getAccountId();
                     CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
                     if (Check.isNull(token)) {
@@ -416,6 +417,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
                     } catch (InterruptedException e) {
                         e.printStackTrace();
                     }
+
                 }
             });
         }

+ 9 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java

@@ -19,7 +19,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -172,4 +171,13 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
         return videoGetMapper.selectPhotoIdsByAccountId(accountId);
     }
 
+    @Override
+    public KuaiShouVideoGet getVideoByPhotoId(Long photo_id) {
+        QueryWrapper<KuaiShouVideoGet> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("photo_id", photo_id);
+        queryWrapper.last("limit 1");
+        KuaiShouVideoGet videoGet = videoGetMapper.selectOne(queryWrapper);
+        return videoGet;
+    }
+
 }

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

@@ -141,4 +141,9 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
             log.error("频库-视频关联创意数查询失败", e);
         }
     }
+
+    @Override
+    public List<JSONObject> getVideoListByMap(Map<String, Object> requestMap) {
+        return kuaishouVideoRelateCreativesMapper.getVideoListByMap(requestMap);
+    }
 }