xiexiang vor 1 Jahr
Ursprung
Commit
92a1d3915f

+ 3 - 8
pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>3.1.3</version>
+        <version>2.7.9</version>
     </parent>
 
     <groupId>cn.cslg</groupId>
@@ -16,7 +16,7 @@
     <description>常熟理工学院 专利分析系统</description>
 
     <properties>
-        <java.version>8</java.version>
+        <java.version>17</java.version>
         <jwt.version>0.9.0</jwt.version>
         <commons.io.version>2.5</commons.io.version>
         <mybatisplus.version>3.5.3.1</mybatisplus.version>
@@ -32,7 +32,6 @@
         <elasticsearch.version>8.6.1</elasticsearch.version>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
-        <java.version>17</java.version>
         <skipTests>true</skipTests>
     </properties>
 
@@ -197,7 +196,7 @@
         <dependency>
             <groupId>com.github.pagehelper</groupId>
             <artifactId>pagehelper-spring-boot-starter</artifactId>
-            <version>1.4.0</version>
+            <version>1.4.6</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -231,10 +230,6 @@
             <version>2.0.16</version>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
-        </dependency>
-        <dependency>
             <groupId>dom4j</groupId>
             <artifactId>dom4j</artifactId>
             <version>1.6.1</version>

+ 13 - 13
src/main/java/com/example/mos/MosApplication.java

@@ -7,10 +7,11 @@ import com.example.mos.weChatLogin.awt.MyImageShowFrame;
 import com.example.mos.weChatLogin.model.WxResultBody;
 import com.example.mos.weChatLogin.okhttp.MyCookieStore;
 import com.example.mos.weChatLogin.utils.HttpUtils;
-import jakarta.annotation.PostConstruct;
+//import jakarta.annotation.PostConstruct;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.context.ApplicationContext;
 import org.springframework.scheduling.annotation.EnableScheduling;
@@ -26,13 +27,12 @@ import java.util.Scanner;
 import java.util.concurrent.Callable;
 import java.util.concurrent.FutureTask;
 
-@SpringBootApplication
 @EnableScheduling
+@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
 public class MosApplication {
     @Autowired
     private MainView mainView;
 
-    //    private static MyImageShowFrame myImageShowFrame;
     public static void main(String[] args) throws IOException {
 //        ApplicationContext ctx = new SpringApplicationBuilder(MosApplication.class).headless(false).run(args);
         // 设置虚拟机参数允许图形界面操作
@@ -43,18 +43,18 @@ public class MosApplication {
         } else {
             SpringApplication.run(MosApplication.class, args);
             System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "后台程序已启动,请运行前台");
-//            // 在非 Headless 模式下运行 Swing GUI
-//            SwingUtilities.invokeLater(() -> {
-//                new MainView();
-//            });
+            // 在非 Headless 模式下运行 Swing GUI
+            SwingUtilities.invokeLater(() -> {
+                new MainView();
+            });
         }
     }
 
-    @PostConstruct
-    public void init() {
-        SwingUtilities.invokeLater(() -> {
-            mainView.setVisible(true);
-        });
-    }
+//    @PostConstruct
+//    public void init() {
+//        SwingUtilities.invokeLater(() -> {
+//            mainView.setVisible(true);
+//        });
+//    }
 
 }

+ 11 - 11
src/main/java/com/example/mos/container/MainView.java

