Browse Source

Merge remote-tracking branch 'origin/test' into test

syh 4 năm trước cách đây
mục cha
commit
95c68c686b
15 tập tin đã thay đổi với 176 bổ sung79 xóa
  1. 4 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialImageInfoController.java
  2. 52 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  3. 2 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  4. 9 10
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  5. 61 35
      module-common/src/main/java/cn/com/ctop/common/module/utils/CosUtils.java
  6. 19 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java
  7. 1 0
      module-ctop/src/main/java/cn/com/ctop/manage/modules/edu/service/impl/EduLessonServiceImpl.java
  8. 2 9
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  9. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouTrackUrlCollectionController.java
  10. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java
  11. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml
  12. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/MateriaRefuseMapper.xml
  13. 16 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java
  14. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  15. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

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

@@ -116,13 +116,15 @@ public class MaterialImageInfoController {
     @AutoLog(value = "素材-分页列表查询")
     @AutoLog(value = "素材-分页列表查询")
     @ApiOperation(value = "素材-分页列表查询", notes = "素材-分页列表查询")
     @ApiOperation(value = "素材-分页列表查询", notes = "素材-分页列表查询")
     @GetMapping(value = "/list")
     @GetMapping(value = "/list")
-    public Result<List<MaterialImageInfo>> queryPageList(String videoId,Integer status) {
+    public Result<List<MaterialImageInfo>> queryPageList(String videoId, Integer status) {
         Result<List<MaterialImageInfo>> result = new Result<>();
         Result<List<MaterialImageInfo>> result = new Result<>();
         List<MaterialImageInfo> list = new ArrayList<>();
         List<MaterialImageInfo> list = new ArrayList<>();
         if (!Check.isNull(videoId)) {
         if (!Check.isNull(videoId)) {
             QueryWrapper<MaterialImageInfo> queryWrapper = new QueryWrapper<>();
             QueryWrapper<MaterialImageInfo> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("video_id", videoId);
             queryWrapper.eq("video_id", videoId);
-            queryWrapper.eq("status", status);
+            if (!Check.isNull(status)) {
+                queryWrapper.eq("status", status);
+            }
             list = MaterialImageInfoService.list(queryWrapper);
             list = MaterialImageInfoService.list(queryWrapper);
         }
         }
 
 

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

@@ -3,10 +3,8 @@ package org.jeecg.modules.ctop.controller;
 import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.service.*;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.common.module.vo.ResFileDTO;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
@@ -26,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.io.IOException;
 import java.io.IOException;
+import java.io.InputStream;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
@@ -69,11 +68,54 @@ public class TestController {
     private IMaterialImageInfoService iMaterialImageInfoService;
     private IMaterialImageInfoService iMaterialImageInfoService;
     @Autowired
     @Autowired
     private IBytedanceReportService bytedanceReportService;
     private IBytedanceReportService bytedanceReportService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    static ExecutorService executorService = Executors.newFixedThreadPool(15);
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
 
 
 
 
+
+    @GetMapping(value = "/getCut")
+    public void getCut() {
+        QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
+        materialInfoQueryWrapper.like("cover_url", "ctop-media.oss-cn-beijing.aliyuncs.com");
+        List<MaterialInfo> list = materialInfoService.list(materialInfoQueryWrapper);
+        if (!Check.isNull(list)) {
+            for (MaterialInfo materialInfo : list) {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            String url = materialInfo.getCoverUrl();
+                            if (!Check.isNull(url)) {
+                                InputStream imageStream = LoadFileUtil.getFileStream(url);
+                                if (!Check.isNull(imageStream)) {
+                                    ResFileDTO jpg = CosUtils.uploadDetailInputStreamV2(imageStream, materialInfo.getCode() + ".jpg", "jpg", 0L, "zeroImage/");
+                                    String fileUrl = jpg.getFileUrl();
+                                    materialInfo.setCoverUrl(fileUrl);
+                                    boolean b = materialInfoService.saveOrUpdate(materialInfo);
+                                    if (b) {
+                                        log.info("修改成功,videoCode:{}", materialInfo.getCode());
+                                    }
+                                }
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            }
+        }
+        // InputStream in, String fileName, String fileType, long fileSize, String fileSavePath
+
+
+    }
+
+
+
+
+
+
+
     @GetMapping(value = "/t")
     @GetMapping(value = "/t")
     public String test() {
     public String test() {
         Result<String> result = new Result<>();
         Result<String> result = new Result<>();
@@ -94,7 +136,6 @@ public class TestController {
     }
     }
 
 
 
 
-
     @GetMapping(value = "/getSuZhao")
     @GetMapping(value = "/getSuZhao")
     public void getSuZhao() throws JobExecutionException {
     public void getSuZhao() throws JobExecutionException {
         try {
         try {
@@ -765,13 +806,15 @@ public class TestController {
             bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 4);
             bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 4);
         }
         }
     }
     }
+
     @Autowired
     @Autowired
     private IBytedanceEffectVideoInfoService effectVideoInfoService;
     private IBytedanceEffectVideoInfoService effectVideoInfoService;
+
     @GetMapping("/bytedance/effectVideo/get")
     @GetMapping("/bytedance/effectVideo/get")
-    public Map<String,Object>effectVideoGet(String date){
-        Map<String,Object>result = new HashMap<>();
+    public Map<String, Object> effectVideoGet(String date) {
+        Map<String, Object> result = new HashMap<>();
         effectVideoInfoService.loadEffectVideo(date);
         effectVideoInfoService.loadEffectVideo(date);
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
         return result;
     }
     }
 
 

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

@@ -71,13 +71,14 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
                 if (code == 0) {
                 if (code == 0) {
                     log.info("头条上传素材成功,返回信息:{},accountId:{}", jsonObject, accountId);
                     log.info("头条上传素材成功,返回信息:{},accountId:{}", jsonObject, accountId);
                 } else {
                 } else {
+                    log.error("头条上传素材失败,返回信息:{},accountId:{}", jsonObject, accountId);
                     UserAllocation allocation = userAllocationService.getByAccountId(Long.valueOf(accountId));
                     UserAllocation allocation = userAllocationService.getByAccountId(Long.valueOf(accountId));
                     String message = messageTemplate.getMaterialSyncTemplate(allocation.getProjectName(), Long.valueOf(accountId), allocation.getAuthName(), materialName, jsonObject.getString("message"));
                     String message = messageTemplate.getMaterialSyncTemplate(allocation.getProjectName(), Long.valueOf(accountId), allocation.getAuthName(), materialName, jsonObject.getString("message"));
                     sendMessageService.sendMessage(userId, message);
                     sendMessageService.sendMessage(userId, message);
                 }
                 }
 
 
             }else{
             }else{
-                log.info("头条上传素材f返回结果为空,返回信息:{},accountId:{}", jsonObject, accountId);
+                log.info("头条上传素材返回结果为空,返回信息:{},accountId:{}", jsonObject, accountId);
             }
             }
 
 
 
 

+ 9 - 10
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
 
 
 import java.io.IOException;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
@@ -356,20 +357,15 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
     private void getCut(String materialId, String videoUrl, String loadImage, Integer count) {
     private void getCut(String materialId, String videoUrl, String loadImage, Integer count) {
         try {
         try {
             Map<String, Object> coverMap = CloudVideoProcessUtil.videoCutFrameHandle(videoUrl, loadImage);
             Map<String, Object> coverMap = CloudVideoProcessUtil.videoCutFrameHandle(videoUrl, loadImage);
-            if (count < 4) {
-                getCut(materialId, videoUrl, loadImage, count + 1);
-            } else {
-                return;
-            }
-
-            if (Check.isNullMap(coverMap)) {
-                return;
-            }
             for (int i = 0; i <= 13; i++) {
             for (int i = 0; i <= 13; i++) {
                 String url = (String) coverMap.get(String.valueOf(i));
                 String url = (String) coverMap.get(String.valueOf(i));
                 if (!Check.isNull(url)) {
                 if (!Check.isNull(url)) {
                     String cutFramePath = LoadFileUtil.downLoadFromUrl(url, imageUpLoadPath);
                     String cutFramePath = LoadFileUtil.downLoadFromUrl(url, imageUpLoadPath);
                     String cutFrameMd5 = LoadFileUtil.getMD5(cutFramePath);
                     String cutFrameMd5 = LoadFileUtil.getMD5(cutFramePath);
+                    Map<String, Object> deleteMap = new HashMap<>();
+                    deleteMap.put("video_signature", materialId);
+                    deleteMap.put("signature", cutFrameMd5);
+                    this.removeByMap(deleteMap);
                     MaterialCutFrame cutFrame = new MaterialCutFrame();
                     MaterialCutFrame cutFrame = new MaterialCutFrame();
                     cutFrame.setSignature(cutFrameMd5);
                     cutFrame.setSignature(cutFrameMd5);
                     cutFrame.setUrl(url);
                     cutFrame.setUrl(url);
@@ -383,6 +379,9 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
         } catch (Exception e) {
         } catch (Exception e) {
             log.info("抽帧异常,code:{}", materialId);
             log.info("抽帧异常,code:{}", materialId);
             e.printStackTrace();
             e.printStackTrace();
+            if (count >= 4) {
+                return;
+            }
             getCut(materialId, videoUrl, loadImage, count + 1);
             getCut(materialId, videoUrl, loadImage, count + 1);
 
 
         }
         }
@@ -391,7 +390,7 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
 
 
     @Override
     @Override
     public boolean updateTencentCutFrame(String videoMD5) {
     public boolean updateTencentCutFrame(String videoMD5) {
-        boolean result=true;
+        boolean result = true;
         Map<String, Object> coverMap = CloudVideoProcessUtil.supplementFrameUrl(videoMD5);
         Map<String, Object> coverMap = CloudVideoProcessUtil.supplementFrameUrl(videoMD5);
         for (int i = 0; i <= 13; i++) {
         for (int i = 0; i <= 13; i++) {
             String url = (String) coverMap.get(String.valueOf(i));
             String url = (String) coverMap.get(String.valueOf(i));

+ 61 - 35
module-common/src/main/java/cn/com/ctop/common/module/utils/CosUtils.java

@@ -22,16 +22,17 @@ import java.util.UUID;
 
 
 public class CosUtils {
 public class CosUtils {
     private static final String ACCESSKEY = "AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets";
     private static final String ACCESSKEY = "AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets";
-    private static final String SECRETKEY ="tXzuwMfplTTK3c9GFUyETilasvQfePu9";
+    private static final String SECRETKEY = "tXzuwMfplTTK3c9GFUyETilasvQfePu9";
     private static final String APPID = "1301855440";
     private static final String APPID = "1301855440";
-    private static final String BUCKETNAME = "media-"+APPID;
+    private static final String BUCKETNAME = "media-" + APPID;
     private static final String REGIONID = "ap-chongqing";
     private static final String REGIONID = "ap-chongqing";
-    private static final String URL_PREFIX = "https://"+BUCKETNAME+".cos.ap-chongqing.myqcloud.com/";
+    private static final String URL_PREFIX = "https://" + BUCKETNAME + ".cos.ap-chongqing.myqcloud.com/";
     /**
     /**
      * https://media-1301855440.cos.ap-chongqing.myqcloud.com/MyFile1/1234.mp4
      * https://media-1301855440.cos.ap-chongqing.myqcloud.com/MyFile1/1234.mp4
      */
      */
     /**
     /**
      * 初始化CosClient相关配置, appid、accessKey、secretKey、region
      * 初始化CosClient相关配置, appid、accessKey、secretKey、region
+     *
      * @return
      * @return
      */
      */
     public static COSClient getCosClient() {
     public static COSClient getCosClient() {
@@ -50,12 +51,12 @@ public class CosUtils {
     /**
     /**
      * URL_PREFIX+fileSavePath+fileName
      * URL_PREFIX+fileSavePath+fileName
      * 上传文件
      * 上传文件
-     * @return
-     * //绝对路径和相对路径都OK
+     *
+     * @return //绝对路径和相对路径都OK
      */
      */
-    public static String uploadFile(String filePath,String fileSavePath,String fileName) {
+    public static String uploadFile(String filePath, String fileSavePath, String fileName) {
         File localFile = new File(filePath);
         File localFile = new File(filePath);
-        PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKETNAME, fileSavePath+fileName, localFile);
+        PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKETNAME, fileSavePath + fileName, localFile);
         // 设置存储类型, 默认是标准(Standard), 低频(standard_ia),一般为标准的
         // 设置存储类型, 默认是标准(Standard), 低频(standard_ia),一般为标准的
         putObjectRequest.setStorageClass(StorageClass.Standard);
         putObjectRequest.setStorageClass(StorageClass.Standard);
         COSClient cc = getCosClient();
         COSClient cc = getCosClient();
@@ -67,7 +68,7 @@ public class CosUtils {
             e.printStackTrace();
             e.printStackTrace();
         } catch (CosClientException e) {
         } catch (CosClientException e) {
             e.printStackTrace();
             e.printStackTrace();
-        }finally {
+        } finally {
             // 关闭客户端
             // 关闭客户端
             cc.shutdown();
             cc.shutdown();
         }
         }
@@ -76,6 +77,7 @@ public class CosUtils {
 
 
     /**
     /**
      * 下载文件
      * 下载文件
+     *
      * @param bucketName
      * @param bucketName
      * @param key
      * @param key
      * @return
      * @return
@@ -93,6 +95,7 @@ public class CosUtils {
 
 
     /**
     /**
      * 删除文件
      * 删除文件
+     *
      * @param bucketName
      * @param bucketName
      * @param key
      * @param key
      */
      */
@@ -110,6 +113,7 @@ public class CosUtils {
 
 
     /**
     /**
      * 创建桶
      * 创建桶
+     *
      * @param bucketName
      * @param bucketName
      * @return
      * @return
      * @throws CosClientException
      * @throws CosClientException
@@ -125,15 +129,18 @@ public class CosUtils {
         } finally {
         } finally {
         }
         }
         return bucket;
         return bucket;
-    };
+    }
+
+    ;
 
 
     /**
     /**
      * 删除桶
      * 删除桶
+     *
      * @param bucketName
      * @param bucketName
      * @throws CosClientException
      * @throws CosClientException
      * @throws CosServiceException
      * @throws CosServiceException
      */
      */
-    public void deleteBucket(String bucketName){
+    public void deleteBucket(String bucketName) {
         COSClient cc = getCosClient();
         COSClient cc = getCosClient();
         try {
         try {
             cc.deleteBucket(bucketName);
             cc.deleteBucket(bucketName);
@@ -141,20 +148,24 @@ public class CosUtils {
             e.printStackTrace();
             e.printStackTrace();
         } finally {
         } finally {
         }
         }
-    };
+    }
+
+    ;
 
 
     /**
     /**
      * 判断桶是否存在
      * 判断桶是否存在
+     *
      * @param bucketName
      * @param bucketName
      * @return
      * @return
      */
      */
-    public static boolean doesBucketExist(String bucketName){
+    public static boolean doesBucketExist(String bucketName) {
         COSClient cc = getCosClient();
         COSClient cc = getCosClient();
         return cc.doesBucketExist(bucketName);
         return cc.doesBucketExist(bucketName);
     }
     }
 
 
     /**
     /**
      * 查看桶文件
      * 查看桶文件
+     *
      * @param bucketName
      * @param bucketName
      * @return
      * @return
      * @throws CosClientException
      * @throws CosClientException
@@ -197,31 +208,32 @@ public class CosUtils {
     }
     }
 
 
     /**
     /**
-     *查询一个 Bucket 所在的 Region。
+     * 查询一个 Bucket 所在的 Region。
+     *
      * @param bucketName
      * @param bucketName
      * @return
      * @return
      */
      */
-    public static String getBucketLocation(String bucketName){
+    public static String getBucketLocation(String bucketName) {
         COSClient cosClient = getCosClient();
         COSClient cosClient = getCosClient();
         // bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
         // bucket 的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
         return cosClient.getBucketLocation(bucketName);
         return cosClient.getBucketLocation(bucketName);
     }
     }
 
 
-    public static ResFileDTO uploadMultipartFile(MultipartFile file,String fileSavePath){
+    public static ResFileDTO uploadMultipartFile(MultipartFile file, String fileSavePath) {
         String fileName = file.getOriginalFilename();
         String fileName = file.getOriginalFilename();
         InputStream inputStream;
         InputStream inputStream;
         ResFileDTO o = new ResFileDTO();
         ResFileDTO o = new ResFileDTO();
-        String fileType ;
+        String fileType;
         long fileSize = file.getSize();
         long fileSize = file.getSize();
         try {
         try {
             inputStream = file.getInputStream();
             inputStream = file.getInputStream();
             FileType type = FileTypeJudge.getType(inputStream);
             FileType type = FileTypeJudge.getType(inputStream);
 
 
-            if(type == null || "null".equals(type.toString()) ||
-                    "XLS_DOC".equals(type.toString())|| "XLSX_DOCX".equals(type.toString()) ||
-                    "WPSUSER".equals(type.toString())|| "WPS".equals(type.toString())){
+            if (type == null || "null".equals(type.toString()) ||
+                    "XLS_DOC".equals(type.toString()) || "XLSX_DOCX".equals(type.toString()) ||
+                    "WPSUSER".equals(type.toString()) || "WPS".equals(type.toString())) {
                 fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                 fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
-            }else{
+            } else {
                 fileType = type.toString().toLowerCase();
                 fileType = type.toString().toLowerCase();
             }
             }
 
 
@@ -232,7 +244,7 @@ public class CosUtils {
         }
         }
 
 
         try {
         try {
-            o = uploadDetailInputStream(file.getInputStream(),fileName,fileType,fileSize,fileSavePath);
+            o = uploadDetailInputStream(file.getInputStream(), fileName, fileType, fileSize, fileSavePath);
         } catch (IOException e) {
         } catch (IOException e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
@@ -240,12 +252,12 @@ public class CosUtils {
     }
     }
 
 
 
 
-    public static ResFileDTO uploadDetailInputStream (InputStream in, String fileName , String fileType, long fileSize,String fileSavePath) {
-        String uuidFileName = UUID.randomUUID().toString()+fileName.substring(fileName.lastIndexOf("."));
-        String fileUrl = URL_PREFIX+fileSavePath+uuidFileName;
+    public static ResFileDTO uploadDetailInputStream(InputStream in, String fileName, String fileType, long fileSize, String fileSavePath) {
+        String uuidFileName = UUID.randomUUID().toString() + fileName.substring(fileName.lastIndexOf("."));
+        String fileUrl = URL_PREFIX + fileSavePath + uuidFileName;
         String md5key = uploadFileByInputStream(in, fileSavePath, uuidFileName);
         String md5key = uploadFileByInputStream(in, fileSavePath, uuidFileName);
         ResFileDTO o = new ResFileDTO();
         ResFileDTO o = new ResFileDTO();
-        if(md5key != null){
+        if (md5key != null) {
             o.setFileType(fileType);
             o.setFileType(fileType);
             o.setFileName(fileName);
             o.setFileName(fileName);
             o.setCFileName(uuidFileName);
             o.setCFileName(uuidFileName);
@@ -256,9 +268,27 @@ public class CosUtils {
         return o;
         return o;
     }
     }
 
 
-    public static String uploadFileByInputStream(InputStream fileStream, String fileSavePath, String fileName){
+
+    public static ResFileDTO uploadDetailInputStreamV2(InputStream in, String fileName, String fileType, long fileSize, String fileSavePath) {
+        //      String uuidFileName = UUID.randomUUID().toString() + fileName.substring(fileName.lastIndexOf("."));
+        String fileUrl = URL_PREFIX + fileSavePath + fileName;
+        String md5key = uploadFileByInputStream(in, fileSavePath, fileName);
+        ResFileDTO o = new ResFileDTO();
+        if (md5key != null) {
+            o.setFileType(fileType);
+            o.setFileName(fileName);
+            o.setCFileName(fileName);
+            o.setFileUrl(fileUrl);
+            o.setFileSize(fileSize);
+            o.setMd5key(md5key);
+        }
+        return o;
+    }
+
+
+    public static String uploadFileByInputStream(InputStream fileStream, String fileSavePath, String fileName) {
         ObjectMetadata metadata = new ObjectMetadata();
         ObjectMetadata metadata = new ObjectMetadata();
-        PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKETNAME, fileSavePath+fileName, fileStream,metadata);
+        PutObjectRequest putObjectRequest = new PutObjectRequest(BUCKETNAME, fileSavePath + fileName, fileStream, metadata);
         // 设置存储类型, 默认是标准(Standard), 低频(standard_ia),一般为标准的
         // 设置存储类型, 默认是标准(Standard), 低频(standard_ia),一般为标准的
         putObjectRequest.setStorageClass(StorageClass.Standard);
         putObjectRequest.setStorageClass(StorageClass.Standard);
         COSClient cc = getCosClient();
         COSClient cc = getCosClient();
@@ -270,7 +300,7 @@ public class CosUtils {
             e.printStackTrace();
             e.printStackTrace();
         } catch (CosClientException e) {
         } catch (CosClientException e) {
             e.printStackTrace();
             e.printStackTrace();
-        }finally {
+        } finally {
             // 关闭客户端
             // 关闭客户端
             cc.shutdown();
             cc.shutdown();
         }
         }
@@ -278,11 +308,7 @@ public class CosUtils {
     }
     }
 
 
 
 
-    public static void main(String[] args) {
-        String filepath = "D:\\1234.mp4";
-        String fileSavePath = "script-lib/wps/";
-        String fileName = UUID.randomUUID().toString()+filepath.substring(filepath.lastIndexOf("."));
-        String filePath = uploadFile(filepath, fileSavePath, fileName);
-        System.out.println(filePath);
-    }
+
+
+
 }
 }

+ 19 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java

@@ -168,4 +168,23 @@ public class LoadFileUtil {
         return null;
         return null;
 
 
     }
     }
+
+
+    public static InputStream getFileStream(String url) {
+        try {
+            HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
+            connection.setReadTimeout(60000);
+            connection.setConnectTimeout(60000);
+            connection.setRequestMethod("GET");
+            if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
+                InputStream inputStream = connection.getInputStream();
+                return inputStream;
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
 }
 }

+ 1 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/edu/service/impl/EduLessonServiceImpl.java

@@ -46,6 +46,7 @@ public class EduLessonServiceImpl extends ServiceImpl<EduLessonMapper, EduLesson
         String result = HttpUtils2.httpGetRequest(url,headMap, jsonObject);
         String result = HttpUtils2.httpGetRequest(url,headMap, jsonObject);
         ObjectMapper mapper = new ObjectMapper();
         ObjectMapper mapper = new ObjectMapper();
         try {
         try {
+
             JsonNode rootNode = mapper.readTree(result);
             JsonNode rootNode = mapper.readTree(result);
             int code = rootNode.get("code").asInt();
             int code = rootNode.get("code").asInt();
             if(code != 0){
             if(code != 0){

+ 2 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -1574,19 +1574,17 @@ public class BatchController {
     /**
     /**
      * 获取视频信息
      * 获取视频信息
      *
      *
-     * @param accountId
      * @param photoId
      * @param photoId
      * @return
      * @return
      */
      */
     @GetMapping(value = "/getVideoDetail")
     @GetMapping(value = "/getVideoDetail")
-    public Result<KuaiShouVideoGet> getVideoDetail(Long accountId, String photoId) {
+    public Result<KuaiShouVideoGet> getVideoDetail(String photoId) {
         Result<KuaiShouVideoGet> result = new Result<>();
         Result<KuaiShouVideoGet> result = new Result<>();
         try {
         try {
-            if (Check.isNull(accountId) || Check.isNull(photoId)) {
+            if (Check.isNull(photoId)) {
                 throw new Exception("参数错误");
                 throw new Exception("参数错误");
             }
             }
             QueryWrapper<KuaiShouVideoGet> videoGetQueryWrapper = new QueryWrapper<>();
             QueryWrapper<KuaiShouVideoGet> videoGetQueryWrapper = new QueryWrapper<>();
-            videoGetQueryWrapper.eq("account_id", accountId);
             videoGetQueryWrapper.eq("photo_id", photoId);
             videoGetQueryWrapper.eq("photo_id", photoId);
             videoGetQueryWrapper.orderByDesc("create_time").last("limit 1");
             videoGetQueryWrapper.orderByDesc("create_time").last("limit 1");
             KuaiShouVideoGet video = videoGetService.getOne(videoGetQueryWrapper);
             KuaiShouVideoGet video = videoGetService.getOne(videoGetQueryWrapper);
@@ -2211,7 +2209,6 @@ public class BatchController {
     }
     }
 
 
 
 
-
     /**
     /**
      * 收藏标题
      * 收藏标题
      *
      *
@@ -2233,7 +2230,6 @@ public class BatchController {
             }
             }
 
 
 
 
-
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
             result.setSuccess(false);
             result.setSuccess(false);
@@ -2243,7 +2239,4 @@ public class BatchController {
     }
     }
 
 
 
 
-
-
-
 }
 }

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

@@ -76,11 +76,12 @@ public class KuaiShouTrackUrlCollectionController {
 
 
 
 
     @GetMapping(value = "/checkTrackName")
     @GetMapping(value = "/checkTrackName")
-    public Result<Boolean> checkTrackName(Long accountId, String trackName) {
+    public Result<Boolean> checkTrackName(Long accountId, String trackName,String userId) {
         Result<Boolean> result = new Result<>();
         Result<Boolean> result = new Result<>();
         QueryWrapper<KuaiShouTrackUrlCollection> queryWrapper = new QueryWrapper<>();
         QueryWrapper<KuaiShouTrackUrlCollection> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("account_id", accountId);
         queryWrapper.eq("account_id", accountId);
         queryWrapper.eq("track_name", trackName);
         queryWrapper.eq("track_name", trackName);
+        queryWrapper.eq("user_id", userId);
         List<KuaiShouTrackUrlCollection> list = kuaiShouTrackUrlCollectionService.list(queryWrapper);
         List<KuaiShouTrackUrlCollection> list = kuaiShouTrackUrlCollectionService.list(queryWrapper);
         if (Check.isNull(list)) {
         if (Check.isNull(list)) {
             result.setResult(true);
             result.setResult(true);

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java

@@ -190,6 +190,7 @@ public class KuaiShouCreative {
     @Excel(name = "第三方有效播放监测链接", width = 15)
     @Excel(name = "第三方有效播放监测链接", width = 15)
     @ApiModelProperty(value = "第三方有效播放监测链接")
     @ApiModelProperty(value = "第三方有效播放监测链接")
     private String adPhotoPlayedT3sUrl;
     private String adPhotoPlayedT3sUrl;
+    private String shortSlogan;
     /**
     /**
      * 创建时间
      * 创建时间
      */
      */

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

@@ -33,6 +33,7 @@
         site_id,
         site_id,
         programmed_creative_material,
         programmed_creative_material,
         photo_ids,
         photo_ids,
+        short_slogan,
         creative_create_time,
         creative_create_time,
         creative_update_time,
         creative_update_time,
         create_time,
         create_time,
@@ -70,6 +71,7 @@
             #{creative.siteId},
             #{creative.siteId},
             #{creative.programmedCreativeMaterial},
             #{creative.programmedCreativeMaterial},
             #{creative.photoIds},
             #{creative.photoIds},
+            #{creative.shortSlogan},
             #{creative.creativeCreateTime},
             #{creative.creativeCreateTime},
             #{creative.creativeUpdateTime},
             #{creative.creativeUpdateTime},
             #{creative.createTime},
             #{creative.createTime},

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

@@ -19,7 +19,7 @@
        on t1.account_id = t2.account_id
        on t1.account_id = t2.account_id
        and t1.photo_id = t2.photo_id
        and t1.photo_id = t2.photo_id
        where  t1.account_id = #{accountId}
        where  t1.account_id = #{accountId}
-       and status = 42
+       and t1.status = 42
        order by t1.creative_id desc
        order by t1.creative_id desc
     </select>
     </select>
 
 

+ 16 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java

@@ -1041,24 +1041,32 @@ public class BatchServiceImpl implements IBatchService {
                 creativeJson.put("advertiser_id", accountId);
                 creativeJson.put("advertiser_id", accountId);
                 creativeJson.put("unit_id", unitId);
                 creativeJson.put("unit_id", unitId);
 
 
-                // 素材类型
-                if (!Check.isNull(creative.getCreativeMaterialType())) {
-                    creativeJson.put("creative_material_type", creative.getCreativeMaterialType());
+
+                if (Check.isNull(creative.getCreativeMaterialType())) {
+                    continue;
+                }
+                creativeJson.put("creative_material_type", creative.getCreativeMaterialType());
+                if (creative.getCreativeMaterialType() == 4) {
+                    creativeJson.put("image_tokens", JSONArray.parseArray(creative.getImageTokens()));
+                    creativeJson.put("short_slogan", creative.getShortSlogan());
+
+                } else {
+                    String photo_id = creative.getPhotoId();
+                    creativeJson.put("photo_id", photo_id);
+                    String image = creative.getImageToken();
+                    creativeJson.put("image_token", image);
                 }
                 }
+
+
                 String action_bar_text = creative.getActionBarText();
                 String action_bar_text = creative.getActionBarText();
-                // 视频id
                 String click_track_url = creative.getClickTrackUrl();
                 String click_track_url = creative.getClickTrackUrl();
                 JSONArray successArr = new JSONArray();
                 JSONArray successArr = new JSONArray();
                 JSONArray failArr = new JSONArray();
                 JSONArray failArr = new JSONArray();
                 String description = creative.getDescription();
                 String description = creative.getDescription();
-                String photo_id = creative.getPhotoId();
-                String image = creative.getImageToken();
                 String name = creative.getCreativeName();
                 String name = creative.getCreativeName();
                 creativeJson.put("action_bar_text", action_bar_text);
                 creativeJson.put("action_bar_text", action_bar_text);
                 creativeJson.put("description", description.trim());
                 creativeJson.put("description", description.trim());
-                creativeJson.put("image_token", image);
                 creativeJson.put("creative_name", name);
                 creativeJson.put("creative_name", name);
-                creativeJson.put("photo_id", photo_id);
                 creativeJson.put("click_track_url", click_track_url);
                 creativeJson.put("click_track_url", click_track_url);
 
 
                 //封面广告语标题
                 //封面广告语标题
@@ -1087,10 +1095,7 @@ public class BatchServiceImpl implements IBatchService {
                         creativeJson.put("site_id", creative.getSiteId());
                         creativeJson.put("site_id", creative.getSiteId());
                     }
                     }
                 }
                 }
-
                 // 安卓下载中间页
                 // 安卓下载中间页
-
-
                 Map<String, Object> returnCreativeMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
                 Map<String, Object> returnCreativeMap = kuaishouInterfaceService.creativeCreate(oauthToken.getAccessToken(), accountId, creativeJson, 1);
                 if (!Check.isNullMap(returnCreativeMap)) {
                 if (!Check.isNullMap(returnCreativeMap)) {
                     Integer code = (Integer) returnCreativeMap.get("code");
                     Integer code = (Integer) returnCreativeMap.get("code");

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

@@ -215,6 +215,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                    creative.setShortSlogan(detailJson.getString("short_slogan"));
                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                     if (!Check.isNull(displayInfoJson)) {
                     if (!Check.isNull(displayInfoJson)) {
                         creative.setDescription(displayInfoJson.getString("description"));
                         creative.setDescription(displayInfoJson.getString("description"));

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

@@ -1347,6 +1347,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                    creative.setShortSlogan(detailJson.getString("short_slogan"));
                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                     if (!Check.isNull(displayInfoJson)) {
                     if (!Check.isNull(displayInfoJson)) {
                         creative.setDescription(displayInfoJson.getString("description"));
                         creative.setDescription(displayInfoJson.getString("description"));
@@ -1526,6 +1527,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                                    creative.setShortSlogan(detailJson.getString("short_slogan"));
                                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                                     if (!Check.isNull(displayInfoJson)) {
                                     if (!Check.isNull(displayInfoJson)) {
                                         creative.setDescription(displayInfoJson.getString("description"));
                                         creative.setDescription(displayInfoJson.getString("description"));
@@ -3050,6 +3052,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                                     creative.setCreativeCreateTime(detailJson.getDate("create_time"));
                                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                                     creative.setCreativeUpdateTime(detailJson.getDate("update_time"));
                                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
                                     creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                                    creative.setShortSlogan(detailJson.getString("short_slogan"));
                                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                                     JSONObject displayInfoJson = detailJson.getJSONObject("display_info");
                                     if (!Check.isNull(displayInfoJson)) {
                                     if (!Check.isNull(displayInfoJson)) {
                                         creative.setDescription(displayInfoJson.getString("description"));
                                         creative.setDescription(displayInfoJson.getString("description"));