yumeng 5 năm trước cách đây
mục cha
commit
0d6b2a7edb

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

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.MaterialInfo;
 import cn.com.ctop.common.module.service.IMaterialInfoService;
 import cn.com.ctop.common.module.service.IMaterialInfoService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -68,16 +69,18 @@ public class MaterialInfoController {
         return materialInfoService.getDetail(materialId);
         return materialInfoService.getDetail(materialId);
 
 
     }
     }
+
     @PostMapping("watermark")
     @PostMapping("watermark")
-    public Result<Object> watermarkVideo(@RequestParam(name = "id")String id,@RequestParam(name = "watermarkTemplateId")Integer watermarkTemplateId){
+    public Result<Object> watermarkVideo(@RequestParam(name = "id") String id, @RequestParam(name = "watermarkTemplateId") Integer watermarkTemplateId) {
         Result<Object> result = new Result<>();
         Result<Object> result = new Result<>();
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        materialInfoService.watermarkVideo(id,watermarkTemplateId,sysUser.getId());
+        materialInfoService.watermarkVideo(id, watermarkTemplateId, sysUser.getId());
         result.setCode(200);
         result.setCode(200);
         result.setSuccess(true);
         result.setSuccess(true);
         result.setMessage("水印合成任务执行成功,请稍后查看");
         result.setMessage("水印合成任务执行成功,请稍后查看");
         return result;
         return result;
     }
     }
+
     /**
     /**
      * 分页列表查询
      * 分页列表查询
      *
      *
@@ -142,6 +145,39 @@ public class MaterialInfoController {
         return result;
         return result;
     }
     }
 
 
+
+    /**
+     * 批量修改项目
+     *
+     * @param jsonObject
+     * @return
+     */
+    @PostMapping(value = "/batchEdit")
+    public Result<MaterialInfo> batchEdit(@RequestBody JSONObject jsonObject) {
+        Result<MaterialInfo> result = new Result<>();
+        try {
+            Long projectId = jsonObject.getLong("projectId");
+            JSONArray materialIds = jsonObject.getJSONArray("materialIds");
+            for (int i = 0; i < materialIds.size(); i++) {
+                String materialId = materialIds.getString(i);
+                MaterialInfo updateMaterial = new MaterialInfo();
+                updateMaterial.setId(materialId);
+                updateMaterial.setProjectId(projectId);
+                materialInfoService.updateById(updateMaterial);
+
+            }
+            result.setSuccess(true);
+            result.success("修改成功!");
+        } catch (Exception e) {
+            result.setSuccess(false);
+        }
+
+
+        return result;
+
+    }
+
+
     /**
     /**
      * 编辑
      * 编辑
      *
      *

+ 4 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/EffiVideoJob.java

@@ -1,16 +1,13 @@
 package org.jeecg.modules.ctop.job;
 package org.jeecg.modules.ctop.job;
 
 
 
 
-
-import org.jeecg.modules.system.service.IPerformanceService;
 import org.quartz.Job;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
 
 
 public class EffiVideoJob implements Job {
 public class EffiVideoJob implements Job {
-    @Autowired
-    private IPerformanceService performanceService;
+  /*  @Autowired
+    private IPerformanceService performanceService;*/
 
 
     /**
     /**
      * 获取有效视频以及对应人的定时任务
      * 获取有效视频以及对应人的定时任务
@@ -20,7 +17,7 @@ public class EffiVideoJob implements Job {
      */
      */
     @Override
     @Override
     public void execute(JobExecutionContext jobExecutionContext) {
     public void execute(JobExecutionContext jobExecutionContext) {
-        performanceService.efficientVideoTask(2);
-        performanceService.efficientVideoTask(1);
+      /*  performanceService.efficientVideoTask(2);
+        performanceService.efficientVideoTask(1);*/
     }
     }
 }
 }

+ 8 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java

@@ -17,24 +17,24 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 
 import java.io.IOException;
 import java.io.IOException;
 import java.util.List;
 import java.util.List;
