浏览代码

素材库改版

yumeng 3 年之前
父节点
当前提交
42acd3dfd8

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -197,4 +197,7 @@ public class MaterialInfo implements Serializable {
     private Integer offlineFlag;
 
     private Date confirmTime;
+    private Integer innovate;
+    private Integer syncKuaishou;
+    private Integer syncBytedance;
 }

文件差异内容过多而无法显示
+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java


+ 6 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -153,6 +153,12 @@
         <if test="endDate != null and endDate != '' ">
             and matInfo.create_time &lt;= #{endDate}
         </if>
+        <if test="syncKuaishou != null and syncKuaishou != '' ">
+            and matInfo.sync_Kuaishou = #{syncKuaishou}
+        </if>
+        <if test="syncBytedance != null and syncBytedance != '' ">
+            and matInfo.sync_bytedance = #{syncBytedance}
+        </if>
         <if test="offlineFlag!=null">
             and matInfo.offline_flag = #{offlineFlag}
         </if>

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -81,7 +81,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     JSONArray getIdListByProject(Long projectId);
 
-    Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, String leaderName,Integer offlineFlag, Integer pageNo, Integer pageSize);
+    Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, String leaderName,Integer offlineFlag, Integer pageNo, Integer pageSize,Integer syncKuaishou,Integer syncBytedance);
 
     void correlationUploadV2(JSONObject json);
 

+ 6 - 22
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -485,7 +485,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     private IProjectService projectService;
 
     public static void main(String[] args) {
-        String url= "https://media-1301855440.cos.ap-chongqing.myqcloud.com/video/2021-09-06/%E4%BA%8C%E5%89%AA-%E5%A4%A9%E5%A4%A9%E4%B8%80%E5%85%83%E8%B4%AD-%E7%BA%B8%E6%8A%BD%E8%BD%AE%E6%92%AD-%E9%87%91%E7%A7%8B-H-%E5%AE%98%E4%B9%89%E5%BE%B7%E7%BB%84-0906-1630926514799.mp4";
+        String url = "https://media-1301855440.cos.ap-chongqing.myqcloud.com/video/2021-09-06/%E4%BA%8C%E5%89%AA-%E5%A4%A9%E5%A4%A9%E4%B8%80%E5%85%83%E8%B4%AD-%E7%BA%B8%E6%8A%BD%E8%BD%AE%E6%92%AD-%E9%87%91%E7%A7%8B-H-%E5%AE%98%E4%B9%89%E5%BE%B7%E7%BB%84-0906-1630926514799.mp4";
         String fileName = AesEncryptUtil.getUrlDecoderString(url.substring(url.lastIndexOf("/") + 1));
         String fileNameNoEx = StringUtils.getFileNameNoEx(fileName);
         if (fileNameNoEx.contains("-")) {
@@ -493,6 +493,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         }
         System.out.println(fileNameNoEx);
     }