@@ -47,17 +47,17 @@ public class MainView extends JFrame {
     public MainView() {
         setTitle("知识产权资讯监控系统");
         ArticleInfoService articleInfoService = new ArticleInfoService();
-        WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
-        List<String> fakeIds = weChatAccountInfoService.getAllFakeIds();
-        if (fakeIds != null && !fakeIds.isEmpty()) {
-            JFrame weChatFrame = new JFrame();
-            WeChatLoginHandler weChatLoginHandler = new WeChatLoginHandler();
-            try {
-                weChatLoginHandler.weChatLogin();
-            } catch (Exception e) {
-                JOptionPane.showMessageDialog(weChatFrame, "微信公众平台登陆失败!");
-            }
-        }
+//        WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+//        List<String> fakeIds = weChatAccountInfoService.getAllFakeIds();
+//        if (fakeIds != null && !fakeIds.isEmpty()) {
+//            JFrame weChatFrame = new JFrame();
+//            WeChatLoginHandler weChatLoginHandler = new WeChatLoginHandler();
+//            try {
+//                weChatLoginHandler.weChatLogin();
+//            } catch (Exception e) {
+//                JOptionPane.showMessageDialog(weChatFrame, "微信公众平台登陆失败!");
+//            }
+//        }
         //用于设置窗体关闭时的默认操作
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setLayout(new BorderLayout());

+ 1 - 0
src/main/java/com/example/mos/mapper/QuartzTaskMapper.java

@@ -2,6 +2,7 @@ package com.example.mos.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.example.mos.domain.QuartzTask;
+import org.springframework.stereotype.Repository;
 
 /**
 * @author admin

+ 50 - 37
src/main/resources/application-dev.yml

@@ -1,8 +1,22 @@
 spring:
-  rabbitmq.host: 192.168.2.24
-  rabbitmq.port: 5672
-  rabbitmq.username: admin
-  rabbitmq.password: 123456
+  rabbitmq:
+    host: 192.168.2.24
+    port: 5672
+    username: admin
+    password: 123456
+  data:
+   redis:
+     host: 192.168.2.24
+     port: 6379
+     database: 3
+     password: Xx0GWxdWQJxx6Swe
+     lettuce:
+       pool:
+         max-active: 20
+         max-idle: 20
+         min-idle: 0
+         max-wait: -1ms
+     timeout: 2000ms
   datasource:
     url: jdbc:mysql://192.168.2.24:3306/mos?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
     username: root
@@ -12,40 +26,39 @@ spring:
     druid:
       stat-view-servlet:
         login-username: admin
-        login-password: 123456
+        login-password: Cslg2022+
       web-stat-filter:
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
-
   quartz:
-  #相关属性配置
-   properties:
-    org:
-      quartz:
-        scheduler:
-          instanceName: DefaultQuartzScheduler
-          instanceId: AUTO
-        jobStore:
-          class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
-          driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
-          tablePrefix: QRTZ_
-          isClustered: false
-          clusterCheckinInterval: 10000
-          useProperties: false
-        threadPool:
-          class: org.quartz.simpl.SimpleThreadPool
-          threadCount: 10
-          threadPriority: 5
-          threadsInheritContextClassLoaderOfInitializingThread: true
-        dataSource:
-          default:
-            URL: jdbc:mysql://192.168.2.24:3306/mos?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
-            user: root
-            password: rrzTwWAYX8Gxh5JH
-            driver: com.mysql.jdbc.Driver
+    #相关属性配置
+    properties:
+      org:
+        quartz:
+          scheduler:
+            instanceName: DefaultQuartzScheduler
+            instanceId: AUTO
+          jobStore:
+            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
+            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+            tablePrefix: QRTZ_
+            isClustered: false
+            clusterCheckinInterval: 10000
+            useProperties: false
+          threadPool:
+            class: org.quartz.simpl.SimpleThreadPool
+            threadCount: 10
+            threadPriority: 5
+            threadsInheritContextClassLoaderOfInitializingThread: true
+          dataSource:
+            default:
+              URL: jdbc:mysql://192.168.2.24:3306/mos?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+              user: root
+              password: rrzTwWAYX8Gxh5JH
+              driver: com.mysql.jdbc.Driver
 
-  #数据库方式
-  job-store-type: jdbc
-  #初始化表结构
-  jdbc:
-    initialize-schema: always
-queueName: emailProd.queue
+    #数据库方式
+    job-store-type: jdbc
+    #初始化表结构
+    jdbc:
+      initialize-schema:  never
+FileSource: 1

+ 0 - 74
src/main/resources/application-dev1.yml

@@ -1,74 +0,0 @@
-spring:
-  rabbitmq:
-    host: 192.168.2.24
-    port: 5672
-    username: admin
-    password: 123456
-  data:
-   redis:
-     host: 192.168.2.24
-     port: 6379
-     database: 3
-     password: Xx0GWxdWQJxx6Swe
-     lettuce:
-       pool:
-         max-active: 20
-         max-idle: 20
-         min-idle: 0
-         max-wait: -1ms
-     timeout: 2000ms
-  datasource:
-    url: jdbc:mysql://192.168.2.24:3306/mos?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
-    username: root
-    password: rrzTwWAYX8Gxh5JH
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    type: com.alibaba.druid.pool.DruidDataSource
-    druid:
-      stat-view-servlet:
-        login-username: admin
-        login-password: Cslg2022+
-      web-stat-filter:
-        exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
-  quartz:
-    #相关属性配置
-    properties:
-      org:
-        quartz:
-          scheduler:
-            instanceName: DefaultQuartzScheduler
-            instanceId: AUTO
-          jobStore:
-            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
-            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
-            tablePrefix: QRTZ_
-            isClustered: false
-            clusterCheckinInterval: 10000
-            useProperties: false
-          threadPool:
-            class: org.quartz.simpl.SimpleThreadPool
-            threadCount: 10
-            threadPriority: 5
-            threadsInheritContextClassLoaderOfInitializingThread: true
-          dataSource:
-            default:
-              URL: jdbc:mysql://192.168.2.24:3306/mos?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
-              user: root
-              password: rrzTwWAYX8Gxh5JH
-              driver: com.mysql.jdbc.Driver
-
-    #数据库方式
-    job-store-type: jdbc
-    #初始化表结构
-    jdbc:
-      initialize-schema:  never
-authorUrl: http://localhost:8885
-PCSUrl: http://localhost:8885
-#OPSUrl: http://192.168.2.24:5001
-OPSUrl: http://139.224.24.90:5001
-PASUrl: http://localhost:8879
-FMSUrl: http://localhost:8803
-FileSource: 1
-ES:
-  patentVector: patent_vector
-  patent: wxpatent
-  config: 192.168.2.24

+ 1 - 1
src/main/resources/application.yml

@@ -23,7 +23,7 @@ spring:
       max-file-size: 1000MB
       max-request-size: 1000MB
   profiles:
-    active: dev1
+    active: dev
   jackson:
     default-property-inclusion: non_null
     serialization: