Prechádzať zdrojové kódy

Merge branch 'test'

syh 5 rokov pred
rodič
commit
6cdce8c519
24 zmenil súbory, kde vykonal 387 pridanie a 132 odobranie
  1. 90 78
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  2. 10 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  3. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/mq/Receiver.java
  4. 27 19
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java
  5. 26 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyAgentSumController.java
  6. 5 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAgentSum.java
  7. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/ParamsDTO.java
  8. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAgentSumMapper.java
  9. 29 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAgentSumMapper.xml
  10. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyAgentSumService.java
  11. 5 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAgentServiceImpl.java
  12. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAgentSumServiceImpl.java
  13. 12 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedancePlanDailyReportMapper.java
  14. 2 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedancePlanDailyReportService.java
  15. 6 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedancePlanDailyReportServiceImpl.java
  16. 0 4
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java
  17. 4 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/ByteDanceCreativeMapper.java
  18. 44 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/ByteDanceCreativeMapper.xml
  19. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceAdvertiserDataService.java
  20. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceCreativeService.java
  21. 54 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  22. 8 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceCreativeServiceImpl.java
  23. 3 3
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/UserEfficientVideoMapMapper.java
  24. 41 9
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml

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

@@ -435,84 +435,6 @@ public class TestController {
         return result;
     }
 
-    @GetMapping("formatYddData")
-    public Map<String, Object> formatYddData() throws Exception {
-        Map<String, Object> result = new HashMap<>();
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> yddWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id", 113);
-        List<UserAllocation> yddallocations = userAllocationService.list(yddWrapper);
-        if (null != yddallocations && yddallocations.size() > 0) {
-            yddallocations.forEach(allocation -> {
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id", allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
-                    bytedancePlanDailyReports.forEach(report -> {
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> dsjyWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id", 112);
-        List<UserAllocation> dsjyAllocations = userAllocationService.list(dsjyWrapper);
-        if (null != dsjyAllocations && dsjyAllocations.size() > 0) {
-            dsjyAllocations.forEach(allocation -> {
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id", allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
-                    bytedancePlanDailyReports.forEach(report -> {
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> fjyhWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id", 222);
-        List<UserAllocation> fjyhAllocations = userAllocationService.list(fjyhWrapper);
-        if (null != fjyhAllocations && fjyhAllocations.size() > 0) {
-            fjyhAllocations.forEach(allocation -> {
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id", allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
-                    bytedancePlanDailyReports.forEach(report -> {
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-
     //线程计数器
     static CountDownLatch countDownLatch = null;
 
@@ -562,6 +484,18 @@ public class TestController {
         return result;
     }
 
+    @GetMapping("formatYzData")
+    public Map<String, Object> formatYzData() {
+        Map<String, Object> result = new HashMap<>();
+        formatYzData(151, new Date());
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    private void formatYzData(int projectId, Date getDate) {
+        planDailyReportService.cleanYzData(projectId);
+    }
+
     private void formatData(Integer projectId, Date finalGetDate) {
         QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("project_id", projectId);
@@ -591,6 +525,84 @@ public class TestController {
     @Autowired
     private IBytedancePlanHourlyReportService planHourlyReportService;
 
+    @GetMapping("loadCreativeData")
+    public Map<String, Object> loadCreaticeData() {
+        Map<String, Object> result = new HashMap<>();
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        log.info("头条创意素材数据开始获取");
+        //查询当日数据
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:wei获取到可用的token");
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
+            return result;
+        }
+        executorService = Executors.newFixedThreadPool(20);
+        countDownLatch = new CountDownLatch(tokens.size());
+        tokens.forEach(token -> {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    //4: 获取广告创意信息数据
+                    try {
+                        advertiserDataService.getAdvertiserCreative(token, null);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    } finally {
+                        countDownLatch.countDown();
+                    }
+                }
+            });
+        });
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        log.info("头条创意素材数据获取完成");
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @GetMapping("loadCreaticeReportData")
+    public Map<String, Object> loadCreaticeReportData() {
+        Map<String, Object> result = new HashMap<>();
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        for (int i = 47; i < 180; i++) {
+            Date getDate = DateUtils.addDay(new Date(), -i);
+            log.info(DateUtils.formatDate(getDate) + "头条创意日报数据开始获取");
+            //查询当日数据
+            if (null == tokens || tokens.size() <= 0) {
+                log.info("定时获取头条数据异常:为获取到可用的token");
+                continue;
+            }
+            executorService = Executors.newFixedThreadPool(20);
+            countDownLatch = new CountDownLatch(tokens.size());
+            tokens.forEach(token -> {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        //4: 获取广告创意信息数据
+                        try {
+                            reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        } finally {
+                            countDownLatch.countDown();
+                        }
+                    }
+                });
+            });
+            try {
+                countDownLatch.await();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            log.info(DateUtils.formatDate(getDate) + "头条创意日报数据获取完成");
+        }
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
     @GetMapping("loadVideoData")
     public Map<String, Object> loadVideoData() {
         log.info("素材数据获取开始");

+ 10 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java

@@ -45,10 +45,18 @@ public class BytedancePlanDailyReportLoadJob implements Job {
             //获取广告计划信息数据
             reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         });
+        formatZybData(215, getDate);
+        formatYddData(113, getDate);
+        formatYddData(112, getDate);
+        formatYddData(222, getDate);
+        planDailyReportService.cleanYzData(151);
+    }
+
+    private void formatZybData(Integer projectId, Date getDate) {
         //清洗关于作业帮数据
         //1:查询作业帮相关的用户数据
         QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
-        wrapper.eq("project_id",215);
+        wrapper.eq("project_id", projectId);
         List<UserAllocation> allocations = userAllocationService.list(wrapper);
         if(null!=allocations&&allocations.size()>0){
             allocations.forEach(allocation->{
@@ -90,12 +98,9 @@ public class BytedancePlanDailyReportLoadJob implements Job {
                 }
             });
         }
-        formatData(113,getDate);
-        formatData(112,getDate);
-        formatData(222,getDate);
     }
 
-    private void formatData(Integer projectId,Date getDate){
+    private void formatYddData(Integer projectId, Date getDate) {
         //清洗关于缘多多数据
         QueryWrapper<UserAllocation> dsjyWrapper = new QueryWrapper<>();
         dsjyWrapper.eq("project_id", projectId);

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/mq/Receiver.java

@@ -1,13 +1,14 @@
 package org.jeecg.modules.mq;
 
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.rabbit.annotation.Queue;
 import org.springframework.amqp.rabbit.annotation.RabbitHandler;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.stereotype.Component;
 
 @Slf4j
 @Component
-@RabbitListener(queues = "hello")
+@RabbitListener(queuesToDeclare = @Queue("hello"))
 public class Receiver {
     /**
      * 通过@RabbitHandler声明的方法,对hello队列中的消息进行处理

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

@@ -1628,10 +1628,10 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
     public List<UserDto2> kuaishouPerformanceInfoNow() {
         //0 获取当前季度的时间
         Map<String, Integer> dateMap = DateUtils.getYearQuarter(new Date());
-        //Integer year = dateMap.get("year");
-        //Integer quarter = dateMap.get("quarter");
-        int year = 2019;
-        int quarter = 4;
+        Integer year = dateMap.get("year");
+        Integer quarter = dateMap.get("quarter");
+        //int year = 2019;
+        //int quarter = 4;
         Map<String, String> timeMap = DateUtils.quarterStartEndDate(year, quarter);
         String startTime = timeMap.get("startDate");
         String endTime = timeMap.get("endDate");
@@ -1670,10 +1670,10 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
     public List<UserDto2> kuaishouYouhuaPerformanceInfoNow() {
         //0 获取当前季度的时间
         Map<String, Integer> dateMap = DateUtils.getYearQuarter(new Date());
-        //Integer year = dateMap.get("year");
-        //Integer quarter = dateMap.get("quarter");
-        int year = 2019;
-        int quarter = 4;
+        Integer year = dateMap.get("year");
+        Integer quarter = dateMap.get("quarter");
+        //int year = 2019;
+        //int quarter = 4;
         Map<String, String> timeMap = DateUtils.quarterStartEndDate(year, quarter);
         String startTime = timeMap.get("startDate");
         String endTime = timeMap.get("endDate");
@@ -1698,10 +1698,10 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
     public List<UserDto2> toutiaoYouhuaPerformanceInfoNow() {
         //0 获取当前季度的时间
         Map<String, Integer> dateMap = DateUtils.getYearQuarter(new Date());
-        //Integer year = dateMap.get("year");
-        //Integer quarter = dateMap.get("quarter");
-        int year = 2019;
-        int quarter = 4;
+        Integer year = dateMap.get("year");
+        Integer quarter = dateMap.get("quarter");
+        //int year = 2019;
+        //int quarter = 4;
         Map<String, String> timeMap = DateUtils.quarterStartEndDate(year, quarter);
         String startTime = timeMap.get("startDate");
         String endTime = timeMap.get("endDate");
@@ -1895,7 +1895,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         String endTime = timeMap.get("endDate");
 
         //1 获取快手下所有人
-        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouDepartUserInfo();
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouDepartAllUserInfo();
         //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
         for (UserDto2 userDto : userDto2List) {
             //String roleCode = userDto.getRoleCode();
@@ -1910,7 +1910,9 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             }
             //2.4 当季度绩效
             BigDecimal performance = userEfficientVideoMapMapper.getQuarterPerformance(userDto.getUserId(), year, quarter, 2);
-
+            if(performance==null){
+                performance=BigDecimal.ZERO;
+            }
             userDto.setEffiRate(performance);
             userDto.setCost(cost);
             userDto.setVideoCount(videoCount);
@@ -1928,7 +1930,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         String endTime = timeMap.get("endDate");
 
         //1 获取头条下所有人
-        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoDepartUserInfo();
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoDepartAllUserInfo();
         //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
         for (UserDto2 userDto : userDto2List) {
             //String roleCode = userDto.getRoleCode();
@@ -1943,7 +1945,9 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             }
             //2.4 当季度绩效
             BigDecimal performance = userEfficientVideoMapMapper.getQuarterPerformance(userDto.getUserId(), year, quarter, 1);
-
+            if(performance==null){
+                performance=BigDecimal.ZERO;
+            }
             userDto.setEffiRate(performance);
             userDto.setCost(cost);
             userDto.setVideoCount(videoCount);
@@ -1969,10 +1973,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         return materialInfoList;
     }
 
-
-
     //快手优化季度绩效报表
-    //@Override
+    @Override
     public List<UserDto2> kuaishouYouhuaQuarterReport(Integer year, Integer quarter) {
         //1 获取快手下所有人
         List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouYunyingDepartUserInfo();
@@ -1985,6 +1987,9 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             }
             //当季度绩效
             BigDecimal performance = userEfficientVideoMapMapper.getQuarterPerformance(userDto.getUserId(), year, quarter, 2);
+            if(performance==null){
+                performance=BigDecimal.ZERO;
+            }
             userDto.setEffiRate(performance);
             userDto.setCost(cost);
             userDto.setYear(year);
@@ -2008,6 +2013,9 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             }
             //当季度绩效
             BigDecimal performance = userEfficientVideoMapMapper.getQuarterPerformance(userDto.getUserId(), year, quarter, 1);
+            if(performance==null){
+                performance=BigDecimal.ZERO;
+            }
             userDto.setEffiRate(performance);
             userDto.setCost(cost);
             userDto.setYear(year);

+ 26 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyAgentSumController.java

@@ -9,6 +9,7 @@ import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent;
 import cn.com.ctop.kuaishou.modules.report.entity.ParamsDTO;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
@@ -240,6 +241,7 @@ public class KuaishouReportDailyAgentSumController {
 		 if(StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)){
 			 result.setSuccess(false);
 			 result.setMessage("时间不能为空");
+			 return result;
 		 }
 
 		 KuaishouReportDailyAgentSum kuaishouReportDailyAgentSum = kuaishouReportDailyAgentSumService.companyReportSum(startDate,endDate);
@@ -250,4 +252,28 @@ public class KuaishouReportDailyAgentSumController {
 		 return result;
 	 }
 
+	 /**
+	  * @param dto
+	  * @return Result<KuaishouReportDailyAgentSum>
+	  */
+	 @AutoLog(value = "公司报表按时间汇总")
+	 @ApiOperation(value="公司报表按时间汇总", notes="公司报表按时间汇总")
+	 @PostMapping(value = "/companyReportAccountDetailList")
+	 public Result<List<KuaishouReportDailyAgent>> companyReportAccountDetailList(@RequestBody ParamsDTO dto) {
+		 Result<List<KuaishouReportDailyAgent>> result = new Result<>();
+		 String date = dto.getDate();
+		 if(StringUtils.isBlank(date)){
+			 result.setSuccess(false);
+			 result.setMessage("时间不能为空");
+			 return result;
+		 }
+
+		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(date);
+		 result.setResult(kuaishouReportDailyAgentList);
+		 result.setSuccess(true);
+		 result.setMessage("success");
+
+		 return result;
+	 }
+
 }

+ 5 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAgentSum.java

@@ -38,7 +38,7 @@ public class KuaishouReportDailyAgentSum {
 	/**有消费计划数*/
 	@Excel(name = "有消费计划数", width = 15)
     @ApiModelProperty(value = "有消费计划数")
-	private Integer costCampaignCount;
+	private Long costCampaignCount;
 	/**总余额*/
 	@Excel(name = "总余额", width = 15)
     @ApiModelProperty(value = "总余额")
@@ -70,19 +70,19 @@ public class KuaishouReportDailyAgentSum {
 	/**封面曝光数*/
 	@Excel(name = "封面曝光数", width = 15)
     @ApiModelProperty(value = "封面曝光数")
-	private Integer fengmianShowCount;
+	private Long fengmianShowCount;
 	/**封面点击数*/
 	@Excel(name = "封面点击数", width = 15)
     @ApiModelProperty(value = "封面点击数")
-	private Integer fengmianClickCount;
+	private Long fengmianClickCount;
 	/**素材曝光数*/
 	@Excel(name = "素材曝光数", width = 15)
     @ApiModelProperty(value = "素材曝光数")
-	private Integer sucaiShowCount;
+	private Long sucaiShowCount;
 	/**行为数*/
 	@Excel(name = "行为数", width = 15)
     @ApiModelProperty(value = "行为数")
-	private Integer convertCount;
+	private Long convertCount;
 	/**封面点击率*/
 	@Excel(name = "封面点击率", width = 15)
     @ApiModelProperty(value = "封面点击率")

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

@@ -9,4 +9,5 @@ import java.io.Serializable;
 public class ParamsDTO implements Serializable {
     private String startDate;
     private String endDate;
+    private String date;
 }

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAgentSumMapper.java

@@ -2,6 +2,7 @@ package cn.com.ctop.kuaishou.modules.report.mapper;
 
 import java.util.List;
 
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgentSum;
 import org.apache.ibatis.annotations.Param;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -16,4 +17,6 @@ public interface KuaishouReportDailyAgentSumMapper extends BaseMapper<KuaishouRe
     List<KuaishouReportDailyAgentSum> companyReport(@Param("startDate")String startDate, @Param("endDate")String endDate);
 
     KuaishouReportDailyAgentSum companyReportSum(@Param("startDate")String startDate, @Param("endDate")String endDate);
+
+    List<KuaishouReportDailyAgent> companyReporAccountDetailList(@Param("date")String date);
 }

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

@@ -49,4 +49,33 @@
         date &lt;= #{endDate} and
         date &gt;= #{startDate}
     </select>
+
+    <!-- 根据传入时间获取公司报表账户的列表 -->
+    <select id="companyReporAccountDetailList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent">
+            select
+            date as date,  <!-- 日期 -->
+            account_id as accountId,  <!-- 账户id -->
+            kid as kid, <!-- 快手id -->
+            advertiser_name as advertiserName, <!-- 广告主名称 -->
+            advertiser_create_time as advertiserCreateTime, <!-- 广告主创建时间 -->
+            cost_campaign_count as costCampaignCount, <!-- 有消费计划数 -->
+            balance as balance, <!-- 总余额 -->
+            cost as cost, <!-- 总消耗 -->
+            xianjin_cost as xianjinCost, <!-- 现金消耗 -->
+            fandian_cost as fandianCost, <!-- 后返消耗 -->
+            kuangfan_cost as kuangfanCost, <!-- 框返消耗 -->
+            jili_cost as jiliCost, <!-- 激励账户消耗 -->
+            xinyong_cost as xinyongCost, <!-- 信用账户消耗 -->
+            fengmian_show_count as fengmianShowCount, <!-- 封面曝光数 -->
+            fengmian_click_count as fengmianClickCount, <!-- 封面点击数 -->
+            sucai_show_count as sucaiShowCount, <!-- 素材曝光数 -->
+            convert_count as convertCount, <!-- 行为数 -->
+            fengmian_click_rate as fengmianClickRate, <!-- 封面点击率 -->
+            convert_click_rate as convertClickRate <!-- 转化点击率 -->
+        from
+        ctop_kuaishou_report_daily_agent
+        where
+        date_format(date, '%Y-%m-%d') = #{date}
+    </select>
+
 </mapper>

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyAgentSumService.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.service;
 
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgentSum;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -14,4 +15,6 @@ import java.util.List;
 public interface IKuaishouReportDailyAgentSumService extends IService<KuaishouReportDailyAgentSum> {
     List<KuaishouReportDailyAgentSum> companyReport(String startDate, String endDate);
     KuaishouReportDailyAgentSum companyReportSum(String startDate, String endDate);
+
+    List<KuaishouReportDailyAgent> companyReportAccountDetailList(String date);
 }

+ 5 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAgentServiceImpl.java

@@ -123,17 +123,17 @@ public class KuaishouReportDailyAgentServiceImpl extends ServiceImpl<KuaishouRep
                             KuaishouReportDailyAgentSum kuaishouReportDailyAgentSum = new KuaishouReportDailyAgentSum();
                             kuaishouReportDailyAgentSum.setBalance(dataNode.get("totalBalanceDouble").decimalValue());
                             kuaishouReportDailyAgentSum.setConvertClickRate(dataNode.get("actionbarClickRatio").decimalValue());
-                            kuaishouReportDailyAgentSum.setConvertCount(dataNode.get("actionbarClick").asInt());
+                            kuaishouReportDailyAgentSum.setConvertCount(dataNode.get("actionbarClick").asLong());
                             kuaishouReportDailyAgentSum.setCost(dataNode.get("totalChargedInYuan").decimalValue());
-                            kuaishouReportDailyAgentSum.setCostCampaignCount(dataNode.get("chargedCampaignCount").asInt());
+                            kuaishouReportDailyAgentSum.setCostCampaignCount(dataNode.get("chargedCampaignCount").asLong());
                             kuaishouReportDailyAgentSum.setDate(sdf.parse(currentDate));
-                            kuaishouReportDailyAgentSum.setFengmianClickCount(dataNode.get("adPhotoClick").asInt());
+                            kuaishouReportDailyAgentSum.setFengmianClickCount(dataNode.get("adPhotoClick").asLong());
                             kuaishouReportDailyAgentSum.setFengmianClickRate(dataNode.get("clickRatio").decimalValue());
-                            kuaishouReportDailyAgentSum.setFengmianShowCount(dataNode.get("impression").asInt());
+                            kuaishouReportDailyAgentSum.setFengmianShowCount(dataNode.get("impression").asLong());
                             kuaishouReportDailyAgentSum.setFandianCost(dataNode.get("rebateRealChargedInYuan").decimalValue());
                             kuaishouReportDailyAgentSum.setJiliCost(dataNode.get("directRebateRealChargedInYuan").decimalValue());
                             kuaishouReportDailyAgentSum.setKuangfanCost(dataNode.get("contractRebateRealChargedInYuan").decimalValue());
-                            kuaishouReportDailyAgentSum.setSucaiShowCount(dataNode.get("click").asInt());
+                            kuaishouReportDailyAgentSum.setSucaiShowCount(dataNode.get("click").asLong());
                             kuaishouReportDailyAgentSum.setXianjinCost(dataNode.get("realChargedInYuan").decimalValue());
                             kuaishouReportDailyAgentSum.setXinyongCost(dataNode.get("creditRealChargedInYuan").decimalValue());
                             QueryWrapper<KuaishouReportDailyAgentSum> queryWrapper = new QueryWrapper<>();

+ 7 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAgentSumServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgentSum;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAgentSumMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentSumService;
@@ -32,4 +33,10 @@ public class KuaishouReportDailyAgentSumServiceImpl extends ServiceImpl<Kuaishou
         return kuaishouReportDailyAgentSumMapper.companyReportSum(startDate, endDate);
     }
 
+    //公司报表详情
+    @Override
+    public List<KuaishouReportDailyAgent> companyReportAccountDetailList(String date){
+        return kuaishouReportDailyAgentSumMapper.companyReporAccountDetailList(date);
+    }
+
 }

+ 12 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedancePlanDailyReportMapper.java

@@ -3,6 +3,7 @@ package cn.com.ctop.bytedance.mapper;
 import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -15,4 +16,15 @@ import java.util.List;
 public interface BytedancePlanDailyReportMapper extends BaseMapper<BytedancePlanDailyReport> {
 
     void replaceBatch(@Param(value = "reports") List<BytedancePlanDailyReport> dailyReports);
+
+    @Update("update ctop_bytedance_report_plan_daily " +
+            "set channel_code = replace(substring_index(ad_name, '-', 1), '.apk', '') " +
+            "where advertiser_id in (select account_id from ctop_user_allocation where project_id = #{projectId})")
+    void cleanYzData(@Param(value = "projectId") Integer projectId);
+
+    @Update("update ctop_bytedance_report_plan_daily " +
+            "set channel_code = replace(replace(replace(substring_index(ad_name, '-', 2), '衍生计划-', ''), '.apk',''),'-','') " +
+            "where advertiser_id in (select account_id from ctop_user_allocation where project_id = #{projectId}) " +
+            "  and channel_code = '衍生计划' ")
+    void cleanYzDataFuck(@Param(value = "projectId") Integer projectId);
 }

+ 2 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedancePlanDailyReportService.java

@@ -16,4 +16,6 @@ public interface IBytedancePlanDailyReportService extends IService<BytedancePlan
     void loadData(String data, String date);
 
     void replaceBatch(List<BytedancePlanDailyReport> dailyReports);
+
+    void cleanYzData(Integer projectId);
 }

+ 6 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedancePlanDailyReportServiceImpl.java

@@ -48,4 +48,10 @@ public class BytedancePlanDailyReportServiceImpl extends ServiceImpl<BytedancePl
     public void replaceBatch(List<BytedancePlanDailyReport> dailyReports) {
         dailyReportMapper.replaceBatch(dailyReports);
     }
+
+    @Override
+    public void cleanYzData(Integer projectId) {
+        dailyReportMapper.cleanYzData(projectId);
+        dailyReportMapper.cleanYzDataFuck(projectId);
+    }
 }

+ 0 - 4
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java

@@ -327,7 +327,6 @@ public class ReportServiceImpl implements IReportService {
         }
         JSONArray dataArray = getObject.getJSONObject("data").getJSONArray("list");
         if (null == dataArray || dataArray.size() <= 0) {
-            log.info("广告创意报表信息为空=》accountId:{}", token.getAccountId());
             return;
         }
         List<BytedanceCreativeHourlyReport> hourlyReports = new ArrayList<>();
@@ -336,11 +335,9 @@ public class ReportServiceImpl implements IReportService {
             var data = dataArray.getJSONObject(i);
             if (null != conditions.getTimeGranularity() && CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY.equals(conditions.getTimeGranularity())) {
                 var hourlyReport = new BytedanceCreativeHourlyReport(data, token.getAccountId());
-//                creativeHourlyReportService.saveOrUpdate(hourlyReport);
                 hourlyReports.add(hourlyReport);
             } else {
                 var dailyReport = new BytedanceCreativeDailyReport(data, token.getAccountId());
-//                creativeDailyReportService.saveOrUpdate(dailyReport);
                 if (!Check.isNull(dailyReport)) {
                     Long creativeId = dailyReport.getCreativeId();
                     String signature = creativeHourlyReportService.getSignatureByCreativeId(creativeId);
@@ -348,7 +345,6 @@ public class ReportServiceImpl implements IReportService {
                         dailyReport.setSignature(signature);
                     }
                 }
-
                 dailyReports.add(dailyReport);
             }
         }

+ 4 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/ByteDanceCreativeMapper.java

@@ -2,6 +2,9 @@ package cn.com.ctop.toutiao.mapper;
 
 import cn.com.ctop.toutiao.entity.ByteDanceCreative;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Description: 今日头条创意信息
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ByteDanceCreativeMapper extends BaseMapper<ByteDanceCreative> {
 
+    void replaceBatch(@Param(value = "creatives") List<ByteDanceCreative> creatives);
 }

+ 44 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/ByteDanceCreativeMapper.xml

@@ -1,5 +1,48 @@
 <?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.toutiao.mapper.ByteDanceCreativeMapper">
-
+    <insert id="replaceBatch">
+        replace into ctop_bytedance_creative(
+        id,
+        plan_id,
+        toutiao_id,
+        account_id,
+        title,
+        creative_word_ids,
+        status,
+        opt_status,
+        image_mode,
+        image_ids,
+        image_id,
+        video_id,
+        audit_reject_reason,
+        third_party_id,
+        creative_create_time,
+        creative_modify_time,
+        create_time,
+        update_time)
+        values
+        <foreach collection="creatives" item="report" separator=",">
+            (
+            #{report.id},
+            #{report.planId},
+            #{report.toutiaoId},
+            #{report.accountId},
+            #{report.title},
+            #{report.creativeWordIds},
+            #{report.status},
+            #{report.optStatus},
+            #{report.imageMode},
+            #{report.imageIds},
+            #{report.imageId},
+            #{report.videoId},
+            #{report.auditRejectReason},
+            #{report.thirdPartyId},
+            #{report.creativeCreateTime},
+            #{report.creativeModifyTime},
+            #{report.createTime},
+            #{report.updateTime}
+            )
+        </foreach>
+    </insert>
 </mapper>

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceAdvertiserDataService.java

@@ -20,6 +20,8 @@ public interface IByteDanceAdvertiserDataService {
 
     Map<String, Object> getAdvertiserCreativeMaterial(String accountId, String creativeIds);
 
+    Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String date);
+
     Map<String, Object> advertiserCampaignUpdateStatus(String accountId, String campaignIds, String optStatus);
 
     Map<String, Object> advertiserCampaignUpdate(String accountId, Long campaignId, String budgetMode, Integer budget, String campaignName);

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IByteDanceCreativeService.java

@@ -4,6 +4,7 @@ import cn.com.ctop.toutiao.entity.ByteDanceCreative;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -23,4 +24,6 @@ public interface IByteDanceCreativeService extends IService<ByteDanceCreative> {
     Map<String, Object> getAdvertiserCreative(String accountId, String ids, String date);
 
     Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus);
+
+    void replaceBatch(List<ByteDanceCreative> creatives);
 }

+ 54 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.toutiao.entity.*;
+import cn.com.ctop.toutiao.mapper.ByteDanceCreativeMapper;
 import cn.com.ctop.toutiao.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -27,12 +28,12 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     @Autowired
     private IByteDanceCreativeMaterialService creativeMaterialService;
     @Autowired
+    private ByteDanceCreativeMapper creativeMapper;
+    @Autowired
     private IByteDanceAdvertiserBudgetService advertiserBudgetService;
     @Autowired
     private IByteDanceCampaignService campaignService;
     @Autowired
-    private IByteDanceAdvertiserService advertiserService;
-    @Autowired
     private IByteDanceImageInfoService imageInfoService;
     @Autowired
     private IByteDanceVideoInfoService videoInfoService;
@@ -234,6 +235,56 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     }
 
     @Override
+    public Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String date) {
+        log.info("开始获取创意信息=>accountId:{}", token.getAccountId());
+        Map<String, Object> result = new HashMap<>();
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        getCreativeByPage(token, date, 1);
+        log.info("创意信息获取结束=>accountId:{}", token.getAccountId());
+        return result;
+    }
+
+    private void getCreativeByPage(CtopOauthToken token, String date, int pageNum) {
+        JSONObject resultObject = getCreative(token, date, pageNum);
+        Integer code = resultObject.getInteger("code");
+        if (null == code || !code.equals(0)) {
+            log.error("头条创意素材获取接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
+            return;
+        }
+        JSONArray data = resultObject.getJSONObject("data").getJSONArray("list");
+        if (null == data || data.size() <= 0) {
+            return;
+        }
+        List<ByteDanceCreative> creatives = new ArrayList<>();
+        for (int i = 0; i < data.size(); i++) {
+            JSONObject dataObject = data.getJSONObject(i);
+            ByteDanceCreative creative = new ByteDanceCreative(dataObject, token.getAccountId() + "");
+            creatives.add(creative);
+        }
+        creativeMapper.replaceBatch(creatives);
+        getVideoByPage(token, date, pageNum + 1);
+    }
+
+
+    public JSONObject getCreative(CtopOauthToken token, String date, int pageNumber) {
+        final Long advertiser_id = token.getAccountId();  //操作的广告主id
+        // 请求地址
+        String url = "https://ad.oceanengine.com/open_api/2/creative/get/";
+
+        // 请求参数
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", advertiser_id);
+        param.put("page", pageNumber);
+        param.put("page_size", 100);
+        if (null != date && !date.trim().equals("")) {
+            JSONObject filtering = new JSONObject();
+            filtering.put("creative_create_time", date);
+            param.put("filtering", filtering);
+        }
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
+    }
+
+    @Override
     public Map<String, Object> advertiserCampaignUpdateStatus(String accountId, String campaignIds, String optStatus) {
         Map<String, Object> resultMap = new HashMap<>();
         JSONArray ids = new JSONArray();
@@ -495,6 +546,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         return resultMap;
     }
 
+
     /**
      * 查询人群包信息
      *

+ 8 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceCreativeServiceImpl.java

@@ -27,6 +27,7 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -47,6 +48,8 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
     private IBytedanceAdvertisePlanTemplateService planTemplateService;
     @Autowired
     private ICtopOauthTokenService tokenService;
+    @Autowired
+    private ByteDanceCreativeMapper creativeMapper;
 
     @Override
     public Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus) {
@@ -96,6 +99,11 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
     }
 
     @Override
+    public void replaceBatch(List<ByteDanceCreative> creatives) {
+        creativeMapper.replaceBatch(creatives);
+    }
+
+    @Override
     public Map<String, Object> getAdvertiserCreative(String accountId, String ids, String date) {
         Map<String, Object> resultMap = new HashMap<>();
         getAdvertiserCreativeByPageNumber(accountId, 1, ids, date);

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

@@ -108,8 +108,9 @@ 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);
@@ -128,8 +129,7 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
     //获取头条单个优化师其下所有的账户下当前的消耗
     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);
+
 }
 

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

@@ -509,7 +509,7 @@
         where c.signature is not null and d.id is not null
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &lt;= #{endDate}
-        where e.plan_id = #{userId}
+        and e.plan_id = #{userId}
     </select>
 
     <!-- 头条根据clip_id获取视频总消耗 -->
@@ -524,7 +524,7 @@
         where c.signature is not null and d.id is not null
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &lt;= #{endDate}
-        where e.clip_id = #{userId}
+        and e.clip_id = #{userId}
     </select>
 
     <!-- 头条根据shot_id获取视频总消耗 -->
@@ -539,7 +539,7 @@
         where c.signature is not null and d.id is not null
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &lt;= #{endDate}
-        where e.shot_id = #{userId}
+        and e.shot_id = #{userId}
     </select>
 
     <!-- 根据year、quarter、user_id获取季度总绩效 -->
@@ -714,7 +714,25 @@
 
     <!-- 获取北京快手设计部所有编导、剪辑、拍摄的信息 -->
     <select id="getKuaishouDepartUserInfo" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
-        select u.id as userId,
+            select
+            u.id as userId,
+            u.realname as realname,
+            r.role_name as roleName,
+            r.role_code as roleCode,
+            r.id as roleId
+        FROM sys_user_depart ud
+        left join sys_depart b on ud.dep_id = b.id
+        left join sys_user u on ud.user_id = u.id
+        left join sys_user_role ur on u.id = ur.user_id
+        left join sys_role r on ur.role_id = r.id
+        WHERE b.parent_id = '4e939124a5f541c88838e49d2a3ea72b'  <!-- 快手设计部 -->
+        and r.role_code in ('plan','clip','shot')
+    </select>
+
+    <!-- 获取北京快手设计部所有人员的信息 -->
+    <select id="getKuaishouDepartAllUserInfo" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        u.id as userId,
         u.realname as realname,
         r.role_name as roleName,
         r.role_code as roleCode,
@@ -725,11 +743,26 @@
         left join sys_user_role ur on u.id = ur.user_id
         left join sys_role r on ur.role_id = r.id
         WHERE b.parent_id = '4e939124a5f541c88838e49d2a3ea72b'  <!-- 快手设计部 -->
-        and r.role_code in ('plan','clip','shot')
     </select>
 
     <!-- 获取北京头条设计部所有编导、剪辑、拍摄的信息 -->
     <select id="getToutiaoDepartUserInfo" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+            select u.id as userId,
+            u.realname as realname,
+            r.role_name as roleName,
+            r.role_code as roleCode,
+            r.id as roleId
+        FROM sys_user_depart ud
+        left join sys_depart b on ud.dep_id = b.id
+        left join sys_user u on ud.user_id = u.id
+        left join sys_user_role ur on u.id = ur.user_id
+        left join sys_role r on ur.role_id = r.id
+        WHERE b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'  <!-- 头条设计部 -->
+        and r.role_code in ('plan','clip','shot')
+    </select>
+
+    <!-- 获取北京头条设计部所有编导、剪辑、拍摄的信息 -->
+    <select id="getToutiaoDepartAllUserInfo" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
         select u.id as userId,
         u.realname as realname,
         r.role_name as roleName,
@@ -740,8 +773,7 @@
         left join sys_user u on ud.user_id = u.id
         left join sys_user_role ur on u.id = ur.user_id
         left join sys_role r on ur.role_id = r.id
-        WHERE b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'  <!-- 快手设计部 -->
-        and r.role_code in ('plan','clip','shot')
+        WHERE b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'  <!-- 头条设计部 -->
     </select>
 
     <!-- 获取北京快手运营部所有优化师得信息 -->
@@ -756,7 +788,7 @@
         left join sys_user u on ud.user_id = u.id
         left join sys_user_role ur on u.id = ur.user_id
         left join sys_role r on ur.role_id = r.id
-        WHERE b.parent_id = '0dd29c09d2c94f98ae91902094c6cf68'  <!-- 快手运营部 -->
+        WHERE b.parent_id = '024b0dc0840045afb048022a8c61253f'  <!-- 快手运营部 -->
     </select>
 
     <!-- 获取北京头条运营部所有优化师得信息 -->
@@ -771,7 +803,7 @@
         left join sys_user u on ud.user_id = u.id
         left join sys_user_role ur on u.id = ur.user_id
         left join sys_role r on ur.role_id = r.id
-        WHERE b.parent_id = '989799ba602e40fcb03f522d5284b705'  <!-- 头条运营部 -->
+        WHERE b.parent_id = 'c869de6bedc44a50803e45a4611df05e'  <!-- 头条运营部 -->
     </select>
 
     <!-- 获取快手单个优化师当前账户下的总消耗 -->