-import java.util.UUID;
 
 
 public class MergeVideoJob implements Job {
 public class MergeVideoJob implements Job {
     @Autowired
     @Autowired
     private IVideoMergeTaskService videoMergeTaskService;
     private IVideoMergeTaskService videoMergeTaskService;
     @Autowired
     @Autowired
     private IMaterialInfoService materialInfoService;
     private IMaterialInfoService materialInfoService;
+
     @Override
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         QueryWrapper<VideoMergeTask> queryWrapper = new QueryWrapper<>();
         QueryWrapper<VideoMergeTask> queryWrapper = new QueryWrapper<>();
-        queryWrapper.in("status","Submitted","Transcoding");
+        queryWrapper.in("status", "Submitted", "Transcoding");
         List<VideoMergeTask> list = videoMergeTaskService.list(queryWrapper);
         List<VideoMergeTask> list = videoMergeTaskService.list(queryWrapper);
-        if(list != null && list.size() > 0){
-            for (VideoMergeTask videoMergeTask : list){
+        if (list != null && list.size() > 0) {
+            for (VideoMergeTask videoMergeTask : list) {
                 MpsUtils mpsUtils = new MpsUtils();
                 MpsUtils mpsUtils = new MpsUtils();
                 QueryJobListResponse.Job job = mpsUtils.getJobStatus(videoMergeTask.getJobId());
                 QueryJobListResponse.Job job = mpsUtils.getJobStatus(videoMergeTask.getJobId());
-                if (job.getState().equals("TranscodeSuccess")){
-                    String url = "https://ctop-part.oss-cn-beijing.aliyuncs.com/"+job.getOutput().getOutputFile().getObject();
+                if (job.getState().equals("TranscodeSuccess")) {
+                    String url = "https://ctop-part.oss-cn-beijing.aliyuncs.com/" + job.getOutput().getOutputFile().getObject();
 
 
                     try {
                     try {
                         String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
                         String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
@@ -48,9 +48,9 @@ public class MergeVideoJob implements Job {
                         materialInfo.setUserId(videoMergeTask.getUserId());
                         materialInfo.setUserId(videoMergeTask.getUserId());
                         materialInfo.setStatus(0);
                         materialInfo.setStatus(0);
                         materialInfo.setType("VIDEO");
                         materialInfo.setType("VIDEO");
-                        materialInfo.setMaterialName("合成"+ DateUtils.getMillis());
+                        materialInfo.setMaterialName("合成" + DateUtils.getMillis());
                         materialInfoService.saveOrUpdate(materialInfo);
                         materialInfoService.saveOrUpdate(materialInfo);
-                        materialInfoService.getFile(materialInfo);
+                        // materialInfoService.getFile(materialInfo);
                         videoMergeTask.setVideoUrl(url);
                         videoMergeTask.setVideoUrl(url);
                         videoMergeTask.setStatus(job.getState());
                         videoMergeTask.setStatus(job.getState());
                         videoMergeTask.setVideoId(materialInfo.getId());
                         videoMergeTask.setVideoId(materialInfo.getId());

+ 43 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/controller/FileController.java

@@ -1,6 +1,10 @@
 package org.jeecg.modules.fileupload.controller;
 package org.jeecg.modules.fileupload.controller;
 
 
 import cn.com.ctop.common.module.service.IMaterialInfoService;
 import cn.com.ctop.common.module.service.IMaterialInfoService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.system.vo.LoginUser;
@@ -10,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -35,4 +40,42 @@ public class FileController {
         json.put("userId", user.getId());
         json.put("userId", user.getId());
         return materialInfoService.insert(json);
         return materialInfoService.insert(json);
     }
     }
+
+
+    @PostMapping("file/batchInsert")
+    public Map<String, Object> batchInsert(@RequestBody JSONObject json) {
+
+
+        Map<String, Object> resultMap = new HashMap<>();
+
+
+        try {
+            LoginUser user = (LoginUser) SecurityUtils.getSubject()
+                    .getPrincipal();
+            json.put("userId", user.getId());
+            JSONArray videoArr = json.getJSONArray("videoArr");
+            if (!Check.isNull(videoArr)) {
+                json.remove("videoArr");
+
+                for (int i = 0; i < videoArr.size(); i++) {
+                    JSONObject video = videoArr.getJSONObject(i);
+                    json.put("code", video.getString("code"));
+                    json.put("url", video.getString("url"));
+                    materialInfoService.insert(json);
+
+                }
+            }
+
+            ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
+
+        } catch (Exception e) {
+            ResultMapUtils.setResultMap(resultMap, StatusCode.MATERIAL_UPLOAD_FAIL.getCode());
+            e.printStackTrace();
+        }
+
+
+        return resultMap;
+    }
+
+
 }
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService.java

@@ -11,5 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @date 2019-12-10
  * @date 2019-12-10
  */
  */
 public interface IPerformanceService extends IService<Performance> {
 public interface IPerformanceService extends IService<Performance> {
-    void efficientVideoTask(int days);
+   //  void efficientVideoTask(int days);
 }
 }

+ 9 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl.java

@@ -1,3 +1,4 @@
+/*
 package org.jeecg.modules.system.service.impl;
 package org.jeecg.modules.system.service.impl;
 
 
 import cn.com.ctop.performanceappraisal.entity.OptimizerConfig;
 import cn.com.ctop.performanceappraisal.entity.OptimizerConfig;
@@ -25,13 +26,15 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
+*/
 /**
 /**
  * 设计师季度绩效表
  * 设计师季度绩效表
  *
  *
  * @author jeecg-boot
  * @author jeecg-boot
  * @version V1.0
  * @version V1.0
  * @date 2019-12-10
  * @date 2019-12-10
- */
+ *//*
+
 @Service
 @Service
 public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Performance> implements IPerformanceService {
 public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Performance> implements IPerformanceService {
 
 
@@ -127,7 +130,8 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
         }
         }
     }
     }
 
 
-    /**
+    */
+/**
      * 分平台:快手、抖音
      * 分平台:快手、抖音
      *
      *
      * 编导、剪辑、拍摄:
      * 编导、剪辑、拍摄:
@@ -147,7 +151,8 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
      * 2.查询出所有设计部门的代码,并找出每部门的leader,和部门下所有人员
      * 2.查询出所有设计部门的代码,并找出每部门的leader,和部门下所有人员
      * 3.根据编导(或剪辑、拍摄)算出素材的总消耗
      * 3.根据编导(或剪辑、拍摄)算出素材的总消耗
      * 4.根据部门当中是否有平面设计师来判断提成绩效。有平面,按照15%计算;没有按照20%计算
      * 4.根据部门当中是否有平面设计师来判断提成绩效。有平面,按照15%计算;没有按照20%计算
-     */
+     *//*
+
     //季度定时任务(在有效视频绑定人定时任务之后跑):设计师绩效计算-----包括快手和头条的计算逻辑
     //季度定时任务(在有效视频绑定人定时任务之后跑):设计师绩效计算-----包括快手和头条的计算逻辑
     public void designerPerformanceTask(){
     public void designerPerformanceTask(){
         kuaishouDesigner();//快手
         kuaishouDesigner();//快手
@@ -534,3 +539,4 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
 
 
 
 
 }
 }
+*/

+ 4 - 3
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/ProjectDTO.java

@@ -2,11 +2,12 @@ package cn.com.ctop.userefficientvideomap.entity;
 
 
 import lombok.Data;
 import lombok.Data;
 
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
 
 
 @Data
 @Data
-public class ProjectDTO {
-	private Long projectId;
-	private BigDecimal projectName;
+public class ProjectDTO implements Serializable {
+    private Long projectId;
+    private BigDecimal projectName;
 }
 }

+ 18 - 18
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/UserEfficientVideoMapMapper.java

@@ -1,48 +1,48 @@
 package cn.com.ctop.userefficientvideomap.mapper;
 package cn.com.ctop.userefficientvideomap.mapper;
 
 
-import java.math.BigDecimal;
-import java.util.List;
-
 import cn.com.ctop.userefficientvideomap.entity.EffiVideoDTO;
 import cn.com.ctop.userefficientvideomap.entity.EffiVideoDTO;
 import cn.com.ctop.userefficientvideomap.entity.ProjectDTO;
 import cn.com.ctop.userefficientvideomap.entity.ProjectDTO;
-import org.apache.ibatis.annotations.Param;
 import cn.com.ctop.userefficientvideomap.entity.UserEfficientVideoMap;
 import cn.com.ctop.userefficientvideomap.entity.UserEfficientVideoMap;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
+import java.math.BigDecimal;
+import java.util.List;
+
 /**
 /**
  * 有效视频与角色对应表
  * 有效视频与角色对应表
+ *
  * @author: jeecg-boot
  * @author: jeecg-boot
- * @date:   2019-12-16
+ * @date: 2019-12-16
  * @cersion: V1.0
  * @cersion: V1.0
  */
  */
 @Component
 @Component
 public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVideoMap> {
 public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVideoMap> {
 
 
-    List<EffiVideoDTO> getUserVideoMap(@Param("startDate")String startDate, @Param("endDate")String endDate);
-
-    int getEffiVideoCountBySignature(@Param("signature")String signature);
+    List<EffiVideoDTO> getUserVideoMap(@Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
-    int getEffiVideoCountByUserId(@Param("year")int year, @Param("quarter")int quarter, @Param("userId")String userId);
+    int getEffiVideoCountBySignature(@Param("signature") String signature);
 
 
-    int getQuarterMaterialCountByUserId(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("userId")String userId);
+    int getEffiVideoCountByUserId(@Param("year") int year, @Param("quarter") int quarter, @Param("userId") String userId);
 
 
-    BigDecimal getTotalCostByClipId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    int getQuarterMaterialCountByUserId(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") String userId);
 
 
-    BigDecimal getTotalCostByShotId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    BigDecimal getTotalCostByClipId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
-    BigDecimal getTotalCostByPlanId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    BigDecimal getTotalCostByShotId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
-    BigDecimal getTotalCostByPlaneId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    BigDecimal getTotalCostByPlanId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
-    BigDecimal getProjectTotalCostByUserId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    BigDecimal getTotalCostByPlaneId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
-    List<ProjectDTO> getProjectsByUserId(@Param("userId")String userId);
+    BigDecimal getProjectTotalCostByUserId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
 
-    int getPlaneCountByProjectId(@Param("projectId")Long projectId);
+    List<ProjectDTO> getProjectsByUserId(@Param("userId") String userId);
 
 
-    int getPlaneCountByUserId(@Param("userId")String userId);
+    int getPlaneCountByProjectId(@Param("projectId") Long projectId);
 
 
+    int getPlaneCountByUserId(@Param("userId") String userId);
 
 
 
 
 }
 }

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml

@@ -144,7 +144,7 @@
     </select>
     </select>
 
 
     <!-- 获取这个人所在的所有项目 -->
     <!-- 获取这个人所在的所有项目 -->
-    <select id="getProjectsByUserId" resultType="cn.com.ctop.userefficientvideomap.entity.ProjectDTO ">
+    <select id="getProjectsByUserId" resultType="cn.com.ctop.userefficientvideomap.entity.ProjectDTO">
         select
         select
         project_id as projectId,
         project_id as projectId,
         project_name as projectName
         project_name as projectName