+
     /**
      * 素材库关联上传素材 1
      *
@@ -528,7 +529,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             if (fileNameNoEx.contains("-")) {
                 fileNameNoEx = fileNameNoEx.substring(0, fileNameNoEx.lastIndexOf("-"));
             }
-
+            info.setInnovate(json.getInteger("innovate"));
             info.setMaterialName(fileNameNoEx);
             info.setWatermarkMaterialName(json.getString("watermarkMaterialName"));
             info.setMaterialDescribe(json.getString("materialDescribe"));
@@ -681,6 +682,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             info.setMaterialDescribe(json.getString("materialDescribe"));
             info.setCreateTime(new Date());
             info.setUpdateTime(new Date());
+            info.setInnovate(json.getInteger("innovate"));
             info.setType(type);
 
             if (!Check.isNull(project.getSupplierCode())) {
@@ -943,25 +945,21 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
 
     @Override
-    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, String leaderName, Integer offlineFlag, Integer pageNo, Integer pageSize) {
+    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, String leaderName, Integer offlineFlag, Integer pageNo, Integer pageSize, Integer syncKuaishou, Integer syncBytedance) {
         Map<String, Object> result = new HashMap<>();
         PageHelper.startPage(pageNo, pageSize);
-
         String ascription = null;
         //剪辑 || 拍摄 || 策划 || 设计
         if (!Check.isNull(clipId) || !Check.isNull(shotId) || !Check.isNull(planId) || !Check.isNull(leaderName)) {
             ascription = "true";
         }
-
         if (!Check.isNull(startDate)) {
             startDate = startDate + " 00:00:01";
         }
-
         if (!Check.isNull(endDate)) {
             endDate = endDate + " 23:59:59";
         }
-
-        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, ascription, clipId, shotId, planId, leaderName, offlineFlag);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, ascription, clipId, shotId, planId, leaderName, offlineFlag, syncKuaishou, syncBytedance);
         List<MaterialInfo> setList = new ArrayList<>();
         PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
         if (!dailyList.isEmpty()) {
@@ -972,20 +970,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                 materialInfo.setConfirmTime(info.getConfirmTime());
                 //素材名称为空 则使用素材id 同步失败
                 materialInfo.setMaterialName(Check.isNull(materialInfo.getMaterialName()) ? materialInfo.getId() : materialInfo.getMaterialName());
-                //判断是否已经同步到快手平台
-                Integer kuaishouMaterialUpCount = this.getKuaishouUpVideoCount(info.getCode());
-                if (kuaishouMaterialUpCount > 0) {
-                    materialInfo.setKuaishouVideoIsUp(1);
-                } else {
-                    materialInfo.setKuaishouVideoIsUp(0);
-                }
-                //判断是否已经同步到抖音平台
-                Integer toutiaoMaterialUpCount = this.getToutiaoUpVideoCount(info.getCode());
-                if (toutiaoMaterialUpCount > 0) {
-                    materialInfo.setToutiaoVideoIsUp(1);
-                } else {
-                    materialInfo.setToutiaoVideoIsUp(0);
-                }
                 //统计快手总消耗数据
                 JSONObject kuaishous = materialParameterMapper.getMaterialTotalCharge(info.getCode());
                 if (!Check.isNull(kuaishous)) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java

@@ -42,7 +42,7 @@ import java.util.concurrent.Executors;
 @Slf4j
 @Service
 public class MaterialUploadServiceImpl implements IMaterialUploadService {
-    static ExecutorService kuaiShouExecutorService = Executors.newFixedThreadPool(5);
+    static ExecutorService kuaiShouExecutorService = Executors.newFixedThreadPool(3);
     static ExecutorService touTiaoExecutorService = Executors.newFixedThreadPool(5);
     @Value("${oss.replace.download}")
     private String downloadUrl;

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

@@ -12,7 +12,6 @@ import cn.com.ctop.toutiao.modules.material.service.IBytedanceVideoSlogenInfoSer
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
@@ -124,30 +123,31 @@ public class MaterialInfoController {
 
     /**
      * 修改名称
+     *
      * @param data
      * @return
      */
     @PostMapping("/editName")
     public Map<String, Object> editName(@RequestBody JSONObject data) {
-        Map<String,Object>result = new HashMap<>();
+        Map<String, Object> result = new HashMap<>();
         String id = data.getString("id");
         String name = data.getString("name");
-        if(null == id||"".equals(id.trim())||null == name||"".equals(name.trim())){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+        if (null == id || "".equals(id.trim()) || null == name || "".equals(name.trim())) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         MaterialInfo info = materialInfoService.getById(id);
-        if(null == info){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_DATA_NOT_EXIST);
+        if (null == info) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_DATA_NOT_EXIST);
             return result;
         }
-        if(info.getStatus() == 1){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_DATA_NO_PERMMISSION);
+        if (info.getStatus() == 1) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_DATA_NO_PERMMISSION);
             return result;
         }
         info.setMaterialName(name);
         materialInfoService.updateById(info);
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
@@ -323,8 +323,10 @@ public class MaterialInfoController {
     @GetMapping(value = "/listV2")
     public Map<String, Object> queryPageList(String type, Integer status, Long productId, String materialName, String code,
                                              String startDate, String endDate, String tagCode,
-                                             Long projectId, String clipId, String shotId, String planId,String leaderName,
+                                             Long projectId, String clipId, String shotId, String planId, String leaderName,
+                                             Integer syncKuaishou, Integer syncBytedance,
                                              @RequestParam(name = "offlineFlag", required = false) Integer offlineFlag,
+
                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -342,7 +344,7 @@ public class MaterialInfoController {
                 List<Long> projectIdsByProductId = projectService.getProjectIdsByProductId(productId);
                 projectIds.addAll(projectIdsByProductId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId,leaderName, offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, leaderName, offlineFlag, pageNo, pageSize, syncKuaishou, syncBytedance);
             //运营经理、运营、运营助理
         } else if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
             if (!Check.isNull(projectId)) {
@@ -358,9 +360,9 @@ public class MaterialInfoController {
                 projectIds.addAll(partakeProjectIds);
                 projectIds.addAll(productProjectIds);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, leaderName,offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, leaderName, offlineFlag, pageNo, pageSize, syncKuaishou, syncBytedance);
 
-        } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)||"clip".equals(roleCode)) {
+        } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode) || "clip".equals(roleCode)) {
             //查询自己所在项目下的数据
             if (!Check.isNull(projectId)) {
                 projectIds.add(projectId);
@@ -369,7 +371,7 @@ public class MaterialInfoController {
             } else {
                 projectIds = projectMemberService.getProjectIdsByProductId(null, userId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, leaderName,offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, leaderName, offlineFlag, pageNo, pageSize, syncKuaishou, syncBytedance);
         } else {
             //查询自己上传的视频
             if (!Check.isNull(projectId)) {
@@ -377,7 +379,7 @@ public class MaterialInfoController {
             } else if (!Check.isNull(productId)) {
                 projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, userId, clipId, shotId, planId,leaderName, offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, userId, clipId, shotId, planId, leaderName, offlineFlag, pageNo, pageSize, syncKuaishou, syncBytedance);
         }
     }