Prechádzať zdrojové kódy

Merge branch 'master' into test

# Conflicts:
#	module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceHomepageReportCtrl.java
#	module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceHomepageMapper.java
#	module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceHomepageMapper.xml
#	module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceHomepageReportServiceImpl.java
yumeng 5 rokov pred
rodič
commit
727416231b
100 zmenil súbory, kde vykonal 1432 pridanie a 156 odobranie
  1. 5 0
      jeecg-boot-module-system/pom.xml
  2. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java
  3. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/config/MybatisPlusConfig.java
  4. 7 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  5. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/config/WebMvcConfiguration.java
  6. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  7. 50 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialTopCtrl.java
  8. 67 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/PangolinController.java
  9. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  10. 40 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  11. 3 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/job/PangolinDataJob.java
  12. 7 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/job/PangolinLoginJob.java
  13. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/MaterialTopMapper.java
  14. 27 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialTopMapper.xml
  15. 8 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IMaterialTopService.java
  16. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java
  17. 38 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialTopServiceImpl.java
  18. 24 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/MaterialTopVO.java
  19. 42 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  20. 17 11
      jeecg-boot-module-system/src/main/resources/application-test.yml
  21. 6 4
      jeecg-boot-module-system/src/main/resources/application.yml
  22. 88 8
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  23. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/SysRoleMapper.java
  24. 0 16
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysRoleMapper.xml
  25. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java
  26. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java
  27. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CorpWeixinServiceImpl.java
  28. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopCorpWexinUserServiceImpl.java
  29. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  30. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  31. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/IpPoolServiceImpl.java
  32. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java
  33. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialAscriptionServiceImpl.java
  34. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  35. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java
  36. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  37. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialParameterServiceImpl.java
  38. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialTagServiceImpl.java
  39. 5 6
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java
  40. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysRoleServiceImpl.java
  41. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  42. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoMergeTaskServiceImpl.java
  43. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoPartServiceImpl.java
  44. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoWatermarkTaskServiceImpl.java
  45. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoWatermarkTemplateServiceImpl.java
  46. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java
  47. 56 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StringUtils.java
  48. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouAdAccountServiceImpl.java
  49. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouAppAccountServiceImpl.java
  50. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouIosAccountServiceImpl.java
  51. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/impl/KuaishouCrawlerServiceImpl.java
  52. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeAdArtStyleServiceImpl.java
  53. 2 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeCompanyProductServiceImpl.java
  54. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeCompanyServiceImpl.java
  55. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeLabelServiceImpl.java
  56. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeMediaServiceImpl.java
  57. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyePlayRulesServiceImpl.java
  58. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductAdArtStyleServiceImpl.java
  59. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductPlayRuleServiceImpl.java
  60. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductServiceImpl.java
  61. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductThemeServiceImpl.java
  62. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeThemesServiceImpl.java
  63. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouEffectAdInfoServiceImpl.java
  64. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouHotPhotoInfoServiceImpl.java
  65. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouInspiredAdServiceImpl.java
  66. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/log/service/impl/CrawlerLogServiceImpl.java
  67. 4 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/IOceanEngineService.java
  68. 1 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/DouyinHotServiceImpl.java
  69. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/EffectCaseServiceImpl.java
  70. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/HotMaterialServiceImpl.java
  71. 347 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/OceanEngineServiceImpl.java
  72. 1 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/entity/PangolinReportBillMonth.java
  73. 1 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/entity/PangolinReportChannelDaily.java
  74. 4 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinAppMapper.java
  75. 4 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinChannelMapper.java
  76. 2 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinReportAppHourMapper.java
  77. 6 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinReportBillMonthMapper.java
  78. 3 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinReportChannelDailyMapper.java
  79. 13 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinAppMapper.xml
  80. 13 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinChannelMapper.xml
  81. 79 26
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinReportAppHourMapper.xml
  82. 39 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinReportBillMonthMapper.xml
  83. 50 5
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinReportChannelDailyMapper.xml
  84. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinAppService.java
  85. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinChannelService.java
  86. 2 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinReportAppHourService.java
  87. 3 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinReportBillMonthService.java
  88. 17 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinAppServiceImpl.java
  89. 17 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinChannelServiceImpl.java
  90. 3 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinCrawlerServiceImpl.java
  91. 21 13
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportAppHourServiceImpl.java
  92. 27 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportBillMonthServiceImpl.java
  93. 39 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportChannelDailyServiceImpl.java
  94. 16 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/vo/PangolinReportAppMonthVO.java
  95. 3 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserDailyReportLoadJob.java
  96. 45 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceFlowFundJob.java
  97. 36 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouCleanMaterialJob.java
  98. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/AppAdServiceImpl.java
  99. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/AppVideoServiceImpl.java
  100. 0 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppProductServiceImpl.java

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

@@ -151,6 +151,11 @@
             <artifactId>opencv</artifactId>
             <version>4.2.0</version>
         </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper</artifactId>
+            <version>5.1.11</version>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>

+ 6 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java

@@ -1,6 +1,7 @@
 package org.jeecg;
 
 import cn.com.ctop.common.module.utils.SpringUtils;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -43,4 +44,9 @@ public class JeecgApplication {
         return new RestTemplate();
     }
 
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+
 }

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/config/MybatisPlusConfig.java

@@ -1,6 +1,7 @@
 package org.jeecg.config;
 
 import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -11,17 +12,17 @@ import org.springframework.context.annotation.Configuration;
  *
  */
 @Configuration
