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

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

syh 5 éve
szülő
commit
8730cf3dc0

+ 3 - 9
jeecg-boot-module-system/pom.xml

@@ -41,12 +41,6 @@
     </repositories>
 
     <dependencies>
-        <!-- rabbitmq 依赖jar包-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-amqp</artifactId>
-            <version>1.5.2.RELEASE</version>
-        </dependency>
         <dependency>
             <groupId>org.jeecgframework.boot</groupId>
             <artifactId>jeecg-boot-base-common</artifactId>
@@ -130,9 +124,9 @@
             <version>3.17</version>
         </dependency>
         <dependency>
-        <groupId>org.apache.poi</groupId>
-        <artifactId>poi-ooxml-schemas</artifactId>
-        <version>3.17</version>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml-schemas</artifactId>
+            <version>3.17</version>
         </dependency>
 
         <dependency>

+ 0 - 67
jeecg-boot-module-system/src/main/java/org/jeecg/config/RabbitConfig.java

@@ -1,67 +0,0 @@
-package org.jeecg.config;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.core.Queue;
-import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
-import org.springframework.amqp.rabbit.connection.ConnectionFactory;
-import org.springframework.amqp.rabbit.core.RabbitTemplate;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Scope;
-
-@Configuration
-@Slf4j
-public class RabbitConfig {
-    @Value("${spring.rabbitmq.host}")
-    private String host;
-
-    @Value("${spring.rabbitmq.port}")
-    private int port;
-
-    @Value("${spring.rabbitmq.username}")
-    private String username;
-
-    @Value("${spring.rabbitmq.password}")
-    private String password;
-
-
-    public static final String EXCHANGE_A = "my-mq-exchange_A";
-    public static final String EXCHANGE_B = "my-mq-exchange_B";
-    public static final String EXCHANGE_C = "my-mq-exchange_C";
-
-
-    public static final String QUEUE_A = "QUEUE_A";
-    public static final String QUEUE_B = "QUEUE_B";
-    public static final String QUEUE_C = "QUEUE_C";
-
-    public static final String ROUTINGKEY_A = "spring-boot-routingKey_A";
-    public static final String ROUTINGKEY_B = "spring-boot-routingKey_B";
-    public static final String ROUTINGKEY_C = "spring-boot-routingKey_C";
-
-    @Bean
-    public ConnectionFactory connectionFactory() {
-        CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host, port);
-        connectionFactory.setUsername(username);
-        connectionFactory.setPassword(password);
-        connectionFactory.setVirtualHost("/");
-        connectionFactory.setPublisherConfirms(true);
-        return connectionFactory;
-    }
-
-    /**
-     * 必须是prototype类型
-     */
-    @Bean
-    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-    public RabbitTemplate rabbitTemplate() {
-        RabbitTemplate template = new RabbitTemplate(connectionFactory());
-        return template;
-    }
-
-    @Bean
-    public Queue helloQueue() {
-        return new Queue("hello");
-    }
-}

+ 0 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/mq/Receiver.java

@@ -1,20 +0,0 @@
-package org.jeecg.modules.mq;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.rabbit.annotation.Queue;
-import org.springframework.amqp.rabbit.annotation.RabbitHandler;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.stereotype.Component;
-
-@Slf4j
-@Component
-@RabbitListener(queuesToDeclare = @Queue("hello"))
-public class Receiver {
-    /**
-     * 通过@RabbitHandler声明的方法,对hello队列中的消息进行处理
-     */
-    @RabbitHandler
-    public void receiver(String str) {
-        log.info("Receiver says:[" + str + "]");
-    }
-}

+ 0 - 27
jeecg-boot-module-system/src/main/java/org/jeecg/modules/mq/Sender.java

@@ -1,27 +0,0 @@
-package org.jeecg.modules.mq;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.core.AmqpTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * @author jeecg-boot
- * 2019年12月5日19:57:58
- */
-@Component
-@Slf4j
-public class Sender {
-
-    @Autowired
-    AmqpTemplate rabbitmqTemplate;
-
-    /**
-     * 发送消息
-     */
-    public void send() {
-        String content = "Sender says:" + "'hello, I'm sender'";
-        log.info(content);
-        rabbitmqTemplate.convertAndSend("hello", content);
-    }
-}

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

