syh 5 سال پیش
والد
کامیت
ddf0a67ea8
94فایلهای تغییر یافته به همراه5279 افزوده شده و 923 حذف شده
  1. 25 23
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 27 0
      jeecg-boot-module-system/pom.xml
  3. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java
  4. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  5. 7 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CrawlerController.java
  6. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/EffiVideoJob.java
  7. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/test/controller/JeecgOrderDmainController.java
  8. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/test/controller/JeecgOrderMainController.java
  9. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/fegin/LogService.java
  10. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/performanceappraisal/controller/OptimizerRoleInfoController.java
  11. 288 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java
  12. 29 29
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementController.java
  13. 23 23
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementSendController.java
  14. 21 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserAgentController.java
  15. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysRoleMapper.xml
  16. 65 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService2.java
  17. 1467 410
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java
  18. 6 0
      jeecg-boot-module-system/src/main/resources/application.yml
  19. 118 0
      log-server/.mvn/wrapper/MavenWrapperDownloader.java
  20. BIN
      log-server/.mvn/wrapper/maven-wrapper.jar
  21. 2 0
      log-server/.mvn/wrapper/maven-wrapper.properties
  22. 376 0
      log-server/pom.xml
  23. 13 0
      log-server/src/main/java/cn/com/ctop/logserver/LogServerApplication.java
  24. 17 0
      log-server/src/main/java/cn/com/ctop/logserver/controller/LogController.java
  25. 160 0
      log-server/src/main/resources/application-dev.yml
  26. 159 0
      log-server/src/main/resources/application-prod.yml
  27. 161 0
      log-server/src/main/resources/application-test.yml
  28. 15 0
      log-server/src/main/resources/application.yml
  29. 14 0
      log-server/src/main/resources/banner.txt
  30. 4 0
      log-server/src/main/resources/log4j.properties
  31. 57 0
      log-server/src/main/resources/logback-dev.xml
  32. 57 0
      log-server/src/main/resources/logback-prod.xml
  33. 57 0
      log-server/src/main/resources/logback-test.xml
  34. 6 0
      log-server/src/main/resources/quartz.properties
  35. 3 3
      mondule-jbpm/src/test/java/cn/com/ctop/jbpm/JbpmApplicationTests.java
  36. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  37. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  38. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java
  39. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  40. 37 0
      module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceCreativeDailyReportController.java
  41. 10 0
      module-report/src/main/java/cn/com/ctop/bytedance/entity/BytedanceCreativeDailyReport.java
  42. 7 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceCreativeDailyReportMapper.java
  43. 92 0
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceCreativeDailyReportMapper.xml
  44. 9 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceCreativeDailyReportService.java
  45. 44 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceCreativeDailyReportServiceImpl.java
  46. 31 16
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java
  47. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceVideoInfo.java
  48. 6 2
      module-toutiao/src/main/resources/bytedance_config.properties
  49. 0 49
      mondule-jbpm/pom.xml
  50. 0 13
      mondule-jbpm/src/main/java/cn/com/ctop/jbpm/JbpmApplication.java
  51. 0 29
      mondule-jbpm/src/main/java/cn/com/ctop/jbpm/service/ActivitiTable.java
  52. 0 1
      mondule-jbpm/src/main/resources/application.properties
  53. 0 76
      mondule-jbpm/src/main/resources/processes/testbpm.bpmn
  54. 118 0
      moudule-eureca/.mvn/wrapper/MavenWrapperDownloader.java
  55. BIN
      moudule-eureca/.mvn/wrapper/maven-wrapper.jar
  56. 2 0
      moudule-eureca/.mvn/wrapper/maven-wrapper.properties
  57. 62 0
      moudule-eureca/pom.xml
  58. 15 0
      moudule-eureca/src/main/java/cn/com/ctop/eureca/server/ServerApplication.java
  59. 14 0
      moudule-eureca/src/main/resources/application.yml
  60. 13 0
      moudule-eureca/src/test/java/cn/com/ctop/eureca/server/ServerApplicationTests.java
  61. 0 13
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/PerformanceAppraisalApplication.java
  62. 248 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceConfigController.java
  63. 71 4
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceController.java
  64. 48 31
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceOptimizerController.java
  65. 11 2
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/OptimizerConfig.java
  66. 3 3
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/Performance.java
  67. 63 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/PerformanceConfig.java
  68. 2 2
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/PerformanceOptimizer.java
  69. 2 2
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/RolePerformancRraise.java
  70. 2 2
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/RolePerformanceCommission.java
  71. 15 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/PerformanceConfigMapper.java
  72. 14 5
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/PerformanceMapper.java
  73. 5 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/xml/PerformanceConfigMapper.xml
  74. 143 8
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/xml/PerformanceMapper.xml
  75. 1 1
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IOptimizerConfigService.java
  76. 1 1
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IOptimizerRoleInfoService.java
  77. 16 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceConfigService.java
  78. 2 2
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceOptimizerService.java
  79. 5 4
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceService.java
  80. 6 2
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/OptimizerConfigServiceImpl.java
  81. 3 3
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/OptimizerRoleInfoServiceImpl.java
  82. 34 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceConfigServiceImpl.java
  83. 198 42
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceOptimizerServiceImpl.java
  84. 37 47
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceServiceImpl.java
  85. 96 0
      performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/vo/UserPerformanceDetailVO.java
  86. 19 9
      performance-appraisal/src/main/java/cn/com/ctop/planeprojectcost/entity/PlaneProjectCost.java
  87. 21 0
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/PlaneProjectCostDTO.java
  88. 1 1
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/ProjectDTO.java
  89. 1 1
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/SysRole.java
  90. 16 0
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserDto2.java
  91. 11 7
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserEfficientVideoMap.java
  92. 59 2
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/UserEfficientVideoMapMapper.java
  93. 445 10
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml
  94. 1 0
      pom.xml

