Bläddra i källkod

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

yumeng 5 år sedan
förälder
incheckning
e106ed90df

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

@@ -74,6 +74,12 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>performance-appraisal</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <version>3.5.0</version>

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -14,7 +14,6 @@ import lombok.val;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.cp.api.WxCpOAuth2Service;
 import me.chanjar.weixin.cp.api.WxCpUserService;
-import me.chanjar.weixin.cp.api.impl.WxCpOAuth2ServiceImpl;
 import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
 import me.chanjar.weixin.cp.api.impl.WxCpUserServiceImpl;
 import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo;
@@ -81,7 +80,6 @@ public class LoginController {
 
         service.setWxCpConfigStorage(configStorage);
         WxCpOAuth2Service wxCpOAuth2Service = service.getOauth2Service();
-        ;
         try {
             WxCpOauth2UserInfo userInfo = wxCpOAuth2Service.getUserInfo(1000002, code);
             if (userInfo != null && userInfo.getUserId() != null) {

+ 20 - 92
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,21 +1,17 @@
 package org.jeecg;
 
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.utils.HttpUtils2;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumJobService;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.impl.client.BasicCookieStore;
-import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IBidWarningService;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.jeecg.modules.mq.Sender;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.chrome.ChromeDriver;
@@ -25,15 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import javax.mail.Message;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
-import java.util.Properties;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
@@ -121,93 +109,33 @@ public class SampleTest {
         sender.send();
     }
 
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private CtopOauthTokenMapper tokenMapper;
-
     @Test
-    public void loadKuaishouDataSingle() {
-
-
-        Date endDate = new Date();
-        QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
-        tokenQueryWrapper.eq("media_id", 2);
-        List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
-        for (CtopOauthToken token : ctopOauthTokens) {
-
-
-            for (int i = 0; i < 7; i++) {
-                Date getStartDate = DateUtils.addDay(endDate, -i);
-
-                //3:获取广告组信息数据
-                kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, getStartDate, getStartDate);
-
-            }
-            for (int i = 0; i < 6; i++) {
-                Date getStartDate = new Date();
-                Date getEndDate = new Date();
-                if (i == 0) {
-                    getStartDate = DateUtils.addDay(endDate, -175 + i * 30);
-                    getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-                } else {
-                    getStartDate = DateUtils.addDay(endDate, -180 + i * 30);
-                    getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-                }
-
-                //3:获取广告组信息数据
-                kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
-
-            }
-
-
+    public void loadKuaishouDataSingle() throws Exception {
+        String url = "https://a201903112120030590198943.szwego.com/static/index.html#/shop_detail/A201903112120030590198943";
+        System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
+        ChromeOptions chromeOptions = new ChromeOptions();
+//        chromeOptions.addArguments("--headless");
+        chromeOptions.addArguments("--incognito");
+        chromeOptions.addArguments("--disable-gpu");
+//        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.get(url);
+        Thread.sleep(3000L);
+        ((JavascriptExecutor) webDriver).executeScript("window.scrollTo(0,document.body.scrollHeight)");
+        Thread.sleep(3000L);
+        List<WebElement> elementList = webDriver.findElements(By.xpath("//div[@class='word-break ellipsis-two f14 g3']"));
+        for (WebElement element : elementList) {
+            System.out.println(element.getText());
         }
 
-
     }
 
     @Test
     public void testMail() throws Exception {
-        Properties properties = new Properties();
-        properties.put("mail.transport.protocol", "smtp");// 连接协议
-        properties.put("mail.smtp.host", "smtp.exmail.qq.com");// 主机名
-        properties.put("mail.smtp.port", 465);// 端口号
-        properties.put("mail.smtp.auth", "true");
-        properties.put("mail.smtp.ssl.enable", "true");// 设置是否使用ssl安全连接 ---一般都使用
-        properties.put("mail.debug", "true");// 设置是否显示debug信息 true 会在控制台显示相关信息
-        // 得到回话对象
-        Session session = Session.getInstance(properties);
-        // 获取邮件对象
-        Message message = new MimeMessage(session);
-        // 设置发件人邮箱地址
-        message.setFrom(new InternetAddress("notice@c-top.com.cn"));
-        // 设置收件人邮箱地址
-
-
-        List<String> mails = new ArrayList<>();
-        mails.add("yumengmeng@c-top.com.cn");
-        mails.add("zhuxinbo@c-top.com.cn");
-
-        InternetAddress[] internetAddresses = new InternetAddress[mails.size()];
-        for (int i = 0; i < mails.size(); i++) {
-            InternetAddress addr = new InternetAddress(mails.get(i));
-            internetAddresses[i] = addr;
-        }
 
-        message.setRecipients(Message.RecipientType.TO, internetAddresses);
-        //  message.setRecipients(Message.RecipientType.TO, new InternetAddress[]{new InternetAddress("yumengmeng@c-top.com.cn"),new InternetAddress("zhuxinbo@c-top.com.cn")});
-        //message.setRecipient(Message.RecipientType.TO, new InternetAddress("xxx@qq.com"));//一个收件人
-        // 设置邮件标题
-        message.setSubject("测试邮件");
-        // 设置邮件内容
-        message.setText("你好啊");
-        // 得到邮差对象
-        Transport transport = session.getTransport();
-        // 连接自己的邮箱账户
-        transport.connect("notice@c-top.com.cn", "Hcst@2019");// 密码为QQ邮箱开通的stmp服务后得到的客户端授权码
-        // 发送邮件
-        transport.sendMessage(message, message.getAllRecipients());
-        transport.close();
     }
 
 

+ 0 - 1
module-toutiao/pom.xml

@@ -13,7 +13,6 @@
     <artifactId>module-toutiao</artifactId>
 
     <name>module-toutiao</name>
-    <!-- FIXME change it to the project's website -->
     <url>http://www.example.com</url>
 
     <properties>

+ 0 - 1
performance-appraisal/pom.xml

@@ -12,7 +12,6 @@
     <artifactId>performance-appraisal</artifactId>
 
     <name>performance-appraisal</name>
-    <!-- FIXME change it to the project's website -->
     <url>http://www.example.com</url>
 
     <properties>

+ 0 - 13
performance-appraisal/src/test/java/cn/com/ctop/performanceappraisal/PerformanceAppraisalApplicationTests.java

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

+ 2 - 1
pom.xml

@@ -22,8 +22,9 @@
         <module>module-toutiao</module>
         <module>module-media</module>
         <module>module-report</module>
-        <module>jeecg-boot-module-system</module>
         <module>module-ctop</module>
+        <module>performance-appraisal</module>
+        <module>jeecg-boot-module-system</module>
 
     </modules>