@@ -14,11 +14,6 @@ management:
         include: metrics,httptrace
 
 spring:
-  rabbitmq:
-    host: 39.106.184.70
-    port: 5672
-    username: guest
-    password: guest
   servlet:
     multipart:
       max-file-size: -1
@@ -99,7 +94,7 @@ spring:
         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
+          url:  url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver

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

@@ -12,11 +12,6 @@ management:
       exposure:
         include: metrics,httptrace
 spring:
-  rabbitmq:
-    host: 39.106.184.70
-    port: 5672
-    username: guest
-    password: guest
   servlet:
     multipart:
       max-file-size: -1

+ 1 - 5
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -14,11 +14,6 @@ management:
         include: metrics,httptrace
 
 spring:
-  rabbitmq:
-    host: 39.106.184.70
-    port: 5672
-    username: guest
-    password: guest
   servlet:
     multipart:
       max-file-size: -1
@@ -44,6 +39,7 @@ spring:
   aop:
     proxy-target-class: true
   #配置freemarker
+  #配置freemarker
   freemarker:
     # 设置模板后缀名
     suffix: .ftl

+ 0 - 1
jeecg-boot-module-system/src/main/resources/static/demo1.html

@@ -1 +0,0 @@
-demo1

+ 24 - 16
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -12,6 +12,7 @@ import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -39,24 +40,29 @@ public class SampleTest {
     private IByteDanceVideoReportDailyService byteDanceVideoReportDailyService;
     @Autowired
     private ICtopOauthTokenService oauthTokenService;
+    @Autowired
+    private IReportService reportService;
 
     @Test
     public void testOceanEngineJob() {
         try {
-            CtopOauthToken byId = oauthTokenService.getById(303094936123368L);
-            String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-            String endDate = DateUtils.addDay(nowDate, -180);
+            CtopOauthToken byId = oauthTokenService.getById(1654059015242756L);
+
+          /*  SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Date start = simpleDateFormat.parse("2020-01-01");
+            Date end = simpleDateFormat.parse("2020-06-03");*/
+
+
+            String nowDate = "2020-06-03";
+            String endDate = "2020-01-01";
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
             Date start = simpleDateFormat.parse(nowDate);
             Date end = simpleDateFormat.parse(endDate);
-            List<Date> dates = DateUtils.findDates(end,start);
+            List<Date> dates = DateUtils.findDates(end, start);
             for (int i = 0; i < dates.size(); i++) {
                 String formatDate = simpleDateFormat.format(dates.get(i));
-                int code = bytedanceReportService.bytedanceMaterialReport(byId, formatDate, formatDate);
-                //如果成功的话跑视频清洗数据方法,失败会进入重试库,重试成功后再清洗数据
-                if (code == 200 || code == 1) {
-                    byteDanceVideoReportDailyService.videoInfoListByAccountId(formatDate, formatDate, byId.getAccountId());
-                }
+                Date parse = simpleDateFormat.parse(formatDate);
+                reportService.getAdvertiserReport(byId, parse, parse, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -126,21 +132,23 @@ public class SampleTest {
         Long end = System.currentTimeMillis();
         log.info("总用时:{}毫秒", end - start);
     }
+
     @Autowired
     private PangolinLoginService pangolinLoginService;
     @Autowired
     private PangolinCrawlerService pangolinCrawlerService;
     @Autowired
     private PangolinAppService pangolinAppService;
+
     @Test
-    public void testPangolinLogin(){
+    public void testPangolinLogin() {
         QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("login_type","pangolin");
-        queryWrapper.eq("status",1);
+        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())){
+        if (list != null && !list.isEmpty()) {
+            for (BindAccountLogin login : list) {
+                if (null == login.getCookie() || "".equals(login.getCookie().trim())) {
                     pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
                 }
             }
@@ -148,7 +156,7 @@ public class SampleTest {
     }
 
     @Test
-    public void testPangolinData(){
+    public void testPangolinData() {
         QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("login_type", "pangolin");
         queryWrapper.eq("status", 1);

+ 0 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -3205,5 +3205,4 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return convertVoList;
     }
 
-
 }