+ 25 - 23
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -923,7 +923,6 @@ public class DateUtils extends PropertyEditorSupport {
     /**
      * 根据时间获取季度
      * 1即Q1(1,2,3月),以此类推
-     *
      * @param date
      * @return
      */
@@ -947,7 +946,6 @@ public class DateUtils extends PropertyEditorSupport {
 
     /**
      * 获取【所在周】周五的时间(周五为一周第一天,周四为一周最后一天)
-     *
      * @param date
      */
     public static Date getFriday(Date date) {
@@ -1059,7 +1057,6 @@ public class DateUtils extends PropertyEditorSupport {
     /**
      * 计算季度开始、结束时间
      * 原则:周五为本周的第一天,下一周的周四为本周的最后一天
-     *
      * @param year
      * @param quarter
      */
@@ -1127,30 +1124,35 @@ public class DateUtils extends PropertyEditorSupport {
         return quarterStartEndDateMap;
     }
 
-    public static void main(String[] args) throws ParseException {
-        //SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-        //Date friDay = DateUtils.getFriday(new Date());
-        //Date effiCalcStart = DateUtils.addDay(friDay,  -14);
-        //System.out.println(sdf.format(effiCalcStart));
-        //Date effiCalcEnd = DateUtils.addDay(friDay,  -1);
-        //System.out.println(sdf.format(effiCalcEnd));
-        //
-        //Date effiEnd = DateUtils.addDay(friDay,  -21);
-        //System.out.println(sdf.format(effiEnd));
-        //Date effiStart = DateUtils.addDay(friDay,  -15);
-        //System.out.println(sdf.format(effiStart));
-
-        Map<String, Integer> map1 = DateUtils.getYearQuarter(DateUtils.parseDate("2020-04-01", "yyyy-MM-dd"));
-
-        Map<String, String> map2 = DateUtils.quarterStartEndDate(2019, 1);
-
-        for (String key : map2.keySet()) {
-            System.out.println(key + ":" + map2.get(key));
+    /**
+     * 获取上个季度的年度和季度数
+     *
+     * @param date
+     * @return
+     */
+    public static Map<String, Integer> lastQuarter(Date date) {
+        Map<String, Integer> resultMap = new HashMap<>();
+        //获取当天所在
+        Map<String, Integer> yearQuarter = getYearQuarter(date);
+        Integer year = yearQuarter.get("year");
+        Integer quarter = yearQuarter.get("quarter");
+
+        Integer lastyear = 0;
+        Integer lastQuarter = 0;
+
+        if (quarter == 4 || quarter == 3 || quarter == 2) {
+            lastyear = year;
+            lastQuarter = quarter - 1;
+        } else {
+            lastyear = year - 1;
+            lastQuarter = 4;
         }
 
+        resultMap.put("year", lastyear);
+        resultMap.put("quarter", lastQuarter);
 
+        return resultMap;
     }
-
 }
 
 

+ 27 - 0
jeecg-boot-module-system/pom.xml

@@ -11,6 +11,11 @@
         <version>2.0.2</version>
     </parent>
 
+    <properties>
+        <java.version>1.8</java.version>
+        <spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
+    </properties>
+
     <repositories>
         <repository>
             <id>aliyun</id>
@@ -36,6 +41,16 @@
     </repositories>
 
     <dependencies>
+        <!--<dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>-->
+
         <!-- rabbitmq 依赖jar包-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -138,6 +153,18 @@
         </dependency>
     </dependencies>
 
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
     <build>
         <plugins>
             <plugin>

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java

@@ -20,8 +20,9 @@ import java.net.UnknownHostException;
 @SpringBootApplication
 @ComponentScan(basePackages = {"cn.com.ctop", "org.jeecg"})
 @Configuration
-
-
+/*@EnableEurekaClient
+@EnableDiscoveryClient
+@EnableFeignClients*/
 public class JeecgApplication {
     public static void main(String[] args) throws UnknownHostException {
         ConfigurableApplicationContext application = SpringApplication.run(JeecgApplication.class, args);

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -73,7 +73,7 @@ public class ShiroConfig {
 		filterChainDefinitionMap.put("/ctop/bytedanceAreaInfo/**", "anon");
 		filterChainDefinitionMap.put("/ctop/bytedanceInterestCategory/**", "anon");
 		filterChainDefinitionMap.put("/template/creative/words/get", "anon");
-        filterChainDefinitionMap.put("/appium/crawler/startJob", "anon");
+		filterChainDefinitionMap.put("/appium/crawler/*", "anon");
 
 		//优化师相关
 		//filterChainDefinitionMap.put("/ctop/performanceOptimizer/detail", "anon");

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

@@ -3,10 +3,7 @@ package org.jeecg.modules.ctop.controller;
 import org.jeecg.modules.ctop.service.ICrawlerService;
 import org.jeecg.modules.ctop.vo.KuaishouAppiumJobVO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
@@ -20,4 +17,10 @@ public class CrawlerController {
     public Map<String, Object> runTask(@RequestBody KuaishouAppiumJobVO jobVO) {
         return crawlerService.startJob(jobVO);
     }
+
+    public static void main(String[] args) {
+        int a = 2;
+        int b = 7791;
+        System.out.println(a & b);
+    }
 }

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.ctop.job;
 
 
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.system.service.IPerformanceService2;
 import org.quartz.Job;
@@ -12,6 +13,7 @@ import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+@Slf4j
 public class EffiVideoJob implements Job {
     @Autowired
     private IPerformanceService2 performanceService;
@@ -26,6 +28,9 @@ public class EffiVideoJob implements Job {
     public void execute(JobExecutionContext jobExecutionContext) {
         //有效视频定时任务,默认跑前一天的
         DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String calcDate = sdf.format(DateUtils.addDay(new Date(), -1));
+        log.info("有效视频定时任务开始执行,有效视频所属时间为" + calcDate);
         performanceService.efficientVideoTask(sdf.format(DateUtils.addDay(new Date(), -1)));
+        log.info("有效视频定时任务结束");
     }
 }

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/test/controller/JeecgOrderDmainController.java

@@ -32,7 +32,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
 /**
- * @Title: Controller
+ * @Title: controller
  * @Description: 订单模拟
  * @Author: ZhiLin
  * @Date: 2019-02-20
@@ -322,7 +322,7 @@ public class JeecgOrderDmainController {
         }
         return result;
     }
-//===========================以下是机票的相关API====================================	
+//===========================以下是机票的相关API====================================
 
     /**
      * 添加
@@ -422,4 +422,4 @@ public class JeecgOrderDmainController {
         return result;
     }
 
-}
+}

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/test/controller/JeecgOrderMainController.java

@@ -33,7 +33,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @Title: Controller
+ * @Title: controller
  * @Description: 订单
  * @Author: jeecg-boot
  * @Date:2019-02-15

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fegin/LogService.java

@@ -0,0 +1,11 @@
+//package org.jeecg.modules.fegin;
+//
+//import org.springframework.cloud.openfeign.FeignClient;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestParam;
+//
+//@FeignClient(name = "log-service")
+//public interface LogService {
+//    @GetMapping("hi")
+//    String home(@RequestParam(value = "name") String name);
+//}

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/performanceappraisal/controller/OptimizerRoleInfoController.java

@@ -175,7 +175,7 @@ public class OptimizerRoleInfoController {
      * 获取优化师经理的统计数据
      */
     @GetMapping("manager/detail")
-    public Map<String, Object> managerDetail(Integer appType) {
-        return optimizerRoleInfoService.getmanagerDetail(appType);
+    public Map<String, Object> managerDetail(@RequestParam(name = "orgCode", defaultValue = "A01") String orgCode, @RequestParam(name = "appType", defaultValue = "2") String appType) {
+        return optimizerRoleInfoService.getManagerDetail(appType, orgCode);
     }
 }

+ 288 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java

@@ -1,16 +1,28 @@
 package org.jeecg.modules.system.controller;
 
-import cn.com.ctop.crawler.modules.account.entity.KuaishouAppAccount;
+import cn.com.ctop.performanceappraisal.entity.Performance;
 import cn.com.ctop.userefficientvideomap.entity.DesignMaterialInfo;
+import cn.com.ctop.userefficientvideomap.entity.UserDto2;
+import cn.com.ctop.userefficientvideomap.mapper.UserEfficientVideoMapMapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.system.service.IPerformanceService2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -29,13 +41,15 @@ import java.util.Map;
 public class PerformanceController2 {
     @Autowired
     private IPerformanceService2 performanceService;
+    @Autowired
+    private UserEfficientVideoMapMapper userEfficientVideoMapMapper;
 
     //平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效
     @AutoLog(value = "平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效")
     @ApiOperation(value = "平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效", notes = "平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效")
     @PostMapping(value = "/getPerformanceInfo")
     public Result<Map<String,Object>> getPerformanceInfo() {
-        Result<Map<String,Object>> result = new Result<Map<String,Object>>();
+        Result<Map<String, Object>> result = new Result<>();
         Map<String,Object> resultMap = new HashMap<>();
         try {
             resultMap = performanceService.getPerformanceInfo();
@@ -104,4 +118,276 @@ public class PerformanceController2 {
         return result;
     }
 
+    @AutoLog(value = "根据year、quarter计算季度设计师绩效")
+    @ApiOperation(value = "根据year、quarter计算季度设计师绩效", notes = "根据year、quarter计算季度设计师绩效")
+    @PostMapping(value = "/designerPerformance")
+    public Result<Map<String, Object>> designerPerformanceTask(@RequestParam(name = "year", required = true) int year,
+                                                               @RequestParam(name = "quarter", required = true) int quarter) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            performanceService.designerPerformanceTask(year, quarter);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/designerPerformance出错啦" + "year:" + year + " quarter:" + quarter);
+            result.error500("/ctop/performance2/designerPerformance出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "有效视频定时任务")
+    @ApiOperation(value = "有效视频定时任务", notes = "calcDate传递yyyy-MM-dd格式的日期")
+    @PostMapping(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>>();
+        if (StringUtils.isBlank(calcDate)) {
+            result.error500("时间不能为空");
+        }
+        try {
+            performanceService.efficientVideoTask(calcDate);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/efficientVideo出错啦" + "date:" + calcDate);
+            result.error500("/ctop/performance2/efficientVideo出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "根据year、quarter计算kuaishou季度设计师绩效")
+    @ApiOperation(value = "根据year、quarter计算kuaishou季度设计师绩效", notes = "根据year、quarter计算kuaishou季度设计师绩效")
+    @PostMapping(value = "/toutiaoDesignerPerformance")
+    public Result<Map<String, Object>> toutiaoDesignerPerformance(@RequestParam(name = "year", required = true) int year,
+                                                                  @RequestParam(name = "quarter", required = true) int quarter) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            performanceService.toutiaoDesigner(year, quarter);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/toutiaoDesignerPerformance出错啦" + "year:" + year + " quarter:" + quarter);
+            result.error500("/ctop/performance2/toutiaoDesignerPerformance出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "根据year、quarter计算toutiao季度设计师绩效")
+    @ApiOperation(value = "根据year、quarter计算toutiao季度设计师绩效", notes = "根据year、quarter计算toutiao季度设计师绩效")
+    @PostMapping(value = "/kuaishouDesignerPerformance")
+    public Result<Map<String, Object>> kuaishouDesignerPerformance(@RequestParam(name = "year", required = true) int year,
+                                                                   @RequestParam(name = "quarter", required = true) int quarter) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            performanceService.kuaishouDesigner(year, quarter);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/kuaishouDesignerPerformance出错啦" + "year:" + year + " quarter:" + quarter);
+            result.error500("/ctop/performance2/kuaishouDesignerPerformance出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "获取设计师组下所有人的绩效")
+    @ApiOperation(value = "获取设计师组下所有人的绩效", notes = "获取设计师组下所有人的绩效")
+    @PostMapping(value = "/designerLastQuarterPerformanceInfo")
+    public Result<Map<String, Object>> designerLastQuarterPerformanceInfo() {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> resultMap = performanceService.designerLastQuarterPerformanceInfo();
+            result.setResult(resultMap);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/designerLastQuarterPerformanceInfo出错啦");
+            result.error500("/ctop/performance2/designerLastQuarterPerformanceInfo出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "获取同一媒体类型下上个季度所有人的绩效")
+    @ApiOperation(value = "获取同一媒体类型下上个季度所有人的绩效", notes = "获取同一媒体类型下上个季度所有人的绩效")
+    @PostMapping(value = "/quarterUserPerformanceList")
+    public Result<Map<String, Object>> quarterUserPerformanceList(@RequestParam(name = "appType", required = true) int appType) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> resultMap = performanceService.quarterUserPerformanceList(appType);
+            result.setResult(resultMap);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/quarterUserPerformanceList出错啦");
+            result.error500("/ctop/performance2/quarterUserPerformanceList出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "获取快手上个季度的季度有效数、素材总数、上个季度的绩效")
+    @ApiOperation(value = "获取快手上个季度的季度有效数、素材总数、上个季度的绩效", notes = "获取快手上个季度的季度有效数、素材总数、上个季度的绩效")
+    @PostMapping(value = "/kuaishouDesignerLastQuarterPerformanceInfo")
+    public Result<Map<String, Object>> kuaishouDesignerLastQuarterPerformanceInfo() {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            resultMap = performanceService.kuaishouDesignerLastQuarterPerformanceInfo();
+            result.setResult(resultMap);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/kuaishouDesignerLastQuarterPerformanceInfo出错啦");
+            result.error500("/ctop/performance2/kuaishouDesignerLastQuarterPerformanceInfo出错啦");
+        }
+        return result;
+    }
+
+    @AutoLog(value = "获取平面设计师上个季度的绩效")
+    @ApiOperation(value = "获取平面设计师上个季度的绩效", notes = "获取平面设计师上个季度的绩效")
+    @PostMapping(value = "/planeLastQuarterPerformanceInfo")
+    public Result<Map<String, Object>> planeLastQuarterPerformanceInfo(@RequestParam(name = "appType", required = true) int appType) {
+        Result<Map<String, Object>> result = new Result<Map<String, Object>>();
+        try {
+            Map<String, Object> resultMap = performanceService.planeLastQuarterPerformanceInfo(appType);
+            result.setResult(resultMap);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            log.error("/ctop/performance2/planeLastQuarterPerformanceInfo出错啦");
+            result.error500("/ctop/performance2/planeLastQuarterPerformanceInfo出错啦");
+        }
+        return result;
+    }
+
+    /**
+     * 分页列表查询
+     *
+     * @param performance
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "平面设计师季度绩效表-分页列表查询")
+    @ApiOperation(value = "平面设计师季度绩效表-分页列表查询", notes = "平面设计师季度绩效表-分页列表查询")
+    @GetMapping(value = "/planePerformanceList")
+    public Result<IPage<Performance>> planePerformanceList(Performance performance,
+                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                           HttpServletRequest req) {
+        Result<IPage<Performance>> result = new Result<IPage<Performance>>();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        performance.setUserId(sysUser.getId());
+        QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
+        Page<Performance> page = new Page<Performance>(pageNo, pageSize);
+        IPage<Performance> pageList = performanceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 分页列表查询
+     *
+     * @param performance
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "平面设计师季度绩效表-分页列表查询")
+    @ApiOperation(value = "平面设计师季度绩效表-分页列表查询", notes = "平面设计师季度绩效表-分页列表查询")
+    @GetMapping(value = "/designerDepartMemberPerformanceList")
+    public Result<IPage<Performance>> designerDepartMemberPerformanceList(Performance performance,
+                                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                          HttpServletRequest req) {
+        Result<IPage<Performance>> result = new Result<IPage<Performance>>();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String departId = userEfficientVideoMapMapper.getDepartIdByUserId("e9ca23d68d884d4ebb19d07889727dae");
+        List<String> userIdList = userEfficientVideoMapMapper.getUserIdListByDepId(departId);
+        //
+        QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
+        queryWrapper.in("user_id", userIdList);
+
+        Page<Performance> page = new Page<Performance>(pageNo, pageSize);
+        IPage<Performance> pageList = performanceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @AutoLog(value = "获取快手绩效时时数据接口")
+    @ApiOperation(value = "获取快手绩效时时数据接口", notes = "获取快手绩效时时数据接口")
+    @GetMapping(value = "/kuaishouPererformanceInfoNow")
+    public Result<List<UserDto2>> kuaishouPererformanceInfoNow(HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        List<UserDto2> userDto2List = performanceService.kuaishouPerformanceInfoNow();
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    @AutoLog(value = "获取头条绩效时时数据接口")
+    @ApiOperation(value = "获取头条绩效时时数据接口", notes = "获取头条绩效时时数据接口")
+    @GetMapping(value = "/toutiaoPererformanceInfoNow")
+    public Result<List<UserDto2>> toutiaoPererformanceInfoNow(HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        List<UserDto2> userDto2List = performanceService.toutiaoPerformanceInfoNow();
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    @AutoLog(value = "获取快手绩效周报表")
+    @ApiOperation(value = "获取快手绩效周报表", notes = "获取快手绩效周报表")
+    @GetMapping(value = "/kuaishouWeekReport")
+    public Result<List<UserDto2>> kuaishouWeekReport(@RequestParam(name = "startDate") String startDate,
+                                                     @RequestParam(name = "endDate") String endDate,
+                                                     HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        List<UserDto2> userDto2List = performanceService.kuaishouWeekReport(startDate, endDate);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    @AutoLog(value = "获取头条绩效周报表")
+    @ApiOperation(value = "获取头条绩效周报表", notes = "获取头条绩效周报表")
+    @GetMapping(value = "/toutiaoWeekReport")
+    public Result<List<UserDto2>> toutiaoWeekReport(@RequestParam(name = "pageNo") String startDate,
+                                                    @RequestParam(name = "pageNo") String endDate,
+                                                    HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        List<UserDto2> userDto2List = performanceService.toutiaoWeekReport(startDate, endDate);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    @AutoLog(value = "获取快手季度绩效报表")
+    @ApiOperation(value = "获取快手季度绩效报表", notes = "获取快手季度绩效报表")
+    @GetMapping(value = "/kuaishouQuarterReport")
+    public Result<List<UserDto2>> kuaishouQuarterReport(@RequestParam(name = "pageNo") Integer year,
+                                                        @RequestParam(name = "pageNo") Integer quarter,
+                                                        HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        List<UserDto2> userDto2List = performanceService.kuaishouQuarterReport(year, quarter);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    @AutoLog(value = "获取头条季度绩效报表")
+    @ApiOperation(value = "获取头条季度绩效报表", notes = "获取头条季度绩效报表")
+    @GetMapping(value = "/toutiaoQuarterReport")
+    public Result<List<UserDto2>> toutiaoQuarterReport(@RequestParam(name = "pageNo") Integer year,
+                                                       @RequestParam(name = "pageNo") Integer quarter,
+                                                       HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        List<UserDto2> userDto2List = performanceService.toutiaoQuarterReport(year, quarter);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
 }

+ 29 - 29
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementController.java

@@ -48,7 +48,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
 /**
- * @Title: Controller
+ * @Title: controller
  * @Description: 系统通告表
  * @Author: jeecg-boot
  * @Date: 2019-01-02
@@ -99,8 +99,8 @@ public class SysAnnouncementController {
 		result.setResult(pageList);
 		return result;
 	}
-	
-	/**
+
+    /**
 	  *   添加
 	 * @param sysAnnouncement
 	 * @return
@@ -120,8 +120,8 @@ public class SysAnnouncementController {
 		}
 		return result;
 	}
-	
-	/**
+
+    /**
 	  *  编辑
 	 * @param sysAnnouncement
 	 * @return
@@ -139,11 +139,11 @@ public class SysAnnouncementController {
 				result.success("修改成功!");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+    /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -161,11 +161,11 @@ public class SysAnnouncementController {
 				result.success("删除成功!");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+    /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -186,8 +186,8 @@ public class SysAnnouncementController {
 		}
 		return result;
 	}
-	
-	/**
+
+    /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -204,8 +204,8 @@ public class SysAnnouncementController {
 		}
 		return result;
 	}
-	
-	/**
+
+    /**
 	 *	 更新发布操作
 	 * @param id
 	 * @return
@@ -227,11 +227,11 @@ public class SysAnnouncementController {
 				result.success("该系统通知发布成功");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+    /**
 	 *	 更新撤销操作
 	 * @param id
 	 * @return
@@ -251,11 +251,11 @@ public class SysAnnouncementController {
 				result.success("该系统通知撤销成功");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+    /**
 	 * @功能:补充用户数据,并返回系统消息
 	 * @return
 	 */

+ 23 - 23
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementSendController.java

@@ -33,7 +33,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
  /**
- * @Title: Controller
+  * @Title: controller
  * @Description: 用户通告阅读标记表
  * @Author: jeecg-boot
  * @Date:  2019-02-21
@@ -45,8 +45,8 @@ import lombok.extern.slf4j.Slf4j;
 public class SysAnnouncementSendController {
 	@Autowired
 	private ISysAnnouncementSendService sysAnnouncementSendService;
-	
-	/**
+
+     /**
 	  * 分页列表查询
 	 * @param sysAnnouncementSend
 	 * @param pageNo
@@ -81,8 +81,8 @@ public class SysAnnouncementSendController {
 		result.setResult(pageList);
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *   添加
 	 * @param sysAnnouncementSend
 	 * @return
@@ -99,8 +99,8 @@ public class SysAnnouncementSendController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *  编辑
 	 * @param sysAnnouncementSend
 	 * @return
@@ -118,11 +118,11 @@ public class SysAnnouncementSendController {
 				result.success("修改成功!");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+     /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -139,11 +139,11 @@ public class SysAnnouncementSendController {
 				result.success("删除成功!");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+     /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -159,8 +159,8 @@ public class SysAnnouncementSendController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -177,8 +177,8 @@ public class SysAnnouncementSendController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	 * @功能:更新用户系统消息阅读状态
 	 * @param json
 	 * @return
@@ -198,8 +198,8 @@ public class SysAnnouncementSendController {
 		result.setSuccess(true);
 		return result;
 	}
-	
-	/**
+
+     /**
 	 * @功能:获取我的消息
 	 * @return
 	 */

+ 21 - 21
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserAgentController.java

@@ -49,7 +49,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
  /**
- * @Title: Controller
+  * @Title: controller
  * @Description: 用户代理人设置
  * @Author: jeecg-boot
  * @Date:  2019-04-17
@@ -61,8 +61,8 @@ import lombok.extern.slf4j.Slf4j;
 public class SysUserAgentController {
 	@Autowired
 	private ISysUserAgentService sysUserAgentService;
-	
-	/**
+
+     /**
 	  * 分页列表查询
 	 * @param sysUserAgent
 	 * @param pageNo
@@ -83,8 +83,8 @@ public class SysUserAgentController {
 		result.setResult(pageList);
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *   添加
 	 * @param sysUserAgent
 	 * @return
@@ -101,8 +101,8 @@ public class SysUserAgentController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  *  编辑
 	 * @param sysUserAgent
 	 * @return
@@ -120,11 +120,11 @@ public class SysUserAgentController {
 				result.success("代理人设置成功!");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+     /**
 	  *   通过id删除
 	 * @param id
 	 * @return
@@ -141,11 +141,11 @@ public class SysUserAgentController {
 				result.success("删除成功!");
 			}
 		}
-		
-		return result;
-	}
-	
-	/**
+
+        return result;
+    }
+
+     /**
 	  *  批量删除
 	 * @param ids
 	 * @return
@@ -161,8 +161,8 @@ public class SysUserAgentController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  * 通过id查询
 	 * @param id
 	 * @return
@@ -179,8 +179,8 @@ public class SysUserAgentController {
 		}
 		return result;
 	}
-	
-	/**
+
+     /**
 	  * 通过userName查询
 	 * @param userName
 	 * @return

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysRoleMapper.xml

@@ -13,6 +13,7 @@
 		sys_user a
 		left join sys_user_role b on a.id = b.user_id
 		left join sys_role c on b.role_id = c.id
+		left join sys_
         where
         c.role_code = #{roleCode}
 	</select>

+ 65 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService2.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.system.service;
 
 import cn.com.ctop.performanceappraisal.entity.Performance;
 import cn.com.ctop.userefficientvideomap.entity.DesignMaterialInfo;
+import cn.com.ctop.userefficientvideomap.entity.UserDto2;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
@@ -15,17 +16,73 @@ import java.util.Map;
  * @date 2019-12-10
  */
 public interface IPerformanceService2 extends IService<Performance> {
+    /**
+     * 查询统计有效视频
+     *
+     * @param calcDateStr
+     */
     void efficientVideoTask(String calcDateStr);
 
-    //平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效
-    public Map<String,Object> getPerformanceInfo();
+    /**
+     * 平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效
+     *
+     * @return
+     */
+    Map<String, Object> getPerformanceInfo();
 
-    //有效率排行榜
-    public Map<String,Object> effiRateRank(Integer size);
+    /**
+     * 有效率排行榜
+     *
+     * @param size
+     * @return
+     */
+    Map<String, Object> effiRateRank(Integer size);
 
-    //素材、素材跑量、封面点击数、封面曝光数、行为数
-    public List<DesignMaterialInfo> materialInfoList();
+    /**
+     * 素材、素材跑量、封面点击数、封面曝光数、行为数
+     *
+     * @return
+     */
+    List<DesignMaterialInfo> materialInfoList();
+
+    /**
+     * 点击+符号 投放账户、投放账户、跑量
+     *
+     * @param materialInfoId
+     * @return
+     */
+    List<DesignMaterialInfo> materialAccountInfo(String materialInfoId);
+
+    void designerPerformanceTask(int year, int quarter);
+
+    void kuaishouDesigner(int thisYear, int thisQuarter);
+
+    void toutiaoDesigner(int thisYear, int thisQuarter);
+
+    Map<String, Object> designerLastQuarterPerformanceInfo();
+
+    Map<String, Object> quarterUserPerformanceList(Integer appType);
+
+    Map<String, Object> kuaishouDesignerLastQuarterPerformanceInfo();
+
+    Map<String, Object> planeLastQuarterPerformanceInfo(int appType);
+
+    //获取快手绩效时时数据接口
+    List<UserDto2> kuaishouPerformanceInfoNow();
+
+    //获取快手绩效时时数据接口
+    List<UserDto2> toutiaoPerformanceInfoNow();
+
+    //获取快手绩效周报表
+    List<UserDto2> kuaishouWeekReport(String startDate, String endDate);
+
+    //获取头条绩效周报表
+    List<UserDto2> toutiaoWeekReport(String startDate, String endDate);
+
+    //获取快手季度绩效报表
+    List<UserDto2> kuaishouQuarterReport(Integer year, Integer quarter);
+
+    //获取头条季度绩效报表
+    List<UserDto2> toutiaoQuarterReport(Integer year, Integer quarter);
 
-    //点击+符号 投放账户、投放账户、跑量
-    public List<DesignMaterialInfo> materialAccountInfo(String materialInfoId);
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1467 - 410
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java


+ 6 - 0
jeecg-boot-module-system/src/main/resources/application.yml

@@ -1,6 +1,12 @@
 spring:
   profiles:
     active: @activatedProperties@
+  application:
+    name: system-web
+eureka:
+  client:
+    serviceUrl:
+      defaultZone: http://localhost:8761/eureka/
 swagger:
   production: false
   basic:

+ 118 - 0
log-server/.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
log-server/.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
log-server/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 376 - 0
log-server/pom.xml

@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.2.2.RELEASE</version>
+        <relativePath/>
+    </parent>
+    <groupId>cn.com.ctop</groupId>
+    <artifactId>log-server</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>log-server</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <spring-cloud.version>Hoxton.SR1</spring-cloud.version>
+        <jeecgboot.common.version>2.0.2</jeecgboot.common.version>
+        <java.version>1.8</java.version>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <mybatis-plus.version>3.0.6</mybatis-plus.version>
+        <druid.version>1.1.10</druid.version>
+        <commons.version>2.6</commons.version>
+        <aliyun-java-sdk-core.version>3.5.0</aliyun-java-sdk-core.version>
+        <aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
+    </properties>
+
+    <dependencies>
+
+        <!--集成springmvc框架并实现自动配置 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>ch.qos.logback</groupId>
+                    <artifactId>logback-classic</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency> -->
+
+        <!-- commons -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>${commons.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>${commons.version}</version>
+        </dependency>
+
+        <!-- freemarker -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+
+        <!-- Lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <!-- mybatis-plus -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+
+        <!-- druid -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+
+        <!-- 动态数据源 -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+
+        <!-- json -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.56</version>
+        </dependency>
+
+        <!--mysql-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.47</version>
+            <scope>runtime</scope>
+        </dependency>
+        <!--sqlserver-->
+        <dependency>
+            <groupId>net.sourceforge.jtds</groupId>
+            <artifactId>jtds</artifactId>
+            <version>1.3.1</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>7.2.1.jre8</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- Quartz定时任务 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+
+        <!--JWT-->
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.7.0</version>
+        </dependency>
+
+        <!--shiro-->
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring-boot-starter</artifactId>
+            <version>1.4.0</version>
+        </dependency>
+
+        <!-- Swagger API文档 -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>swagger-bootstrap-ui</artifactId>
+            <version>1.9.3</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-bean-validators</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+
+
+        <!-- Redis -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
+        <!-- 代码生成器 -->
+
+        <!-- AutoPoi Excel工具类-->
+        <dependency>
+            <groupId>org.jeecgframework</groupId>
+            <artifactId>autopoi-web</artifactId>
+            <version>1.0.3</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.retrofit2</groupId>
+            <artifactId>retrofit</artifactId>
+            <version>2.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.pdfbox</groupId>
+            <artifactId>fontbox</artifactId>
+            <version>2.0.15</version>
+        </dependency>
+        <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-java</artifactId>
+            <version>3.141.59</version>
+        </dependency>
+        <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-firefox-driver</artifactId>
+            <version>3.141.59</version>
+        </dependency>
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>LATEST</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>25.0-jre</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-cp</artifactId>
+            <version>3.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>us.codecraft</groupId>
+            <artifactId>webmagic-core</artifactId>
+            <version>0.7.3</version>
+        </dependency>
+        <dependency>
+            <groupId>us.codecraft</groupId>
+            <artifactId>webmagic-extension</artifactId>
+            <version>0.7.3</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sourceforge.htmlunit</groupId>
+            <artifactId>htmlunit</artifactId>
+            <version>2.36.0</version>
+        </dependency>
+        <dependency>
+            <groupId>io.appium</groupId>
+            <artifactId>java-client</artifactId>
+            <version>7.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.11</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>4.5.11</version>
+        </dependency>
+
+        <!-- 阿里云短信 -->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+            <version>${aliyun-java-sdk-dysmsapi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>${aliyun-java-sdk-core.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>2.8.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-mts</artifactId>
+            <version>2.5.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.jeecgframework.boot</groupId>
+                <artifactId>jeecg-boot-base-common</artifactId>
+                <version>${jeecgboot.common.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <!-- 环境标识,需要与配置文件的名称相对应 -->
+                <activatedProperties>dev</activatedProperties>
+            </properties>
+            <activation>
+                <!-- 默认环境 -->
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+        <profile>
+            <id>test</id>
+            <properties>
+                <activatedProperties>test</activatedProperties>
+            </properties>
+        </profile>
+        <profile>
+            <id>prod</id>
+            <properties>
+                <activatedProperties>prod</activatedProperties>
+            </properties>
+        </profile>
+    </profiles>
+</project>

+ 13 - 0
log-server/src/main/java/cn/com/ctop/logserver/LogServerApplication.java

@@ -0,0 +1,13 @@
+package cn.com.ctop.logserver;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+
+@SpringBootApplication
+@EnableEurekaClient
+public class LogServerApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(LogServerApplication.class, args);
+    }
+}

+ 17 - 0
log-server/src/main/java/cn/com/ctop/logserver/controller/LogController.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.logserver.controller;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class LogController {
+    @Value("${server.port}")
+    String port;
+
+    @GetMapping("hi")
+    public String home(@RequestParam(value = "name", defaultValue = "forezp") String name) {
+        return "hi " + name + " ,i am from port:" + port;
+    }
+}

+ 160 - 0
log-server/src/main/resources/application-dev.yml

@@ -0,0 +1,160 @@
+server:
+  port: 8080
+  servlet:
+    context-path: /jeecg-boot
+    compression:
+      enabled: true
+      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: metrics,httptrace
+
+spring:
+  rabbitmq:
+    host: 39.106.184.70
+    port: 5672
+    username: guest
+    password: guest
+  servlet:
+    multipart:
+      max-file-size: -1
+      max-request-size: -1
+  mail:
+    host: smtp.163.com
+    username: jeecgos@163.com
+    password: ??
+    properties:
+      mail:
+        smtp:
+          auth: true
+          starttls:
+            enable: true
+            required: true
+  ## quartz定时任务,采用数据库方式
+  quartz:
+    job-store-type: jdbc
+  #json 时间戳统一转换
+  jackson:
+    date-format:   yyyy-MM-dd HH:mm:ss
+    time-zone:   GMT+8
+  aop:
+    proxy-target-class: true
+  #配置freemarker
+  freemarker:
+    # 设置模板后缀名
+    suffix: .ftl
+    # 设置文档类型
+    content-type: text/html
+    # 设置页面编码格式
+    charset: UTF-8
+    # 设置页面缓存
+    cache: false
+    prefer-file-system-access: false
+    # 设置ftl文件路径
+    template-loader-path:
+      - classpath:/templates
+  # 设置静态文件路径,js,css等
+  mvc:
+    static-path-pattern: /**
+  resource:
+    static-locations: classpath:/static/,classpath:/public/
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+      web-stat-filter:
+        enabled: true
+    dynamic:
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        connection-init-sql: set names utf8mb4
+
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: root
+          password: hcst2019
+          driver-class-name: com.mysql.jdbc.Driver
+          # 多数据源配置
+          #multi-datasource1:
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
+          #username: root
+          #password: root
+          #driver-class-name: com.mysql.jdbc.Driver
+  #redis 配置
+  redis:
+    database: 0
+    host: 127.0.0.1
+    lettuce:
+      pool:
+        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: ''
+    port: 6379
+#mybatis plus 设置
+mybatis-plus:
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
+  global-config:
+    # 关闭MP3.0自带的banner
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
+      id-type: 4
+      # 默认数据库表下划线命名
+      table-underline: true
+    configuration:
+      # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#jeecg专用配置
+jeecg:
+  path:
+    #文件上传根目录 设置
+    upload: D://upFiles
+    #webapp文件路径
+    webapp: D://webapp
+    video-upload: D://upFiles//video//
+    image-upload: D://upFiles//image//
+    chrome-driver: D://chromedriver.exe
+    csv-upload: D://upFiles//csv//
+kuaishou:
+  group-control:
+    path: http://39.106.184.70
+    port: 4723
+logging:
+  level:
+    root: info
+  config: classpath:logback-dev.xml
+chrome:
+  script:
+    clean: sh /mnt/webapp/cleanProcess.sh

+ 159 - 0
log-server/src/main/resources/application-prod.yml

@@ -0,0 +1,159 @@
+server:
+  port: 8080
+  servlet:
+    context-path: /jeecg-boot
+    compression:
+      enabled: true
+      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: metrics,httptrace
+
+
+spring:
+  rabbitmq:
+    host: 39.106.184.70
+    port: 5672
+    username: guest
+    password: guest
+  servlet:
+    multipart:
+      max-file-size: -1
+      max-request-size: -1
+  mail:
+    host: smtp.163.com
+    username: jeecgos@163.com
+    password: ??
+    properties:
+      mail:
+        smtp:
+          auth: true
+          starttls:
+            enable: true
+            required: true
+  ## quartz定时任务,采用数据库方式
+  quartz:
+    job-store-type: jdbc
+  #json 时间戳统一转换
+  jackson:
+    date-format:   yyyy-MM-dd HH:mm:ss
+    time-zone:   GMT+8
+  aop:
+    proxy-target-class: true
+  #配置freemarker
+  freemarker:
+    # 设置模板后缀名
+    suffix: .ftl
+    # 设置文档类型
+    content-type: text/html
+    # 设置页面编码格式
+    charset: UTF-8
+    # 设置页面缓存
+    cache: false
+    prefer-file-system-access: false
+    # 设置ftl文件路径
+    template-loader-path:
+      - classpath:/templates
+  # 设置静态文件路径,js,css等
+  mvc:
+    static-path-pattern: /**
+  resource:
+    static-locations: classpath:/static/,classpath:/public/
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  datasource:
+    druid:
+      stat-view-servlet:
+        loginUsername: admin
+        loginPassword: hcst2016
+        enabled: true
+      web-stat-filter:
+        enabled: true
+    #      remove-abandoned: false
+    dynamic:
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        connection-init-sql: set names utf8mb4
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: hcst
+          password: test@20190531
+          driver-class-name: com.mysql.jdbc.Driver
+          # 多数据源配置
+          #multi-datasource1:
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
+          #username: root
+          #password: root
+          #driver-class-name: com.mysql.jdbc.Driver
+  #redis 配置
+  redis:
+    database: 0
+    host: 127.0.0.1
+    lettuce:
+      pool:
+        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: ''
+    port: 6379
+#mybatis plus 设置
+mybatis-plus:
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
+  global-config:
+    # 关闭MP3.0自带的banner
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
+      id-type: 4
+      # 默认数据库表下划线命名
+      table-underline: true
+#jeecg专用配置
+jeecg:
+  path:
+    #文件上传根目录 设置
+    upload: /mnt/upload
+    #webapp文件路径
+    webapp: /mnt/webapp
+    video-upload: /mnt/upload/video/
+    image-upload: /mnt/upload/image/
+    chrome-driver: /usr/bin/chromedriver
+    csv-upload: /mnt/upload/csv/
+kuaishou:
+  group-control:
+    path: http://39.106.184.70
+    port: 4723
+logging:
+  level:
+    root: info
+  config: classpath:logback-prod.xml
+chrome:
+  script:
+    clean: sh /mnt/webapp/cleanProcess.sh
+

+ 161 - 0
log-server/src/main/resources/application-test.yml

@@ -0,0 +1,161 @@
+server:
+  port: 8080
+  servlet:
+    context-path: /jeecg-boot
+    compression:
+      enabled: true
+      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: metrics,httptrace
+
+spring:
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    username: guest
+    password: guest
+  servlet:
+    multipart:
+      max-file-size: -1
+      max-request-size: -1
+  mail:
+    host: smtp.163.com
+    username: jeecgos@163.com
+    password: ??
+    properties:
+      mail:
+        smtp:
+          auth: true
+          starttls:
+            enable: true
+            required: true
+  ## quartz定时任务,采用数据库方式
+  quartz:
+    job-store-type: jdbc
+  #json 时间戳统一转换
+  jackson:
+    date-format:   yyyy-MM-dd HH:mm:ss
+    time-zone:   GMT+8
+  aop:
+    proxy-target-class: true
+  #配置freemarker
+  freemarker:
+    # 设置模板后缀名
+    suffix: .ftl
+    # 设置文档类型
+    content-type: text/html
+    # 设置页面编码格式
+    charset: UTF-8
+    # 设置页面缓存
+    cache: false
+    prefer-file-system-access: false
+    # 设置ftl文件路径
+    template-loader-path:
+      - classpath:/templates
+  # 设置静态文件路径,js,css等
+  mvc:
+    static-path-pattern: /**
+  resource:
+    static-locations: classpath:/static/,classpath:/public/
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+      web-stat-filter:
+        enabled: true
+    dynamic:
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        connection-init-sql: set names utf8mb4
+
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: root
+          password: hcst2019
+          driver-class-name: com.mysql.jdbc.Driver
+          # 多数据源配置
+          #multi-datasource1:
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
+          #username: root
+          #password: root
+          #driver-class-name: com.mysql.jdbc.Driver
+  #redis 配置
+  redis:
+    database: 0
+    host: 127.0.0.1
+    lettuce:
+      pool:
+        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: ''
+    port: 6379
+#mybatis plus 设置
+mybatis-plus:
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
+  global-config:
+    # 关闭MP3.0自带的banner
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
+      id-type: 4
+      # 默认数据库表下划线命名
+      table-underline: true
+    configuration:
+      # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#jeecg专用配置
+jeecg:
+  path:
+    #文件上传根目录 设置
+    #文件上传根目录 设置
+    upload: /data/upload
+    #webapp文件路径
+    webapp: /data/webapp
+    video-upload: /data/upload/video/
+    image-upload: /data/upload/image/
+    chrome-driver: /usr/bin/chromedriver
+    csv-upload: /data/upload/csv/
+kuaishou:
+  group-control:
+    path: http://127.0.0.1
+    port: 4723
+logging:
+  level:
+    root: info
+  config: classpath:logback-test.xml
+chrome:
+  script:
+    clean: sh /mnt/webapp/cleanProcess.sh

+ 15 - 0
log-server/src/main/resources/application.yml

@@ -0,0 +1,15 @@
+spring:
+  profiles:
+    active: @activatedProperties@
+  application:
+    name: system-web
+eureka:
+  client:
+    serviceUrl:
+      defaultZone: http://localhost:8761/eureka/
+swagger:
+  production: false
+  basic:
+    enable: true
+    username: jeecg
+    password: jeecg1314

+ 14 - 0
log-server/src/main/resources/banner.txt

@@ -0,0 +1,14 @@
+
+${AnsiColor.BRIGHT_BLUE}
+   (_)                          | |               | |
+    _  ___  ___  ___ __ _ ______| |__   ___   ___ | |_ 
+   | |/ _ \/ _ \/ __/ _` |______| '_ \ / _ \ / _ \| __|
+   | |  __/  __/ (_| (_| |      | |_) | (_) | (_) | |_ 
+   | |\___|\___|\___\__, |      |_.__/ \___/ \___/ \__|
+  _/ |               __/ |                             
+ |__/               |___/
+
+${AnsiColor.BRIGHT_GREEN}
+Jeecg  Boot Version: 2.0.2
+Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
+${AnsiColor.BLACK}

+ 4 - 0
log-server/src/main/resources/log4j.properties

@@ -0,0 +1,4 @@
+log4j.rootLogger=INFO,stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS}-[%p] [%t] %-5l - %m%n

+ 57 - 0
log-server/src/main/resources/logback-dev.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+
+
+    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
+
+    <!-- 定义日志存储的路径,不要配置相对路径 -->
+    <property name="FILE_PATH" value="D:/Desktop/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+    <!-- 控制台输出日志 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- 日志级别过滤INFO以下 -->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+        <encoder>
+            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
+    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+
+            <fileNamePattern>${FILE_PATH}</fileNamePattern>
+
+            <!-- keep 15 days' worth of history -->
+            <maxHistory>30</maxHistory>
+
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 日志文件的最大大小 -->
+                <maxFileSize>2MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+
+            <!-- 超出删除老文件 -->
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+
+        <encoder>
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- project default level -->
+    <logger name="net.sh.rgface.serive" level="ERROR"/>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="rollingFile"/>
+    </root>
+</configuration>

+ 57 - 0
log-server/src/main/resources/logback-prod.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+
+
+    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
+
+    <!-- 定义日志存储的路径,不要配置相对路径 -->
+    <property name="FILE_PATH" value="/mnt/webapps/logs/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+    <!-- 控制台输出日志 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- 日志级别过滤INFO以下 -->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+        <encoder>
+            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
+    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+
+            <fileNamePattern>${FILE_PATH}</fileNamePattern>
+
+            <!-- keep 15 days' worth of history -->
+            <maxHistory>30</maxHistory>
+
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 日志文件的最大大小 -->
+                <maxFileSize>2MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+
+            <!-- 超出删除老文件 -->
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+
+        <encoder>
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- project default level -->
+    <logger name="net.sh.rgface.serive" level="ERROR"/>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="rollingFile"/>
+    </root>
+</configuration>

+ 57 - 0
log-server/src/main/resources/logback-test.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+
+
+    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
+
+    <!-- 定义日志存储的路径,不要配置相对路径 -->
+    <property name="FILE_PATH" value="/data/webapp/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
+
+    <!-- 控制台输出日志 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <!-- 日志级别过滤INFO以下 -->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+        <encoder>
+            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
+    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+
+            <fileNamePattern>${FILE_PATH}</fileNamePattern>
+
+            <!-- keep 15 days' worth of history -->
+            <maxHistory>30</maxHistory>
+
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 日志文件的最大大小 -->
+                <maxFileSize>2MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+
+            <!-- 超出删除老文件 -->
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+
+        <encoder>
+            <pattern>${LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- project default level -->
+    <logger name="net.sh.rgface.serive" level="ERROR"/>
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="rollingFile"/>
+    </root>
+</configuration>

+ 6 - 0
log-server/src/main/resources/quartz.properties

@@ -0,0 +1,6 @@
+org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
+org.quartz.threadPool.threadCount=20
+org.quartz.threadPool.threadPriority=5
+org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
+org.quartz.jobStore.misfireThreshold=60000
+org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore

+ 3 - 3
mondule-jbpm/src/test/java/cn/com/ctop/jbpm/JbpmApplicationTests.java

@@ -1,10 +1,10 @@
-package cn.com.ctop.jbpm;
+package cn.com.ctop.logserver;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 
 @SpringBootTest
-class JbpmApplicationTests {
+class LogServerApplicationTests {
 
     @Test
     void contextLoads() {

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

@@ -119,4 +119,8 @@ public class MaterialInfo {
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     private Date updateTime;
 
+    private Integer toutiaoEffiType; //判断是否为头条有效素材0否_1是
+
+    private Integer kuaishouEffiType; //判断是否为快手有效素材0否_1是
+
 }

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

@@ -65,7 +65,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         String path = materialInfo.getUrl().substring(materialInfo.getUrl().indexOf("/", 10) + 1, materialInfo.getUrl().length());
         System.out.println(path);
         String jobId = mpsUtils.videoWaterMark(path, videoWatermarkTemplate.getTemplatePath(), videoWatermarkTemplate.getTemplateId(), videoWatermarkTemplate.getHeight());
-        QueryJobListResponse.Job job = mpsUtils.getJobStatus(jobId);
+        QueryJobListResponse.Job job = MpsUtils.getJobStatus(jobId);
         VideoWatermarkTask videoWatermarkTask = new VideoWatermarkTask();
         videoWatermarkTask.setJobId(jobId);
         videoWatermarkTask.setUserId(userId);

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java

@@ -16,4 +16,6 @@ public class CtopAdConstant {
     public static final String UREPORT_PREVIEW_URL_PREFIX = "/jeecg-boot/ureport/designer?_u=mysql:";
 
 
+    public static final String CTOP_ORGCODE_NORTH_CHINA_PREFIX = "A01";
+    public static final String CTOP_ORGCODE_EAST_CHINA_PREFIX = "A02";
 }

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -32,6 +32,7 @@ public enum StatusCode {
     ACCOUNT_HAS_NO_AUTHORIZE("该用户尚未进行授权", -209, false),
     FILE_HAS_UPLOAD("文件已经上传过", 0, false),
     COMMON_SERVER_ERROR("服务器内部错误", -102, false),
+    CTOP_HAS_NO_PERFORMANCE_STATISTIC_LOGIC("绩效统计逻辑尚未确定", -103, false),
     KUAISHOU_CRAWLER_APP_EXIT("快手app异常退出", -1001, false),
     KUAISHOU_CRAWLER_APP_ELEMENT_ERROR("快手元素异常", -1002, false),
     KUAISHOU_CRAWLER_APP_ELEMENT_IS_NULL("此快手元素获取不到", -1003, false),
@@ -40,6 +41,8 @@ public enum StatusCode {
     KUAISHOU_CRAWLER_APP_NO_ENABLED_DEVICE("暂无可用设备", -2001, false),
     KUAISHOU_OPTINIZER_CONFIG_IS_NULL("快手媒体优化师配置信息不全", -3001, false),
     KUAISHOU_OPTINIZER_PERSONNAL_DATA_IS_NULL("快手媒体优化师个人消耗数据不存在", -3002, false),
+    BYTEDANCE_OPTINIZER_PERSONNAL_DATA_IS_NULL("头条媒体优化师个人消耗数据不存在", -3003, false),
+    OPTINIZER_PERSONNAL_DATA_IS_NULL("优化师个人消耗数据不存在", -3004, false),
     KUAISHOU_CRAWLER_APP_SUCCESS("爬虫运行正常", 0, true),
     KUAISHOU_CRAWLER_APP_TASK_END("爬虫任务运行结束", 1, true),
     KUAISHOU_CRAWLER_APP_JOB_StART("任务开始执行开始", 0, true),

+ 37 - 0
module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceCreativeDailyReportController.java

@@ -3,6 +3,7 @@ package cn.com.ctop.bytedance.controller;
 import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import cn.com.ctop.bytedance.service.IBytedanceCreativeDailyReportService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -245,4 +246,40 @@ public class BytedanceCreativeDailyReportController {
         return Result.ok("文件导入失败!");
     }
 
+    /**
+     * bytedanceCreativeDailyReportList
+     *
+     * @param json
+     * @return
+     */
+    @AutoLog(value = "头条素材报表")
+    @ApiOperation(value = "头条素材报表", notes = "头条素材报表")
+    @PostMapping(value = "/bytedanceCreativeDailyReportList")
+    public Result<List<BytedanceCreativeDailyReport>> bytedanceCreativeDailyReportList(@RequestBody JSONObject json,
+                                                                                       HttpServletRequest request, HttpServletResponse response) {
+        Result<List<BytedanceCreativeDailyReport>> result = new Result<>();
+        List<BytedanceCreativeDailyReport> bytedanceCreativeDailyReportList = bytedanceCreativeDailyReportService.bytedanceCreativeDailyReportList(json);
+        result.setResult(bytedanceCreativeDailyReportList);
+        result.setSuccess(true);
+        return result;
+    }
+
+    /**
+     * bytedanceCreativeAccountReportList
+     *
+     * @param json
+     * @return
+     */
+    @AutoLog(value = "头条素材账户报表")
+    @ApiOperation(value = "头条素材账户报表", notes = "头条素材账户报表")
+    @PostMapping(value = "/bytedanceCreativeAccountReportList")
+    public Result<List<BytedanceCreativeDailyReport>> bytedanceCreativeAccountReportList(@RequestBody JSONObject json,
+                                                                                         HttpServletRequest request, HttpServletResponse response) {
+        Result<List<BytedanceCreativeDailyReport>> result = new Result<>();
+        List<BytedanceCreativeDailyReport> bytedanceCreativeDailyReportList = bytedanceCreativeDailyReportService.bytedanceCreativeAccountReportList(json);
+        result.setResult(bytedanceCreativeDailyReportList);
+        result.setSuccess(true);
+        return result;
+    }
+
 }

+ 10 - 0
module-report/src/main/java/cn/com/ctop/bytedance/entity/BytedanceCreativeDailyReport.java

@@ -400,6 +400,16 @@ public class BytedanceCreativeDailyReport {
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
 
+    private String videoUrl;
+
+    public String getVideoUrl() {
+        return videoUrl;
+    }
+
+    public void setVideoUrl(String videoUrl) {
+        this.videoUrl = videoUrl;
+    }
+
     public BytedanceCreativeDailyReport(JSONObject data, Long setAdvertiserId) {
         Long playFeedBreak75 = data.getLong("play_75_feed_break");
         if (null != playFeedBreak75) {

+ 7 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceCreativeDailyReportMapper.java

@@ -3,6 +3,9 @@ package cn.com.ctop.bytedance.mapper;
 import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description: 广告创意日报表信息
  * @Author: jeecg-boot
@@ -10,5 +13,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @Version: V1.0
  */
 public interface BytedanceCreativeDailyReportMapper extends BaseMapper<BytedanceCreativeDailyReport> {
+    List<BytedanceCreativeDailyReport> bytedanceCreativeDailyReport(Map<String, Object> paramsMap);
+
+    List<BytedanceCreativeDailyReport> bytedanceCreativeAccountReport(Map<String, Object> paramsMap);
+
 
 }

+ 92 - 0
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceCreativeDailyReportMapper.xml

@@ -1,5 +1,97 @@
 <?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.bytedance.mapper.BytedanceCreativeDailyReportMapper">
+    <select id="bytedanceCreativeDailyReport" parameterType="Map"
+            resultType="cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport">
+        select
+        t2.creative_id as creativeId,  <!-- 素材id -->
+        t4.video_url as videoUrl,  <!-- 视频url -->
+        sum(t2.show_num) as showNum,  <!-- 展示量 -->
+        sum(t2.click) as click,  <!-- 点击量 -->
+        sum(t2.convert_num) as convertNum,  <!-- 转化量 -->
+        sum(t2.cost) as cost,  <!-- 总花费 -->
+        sum(t2.active) as active, <!-- 应用下载-激活 -->
+        sum(t2.download_finish) as downloadFinish,  <!-- 应用下载-安卓下载完成 -->
+        sum(t2.click_install) as clickInstall,  <!-- 应用下载-点击安装数 -->
+        sum(t2.in_app_pay) as inAppPay, <!-- 应用下载-付费 -->
+        sum(t2.total_play) as totalPlay, <!-- 视频-总播放 -->
+        sum(t2.valid_play) as validPlay, <!-- 视频-有效播放 -->
+        sum(t2.wifi_play) as wifiPlay, <!-- 视频-wifi播放 -->
+        sum(t2.play100_feed_break) as play100FeedBreak,  <!-- 视频-播放100%进度总数 -->
+        sum(t2.play75_feed_break) as play75FeedBreak,  <!-- 视频-播放75%进度总数 -->
+        sum(t2.comment) as comment,  <!-- 互动数据-评论数 -->
+        AVG(t2.next_day_open) as nextDayOpen,  <!-- 次留数 -->
+        AVG(t2.next_day_open_rate) as nextDayOpenRate,  <!-- 次留率 -->
+        AVG(t2.next_day_open_cost) as nextDayOpenCost  <!-- 次留成本 -->
+        from
+        ctop_user_allocation t1
+        left join ctop_bytedance_report_creative_daily t2 on t1.account_id = t2.advertiser_id
+        left join ctop_bytedance_creative t3 on t2.creative_id = t3.id
+        left join ctop_bytedance_video_info t4 on t3.video_id = t4.id
+        where
+        t3.id is not NULL
+        and t1.media_id = '1'
+        and t1.account_id != ''
+        <if test="userId != null">
+            and t1.user_id = #{userId,jdbcType=VARCHAR}
+        </if>
+
+        <if test="startDate != null">
+            and t2.stat_datetime &gt;= #{startDate}
+        </if>
+        <if test="endDate != null">
+            and t2.stat_datetime &lt;= #{endDate}
+        </if>
+        group by t4.signature
+        order by sum(t2.cost) desc
+        limit 100
+    </select>
+
+    <select id="bytedanceCreativeAccountReport" parameterType="Map"
+            resultType="cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport">
+        select
+        t2.creative_id as creativeId,  <!-- 素材id -->
+        t4.video_url as videoUrl,  <!-- 视频url -->
+        sum(t2.show_num) as showNum,  <!-- 展示量 -->
+        sum(t2.click) as click,  <!-- 点击量 -->
+        sum(t2.convert_num) as convertNum,  <!-- 转化量 -->
+        sum(t2.cost) as cost,  <!-- 总花费 -->
+        sum(t2.active) as active, <!-- 应用下载-激活 -->
+        sum(t2.download_finish) as downloadFinish,  <!-- 应用下载-安卓下载完成 -->
+        sum(t2.click_install) as clickInstall,  <!-- 应用下载-点击安装数 -->
+        sum(t2.in_app_pay) as inAppPay, <!-- 应用下载-付费 -->
+        sum(t2.total_play) as totalPlay, <!-- 视频-总播放 -->
+        sum(t2.valid_play) as validPlay, <!-- 视频-有效播放 -->
+        sum(t2.wifi_play) as wifiPlay, <!-- 视频-wifi播放 -->
+        sum(t2.play100_feed_break) as play100FeedBreak,  <!-- 视频-播放100%进度总数 -->
+        sum(t2.play75_feed_break) as play75FeedBreak,  <!-- 视频-播放75%进度总数 -->
+        sum(t2.comment) as comment,  <!-- 互动数据-评论数 -->
+        AVG(t2.next_day_open) as nextDayOpen,  <!-- 次留数 -->
+        AVG(t2.next_day_open_rate) as nextDayOpenRate,  <!-- 次留率 -->
+        AVG(t2.next_day_open_cost) as nextDayOpenCost  <!-- 次留成本 -->
+        from
+        ctop_user_allocation t1
+        left join ctop_bytedance_report_creative_daily t2 on t1.account_id = t2.advertiser_id
+        left join ctop_bytedance_creative t3 on t2.creative_id = t3.id
+        left join ctop_bytedance_video_info t4 on t3.video_id = t4.id
+        where t1.account_id in
+        <foreach item="item" index="index" collection="accountIds"
+                 open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        and t1.media_id = '1'
+        and t1.account_id != ''
+        <if test="startDate != null">
+            and t2.stat_datetime &gt;= #{startDate}
+        </if>
+        <if test="endDate != null">
+            and t2.stat_datetime &lt;= #{endDate}
+        </if>
+        and t3.id is not NULL
+        group by t4.signature
+        order by sum(t2.cost) desc
+        limit 100
+    </select>
+
 
 </mapper>

+ 9 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceCreativeDailyReportService.java

@@ -1,8 +1,11 @@
 package cn.com.ctop.bytedance.service;
 
 import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: 广告创意日报表信息
  * @Author: jeecg-boot
@@ -11,4 +14,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IBytedanceCreativeDailyReportService extends IService<BytedanceCreativeDailyReport> {
 
+    List<BytedanceCreativeDailyReport> bytedanceCreativeDailyReportList(JSONObject json);
+
+    List<BytedanceCreativeDailyReport> bytedanceCreativeAccountReportList(JSONObject json);
+
+
+
 }

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

@@ -2,11 +2,21 @@ package cn.com.ctop.bytedance.service.impl;
 
 import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import cn.com.ctop.bytedance.mapper.BytedanceCreativeDailyReportMapper;
+import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
 import cn.com.ctop.bytedance.service.IBytedanceCreativeDailyReportService;
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description: 广告创意日报表信息
  * @Author: jeecg-boot
@@ -15,5 +25,39 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class BytedanceCreativeDailyReportServiceImpl extends ServiceImpl<BytedanceCreativeDailyReportMapper, BytedanceCreativeDailyReport> implements IBytedanceCreativeDailyReportService {
+    @Autowired
+    private BytedanceCreativeDailyReportMapper bytedanceCreativeDailyReportMapper;
+
+    @Override
+    public List<BytedanceCreativeDailyReport> bytedanceCreativeDailyReportList(JSONObject json) {
+        String userId = json.getString("userId");
+        if (Check.isNull(userId)) {
+            return null;
+        }
+        String nowDate = json.getString("startDate");
+        String endDate = json.getString("endDate");
+        Map<String, Object> paramsMap = new HashMap<>();
+        paramsMap.put("userId", userId);
+        paramsMap.put("startDate", nowDate);
+        paramsMap.put("endDate", endDate);
+
+        return bytedanceCreativeDailyReportMapper.bytedanceCreativeDailyReport(paramsMap);
+    }
+
+    @Override
+    public List<BytedanceCreativeDailyReport> bytedanceCreativeAccountReportList(JSONObject json) {
+        Map<String, Object> paramsMap = new HashMap<>();
+        JSONArray accountIds = json.getJSONArray("accountIds");
+        if (Check.isNull(accountIds)) {
+            return null;
+        }
+        paramsMap.put("accountIds", accountIds);
+        String nowDate = json.getString("startDate");
+        String endDate = json.getString("endDate");
+        paramsMap.put("startDate", nowDate);
+        paramsMap.put("endDate", endDate);
+
+        return bytedanceCreativeDailyReportMapper.bytedanceCreativeAccountReport(paramsMap);
+    }
 
 }

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

@@ -379,16 +379,6 @@ public class ReportServiceImpl implements IReportService {
         return getObject;
     }
 
-    private JSONObject getAdStat(CtopOauthToken token, JSONObject conditions) {
-        // 请求地址
-        String url = "https://ad.toutiao.com/open_api/2/report/ad/get/";
-        JSONArray groupBy = new JSONArray();
-        groupBy.add("STAT_GROUP_BY_FIELD_ID");
-        groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
-        conditions.put("group_by", groupBy);
-        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
-    }
-
     @Override
     public void insertCustomerInfo(String csvPath, String charset) {
         try {
@@ -820,15 +810,33 @@ public class ReportServiceImpl implements IReportService {
         }
     }
 
-    public JSONObject getAgentStat(CtopOauthToken token, JSONObject conditions) {
+    /**
+     * 获取广告创意报表信息
+     *
+     * @param token
+     * @param conditions
+     * @return
+     */
+    public JSONObject getCreativeStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = "https://ad.toutiao.com/open_api/2/report/agent/get/";
+        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_ad_creative_get");
+        JSONArray groupBy = new JSONArray();
+        groupBy.add("STAT_GROUP_BY_FIELD_ID");
+        groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
+        conditions.put("group_by", groupBy);
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }
 
-    public JSONObject getCreativeStat(CtopOauthToken token, JSONObject conditions) {
+    /**
+     * 获取广告计划报表信息
+     *
+     * @param token
+     * @param conditions
+     * @return
+     */
+    private JSONObject getAdStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = "https://ad.toutiao.com/open_api/2/report/creative/get/";
+        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_ad_report_get");
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
@@ -836,9 +844,16 @@ public class ReportServiceImpl implements IReportService {
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }
 
+    /**
+     * 获取广告组报表信息
+     *
+     * @param token
+     * @param conditions
+     * @return
+     */
     public JSONObject getCampaignStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = "https://ad.toutiao.com/open_api/2/report/campaign/get/";
+        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_campaign_report_get");
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
@@ -855,7 +870,7 @@ public class ReportServiceImpl implements IReportService {
      */
     public JSONObject getAdvertiserStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = "https://ad.toutiao.com/open_api/2/report/advertiser/get/";
+        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_advertiser_report_get");
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceVideoInfo.java

@@ -80,6 +80,10 @@ public class ByteDanceVideoInfo {
     @Excel(name = "视频地址", width = 15)
     @ApiModelProperty(value = "视频地址")
     private String videoUrl;
+
+    @Excel(name = "md5码", width = 64)
+    @ApiModelProperty(value = "md5码")
+    private String signature;
     /**
      * status
      */
@@ -107,6 +111,7 @@ public class ByteDanceVideoInfo {
         this.size = data.getLong("size");
         this.duration = data.getDouble("duration");
         this.videoUrl = data.getString("video_url");
+        this.signature = data.getString("signature");
         this.status = 1;
         Date now = new Date();
         this.createTime = now;

+ 6 - 2
module-toutiao/src/main/resources/bytedance_config.properties

@@ -5,7 +5,6 @@ bytedance_secret=0c51523e90d6166418fc8421a4896808e90e26f4
 # bytedance_secret=34bc59f53955c66871ce111a1f15a6051cfa3f12
 #release
 bytedance_api_url=https://ad.oceanengine.com/open_api
-bytedance_auth_url=https://ad.oceanengine.com/openapi
 #sandbox
 #bytedance_api_url=https://test-ad.toutiao.com/open_api
 #bytedance_auth_url=https://test-ad.toutiao.com/open_api
@@ -25,6 +24,11 @@ bytedance_v2_dmp_custom_audience_select=/2/dmp/custom_audience/select/
 bytedance_v2_file_video_ad=/2/file/video/ad/
 bytedance_v2_file_image_ad=/2/file/image/ad/
 bytedance_v2_creative_update_status=/2/creative/update/status/
-bytedance_v2_creative_material_get=/2/creative/material/read
+bytedance_v2_creative_material_get=/2/creative/material/read/
 bytedance_v2_creative_create_v2=/2/creative/create_v2/
 bytedance_v2_creative_get=/2/creative/get/
+##报表相关
+bytedance_v2_advertiser_report_get=/2/report/advertiser/get/
+bytedance_v2_campaign_report_get=/2/report/campaign/get/
+bytedance_v2_ad_report_get=/2/report/ad/get/
+bytedance_v2_ad_creative_get=/2/report/creative/get/

+ 0 - 49
mondule-jbpm/pom.xml

@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <artifactId>jeecg-boot-parent</artifactId>
-        <groupId>org.jeecgframework.boot</groupId>
-        <version>2.0.2</version>
-    </parent>
-    <groupId>cn.com.ctop</groupId>
-    <artifactId>mondule-jbpm</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>mondule-jbpm</name>
-
-    <properties>
-        <java.version>1.8</java.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.com.ctop</groupId>
-            <artifactId>module-common</artifactId>
-            <version>2.0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.activiti</groupId>
-            <artifactId>activiti-spring</artifactId>
-            <version>6.0.0</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <resources>
-            <!-- 解决MyBatis配置文件引入问题 -->
-            <resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-                <!-- 是否替换资源中的属性-->
-                <filtering>false</filtering>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-            </resource>
-        </resources>
-    </build>
-
-</project>

+ 0 - 13
mondule-jbpm/src/main/java/cn/com/ctop/jbpm/JbpmApplication.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.jbpm;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class JbpmApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(JbpmApplication.class, args);
-    }
-
-}

+ 0 - 29
mondule-jbpm/src/main/java/cn/com/ctop/jbpm/service/ActivitiTable.java

@@ -1,29 +0,0 @@
-package cn.com.ctop.jbpm.service;
-
-import org.activiti.engine.ProcessEngine;
-import org.activiti.engine.ProcessEngineConfiguration;
-
-/**
- * @author jeecg-boot
- * 2019年12月5日19:55:14
- */
-public class ActivitiTable {
-    public static void main(String[] args) {
-        // 引擎配置
-        ProcessEngineConfiguration pec = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
-        pec.setJdbcDriver("com.mysql.jdbc.Driver");
-        pec.setJdbcUrl("jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false");
-        pec.setJdbcUsername("hcst");
-        pec.setJdbcPassword("hcst2019");
-        /**
-         * false 不能自动创建表
-         * create-drop 先删除表再创建表
-         * true 自动创建和更新表
-         */
-        pec.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
-
-        // 获取流程引擎对象
-        ProcessEngine processEngine = pec.buildProcessEngine();
-
-    }
-}

+ 0 - 1
mondule-jbpm/src/main/resources/application.properties

@@ -1 +0,0 @@
-

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 76
mondule-jbpm/src/main/resources/processes/testbpm.bpmn


+ 118 - 0
moudule-eureca/.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
moudule-eureca/.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
moudule-eureca/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 62 - 0
moudule-eureca/pom.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.2.2.RELEASE</version>
+        <relativePath/>
+    </parent>
+    <groupId>cn.com.ctop.eureca</groupId>
+    <artifactId>server</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>server</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <spring-cloud.version>Hoxton.SR1</spring-cloud.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 15 - 0
moudule-eureca/src/main/java/cn/com/ctop/eureca/server/ServerApplication.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.eureca.server;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
+
+@SpringBootApplication
+@EnableEurekaServer
+public class ServerApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(ServerApplication.class, args);
+    }
+
+}

+ 14 - 0
moudule-eureca/src/main/resources/application.yml

@@ -0,0 +1,14 @@
+server:
+  port: 8761
+
+eureka:
+  instance:
+    hostname: localhost
+  client:
+    registerWithEureka: false
+    fetchRegistry: false
+    serviceUrl:
+      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
+spring:
+  application:
+    name: eurka-server

+ 13 - 0
moudule-eureca/src/test/java/cn/com/ctop/eureca/server/ServerApplicationTests.java

@@ -0,0 +1,13 @@
+package cn.com.ctop.eureca.server;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class ServerApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}

+ 0 - 13
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/PerformanceAppraisalApplication.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.performanceappraisal;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class PerformanceAppraisalApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(PerformanceAppraisalApplication.class, args);
-    }
-
-}

+ 248 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceConfigController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.performanceappraisal.controller;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import cn.com.ctop.performanceappraisal.service.IPerformanceConfigService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+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 javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+@Slf4j
+@Api(tags = "绩效配置文件表")
+@RestController
+@RequestMapping("/ctop/performanceConfig")
+public class PerformanceConfigController {
+    @Autowired
+    private IPerformanceConfigService performanceConfigService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param performanceConfig
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-分页列表查询")
+    @ApiOperation(value = "绩效配置文件表-分页列表查询", notes = "绩效配置文件表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<PerformanceConfig>> queryPageList(PerformanceConfig performanceConfig,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Result<IPage<PerformanceConfig>> result = new Result<IPage<PerformanceConfig>>();
+        QueryWrapper<PerformanceConfig> queryWrapper = QueryGenerator.initQueryWrapper(performanceConfig, req.getParameterMap());
+        Page<PerformanceConfig> page = new Page<PerformanceConfig>(pageNo, pageSize);
+        IPage<PerformanceConfig> pageList = performanceConfigService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param performanceConfig
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-添加")
+    @ApiOperation(value = "绩效配置文件表-添加", notes = "绩效配置文件表-添加")
+    @PostMapping(value = "/add")
+    public Result<PerformanceConfig> add(@RequestBody PerformanceConfig performanceConfig) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        try {
+            performanceConfigService.save(performanceConfig);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param performanceConfig
+     * @return
+     */
+    @AutoLog(value = "绩效配置文件表-编辑")
+    @ApiOperation(value = "绩效配置文件表-编辑", notes = "绩效配置文件表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<PerformanceConfig> edit(@RequestBody PerformanceConfig performanceConfig) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        PerformanceConfig performanceConfigEntity = performanceConfigService.getById(performanceConfig.getId());
+        if (performanceConfigEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = performanceConfigService.updateById(performanceConfig);
+            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 {
+            performanceConfigService.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<PerformanceConfig> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.performanceConfigService.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<PerformanceConfig> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<PerformanceConfig> result = new Result<PerformanceConfig>();
+        PerformanceConfig performanceConfig = performanceConfigService.getById(id);
+        if (performanceConfig == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(performanceConfig);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<PerformanceConfig> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                PerformanceConfig performanceConfig = JSON.parseObject(deString, PerformanceConfig.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(performanceConfig, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<PerformanceConfig> pageList = performanceConfigService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "绩效配置文件表列表");
+        mv.addObject(NormalExcelConstants.CLASS, PerformanceConfig.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<PerformanceConfig> listPerformanceConfigs = ExcelImportUtil.importExcel(file.getInputStream(), PerformanceConfig.class, params);
+                performanceConfigService.saveBatch(listPerformanceConfigs);
+                return Result.ok("文件导入成功!数据行数:" + listPerformanceConfigs.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("文件导入失败!");
+    }
+
+}

+ 71 - 4
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceController.java

@@ -2,20 +2,24 @@ package cn.com.ctop.performanceappraisal.controller;
 
 import cn.com.ctop.performanceappraisal.entity.Performance;
 import cn.com.ctop.performanceappraisal.service.IPerformanceService;
+import cn.com.ctop.userefficientvideomap.mapper.UserEfficientVideoMapMapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -32,6 +36,8 @@ import java.util.Map;
 public class PerformanceController {
     @Autowired
     private IPerformanceService performanceService;
+    @Autowired
+    private UserEfficientVideoMapMapper userEfficientVideoMapMapper;
 
     /**
      * 分页列表查询
@@ -165,13 +171,74 @@ public class PerformanceController {
 
     @GetMapping("/project/list")
     public Map<String, Object> projectList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
-        return performanceService.getUserOptimizerProjectList(pageNo, pageSize);
+                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, String appType) {
+        return performanceService.getUserOptimizerProjectList(pageNo, pageSize, appType);
     }
 
     @GetMapping("/account/list")
     public Map<String, Object> accountList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, Long projectId) {
-        return performanceService.getUserOptimizerAccountList(projectId, pageNo, pageSize);
+                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                           Long projectId, String appType) {
+        return performanceService.getUserOptimizerAccountList(appType, projectId, pageNo, pageSize);
+    }
+
+
+    @AutoLog(value = "设计组内设计师季度绩效表-分页列表查询")
+    @ApiOperation(value = "设计组内设计师季度绩效表-分页列表查询", notes = "设计组内设计师季度绩效表-分页列表查询")
+    @GetMapping(value = "/designerDepartMemberPerformanceList")
+    public Result<IPage<Performance>> designerDepartMemberPerformanceList(Performance performance,
+                                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                          HttpServletRequest req) {
+        Result<IPage<Performance>> result = new Result<IPage<Performance>>();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String departId = userEfficientVideoMapMapper.getDepartIdByUserId("e9ca23d68d884d4ebb19d07889727dae");
+        String departId = userEfficientVideoMapMapper.getDepartIdByUserId(sysUser.getId());
+        List<String> userIdList = userEfficientVideoMapMapper.getUserIdListByDepId(departId);
+        ////
+        QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
+        queryWrapper.in("user_id", userIdList);
+
+        Page<Performance> page = new Page<Performance>(pageNo, pageSize);
+        IPage<Performance> pageList = performanceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
     }
+
+    @AutoLog(value = "北京设计师季度绩效列表-分页列表查询")
+    @ApiOperation(value = "北京设计师季度绩效列表-分页列表查询", notes = "北京设计师季度绩效列表-分页列表查询")
+    @GetMapping(value = "/beijingDesignerPageList")
+    public Result<IPage<Performance>> beijingDesignerPageList(Performance performance,
+                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                              HttpServletRequest req) {
+        Result<IPage<Performance>> result = new Result<IPage<Performance>>();
+        QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
+        Page<Performance> page = new Page<Performance>(pageNo, pageSize);
+        IPage<Performance> pageList = performanceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @AutoLog(value = "北京设计师季度绩效列表-分页列表查询")
+    @ApiOperation(value = "北京设计师季度绩效列表-分页列表查询", notes = "北京设计师季度绩效列表-分页列表查询")
+    @GetMapping(value = "/beijingPlaneDesignerList")
+    public Result<IPage<Performance>> beijingPlaneDesignerPageList(Performance performance,
+                                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                   HttpServletRequest req) {
+        Result<IPage<Performance>> result = new Result<IPage<Performance>>();
+        QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //sysUser.setId("b0e4798234df4096936e6bc6d00db3ba");
+        queryWrapper.eq("user_id", sysUser.getId());
+        Page<Performance> page = new Page<Performance>(pageNo, pageSize);
+        IPage<Performance> pageList = performanceService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
 }

+ 48 - 31
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/controller/PerformanceOptimizerController.java

@@ -64,7 +64,7 @@ public class PerformanceOptimizerController {
                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                              HttpServletRequest req) {
-        Result<IPage<PerformanceOptimizer>> result = new Result<IPage<PerformanceOptimizer>>();
+        Result<IPage<PerformanceOptimizer>> result = new Result<>();
         QueryWrapper<PerformanceOptimizer> queryWrapper = QueryGenerator.initQueryWrapper(performanceOptimizer, req.getParameterMap());
         Page<PerformanceOptimizer> page = new Page<PerformanceOptimizer>(pageNo, pageSize);
         IPage<PerformanceOptimizer> pageList = performanceOptimizerService.page(page, queryWrapper);
@@ -73,36 +73,6 @@ public class PerformanceOptimizerController {
         return result;
     }
 
-    @GetMapping(value = "/detail")
-    @ResponseBody
-    public Map<String, Object> getPerformanceDetail(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                    HttpServletRequest req, @RequestParam(name = "mediaType", defaultValue = "2") String mediaType) {
-        return performanceOptimizerService.getPerformanceDetail(mediaType, pageNo, pageSize);
-    }
-
-    @GetMapping(value = "/ranking/list")
-    @ResponseBody
-    public Map<String, Object> getRankingList(@RequestParam(name = "mediaType", defaultValue = "2") String mediaType,
-                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                              @RequestParam(name = "pageSize", defaultValue = "3") Integer pageSize,
-                                              HttpServletRequest req) {
-        return performanceOptimizerService.getRankingList(mediaType, pageNo, pageSize);
-    }
-
-    /**
-     * 获取项目经理相关数据
-     *
-     * @param req
-     * @param mediaType
-     * @return
-     */
-    @GetMapping(value = "/manager/detail")
-    @ResponseBody
-    public Map<String, Object> getManagerPerformanceDetail(HttpServletRequest req, @RequestParam(name = "mediaType", defaultValue = "2") String mediaType) {
-        return performanceOptimizerService.getManagerPerformanceDetail(mediaType);
-    }
-
     /**
      * 添加
      *
@@ -275,4 +245,51 @@ public class PerformanceOptimizerController {
         return Result.ok("文件导入失败!");
     }
 
+    /**
+     * 优化师绩效详情
+     *
+     * @param pageNo
+     * @param pageSize
+     * @param mediaType
+     * @return
+     */
+    @GetMapping(value = "/detail")
+    @ResponseBody
+    public Map<String, Object> getPerformanceDetail(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                    @RequestParam(name = "mediaType", defaultValue = "2") String mediaType) {
+        return performanceOptimizerService.getPerformanceDetail(mediaType, pageNo, pageSize);
+    }
+
+    /**
+     * 优化师绩效排行榜
+     *
+     * @param mediaType
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/ranking/list")
+    @ResponseBody
+    public Map<String, Object> getRankingList(@RequestParam(name = "mediaType", defaultValue = "2") String mediaType,
+                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                              @RequestParam(name = "pageSize", defaultValue = "3") Integer pageSize,
+                                              @RequestParam(name = "orgCode", defaultValue = "A01") String orgCode) {
+        return performanceOptimizerService.getRankingList(mediaType, pageNo, pageSize, orgCode);
+    }
+
+    /**
+     * 获取项目经理相关数据
+     *
+     * @param req
+     * @param mediaType
+     * @return
+     */
+    @GetMapping(value = "/manager/detail")
+    @ResponseBody
+    public Map<String, Object> getManagerPerformanceDetail(@RequestParam(name = "orgCode", defaultValue = "A01") String orgCode,
+                                                           @RequestParam(name = "mediaType", defaultValue = "2") String mediaType) {
+        return performanceOptimizerService.getManagerPerformanceDetail(mediaType, orgCode);
+    }
+
 }

+ 11 - 2
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/OptimizerConfig.java

@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -35,8 +36,8 @@ public class OptimizerConfig {
     /**
      * 媒体类型
      */
-    @Excel(name = "媒体类型", width = 15)
-    @ApiModelProperty(value = "媒体类型")
+    @Excel(name = "媒体类型1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "媒体类型1_头条2_快手")
     private Integer appType;
     /**
      * 媒体任务
@@ -68,6 +69,14 @@ public class OptimizerConfig {
     @Excel(name = "是否有效", width = 15)
     @ApiModelProperty(value = "是否有效")
     private Integer enabled;
+
+    @Excel(name = "个人总任务", width = 15)
+    @ApiModelProperty(value = "个人总任务")
+    private BigDecimal totalPersonalTask;
+
+    @Excel(name = "机构代码", width = 15)
+    @ApiModelProperty(value = "机构代码")
+    private String orgCode;
     /**
      * createTime
      */

+ 3 - 3
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/Performance.java

@@ -104,9 +104,9 @@ public class Performance {
     /**
      * 1_快手2_抖音
      */
-    @Excel(name = "媒体类型", width = 15)
-    @ApiModelProperty(value = "媒体类型")
-    @Dict(dicCode = "media_type")
+    @Excel(name = "媒体类型1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "媒体类型1_头条2_快手")
+    @Dict(dicCode = "app_type")
     private Integer appType;
     /**
      * 创建时间

+ 63 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/PerformanceConfig.java

@@ -0,0 +1,63 @@
+package cn.com.ctop.performanceappraisal.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+@Data
+@TableName("ctop_performance_config")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_performance_config对象", description = "绩效配置文件表")
+public class PerformanceConfig {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private Integer id;
+    /**
+     * year
+     */
+    @Excel(name = "year", width = 15)
+    @ApiModelProperty(value = "year")
+    private Integer year;
+    /**
+     * quarter
+     */
+    @Excel(name = "quarter", width = 15)
+    @ApiModelProperty(value = "quarter")
+    private Integer quarter;
+    /**
+     * mediaTaskRaise
+     */
+    @Excel(name = "mediaTaskRaise", width = 15)
+    @ApiModelProperty(value = "mediaTaskRaise")
+    private Integer mediaTaskRaise;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 2 - 2
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/PerformanceOptimizer.java

@@ -72,8 +72,8 @@ public class PerformanceOptimizer {
     /**
      * 媒体类型
      */
-    @Excel(name = "媒体类型", width = 15)
-    @ApiModelProperty(value = "媒体类型")
+    @Excel(name = "媒体类型1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "媒体类型1_头条2_快手")
     private Integer appType;
     /**
      * createTime

+ 2 - 2
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/RolePerformancRraise.java

@@ -61,8 +61,8 @@ public class RolePerformancRraise {
     /**
      * 1:快手 2:头条
      */
-    @Excel(name = "媒体类型", width = 15)
-    @ApiModelProperty(value = "媒体类型")
+    @Excel(name = "媒体类型1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "媒体类型1_头条2_快手")
     @Dict(dicCode = "media_type")
     private Integer appType;
     /**

+ 2 - 2
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/entity/RolePerformanceCommission.java

@@ -56,8 +56,8 @@ public class RolePerformanceCommission {
     /**
      * 1:快手  2:头条
      */
-    @Excel(name = "媒体类型", width = 15)
-    @ApiModelProperty(value = "媒体类型")
+    @Excel(name = "媒体类型1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "媒体类型1_头条2_快手")
     @Dict(dicCode = "media_type")
     private Integer appType;
 

+ 15 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/PerformanceConfigMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.performanceappraisal.mapper;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-01-08
+ * @cersion: V1.0
+ */
+public interface PerformanceConfigMapper extends BaseMapper<PerformanceConfig> {
+
+}

+ 14 - 5
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/PerformanceMapper.java

@@ -15,16 +15,25 @@ import java.util.List;
  * @cersion: V1.0
  */
 public interface PerformanceMapper extends BaseMapper<Performance> {
+    List<OptimizerCostDetailVO> getKuaishouOptimizerTotalCostDetailGroupByUserId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize);
 
-    List<OptimizerCostDetailVO> getOptimizerTotalCostDetailGroupByUserId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize);
+    List<OptimizerCostDetailVO> getBytedanceOptimizerTotalCostDetailGroupByUserId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize);
 
     List<OptimizerCostDetailVO> getOptimizerTotalCostDetailGroupByAccountId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize);
 
-    List<OptimizerCostDetailVO> getUserOptimizerTotalCostGroupByProjectId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize, @Param(value = "projectId") Long projectId);
+    List<OptimizerCostDetailVO> getKuaishouUserOptimizerTotalCostGroupByProjectId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize, @Param(value = "projectId") Long projectId);
 
-    List<OptimizerCostDetailVO> getUserOptimizerTotalCostGroupByAccountId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize, @Param(value = "projectId") Long projectId, @Param(value = "accountId") Long accountId);
+    List<OptimizerCostDetailVO> getBytedanceUserOptimizerTotalCostGroupByProjectId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize, @Param(value = "projectId") Long projectId);
 
-    List<OptimizerCostDetailVO> getMemberPerformanceByOrgCode(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "orgCode") String orgCode);
+    List<OptimizerCostDetailVO> getKuaishouUserOptimizerTotalCostGroupByAccountId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize, @Param(value = "projectId") Long projectId, @Param(value = "accountId") Long accountId);
 
-    OptimizerCostDetailVO getOptimizerTotalCost(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter);
+    List<OptimizerCostDetailVO> getBytedanceUserOptimizerTotalCostGroupByAccountId(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "userId") String userId, @Param(value = "startIndex") Integer startIndex, @Param(value = "pageSize") Integer pageSize, @Param(value = "projectId") Long projectId, @Param(value = "accountId") Long accountId);
+
+    List<OptimizerCostDetailVO> getKuaishouMemberPerformanceByOrgCode(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "orgCode") String orgCode);
+
+    List<OptimizerCostDetailVO> getBytedanceMemberPerformanceByOrgCode(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter, @Param(value = "orgCode") String orgCode);
+
+    OptimizerCostDetailVO getKuaishouOptimizerTotalCost(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter);
+
+    OptimizerCostDetailVO getBytedanceOptimizerTotalCost(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "year") String year, @Param(value = "quarter") String quarter);
 }

+ 5 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/xml/PerformanceConfigMapper.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.performanceappraisal.mapper.PerformanceConfigMapper">
+
+</mapper>

+ 143 - 8
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/mapper/xml/PerformanceMapper.xml

@@ -12,7 +12,7 @@
         <result column="projectName" property="projectName"/>
         <result column="accountName" property="accountName"/>
     </resultMap>
-    <select id="getOptimizerTotalCostDetailGroupByUserId" resultMap="OptimizerTotalCostDetail">
+    <select id="getKuaishouOptimizerTotalCostDetailGroupByUserId" resultMap="OptimizerTotalCostDetail">
         SELECT
         sysUser.id as userId,sysUser.realname as realName,SUM(charge) as totalCost,#{year} AS year,#{quarter} as
         quarter,2 as appType
@@ -40,6 +40,34 @@
         limit #{startIndex},#{pageSize}
     </select>
 
+    <select id="getBytedanceOptimizerTotalCostDetailGroupByUserId" resultMap="OptimizerTotalCostDetail">
+        SELECT
+        sysUser.id as userId,sysUser.realname as realName,SUM(dailiAccount.cost) as totalCost,
+        #{year} AS year,#{quarter} as quarter,1 as appType
+        FROM
+        ctop_bytedance_report_advertiser_daily dailyAccount
+        LEFT JOIN
+        ctop_user_allocation allocation ON dailyAccount.advertiser_id = allocation.account_id
+        LEFT JOIN
+        sys_user_role userRole ON userRole.user_id = allocation.user_id
+        LEFT JOIN
+        sys_user sysUser ON sysUser.id = userRole.user_id
+        WHERE
+        userRole.role_id = '79fba4f45f1b8e284af9c68311c6c771'
+        <if test="userId != null">
+            and sysUser.id = #{userId}
+        </if>
+        AND
+        dailyAccount.stat_datetime &gt;= #{startDate}
+        AND
+        dailyAccount.stat_datetime &lt; #{endDate}
+        GROUP BY
+        sysUser.id
+        ORDER BY
+        SUM(dailyAccount.cost) DESC
+        limit #{startIndex},#{pageSize}
+    </select>
+
     <select id="getOptimizerTotalCostDetailGroupByAccountId" resultMap="OptimizerTotalCostDetail">
         SELECT
         dailiAccount.account_id,sysUser.id as userId,sysUser.realname as realName,SUM(charge) as totalCost,#{year} AS
@@ -68,11 +96,11 @@
         limit #{startIndex},#{pageSize}
     </select>
 
-    <select id="getUserOptimizerTotalCostGroupByProjectId" resultMap="OptimizerTotalCostDetail">
+    <select id="getKuaishouUserOptimizerTotalCostGroupByProjectId" resultMap="OptimizerTotalCostDetail">
         SELECT
-        allocation.project_id as projectId,allocation.project_name as projectName,allocation.auth_name as
-        accountName,sysUser.id as
-        userId,sysUser.realname as realName,SUM(charge) as totalCost,#{year} AS year,#{quarter} as quarter,2 as appType
+        allocation.project_id as projectId,allocation.project_name as projectName,
+        allocation.auth_name as accountName,sysUser.id as userId,sysUser.realname as realName,
+        SUM(charge) as totalCost,#{year} AS year,#{quarter} as quarter,2 as appType
         FROM
         ctop_kuaishou_report_daily_account dailiAccount
         LEFT JOIN
@@ -99,7 +127,40 @@
         SUM(charge) DESC
         limit #{startIndex},#{pageSize}
     </select>
-    <select id="getUserOptimizerTotalCostGroupByAccountId" resultMap="OptimizerTotalCostDetail">
+
+    <select id="getBytedanceUserOptimizerTotalCostGroupByProjectId" resultMap="OptimizerTotalCostDetail">
+        SELECT
+        allocation.project_id as projectId,allocation.project_name as projectName,
+        allocation.auth_name as accountName,sysUser.id as userId,sysUser.realname as realName,
+        SUM(dailyAccount.cost) as totalCost,#{year} AS year,#{quarter} as quarter,1 as appType
+        FROM
+        ctop_bytedance_report_advertiser_daily dailyAccount
+        LEFT JOIN
+        ctop_user_allocation allocation ON dailyAccount.advertiser_id = allocation.account_id
+        LEFT JOIN
+        sys_user_role userRole ON userRole.user_id = allocation.user_id
+        LEFT JOIN
+        sys_user sysUser ON sysUser.id = userRole.user_id
+        WHERE
+        userRole.role_id = '79fba4f45f1b8e284af9c68311c6c771'
+        <if test="userId != null">
+            and sysUser.id = #{userId}
+        </if>
+        <if test="projectId != null">
+            and allocation.project_id = #{projectId}
+        </if>
+        AND
+        dailyAccount.stat_datetime &gt;= #{startDate}
+        AND
+        dailyAccount.stat_datetime &lt; #{endDate}
+        GROUP BY
+        allocation.project_id
+        ORDER BY
+        SUM(dailyAccount.cost) DESC
+        limit #{startIndex},#{pageSize}
+    </select>
+
+    <select id="getKuaishouUserOptimizerTotalCostGroupByAccountId" resultMap="OptimizerTotalCostDetail">
         SELECT
         allocation.project_id as projectId,allocation.project_name as projectName,allocation.auth_name as accountName
         ,sysUser.id as
@@ -133,7 +194,41 @@
         limit #{startIndex},#{pageSize}
     </select>
 
-    <select id="getOptimizerTotalCost" resultMap="OptimizerTotalCostDetail">
+    <select id="getBytedanceUserOptimizerTotalCostGroupByAccountId" resultMap="OptimizerTotalCostDetail">
+        SELECT
+        allocation.project_id as projectId,allocation.project_name as projectName,
+        allocation.auth_name as accountName,sysUser.id as userId,sysUser.realname as realName,
+        SUM(dailyAccount.cost) as totalCost,#{year} AS year,#{quarter} as quarter,1 as appType
+        FROM
+        ctop_bytedance_report_advertiser_daily dailyAccount
+        LEFT JOIN
+        ctop_user_allocation allocation ON dailyAccount.advertiser_id = allocation.account_id
+        LEFT JOIN
+        sys_user_role userRole ON userRole.user_id = allocation.user_id
+        LEFT JOIN
+        sys_user sysUser ON sysUser.id = userRole.user_id
+        WHERE
+        1=1
+        and
+        userRole.role_id = '79fba4f45f1b8e284af9c68311c6c771'
+        <if test="projectId != null">
+            and allocation.project_id = #{projectId}
+        </if>
+        <if test="userId != null">
+            and sysUser.id = #{userId}
+        </if>
+        AND
+        dailyAccount.stat_datetime &gt;= #{startDate}
+        AND
+        dailyAccount.stat_datetime &lt; #{endDate}
+        GROUP BY
+        allocation.account_id
+        ORDER BY
+        SUM(dailyAccount.cost) DESC
+        limit #{startIndex},#{pageSize}
+    </select>
+
+    <select id="getKuaishouOptimizerTotalCost" resultMap="OptimizerTotalCostDetail">
         SELECT
             '账户总计' as realname,SUM(charge) as totalCost,#{year} AS year,#{quarter} as quarter,2 as appType
         FROM
@@ -153,7 +248,27 @@
         GROUP BY userRole.role_id
     </select>
 
-    <select id="getMemberPerformanceByOrgCode" resultMap="OptimizerTotalCostDetail">
+    <select id="getBytedanceOptimizerTotalCost" resultMap="OptimizerTotalCostDetail">
+        SELECT
+            '账户总计' as realname,SUM(dailyAccount.cost) as totalCost,#{year} AS year,#{quarter} as quarter,1 as appType
+        FROM
+            ctop_bytedance_report_advertiser_daily dailyAccount
+        LEFT JOIN
+            ctop_user_allocation allocation ON dailyAccount.advertiser_id = allocation.account_id
+        LEFT JOIN
+            sys_user_role userRole ON userRole.user_id = allocation.user_id
+        LEFT JOIN
+            sys_user sysUser ON sysUser.id = userRole.user_id
+        WHERE
+            userRole.role_id = '79fba4f45f1b8e284af9c68311c6c771'
+        AND
+            dailyAccount.stat_date &gt;= #{startDate}
+        AND
+            dailyAccount.stat_date &lt; #{endDate}
+        GROUP BY userRole.role_id
+    </select>
+
+    <select id="getKuaishouMemberPerformanceByOrgCode" resultMap="OptimizerTotalCostDetail">
         SELECT
             sysUser.id as userId,sysUser.realname as realName,SUM(charge) as totalCost,#{year} AS year,#{quarter} as quarter,2 as appType
         FROM
@@ -172,6 +287,26 @@
             sysUser.id
         ORDER BY
             SUM(charge) DESC
+    </select>
 
+    <select id="getBytedanceMemberPerformanceByOrgCode" resultMap="OptimizerTotalCostDetail">
+        SELECT
+            sysUser.id as userId,sysUser.realname as realName,SUM(dailyAccount.cost) as totalCost,#{year} AS year,#{quarter} as quarter,2 as appType
+        FROM
+            ctop_bytedance_report_advertiser_daily dailyAccount
+        LEFT JOIN
+            ctop_user_allocation allocation ON dailyAccount.advertiser_id = allocation.account_id
+        LEFT JOIN
+            sys_user_role userRole ON userRole.user_id = allocation.user_id
+        LEFT JOIN
+            sys_user sysUser ON sysUser.id = userRole.user_id
+        WHERE
+            userRole.role_id = '79fba4f45f1b8e284af9c68311c6c771'
+		AND
+			sysUser.org_code = #{orgCode}
+        GROUP BY
+            sysUser.id
+        ORDER BY
+            SUM(dailyAccount.cost) DESC
     </select>
 </mapper>

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IOptimizerConfigService.java

@@ -11,5 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @date 2019-12-13
  */
 public interface IOptimizerConfigService extends IService<OptimizerConfig> {
-    OptimizerConfig getEnabledConfigByMediaType(String mediaType);
+    OptimizerConfig getEnabledConfigByMediaType(String mediaType, String orgCode);
 }

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IOptimizerRoleInfoService.java

@@ -14,5 +14,5 @@ import java.util.Map;
  */
 public interface IOptimizerRoleInfoService extends IService<OptimizerRoleInfo> {
 
-    Map<String, Object> getmanagerDetail(Integer appType);
+    Map<String, Object> getManagerDetail(String appType, String orgCode);
 }

+ 16 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceConfigService.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.performanceappraisal.service;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+public interface IPerformanceConfigService extends IService<PerformanceConfig> {
+
+    PerformanceConfig getNowConfig();
+}

+ 2 - 2
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceOptimizerService.java

@@ -16,7 +16,7 @@ public interface IPerformanceOptimizerService extends IService<PerformanceOptimi
 
     Map<String, Object> getPerformanceDetail(String mediaType, Integer pageNo, Integer pageSize);
 
-    Map<String, Object> getRankingList(String mediaType, Integer pageNo, Integer pageSize);
+    Map<String, Object> getRankingList(String mediaType, Integer pageNo, Integer pageSize, String orgCode);
 
-    Map<String, Object> getManagerPerformanceDetail(String mediaType);
+    Map<String, Object> getManagerPerformanceDetail(String mediaType, String orgCode);
 }

+ 5 - 4
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/IPerformanceService.java

@@ -25,13 +25,14 @@ public interface IPerformanceService extends IService<Performance> {
     /**
      * 获取优化师总消耗数据信息
      */
-    List<OptimizerCostDetailVO> getOptimizerTotalCostDetailGroupByUserId(String userId, Integer startIndex, Integer pageSize);
+    List<OptimizerCostDetailVO> getOptimizerTotalCostDetailGroupByUserId(String mediaType, String userId, Integer startIndex, Integer pageSize);
 
-    OptimizerCostDetailVO getOptimizerTotalCost();
+    OptimizerCostDetailVO getOptimizerTotalCost(String mediaType);
 
-    Map<String, Object> getUserOptimizerProjectList(Integer pageNo, Integer pageSize);
+    Map<String, Object> getUserOptimizerProjectList(Integer pageNo, Integer pageSize, String appType);
 
-    Map<String, Object> getUserOptimizerAccountList(Long projectId, Integer pageNo, Integer pageSize);
+    Map<String, Object> getUserOptimizerAccountList(String apptype, Long projectId, Integer pageNo, Integer pageSize);
 
     Map<String, Object> getMemberPerformanceByUserId(OptimizerConfig config, OptimizerCostDetailVO totalCostVo);
+
 }

+ 6 - 2
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/OptimizerConfigServiceImpl.java

@@ -18,9 +18,13 @@ import org.springframework.stereotype.Service;
 public class OptimizerConfigServiceImpl extends ServiceImpl<OptimizerConfigMapper, OptimizerConfig> implements IOptimizerConfigService {
 
     @Override
-    public OptimizerConfig getEnabledConfigByMediaType(String mediaType) {
+    public OptimizerConfig getEnabledConfigByMediaType(String mediaType, String orgCode) {
         QueryWrapper<OptimizerConfig> queryWrapper = new QueryWrapper();
-        queryWrapper.eq("enabled", "1").eq("app_type", mediaType).orderByDesc("id").last(" limit 1");
+        queryWrapper.eq("enabled", "1")
+                .eq("app_type", mediaType)
+                .eq("org_code", orgCode)
+                .orderByDesc("id")
+                .last(" limit 1");
         return this.getOne(queryWrapper);
     }
 }

+ 3 - 3
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/OptimizerRoleInfoServiceImpl.java

@@ -31,12 +31,12 @@ public class OptimizerRoleInfoServiceImpl extends ServiceImpl<OptimizerRoleInfoM
     private IOptimizerConfigService optimizerConfigService;
 
     @Override
-    public Map<String, Object> getmanagerDetail(Integer appType) {
+    public Map<String, Object> getManagerDetail(String appType, String orgCode) {
         Map<String, Object> result = new HashMap<>();
         try {
             //1:查询媒体任务
-            OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost();
-            OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(appType + "");
+            OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost(appType);
+            OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(appType, orgCode);
             //查询经理所属人员任务完成信息列表
             result = performanceService.getMemberPerformanceByUserId(config, totalCostVo);
             ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());

+ 34 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceConfigServiceImpl.java

@@ -0,0 +1,34 @@
+package cn.com.ctop.performanceappraisal.service.impl;
+
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
+import cn.com.ctop.performanceappraisal.mapper.PerformanceConfigMapper;
+import cn.com.ctop.performanceappraisal.service.IPerformanceConfigService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * 绩效配置文件表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-01-08
+ */
+@Service
+public class PerformanceConfigServiceImpl extends ServiceImpl<PerformanceConfigMapper, PerformanceConfig> implements IPerformanceConfigService {
+
+    @Override
+    public PerformanceConfig getNowConfig() {
+        Integer year = DateUtils.getYear(new Date());
+        Integer quarter = DateUtils.getQuarter(new Date());
+        QueryWrapper<PerformanceConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("year", year)
+                .eq("quarter", quarter)
+                .orderByDesc("id")
+                .last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 198 - 42
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceOptimizerServiceImpl.java

@@ -1,15 +1,18 @@
 package cn.com.ctop.performanceappraisal.service.impl;
 
+import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.performanceappraisal.entity.OptimizerConfig;
+import cn.com.ctop.performanceappraisal.entity.PerformanceConfig;
 import cn.com.ctop.performanceappraisal.entity.PerformanceOptimizer;
 import cn.com.ctop.performanceappraisal.mapper.PerformanceOptimizerMapper;
 import cn.com.ctop.performanceappraisal.service.IOptimizerConfigService;
+import cn.com.ctop.performanceappraisal.service.IPerformanceConfigService;
 import cn.com.ctop.performanceappraisal.service.IPerformanceOptimizerService;
 import cn.com.ctop.performanceappraisal.service.IPerformanceService;
 import cn.com.ctop.performanceappraisal.vo.OptimizerCostDetailVO;
-import com.alibaba.fastjson.JSONObject;
+import cn.com.ctop.performanceappraisal.vo.UserPerformanceDetailVO;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
@@ -43,52 +46,192 @@ public class PerformanceOptimizerServiceImpl extends ServiceImpl<PerformanceOpti
         Integer startIndex = (pageNo - 1) * pageSize;
         //查询当前登录人信息
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        LoginUser sysUser = new LoginUser();
-//        sysUser.setId("fcb3fbf6192640adaadb2a7df9c02dae");
-        //查询当前媒体配置信息
-        OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(mediaType);
-        if (null == config) {
-            ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_CONFIG_IS_NULL.getCode());
+        String orgCode = sysUser.getOrgCode();
+        if (orgCode.startsWith(CtopAdConstant.CTOP_ORGCODE_NORTH_CHINA_PREFIX)) {
+            //华北
+            //查询当前媒体配置信息
+            OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(mediaType, CtopAdConstant.CTOP_ORGCODE_NORTH_CHINA_PREFIX);
+            if (null == config) {
+                ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_CONFIG_IS_NULL.getCode());
+                return result;
+            }
+            //:查询当前用户截止到目前当前季度的消耗统计数据
+            List<OptimizerCostDetailVO> vos = performanceService.getOptimizerTotalCostDetailGroupByUserId(mediaType, sysUser.getId(), startIndex, pageSize);
+            if (null == vos || vos.size() <= 0) {
+                ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_PERSONNAL_DATA_IS_NULL.getCode());
+                return result;
+            }
+            //2: 查询媒体季度任务完成情况
+            UserPerformanceDetailVO performanceDetailVO = getPerformanceDetailVO(mediaType, vos.get(0), config);
+            result.put("userDetail", performanceDetailVO);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
             return result;
-        }
-        //:查询当前用户截止到目前当前季度的消耗统计数据
-        List<OptimizerCostDetailVO> vos = performanceService.getOptimizerTotalCostDetailGroupByUserId(sysUser.getId(), startIndex, pageSize);
-        if (null == vos || vos.size() <= 0) {
-            ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_PERSONNAL_DATA_IS_NULL.getCode());
+        } else if (orgCode.startsWith(CtopAdConstant.CTOP_ORGCODE_EAST_CHINA_PREFIX)) {
+            //华东
+            //查询当前媒体配置信息
+            OptimizerConfig kuaishouConfig = optimizerConfigService.getEnabledConfigByMediaType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU, CtopAdConstant.CTOP_ORGCODE_EAST_CHINA_PREFIX);
+            OptimizerConfig bytedanceConfig = optimizerConfigService.getEnabledConfigByMediaType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE, CtopAdConstant.CTOP_ORGCODE_EAST_CHINA_PREFIX);
+            if (null == kuaishouConfig || null == bytedanceConfig) {
+                ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_OPTINIZER_CONFIG_IS_NULL.getCode());
+                return result;
+            }
+            //:查询当前用户截止到目前当前季度的消耗统计数据
+            List<OptimizerCostDetailVO> kuaishouVos = performanceService.getOptimizerTotalCostDetailGroupByUserId(CtopAdConstant.PLATFORM_TYPE_KUAISHOU, sysUser.getId(), startIndex, pageSize);
+            List<OptimizerCostDetailVO> bytedanceVos = performanceService.getOptimizerTotalCostDetailGroupByUserId(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE, sysUser.getId(), startIndex, pageSize);
+            boolean hasNoCost = (null == kuaishouVos || kuaishouVos.size() <= 0) && (null == bytedanceVos || bytedanceVos.size() <= 0);
+            if (hasNoCost) {
+                ResultMapUtils.setResultMap(result, StatusCode.OPTINIZER_PERSONNAL_DATA_IS_NULL.getCode());
+                return result;
+            }
+            if (null == kuaishouVos || kuaishouVos.size() <= 0) {
+                //快手消耗为0
+                //2: 查询头条媒体季度任务完成情况
+                UserPerformanceDetailVO performanceDetailVO = getPerformanceDetailVO(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE, bytedanceVos.get(0), bytedanceConfig);
+                result.put("userDetail", performanceDetailVO);
+                ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
+                return result;
+            }
+            if (null == bytedanceVos || bytedanceVos.size() <= 0) {
+                //头条消耗为0
+                //2: 查询快手媒体季度任务完成情况
+                UserPerformanceDetailVO performanceDetailVO = getPerformanceDetailVO(CtopAdConstant.PLATFORM_TYPE_KUAISHOU, kuaishouVos.get(0), kuaishouConfig);
+                result.put("userDetail", performanceDetailVO);
+                ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
+                return result;
+            }
+            //快手+头条
+            UserPerformanceDetailVO performanceDetailVO = getMultiPerformanceDetailVO(kuaishouVos.get(0), kuaishouConfig, bytedanceVos.get(0), bytedanceConfig);
+            result.put("userDetail", performanceDetailVO);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
+            return result;
+        } else {
+            ResultMapUtils.setResultMap(result, StatusCode.CTOP_HAS_NO_PERFORMANCE_STATISTIC_LOGIC);
             return result;
         }
-        //2: 查询媒体季度任务完成情况
-        OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost();
-        OptimizerCostDetailVO detailVO = vos.get(0);
-        detailVO.setTotalRoyalty(getTotalRoyalty(config, detailVO, totalCostVo));
-        JSONObject detail = new JSONObject();
-        detail.put("realName", detailVO.getRealName());
-        detail.put("totalCost", detailVO.getTotalCost());
-        detail.put("totalRoyalty", detailVO.getTotalRoyalty());
-        detail.put("mediaTask", config.getMediaTask());
-        detail.put("personalTask", config.getPersonalTask());
-
-        detail.put("year", detailVO.getYear());
-        detail.put("quarter", detailVO.getQuarter());
-        detail.put("royaltyRatio", getRate(config, detailVO, totalCostVo).toString() + "‰");
-        result.put("userDetail", detail);
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
-        return result;
+    }
+
+    private UserPerformanceDetailVO getMultiPerformanceDetailVO(OptimizerCostDetailVO kuaishouQuarterCostVO, OptimizerConfig kuaishouConfig, OptimizerCostDetailVO bytedanceQuarterCostVO, OptimizerConfig bytedanceConfig) {
+        //1:获取个人各渠道消耗
+        OptimizerCostDetailVO kuaishouTotalCostVo = performanceService.getOptimizerTotalCost(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        OptimizerCostDetailVO bytedanceTotalCostVo = performanceService.getOptimizerTotalCost(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+
+        UserPerformanceDetailVO performanceDetailVO = new UserPerformanceDetailVO();
+        performanceDetailVO.setRealName(kuaishouTotalCostVo.getRealName());
+        //个人消耗
+        performanceDetailVO.setKuaishouPersonalCost(kuaishouTotalCostVo.getTotalCost());
+        performanceDetailVO.setBytedancePersonalCost(bytedanceTotalCostVo.getTotalCost());
+        performanceDetailVO.setTotalPersonalCost(kuaishouTotalCostVo.getTotalCost().add(bytedanceTotalCostVo.getTotalCost()).setScale(2, RoundingMode.HALF_UP));
+        //媒体消耗
+        performanceDetailVO.setKuaishouMediaCost(kuaishouQuarterCostVO.getTotalCost());
+        performanceDetailVO.setBytedanceMediaCost(bytedanceQuarterCostVO.getTotalCost());
+        performanceDetailVO.setTotalMediaCost(bytedanceQuarterCostVO.getTotalCost().add(kuaishouQuarterCostVO.getTotalCost()).setScale(2, RoundingMode.HALF_UP));
+
+        //媒体任务
+        performanceDetailVO.setKuaishouMediaTask(kuaishouConfig.getMediaTask());
+        performanceDetailVO.setBytedanceMediaTask(bytedanceConfig.getMediaTask());
+        performanceDetailVO.setTotalMediaCost(kuaishouConfig.getMediaTask().add(bytedanceConfig.getMediaTask()).setScale(2, RoundingMode.HALF_UP));
+
+        //个人任务
+        performanceDetailVO.setTotalPersonalTask(kuaishouConfig.getTotalPersonalTask());
+        performanceDetailVO.setKuaishouPersonalTask(kuaishouConfig.getPersonalTask());
+        performanceDetailVO.setBytedancePersonalTask(bytedanceConfig.getPersonalTask());
+
+        performanceDetailVO.setYear(kuaishouQuarterCostVO.getYear());
+        performanceDetailVO.setQuarter(kuaishouQuarterCostVO.getQuarter());
+
+        //快手提成
+        performanceDetailVO.setKuaishouRoyalty(getRoyalty(kuaishouConfig,
+                performanceDetailVO.getTotalPersonalCost(), performanceDetailVO.getTotalPersonalTask(),
+                performanceDetailVO.getKuaishouMediaCost(), performanceDetailVO.getKuaishouMediaTask(),
+                performanceDetailVO.getKuaishouPersonalCost()));
+        //头条提成
+        performanceDetailVO.setBytedanceRoyalty(getRoyalty(bytedanceConfig,
+                performanceDetailVO.getTotalPersonalCost(), performanceDetailVO.getTotalPersonalTask(),
+                performanceDetailVO.getBytedanceMediaCost(), performanceDetailVO.getBytedanceMediaTask(),
+                performanceDetailVO.getBytedancePersonalCost()));
+
+        //快手提成点
+        performanceDetailVO.setKuaishouRoyaltyRatio(getRoyaltyRatio(kuaishouConfig, performanceDetailVO.getTotalPersonalCost(), performanceDetailVO.getTotalPersonalTask(), performanceDetailVO.getKuaishouMediaCost(), performanceDetailVO.getKuaishouMediaTask()));
+        //头条提成点
+        performanceDetailVO.setBytedanceRoyaltyRatio(getRoyaltyRatio(bytedanceConfig, performanceDetailVO.getTotalPersonalCost(), performanceDetailVO.getTotalPersonalTask(), performanceDetailVO.getBytedanceMediaCost(), performanceDetailVO.getBytedanceMediaTask()));
+        //总提成
+        performanceDetailVO.setTotalRoyalty(performanceDetailVO.getBytedanceRoyalty().add(performanceDetailVO.getKuaishouRoyalty()).setScale(2, RoundingMode.HALF_UP));
+
+        return performanceDetailVO;
+    }
+
+    private BigDecimal getRoyalty(OptimizerConfig bytedanceConfig, BigDecimal totalPersonalCost, BigDecimal totalPersonalTask, BigDecimal bytedanceMediaCost, BigDecimal bytedanceMediaTask, BigDecimal bytedancePersonalCost) {
+        BigDecimal royalty = BigDecimal.ZERO;
+
+        //个人任务未完成
+        if (totalPersonalCost.compareTo(totalPersonalTask) < 0) {
+            return royalty;
+        }
+        //快手媒体任务未完成
+        if (bytedanceMediaCost.compareTo(bytedanceMediaTask) < 0) {
+            return bytedancePersonalCost.multiply(bytedanceConfig.getMediaTaskNoFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
+        }
+
+        PerformanceConfig performanceConfig = performanceConfigService.getNowConfig();
+        if (null != performanceConfig && performanceConfig.getMediaTaskRaise() == 1) {
+            //同意提高提成点
+            return bytedancePersonalCost.multiply(bytedanceConfig.getMediaTaskFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
+        } else {
+            return bytedancePersonalCost.multiply(bytedanceConfig.getMediaTaskFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
+        }
+    }
+
+    private BigDecimal getRoyaltyRatio(OptimizerConfig bytedanceConfig, BigDecimal totalPersonalCost, BigDecimal totalPersonalTask, BigDecimal mediaCost, BigDecimal mediaTask) {
+        BigDecimal royalty = BigDecimal.ZERO;
+
+        //个人任务未完成
+        if (totalPersonalCost.compareTo(totalPersonalTask) < 0) {
+            return royalty;
+        }
+        //快手媒体任务未完成
+        if (mediaCost.compareTo(mediaTask) < 0) {
+            return bytedanceConfig.getMediaTaskNoFinishRate().setScale(2, RoundingMode.HALF_UP);
+        }
+
+        PerformanceConfig performanceConfig = performanceConfigService.getNowConfig();
+        if (null != performanceConfig && performanceConfig.getMediaTaskRaise() == 1) {
+            //同意提高提成点
+            return bytedanceConfig.getMediaTaskFinishRate().setScale(2, RoundingMode.HALF_UP);
+        } else {
+            return bytedanceConfig.getMediaTaskNoFinishRate().setScale(2, RoundingMode.HALF_UP);
+        }
+    }
+
+    private UserPerformanceDetailVO getPerformanceDetailVO(String appType, OptimizerCostDetailVO kuaishouCostVo, OptimizerConfig kuaishouConfig) {
+        OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost(appType);
+        UserPerformanceDetailVO performanceDetailVO = new UserPerformanceDetailVO();
+        kuaishouCostVo.setTotalRoyalty(getTotalRoyalty(kuaishouConfig, kuaishouCostVo, totalCostVo));
+        performanceDetailVO.setRealName(kuaishouCostVo.getRealName());
+        performanceDetailVO.setTotalPersonalCost(kuaishouCostVo.getTotalCost());
+        performanceDetailVO.setTotalRoyalty(kuaishouCostVo.getTotalRoyalty());
+        performanceDetailVO.setTotalMediaTask(kuaishouConfig.getMediaTask());
+        performanceDetailVO.setTotalPersonalTask(kuaishouConfig.getPersonalTask());
+
+        performanceDetailVO.setYear(kuaishouCostVo.getYear());
+        performanceDetailVO.setQuarter(kuaishouCostVo.getQuarter());
+        performanceDetailVO.setRoyaltyRatio(getRate(kuaishouConfig, kuaishouCostVo, totalCostVo).toString() + "‰");
+        return performanceDetailVO;
     }
 
     @Override
-    public Map<String, Object> getRankingList(String mediaType, Integer pageNo, Integer pageSize) {
+    //TODO --先优先华北的逻辑
+    public Map<String, Object> getRankingList(String mediaType, Integer pageNo, Integer pageSize, String orgCode) {
         Map<String, Object> result = new HashMap<>();
         Integer startIndex = (pageNo - 1) * pageSize;
-        List<OptimizerCostDetailVO> vos = performanceService.getOptimizerTotalCostDetailGroupByUserId(null, startIndex, pageSize);
+        List<OptimizerCostDetailVO> vos = performanceService.getOptimizerTotalCostDetailGroupByUserId(mediaType, null, startIndex, pageSize);
         if (null == vos || vos.size() <= 0) {
             ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_CRAWLER_APP_ELEMENT_IS_NULL.getCode());
             return result;
         }
         //查询优化师系统设置数据
-        OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType("2");
+        OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(mediaType, orgCode);
         //2: 查询媒体季度任务完成情况
-        OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost();
+        OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost(mediaType);
         //3:计算单个优化师提成总额
         List<OptimizerCostDetailVO> getDetailVos = new ArrayList<>();
         if (null != vos && vos.size() > 0) {
@@ -103,13 +246,14 @@ public class PerformanceOptimizerServiceImpl extends ServiceImpl<PerformanceOpti
     }
 
     @Override
-    public Map<String, Object> getManagerPerformanceDetail(String mediaType) {
+    //TODO --优先华北
+    public Map<String, Object> getManagerPerformanceDetail(String mediaType, String orgCode) {
         Map<String, Object> result = new HashMap<>();
         //获取经理相关信息
         //查询优化师系统设置数据
-        OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(mediaType);
+        OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType(mediaType, orgCode);
         //2: 查询媒体季度任务完成情况
-        OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost();
+        OptimizerCostDetailVO totalCostVo = performanceService.getOptimizerTotalCost(mediaType);
         result.put("totalCost", totalCostVo.getTotalCost().toString());
         if (totalCostVo.getTotalCost().compareTo(config.getMediaTask()) < 0) {
             //当前消耗季度任务未完成
@@ -122,6 +266,8 @@ public class PerformanceOptimizerServiceImpl extends ServiceImpl<PerformanceOpti
         return result;
     }
 
+    @Autowired
+    private IPerformanceConfigService performanceConfigService;
     private BigDecimal getTotalRoyalty(OptimizerConfig config, OptimizerCostDetailVO vo, OptimizerCostDetailVO quarterCost) {
         BigDecimal royalty = BigDecimal.ZERO;
         //个人总消耗
@@ -135,11 +281,15 @@ public class PerformanceOptimizerServiceImpl extends ServiceImpl<PerformanceOpti
             return royalty;
         }
         //季度任务未完成
-        if (totalCost.compareTo(mediaTask) < 0) {
+        if (quarterCost.getTotalCost().compareTo(mediaTask) < 0) {
+            return totalCost.multiply(config.getMediaTaskNoFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
+        }
+        PerformanceConfig performanceConfig = performanceConfigService.getNowConfig();
+        if (null != performanceConfig && performanceConfig.getMediaTaskRaise() == 1) {
+            return totalCost.multiply(config.getMediaTaskFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
+        } else {
             return totalCost.multiply(config.getMediaTaskNoFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
         }
-
-        return totalCost.multiply(config.getMediaTaskFinishRate()).divide(new BigDecimal("1000")).setScale(2, RoundingMode.HALF_UP);
     }
 
     private BigDecimal getRate(OptimizerConfig config, OptimizerCostDetailVO vo, OptimizerCostDetailVO quarterCost) {
@@ -152,13 +302,19 @@ public class PerformanceOptimizerServiceImpl extends ServiceImpl<PerformanceOpti
         BigDecimal mediaTask = config.getMediaTask();
         //个人任务未完成
         if (totalCost.compareTo(personalTask) < 0) {
-            return BigDecimal.ZERO;
+            return royalty;
         }
         //季度任务未完成
-        if (totalCost.compareTo(mediaTask) < 0) {
+        if (quarterCost.getTotalCost().compareTo(mediaTask) < 0) {
+            return config.getMediaTaskNoFinishRate().setScale(2, RoundingMode.HALF_UP);
+        }
+
+        PerformanceConfig performanceConfig = performanceConfigService.getNowConfig();
+        if (null != performanceConfig && performanceConfig.getMediaTaskRaise() == 1) {
+            return config.getMediaTaskFinishRate().setScale(2, RoundingMode.HALF_UP);
+        } else {
             return config.getMediaTaskNoFinishRate().setScale(2, RoundingMode.HALF_UP);
         }
 
-        return config.getMediaTaskFinishRate().setScale(2, RoundingMode.HALF_UP);
     }
 }

+ 37 - 47
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/service/impl/PerformanceServiceImpl.java

@@ -1,13 +1,11 @@
 package cn.com.ctop.performanceappraisal.service.impl;
 
+import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.performanceappraisal.entity.OptimizerConfig;
 import cn.com.ctop.performanceappraisal.entity.Performance;
-import cn.com.ctop.performanceappraisal.entity.PerformanceOptimizer;
 import cn.com.ctop.performanceappraisal.mapper.PerformanceMapper;
-import cn.com.ctop.performanceappraisal.mapper.PerformanceOptimizerMapper;
-import cn.com.ctop.performanceappraisal.service.IOptimizerConfigService;
 import cn.com.ctop.performanceappraisal.service.IPerformanceService;
 import cn.com.ctop.performanceappraisal.vo.DesignerCostDetailVO;
 import cn.com.ctop.performanceappraisal.vo.OptimizerCostDetailVO;
@@ -33,10 +31,6 @@ import java.util.*;
 public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Performance> implements IPerformanceService {
     @Autowired
     private PerformanceMapper performanceMapper;
-    @Autowired
-    private PerformanceOptimizerMapper optimizerMapper;
-    @Autowired
-    private IOptimizerConfigService optimizerConfigService;
     /**
      * 计算设计岗位绩效逻辑
      * 1:查询用户总消耗以及总视频数
@@ -50,58 +44,43 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
     }
 
     @Override
-    public List<OptimizerCostDetailVO> getOptimizerTotalCostDetailGroupByUserId(String userId, Integer startIndex, Integer pageSize) {
+    public List<OptimizerCostDetailVO> getOptimizerTotalCostDetailGroupByUserId(String mediaType, String userId, Integer startIndex, Integer pageSize) {
         Date date = new Date();
         Date getDate = DateUtils.addDay(date, -1);
         String startDate = DateUtils.getQuarterStartDate(getDate);
         String endDate = DateUtils.getQuarterEndDate(getDate);
         String year = DateUtils.getYear(getDate) + "";
         String quarter = DateUtils.getQuarter(getDate) + "";
-        return performanceMapper.getOptimizerTotalCostDetailGroupByUserId(startDate, endDate, year, quarter, userId, startIndex, pageSize);
-    }
-
-    /**
-     * 计算优化师岗位绩效逻辑
-     * 1:查询所有优化师总消耗数据
-     * 2:查询媒体季度任务完成情况
-     * 3:计算单个优化师提成总额
-     */
-    public List<OptimizerCostDetailVO> getOptimizerPerformance() {
-        //1:查询所有优化师总消耗数据
-        List<OptimizerCostDetailVO> detailVOS = getOptimizerTotalCostDetailGroupByUserId(null, 1, 10);
-        //查询优化师系统设置数据
-        OptimizerConfig config = optimizerConfigService.getEnabledConfigByMediaType("2");
-        //2: 查询媒体季度任务完成情况
-        OptimizerCostDetailVO totalCostVo = getOptimizerTotalCost();
-        //3:计算单个优化师提成总额
-        List<OptimizerCostDetailVO> getDetailVos = new ArrayList<>();
-        if (null != detailVOS && detailVOS.size() > 0) {
-            for (OptimizerCostDetailVO vo : detailVOS) {
-                vo.setTotalRoyalty(getTotalRoyalty(config, vo, totalCostVo));
-                PerformanceOptimizer optimizer = new PerformanceOptimizer(vo);
-                optimizerMapper.insert(optimizer);
-            }
+        if (null != mediaType && mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            //快手
+            return performanceMapper.getKuaishouOptimizerTotalCostDetailGroupByUserId(startDate, endDate, year, quarter, userId, startIndex, pageSize);
+        } else {
+            //头条
+            return performanceMapper.getBytedanceOptimizerTotalCostDetailGroupByUserId(startDate, endDate, year, quarter, userId, startIndex, pageSize);
         }
-        return getDetailVos;
     }
 
     @Override
-    public OptimizerCostDetailVO getOptimizerTotalCost() {
+    public OptimizerCostDetailVO getOptimizerTotalCost(String mediaType) {
         Date date = new Date();
         Date getDate = DateUtils.addDay(date, -1);
         String startDate = DateUtils.getQuarterStartDate(getDate);
         String endDate = DateUtils.getQuarterEndDate(getDate);
         String year = DateUtils.getYear(getDate) + "";
         String quarter = DateUtils.getQuarter(getDate) + "";
-        return performanceMapper.getOptimizerTotalCost(startDate, endDate, year, quarter);
+        if (null != mediaType && mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            //快手
+            return performanceMapper.getKuaishouOptimizerTotalCost(startDate, endDate, year, quarter);
+        } else {
+            //头条
+            return performanceMapper.getBytedanceOptimizerTotalCost(startDate, endDate, year, quarter);
+        }
     }
 
     @Override
-    public Map<String, Object> getUserOptimizerProjectList(Integer pageNo, Integer pageSize) {
+    public Map<String, Object> getUserOptimizerProjectList(Integer pageNo, Integer pageSize, String appType) {
         Map<String, Object> result = new HashMap<>();
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        LoginUser sysUser = new LoginUser();
-//        sysUser.setId("fcb3fbf6192640adaadb2a7df9c02dae");
         Integer startIndex = (pageNo - 1) * pageSize;
         Date date = new Date();
         Date getDate = DateUtils.addDay(date, -1);
@@ -109,18 +88,21 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
         String endDate = DateUtils.getQuarterEndDate(getDate);
         String year = DateUtils.getYear(getDate) + "";
         String quarter = DateUtils.getQuarter(getDate) + "";
-        List<OptimizerCostDetailVO> detailVOS = performanceMapper.getUserOptimizerTotalCostGroupByProjectId(startDate, endDate, year, quarter, sysUser.getId(), startIndex, pageSize, null);
+        List<OptimizerCostDetailVO> detailVOS = null;
+        if (null != appType && appType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            detailVOS = performanceMapper.getKuaishouUserOptimizerTotalCostGroupByProjectId(startDate, endDate, year, quarter, sysUser.getId(), startIndex, pageSize, null);
+        } else {
+            detailVOS = performanceMapper.getBytedanceUserOptimizerTotalCostGroupByProjectId(startDate, endDate, year, quarter, sysUser.getId(), startIndex, pageSize, null);
+        }
         result.put("data", detailVOS);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
         return result;
     }
 
     @Override
-    public Map<String, Object> getUserOptimizerAccountList(Long projectId, Integer pageNo, Integer pageSize) {
+    public Map<String, Object> getUserOptimizerAccountList(String appType, Long projectId, Integer pageNo, Integer pageSize) {
         Map<String, Object> result = new HashMap<>();
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        LoginUser sysUser = new LoginUser();
-//        sysUser.setId("fcb3fbf6192640adaadb2a7df9c02dae");
         Integer startIndex = (pageNo - 1) * pageSize;
         Date date = new Date();
         Date getDate = DateUtils.addDay(date, -1);
@@ -128,7 +110,12 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
         String endDate = DateUtils.getQuarterEndDate(getDate);
         String year = DateUtils.getYear(getDate) + "";
         String quarter = DateUtils.getQuarter(getDate) + "";
-        List<OptimizerCostDetailVO> detailVOS = performanceMapper.getUserOptimizerTotalCostGroupByAccountId(startDate, endDate, year, quarter, sysUser.getId(), startIndex, pageSize, projectId, null);
+        List<OptimizerCostDetailVO> detailVOS = null;
+        if (null != appType && appType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            detailVOS = performanceMapper.getKuaishouUserOptimizerTotalCostGroupByAccountId(startDate, endDate, year, quarter, sysUser.getId(), startIndex, pageSize, projectId, null);
+        } else {
+            detailVOS = performanceMapper.getBytedanceUserOptimizerTotalCostGroupByAccountId(startDate, endDate, year, quarter, sysUser.getId(), startIndex, pageSize, projectId, null);
+        }
         result.put("data", detailVOS);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
         return result;
@@ -139,9 +126,6 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
         Map<String, Object> result = new HashMap<>();
         //查询此机构下其他运营专员跑量数据
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        LoginUser sysUser = new LoginUser();
-//        sysUser.setId("fcb3fbf6192640adaadb2a7df9c02dae");
-//        sysUser.setOrgCode("A01A07A01");
         Date date = new Date();
         Date getDate = DateUtils.addDay(date, -1);
         String startDate = DateUtils.getQuarterStartDate(getDate);
@@ -149,7 +133,13 @@ public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Perfo
         String year = DateUtils.getYear(getDate) + "";
         String quarter = DateUtils.getQuarter(getDate) + "";
         //查询用户相关机构编号
-        List<OptimizerCostDetailVO> detailVOS = performanceMapper.getMemberPerformanceByOrgCode(startDate, endDate, year, quarter, sysUser.getOrgCode());
+        List<OptimizerCostDetailVO> detailVOS = null;
+        if (null != config.getAppType() && config.getAppType() + "" == CtopAdConstant.PLATFORM_TYPE_KUAISHOU) {
+            performanceMapper.getKuaishouMemberPerformanceByOrgCode(startDate, endDate, year, quarter, sysUser.getOrgCode());
+        } else {
+            performanceMapper.getBytedanceMemberPerformanceByOrgCode(startDate, endDate, year, quarter, sysUser.getOrgCode());
+        }
+
         List<OptimizerCostDetailVO> getDetails = new ArrayList<>();
         BigDecimal memberTotaRoyalty = BigDecimal.ZERO;
         BigDecimal memberTotaCost = BigDecimal.ZERO;

+ 96 - 0
performance-appraisal/src/main/java/cn/com/ctop/performanceappraisal/vo/UserPerformanceDetailVO.java

@@ -0,0 +1,96 @@
+package cn.com.ctop.performanceappraisal.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class UserPerformanceDetailVO implements Serializable {
+    /**
+     * 姓名
+     */
+    private String realName;
+    /**
+     * 个人总消耗
+     */
+    private BigDecimal totalPersonalCost;
+    /**
+     * 快手总消耗
+     */
+    private BigDecimal kuaishouPersonalCost;
+    /**
+     * 头条总消耗
+     */
+    private BigDecimal bytedancePersonalCost;
+    /**
+     * 媒体总消耗
+     */
+    private BigDecimal totalMediaCost;
+    /**
+     * 快手媒体总消耗
+     */
+    private BigDecimal kuaishouMediaCost;
+    /**
+     * 头条总消耗
+     */
+    private BigDecimal bytedanceMediaCost;
+    /**
+     * 媒体任务
+     */
+    private BigDecimal totalMediaTask;
+    /**
+     * 快手媒体任务
+     */
+    private BigDecimal kuaishouMediaTask;
+    /**
+     * 头条媒体任务
+     */
+    private BigDecimal bytedanceMediaTask;
+    /**
+     * 个人季度任务
+     */
+    private BigDecimal totalPersonalTask;
+    /**
+     * 个人快手季度任务
+     */
+    private BigDecimal kuaishouPersonalTask;
+    /**
+     * 个人头条季度任务
+     */
+    private BigDecimal bytedancePersonalTask;
+    /**
+     * 年度
+     */
+    private String year;
+    /**
+     * 季度
+     */
+    private String quarter;
+
+
+    /**
+     * 个人提成比例
+     */
+    private String royaltyRatio;
+    /**
+     * 快手提成比例
+     */
+    private BigDecimal kuaishouRoyaltyRatio;
+    /**
+     * 头条提成比例
+     */
+    private BigDecimal bytedanceRoyaltyRatio;
+    /**
+     * 个人总绩效
+     */
+    private BigDecimal totalRoyalty;
+    /**
+     * 快手总绩效
+     */
+    private BigDecimal kuaishouRoyalty;
+    /**
+     * 头条总绩效
+     */
+    private BigDecimal bytedanceRoyalty;
+}

+ 19 - 9
performance-appraisal/src/main/java/cn/com/ctop/planeprojectcost/entity/PlaneProjectCost.java

@@ -1,20 +1,18 @@
 package cn.com.ctop.planeprojectcost.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;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 /**
  * 平面设计项目消耗表
  * @author jeecg-boot
@@ -29,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 public class PlaneProjectCost {
 
 	/**id*/
-	@TableId(type = IdType.UUID)
+    @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "id")
 	private Integer id;
 	/**ctop_project的id*/
@@ -44,9 +42,11 @@ public class PlaneProjectCost {
 	@Excel(name = "项目消耗", width = 15)
     @ApiModelProperty(value = "项目消耗")
 	private java.math.BigDecimal projectCost;
-	/**1_快手2_抖音*/
-	@Excel(name = "1_快手2_抖音", width = 15)
-    @ApiModelProperty(value = "1_快手2_抖音")
+    /**
+     * 1_头条2_快手
+     */
+    @Excel(name = "1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "1_头条2_快手")
 	private Integer appType;
 	/**项目总消耗*/
 	@Excel(name = "项目总消耗", width = 15)
@@ -66,4 +66,14 @@ public class PlaneProjectCost {
 	/**updateTime*/
     @ApiModelProperty(value = "updateTime")
 	private Date updateTime;
+    /**
+     * projectPerformance
+     */
+    @ApiModelProperty(value = "projectPerformance")
+    private BigDecimal projectPerformance;
+    /**
+     * projectPlaneCount
+     */
+    @ApiModelProperty(value = "projectPlaneCount")
+    private Integer projectPlaneCount;
 }

+ 21 - 0
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/PlaneProjectCostDTO.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.userefficientvideomap.entity;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class PlaneProjectCostDTO {
+
+    private Integer id;
+    private Long projectId;
+    private String userId;
+    private BigDecimal projectCost;
+    private Integer appType;
+    private BigDecimal projectTotalCost;
+    private Integer year;
+    private Integer quarter;
+    private BigDecimal projectPerformance;
+    private Integer projectPlaneCount;
+    private String projectName;
+}

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

@@ -9,5 +9,5 @@ import java.math.BigDecimal;
 @Data
 public class ProjectDTO implements Serializable {
     private Long projectId;
-    private BigDecimal projectName;
+    private String projectName;
 }

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/SysRole.java

@@ -46,7 +46,7 @@ public class SysRole implements Serializable {
     private String roleCode;
 
     /**
-          * 描述
+     * 描述
      */
     @Excel(name="描述",width=60)
     private String description;

+ 16 - 0
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserDto2.java

@@ -22,4 +22,20 @@ public class UserDto2 implements Serializable {
 
     private String depId;
 
+    private Integer year;
+
+    private Integer quarter;
+
+    private String departName;
+
+    private String parentId;
+
+    private String roleCode;
+
+    private Integer effiVideoCount;
+
+    private Integer videoCount;
+
+    private BigDecimal cost;
+
 }

+ 11 - 7
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserEfficientVideoMap.java

@@ -29,9 +29,9 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 public class UserEfficientVideoMap {
 
 	/**id*/
-	@TableId(type = IdType.UUID)
+    @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "id")
-	private Integer id;
+    private Long id;
 	/**有效视频md5*/
 	@Excel(name = "有效视频md5", width = 15)
     @ApiModelProperty(value = "有效视频md5")
@@ -52,17 +52,21 @@ public class UserEfficientVideoMap {
 	@Excel(name = "年", width = 15)
     @ApiModelProperty(value = "年")
 	private Integer year;
-	/**年*/
+    /**
+     * 月
+     */
 	@Excel(name = "月", width = 15)
 	@ApiModelProperty(value = "月")
 	private Integer month;
-	/**计算日期_按照此日期进行所属年月季度的计算的*/
+    /**计算日期_用于计算所属年月季的基础日期*/
 	@Excel(name = "计算日期", width = 15)
 	@ApiModelProperty(value = "计算日期")
 	private Date calcDate;
-	/**媒体类型1_快手2_头条*/
-	@Excel(name = "媒体类型1_快手2_头条", width = 15)
-    @ApiModelProperty(value = "媒体类型1_快手2_头条")
+    /**
+     * 媒体类型1_头条2_快手
+     */
+    @Excel(name = "媒体类型1_头条2_快手", width = 15)
+    @ApiModelProperty(value = "媒体类型1_头条2_快手")
 	private Integer appType;
 	/**createTime*/
     @ApiModelProperty(value = "createTime")

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

@@ -21,7 +21,7 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
 
     int getEffiVideoCountBySignature(@Param("signature")String signature, @Param("appType")Integer appType);
 
-    int getEffiVideoCountByUserId(@Param("year")int year, @Param("quarter")int quarter, @Param("userId")String userId);
+    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);
 
@@ -53,8 +53,65 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
 
     List<UserDto2> getKuaishouDesignLeaderList();
 
+    List<UserDto2> getKuaishouPlanList();
+
+    List<UserDto2> getKuaishouShotList();
+
+    List<UserDto2> getKuaishouClipList();
+
+    List<UserDto2> getToutiaoPlanList();
+
+    List<UserDto2> getToutiaoShotList();
+
+    List<UserDto2> getToutiaoClipList();
+
+    List<UserDto2> getToutiaoDesignLeaderList();
+
     List<String> getClip(@Param("depId")String depId);
 
-    BigDecimal getClipQuarterCost(@Param("appType")Integer appType, @Param("quarter")int quarter, @Param("year")int year, @Param("userId")String userId);
+    BigDecimal getClipQuarterCost(@Param("appType") int appType, @Param("quarter") int quarter, @Param("year") int year, @Param("userId") String userId);
+
+    //头条有效视频计算sql
+    List<EffiVideoDTO> getToutiaoUserVideoMap(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("startCalcDate") String startCalcDate, @Param("endCalcDate") String endCalcDate);
+
+    BigDecimal toutiaoGetTotalCostByClipId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    BigDecimal toutiaoGetTotalCostByShotId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    BigDecimal toutiaoGetTotalCostByPlanId(@Param("userId") String userId, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    BigDecimal getQuarterPerformance(@Param("userId") String userId, @Param("year") int year, @Param("quarter") int quarter, @Param("appType") int appType);
+
+    BigDecimal getQuarterCost(@Param("userId") String userId, @Param("year") int year, @Param("quarter") int quarter, @Param("appType") int appType);
+
+    String getOrgCodeByProjectId(@Param("projectId") Long projectId);
+
+    SysRole getRoleIdByUserId(@Param("userId") String userId);
+
+    String getDepartIdByUserId(@Param("userId") String userId);
+
+    List<UserDto2> getUserListByDepartId(@Param("departId") String departId);
+
+    String getDepartNameByUserId(@Param("userId") String userId);
+
+    String getParentIdByDepartId(@Param("departId") String departId);
+
+    List<PlaneProjectCostDTO> getPlanePerformanceInfo(@Param("appType") int appType, @Param("year") int year, @Param("quarter") int quarter, @Param("userId") String userId);
+
+    List<UserDto2> getUserPerformanceList(@Param("appType") Integer appType, @Param("year") Integer year, @Param("quarter") Integer quarter);
+
+    List<String> getUserIdListByDepId(@Param("depId") String depId);
+
+    void updateKuaishouEffiType(@Param("kuaishouEffiType") Integer kuaishouEffiType, @Param("signature") String signature);
+
+    void updateToutiaoEffiType(@Param("toutiaoEffiType") Integer toutiaoEffiType, @Param("signature") String signature);
+
+    List<UserDto2> getKuaishouDepartUserInfo();
+
+    List<UserDto2> getToutiaoDepartUserInfo();
+
+    //根据天数的区间获取userId获取有效视频数量
+    Integer getEffiVideoCountByCalcDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("roleId") String roleId, @Param("userId") String userId, @Param("appType") Integer appType);
+
 }
 

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

@@ -49,6 +49,8 @@
         where year = #{year}
         and quarter = #{quarter}
         and user_id = #{userId}
+        and role_id = #{roleId}
+        and app_type = #{appType}
     </select>
 
     <!-- 按人获取季度总视频数量 -->
@@ -71,7 +73,6 @@
                 b.shot_id = #{userId}
             </otherwise>
         </choose>
-
     </select>
 
     <!-- 根据clip_id获取视频总消耗 -->
@@ -91,7 +92,7 @@
         and c.clip_id = #{userId}
     </select>
 
-    <!-- 根据clip_id获取视频总消耗 -->
+    <!-- 根据shot_id获取视频总消耗 -->
     <select id="getTotalCostByShotId" resultType="java.math.BigDecimal">
             select
             sum(a.charge) as charge
@@ -108,7 +109,7 @@
         and c.shot_id = #{userId}
     </select>
 
-    <!-- 根据clip_id获取视频总消耗 -->
+    <!-- 根据plan_id获取视频总消耗 -->
     <select id="getTotalCostByPlanId" resultType="java.math.BigDecimal">
             select
             sum(a.charge) as charge
@@ -170,7 +171,6 @@
         user_id = #{userId}
     </select>
 
-
     <!-- 根据项目id获取平面设计师的数量 -->
     <select id="getPlaneCountByProjectId" resultType="java.lang.Integer">
         select
@@ -235,13 +235,13 @@
         where
         b.id = #{materialId}
         and DATE_FORMAT(b.create_time,'%Y-%m-%d') &gt;= #{startDate}
-         and DATE_FORMAT(b.create_time,'%Y-%m-%d') &lt;= #{endDate}
+        and DATE_FORMAT(b.create_time,'%Y-%m-%d') &lt;= #{endDate}
     </select>
 
     <!-- 获取这个人所在的所有项目 -->
     <select id="getProjects" resultType="cn.com.ctop.userefficientvideomap.entity.ProjectDTO">
         select
-        project_id as projectId,
+        id as projectId,
         project_name as projectName
         from
         ctop_project
@@ -258,7 +258,7 @@
             left join
             ctop_user_allocation allocation on dailiAccount.account_id = allocation.account_id
         where
-        dailiAccount.project_id = #{projectId}
+        allocation.project_id = #{projectId}
         AND
         dailiAccount.stat_date &gt;= #{startDate}
         AND
@@ -275,7 +275,7 @@
         ctop_project_member a
         left join sys_role b on a.role_code = b.role_code
         where
-        a.project_id = #{projectId}
+        a.project_id = #{projectId} and
         a.role_code in ('planeLeader','plane')
     </select>
 
@@ -299,15 +299,76 @@
         and b.parent_id = '4e939124a5f541c88838e49d2a3ea72b'  <!-- 快手设计部 -->
     </select>
 
+    <!-- 获取快手编导列表 -->
+    <select id="getKuaishouPlanList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        '0214283aa16f943efbb149ea4bb18f18' as roleId,
+        '策划' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = '0214283aa16f943efbb149ea4bb18f18'    <!-- 编导 -->
+        )
+        and b.parent_id = '4e939124a5f541c88838e49d2a3ea72b'  <!-- 快手设计部 -->
+    </select>
+
+    <!-- 获取快手拍摄列表 -->
+    <select id="getKuaishouShotList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        '7bff9afed625aeeabca6bffe3c189183' as roleId,
+        '拍摄' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = '7bff9afed625aeeabca6bffe3c189183'   <!-- 拍摄 -->
+        )
+        and b.parent_id = '4e939124a5f541c88838e49d2a3ea72b'   <!-- 快手设计部 -->
+    </select>
+
+    <!-- 获取快手剪辑列表 -->
+    <select id="getKuaishouClipList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        'f38d8d70cf7ec50d5357a749e4dbf8ee' as roleId,
+        '剪辑' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = 'f38d8d70cf7ec50d5357a749e4dbf8ee'   <!-- 拍摄 -->
+        )
+        and b.parent_id = '4e939124a5f541c88838e49d2a3ea72b'   <!-- 快手设计部 -->
+    </select>
+
     <!-- 根据部门id -->
     <select id="getClip" resultType="string">
         select
-        user_id
+        a.user_id
         from
         sys_user_depart a
         left join sys_user_role b on a.user_id = b.user_id
+        left join sys_role c on b.role_id = c.id
         where a.dep_id = #{depId}
-        and b.role_code = 'clip'
+        and c.role_code = 'clip'
     </select>
 
     <select id="getClipQuarterCost" resultType="java.math.BigDecimal">
@@ -320,6 +381,380 @@
         and quarter = #{quarter}
         and year = #{year}
         and user_id = #{userId}
+        limit 1
     </select>
 
+    <!-- 获取toutiao设计师leader的信息 -->
+    <select id="getToutiaoDesignLeaderList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        '8d3e2ed58bdedf17716f698ea674da27' as roleId,
+        '设计组长' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = '8d3e2ed58bdedf17716f698ea674da27'   <!-- 设计师 -->
+        )
+        and b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'  <!-- 头条设计部 -->
+    </select>
+
+    <!-- 获取toutiao编导列表 -->
+    <select id="getToutiaoPlanList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        '0214283aa16f943efbb149ea4bb18f18' as roleId,
+        '策划' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = '0214283aa16f943efbb149ea4bb18f18'    <!-- 编导 -->
+        )
+        and b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'  <!-- 头条设计部 -->
+    </select>
+
+    <!-- 获取toutiao拍摄列表 -->
+    <select id="getToutiaoShotList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        '7bff9afed625aeeabca6bffe3c189183' as roleId,
+        '拍摄' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = '7bff9afed625aeeabca6bffe3c189183'   <!-- 拍摄 -->
+        )
+        and b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'   <!-- 头条设计部 -->
+    </select>
+
+    <!-- 获取toutiao剪辑列表 -->
+    <select id="getToutiaoClipList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+        select
+        a.user_id as userId,
+        c.realname as userName,
+        'f38d8d70cf7ec50d5357a749e4dbf8ee' as roleId,
+        '剪辑' as roleName,
+        a.dep_id as depId
+        FROM sys_user_depart a
+        left join sys_user c on a.user_id = c.id
+        left join sys_depart b on a.dep_id = b.id
+        WHERE a.user_id in(
+        select
+        user_id
+        from sys_user_role
+        WHERE role_id = 'f38d8d70cf7ec50d5357a749e4dbf8ee'   <!-- 拍摄 -->
+        )
+        and b.parent_id = '26c10ecb5e0d416bb01f8ff983f4588c'   <!-- 头条设计部 -->
+    </select>
+
+    <!-- 头条有效视频用户关系绑定 -->
+    <select id="getToutiaoUserVideoMap" resultType="cn.com.ctop.userefficientvideomap.entity.EffiVideoDTO">
+        select
+        c.signature as signature,
+        sum(a.cost) as charge, <!-- 总花费 -->
+        f1.id as clipId,
+        f1.realname as clipName,
+        f2.id as shotId,
+        f2.realname as shotName,
+        f3.id as planId,
+        f3.realname as planName,
+        f4.id as planeId,
+        f4.realname as planeName
+        from
+        ctop_bytedance_report_creative_daily a
+        left join ctop_bytedance_creative b on a.creative_id = b.id
+        left join ctop_bytedance_video_info c on b.video_id = c.id
+        left join ctop_material_info d on c.signature = d.code
+        left join ctop_material_ascription e on on d.id = e.material_id
+        left join sys_user f1 on e.clip_id = f1.id
+        left join sys_user f2 on e.shot_id = f2.id
+        left join sys_user f3 on e.plan_id = f3.id
+        left join sys_user f4 on e.plane_id = f4.id
+        where
+        c.signature is not null and d.id is not null and
+        date_format(a.stat_datetime, '%Y-%m-%d') &gt;= #{startTime} and
+        date_format(a.stat_datetime, '%Y-%m-%d') &lt;= #{endTime} and
+        date_format(d.create_time, '%Y-%m-%d') &gt;= #{startDate} and
+        date_format(d.update_time, '%Y-%m-%d') &lt;= #{endDate}
+        group by c.signature
+        having sum(a.charge) >= 5000
+    </select>
+
+    <!-- 头条根据plan_id获取视频总消耗 -->
+    <select id="toutiaoGetTotalCostByPlanId" resultType="java.math.BigDecimal">
+            select
+            sum(a.charge) as charge
+            ctop_bytedance_report_creative_daily a
+        left join ctop_bytedance_creative b on a.creative_id = b.id
+        left join ctop_bytedance_video_info c on b.video_id = c.id
+        left join ctop_material_info d on c.signature = d.code
+        left join ctop_material_ascription e on on d.id = e.material_id
+        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}
+    </select>
+
+    <!-- 头条根据clip_id获取视频总消耗 -->
+    <select id="toutiaoGetTotalCostByClipId" resultType="java.math.BigDecimal">
+            select
+            sum(a.charge) as charge
+            ctop_bytedance_report_creative_daily a
+        left join ctop_bytedance_creative b on a.creative_id = b.id
+        left join ctop_bytedance_video_info c on b.video_id = c.id
+        left join ctop_material_info d on c.signature = d.code
+        left join ctop_material_ascription e on on d.id = e.material_id
+        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}
+    </select>
+
+    <!-- 头条根据shot_id获取视频总消耗 -->
+    <select id="toutiaoGetTotalCostByShotId" resultType="java.math.BigDecimal">
+            select
+            sum(a.charge) as charge
+            ctop_bytedance_report_creative_daily a
+        left join ctop_bytedance_creative b on a.creative_id = b.id
+        left join ctop_bytedance_video_info c on b.video_id = c.id
+        left join ctop_material_info d on c.signature = d.code
+        left join ctop_material_ascription e on on d.id = e.material_id
+        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}
+    </select>
+
+    <!-- 根据year、quarter、user_id获取季度总绩效 -->
+    <select id="getQuarterPerformance" resultType="java.math.BigDecimal">
+        select
+        total_performance
+        from
+        ctop_performance
+        where
+        user_id = #{userId}
+        and
+        year = #{year}
+        and
+        quarter = #{quarter}
+        and
+        app_type = #{appType}
+        limit 1
+    </select>
+
+    <!-- 根据year、quarter、user_id获取季度总消耗 -->
+    <select id="getQuarterCost" resultType="java.math.BigDecimal">
+        select
+        total_cost
+        from
+        ctop_performance
+        where
+        user_id = #{userId}
+        and
+        year = #{year}
+        and
+        quarter = #{quarter}
+        and
+        app_type = #{appType}
+    </select>
+
+    <select id="getOrgCodeByProjectId" resultType="string">
+            select
+            c.org_code
+        from
+        ctop_project a
+        left join sys_user_depart b on a.design_responsible_id = b.user_id
+        left join sys_depart c on b.dep_id = c.id
+        where
+        a.id = #{projectId}
+    </select>
+
+    <select id="getRoleIdByUserId" resultType="cn.com.ctop.userefficientvideomap.entity.SysRole">
+            select
+            c.id as id,
+            c.role_code as roleCode,
+            c.role_name as roleName
+        from
+        sys_user a
+        left join sys_user_role b on a.id = b.user_id
+        left join sys_role c on b.role_id = c.id
+        where a.id = #{userId}
+    </select>
+
+    <!-- 根据userId获取depart_id -->
+    <select id="getDepartIdByUserId" resultType="string">
+        select
+        dep_id
+        from
+        sys_user_depart
+        where
+        user_id = #{userId}
+    </select>
+
+    <!-- 根据departId获取部门下所有的人 -->
+    <select id="getUserListByDepartId" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+            select
+            b.id as userId,
+            b.realname as realname,
+            d.id as roleId ,
+            d.role_name as roleName,
+			d.role_code as roleCode,
+			e.parent_id as parentId,
+			e.depart_name as departName
+        from
+        sys_user_depart a
+        left join sys_user b on a.user_id = b.id
+        left join sys_user_role c on b.id = c.user_id
+        left join sys_role d on c.role_id = d.id
+        left join sys_depart e on a.dep_id = e.id
+        where a.dep_id = #{departId}
+    </select>
+
+    <!-- 根据userId获取departName -->
+    <select id="getDepartNameByUserId" resultType="string">
+        select
+        b.depart_name
+        from
+        sys_user_depart a
+        left join sys_depart b on a.dep_id = b.id
+        where a.user_id = #{userId}
+    </select>
+
+    <!-- 获取部门的上一级部门 -->
+    <select id="getParentIdByDepartId" resultType="string">
+            select
+            parent_id
+        from
+        sys_depart
+        where
+        id = #{departId}
+    </select>
+
+    <select id="getPlanePerformanceInfo" resultType="cn.com.ctop.userefficientvideomap.entity.PlaneProjectCostDTO">
+        select
+        b.project_name as projectName,
+        a.year as year,
+        a.quarter as quarter,
+        a.app_type as appType,
+        a.project_performance as projectPerformance,
+        a.project_total_cost as projectTotalCost
+        from
+        ctop_plane_project_cost a
+        left join ctop_project b on a.project_id = b.id
+        where
+        a.app_type = #{appType} and
+        a.year = #{year} and
+        a.quarter = #{quarter} and
+        a.user_id = #{userId}
+    </select>
+
+    <select id="getUserPerformanceList" resultType="cn.com.ctop.userefficientvideomap.entity.UserDto2">
+            select
+            b.id as userId,
+            b.realname as realname,
+            c.id as roleId,
+            c.role_name as roleName,
+            a.year as year,
+            a.quarter as quarter,
+            sum(a.total_performance) as effiRate,
+            e.depart_name as departName
+        from
+        ctop_performance a
+        left join sys_user b on a.user_id = b.id
+        left join sys_role c on a.role_id = c.id
+        left join sys_user_depart d on a.user_id = d.user_id
+        left join sys_depart e on d.dep_id = e.id
+        where
+        a.year = #{year} and
+        a.quarter = #{quarter} and
+        a.app_type = #{appType}
+        group by a.user_id
+    </select>
+
+    <select id="getUserIdListByDepId" resultType="string">
+            select
+            user_id
+        from
+        sys_user_depart
+        where
+        dep_id = #{depId}
+    </select>
+
+    <!-- 更新快手的有效视频 -->
+    <select id="updateKuaishouEffiType">
+        update ctop_material_info
+        set kuaishou_effi_type = #{kuaishouEffiType}
+        where code = #{signature}
+    </select>
+
+    <!-- 更新头条的有效视频 -->
+    <select id="updateToutiaoEffiType">
+        update ctop_material_info
+        set toutiao_effi_type = #{toutiaoEffiType}
+        where code = #{signature}
+    </select>
+
+    <!-- 获取北京快手设计部所有编导、剪辑、拍摄的信息 -->
+    <select id="getKuaishouDepartUserInfo" 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 = '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>
+
+    <!-- 根据天数的区间获取userId获取有效视频数量 -->
+    <select id="getEffiVideoCountByCalcDate" resultType="java.lang.Integer">
+        select
+        count(1)
+        from
+        ctop_user_efficient_video_map
+        where user_id = #{userId}
+        and role_id = #{roleId}
+        and app_type = #{appType}
+        and calc_date &lt;= #{endDate}
+        and calc_date &gt;= #{startDate}
+    </select>
+
+
 </mapper>

+ 1 - 0
pom.xml

@@ -25,6 +25,7 @@
         <module>module-ctop</module>
         <module>performance-appraisal</module>
         <module>jeecg-boot-module-system</module>
+        <module>moudule-eureca</module>
 
     </modules>