-@MapperScan(value = {"org.jeecg.modules.**.mapper*", "cn.com.ctop.**.mapper*", "cn.com.ctop.bytedance.mapper*"})
+@MapperScan(value = {"org.jeecg.modules.**.mapper*", "cn.com.ctop.**.mapper*"})
 
 public class MybatisPlusConfig {
 
     /**
          *  分页插件
      */
-    @Bean
+    /*@Bean
     public PaginationInterceptor paginationInterceptor() {
         return new PaginationInterceptor();
-    }
+    }*/
 
 //    /**
 //     * mybatis-plus SQL执行效率插件【生产环境可以关闭】
@@ -31,5 +32,4 @@ public class MybatisPlusConfig {
 //        return new PerformanceInterceptor();
 //    }
 
-
 }

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

@@ -78,6 +78,12 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/kuaishouChannelRegInfo/*", "anon");
 
 
+		filterChainDefinitionMap.put("/ctop/byteDance/homePage/report/*", "anon");
+		filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
+
+
+
+
 		//优化师相关
 		//filterChainDefinitionMap.put("/ctop/performanceOptimizer/detail", "anon");
 		//filterChainDefinitionMap.put("/ctop/performanceOptimizer/ranking/list", "anon");
@@ -150,7 +156,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/advertiser/**", "anon");
 
 		// 添加自己的过滤器并且取名为jwt
-		Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
+		Map<String, Filter> filterMap = new HashMap<>(1);
 		filterMap.put("jwt", new JwtFilter());
 		shiroFilterFactoryBean.setFilters(filterMap);
 		// <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/config/WebMvcConfiguration.java

@@ -33,10 +33,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
 	@Value("${spring.resource.static-locations}")
 	private String staticLocations;
 
-	@Override
-	public void addInterceptors(InterceptorRegistry registry) {
-		registry.addInterceptor(browseLogHandelInterceptor);
-	}
+//	@Override
+//	public void addInterceptors(InterceptorRegistry registry) {
+//		registry.addInterceptor(browseLogHandelInterceptor);
+//	}
 
 	@Bean
 	public CorsFilter corsFilter() {

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

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.StringUtils;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -61,15 +62,15 @@ public class BindAccountLoginController {
         }
         //创建人
         String userId = json.getString("userId");
-        String password = json.getString("password");
         String loginType = json.getString("loginType");
         // 广告主名称
         String advertiserName = json.getString("advertiser_name");
         //账号
         String accountName = json.getString("accountName");
+        String password = json.getString("password");
         Map<String, Object> stringObjectMap = createInternalService.bindLogin(advertiserId, accountName, password, loginType, userId, advertiserName);
         Boolean trueOrFalse = (Boolean) stringObjectMap.get("success");
-        if (Boolean.TRUE.equals(trueOrFalse)) {
+        if (Boolean.TRUE.equals(trueOrFalse)&&!loginType.equals(CtopAdConstant.PLATFORM_TYPE_PANGOLIN_PY)) {
             Map<String, Object> deleteMap = new HashMap<>();
             deleteMap.put("account_name", accountName);
             deleteMap.put("user_id", userId);

+ 50 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialTopCtrl.java

@@ -0,0 +1,50 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.ctop.service.IMaterialTopService;
+import org.jeecg.modules.ctop.vo.MaterialTopVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ *  Created by JQ.bi on 2020.5.21
+ */
+@Slf4j
+@RestController
+@RequestMapping("/ctop/material")
+public class MaterialTopCtrl {
+
+    @Autowired
+    IMaterialTopService materialTopService;
+
+    @PostMapping("/top/cost")
+    public Result<IPage<MaterialTopVO>> getCostTop(@RequestBody JSONObject requestBody,
+                                                   @RequestParam(defaultValue = "cost") String target,
+                                                   @RequestParam(defaultValue = "desc") String order,
+                                                   @RequestParam(defaultValue = "1") int pageNo,
+                                                   @RequestParam(defaultValue = "10") int pageSize) {
+        Result<IPage<MaterialTopVO>> result = new Result<>();
+        if(requestBody.isEmpty()){
+            log.error("request body is empty");
+            result.setSuccess(false);
+        }
+        try {
+            String startDate= requestBody.getString("startDate");
+            String endDate= requestBody.getString("endDate");
+            if(startDate.isEmpty()||endDate.isEmpty()){
+                log.error("startDate or endDate is empty");
+                result.setSuccess(false);
+            }
+            IPage<MaterialTopVO> voiPage = materialTopService.selectByPage(endDate, startDate, target, order, pageNo, pageSize);
+            result.setResult(voiPage);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            result.setSuccess(false);
+        }
+        return result;
+    }
+}

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

@@ -1,18 +1,24 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportAppHourService;
-import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportBillMonthService;
-import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportChannelDailyService;
+import cn.com.ctop.common.module.service.ISysRoleService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.crawler.modules.pangolin.service.*;
+import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppMonthVO;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
 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 java.util.HashMap;
 import java.util.Map;
 
+@RestController
 @RequestMapping("pangolin")
 public class PangolinController {
     @Autowired
@@ -21,14 +27,51 @@ public class PangolinController {
     private PangolinReportChannelDailyService pangolinReportChannelDailyService;
     @Autowired
     private PangolinReportBillMonthService pangolinReportBillMonthService;
+    @Autowired
+    private PangolinAppService pangolinAppService;
+    @Autowired
+    private PangolinChannelService pangolinChannelService;
+    @Autowired
+    private ISysRoleService sysRoleService;
+    @PostMapping("api/channel/list")
+    public Map<String, Object> channelList(@RequestBody JSONObject data) {
+//        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        String userId = user.getId();
+        String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if(null!=roleCode&&(roleCode.equals("admin"))){
+            userId = null;
+        }
+        return pangolinChannelService.getListByUserId(userId);
+    }
+
+
+    @PostMapping("api/app/list")
+    public Map<String, Object> appList() {
+//        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        String userId = user.getId();
+        String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if(null!=roleCode&&(roleCode.equals("admin"))){
+            userId = null;
+        }
+        return pangolinAppService.getListByUserId(userId);
+    }
+
 
     /**
      * 实时数据
      */
     @PostMapping("api/realtime")
-    public Map<String, Object> realTime() {
+    public Map<String, Object> realTime(@RequestBody JSONObject data) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        return pangolinReportAppHourService.getRealTimeData(user.getId());
+        String userId = user.getId();
+//        String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if(null!=roleCode&&(roleCode.equals("admin"))){
+            userId = null;
+        }
+        return pangolinReportAppHourService.getRealTimeData(userId,data);
     }
 
     /**
@@ -37,16 +80,32 @@ public class PangolinController {
     @PostMapping("api/activation/list")
     public Map<String, Object> activationList(@RequestBody JSONObject data) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        return pangolinReportChannelDailyService.getActivationList(user.getId(), data);
+        String userId = user.getId();
+//        String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if(null!=roleCode&&(roleCode.equals("admin"))){
+            userId = null;
+        }
+        return pangolinReportChannelDailyService.getActivationList(userId, data);
     }
 
     /**
      * 对账单
      */
     @PostMapping("/api/checkApps/list")
-    public Map<String, Object> checkAppList(@RequestBody JSONObject data) {
+    public Map<String,Object> checkAppList(@RequestBody JSONObject data) {
+        Map<String,Object> result = new HashMap<>();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        return pangolinReportBillMonthService.checkAppList(user.getId(), data);
+        String userId = user.getId();
+//        String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if(null!=roleCode&&(roleCode.equals("admin"))){
+            userId = null;
+        }
+        PageInfo<PangolinReportAppMonthVO> pageInfo = pangolinReportBillMonthService.checkAppList(userId, data);
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
     }
 
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -185,7 +185,7 @@ public class ProjectMemberController {
                     QueryWrapper<ProjectMember> queryWrapper = new QueryWrapper<>();
                     queryWrapper.eq("user_id", userId);
                     queryWrapper.eq("project_id", projectId);
-                    ProjectMember selectMember = (ProjectMember) projectMemberService.getObj(queryWrapper);
+                    ProjectMember selectMember = (ProjectMember) projectMemberService.getOne(queryWrapper);
                     if (!Check.isNull(selectMember)) {
                         continue;
                     }

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

@@ -95,6 +95,46 @@ public class TestController {
     }
 
 
+    @GetMapping(value = "/getAccountReport")
+    public String getAccountReport(Long accountId, String startDate, String endDate) throws ParseException {
+        QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+        oauthTokenQueryWrapper.eq("media_id", 2);
+        oauthTokenQueryWrapper.eq("account_id", accountId);
+        oauthTokenQueryWrapper.last("limit 1");
+        CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+        Date date1 = sim.parse(startDate);
+        Date date2 = sim.parse(endDate);
+        kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2);
+        return "Success";
+    }
+
+
+    @GetMapping(value = "/getAccountReportList")
+    public String getAccountReportList(String startDate, String endDate) {
+        Result<String> result = new Result<>();
+        try {
+            SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+            Date date1 = sim.parse(startDate);
+            Date date2 = sim.parse(endDate);
+
+            QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
+            tokenQueryWrapper.eq("media_id", 2);
+            List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
+            if (!Check.isNull(ctopOauthTokens)) {
+                for (CtopOauthToken token : ctopOauthTokens) {
+                    kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2);
+                }
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return "success";
+    }
+
+
     @GetMapping(value = "/updateCode")
     public String updateCode() {
         List<MaterialInfo> list = materialInfoService.list();
@@ -386,9 +426,6 @@ public class TestController {
     private IReportService reportService;
 
 
-
-
-
     @Autowired
     private IBytedancePlanHourlyReportService planHourlyReportService;
 

+ 3 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/job/PangolinDataJob.java

@@ -1,9 +1,10 @@
-package cn.com.ctop.crawler.modules.pangolin.job;
+package org.jeecg.modules.ctop.job;
 
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
-import cn.com.ctop.crawler.modules.pangolin.service.*;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;

+ 7 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/job/PangolinLoginJob.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.crawler.modules.pangolin.job;
+package org.jeecg.modules.ctop.job;
 
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
@@ -21,10 +21,13 @@ public class PangolinLoginJob implements Job {
         QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("login_type","pangolin");
         queryWrapper.eq("status",1);
-        queryWrapper.isNull("cookie");
         List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
-        if (list != null && !list.isEmpty()) {
-            list.forEach(bindAccountLogin -> pangolinLoginService.pangolinLogin(bindAccountLogin.getAccountName(), bindAccountLogin.getPassword()));
+        if(list!=null&&!list.isEmpty()){
+            for (BindAccountLogin login:list) {
+                if(null==login.getCookie()||"".equals(login.getCookie().trim())){
+                    pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
+                }
+            }
         }
     }
 }

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/MaterialTopMapper.java

@@ -0,0 +1,12 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.ctop.vo.MaterialTopVO;
+
+public interface MaterialTopMapper {
+    IPage<MaterialTopVO> selectMapsPage(Page<MaterialTopVO> page, @Param(Constants.WRAPPER)QueryWrapper<MaterialTopVO> wrapper);
+}

+ 27 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialTopMapper.xml

@@ -0,0 +1,27 @@
+<?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="org.jeecg.modules.ctop.mapper.MaterialTopMapper">
+    <select id="selectMapsPage" resultType="org.jeecg.modules.ctop.vo.MaterialTopVO">
+        SELECT
+        url,
+        name,
+        stat_date ,
+        sum(cost) as cost,
+        sum(click) as click,
+        sum(show_num) as show_num,
+        sum(active) as active,
+        sum(register) as register,
+        sum(pay) as pay,
+        sum(phone_convert) as phone_convert,
+        sum(form_convert) as form_convert,
+        convert_rate,
+        sum(residue) as residue,
+        sum(play3s) as play3s,
+        sum(play10s) as play10s
+        FROM
+        ctop_material_report_total_result
+        where
+        ${ew.sqlSegment}
+    </select>
+
+</mapper>

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IMaterialTopService.java

@@ -0,0 +1,8 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.jeecg.modules.ctop.vo.MaterialTopVO;
+
+public interface IMaterialTopService {
+    IPage<MaterialTopVO> selectByPage(String endDate, String startDate, String target, String order, int pageNo, int pageSize);
+}

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -36,7 +36,6 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
 
     @Override
     public Map<String, Object> bindLogin(String advertiserId, String accountName, String password, String loginType, String userId, String advertiserName) {
-
         Map<String, Object> returnMap = new HashMap<>();
         Map<String, Object> requestMap = new HashMap<>();
         requestMap.put("advertiser_id", advertiserId);
@@ -79,7 +78,6 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
             log.info("登录账号绑定成功,广告主id:{}", bindAccountLogin.getAdvertiserId());
             returnMap.put("success", true);
             returnMap.put("accountUd", password);
-            return returnMap;
         }
         return returnMap;
     }

+ 38 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialTopServiceImpl.java

@@ -0,0 +1,38 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.common.module.utils.StringUtils;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.ctop.mapper.MaterialTopMapper;
+import org.jeecg.modules.ctop.service.IMaterialTopService;
+import org.jeecg.modules.ctop.vo.MaterialTopVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ *  Created by JQ.bi on 2020.05.22
+ */
+@Service
+public class MaterialTopServiceImpl  implements IMaterialTopService {
+
+    @Autowired
+    MaterialTopMapper materialTopMapper;
+    @Override
+    public IPage<MaterialTopVO> selectByPage(String endDate, String startDate, String target, String order, int pageNo, int pageSize) {
+        QueryWrapper<MaterialTopVO> wrapper = new QueryWrapper();
+        wrapper.ge("stat_date", startDate).le("stat_date", endDate).isNotNull("url");
+        target = StringUtils.humpToLine2(target);
+        if(order.equals(CtopAdConstant.COMMON_ORDER_TYPE_ASC)){
+            wrapper.orderByAsc(target);
+        }else{
+            wrapper.orderByDesc(target);
+        }
+        wrapper.groupBy("code");
+        Page<MaterialTopVO> page = new Page<>((pageNo-1)*pageSize,pageSize);
+        IPage<MaterialTopVO> mapIPage = materialTopMapper.selectMapsPage(page, wrapper);
+        return mapIPage;
+    }
+
+}

+ 24 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/MaterialTopVO.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.ctop.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class MaterialTopVO {
+    private String url;
+    private String name ;
+    private String statDate;
+    private BigDecimal cost;
+    private Long click;
+    private Long showNum;
+    private Long active;
+    private Long register;
+    private BigDecimal pay;
+    private Long phoneConvert;
+    private Long formConvert;
+    private BigDecimal convertRate;
+    private Long residue;
+    private Long play3s;
+    private Long play10s;
+}

+ 42 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -1,5 +1,8 @@
 package org.jeecg.modules.system.controller;
 
+import cn.com.ctop.common.module.entity.SysRole;
+import cn.com.ctop.common.module.service.ISysRoleService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.vo.SysDepartUsersVO;
 import cn.com.ctop.common.module.vo.SysUserRoleVO;
 import cn.com.ctop.common.module.vo.SysUserVo;
@@ -20,6 +23,8 @@ import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.PasswordUtil;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.entity.ProjectMember;
+import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.entity.SysUserDepart;
@@ -58,24 +63,24 @@ public class SysUserController {
 
     @Autowired
     private ISysUserService sysUserService;
-
     @Autowired
     private ISysDepartService sysDepartService;
-
     @Autowired
     private ISysUserRoleService sysUserRoleService;
-
     @Autowired
     private ISysUserDepartService sysUserDepartService;
-
     @Autowired
     private ISysUserRoleService userRoleService;
-
     @Autowired
     private RedisUtil redisUtil;
-
     @Autowired
     private IUserCompanyService userCompanyService;
+    @Autowired
+    private ISysRoleService roleService;
+    @Autowired
+    private IProjectMemberService memberService;
+    @Autowired
+    private ISysDepartService departService;
 
 
     @RequestMapping(value = "/getRoleInfo", method = RequestMethod.GET)
@@ -169,7 +174,14 @@ public class SysUserController {
         String selectedRoles = jsonObject.getString("selectedroles");
         String selectedDeparts = jsonObject.getString("selecteddeparts");
         try {
+
             SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
+            if (!Check.isNull(selectedDeparts)) {
+                SysDepart depart = departService.getById(selectedDeparts);
+                if (!Check.isNull(depart)) {
+                    user.setOrgCode(depart.getOrgCode());
+                }
+            }
             //设置创建时间
             user.setCreateTime(new Date());
             String salt = oConvertUtils.randomGen(8);
@@ -191,9 +203,8 @@ public class SysUserController {
         return result;
     }
 
-    @RequestMapping(value = "/edit", method = RequestMethod.PUT)
-    //	@RequiresPermissions("user:edit")
 
+    @RequestMapping(value = "/edit", method = RequestMethod.PUT)
     public Result<SysUser> edit(@RequestBody JSONObject jsonObject) {
         Result<SysUser> result = new Result<SysUser>();
         try {
@@ -206,11 +217,33 @@ public class SysUserController {
                 //String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
                 user.setPassword(sysUser.getPassword());
                 String roles = jsonObject.getString("selectedroles");
-
                 String departs = jsonObject.getString("selecteddeparts");
+                if (!Check.isNull(departs)) {
+                    SysDepart depart = departService.getById(departs);
+                    if (!Check.isNull(depart)) {
+                        user.setOrgCode(depart.getOrgCode());
+                    }
+                }
                 sysUserService.editUserWithRole(user, roles);
                 sysUserService.editUserWithDepart(user, departs);
                 userCompanyService.addOrUpdateUserWithCompany(user);
+                if (!Check.isNull(roles)) {
+                    Thread thread = new Thread() {
+                        @Override
+                        public void run() {
+                            SysRole sysRole = roleService.getById(roles);
+                            if (!Check.isNull(sysRole)) {
+                                QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
+                                memberQueryWrapper.eq("user_id", user.getId());
+                                ProjectMember updateMember = new ProjectMember();
+                                updateMember.setRoleCode(sysRole.getRoleCode());
+                                memberService.update(updateMember, memberQueryWrapper);
+                            }
+                        }
+                    };
+                    thread.start();
+                }
+
                 result.success("修改成功!");
             }
         } catch (Exception e) {

+ 17 - 11
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8080
+  port: 8088
   ip: 39.106.184.70
   servlet:
     context-path: /jeecg-boot
@@ -95,18 +95,17 @@ spring:
         filters: stat,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: hcst
+#          password: test@20190531
       datasource:
         master:
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://39.97.120.42: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
@@ -131,9 +130,16 @@ mybatis-plus:
       id-type: 4
       # 默认数据库表下划线命名
       table-underline: true
-    configuration:
-      # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+    # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+      #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  #分页pageHelper
+pagehelper:
+  helper-dialect: mysql
+  reasonable: true
+  support-methods-arguments: true
 #jeecg专用配置
 jeecg:
   ffmpeg:

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

@@ -3,13 +3,15 @@ spring:
     active: @activatedProperties@
   application:
     name: system-web
-eureka:
-  client:
-    serviceUrl:
-      defaultZone: http://localhost:8761/eureka/
+#分页pageHelper
+pagehelper:
+  helper-dialect: mysql
+  reasonable: true
+  support-methods-arguments: true
 swagger:
   production: false
   basic:
     enable: true
     username: jeecg
     password: jeecg1314
+

+ 88 - 8
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,34 +1,114 @@
 package org.jeecg;
 
+import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import java.util.Date;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
 @Slf4j
 public class SampleTest {
     @Autowired
-    private ICtopOauthTokenService tokenService;
+    private IBindAccountLoginService bindAccountLoginService;
+    @Autowired
+    private PangolinLoginService pangolinLoginService;
+    @Autowired
+    private PangolinCrawlerService pangolinCrawlerService;
+    @Autowired
+    private PangolinAppService pangolinAppService;
+    @Test
+    public void testPangolinLogin(){
+        QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("login_type","pangolin");
+        queryWrapper.eq("status",1);
+        List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
+        if(list!=null&&!list.isEmpty()){
+            for (BindAccountLogin login:list) {
+                if(null==login.getCookie()||"".equals(login.getCookie().trim())){
+                    pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
+                }
+            }
+        }
+    }
 
+    @Test
+    public void testPangolinData(){
+        QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("login_type", "pangolin");
+        queryWrapper.eq("status", 1);
+        queryWrapper.isNotNull("cookie");
+        List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
+        if (list != null && !list.isEmpty()) {
+            for (BindAccountLogin bindAccountLogin : list) {
+                pangolinCrawlerService.getChannelList(bindAccountLogin);
+                pangolinCrawlerService.getActivationList(bindAccountLogin, DateUtils.getNowDate("yyyy-MM-dd"), 1);
+                pangolinCrawlerService.getCheckList(bindAccountLogin);
+                QueryWrapper<PangolinApp> queryWrapper1 = new QueryWrapper<>();
+                queryWrapper1.eq("account_name", bindAccountLogin.getAccountName());
+                List<PangolinApp> appList = pangolinAppService.list(queryWrapper1);
+                if (appList != null && !appList.isEmpty()) {
+                    appList.forEach(pangolinApp -> pangolinCrawlerService.getRealTimeList(bindAccountLogin, pangolinApp.getId()));
+                }
+            }
+        }
+    }
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
     @Autowired
-    private IReportService reportService;
+    private IBytedanceFundDailyService bytedanceFundDailyService;
+    static ExecutorService executorService = null;
+
 
     @Test
-    public void kuaisShouReport() {
-        CtopOauthToken token = tokenService.getTokenByAccountId(1666360425745416L);
-        Date getDate = new Date();
-        reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+    public void testflowFund(){
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (null == tokens || tokens.size() <= 0) {
+            log.error("头条账户流水数据异常:未获取到可用的token");
+            return ;
+        }
+        CountDownLatch countDownLatch   = new CountDownLatch(tokens.size());
+        executorService = Executors.newFixedThreadPool(5);
+        tokens.forEach(token -> {
+            executorService.submit(() -> {
+                try {
+                    for(int i=0;i<60;i++){
+                        String findDate = DateUtils.addDay(DateUtils.formatDate(),-i);
+                        bytedanceFundDailyService.loadFundDataByPage(token, findDate, findDate,1);
+                    }
+                }catch (Exception e){
+                }finally {
+                    countDownLatch.countDown();
+                }
+            });
+        });
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
     }
+
 }
 
 

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/SysRoleMapper.java

@@ -20,7 +20,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
     /**
      * 根据roleCode获取相对应的用户信息
      */
-    List<UserDto> getUserByRoleCode(@Param("roleCode") String roleCode);
+
 
     String getRoleIdByRoleCode(@Param("roleCode") String roleCode);
 

+ 0 - 16
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysRoleMapper.xml

@@ -2,22 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.SysRoleMapper">
 
-	<!-- 根据rolecode获取相对应角色所有的人 -->
-    <select id="getUserByRoleCode" resultType="cn.com.ctop.common.module.vo.UserDto">
-			select
-			a.id as userId,
-			a.realname,
-			c.id as roleId,
-			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
-		left join sys_
-        where
-        c.role_code = #{roleCode}
-	</select>
-
 	<!-- 根据roleCode获取roleId -->
 	<select id="getRoleIdByRoleCode" resultType="java.lang.String">
 		select

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java

@@ -9,6 +9,7 @@ import cn.com.ctop.common.module.utils.PropertiesUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.io.UnsupportedEncodingException;
@@ -25,6 +26,7 @@ import java.util.Map;
  */
 @Slf4j
 @Service
+@Primary
 public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMapper, BindAccountAuth> implements IBindAccountAuthService {
 
     @Autowired

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountLoginServiceImpl.java

@@ -6,6 +6,7 @@ import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 /**
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
  */
 @Slf4j
 @Service
+@Primary
 public class BindAccountLoginServiceImpl extends ServiceImpl<BindAccountLoginMapper, BindAccountLogin> implements IBindAccountLoginService {
     @Override
     public BindAccountLogin selectByAccountId(String accountId) {

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CorpWeixinServiceImpl.java

@@ -8,10 +8,12 @@ import me.chanjar.weixin.cp.api.impl.WxCpOAuth2ServiceImpl;
 import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
 import me.chanjar.weixin.cp.bean.WxCpMessage;
 import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Slf4j
 @Service
+@Primary
 public class CorpWeixinServiceImpl implements ICorpWeixinService {
     public static void main(String[] args) {
         val configStorage = new WxCpDefaultConfigImpl();

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopCorpWexinUserServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
 import cn.com.ctop.common.module.mapper.CtopCorpWexinUserMapper;
 import cn.com.ctop.common.module.service.ICtopCorpWexinUserService;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @date 2019-12-08
  */
 @Service
+@Primary
 public class CtopCorpWexinUserServiceImpl extends ServiceImpl<CtopCorpWexinUserMapper, CtopCorpWexinUser> implements ICtopCorpWexinUserService {
 
 }

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

@@ -25,7 +25,7 @@ import java.util.Map;
  * @Version: V1.0
  */
 @Slf4j
-@Service("ctopOauthTokenService")
+@Service
 public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper, CtopOauthToken> implements ICtopOauthTokenService {
     @Autowired
     private CtopOauthTokenMapper cTopOauthTokenMapper;

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -23,6 +23,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -42,6 +43,7 @@ import java.util.Map;
  */
 @Slf4j
 @Service
+@Primary
 public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> implements IFileInfoService {
     @Value("${jeecg.path.image-upload}")
     private String imageUploadPath;

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/IpPoolServiceImpl.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
@@ -22,6 +23,7 @@ import java.util.List;
  */
 @Slf4j
 @Service
+@Primary
 public class IpPoolServiceImpl extends ServiceImpl<IpPoolMapper, IpPool> implements IIpPoolService {
 
     @Override

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java

@@ -7,6 +7,7 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
  * @date 2019-12-08
  */
 @Service
+@Primary
 public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> implements IMailLogService {
     @Autowired
     private MailLogMapper mailLogMapper;

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialAscriptionServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.entity.MaterialAscription;
 import cn.com.ctop.common.module.mapper.MaterialAscriptionMapper;
 import cn.com.ctop.common.module.service.IMaterialAscriptionService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 /**
@@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
  * @date 2019-11-23
  */
 @Service
+@Primary
 public class MaterialAscriptionServiceImpl extends ServiceImpl<MaterialAscriptionMapper, MaterialAscription> implements IMaterialAscriptionService {
 
 }

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

@@ -28,7 +28,7 @@ import java.net.URLEncoder;
  * @version V1.0
  * @date 2019-12-25
  */
-@Service("materialCutFrameService")
+@Service
 public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMapper, MaterialCutFrame> implements IMaterialCutFrameService {
 
     private static String ossLocation = "oss-cn-beijing";

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

@@ -33,7 +33,7 @@ import java.util.Map;
  * @date 2020-03-16
  */
 @Slf4j
-@Service("materialImageInfoService")
+@Service
 public class MaterialImageInfoServiceImpl extends ServiceImpl<MaterialImageInfoMapper, MaterialImageInfo> implements IMaterialImageInfoService {
 
     @Value("${oss.replace.download}")

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

@@ -17,6 +17,7 @@ import it.sauronsoftware.jave.EncoderException;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -41,6 +42,7 @@ import java.util.regex.Pattern;
  */
 @Slf4j
 @Service
+@Primary
 public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, MaterialInfo> implements IMaterialInfoService {
     private static ExecutorService uploadExecutorService = Executors.newFixedThreadPool(5);
     @Resource

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialParameterServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.mapper.MaterialParameterMapper;
 import cn.com.ctop.common.module.service.IMaterialParameterService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 /**
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
  * @date 2019-11-23
  */
 @Service
+@Primary
 public class MaterialParameterServiceImpl extends ServiceImpl<MaterialParameterMapper, MaterialParameter> implements IMaterialParameterService {
 
     @Override

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialTagServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.entity.MaterialTag;
 import cn.com.ctop.common.module.mapper.MaterialTagMapper;
 import cn.com.ctop.common.module.service.IMaterialTagService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 /**
@@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
  * @date 2019-11-23
  */
 @Service
+@Primary
 public class MaterialTagServiceImpl extends ServiceImpl<MaterialTagMapper, MaterialTag> implements IMaterialTagService {
 
 }

+ 5 - 6
module-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java

@@ -10,16 +10,15 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.List;
 
 @Slf4j
-@Service("refreshTokenService")
+@Service
 public class RefreshTokenServiceImpl implements IRefreshTokenService {
     @Autowired
     private CtopOauthTokenMapper oauthTokenMapper;
-    @Resource
-    private ICtopOauthTokenService ctopOauthTokenService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
 
     /**
      * 获取所有token
@@ -35,11 +34,11 @@ public class RefreshTokenServiceImpl implements IRefreshTokenService {
                 log.info("刷新token,accountId:{}", oauthToken.getAccountId());
                 //头条
                 if (CtopAdConstant.PLATFORM_TYPE_BYTEDANCE.equals(oauthToken.getMediaId().trim())) {
-                    ctopOauthTokenService.getByteDanceAccessToken(String.valueOf(oauthToken.getAccountId()));
+                    oauthTokenService.getByteDanceAccessToken(String.valueOf(oauthToken.getAccountId()));
                 }
                 //快手
                 if (CtopAdConstant.PLATFORM_TYPE_KUAISHOU.equals(oauthToken.getMediaId().trim())) {
-                    ctopOauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getRefreshToken(), oauthToken.getAgentType());
+                    oauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getRefreshToken(), oauthToken.getAgentType());
                 }
             }
         } else {

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysRoleServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.mapper.SysRoleMapper;
 import cn.com.ctop.common.module.service.ISysRoleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 /**
@@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
  * @since 2018-12-19
  */
 @Service
+@Primary
 public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
     @Autowired
     private SysRoleMapper sysRoleMapper;

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -16,6 +17,7 @@ import java.util.List;
  * @Version: V1.0
  */
 @Service
+@Primary
 public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper, UserAllocation> implements IUserAllocationService {
 
     @Override

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoMergeTaskServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.VideoMergeTask;
 import cn.com.ctop.common.module.mapper.VideoMergeTaskMapper;
 import cn.com.ctop.common.module.service.IVideoMergeTaskService;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @version V1.0
  */
 @Service
+@Primary
 public class VideoMergeTaskServiceImpl extends ServiceImpl<VideoMergeTaskMapper, VideoMergeTask> implements IVideoMergeTaskService {
 
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/VideoPartServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.VideoPart;
 import cn.com.ctop.common.module.mapper.VideoPartMapper;
 import cn.com.ctop.common.module.service.IVideoPartService;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @version V1.0
  */
 @Service
+@Primary
 public class VideoPartServiceImpl extends ServiceImpl<VideoPartMapper, VideoPart> implements IVideoPartService {
 
 }

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

@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @date   2019-12-20
  * @version V1.0
  */
-@Service("videoWatermarkTaskService")
+@Service
 public class VideoWatermarkTaskServiceImpl extends ServiceImpl<VideoWatermarkTaskMapper, VideoWatermarkTask> implements IVideoWatermarkTaskService {
 
 }

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

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.VideoWatermarkTemplate;
 import cn.com.ctop.common.module.mapper.VideoWatermarkTemplateMapper;
 import cn.com.ctop.common.module.service.IVideoWatermarkTemplateService;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -13,7 +14,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @date   2019-12-20
  * @version V1.0
  */
-@Service("videoWatermarkTemplateService")
+@Service
+@Primary
 public class VideoWatermarkTemplateServiceImpl extends ServiceImpl<VideoWatermarkTemplateMapper, VideoWatermarkTemplate> implements IVideoWatermarkTemplateService {
 
 }

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

@@ -11,6 +11,7 @@ public class CtopAdConstant {
 
     public static final String PLATFORM_TYPE_BYTEDANCE_PY = "bytedance";
     public static final String PLATFORM_TYPE_KUAISHOU_PY = "kuaishou";
+    public static final String PLATFORM_TYPE_PANGOLIN_PY = "pangolin";
 
     public static final String BYTEDANCE_REPORT_TYPE_DAILY = "STAT_TIME_GRANULARITY_DAILY";
     public static final String BYTEDANCE_REPORT_TYPE_HOURLY = "STAT_TIME_GRANULARITY_HOURLY";
@@ -71,4 +72,7 @@ public class CtopAdConstant {
     public static final Integer COMMON_STATUS_ENABLED = 1;
 
     public static final Integer COMMON_STATUS_NOT_ENABLED = 0;
+
+    public static final String COMMON_ORDER_TYPE_ASC = "asc";
+    public static final String COMMON_ORDER_TYPE_DESC = "desc";
 }

+ 56 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StringUtils.java

@@ -21,6 +21,62 @@ public class StringUtils {
         return list;
     }
 
+    /**
+     * 将下划线风格转换为驼峰风格
+     * @param inputString
+     * @return
+     */
+    public static String underlineToCamehunp(String inputString){
+        StringBuilder sb = new StringBuilder();
+        boolean nextUppercase = false;
+        for (int i = 0; i < inputString.length(); i++) {
+            char c = inputString.charAt(i);
+            if (c == '_') {
+                if (sb.length()>0) {
+                    nextUppercase = true;
+                }
+            }else {
+                if (nextUppercase) {
+                    sb.append(Character.toUpperCase(c));
+                    nextUppercase = false;
+                }else {
+                    sb.append(Character.toLowerCase(c));
+                }
+            }
+        }
+        return sb.toString();
+    }
+    private static Pattern linePattern = Pattern.compile("_(\\w)");
+    /** 下划线转驼峰 */
+    public static String lineToHump(String str) {
+        str = str.toLowerCase();
+        Matcher matcher = linePattern.matcher(str);
+        StringBuffer sb = new StringBuffer();
+        while (matcher.find()) {
+            matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
+        }
+        matcher.appendTail(sb);
+        return sb.toString();
+    }
+
+    /** 驼峰转下划线(简单写法,效率低于{@link #humpToLine2(String)}) */
+    public static String humpToLine(String str) {
+        return str.replaceAll("[A-Z]", "_$0").toLowerCase();
+    }
+
+    private static Pattern humpPattern = Pattern.compile("[A-Z]");
+
+    /** 驼峰转下划线,效率比上面高 */
+    public static String humpToLine2(String str) {
+        Matcher matcher = humpPattern.matcher(str);
+        StringBuffer sb = new StringBuffer();
+        while (matcher.find()) {
+            matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
+        }
+        matcher.appendTail(sb);
+        return sb.toString();
+    }
+
     public static String replaceBlank(String str) {
         String dest = "";
         if (str!=null) {

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouAdAccountServiceImpl.java

@@ -5,11 +5,14 @@ import cn.com.ctop.crawler.modules.account.mapper.KuaishouAdAccountMapper;
 import cn.com.ctop.crawler.modules.account.service.IKuaishouAdAccountService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
 @Service
+@Primary
+
 public class KuaishouAdAccountServiceImpl extends ServiceImpl<KuaishouAdAccountMapper, KuaishouAdAccount> implements IKuaishouAdAccountService {
     @Autowired
     private KuaishouAdAccountMapper kuaishouAdAccountMapper;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouAppAccountServiceImpl.java

@@ -4,8 +4,11 @@ import cn.com.ctop.crawler.modules.account.entity.KuaishouAppAccount;
 import cn.com.ctop.crawler.modules.account.mapper.KuaishouAppAccountMapper;
 import cn.com.ctop.crawler.modules.account.service.IKuaishouAppAccountService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class KuaishouAppAccountServiceImpl extends ServiceImpl<KuaishouAppAccountMapper, KuaishouAppAccount> implements IKuaishouAppAccountService {
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouIosAccountServiceImpl.java

@@ -7,8 +7,11 @@ import cn.com.ctop.crawler.modules.account.mapper.KuaishouIosAccountMapper;
 import cn.com.ctop.crawler.modules.account.service.IKuaishouAppAccountService;
 import cn.com.ctop.crawler.modules.account.service.IKuaishouIosAccountService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class KuaishouIosAccountServiceImpl extends ServiceImpl<KuaishouIosAccountMapper, KuaishouIosAccount> implements IKuaishouIosAccountService {
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/impl/KuaishouCrawlerServiceImpl.java

@@ -10,11 +10,14 @@ import cn.com.ctop.crawler.modules.core.service.IKuaishouCrawlerService;
 import cn.com.ctop.crawler.modules.core.util.KuaishouUtil;
 import cn.com.ctop.crawler.modules.log.entity.CrawlerLog;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.Random;
 
 @Service
+@Primary
+
 public class KuaishouCrawlerServiceImpl implements IKuaishouCrawlerService {
     @Autowired
     private IIpPoolService iIpPoolService;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeAdArtStyleServiceImpl.java

@@ -4,8 +4,11 @@ import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeAdArtStyle;
 import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeAdArtStyleMapper;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeAdArtStyleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class DataeyeAdArtStyleServiceImpl extends ServiceImpl<DataeyeAdArtStyleMapper, DataeyeAdArtStyle> implements DataeyeAdArtStyleService {
 }

+ 2 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeCompanyProductServiceImpl.java

@@ -4,8 +4,10 @@ import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeCompanyProduct;
 import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeCompanyProductMapper;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeCompanyProductService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
 public class DataeyeCompanyProductServiceImpl extends ServiceImpl<DataeyeCompanyProductMapper, DataeyeCompanyProduct> implements DataeyeCompanyProductService {
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeCompanyServiceImpl.java

@@ -10,6 +10,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
@@ -17,6 +18,8 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 @Service
+@Primary
+
 public class DataeyeCompanyServiceImpl extends ServiceImpl<DataeyeCompanyMapper, DataeyeCompany> implements DataeyeCompanyService {
     @Autowired
     private DataeyeProductService dataeyeProductService;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeLabelServiceImpl.java

@@ -17,12 +17,15 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
 import java.util.List;
 
 @Service
+@Primary
+
 public class DataeyeLabelServiceImpl implements DataeyeLabelService {
     @Autowired
     private DataeyeAdArtStyleService dataeyeAdArtStyleService;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeMediaServiceImpl.java

@@ -12,12 +12,15 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
 import java.util.*;
 
 @Service
+@Primary
+
 public class DataeyeMediaServiceImpl extends ServiceImpl<DataeyeMediaMapper, DataeyeMedia> implements DataeyeMediaService {
     @Autowired
     private DataeyeCompanyService dataeyeCompanyService;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyePlayRulesServiceImpl.java

@@ -4,8 +4,11 @@ import cn.com.ctop.crawler.modules.dataeye.entity.DataeyePlayRules;
 import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyePlayRulesMapper;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyePlayRulesService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class DataeyePlayRulesServiceImpl extends ServiceImpl<DataeyePlayRulesMapper, DataeyePlayRules> implements DataeyePlayRulesService{
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductAdArtStyleServiceImpl.java

@@ -6,8 +6,11 @@ import cn.com.ctop.crawler.modules.dataeye.service.DataeyeAdArtStyleService;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyePlayRulesService;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeProductAdArtStyleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class DataeyeProductAdArtStyleServiceImpl extends ServiceImpl<DataeyeProductAdArtStyleMapper, DataeyeProductAdArtStyle> implements DataeyeProductAdArtStyleService {
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductPlayRuleServiceImpl.java

@@ -4,8 +4,11 @@ import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeProductPlayRule;
 import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeProductPlayRuleMapper;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeProductPlayRuleService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class DataeyeProductPlayRuleServiceImpl extends ServiceImpl<DataeyeProductPlayRuleMapper, DataeyeProductPlayRule> implements DataeyeProductPlayRuleService{
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductServiceImpl.java

@@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 import us.codecraft.webmagic.thread.CountableThreadPool;
 
@@ -24,6 +25,8 @@ import java.util.concurrent.LinkedBlockingQueue;
 import java.util.logging.Logger;
 
 @Service
+@Primary
+
 public class DataeyeProductServiceImpl extends ServiceImpl<DataeyeProductMapper, DataeyeProduct> implements DataeyeProductService {
     @Autowired
     private DataeyeProductThemeService dataeyeProductThemeService;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeProductThemeServiceImpl.java

@@ -4,8 +4,11 @@ import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeProductTheme;
 import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeProductThemeMapper;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeProductThemeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class DataeyeProductThemeServiceImpl extends ServiceImpl<DataeyeProductThemeMapper, DataeyeProductTheme> implements DataeyeProductThemeService {
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeThemesServiceImpl.java

@@ -5,8 +5,11 @@ import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeCompanyMapper;
 import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeThemesMapper;
 import cn.com.ctop.crawler.modules.dataeye.service.DataeyeThemesService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class DataeyeThemesServiceImpl extends ServiceImpl<DataeyeThemesMapper, DataeyeThemes> implements DataeyeThemesService {
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouEffectAdInfoServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouEffectAdInfoMapper
 import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouEffectAdInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -17,6 +18,8 @@ import java.util.List;
  * @date 2020-03-02
  */
 @Service
+@Primary
+
 public class KuaishouEffectAdInfoServiceImpl extends ServiceImpl<KuaishouEffectAdInfoMapper, KuaishouEffectAdInfo> implements IKuaishouEffectAdInfoService {
     @Autowired
     private KuaishouEffectAdInfoMapper adInfoMapper;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouHotPhotoInfoServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouHotPhotoInfoMapper
 import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouHotPhotoInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -17,6 +18,8 @@ import java.util.List;
  * @date 2020-03-03
  */
 @Service
+@Primary
+
 public class KuaishouHotPhotoInfoServiceImpl extends ServiceImpl<KuaishouHotPhotoInfoMapper, KuaishouHotPhotoInfo> implements IKuaishouHotPhotoInfoService {
     @Autowired
     private KuaishouHotPhotoInfoMapper photoInfoMapper;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouInspiredAdServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouInspiredAdMapper;
 import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouInspiredAdService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -17,6 +18,8 @@ import java.util.List;
  * @date 2020-03-03
  */
 @Service
+@Primary
+
 public class KuaishouInspiredAdServiceImpl extends ServiceImpl<KuaishouInspiredAdMapper, KuaishouInspiredAd> implements IKuaishouInspiredAdService {
     @Autowired
     private KuaishouInspiredAdMapper inspiredAdMapper;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/log/service/impl/CrawlerLogServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.crawler.modules.log.service.impl;
 import cn.com.ctop.crawler.modules.log.entity.CrawlerLog;
 import cn.com.ctop.crawler.modules.log.mapper.CrawlerLogMapper;
 import cn.com.ctop.crawler.modules.log.service.ICrawlerLogService;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -14,6 +15,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @Version: V1.0
  */
 @Service
+@Primary
+
 public class CrawlerLogServiceImpl extends ServiceImpl<CrawlerLogMapper, CrawlerLog> implements ICrawlerLogService {
 
 }

+ 4 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/IOceanEngineService.java

@@ -0,0 +1,4 @@
+package cn.com.ctop.crawler.modules.oceanengine.service;
+
+public interface IOceanEngineService {
+}

+ 1 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/DouyinHotServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/EffectCaseServiceImpl.java

@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.net.HttpURLConnection;
@@ -26,6 +27,8 @@ import java.util.HashMap;
 import java.util.Map;
 
 @Service
+@Primary
+
 public class EffectCaseServiceImpl extends ServiceImpl<EffectCaseMapper, EffectCase> implements IEffectCaseService {
     @Autowired
     private IDouyinHotService douyinHotService;

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/HotMaterialServiceImpl.java

@@ -7,9 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class HotMaterialServiceImpl extends ServiceImpl<HotMaterialMapper, HotMaterial> implements IHotMaterialService {
     @Override
     public IPage<HotMaterial> queryHotFeeds(String userName, String start, String end, String orderByColumn, String orderByType, Integer pageNo, Integer pageSize) {

+ 347 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/OceanEngineServiceImpl.java

@@ -0,0 +1,347 @@
+//package cn.com.ctop.crawler.modules.oceanengine.service.impl;
+//
+//import cn.com.ctop.common.module.utils.Base64Utils;
+//import cn.com.ctop.common.module.utils.HttpUtils2;
+//import cn.com.ctop.crawler.modules.core.util.FateadmHttpUtil;
+//import cn.com.ctop.crawler.modules.core.util.FateadmUtil;
+//import cn.com.ctop.crawler.modules.oceanengine.entity.DouyinHot;
+//import cn.com.ctop.crawler.modules.oceanengine.entity.EffectCase;
+//import cn.com.ctop.crawler.modules.oceanengine.entity.HotMaterial;
+//import cn.com.ctop.crawler.modules.oceanengine.service.IOceanEngineService;
+//import com.fasterxml.jackson.core.type.TypeReference;
+//import com.fasterxml.jackson.databind.DeserializationFeature;
+//import com.fasterxml.jackson.databind.JsonNode;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import org.apache.http.impl.cookie.BasicClientCookie;
+//import org.bytedeco.javacv.FFmpegFrameGrabber;
+//import org.bytedeco.javacv.Frame;
+//import org.bytedeco.javacv.Java2DFrameConverter;
+//import org.openqa.selenium.Cookie;
+//import org.openqa.selenium.WebDriver;
+//import org.openqa.selenium.chrome.ChromeDriver;
+//import org.openqa.selenium.chrome.ChromeOptions;
+//import org.quartz.JobExecutionContext;
+//import org.quartz.JobExecutionException;
+//import org.springframework.stereotype.Service;
+//
+//import javax.imageio.ImageIO;
+//import java.awt.*;
+//import java.awt.image.BufferedImage;
+//import java.io.ByteArrayOutputStream;
+//import java.net.HttpURLConnection;
+//import java.net.URL;
+//import java.util.*;
+//import java.util.List;
+//
+//@Service
+//public class OceanEngineServiceImpl implements IOceanEngineService {
+//    public static String getVideoUrlByVid(String vid) {
+//        String url = "https://aweme.snssdk.com/aweme/v1/playwm/?video_id=" + vid + "&line=0";
+//        return getRealVideoUrl(url);
+//    }
+//
+//    public static String getRealVideoUrl(String url) {
+//        try {
+//            URL serverUrl = new URL(url);
+//            HttpURLConnection conn = (HttpURLConnection) serverUrl
+//                    .openConnection();
+//            conn.setRequestMethod("GET");
+//            // 必须设置false,否则会自动redirect到Location的地址
+//            conn.setInstanceFollowRedirects(false);
+//            conn.addRequestProperty("User-Agent",
+//                    "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.8) Firefox/3.6.8");
+//            conn.connect();
+//            String location = conn.getHeaderField("Location");
+//            return location;
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return null;
+//    }
+//    private void hotMaterialHandler(int page,int appCode,String appName){
+//        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/hot_material/list?material_type=3&order_by=convert_show_rate&period_type=3&aggr_app_code="+appCode+"&page="+page+"&limit=20");
+//        ObjectMapper mapper = new ObjectMapper();
+//        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+//        try {
+//            JsonNode node = mapper.readTree(result);
+//            int code = node.get("code").asInt();
+//            if (code == 0) {
+//                if (node.get("data") != null&&node.get("data").get("materials")!=null) {
+//                    String dataJson = node.get("data").get("materials").toString();
+//                    List<HotMaterial> list = mapper.readValue(dataJson,new TypeReference<List<HotMaterial>>() {});
+//                    if(list != null && list.size() > 0){
+//                        for (HotMaterial material : list){
+//                            material.setAppCode(appCode);
+//                            material.setAppName(appName);
+//                            material.setVideoUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+material.getVid()+"&line=0"));
+//                            if(material.getVideoUrl() == null){
+//                                material.setVideoUrl(getVideoUrl(material.getVid()));
+//                            }
+////                            material.setVideoUrl(getVideoUrl(material.getVid()));
+//                            material.setCoverImage(getVideoFirstImage(material.getVideoUrl()));
+//                            if(material.getCoverImage() == null){
+//                                Thread.sleep(1000);
+//                                material.setCoverImage(getVideoFirstImage(material.getVideoUrl()));
+//                            }
+//                            hotMaterialService.saveOrUpdate(material);
+//                        }
+//                        hotMaterialHandler(page+1,appCode,appName);
+//                    }
+//                }
+//            }
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
+//    }
+//
+//    public static String getVideoUrl(String vid) throws Exception {
+//        String url = "http://i.snssdk.com/video/urls/1/toutiao/mp4/"+vid;
+//        String result = HttpUtils2.httpGetRequest(url);
+//        ObjectMapper mapper = new ObjectMapper();
+//        if(result != null){
+//            JsonNode node = mapper.readTree(result);
+//            String mainUrl = node.get("data").get("video_list").get("video_1").get("main_url").asText();
+//            return Base64Utils.decode(mainUrl);
+//        }
+//        return null;
+//    }
+//    private void effectCaseHandler(int page){
+//        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/case/effect_case_list?industry=0&style=0&mode=0&page="+page+"&limit=20");
+//        ObjectMapper mapper = new ObjectMapper();
+//        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+//        try {
+//            JsonNode node = mapper.readTree(result);
+//            int code = node.get("code").asInt();
+//            if(code == 0) {
+//                if (node.get("data") != null) {
+//                    String dataJson = node.get("data").get("effect_cases").toString();
+//                    List<EffectCase> list = mapper.readValue(dataJson,new TypeReference<List<EffectCase>>() {});
+//                    if (list != null && list.size() > 0) {
+//                        for (EffectCase effectCase:list){
+//                            String resultDetail = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/case/effect_case/"+effectCase.getId());
+//                            JsonNode detailNode = mapper.readTree(resultDetail);
+//                            int detailCode = detailNode.get("code").asInt();
+//                            if(detailCode == 0){
+//                                if(detailNode.get("data") != null){
+////                                    String detailJson = node.get("data").get("effect_cases").toString();
+////                                    EffectCase effectCase1 = mapper.readValue(detailJson,EffectCase.class);
+//                                    effectCase.setAuthor(detailNode.get("data").get("effect_case").get("author").asText());
+//                                    effectCase.setCreateDate(detailNode.get("data").get("effect_case").get("create_date").asText());
+//                                    effectCase.setCreativeId(detailNode.get("data").get("effect_case").get("creative_id").asLong());
+//                                    effectCase.setCreativeScore(detailNode.get("data").get("effect_case").get("creative_score").asText());
+//                                    effectCase.setEffect(detailNode.get("data").get("effect_case").get("effect").toString());
+//                                    effectCase.setMethods(detailNode.get("data").get("effect_case").get("methods").toString());
+//                                    effectCase.setVideoUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+effectCase.getVid()+"&line=0"));
+//                                    if (effectCase.getVideoUrl() == null){
+//                                        effectCase.setVideoUrl(getVideoUrl(effectCase.getVid()));
+//                                    }
+////                                    effectCase.setVideoUrl(getVideoUrl(effectCase.getVid()));
+//                                    effectCase.setCoverImage(getVideoFirstImage(effectCase.getVideoUrl()));
+//                                    if (effectCase.getCoverImage() == null){
+//                                        Thread.sleep(1000);
+//                                        effectCase.setCoverImage(getVideoFirstImage(effectCase.getVideoUrl()));
+//                                    }
+//                                    effectCase.setCreativeLabel(detailNode.get("data").get("effect_case").get("creative_label").toString());
+//                                }
+//                            }
+//                            effectCaseService.saveOrUpdate(effectCase);
+//                        }
+//                        effectCaseHandler(page+1);
+//                    }
+//                }
+//            }
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
+//    }
+//
+//    private String getVideoFirstImage(String url){
+//        try {
+//            FFmpegFrameGrabber ff = new FFmpegFrameGrabber(url);
+//            ff.start();
+//            int lenght = ff.getLengthInFrames();
+//            int i = 0;
+//            Frame f = null;
+//            while (i < lenght) {
+//// 过滤前5帧,避免出现全黑的图片,依自己情况而定
+//                f = ff.grabFrame();
+//                if ((i > 5) && (f.image != null)) {
+//                    break;
+//                }
+//                i++;
+//            }
+////            opencv_core.IplImage img = f.image;
+//            int owidth = f.imageWidth;
+//            int oheight = f.imageHeight;
+//            Java2DFrameConverter converter =new Java2DFrameConverter();
+//            BufferedImage fecthedImage =converter.getBufferedImage(f);
+//// 对截取的帧进行等比例缩放
+//            int width = 800;
+//            int height = (int) (((double) width / owidth) * oheight);
+//            BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
+//            bi.getGraphics().drawImage(fecthedImage.getScaledInstance(width, height, Image.SCALE_SMOOTH),
+//                    0, 0, null);
+//            ByteArrayOutputStream baos = new ByteArrayOutputStream();//io流
+//            ImageIO.write(bi, "jpg", baos);
+//            byte[] bytes = baos.toByteArray();//转换成字节
+//            String png_base64 = Base64.getEncoder().encodeToString(bytes).trim();//转换成base64串
+//            png_base64 = png_base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n
+//            //        ImageIO.write(bufferedImage, "png", new File("D:/qrcode1.png"));
+//            baos.close();
+//            ff.close();
+//            return "data:image/jpg;base64,"+png_base64;
+//        }catch (Exception e){
+//            e.printStackTrace();
+//            return null;
+//        }
+//
+//    }
+//    private void douyinHotHandler(int page,int listType){
+//        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/hot_video/user_side/list?page="+page+"&limit=20&list_type="+listType+"&aggr_duration_type=-1");
+//        ObjectMapper mapper = new ObjectMapper();
+//        try {
+//            JsonNode node = mapper.readTree(result);
+//            int code = node.get("code").asInt();
+//            if(code == 0){
+//                if(node.get("data")!= null){
+//                    String dataJson = node.get("data").get("items").toString();
+//                    List<DouyinHot> list = mapper.readValue(dataJson,new TypeReference<List<DouyinHot>>() {});
+//                    if (list != null && list.size() > 0){
+//                        for (DouyinHot douyinHot : list){
+//                            douyinHot.setUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+douyinHot.getVideoId()+"&line=0"));
+//                            if(douyinHot.getUrl() == null){
+//                                douyinHot.setUrl(getVideoUrl(douyinHot.getVideoId()));
+//                            }
+////                            douyinHot.setUrl(getVideoUrl(douyinHot.getVideoId()));
+//                            douyinHot.setCoverImage(getVideoFirstImage(douyinHot.getUrl()));
+//                            if(douyinHot.getCoverImage() == null){
+//                                Thread.sleep(1000);
+//                                douyinHot.setCoverImage(getVideoFirstImage(douyinHot.getUrl()));
+//                            }
+//                            douyinHotService.saveOrUpdate(douyinHot);
+//                        }
+//                        douyinHotHandler(page+1,listType);
+//                    }else {
+//                        if(listType < 4){
+//                            douyinHotHandler(1,listType+1);
+//                        }
+//                    }
+//                }
+//            }
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
+//
+//    }
+//    @Override
+//    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+//        String account="3248395570@qq.com";
+//        String password = "Ydxq-704127411";
+//        login(account,password);
+//        douyinHotHandler(1,1);
+//        effectCaseHandler(1);
+//        hotMaterialHandler(1,1,"西瓜");
+//        hotMaterialHandler(1,3,"火山");
+//        hotMaterialHandler(1,4,"抖音");
+//        hotMaterialHandler(1,8,"头条");
+//        hotMaterialHandler(1,9,"穿山甲");
+//        log.info("巨量创意抓取完成");
+//    }
+//
+//    private void login(String account,String password){
+//        String url = "https://cc.oceanengine.com/login";
+//        System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
+//        ChromeOptions chromeOptions = new ChromeOptions();
+//        chromeOptions.addArguments("--headless");
+//        chromeOptions.addArguments("--no-sandbox");
+//        chromeOptions.addArguments("--window-size=1920,1080");
+//        chromeOptions.addArguments("--user-agent=" + HttpUtils2.USER_AGENT);
+//        chromeOptions.setAcceptInsecureCerts(true);
+//        WebDriver webDriver = new ChromeDriver(chromeOptions);
+//        //清除所有的缓存
+//        webDriver.manage().deleteAllCookies();
+//        try {
+//            //获取登录页面
+//            webDriver.get(url);
+//            for (Cookie cookie : webDriver.manage().getCookies()) {
+//                BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
+//                ck.setDomain("oceanengine.com");
+//                ck.setExpiryDate(cookie.getExpiry());
+//                ck.setPath(cookie.getPath());
+//                HttpUtils2.cookieStore.addCookie(ck);
+//            }
+//            Map<String, String> header = new HashMap<>();
+//            header.put("Accept", "*/*");
+//            header.put("Connection", "keep-alive");
+//            header.put("Host", "sso.toutiao.com");
+//            header.put("Content-Type", "application/x-www-form-urlencoded");
+//            header.put("Origin", "https://cc.oceanengine.com");
+//            header.put("Referer", "https://cc.oceanengine.com/login");
+//            Map<String, Object> param = new HashMap<>();
+//            param.put("mobile", "");
+//            param.put("code", "");
+//            param.put("account", account);
+//            param.put("password", password);
+//            param.put("captcha", "hqde");
+//            param.put("is_30_days_no_login", "true");
+//            param.put("service", "https://cc.oceanengine.com");
+//            String res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
+//            ObjectMapper mapper = new ObjectMapper();
+//            mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+//            JsonNode jsonNode = mapper.readTree(res);
+//            //errorcode == 1102 验证码错误,请重新输入验证码
+//            //errorcode == 1101 验证码为空
+//
+//            Integer errorCode = jsonNode.get("error_code").asInt();
+//            String orderId = null;
+//            while (errorCode != 0) {
+//                //用户名或者密码错误
+//                if (null != errorCode && errorCode == 1009) {
+//                    return;
+//                }
+//                FateadmUtil fateadmUtil = new FateadmUtil();
+//                fateadmUtil.init();
+//                if (orderId != null) {
+//                    fateadmUtil.justice(orderId);
+//                }
+//                String captcha = jsonNode.get("captcha").asText();
+//                Base64.Decoder decoder = Base64.getDecoder();
+//                FateadmHttpUtil.HttpResp resp = fateadmUtil.Predict("30400", decoder.decode(captcha));
+//                param.put("captcha", resp.predResl);
+//                orderId = resp.reqId;
+//                res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
+//                jsonNode = mapper.readTree(res);
+//                errorCode = jsonNode.get("error_code").asInt();
+//            }
+//            if (errorCode == 0) {
+//                //表示登录成功
+//                List<org.apache.http.cookie.Cookie> cookies = HttpUtils2.cookieStore.getCookies();
+//                for (org.apache.http.cookie.Cookie ck : cookies) {
+//                    Cookie cookie = new Cookie(ck.getName(), ck.getValue(), "." + ck.getDomain(), ck.getPath(), ck.getExpiryDate());
+//                    webDriver.manage().addCookie(cookie);
+//                }
+//                String redirectUrl = jsonNode.get("redirect_url").asText();
+//                webDriver.get(redirectUrl);
+//                //登录成功 进入推广页面
+//                webDriver.get("https://cc.oceanengine.com/inspiration/douyin-rank-list");
+//                Thread.sleep(3000);
+//                for (Cookie cookie : webDriver.manage().getCookies()) {
+//                    BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
+//                    ck.setDomain("cc.oceanengine.com");
+//                    ck.setExpiryDate(cookie.getExpiry());
+//                    ck.setPath(cookie.getPath());
+//                    HttpUtils2.cookieStore.addCookie(ck);
+//                }
+//
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        } finally {
+//            //获得cookie
+//            Set<Cookie> coo = webDriver.manage().getCookies();
+//            //清除所有的缓存
+//            webDriver.manage().deleteAllCookies();
+//            webDriver.quit();
+//        }
+//    }
+//}

+ 1 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/entity/PangolinReportBillMonth.java

@@ -19,6 +19,7 @@ public class PangolinReportBillMonth {
      * 月
      */
     private Integer month;
+    private String date;
     /**
      * appId
      */

+ 1 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/entity/PangolinReportChannelDaily.java

@@ -27,7 +27,7 @@ public class PangolinReportChannelDaily {
     /**
      * 操作系统
      */
-    private String os;
+    private String oprateSystem;
     /**
      * 激活数
      */

+ 4 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinAppMapper.java

@@ -2,6 +2,10 @@ package cn.com.ctop.crawler.modules.pangolin.mapper;
 
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface PangolinAppMapper extends BaseMapper<PangolinApp> {
+    List<PangolinApp> getListByUserId(@Param(value = "userId") String userId);
 }

+ 4 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinChannelMapper.java

@@ -2,6 +2,10 @@ package cn.com.ctop.crawler.modules.pangolin.mapper;
 
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinChannel;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface PangolinChannelMapper extends BaseMapper<PangolinChannel> {
+    List<PangolinChannel> getListByUserId(@Param(value = "userId") String userId);
 }

+ 2 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinReportAppHourMapper.java

@@ -1,12 +1,10 @@
 package cn.com.ctop.crawler.modules.pangolin.mapper;
 
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportAppHour;
-import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppHourVO;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
 public interface PangolinReportAppHourMapper extends BaseMapper<PangolinReportAppHour> {
-    List<PangolinReportAppHourVO> getRealTimeData(@Param(value = "userId") String userId, @Param(value = "date") String date);
+    JSONObject getComparedDate(@Param(value = "appId") Integer appId,@Param(value = "hour") Integer hour, @Param(value = "userId")String userId, @Param(value = "type")String type, @Param(value = "today")String today, @Param(value = "yesterday")String yesterday, @Param(value = "sevenDaysAgo")String sevenDaysAgo, @Param(value = "compareTime1")String compareTime1, @Param(value = "compareTime2")String compareTime2);
 }

+ 6 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinReportBillMonthMapper.java

@@ -1,7 +1,13 @@
 package cn.com.ctop.crawler.modules.pangolin.mapper;
 
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportBillMonth;
+import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppMonthVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface PangolinReportBillMonthMapper extends BaseMapper<PangolinReportBillMonth> {
+    List<PangolinReportAppMonthVO> checkAppList(@Param(value = "appId") Integer appId, @Param(value = "userId") String userId, @Param(value = "startDate") String startDate,
+                                                @Param(value = "endDate") String endDate, @Param(value = "operateSystem") String operateSystem);
 }

+ 3 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/PangolinReportChannelDailyMapper.java

@@ -7,5 +7,7 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 public interface PangolinReportChannelDailyMapper extends BaseMapper<PangolinReportChannelDaily> {
-    List<PangolinReportChannelDaily> getActivationList(@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "userId") String userId, @Param(value = "type") String type);
+    Integer sumAppList(@Param(value = "appId") Integer appId,@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "userId") String userId, @Param(value = "type") String type);
+
+    List<PangolinReportChannelDaily> getActivationList(@Param(value = "appId") Integer appId,@Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate, @Param(value = "userId") String userId, @Param(value = "type") String type);
 }

+ 13 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinAppMapper.xml

@@ -0,0 +1,13 @@
+<?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.crawler.modules.pangolin.mapper.PangolinAppMapper">
+    <select id="getListByUserId" resultType="cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp">
+        select app.*
+            from ctop_pangolin_app app
+        left join ctop_bind_account_login login on login.account_name = app.account_name
+        where 1=1
+        <if test="userId!=null">
+            and login.user_id = #{userId}
+        </if>
+    </select>
+</mapper>

+ 13 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinChannelMapper.xml

@@ -0,0 +1,13 @@
+<?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.crawler.modules.pangolin.mapper.PangolinChannelMapper">
+    <select id="getListByUserId" resultType="cn.com.ctop.crawler.modules.pangolin.entity.PangolinChannel">
+        select channel.*
+from ctop_pangolin_channel channel
+         left join ctop_bind_account_login login on login.account_name = channel.account_name
+         where 1=1
+         <if test="userId!=null">
+             and login.user_id = #{userId}
+         </if>
+    </select>
+</mapper>

+ 79 - 26
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinReportAppHourMapper.xml

@@ -1,36 +1,89 @@
 <?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.crawler.modules.pangolin.mapper.PangolinReportAppHourMapper">
-    <select id="getRealTimeData" resultType="cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppHourVO">
-        select appHourActive.date as 'date',
-        appHourActive.hour as 'hour',
-        appHourActive.app_id as 'appId',
-        appHourActive.num as 'activeNum',
-        (select appHourRate.num
-        from ctop_pangolin_report_app_hour appHourRate
-        where appHourRate.date = appHourActive.date
-        and appHourRate.hour = appHourActive.hour
-        and appHourRate.type = 'rate') as 'rateNum',
-        (select appHourClick.num
-        from ctop_pangolin_report_app_hour appHourClick
-        where appHourClick.date = appHourActive.date
-        and appHourClick.hour = appHourActive.hour
-        and appHourClick.type = 'click') as 'clickNum'
-        from ctop_pangolin_report_app_hour appHourActive
-        left join ctop_pangolin_app app on app.id = appHourActive.app_id
-        left join ctop_bind_account_login login on login.account_name = app.account_name
-        where
-        1=1
+    <select id="getComparedDate" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        <if test="compareTime1!=null">
+            sum(if(date = '${compareTime1}',num,0)) as '${compareTime1}',
+        </if>
+        <if test="compareTime2!=null">
+            sum(if(date = '${compareTime2}',num,0)) as '${compareTime2}',
+        </if>
+            sum(if(date = '${today}',num,0)) as 'today',
+            sum(if(date = '${yesterday}',num,0)) as 'yesterday',
+            sum(if(date = '${sevenDaysAgo}',num,0)) as 'sevendaysAgo',
+            hour
+       from (select num,date,hour
+from ctop_pangolin_report_app_hour appHourActive
+         left join ctop_pangolin_app app on app.id = appHourActive.app_id
+         left join ctop_bind_account_login login on login.account_name = app.account_name
+where appHourActive.type = #{type}
+and date =  #{today} and hour = #{hour}
+<if test="appId!=null">
+    and app.id = #{appId}
+</if>
+<if test="userId!=null">
+    and login.user_id = #{userId}
+</if>
+group by appHourActive.date, appHourActive.hour
+union all select num,date,hour
+from ctop_pangolin_report_app_hour appHourActive
+         left join ctop_pangolin_app app on app.id = appHourActive.app_id
+         left join ctop_bind_account_login login on login.account_name = app.account_name
+where appHourActive.type = #{type}
+        and date =  #{yesterday} and hour = #{hour}
+        <if test="appId!=null">
+            and app.id = #{appId}
+        </if>
         <if test="userId!=null">
             and login.user_id = #{userId}
         </if>
-        and appHourActive.date = #{date}
-        and appHourActive.type = 'active'
-        group by
+        group by appHourActive.date, appHourActive.hour
+union all select num,date,hour
+from ctop_pangolin_report_app_hour appHourActive
+         left join ctop_pangolin_app app on app.id = appHourActive.app_id
+         left join ctop_bind_account_login login on login.account_name = app.account_name
+where appHourActive.type = #{type}
+        and date =  #{sevenDaysAgo} and hour = #{hour}
+        <if test="appId!=null">
+            and app.id = #{appId}
+        </if>
         <if test="userId!=null">
-            login.user_id,
+            and login.user_id = #{userId}
+        </if>
+        group by appHourActive.date, appHourActive.hour
+<if test="compareTime1!=null">
+    union all
+    select num,date,hour
+    from ctop_pangolin_report_app_hour appHourActive
+    left join ctop_pangolin_app app on app.id = appHourActive.app_id
+    left join ctop_bind_account_login login on login.account_name = app.account_name
+    where appHourActive.type = #{type}
+    and date =  #{compareTime1} and hour = #{hour}
+    <if test="appId!=null">
+        and app.id = #{appId}
+    </if>
+    <if test="userId!=null">
+        and login.user_id = #{userId}
+    </if>
+    group by appHourActive.date, appHourActive.hour
+</if>
+        <if test="compareTime2!=null">
+            union all
+            select num,date,hour
+            from ctop_pangolin_report_app_hour appHourActive
+            left join ctop_pangolin_app app on app.id = appHourActive.app_id
+            left join ctop_bind_account_login login on login.account_name = app.account_name
+            where appHourActive.type = #{type}
+            and date =  #{compareTime2} and hour = #{hour}
+            <if test="appId!=null">
+                and app.id = #{appId}
+            </if>
+            <if test="userId!=null">
+                and login.user_id = #{userId}
+            </if>
+            group by appHourActive.date, appHourActive.hour
         </if>
-        appHourActive.date,appHourActive.hour
-        order by appHourActive.hour
+        )a group by hour
     </select>
 </mapper>

+ 39 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinReportBillMonthMapper.xml

@@ -0,0 +1,39 @@
+<?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.crawler.modules.pangolin.mapper.PangolinReportBillMonthMapper">
+    <select id="checkAppList" resultType="cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppMonthVO">
+        select
+       bill.date,
+        <if test="appId == null">
+            '-' as 'app_name',
+        </if>
+        <if test="appId != null">
+            app.name as 'app_name',
+        </if>
+       bill.os as 'operate_system',
+       sum(bill.sum_internal_activations) as 'sum_internal_activations',
+       sum(bill.estimated_total_price) as 'estimated_total_price',
+       round(avg(bill.account_quality_score),2) as 'account_quality_score',
+       sum(bill.actual_total_price) as 'actual_total_price'
+from ctop_pangolin_report_bill_month bill
+         left join ctop_pangolin_app app on app.id = bill.app_id
+         left join ctop_bind_account_login login on login.account_name = app.account_name
+         where 1=1
+         <if test="userId!=null">
+             and login.user_id = #{userId}
+         </if>
+         <if test="appId!=null">
+             and app.id = #{appId}
+         </if>
+        <if test="startDate!=null">
+            and bill.date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+           and  bill.date &lt;= #{endDate}
+        </if>
+        <if test="operateSystem!=null">
+           and bill.os = #{operateSystem}
+        </if>
+        group by bill.date,bill.os order by bill.date desc
+    </select>
+</mapper>

+ 50 - 5
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/mapper/xml/PangolinReportChannelDailyMapper.xml

@@ -6,19 +6,64 @@
             resultType="cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportChannelDaily">
         select
             daily.date,
-            daily.app_name,
+            channel.name as 'channel_name',
+            <if test="appId == null">
+                '-' as 'app_name',
+            </if>
+            <if test="appId != null">
+                daily.app_name,
+            </if>
+            daily.oprate_system,
             sum(daily.external_activation) as 'external_activation',
             sum(daily.total_price)as 'total_price'
         from
         ctop_pangolin_report_channel_daily daily
         left join ctop_pangolin_channel channel on channel.name = daily.channel_name
         left join ctop_bind_account_login login on login.account_name = channel.account_name
+        left join ctop_pangolin_app app on app.account_name = channel.account_name
         where 1=1
-        and login.user_id = #{userId}
-        and daily.date &gt;= #{startDate}
-        and daily.date &lt;= #{endDate}
-        and daily.os = #{type}
+        <if test="userId!=null">
+            and login.user_id = #{userId}
+        </if>
+        <if test="appId!=null">
+            and app.id = #{appId}
+        </if>
+        <if test="startDate!=null">
+            and daily.date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and daily.date &lt;= #{endDate}
+        </if>
+        <if test="type!=null">
+            and daily.os = #{type}
+        </if>
         group by daily.date
     </select>
+    <select id="sumAppList" resultType="java.lang.Integer">
+        select
+            sum(daily.external_activation)
+        from
+        ctop_pangolin_report_channel_daily daily
+        left join ctop_pangolin_channel channel on channel.name = daily.channel_name
+        left join ctop_bind_account_login login on login.account_name = channel.account_name
+        left join ctop_pangolin_app app on app.account_name = channel.account_name
+        where 1=1
+        <if test="userId!=null">
+            and login.user_id = #{userId}
+        </if>
+        <if test="appId!=null">
+            and app.id = #{appId}
+        </if>
+        <if test="startDate!=null">
+            and daily.date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and daily.date &lt;= #{endDate}
+        </if>
+        <if test="type!=null">
+            and daily.os = #{type}
+        </if>
+
+    </select>
 
 </mapper>

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinAppService.java

@@ -3,5 +3,8 @@ package cn.com.ctop.crawler.modules.pangolin.service;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.Map;
+
 public interface PangolinAppService extends IService<PangolinApp> {
+    Map<String, Object> getListByUserId(String userId);
 }

+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinChannelService.java

@@ -3,5 +3,8 @@ package cn.com.ctop.crawler.modules.pangolin.service;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinChannel;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.Map;
+
 public interface PangolinChannelService extends IService<PangolinChannel> {
+    Map<String, Object> getListByUserId(String userId);
 }

+ 2 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinReportAppHourService.java

@@ -1,10 +1,11 @@
 package cn.com.ctop.crawler.modules.pangolin.service;
 
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportAppHour;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.Map;
 
 public interface PangolinReportAppHourService extends IService<PangolinReportAppHour> {
-    Map<String, Object> getRealTimeData(String userId);
+    Map<String, Object> getRealTimeData(String userId, JSONObject data);
 }

+ 3 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/PangolinReportBillMonthService.java

@@ -1,11 +1,11 @@
 package cn.com.ctop.crawler.modules.pangolin.service;
 
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportBillMonth;
+import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppMonthVO;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.Map;
+import com.github.pagehelper.PageInfo;
 
 public interface PangolinReportBillMonthService extends IService<PangolinReportBillMonth> {
-    Map<String, Object> checkAppList(String userId, JSONObject data);
+    PageInfo<PangolinReportAppMonthVO> checkAppList(String userId, JSONObject data);
 }

+ 17 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinAppServiceImpl.java

@@ -1,13 +1,28 @@
 package cn.com.ctop.crawler.modules.pangolin.service.impl;
 
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
 import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinAppMapper;
-import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinChannelMapper;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 @Service
 public class PangolinAppServiceImpl extends ServiceImpl<PangolinAppMapper, PangolinApp> implements PangolinAppService {
-
+    @Autowired
+    private PangolinAppMapper pangolinAppMapper;
+    @Override
+    public Map<String, Object> getListByUserId(String userId) {
+        Map<String,Object>result = new HashMap<>();
+        List<PangolinApp>appList = pangolinAppMapper.getListByUserId(userId);
+        result.put("data",appList);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }

+ 17 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinChannelServiceImpl.java

@@ -1,11 +1,28 @@
 package cn.com.ctop.crawler.modules.pangolin.service.impl;
 
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinChannel;
 import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinChannelMapper;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinChannelService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 @Service
 public class PangolinChannelServiceImpl extends ServiceImpl<PangolinChannelMapper, PangolinChannel> implements PangolinChannelService {
+    @Autowired
+    private PangolinChannelMapper pangolinChannelMapper;
+    @Override
+    public Map<String, Object> getListByUserId(String userId) {
+        Map<String,Object>result = new HashMap<>();
+        List<PangolinChannel>channelList = pangolinChannelMapper.getListByUserId(userId);
+        result.put("data",channelList);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }

+ 3 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinCrawlerServiceImpl.java

@@ -79,6 +79,7 @@ public class PangolinCrawlerServiceImpl implements PangolinCrawlerService {
                     pangolinReportBillMonth.setSumInternalActivations(sumInternalActivations);
                     pangolinReportBillMonth.setYear(Integer.parseInt(date.split("-")[0]));
                     pangolinReportBillMonth.setMonth(Integer.parseInt(date.split("-")[1]));
+                    pangolinReportBillMonth.setDate(date);
                     QueryWrapper<PangolinReportBillMonth> queryWrapper = new QueryWrapper<>();
                     queryWrapper.eq("os", pangolinReportBillMonth.getOs());
                     queryWrapper.eq("app_id", pangolinReportBillMonth.getAppId());
@@ -204,7 +205,7 @@ public class PangolinCrawlerServiceImpl implements PangolinCrawlerService {
                     pangolinReportChannelDaily.setChannelName(channelName);
                     pangolinReportChannelDaily.setDate(DateUtils.parseDate(startDate, "yyyy-MM-dd"));
                     pangolinReportChannelDaily.setExternalActivation(externalActivation);
-                    pangolinReportChannelDaily.setOs(os);
+                    pangolinReportChannelDaily.setOprateSystem(os);
                     pangolinReportChannelDaily.setRetentionRatio(retentionRatio);
                     pangolinReportChannelDaily.setTotalPrice(totalPrice);
                     QueryWrapper<PangolinReportChannelDaily> queryWrapper = new QueryWrapper<>();
@@ -343,7 +344,7 @@ public class PangolinCrawlerServiceImpl implements PangolinCrawlerService {
 
     public boolean checkLogin(BindAccountLogin bindAccountLogin, String response) {
         if (response.contains("<html>")) {
-            bindAccountLogin.setCookie(null);
+            bindAccountLogin.setCookie("");
             bindAccountLoginService.updateById(bindAccountLogin);
             return false;
         }

+ 21 - 13
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportAppHourServiceImpl.java

@@ -5,12 +5,13 @@ import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportAppHour;
 import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinReportAppHourMapper;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportAppHourService;
-import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppHourVO;
+import com.alibaba.fastjson.JSONObject;
 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.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -21,23 +22,30 @@ public class PangolinReportAppHourServiceImpl extends ServiceImpl<PangolinReport
     private PangolinReportAppHourMapper pangolinReportAppHourMapper;
 
     @Override
-    public Map<String, Object> getRealTimeData(String userId) {
+    public Map<String, Object> getRealTimeData(String userId, JSONObject data) {
+
         Map<String, Object> resultMap = new HashMap<>();
         String today = DateUtils.formatDate();
-        //1:查询当天的数据
-        List<PangolinReportAppHourVO> todayList = this.getRealTimeData(userId, today);
-        resultMap.put("today", todayList);
-        //2:查询昨天的数据
-        List<PangolinReportAppHourVO> yestodyList = this.getRealTimeData(userId, DateUtils.addDay(today, -1));
-        resultMap.put("yesterday", yestodyList);
-        //3:查询七天前的数据
-        List<PangolinReportAppHourVO> lastSevenList = this.getRealTimeData(userId, DateUtils.addDay(today, -7));
-        resultMap.put("sevenDaysAgo", lastSevenList);
+        String yesterday = DateUtils.addDay(today,-1);
+        String sevenDaysAgo = DateUtils.addDay(today,-7);
+        String type = data.getString("type");
+        String compareTime1 = data.getString("compareTime1");
+        String compareTime2 = data.getString("compareTime2");
+        Integer appId = data.getInteger("appId");
+        if(null == appId||appId == 0){
+            appId = null;
+        }
+        List<JSONObject> dataList = new ArrayList<>();
+        for(int i=0;i<24;i++){
+            JSONObject getData = this.getComparedDate(appId,i,userId,type,today,yesterday,sevenDaysAgo,compareTime1,compareTime2);
+            dataList.add(getData);
+        }
+        resultMap.put("data",dataList);
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS);
         return resultMap;
     }
 
-    private List<PangolinReportAppHourVO> getRealTimeData(String userId, String date) {
-        return pangolinReportAppHourMapper.getRealTimeData(userId, date);
+    private JSONObject getComparedDate(Integer appId,Integer hour,String userId,String type,String today, String yesterday, String sevenDaysAgo, String compareTime1, String compareTime2) {
+        return pangolinReportAppHourMapper.getComparedDate(appId,hour,userId,type,today, yesterday,sevenDaysAgo,compareTime1,compareTime2);
     }
 }

+ 27 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportBillMonthServiceImpl.java

@@ -3,12 +3,15 @@ package cn.com.ctop.crawler.modules.pangolin.service.impl;
 import cn.com.ctop.crawler.modules.pangolin.entity.PangolinReportBillMonth;
 import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinReportBillMonthMapper;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportBillMonthService;
+import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppMonthVO;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Map;
+import java.util.List;
 
 @Service
 public class PangolinReportBillMonthServiceImpl extends ServiceImpl<PangolinReportBillMonthMapper, PangolinReportBillMonth> implements PangolinReportBillMonthService {
@@ -16,7 +19,28 @@ public class PangolinReportBillMonthServiceImpl extends ServiceImpl<PangolinRepo
     private PangolinReportBillMonthMapper pangolinReportBillMonthMapper;
 
     @Override
-    public Map<String, Object> checkAppList(String userId, JSONObject data) {
-        return null;
+    public PageInfo<PangolinReportAppMonthVO> checkAppList(String userId, JSONObject data) {
+        Integer pageNo = data.getInteger("pageNo");
+        if(null == pageNo||pageNo == 0){
+            pageNo = 1;
+        }
+        Integer pageSize = data.getInteger("pageSize");
+        if(null == pageSize||pageSize == 0){
+            pageSize = 10;
+        }
+        Integer appId = data.getInteger("appId");
+        if(null == appId||appId == 0){
+            appId = null;
+        }
+        String startDate = data.getString("startDate");
+        String endDate = data.getString("endDate");
+        String operateSystem = data.getString("operateSystem");
+        if(null!=operateSystem&&operateSystem.trim().equals("all")){
+            operateSystem = null;
+        }
+        PageHelper.startPage(pageNo,pageSize);
+        List<PangolinReportAppMonthVO> list = pangolinReportBillMonthMapper.checkAppList(appId,userId,startDate,endDate,operateSystem);
+        PageInfo<PangolinReportAppMonthVO> pageInfo = new PageInfo<>(list);
+        return pageInfo;
     }
 }

+ 39 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportChannelDailyServiceImpl.java

@@ -7,6 +7,9 @@ import cn.com.ctop.crawler.modules.pangolin.mapper.PangolinReportChannelDailyMap
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinReportChannelDailyService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -20,13 +23,45 @@ public class PangolinReportChannelDailyServiceImpl extends ServiceImpl<PangolinR
     private PangolinReportChannelDailyMapper pangolinReportChannelDailyMapper;
 
     @Override
-    public Map<String, Object> getActivationList(String userId, JSONObject data) {
+    public Map<String, Object>  getActivationList(String userId, JSONObject data) {
         Map<String, Object> result = new HashMap<>();
+        Integer pageNo = data.getInteger("pageNo");
+        if(null == pageNo||pageNo == 0){
+            pageNo = 1;
+        }
+        Integer pageSize = data.getInteger("pageSize");
+        if(null == pageSize||pageSize == 0){
+            pageSize = 10;
+        }
+        String operateSystem = data.getString("operateSystem");
+        if(null!=operateSystem&&operateSystem.trim().equals("all")){
+            operateSystem = null;
+        }
+        Integer appId = data.getInteger("appId");
+        if(null == appId||appId == 0){
+            appId = null;
+        }
         String startDate = data.getString("startDate");
         String endDate = data.getString("endDate");
-        String type = data.getString("type");
-        List<PangolinReportChannelDaily> dailyList = pangolinReportChannelDailyMapper.getActivationList(startDate, endDate, userId, type);
-        result.put("activationList", dailyList);
+        PageHelper.startPage(pageNo,pageSize);
+        List<PangolinReportChannelDaily> dailyList = pangolinReportChannelDailyMapper.getActivationList(appId,startDate, endDate, userId, operateSystem);
+        PageInfo<PangolinReportChannelDaily> pageInfo = new PageInfo<>(dailyList);
+        result.put("data", pageInfo);
+        Integer totalActive = pangolinReportChannelDailyMapper.sumAppList(appId,startDate,endDate,userId,operateSystem);
+        Long totalDays = 1L;
+        if(!startDate.equals(endDate)){
+            totalDays = DateUtils.getDiscrepantDays(startDate,endDate)+1;
+        }
+        if(null == totalActive){
+            result.put("totalActive","-");
+            result.put("avgActive","-");
+        }else if(0 == totalActive){
+            result.put("totalActive","0");
+            result.put("avgActive","0");
+        }else{
+            result.put("totalActive",totalActive+"");
+            result.put("avgActive",totalActive/totalDays+"");
+        }
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }

+ 16 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/vo/PangolinReportAppMonthVO.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.crawler.modules.pangolin.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class PangolinReportAppMonthVO {
+    private String date;
+    private String appName;
+    private String operateSystem;
+    private Integer sumInternalActivations;
+    private BigDecimal estimatedTotalPrice;
+    private BigDecimal accountQualityScore;
+    private BigDecimal actualTotalPrice;
+}

+ 3 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserDailyReportLoadJob.java

@@ -9,6 +9,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.log.XxlJobLogger;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
@@ -25,8 +26,10 @@ import java.util.concurrent.Executors;
 @Component
 public class BytedanceAdvertiserDailyReportLoadJob {
     @Autowired
+    @Qualifier("tokenService")
     private ICtopOauthTokenService tokenService;
     @Autowired
+    @Qualifier("reportService")
     private IReportService reportService;
     static ExecutorService executorService = null;
 

+ 45 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceFlowFundJob.java

@@ -0,0 +1,45 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class BytedanceFlowFundJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IBytedanceFundDailyService bytedanceFundDailyService;
+    static ExecutorService executorService = null;
+    @XxlJob("bytedanceFlowFund")
+    public ReturnT<String> execute(String param) throws Exception {
+        XxlJobLogger.log("头条账户流水数据获取开始");
+        Date getDate = new Date();
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (null == tokens || tokens.size() <= 0) {
+            XxlJobLogger.log("头条账户流水数据异常:未获取到可用的token");
+            return ReturnT.FAIL;
+        }
+        executorService = Executors.newFixedThreadPool(4);
+        tokens.forEach(token -> {
+            executorService.submit(() -> {
+                bytedanceFundDailyService.loadFundDataByPage(token, DateUtils.formatDate(getDate), DateUtils.formatDate(getDate),1);
+            });
+        });
+        XxlJobLogger.log("头条账户流水数据获取结束");
+        return ReturnT.SUCCESS;
+    }
+}

+ 36 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouCleanMaterialJob.java

@@ -0,0 +1,36 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaiShouCleanMaterialJob {
+    @Autowired
+    private IKuaiShouCleanMaterialReportService kuaiShouCleanMaterialReportService;
+
+    static ExecutorService executorService = null;
+
+    @XxlJob("kuaiShouCleanMaterial")
+    public ReturnT<String> execute(String param) {
+        List<String> signatureList = kuaiShouCleanMaterialReportService.getSignature();
+        if (Check.isNull(signatureList)) {
+            XxlJobLogger.log("素材数据获取为空");
+            return ReturnT.FAIL;
+        }
+        executorService = Executors.newFixedThreadPool(5);
+        for (int i = 0; i < signatureList.size(); i++) {
+            String signature = signatureList.get(i);
+            executorService.submit(()-> kuaiShouCleanMaterialReportService.calculationReport(signature));
+        }
+        return ReturnT.SUCCESS;
+    }
+}

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/AppAdServiceImpl.java

@@ -6,11 +6,14 @@ import cn.com.ctop.kuaishou.modules.app.service.IAppAdService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
 @Service
+@Primary
+
 public class AppAdServiceImpl extends ServiceImpl<AppAdMapper, AppAd> implements IAppAdService {
     @Autowired
     private AppAdMapper appAdMapper;

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/AppVideoServiceImpl.java

@@ -4,8 +4,11 @@ import cn.com.ctop.kuaishou.modules.app.entity.AppVideo;
 import cn.com.ctop.kuaishou.modules.app.mapper.AppVideoMapper;
 import cn.com.ctop.kuaishou.modules.app.service.IAppVideoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
 @Service
+@Primary
+
 public class AppVideoServiceImpl extends ServiceImpl<AppVideoMapper, AppVideo> implements IAppVideoService {
 }

+ 0 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppProductServiceImpl.java


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov