Forráskód Böngészése

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

syh 5 éve
szülő
commit
b6856ef704
15 módosított fájl, 1171 hozzáadás és 78 törlés
  1. 8 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  2. 1 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  3. 20 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java
  4. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService2.java
  5. 410 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java
  6. 12 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  7. 8 0
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserEfficientVideoMap.java
  8. 66 24
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/UserEfficientVideoMapMapper.java
  9. 258 12
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml
  10. 243 0
      performance-appraisal/src/main/java/cn/com/ctop/uservideomap/controller/UserVideoMapController.java
  11. 87 0
      performance-appraisal/src/main/java/cn/com/ctop/uservideomap/entity/UserVideoMap.java
  12. 17 0
      performance-appraisal/src/main/java/cn/com/ctop/uservideomap/mapper/UserVideoMapMapper.java
  13. 5 0
      performance-appraisal/src/main/java/cn/com/ctop/uservideomap/mapper/xml/UserVideoMapMapper.xml
  14. 14 0
      performance-appraisal/src/main/java/cn/com/ctop/uservideomap/service/IUserVideoMapService.java
  15. 19 0
      performance-appraisal/src/main/java/cn/com/ctop/uservideomap/service/impl/UserVideoMapServiceImpl.java

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

@@ -2,10 +2,7 @@ package org.jeecg.modules.ctop.controller;
 
 
 import cn.com.ctop.common.module.entity.MaterialInfo;
-import cn.com.ctop.common.module.service.IMaterialAscriptionService;
-import cn.com.ctop.common.module.service.IMaterialInfoService;
-import cn.com.ctop.common.module.service.IMaterialParameterService;
-import cn.com.ctop.common.module.service.IMaterialTagService;
+import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
@@ -76,6 +73,8 @@ public class MaterialInfoController {
     private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
     @Autowired
     private IKuaiShouCleanMaterialReportService kuaiShouCleanMaterialReportService;
+    @Autowired
+    private IVideoWatermarkTaskService watermarkTaskService;
 
     @GetMapping(value = "/report")
     public JSONObject report(String userId) {
@@ -333,6 +332,7 @@ public class MaterialInfoController {
 
     }
 
+
     /**
      * 通过id删除
      *
@@ -347,10 +347,13 @@ public class MaterialInfoController {
             materialInfoService.removeById(id);
             Map<String, Object> deleteMap = new HashMap<>();
             deleteMap.put("material_id", id);
-
             materialAscriptionService.removeByMap(deleteMap);
             materialParameterService.removeByMap(deleteMap);
             materialTagService.removeByMap(deleteMap);
+            Map<String, Object> deleteWatermarkMap = new HashMap<>();
+            deleteWatermarkMap.put("video_id", id);
+            watermarkTaskService.removeByMap(deleteWatermarkMap);
+
         } catch (Exception e) {
             log.error("删除失败", e.getMessage());
             return Result.error("删除失败!");

+ 1 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java

@@ -40,13 +40,12 @@ public class WatermarkVideoJob implements Job {
 
                             try {
                                 String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-                                //                        String localPath = LoadFileUtil.downLoadFromUrl(url,"D:/video/");
-                                String md5 = LoadFileUtil.getMD5(localPath);
                                 LoadFileUtil.delFile(localPath);
                                 QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
                                 materialInfoQueryWrapper.eq("watermark_code", job.getJobId());
                                 MaterialInfo materialInfo = materialInfoService.getOne(materialInfoQueryWrapper);
                                 if (Check.isNull(materialInfo)) {
+                                    videoWaterMarkService.removeById(videoWatermarkTask.getId());
                                     continue;
 
                                 }

+ 20 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java

@@ -140,7 +140,7 @@ public class PerformanceController2 {
 
     @AutoLog(value = "有效视频定时任务")
     @ApiOperation(value = "有效视频定时任务", notes = "calcDate传递yyyy-MM-dd格式的日期")
-    @PostMapping(value = "/efficientVideo")
+    @GetMapping(value = "/efficientVideo")
     public Result<Map<String, Object>> efficientVideo(@RequestParam(name = "calcDate", required = true) String calcDate) {
         log.info("有效视频任务开始,有效视频所属时间为" + calcDate);
         Result<Map<String, Object>> result = new Result<Map<String, Object>>();
@@ -535,6 +535,25 @@ public class PerformanceController2 {
         return result;
     }
 
+    @AutoLog(value = "获取相关视频列表")
+    @ApiOperation(value = "获取相关视频列表", notes = "获取相关视频列表")
+    @PostMapping(value = "/getVideoList")
+    public Result<List<MaterialInfo>> getVideoList(@RequestBody PerformanceTimeDTO dto,
+                                                       HttpServletRequest req) {
+        Result<List<MaterialInfo>> result = new Result<>();
+        String userId = dto.getUserId();
+        String startDate = dto.getStartDate();
+        String endDate = dto.getEndDate();
+        if(userId==null || startDate == null || endDate == null){
+            result.setSuccess(false);
+            result.setMessage("userId和时间不能为空");
+        }
+        List<MaterialInfo> materialInfoList = performanceService.getVideoList(userId, startDate, endDate);
+        result.setSuccess(true);
+        result.setResult(materialInfoList);
+        return result;
+    }
+
     @AutoLog(value = "获取本周相关有效视频列表")
     @ApiOperation(value = "获取本周相关有效视频列表", notes = "获取本周相关有效视频列表")
     @PostMapping(value = "/getWeekEffiVideoList")

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService2.java

@@ -90,6 +90,9 @@ public interface IPerformanceService2 extends IService<Performance> {
     //获取有效视频列表
     List<MaterialInfo> effiVideoList(Integer appType, Integer year, Integer quarter, String userId);
 
+    //获取有效视频列表
+    List<MaterialInfo> getVideoList(String userId, String startDate, String endDate);
+
     List<MaterialInfo> getEffiWeekVideoList(Integer appType, String startDate, String endDate, String userId);
 
     //获取快手优化师绩效实时数据

+ 410 - 34
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java

@@ -7,7 +7,10 @@ import cn.com.ctop.planeprojectcost.entity.PlaneProjectCost;
 import cn.com.ctop.planeprojectcost.mapper.PlaneProjectCostMapper;
 import cn.com.ctop.userefficientvideomap.entity.*;
 import cn.com.ctop.userefficientvideomap.mapper.UserEfficientVideoMapMapper;
+import cn.com.ctop.uservideomap.entity.UserVideoMap;
+import cn.com.ctop.uservideomap.mapper.UserVideoMapMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.micrometer.core.instrument.util.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
@@ -42,6 +45,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
     private SysRoleMapper sysRoleMapper;
     @Autowired
     private PlaneProjectCostMapper planeProjectCostMapper;
+    @Autowired
+    private UserVideoMapMapper userVideoMapMapper;
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //有效视频计算开始
@@ -71,9 +76,12 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             e.printStackTrace();
         }
         //传入时间,获取对应的年份
-        Date friday = DateUtils.getFriday(calcDate);
+        Date friday = DateUtils.getFriday(calcDate); //周的第一天
+        Date thursday = DateUtils.addDay(friday, 6); //周的最后一天
         String effiCalcStart = DateUtils.formatDate(DateUtils.addDay(friday, -14)); //计算有效视频开始的时间
-        log.info("有效视频统计的开始时间为" + effiCalcStart);
+        log.info("有效视频统计的开始时间,同时也是有效视频第一周开始时间为" + effiCalcStart);
+        String effiFirstWeekCalcEnd = DateUtils.formatDate(DateUtils.addDay(friday, -8)); //计算有效视频第一周结束时间
+        log.info("有效视频第一周结束时间为" + effiCalcStart);
         String effiCalcEnd = DateUtils.formatDate(DateUtils.addDay(friday, -1)); //计算有效视频结束的时间
         log.info("有效视频统计的结束时间为" + effiCalcEnd);
         String effiStart = DateUtils.formatDate(DateUtils.addDay(friday, -21)); //有效视频发布开始时间
@@ -89,10 +97,13 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         int thisQuarter = yearQuarterMap.get("quarter"); //获取当天所在周所在的季度
         log.info("统计时间所在年" + thisYear + "月" + thisMonth + "季" + thisQuarter);
 
-        //快手有效视频
-        kuaishouEffiVideo(calcDate, effiCalcStart, effiCalcEnd, effiStart, effiEnd, thisYear, thisMonth, thisQuarter);
+        //快手有效视频(新)
+        kuaishouNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
         //头条有效视频
-        toutiaoEffiVideo(calcDate, effiCalcStart, effiCalcEnd, effiStart, effiEnd, thisYear, thisMonth, thisQuarter);
+        //toutiaoNewEffiVideo(calcDate, effiCalcStart, effiFirstWeekCalcEnd, thisYear, thisMonth, thisQuarter, DateUtils.formatDate(friday), DateUtils.formatDate(thursday));
+
+        //总视频
+        //kuaishouNewVideo( calcDate,  thisYear,  thisQuarter,  thisMonth, DateUtils.formatDate(friday),  DateUtils.formatDate(thursday));
     }
 
     //快手有效视频统计
@@ -242,6 +253,352 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //新有效视频计算开始
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //快手有效视频统计
+    private void kuaishouNewEffiVideo(Date calcDate, String effiCalcStart, String effiFirstWeekCalcEnd, int thisYear, int thisMonth, int thisQuarter, String friday, String thursday) {
+        log.info("快手有效视频统计开始,统计时间为 " + calcDate);
+        //List<EffiVideoDTO> effiList = new ArrayList<>();
+        Integer appType = 2;
+
+        //1.计算第一周(周五-下周周四)所有有消耗得md5
+        List<String> md5List = userEfficientVideoMapMapper.getWeekCostMd5(effiCalcStart, effiFirstWeekCalcEnd);
+        //2.排除第一周之前产生消耗的md5以及14天内消耗<5000的md5
+        for (String md5:md5List){
+            //有效视频去重--如果之前在对应的媒体中存在的话就跳过
+            int signatureCount = userEfficientVideoMapMapper.getEffiVideoCountBySignature(md5, appType);//1头条 2快手
+            if (signatureCount != 0) {
+                continue;
+            }
+
+            Integer count = userEfficientVideoMapMapper.beforeWeekCostCount(md5, effiCalcStart);
+            //如果第一周之前就有消耗的话排除
+            if(count>0){
+                continue;
+            }
+            String videoEarlistCostDate = userEfficientVideoMapMapper.getVideoEarlistCostDate(md5);
+            String videoEndCostDate = null;
+            try {
+               videoEndCostDate = DateUtils.formatDate(DateUtils.addDay(videoEarlistCostDate, 13)); //有效视频发布开始时间
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            //如果从产生消耗开始时间14天内总消耗<5000,则排除掉
+            BigDecimal videoTotalCost = userEfficientVideoMapMapper.videoTotalCostInDates(md5, videoEarlistCostDate, videoEndCostDate);
+            if( (videoTotalCost.subtract(new BigDecimal("5000"))).compareTo(BigDecimal.ZERO) < 0){
+                continue;
+            }
+
+            //获取该视频的编导、剪辑、拍摄、平面等信息
+            EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
+            if(effiVideoDTO == null){
+                effiVideoDTO = new EffiVideoDTO();
+            }
+            effiVideoDTO.setSignature(md5);
+            effiVideoDTO.setCharge(videoTotalCost);
+
+            String companyId = null;
+            //根据编导id获取视频所属分公司
+            if( StringUtils.isNotBlank(effiVideoDTO.getPlanId()) ) {
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId(effiVideoDTO.getPlanId());
+            }else if( StringUtils.isNotBlank(effiVideoDTO.getClipId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getClipId() );
+            }else if( StringUtils.isNotBlank(effiVideoDTO.getShotId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getShotId() );
+            }else if ( StringUtils.isNotBlank(effiVideoDTO.getPlaneId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getPlaneId() );
+            }
+            //
+
+            UserEfficientVideoMap shot = new UserEfficientVideoMap();
+            UserEfficientVideoMap plane = new UserEfficientVideoMap();
+            UserEfficientVideoMap plan = new UserEfficientVideoMap();
+            UserEfficientVideoMap clip = new UserEfficientVideoMap();
+
+            //拍摄
+            shot.setUserId(effiVideoDTO.getShotId());
+            shot.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            shot.setQuarter(thisQuarter);
+            shot.setAppType(appType); //1头条 2快手
+            shot.setYear(thisYear);
+            shot.setMonth(thisMonth);
+            shot.setCalcDate(calcDate);
+            shot.setRoleId("shot");
+            shot.setWeekStart(friday);
+            shot.setWeekEnd(thursday);
+            shot.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(shot);
+
+            //平面
+            plane.setUserId(effiVideoDTO.getPlaneId());
+            plane.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            plane.setQuarter(thisQuarter);
+            plane.setAppType(appType); //1头条 2快手
+            plane.setYear(thisYear);
+            plane.setMonth(thisMonth);
+            plane.setCalcDate(calcDate);
+            plane.setRoleId("plane");
+            plane.setWeekStart(friday);
+            plane.setWeekEnd(thursday);
+            plane.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(plane);
+
+            //编导
+            plan.setUserId(effiVideoDTO.getPlanId());
+            plan.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            plan.setQuarter(thisQuarter);
+            plan.setAppType(appType); //1头条 2快手
+            plan.setYear(thisYear);
+            plan.setMonth(thisMonth);
+            plan.setCalcDate(calcDate);
+            plan.setRoleId("plan");
+            plan.setWeekStart(friday);
+            plan.setWeekEnd(thursday);
+            plan.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(plan);
+
+            //剪辑
+            clip.setUserId(effiVideoDTO.getClipId());
+            clip.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            clip.setQuarter(thisQuarter);
+            clip.setAppType(appType); //1头条 2快手
+            clip.setYear(thisYear);
+            clip.setMonth(thisMonth);
+            clip.setCalcDate(calcDate);
+            clip.setRoleId("clip");
+            clip.setWeekStart(friday);
+            clip.setWeekEnd(thursday);
+            clip.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(clip);
+
+            //有效视频同步到有效视频素材库--测试的时候不打开,生产打开
+            //userEfficientVideoMapMapper.updateKuaishouEffiType(2, effiVideoDTO.getSignature());
+        }
+        log.info("快手有效视频统计结束,统计时间为 " + calcDate);
+    }
+
+    //toutiao新有效视频统计
+    private void toutiaoNewEffiVideo(Date calcDate, String effiCalcStart, String effiFirstWeekCalcEnd, int thisYear, int thisMonth, int thisQuarter, String friday, String thursday) {
+        log.info("toutiao有效视频统计开始,统计时间为 " + calcDate);
+        //List<EffiVideoDTO> effiList = new ArrayList<>();
+        Integer appType = 1;
+
+        //1.计算第一周(周五-下周周四)所有有消耗得md5
+        List<String> md5List = userEfficientVideoMapMapper.toutiaoGetWeekCostMd5(effiCalcStart, effiFirstWeekCalcEnd);
+        //2.排除第一周之前产生消耗的md5以及14天内消耗<5000的md5
+        for (String md5:md5List){
+            //有效视频去重--如果之前在对应的媒体中存在的话就跳过
+            int signatureCount = userEfficientVideoMapMapper.getEffiVideoCountBySignature(md5, appType);//1头条 2快手
+            if (signatureCount != 0) {
+                continue;
+            }
+
+            Integer count = userEfficientVideoMapMapper.toutiaoBeforeWeekCostCount(md5, effiCalcStart);
+            //如果第一周之前就有消耗的话排除
+            if(count>0){
+                continue;
+            }
+            String videoEarlistCostDate = userEfficientVideoMapMapper.getToutiaoVideoEarlistCostDate(md5);
+            String videoEndCostDate = null;
+            try {
+                videoEndCostDate = DateUtils.formatDate(DateUtils.addDay(videoEarlistCostDate, 13)); //有效视频发布开始时间
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            //如果从产生消耗开始时间14天内总消耗<5000,则排除掉
+            BigDecimal videoTotalCost = userEfficientVideoMapMapper.toutiaoVideoTotalCostInDates(md5, videoEarlistCostDate, videoEndCostDate);
+            if( (videoTotalCost.subtract(new BigDecimal("5000"))).compareTo(BigDecimal.ZERO) < 0){
+                continue;
+            }
+
+            //获取该视频的编导、剪辑、拍摄、平面等信息
+            EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
+            if(effiVideoDTO == null){
+                effiVideoDTO = new EffiVideoDTO();
+            }
+            effiVideoDTO.setSignature(md5);
+            effiVideoDTO.setCharge(videoTotalCost);
+
+            String companyId = null;
+            //根据编导id获取视频所属分公司
+            if( StringUtils.isNotBlank(effiVideoDTO.getPlanId()) ) {
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId(effiVideoDTO.getPlanId());
+            }else if( StringUtils.isNotBlank(effiVideoDTO.getClipId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getClipId() );
+            }else if( StringUtils.isNotBlank(effiVideoDTO.getShotId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getShotId() );
+            }else if ( StringUtils.isNotBlank(effiVideoDTO.getPlaneId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getPlaneId() );
+            }
+            //
+
+            UserEfficientVideoMap shot = new UserEfficientVideoMap();
+            UserEfficientVideoMap plane = new UserEfficientVideoMap();
+            UserEfficientVideoMap plan = new UserEfficientVideoMap();
+            UserEfficientVideoMap clip = new UserEfficientVideoMap();
+
+            //拍摄
+            shot.setUserId(effiVideoDTO.getShotId());
+            shot.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            shot.setQuarter(thisQuarter);
+            shot.setAppType(appType); //1头条 2快手
+            shot.setYear(thisYear);
+            shot.setMonth(thisMonth);
+            shot.setCalcDate(calcDate);
+            shot.setRoleId("shot");
+            shot.setWeekStart(friday);
+            shot.setWeekEnd(thursday);
+            shot.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(shot);
+
+            //平面
+            plane.setUserId(effiVideoDTO.getPlaneId());
+            plane.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            plane.setQuarter(thisQuarter);
+            plane.setAppType(appType); //1头条 2快手
+            plane.setYear(thisYear);
+            plane.setMonth(thisMonth);
+            plane.setCalcDate(calcDate);
+            plane.setRoleId("plane");
+            plane.setWeekStart(friday);
+            plane.setWeekEnd(thursday);
+            plane.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(plane);
+
+            //编导
+            plan.setUserId(effiVideoDTO.getPlanId());
+            plan.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            plan.setQuarter(thisQuarter);
+            plan.setAppType(appType); //1头条 2快手
+            plan.setYear(thisYear);
+            plan.setMonth(thisMonth);
+            plan.setCalcDate(calcDate);
+            plan.setRoleId("plan");
+            plan.setWeekStart(friday);
+            plan.setWeekEnd(thursday);
+            plan.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(plan);
+
+            //剪辑
+            clip.setUserId(effiVideoDTO.getClipId());
+            clip.setEfficientVideoSignature(effiVideoDTO.getSignature());
+            clip.setQuarter(thisQuarter);
+            clip.setAppType(appType); //1头条 2快手
+            clip.setYear(thisYear);
+            clip.setMonth(thisMonth);
+            clip.setCalcDate(calcDate);
+            clip.setRoleId("clip");
+            clip.setWeekStart(friday);
+            clip.setWeekEnd(thursday);
+            clip.setCompanyId(companyId);
+            userEfficientVideoMapMapper.insert(clip);
+
+            //有效视频同步到有效视频素材库--测试的时候不打开,生产打开
+            //userEfficientVideoMapMapper.updateToutiaoEffiType(2, effiVideoDTO.getSignature());
+        }
+        log.info("toutiao有效视频统计结束,统计时间为 " + calcDate);
+    }
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //新有效视频计算结束
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //新总视频计算开始
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    public void kuaishouNewVideo(Date calcDate, int thisYear, int thisQuarter, int thisMonth, String friday, String thursday){
+        log.info("设计师周总视频计算开始");
+        List<String> videoMd5s = userEfficientVideoMapMapper.getVideoByDates(friday,thursday);
+        for(String md5:videoMd5s){
+            //去重
+            Integer signatureCount = userEfficientVideoMapMapper.getVideoCountByCode(md5);
+            if(signatureCount > 0){
+                continue;
+            }
+            //
+
+            //获取该视频的编导、剪辑、拍摄、平面等信息
+            EffiVideoDTO effiVideoDTO = userEfficientVideoMapMapper.getDesignerInfoByCode(md5);
+            if(effiVideoDTO == null){
+                effiVideoDTO = new EffiVideoDTO();
+            }
+            effiVideoDTO.setSignature(md5);
+
+            String companyId = null;
+            //根据编导id获取视频所属分公司
+            if( StringUtils.isNotBlank(effiVideoDTO.getPlanId()) ) {
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId(effiVideoDTO.getPlanId());
+            }else if( StringUtils.isNotBlank(effiVideoDTO.getClipId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getClipId() );
+            }else if( StringUtils.isNotBlank(effiVideoDTO.getShotId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getShotId() );
+            }else if ( StringUtils.isNotBlank(effiVideoDTO.getPlaneId()) ){
+                companyId = userEfficientVideoMapMapper.getCompanyInfoByUserId( effiVideoDTO.getPlaneId() );
+            }
+
+            UserVideoMap shot = new UserVideoMap();
+            UserVideoMap plane = new UserVideoMap();
+            UserVideoMap plan = new UserVideoMap();
+            UserVideoMap clip = new UserVideoMap();
+
+            //拍摄
+            shot.setUserId(effiVideoDTO.getShotId());
+            shot.setVideoSignature(effiVideoDTO.getSignature());
+            shot.setQuarter(thisQuarter);
+            shot.setYear(thisYear);
+            shot.setMonth(thisMonth);
+            shot.setCalcDate(calcDate);
+            shot.setRoleId("shot");
+            shot.setWeekStart(friday);
+            shot.setWeekEnd(thursday);
+            shot.setCompanyId(companyId);
+            userVideoMapMapper.insert(shot);
+
+            //平面
+            plane.setUserId(effiVideoDTO.getPlaneId());
+            plane.setVideoSignature(effiVideoDTO.getSignature());
+            plane.setQuarter(thisQuarter);
+            plane.setYear(thisYear);
+            plane.setMonth(thisMonth);
+            plane.setCalcDate(calcDate);
+            plane.setRoleId("plane");
+            plane.setWeekStart(friday);
+            plane.setWeekEnd(thursday);
+            plane.setCompanyId(companyId);
+            userVideoMapMapper.insert(plane);
+
+            //编导
+            plan.setUserId(effiVideoDTO.getPlanId());
+            plan.setVideoSignature(effiVideoDTO.getSignature());
+            plan.setQuarter(thisQuarter);
+            plan.setYear(thisYear);
+            plan.setMonth(thisMonth);
+            plan.setCalcDate(calcDate);
+            plan.setRoleId("plan");
+            plan.setWeekStart(friday);
+            plan.setWeekEnd(thursday);
+            plan.setCompanyId(companyId);
+            userVideoMapMapper.insert(plan);
+
+            //剪辑
+            clip.setUserId(effiVideoDTO.getClipId());
+            clip.setVideoSignature(effiVideoDTO.getSignature());
+            clip.setQuarter(thisQuarter);
+            clip.setYear(thisYear);
+            clip.setMonth(thisMonth);
+            clip.setCalcDate(calcDate);
+            clip.setRoleId("clip");
+            clip.setWeekStart(friday);
+            clip.setWeekEnd(thursday);
+            clip.setCompanyId(companyId);
+            userVideoMapMapper.insert(clip);
+        }
+        log.info("设计师周总视频计算结束");
+     }
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //新总视频计算结束
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //绩效计算开始
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     /**
@@ -1830,24 +2187,22 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouDepartUserInfo();
         //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
         for (UserDto2 userDto : userDto2List) {
-            String roleCode = userDto.getRoleCode();
             //2.1 获取有效视频数量
-            Integer effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByCalcDate(startDate, endDate, userDto.getRoleId(), userDto.getUserId(), 2);
-            //2.2 获取有效视频总数
-            Integer videoCount = userEfficientVideoMapMapper.getQuarterMaterialCountByUserId(userDto.getRoleCode(), startDate, endDate, userDto.getUserId());
+            Integer effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByCalcDate(startDate, endDate, userDto.getUserId(), 2);
+            //2.2 获取视频总数
+            Integer videoCount = userEfficientVideoMapMapper.getVideoCountByUserId(userDto.getUserId(), startDate, endDate);
             //2.3 总消耗
-            BigDecimal cost = null;
-            if ("clip".equals(roleCode)) {
-                cost = userEfficientVideoMapMapper.getTotalCostByClipId(userDto.getUserId(), startDate, endDate);
-            } else if ("plan".equals(roleCode)) {
-                cost = userEfficientVideoMapMapper.getTotalCostByPlanId(userDto.getUserId(), startDate, endDate);
-            } else if ("shot".equals(roleCode)) {
-                cost = userEfficientVideoMapMapper.getTotalCostByShotId(userDto.getUserId(), startDate, endDate);
+            BigDecimal totalCost = BigDecimal.ZERO;
+            List<String> md5s = userEfficientVideoMapMapper.getTotalSignatureByUserId(userDto.getUserId(), startDate, endDate);
+            for(String md5:md5s){
+                BigDecimal cost = userEfficientVideoMapMapper.getSumChargeBySignature(md5, startDate, endDate);
+                    if(cost== null){
+                        cost = BigDecimal.ZERO;
+                    }
+                totalCost = totalCost.add(cost);
             }
-            if(cost == null){
-                cost = BigDecimal.ZERO;
-            }
-            userDto.setCost(cost);
+
+            userDto.setCost(totalCost);
             userDto.setVideoCount(videoCount);
             userDto.setEffiVideoCount(effiVideoCount);
         }
@@ -1863,23 +2218,20 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         for (UserDto2 userDto : userDto2List) {
             String roleCode = userDto.getRoleCode();
             //2.1 获取有效视频数量
-            Integer effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByCalcDate(startDate, endDate, userDto.getRoleId(), userDto.getUserId(), 1);
+            Integer effiVideoCount = userEfficientVideoMapMapper.getEffiVideoCountByCalcDate(startDate, endDate, userDto.getUserId(), 1);
             //2.2 获取视频总数
-            Integer videoCount = userEfficientVideoMapMapper.getQuarterMaterialCountByUserId(userDto.getRoleCode(), startDate, endDate, userDto.getUserId());
+            Integer videoCount = userEfficientVideoMapMapper.getVideoCountByUserId(userDto.getUserId(), startDate, endDate);
             //2.3 总消耗
-            BigDecimal cost = null;
-            if ("clip".equals(roleCode)) {
-                cost = userEfficientVideoMapMapper.toutiaoGetTotalCostByClipId(userDto.getUserId(), startDate, endDate);
-            } else if ("plan".equals(roleCode)) {
-                cost = userEfficientVideoMapMapper.toutiaoGetTotalCostByPlanId(userDto.getUserId(), startDate, endDate);
-            } else if ("shot".equals(roleCode)) {
-                cost = userEfficientVideoMapMapper.toutiaoGetTotalCostByShotId(userDto.getUserId(), startDate, endDate);
-            }
-
-            if(cost == null){
-                cost = BigDecimal.ZERO;
+            BigDecimal totalCost = BigDecimal.ZERO;
+            List<String> md5s = userEfficientVideoMapMapper.getTotalSignatureByUserId(userDto.getUserId(), startDate, endDate);
+            for(String md5:md5s){
+                BigDecimal cost = userEfficientVideoMapMapper.getToutiaoSumChargeBySignature(md5, startDate, endDate);
+                if(cost== null){
+                    cost = BigDecimal.ZERO;
+                }
+                totalCost = totalCost.add(cost);
             }
-            userDto.setCost(cost);
+            userDto.setCost(totalCost);
             userDto.setVideoCount(videoCount);
             userDto.setEffiVideoCount(effiVideoCount);
         }
@@ -1968,8 +2320,32 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
     }
 
     //根据userid,appType,年度,季度查询有效视频列表
+    public List<MaterialInfo> getVideoList(String userId, String startDate, String endDate){
+        List<MaterialInfo> materialInfoList = userEfficientVideoMapMapper.getVideoList(userId, startDate, endDate);
+        return materialInfoList;
+    }
+
+    //根据userid,appType,年度,季度查询有效视频列表
     public List<MaterialInfo> getEffiWeekVideoList(Integer appType, String startDate, String endDate, String userId){
         List<MaterialInfo> materialInfoList = userEfficientVideoMapMapper.getEffiWeekVideoList(appType, startDate, endDate, userId);
+        BigDecimal cost = null;
+        if(appType == 2){
+            for(MaterialInfo materialInfo:materialInfoList){
+                cost = userEfficientVideoMapMapper.videoTotalCostInDates(materialInfo.getCode(),startDate, endDate);
+                if(cost == null){
+                    cost = BigDecimal.ZERO;
+                }
+                materialInfo.setCost(cost);
+            }
+        }else if(appType == 1){
+            for(MaterialInfo materialInfo:materialInfoList){
+                cost = userEfficientVideoMapMapper.toutiaoVideoTotalCostInDates(materialInfo.getCode(),startDate, endDate);
+                if(cost == null){
+                    cost = BigDecimal.ZERO;
+                }
+                materialInfo.setCost(cost);
+            }
+        }
         return materialInfoList;
     }
 

+ 12 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -136,4 +137,15 @@ public class MaterialInfo {
     @TableField(exist = false)
     private JSONObject kuaiShou;
 
+    @TableField(exist = false)
+    private String videoRoleCode;  //拍摄时候担任的角色
+
+    @TableField(exist = false)
+    private String originRoleName;  //原本的角色
+
+    @TableField(exist = false)
+    private BigDecimal cost;
+
+    @TableField(exist = false)
+    private String realname;
 }

+ 8 - 0
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserEfficientVideoMap.java

@@ -76,4 +76,12 @@ public class UserEfficientVideoMap {
 	/**updateTime*/
     @ApiModelProperty(value = "updateTime")
 	private Date updateTime;
+
+    private String weekStart;
+
+    private String weekEnd;
+
+    private String companyId;
+
+
 }

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

@@ -18,39 +18,43 @@ import java.util.List;
 @Component
 public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVideoMap> {
 
-    List<EffiVideoDTO> getUserVideoMap(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("startCalcDate")String startCalcDate, @Param("endCalcDate")String endCalcDate);
+    List<EffiVideoDTO> getUserVideoMap(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("startCalcDate") String startCalcDate, @Param("endCalcDate") String endCalcDate);
 
-    int getEffiVideoCountBySignature(@Param("signature")String signature, @Param("appType")Integer appType);
+    int getEffiVideoCountBySignature(@Param("signature") String signature, @Param("appType") Integer appType);
 
     int getEffiVideoCountByUserId(@Param("appType") int appType, @Param("year") int year, @Param("quarter") int quarter, @Param("userId") String userId, @Param("roleId") String roleId);
 
-    int getQuarterMaterialCountByUserId(@Param("roleCode")String roleCode, @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("userId")String userId);
+    int getQuarterMaterialCountByUserId(@Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userId") String userId);
 
-    BigDecimal getTotalCostByClipId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    int getVideoCountByUserId(@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 getTotalCostByUserId(@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 getTotalCostByClipId(@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 getTotalCostByShotId(@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 getTotalCostByPlanId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    List<ProjectDTO> getProjectsByUserId(@Param("userId")String userId);
+    BigDecimal getTotalCostByPlaneId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    int getPlaneCountByProjectId(@Param("projectId")Long projectId);
+    BigDecimal getProjectTotalCostByUserId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    int getPlaneCountByUserId(@Param("userId")String userId);
+    List<ProjectDTO> getProjectsByUserId(@Param("userId") String userId);
 
-    List<DesignMaterialInfo> designMaterialInfoList(@Param("roleCode")String roleCode, @Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    int getPlaneCountByProjectId(@Param("projectId") Long projectId);
 
-    List<DesignMaterialInfo> getMaterialAccountInfoByMaterialId(@Param("materialId")String materialId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    int getPlaneCountByUserId(@Param("userId") String userId);
 
-    List<ProjectDTO> getProjects(@Param("mediaId")String mediaId);
+    List<DesignMaterialInfo> designMaterialInfoList(@Param("roleCode") String roleCode, @Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    BigDecimal getProjectQuarterCostById(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectId")Long projectId);
+    List<DesignMaterialInfo> getMaterialAccountInfoByMaterialId(@Param("materialId") String materialId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    List<UserDto2> getPlaneByProjectId(@Param("projectId")Long projectId);
+    List<ProjectDTO> getProjects(@Param("mediaId") String mediaId);
+
+    BigDecimal getProjectQuarterCostById(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectId") Long projectId);
+
+    List<UserDto2> getPlaneByProjectId(@Param("projectId") Long projectId);
 
     List<UserDto2> getKuaishouDesignLeaderList();
 
@@ -68,7 +72,7 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
 
     List<UserDto2> getToutiaoDesignLeaderList();
 
-    List<String> getClip(@Param("depId")String depId);
+    List<String> getClip(@Param("depId") String depId);
 
     BigDecimal getClipQuarterCost(@Param("appType") int appType, @Param("quarter") int quarter, @Param("year") int year, @Param("userId") String userId);
 
@@ -108,28 +112,66 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
     void updateToutiaoEffiType(@Param("toutiaoEffiType") Integer toutiaoEffiType, @Param("signature") String signature);
 
     List<UserDto2> getKuaishouDepartUserInfo();
+
     List<UserDto2> getKuaishouDepartAllUserInfo();
+
     List<UserDto2> getToutiaoDepartUserInfo();
+
     List<UserDto2> getToutiaoDepartAllUserInfo();
 
     //根据天数的区间获取userId获取有效视频数量
-    Integer getEffiVideoCountByCalcDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("roleId") String roleId, @Param("userId") String userId, @Param("appType") Integer appType);
+    Integer getEffiVideoCountByCalcDate(@Param("startDate") String startDate, @Param("endDate") String endDate,  @Param("userId") String userId, @Param("appType") Integer appType);
 
-    List<MaterialInfo> getEffiVideoList(@Param("appType")Integer appType, @Param("year")Integer year, @Param("quarter")Integer quarter, @Param("userId")String userId);
+    List<MaterialInfo> getEffiVideoList(@Param("appType") Integer appType, @Param("year") Integer year, @Param("quarter") Integer quarter, @Param("userId") String userId);
 
     List<UserDto2> getKuaishouYunyingDepartUserInfo();
 
     List<UserDto2> getToutiaoYunyingDepartUserInfo();
+
     //获取快手单个优化师当前账户下的总消耗
-    BigDecimal getKuaishouYunyingTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    BigDecimal getKuaishouYunyingTotalCost(@Param("userId") String userId, @Param("appType") Integer appType, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
     //获取快手单个优化师当前账户下的总消耗
-    BigDecimal getToutiaoYunyingTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    BigDecimal getToutiaoYunyingTotalCost(@Param("userId") String userId, @Param("appType") Integer appType, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
     //获取快手单个优化师其下所有的账户下当前的消耗
-    List<AccountDTO> getKuaishouAccountTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    List<AccountDTO> getKuaishouAccountTotalCost(@Param("userId") String userId, @Param("appType") Integer appType, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
     //获取头条单个优化师其下所有的账户下当前的消耗
-    List<AccountDTO> getToutiaoAccountTotalCost(@Param("userId")String userId, @Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    List<AccountDTO> getToutiaoAccountTotalCost(@Param("userId") String userId, @Param("appType") Integer appType, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    List<MaterialInfo> getEffiWeekVideoList(@Param("appType") Integer appType, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("userId") String userId);
+
+    List<String> getWeekCostMd5(@Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    List<String> toutiaoGetWeekCostMd5(@Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    Integer beforeWeekCostCount(@Param("md5") String md5, @Param("date") String date);
+
+    Integer toutiaoBeforeWeekCostCount(@Param("md5") String md5, @Param("date") String date);
+
+    String getVideoEarlistCostDate(@Param("md5")String md5);
+
+    String getToutiaoVideoEarlistCostDate(@Param("md5")String md5);
+
+    BigDecimal videoTotalCostInDates(@Param("md5")String md5, @Param("startDate")String startDate, @Param("endDate")String endDate);
+
+    BigDecimal toutiaoVideoTotalCostInDates(@Param("md5")String md5, @Param("startDate")String startDate, @Param("endDate")String endDate);
+
+    EffiVideoDTO getDesignerInfoByCode(@Param("code")String code);
+
+    String getCompanyInfoByUserId(@Param("userId")String userId);
+
+    List<String> getVideoByDates(@Param("startDate")String startDate, @Param("endDate")String endDate);
+
+    Integer getVideoCountByCode(@Param("signature")String signature);
+
+    List<String> getTotalSignatureByUserId(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
+
+    BigDecimal getSumChargeBySignature(@Param("signature")String signature, @Param("startDate")String startDate, @Param("endDate")String endDate);
 
-    List<MaterialInfo> getEffiWeekVideoList(@Param("appType")Integer appType, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
+    BigDecimal getToutiaoSumChargeBySignature(@Param("signature")String signature, @Param("startDate")String startDate, @Param("endDate")String endDate);
 
+    List<MaterialInfo> getVideoList(@Param("userId")String userId, @Param("startDate")String startDate, @Param("endDate")String endDate);
 }
 

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

@@ -15,7 +15,7 @@
             d3.realname as plan_name,
             d4.id as plane_id,
             d4.realname as plane_name
-        from ctop_kuaishou_report_daily_creative_statistic a
+        from ctop_kuaishou_report_daily_creative a
         left join (select id, create_time ,code from ctop_material_info group by code) b on a.signature = b.code
         left join ctop_material_ascription c on b.id = c.material_id
         left join sys_user d1 on c.clip_id = d1.id
@@ -75,11 +75,21 @@
         </choose>
     </select>
 
+    <select id="getVideoCountByUserId" resultType="integer">
+            select
+            count(1)
+        from
+        ctop_user_video_map
+        where user_id = #{userId}
+            and DATE_FORMAT(calc_date,'%Y-%m-%d') &gt;= #{startDate}
+            and DATE_FORMAT(calc_date,'%Y-%m-%d') &lt;= #{endDate}
+    </select>
+
     <!-- 根据clip_id获取视频总消耗 -->
     <select id="getTotalCostByClipId" resultType="java.math.BigDecimal">
             select
             sum(a.charge) as charge
-        from ctop_kuaishou_report_daily_creative_statistic a
+        from ctop_kuaishou_report_daily_creative a
         left join ctop_material_info b on a.signature = b.code
         left join ctop_material_ascription c on b.id = c.material_id
         left join sys_user d1 on c.clip_id = d1.id
@@ -92,11 +102,68 @@
         and c.clip_id = #{userId}
     </select>
 
+    <select id="getTotalCostByUserId" resultType="java.math.BigDecimal">
+            select
+            sum(a.charge) as charge
+        from
+        ctop_kuaishou_report_daily_creative a
+        left join
+        (
+        select
+        video_signature as signature
+        from
+        ctop_user_video_map
+        where user_id = #{userId}
+        and DATE_FORMAT(calc_date,'%Y-%m-%d') &gt;= #{startDate}
+        and DATE_FORMAT(calc_date,'%Y-%m-%d') &lt;= #{endDate}
+        group by video_signature) b
+        on a.signature = b.signature
+        where
+        DATE_FORMAT(a.stat_date,'%Y-%m-%d') &gt;= #{startDate}
+        and DATE_FORMAT(a.stat_date,'%Y-%m-%d') &lt;= #{endDate}
+    </select>
+
+    <select id="getTotalSignatureByUserId" resultType="string">
+        select
+        video_signature as signature
+        from
+        ctop_user_video_map
+        where user_id = #{userId}
+        and DATE_FORMAT(calc_date,'%Y-%m-%d') &gt;= #{startDate}
+        and DATE_FORMAT(calc_date,'%Y-%m-%d') &lt;= #{endDate}
+        group by video_signature
+    </select>
+
+    <select id="getToutiaoSumChargeBySignature" resultType="java.math.BigDecimal">
+        select
+            sum(a.cost) as charge
+        from
+        ctop_bytedance_report_creative_daily a
+        where a.signature = #{signature}
+        and
+        DATE_FORMAT(a.stat_datetime,'%Y-%m-%d') &gt;= #{startDate}
+        and
+        DATE_FORMAT(a.stat_datetime,'%Y-%m-%d') &lt;= #{endDate}
+    </select>
+
+    <select id="getSumChargeBySignature" resultType="java.math.BigDecimal">
+        select
+            sum(a.charge) as charge
+        from
+        ctop_kuaishou_report_daily_creative a
+        where a.signature = #{signature}
+        and
+        DATE_FORMAT(a.stat_date,'%Y-%m-%d') &gt;= #{startDate}
+        and
+        DATE_FORMAT(a.stat_date,'%Y-%m-%d') &lt;= #{endDate}
+    </select>
+
+
     <!-- 根据shot_id获取视频总消耗 -->
     <select id="getTotalCostByShotId" resultType="java.math.BigDecimal">
             select
             sum(a.charge) as charge
-        from ctop_kuaishou_report_daily_creative_statistic a
+        from ctop_kuaishou_report_daily_creative a
         left join ctop_material_info b on a.signature = b.code
         left join ctop_material_ascription c on b.id = c.material_id
         left join sys_user d1 on c.clip_id = d1.id
@@ -113,7 +180,7 @@
     <select id="getTotalCostByPlanId" resultType="java.math.BigDecimal">
             select
             sum(a.charge) as charge
-        from ctop_kuaishou_report_daily_creative_statistic a
+        from ctop_kuaishou_report_daily_creative a
         left join ctop_material_info b on a.signature = b.code
         left join ctop_material_ascription c on b.id = c.material_id
         left join sys_user d1 on c.clip_id = d1.id
@@ -130,7 +197,7 @@
     <select id="getTotalCostByPlaneId" resultType="java.math.BigDecimal">
             select
             sum(a.charge) as charge
-        from ctop_kuaishou_report_daily_creative_statistic a
+        from ctop_kuaishou_report_daily_creative a
         left join ctop_material_info b on a.signature = b.code
         left join ctop_material_ascription c on b.id = c.material_id
         left join sys_user d1 on c.clip_id = d1.id
@@ -203,7 +270,7 @@
         from
         ctop_material_info b
         left join ctop_material_ascription c on b.id = c.material_id
-        left join ctop_kuaishou_report_daily_creative_statistic a on b.code = a.signature
+        left join ctop_kuaishou_report_daily_creative a on b.code = a.signature
         where
         <choose>
             <when test=" roleCode == 'plan' ">
@@ -231,7 +298,7 @@
         from
         ctop_material_info b
         left join ctop_material_ascription c on b.id = c.material_id
-        left join ctop_kuaishou_report_daily_creative_statistic a on b.code = a.signature
+        left join ctop_kuaishou_report_daily_creative a on b.code = a.signature
         where
         b.id = #{materialId}
         and DATE_FORMAT(b.create_time,'%Y-%m-%d') &gt;= #{startDate}
@@ -897,7 +964,7 @@
         from
         ctop_user_efficient_video_map
         where user_id = #{userId}
-        and role_id = #{roleId}
+       <!-- and role_id = #{roleId}  -->
         and app_type = #{appType}
         and calc_date &lt;= #{endDate}
         and calc_date &gt;= #{startDate}
@@ -910,10 +977,14 @@
             i.code as code,
             i.url as url,
             i.material_name as materialName,
-            i.watermark_material_name as watermarkMaterialName
+            i.watermark_material_name as watermarkMaterialName,
+            m.role_id as videoRoleCode,  <!-- 拍摄时候担任的角色 -->
+            r.role_name as originRoleName  <!-- 原本的角色 -->
         from
         ctop_user_efficient_video_map m
-        left join ctop_material_info i on m.efficient_video_signature = i.code
+        left join (select id,code,url,material_name,watermark_material_name from ctop_material_info group by code) i on m.efficient_video_signature = i.code
+        left join sys_user_role sr on m.user_id = sr.user_id
+        left join sys_role r on sr.role_id = r.id
         where
         m.user_id = #{userId} and
         m.app_type =#{appType} and
@@ -928,10 +999,16 @@
             i.code as code,
             i.url as url,
             i.material_name as materialName,
-            i.watermark_material_name as watermarkMaterialName
+            i.watermark_material_name as watermarkMaterialName,
+            m.role_id as videoRoleCode,  <!-- 拍摄时候担任的角色 -->
+            r.role_name as originRoleName,  <!-- 原本的角色 -->
+            su.realname as realname
         from
         ctop_user_efficient_video_map m
-        left join ctop_material_info i on m.efficient_video_signature = i.code
+        left join (select id,code,url,material_name,watermark_material_name from ctop_material_info group by code) i on m.efficient_video_signature = i.code
+        left join sys_user_role sr on m.user_id = sr.user_id
+        left join sys_role r on sr.role_id = r.id
+        left join sys_user su on m.user_id = su.id
         where
         m.user_id = #{userId} and
         m.app_type =#{appType} and
@@ -939,4 +1016,173 @@
         m.calc_date &gt;= #{startDate}
     </select>
 
+    <!-- 获取有效视频第一周所有产生消耗的视频的md5 -->
+    <select id="getWeekCostMd5" resultType="string">
+        select
+        signature
+        from ctop_kuaishou_report_daily_creative
+        where
+        DATE_FORMAT(stat_date,'%Y-%m-%d') &gt;= #{startDate}
+        and DATE_FORMAT(stat_date,'%Y-%m-%d') &lt;= #{endDate}
+        and signature is not null
+        group by signature
+    </select>
+
+    <!-- 获取toutiao有效视频第一周所有产生消耗的视频的md5 -->
+    <select id="toutiaoGetWeekCostMd5" resultType="string">
+        select
+        signature
+        from ctop_bytedance_report_creative_daily
+        where
+        DATE_FORMAT(stat_datetime,'%Y-%m-%d') &gt;= #{startDate}
+        and DATE_FORMAT(stat_datetime,'%Y-%m-%d') &lt;= #{endDate}
+        and signature is not null
+        group by signature
+    </select>
+
+    <!-- 获取有效视频第一周开始时间之前消耗次数 -->
+    <select id="beforeWeekCostCount" resultType="integer">
+        select
+        count(1)
+        from ctop_kuaishou_report_daily_creative
+        where
+        signature = #{md5} and
+        DATE_FORMAT(stat_date,'%Y-%m-%d') &lt; #{date}
+    </select>
+
+    <!-- 获取有效视频第一周开始时间之前消耗次数 -->
+    <select id="toutiaoBeforeWeekCostCount" resultType="integer">
+        select
+        count(1)
+        from ctop_bytedance_report_creative_daily
+        where
+        signature = #{md5} and
+        DATE_FORMAT(stat_datetime,'%Y-%m-%d') &lt; #{date}
+    </select>
+
+    <!-- 获取视频最早产生消耗的日期 -->
+    <select id="getVideoEarlistCostDate" resultType="string">
+        select
+        DATE_FORMAT(stat_date,'%Y-%m-%d')
+        from ctop_kuaishou_report_daily_creative
+        where
+        signature = #{md5}
+        order by stat_date asc limit 1
+    </select>
+
+    <!-- 获取视频最早产生消耗的日期 -->
+    <select id="getToutiaoVideoEarlistCostDate" resultType="string">
+        select
+        DATE_FORMAT(stat_datetime,'%Y-%m-%d')
+        from ctop_bytedance_report_creative_daily
+        where
+        signature = #{md5}
+        order by stat_datetime asc limit 1
+    </select>
+
+    <!-- 获取视频在时间范围内的总消耗 -->
+    <select id="videoTotalCostInDates" resultType="java.math.BigDecimal">
+        select
+        sum(charge)
+        from ctop_kuaishou_report_daily_creative
+        where
+        signature = #{md5}
+        and DATE_FORMAT(stat_date,'%Y-%m-%d') &lt;= #{endDate}
+        and DATE_FORMAT(stat_date, '%Y-%m-%d') &gt;= #{startDate}
+    </select>
+
+    <!-- 获取视频在时间范围内的总消耗 -->
+    <select id="toutiaoVideoTotalCostInDates" resultType="java.math.BigDecimal">
+        select
+        sum(cost)
+        from ctop_bytedance_report_creative_daily
+        where
+        signature = #{md5}
+        and DATE_FORMAT(stat_datetime,'%Y-%m-%d') &lt;= #{endDate}
+        and DATE_FORMAT(stat_datetime, '%Y-%m-%d') &gt;= #{startDate}
+    </select>
+
+    <select id="getDesignerInfoByCode" resultType="cn.com.ctop.userefficientvideomap.entity.EffiVideoDTO">
+        select
+        a.id,
+        b.clip_id as clipId,
+        u1.realname as clipName,
+        b.shot_id as shotId,
+        u2.realname as shotName,
+        b.plan_id as planId,
+        u3.realname as planName,
+        b.plane_id as planeId,
+        u4.realname as planeName
+        from
+        ctop_material_info a
+        left join ctop_material_ascription b on a.id=b.material_id
+        left join sys_user u1 on b.clip_id = u1.id
+        left join sys_user u2 on b.shot_id = u2.id
+        left join sys_user u3 on b.plan_id = u3.id
+        left join sys_user u4 on b.plane_id = u4.id
+        where a.code = #{code}
+        limit 1
+    </select>
+
+    <!-- 根据user_id获取员工所属分公司的company_id -->
+    <select id="getCompanyInfoByUserId" resultType="string">
+        select
+        company_id
+        from
+        user_company
+        where user_id = #{userId}
+    </select>
+
+    <!-- 按时间段获取视频总量 -->
+    <select id="getVideoByDates" resultType="string">
+        select
+        code
+        from (
+            select
+            code,
+            create_time
+            from
+            ctop_material_info
+            where
+            date_format(create_time, '%Y-%m-%d') &gt;= #{startDate} and
+            date_format(create_time, '%Y-%m-%d') &lt;= #{endDate}
+            order by create_time
+            ) a
+        group by code
+    </select>
+
+    <select id="getVideoCountByCode" resultType="integer">
+        select
+        count(1)
+        from
+        ctop_user_video_map
+        where video_signature = #{signature}
+    </select>
+
+    <!-- 视频素材 -->
+    <select id="getVideoList" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
+            select
+            i.id as id,
+            i.code as code,
+            i.url as url,
+            i.material_name as materialName,
+            i.watermark_material_name as watermarkMaterialName,
+            m.role_id as videoRoleCode,  <!-- 拍摄时候担任的角色 -->
+            r.role_name as originRoleName  <!-- 原本的角色 -->
+        from
+        ctop_user_video_map m
+        left join (
+                    select
+                    id,code,url,material_name,watermark_material_name
+                    from
+                    ctop_material_info group by code
+                    ) i on m.video_signature = i.code
+        left join sys_user_role sr on m.user_id = sr.user_id
+        left join sys_role r on sr.role_id = r.id
+        where
+        m.user_id = #{userId} and
+        m.calc_date &gt;= #{startDate} and
+        m.calc_date &lt;= #{endDate}
+    </select>
+
 </mapper>

+ 243 - 0
performance-appraisal/src/main/java/cn/com/ctop/uservideomap/controller/UserVideoMapController.java

@@ -0,0 +1,243 @@
+package cn.com.ctop.uservideomap.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.oConvertUtils;
+import cn.com.ctop.uservideomap.entity.UserVideoMap;
+import cn.com.ctop.uservideomap.service.IUserVideoMapService;
+import java.util.Date;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+ /**
+ * 视频和设计师对应关系表
+ * @author jeecg-boot
+ * @date   2020-03-17
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="视频和设计师对应关系表")
+@RestController
+@RequestMapping("/uservideomap/userVideoMap")
+public class UserVideoMapController {
+	@Autowired
+	private IUserVideoMapService userVideoMapService;
+	
+	/**
+	  * 分页列表查询
+	 * @param userVideoMap
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "视频和设计师对应关系表-分页列表查询")
+	@ApiOperation(value="视频和设计师对应关系表-分页列表查询", notes="视频和设计师对应关系表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<UserVideoMap>> queryPageList(UserVideoMap userVideoMap,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<UserVideoMap>> result = new Result<IPage<UserVideoMap>>();
+		QueryWrapper<UserVideoMap> queryWrapper = QueryGenerator.initQueryWrapper(userVideoMap, req.getParameterMap());
+		Page<UserVideoMap> page = new Page<UserVideoMap>(pageNo, pageSize);
+		IPage<UserVideoMap> pageList = userVideoMapService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param userVideoMap
+	 * @return
+	 */
+	@AutoLog(value = "视频和设计师对应关系表-添加")
+	@ApiOperation(value="视频和设计师对应关系表-添加", notes="视频和设计师对应关系表-添加")
+	@PostMapping(value = "/add")
+	public Result<UserVideoMap> add(@RequestBody UserVideoMap userVideoMap) {
+		Result<UserVideoMap> result = new Result<UserVideoMap>();
+		try {
+			userVideoMapService.save(userVideoMap);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param userVideoMap
+	 * @return
+	 */
+	@AutoLog(value = "视频和设计师对应关系表-编辑")
+	@ApiOperation(value="视频和设计师对应关系表-编辑", notes="视频和设计师对应关系表-编辑")
+	@PutMapping(value = "/edit")
+	public Result<UserVideoMap> edit(@RequestBody UserVideoMap userVideoMap) {
+		Result<UserVideoMap> result = new Result<UserVideoMap>();
+		UserVideoMap userVideoMapEntity = userVideoMapService.getById(userVideoMap.getId());
+		if(userVideoMapEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = userVideoMapService.updateById(userVideoMap);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "视频和设计师对应关系表-通过id删除")
+	@ApiOperation(value="视频和设计师对应关系表-通过id删除", notes="视频和设计师对应关系表-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			userVideoMapService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "视频和设计师对应关系表-批量删除")
+	@ApiOperation(value="视频和设计师对应关系表-批量删除", notes="视频和设计师对应关系表-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<UserVideoMap> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<UserVideoMap> result = new Result<UserVideoMap>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.userVideoMapService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "视频和设计师对应关系表-通过id查询")
+	@ApiOperation(value="视频和设计师对应关系表-通过id查询", notes="视频和设计师对应关系表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<UserVideoMap> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<UserVideoMap> result = new Result<UserVideoMap>();
+		UserVideoMap userVideoMap = userVideoMapService.getById(id);
+		if(userVideoMap==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(userVideoMap);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<UserVideoMap> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              UserVideoMap userVideoMap = JSON.parseObject(deString, UserVideoMap.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(userVideoMap, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<UserVideoMap> pageList = userVideoMapService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "视频和设计师对应关系表列表");
+      mv.addObject(NormalExcelConstants.CLASS, UserVideoMap.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("视频和设计师对应关系表列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<UserVideoMap> listUserVideoMaps = ExcelImportUtil.importExcel(file.getInputStream(), UserVideoMap.class, params);
+              userVideoMapService.saveBatch(listUserVideoMaps);
+              return Result.ok("文件导入成功!数据行数:" + listUserVideoMaps.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 87 - 0
performance-appraisal/src/main/java/cn/com/ctop/uservideomap/entity/UserVideoMap.java

@@ -0,0 +1,87 @@
+package cn.com.ctop.uservideomap.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 视频和设计师对应关系表
+ * @author jeecg-boot
+ * @date   2020-03-17
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_user_video_map")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_user_video_map对象", description="视频和设计师对应关系表")
+public class UserVideoMap {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**有效视频md5*/
+	@Excel(name = "有效视频md5", width = 15)
+    @ApiModelProperty(value = "有效视频md5")
+	private String videoSignature;
+	/**视频制作中担任的角色-不一定是自己原本的角色*/
+	@Excel(name = "视频制作中担任的角色-不一定是自己原本的角色", width = 15)
+    @ApiModelProperty(value = "视频制作中担任的角色-不一定是自己原本的角色")
+	private String roleId;
+	/**用户id*/
+	@Excel(name = "用户id", width = 15)
+    @ApiModelProperty(value = "用户id")
+	private String userId;
+	/**季度*/
+	@Excel(name = "季度", width = 15)
+    @ApiModelProperty(value = "季度")
+	private Integer quarter;
+	/**年*/
+	@Excel(name = "年", width = 15)
+    @ApiModelProperty(value = "年")
+	private Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+	private Integer month;
+	/**有效视频所属周开始时间*/
+	@Excel(name = "有效视频所属周开始时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "有效视频所属周开始时间")
+	private String weekStart;
+	/**有效视频所属周结束时间*/
+	@Excel(name = "有效视频所属周结束时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "有效视频所属周结束时间")
+	private String weekEnd;
+	/**用于计算所属年月季的基础日期*/
+	@Excel(name = "用于计算所属年月季的基础日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "用于计算所属年月季的基础日期")
+	private Date calcDate;
+	/**视频所属分公司的id*/
+	@Excel(name = "视频所属分公司的id", width = 15)
+    @ApiModelProperty(value = "视频所属分公司的id")
+	private String companyId;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 17 - 0
performance-appraisal/src/main/java/cn/com/ctop/uservideomap/mapper/UserVideoMapMapper.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.uservideomap.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import cn.com.ctop.uservideomap.entity.UserVideoMap;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 视频和设计师对应关系表
+ * @author: jeecg-boot
+ * @date:   2020-03-17
+ * @cersion: V1.0
+ */
+public interface UserVideoMapMapper extends BaseMapper<UserVideoMap> {
+
+}

+ 5 - 0
performance-appraisal/src/main/java/cn/com/ctop/uservideomap/mapper/xml/UserVideoMapMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.uservideomap.mapper.UserVideoMapMapper">
+
+</mapper>

+ 14 - 0
performance-appraisal/src/main/java/cn/com/ctop/uservideomap/service/IUserVideoMapService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.uservideomap.service;
+
+import cn.com.ctop.uservideomap.entity.UserVideoMap;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 视频和设计师对应关系表
+ * @author jeecg-boot
+ * @date   2020-03-17
+ * @version V1.0
+ */
+public interface IUserVideoMapService extends IService<UserVideoMap> {
+
+}

+ 19 - 0
performance-appraisal/src/main/java/cn/com/ctop/uservideomap/service/impl/UserVideoMapServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.uservideomap.service.impl;
+
+import cn.com.ctop.uservideomap.entity.UserVideoMap;
+import cn.com.ctop.uservideomap.mapper.UserVideoMapMapper;
+import cn.com.ctop.uservideomap.service.IUserVideoMapService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * 视频和设计师对应关系表
+ * @author jeecg-boot
+ * @date   2020-03-17
+ * @version V1.0
+ */
+@Service
+public class UserVideoMapServiceImpl extends ServiceImpl<UserVideoMapMapper, UserVideoMap> implements IUserVideoMapService {
+
+}