16 changed files with 555 additions and 822 deletions
@ -1,374 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
||||||
<modelVersion>4.0.0</modelVersion> |
|
||||||
<parent> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-parent</artifactId> |
|
||||||
<version>3.3.2</version> |
|
||||||
<relativePath/> <!-- lookup parent from repository --> |
|
||||||
</parent> |
|
||||||
<groupId>com.biutag</groupId> |
|
||||||
<artifactId>supervision</artifactId> |
|
||||||
<version>0.0.1-SNAPSHOT</version> |
|
||||||
<name>supervision</name> |
|
||||||
<description>长沙公安数据督察</description> |
|
||||||
<url/> |
|
||||||
<licenses> |
|
||||||
<license/> |
|
||||||
</licenses> |
|
||||||
<developers> |
|
||||||
<developer/> |
|
||||||
</developers> |
|
||||||
<scm> |
|
||||||
<connection/> |
|
||||||
<developerConnection/> |
|
||||||
<tag/> |
|
||||||
<url/> |
|
||||||
</scm> |
|
||||||
<properties> |
|
||||||
<java.version>17</java.version> |
|
||||||
</properties> |
|
||||||
<dependencies> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.jfree</groupId> |
|
||||||
<artifactId>jfreechart</artifactId> |
|
||||||
<version>1.5.4</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.deepoove</groupId> |
|
||||||
<artifactId>poi-tl</artifactId> |
|
||||||
<version>1.12.2</version> |
|
||||||
<exclusions> |
|
||||||
<exclusion> |
|
||||||
<groupId>org.apache.poi</groupId> |
|
||||||
<artifactId>poi</artifactId> |
|
||||||
</exclusion> |
|
||||||
<exclusion> |
|
||||||
<groupId>org.apache.poi</groupId> |
|
||||||
<artifactId>poi-ooxml</artifactId> |
|
||||||
</exclusion> |
|
||||||
<exclusion> |
|
||||||
<groupId>org.apache.poi</groupId> |
|
||||||
<artifactId>poi-ooxml-lite</artifactId> |
|
||||||
</exclusion> |
|
||||||
</exclusions> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.projectlombok</groupId> |
|
||||||
<artifactId>lombok</artifactId> |
|
||||||
<optional>true</optional> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- MapStruct 核心依赖 --> |
|
||||||
<dependency> |
|
||||||
<groupId>org.mapstruct</groupId> |
|
||||||
<artifactId>mapstruct</artifactId> |
|
||||||
<version>1.5.5.Final</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- MapStruct 编译期处理器 --> |
|
||||||
<dependency> |
|
||||||
<groupId>org.mapstruct</groupId> |
|
||||||
<artifactId>mapstruct-processor</artifactId> |
|
||||||
<version>1.5.5.Final</version> |
|
||||||
<scope>provided</scope> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.google.guava</groupId> |
|
||||||
<artifactId>guava</artifactId> |
|
||||||
<version>32.1.2-jre</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-web</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-validation</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-data-redis-reactive</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- 达梦数据库驱动 --> |
|
||||||
<!-- 达梦数据库驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.dameng</groupId> |
|
||||||
<artifactId>DmJdbcDriver18</artifactId> |
|
||||||
<version>8.1.3.140</version> |
|
||||||
</dependency> |
|
||||||
<!-- <dependency>--> |
|
||||||
<!-- <groupId>org.springframework.boot</groupId>--> |
|
||||||
<!-- <artifactId>spring-boot-devtools</artifactId>--> |
|
||||||
<!-- <scope>runtime</scope>--> |
|
||||||
<!-- <optional>true</optional>--> |
|
||||||
<!-- </dependency>--> |
|
||||||
|
|
||||||
|
|
||||||
<!-- mysql JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.mysql</groupId> |
|
||||||
<artifactId>mysql-connector-j</artifactId> |
|
||||||
<scope>runtime</scope> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- SQL Server JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.microsoft.sqlserver</groupId> |
|
||||||
<artifactId>mssql-jdbc</artifactId> |
|
||||||
<version>12.8.1.jre11</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>javax.xml.bind</groupId> |
|
||||||
<artifactId>jaxb-api</artifactId> |
|
||||||
<version>2.3.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.sun.xml.bind</groupId> |
|
||||||
<artifactId>jaxb-impl</artifactId> |
|
||||||
<version>2.3.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.sun.xml.bind</groupId> |
|
||||||
<artifactId>jaxb-core</artifactId> |
|
||||||
<version>2.3.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>javax.activation</groupId> |
|
||||||
<artifactId>activation</artifactId> |
|
||||||
<version>1.1.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- gbase数据库 JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.gbase</groupId> |
|
||||||
<artifactId>gbase-jdbc</artifactId> |
|
||||||
<scope>system</scope> |
|
||||||
<version>8.3.81.53-build55.2.1-bin</version> |
|
||||||
<systemPath>${project.basedir}/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar</systemPath> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- dm数据库 JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.dameng</groupId> |
|
||||||
<artifactId>DmJdbcDriver18</artifactId> |
|
||||||
<version>8.1.3.140</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- postgresql JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>org.postgresql</groupId> |
|
||||||
<artifactId>postgresql</artifactId> |
|
||||||
<version>42.7.4</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.alibaba</groupId> |
|
||||||
<artifactId>druid-spring-boot-starter</artifactId> |
|
||||||
<version>1.2.22</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.projectlombok</groupId> |
|
||||||
<artifactId>lombok</artifactId> |
|
||||||
<optional>true</optional> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-test</artifactId> |
|
||||||
<scope>test</scope> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.baomidou</groupId> |
|
||||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
|
||||||
<version>3.5.7</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.alibaba</groupId> |
|
||||||
<artifactId>easyexcel</artifactId> |
|
||||||
<version>4.0.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>commons-io</groupId> |
|
||||||
<artifactId>commons-io</artifactId> |
|
||||||
<version>2.17.0</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-all</artifactId> |
|
||||||
<version>5.8.29</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-core</artifactId> |
|
||||||
<version>5.8.29</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-http</artifactId> |
|
||||||
<version>5.8.29</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.baomidou</groupId> |
|
||||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId> |
|
||||||
<version>4.3.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.freemarker</groupId> |
|
||||||
<artifactId>freemarker</artifactId> |
|
||||||
<version>2.3.32</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.security</groupId> |
|
||||||
<artifactId>spring-security-crypto</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.github.tobato</groupId> |
|
||||||
<artifactId>fastdfs-client</artifactId> |
|
||||||
<version>1.27.2</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!--knife4j--> |
|
||||||
<dependency> |
|
||||||
<groupId>com.github.xiaoymin</groupId> |
|
||||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId> |
|
||||||
<version>4.1.0</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.alibaba</groupId> |
|
||||||
<artifactId>fastjson</artifactId> |
|
||||||
<version>2.0.53</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>net.logstash.logback</groupId> |
|
||||||
<artifactId>logstash-logback-encoder</artifactId> |
|
||||||
<version>4.9</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- word转换 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.aspose</groupId> |
|
||||||
<artifactId>aspose-words</artifactId> |
|
||||||
<version>15.8.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- 数字证书 --> |
|
||||||
<dependency> |
|
||||||
<groupId>cn.com.jit</groupId> |
|
||||||
<artifactId>authSDK</artifactId> |
|
||||||
<version>3.0.3</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>commons-httpclient</groupId> |
|
||||||
<artifactId>commons-httpclient</artifactId> |
|
||||||
<version>3.0.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.jsoup</groupId> |
|
||||||
<artifactId>jsoup</artifactId> |
|
||||||
<version>1.17.2</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
</dependencies> |
|
||||||
|
|
||||||
<build> |
|
||||||
<resources> |
|
||||||
<resource> |
|
||||||
<directory>src/main/resources</directory> |
|
||||||
<filtering>false</filtering> |
|
||||||
<!-- 本地跑时改成true,打包时改成false--> |
|
||||||
</resource> |
|
||||||
<resource> |
|
||||||
<directory>src/main/resources</directory> |
|
||||||
<includes> |
|
||||||
<include>application.yml</include> |
|
||||||
</includes> |
|
||||||
<filtering>true</filtering> |
|
||||||
</resource> |
|
||||||
</resources> |
|
||||||
|
|
||||||
<plugins> |
|
||||||
<plugin> |
|
||||||
<!--打包跳过测试--> |
|
||||||
<groupId>org.apache.maven.plugins</groupId> |
|
||||||
<artifactId>maven-surefire-plugin</artifactId> |
|
||||||
<version>3.2.5</version> |
|
||||||
<configuration> |
|
||||||
<skipTests>false</skipTests> |
|
||||||
</configuration> |
|
||||||
</plugin> |
|
||||||
<plugin> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId> |
|
||||||
<configuration> |
|
||||||
<includeSystemScope>true</includeSystemScope> |
|
||||||
<excludes> |
|
||||||
<exclude> |
|
||||||
<groupId>org.projectlombok</groupId> |
|
||||||
<artifactId>lombok</artifactId> |
|
||||||
</exclude> |
|
||||||
</excludes> |
|
||||||
</configuration> |
|
||||||
</plugin> |
|
||||||
</plugins> |
|
||||||
|
|
||||||
<finalName>supervision</finalName> |
|
||||||
</build> |
|
||||||
|
|
||||||
<profiles> |
|
||||||
<profile> |
|
||||||
<id>local</id> |
|
||||||
<properties> |
|
||||||
<!-- 环境标识,需要与配置文件的名称相对应 --> |
|
||||||
<profiles.active>local</profiles.active> |
|
||||||
</properties> |
|
||||||
|
|
||||||
<activation> |
|
||||||
<!-- 默认环境 --> |
|
||||||
<activeByDefault>true</activeByDefault> |
|
||||||
</activation> |
|
||||||
</profile> |
|
||||||
<profile> |
|
||||||
<id>dev</id> |
|
||||||
<properties> |
|
||||||
<!-- 环境标识,需要与配置文件的名称相对应 --> |
|
||||||
<profiles.active>dev</profiles.active> |
|
||||||
</properties> |
|
||||||
</profile> |
|
||||||
<profile> |
|
||||||
<id>prod</id> |
|
||||||
<properties> |
|
||||||
<profiles.active>prod</profiles.active> |
|
||||||
</properties> |
|
||||||
</profile> |
|
||||||
</profiles> |
|
||||||
|
|
||||||
</project> |
|
||||||
@ -1,374 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
||||||
<modelVersion>4.0.0</modelVersion> |
|
||||||
<parent> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-parent</artifactId> |
|
||||||
<version>3.3.2</version> |
|
||||||
<relativePath/> <!-- lookup parent from repository --> |
|
||||||
</parent> |
|
||||||
<groupId>com.biutag</groupId> |
|
||||||
<artifactId>supervision</artifactId> |
|
||||||
<version>0.0.1-SNAPSHOT</version> |
|
||||||
<name>supervision</name> |
|
||||||
<description>长沙公安数据督察</description> |
|
||||||
<url/> |
|
||||||
<licenses> |
|
||||||
<license/> |
|
||||||
</licenses> |
|
||||||
<developers> |
|
||||||
<developer/> |
|
||||||
</developers> |
|
||||||
<scm> |
|
||||||
<connection/> |
|
||||||
<developerConnection/> |
|
||||||
<tag/> |
|
||||||
<url/> |
|
||||||
</scm> |
|
||||||
<properties> |
|
||||||
<java.version>17</java.version> |
|
||||||
</properties> |
|
||||||
<dependencies> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.jfree</groupId> |
|
||||||
<artifactId>jfreechart</artifactId> |
|
||||||
<version>1.5.4</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.deepoove</groupId> |
|
||||||
<artifactId>poi-tl</artifactId> |
|
||||||
<version>1.12.2</version> |
|
||||||
<exclusions> |
|
||||||
<exclusion> |
|
||||||
<groupId>org.apache.poi</groupId> |
|
||||||
<artifactId>poi</artifactId> |
|
||||||
</exclusion> |
|
||||||
<exclusion> |
|
||||||
<groupId>org.apache.poi</groupId> |
|
||||||
<artifactId>poi-ooxml</artifactId> |
|
||||||
</exclusion> |
|
||||||
<exclusion> |
|
||||||
<groupId>org.apache.poi</groupId> |
|
||||||
<artifactId>poi-ooxml-lite</artifactId> |
|
||||||
</exclusion> |
|
||||||
</exclusions> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.projectlombok</groupId> |
|
||||||
<artifactId>lombok</artifactId> |
|
||||||
<optional>true</optional> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- MapStruct 核心依赖 --> |
|
||||||
<dependency> |
|
||||||
<groupId>org.mapstruct</groupId> |
|
||||||
<artifactId>mapstruct</artifactId> |
|
||||||
<version>1.5.5.Final</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- MapStruct 编译期处理器 --> |
|
||||||
<dependency> |
|
||||||
<groupId>org.mapstruct</groupId> |
|
||||||
<artifactId>mapstruct-processor</artifactId> |
|
||||||
<version>1.5.5.Final</version> |
|
||||||
<scope>provided</scope> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.google.guava</groupId> |
|
||||||
<artifactId>guava</artifactId> |
|
||||||
<version>32.1.2-jre</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-web</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-validation</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-data-redis-reactive</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- 达梦数据库驱动 --> |
|
||||||
<!-- 达梦数据库驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.dameng</groupId> |
|
||||||
<artifactId>DmJdbcDriver18</artifactId> |
|
||||||
<version>8.1.3.140</version> |
|
||||||
</dependency> |
|
||||||
<!-- <dependency>--> |
|
||||||
<!-- <groupId>org.springframework.boot</groupId>--> |
|
||||||
<!-- <artifactId>spring-boot-devtools</artifactId>--> |
|
||||||
<!-- <scope>runtime</scope>--> |
|
||||||
<!-- <optional>true</optional>--> |
|
||||||
<!-- </dependency>--> |
|
||||||
|
|
||||||
|
|
||||||
<!-- mysql JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.mysql</groupId> |
|
||||||
<artifactId>mysql-connector-j</artifactId> |
|
||||||
<scope>runtime</scope> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- SQL Server JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.microsoft.sqlserver</groupId> |
|
||||||
<artifactId>mssql-jdbc</artifactId> |
|
||||||
<version>12.8.1.jre11</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>javax.xml.bind</groupId> |
|
||||||
<artifactId>jaxb-api</artifactId> |
|
||||||
<version>2.3.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.sun.xml.bind</groupId> |
|
||||||
<artifactId>jaxb-impl</artifactId> |
|
||||||
<version>2.3.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.sun.xml.bind</groupId> |
|
||||||
<artifactId>jaxb-core</artifactId> |
|
||||||
<version>2.3.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>javax.activation</groupId> |
|
||||||
<artifactId>activation</artifactId> |
|
||||||
<version>1.1.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- gbase数据库 JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.gbase</groupId> |
|
||||||
<artifactId>gbase-jdbc</artifactId> |
|
||||||
<scope>system</scope> |
|
||||||
<version>8.3.81.53-build55.2.1-bin</version> |
|
||||||
<systemPath>${project.basedir}/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar</systemPath> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- dm数据库 JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.dameng</groupId> |
|
||||||
<artifactId>DmJdbcDriver18</artifactId> |
|
||||||
<version>8.1.3.140</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- postgresql JDBC驱动 --> |
|
||||||
<dependency> |
|
||||||
<groupId>org.postgresql</groupId> |
|
||||||
<artifactId>postgresql</artifactId> |
|
||||||
<version>42.7.4</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.alibaba</groupId> |
|
||||||
<artifactId>druid-spring-boot-starter</artifactId> |
|
||||||
<version>1.2.22</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.projectlombok</groupId> |
|
||||||
<artifactId>lombok</artifactId> |
|
||||||
<optional>true</optional> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-test</artifactId> |
|
||||||
<scope>test</scope> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.baomidou</groupId> |
|
||||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
|
||||||
<version>3.5.7</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.alibaba</groupId> |
|
||||||
<artifactId>easyexcel</artifactId> |
|
||||||
<version>4.0.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>commons-io</groupId> |
|
||||||
<artifactId>commons-io</artifactId> |
|
||||||
<version>2.17.0</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-all</artifactId> |
|
||||||
<version>5.8.29</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-core</artifactId> |
|
||||||
<version>5.8.29</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>cn.hutool</groupId> |
|
||||||
<artifactId>hutool-http</artifactId> |
|
||||||
<version>5.8.29</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.baomidou</groupId> |
|
||||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId> |
|
||||||
<version>4.3.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.freemarker</groupId> |
|
||||||
<artifactId>freemarker</artifactId> |
|
||||||
<version>2.3.32</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.security</groupId> |
|
||||||
<artifactId>spring-security-crypto</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.github.tobato</groupId> |
|
||||||
<artifactId>fastdfs-client</artifactId> |
|
||||||
<version>1.27.2</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!--knife4j--> |
|
||||||
<dependency> |
|
||||||
<groupId>com.github.xiaoymin</groupId> |
|
||||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId> |
|
||||||
<version>4.1.0</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>com.alibaba</groupId> |
|
||||||
<artifactId>fastjson</artifactId> |
|
||||||
<version>2.0.53</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>net.logstash.logback</groupId> |
|
||||||
<artifactId>logstash-logback-encoder</artifactId> |
|
||||||
<version>4.9</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- word转换 --> |
|
||||||
<dependency> |
|
||||||
<groupId>com.aspose</groupId> |
|
||||||
<artifactId>aspose-words</artifactId> |
|
||||||
<version>15.8.0</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<!-- 数字证书 --> |
|
||||||
<dependency> |
|
||||||
<groupId>cn.com.jit</groupId> |
|
||||||
<artifactId>authSDK</artifactId> |
|
||||||
<version>3.0.3</version> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>commons-httpclient</groupId> |
|
||||||
<artifactId>commons-httpclient</artifactId> |
|
||||||
<version>3.0.1</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.jsoup</groupId> |
|
||||||
<artifactId>jsoup</artifactId> |
|
||||||
<version>1.17.2</version> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
</dependencies> |
|
||||||
|
|
||||||
<build> |
|
||||||
<resources> |
|
||||||
<resource> |
|
||||||
<directory>src/main/resources</directory> |
|
||||||
<filtering>false</filtering> |
|
||||||
<!-- 本地跑时改成true,打包时改成false--> |
|
||||||
</resource> |
|
||||||
<resource> |
|
||||||
<directory>src/main/resources</directory> |
|
||||||
<includes> |
|
||||||
<include>application.yml</include> |
|
||||||
</includes> |
|
||||||
<filtering>true</filtering> |
|
||||||
</resource> |
|
||||||
</resources> |
|
||||||
|
|
||||||
<plugins> |
|
||||||
<plugin> |
|
||||||
<!--打包跳过测试--> |
|
||||||
<groupId>org.apache.maven.plugins</groupId> |
|
||||||
<artifactId>maven-surefire-plugin</artifactId> |
|
||||||
<version>3.2.5</version> |
|
||||||
<configuration> |
|
||||||
<skipTests>false</skipTests> |
|
||||||
</configuration> |
|
||||||
</plugin> |
|
||||||
<plugin> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId> |
|
||||||
<configuration> |
|
||||||
<includeSystemScope>true</includeSystemScope> |
|
||||||
<excludes> |
|
||||||
<exclude> |
|
||||||
<groupId>org.projectlombok</groupId> |
|
||||||
<artifactId>lombok</artifactId> |
|
||||||
</exclude> |
|
||||||
</excludes> |
|
||||||
</configuration> |
|
||||||
</plugin> |
|
||||||
</plugins> |
|
||||||
|
|
||||||
<finalName>supervision</finalName> |
|
||||||
</build> |
|
||||||
|
|
||||||
<profiles> |
|
||||||
<profile> |
|
||||||
<id>local</id> |
|
||||||
<properties> |
|
||||||
<!-- 环境标识,需要与配置文件的名称相对应 --> |
|
||||||
<profiles.active>local</profiles.active> |
|
||||||
</properties> |
|
||||||
|
|
||||||
<activation> |
|
||||||
<!-- 默认环境 --> |
|
||||||
<activeByDefault>true</activeByDefault> |
|
||||||
</activation> |
|
||||||
</profile> |
|
||||||
<profile> |
|
||||||
<id>dev</id> |
|
||||||
<properties> |
|
||||||
<!-- 环境标识,需要与配置文件的名称相对应 --> |
|
||||||
<profiles.active>dev</profiles.active> |
|
||||||
</properties> |
|
||||||
</profile> |
|
||||||
<profile> |
|
||||||
<id>prod</id> |
|
||||||
<properties> |
|
||||||
<profiles.active>prod</profiles.active> |
|
||||||
</properties> |
|
||||||
</profile> |
|
||||||
</profiles> |
|
||||||
|
|
||||||
</project> |
|
||||||
@ -0,0 +1,43 @@ |
|||||||
|
-- MySQL 5.7.21:只读核查关联字段,不查询业务明细。 |
||||||
|
-- 在 result.txt 对应的业务库执行,返回全部结果集。 |
||||||
|
SELECT VERSION(), DATABASE(), @@character_set_connection, @@collation_connection; |
||||||
|
|
||||||
|
SELECT TABLE_NAME, COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, |
||||||
|
CHARACTER_SET_NAME, COLLATION_NAME, COLUMN_KEY |
||||||
|
FROM information_schema.COLUMNS |
||||||
|
WHERE TABLE_SCHEMA = DATABASE() |
||||||
|
AND ( |
||||||
|
(TABLE_NAME = 'negative' AND COLUMN_NAME IN ('id', 'involveDepartId', 'crtTime', 'discoveryTime', 'processing_status', 'checkStatus')) |
||||||
|
OR (TABLE_NAME = 'negative_blame' AND COLUMN_NAME IN ('negativeId', 'blameIdCode', 'type')) |
||||||
|
OR (TABLE_NAME = 'sup_depart' AND COLUMN_NAME IN ('id', 'pid')) |
||||||
|
OR (TABLE_NAME = 'sup_depart_police_size' AND COLUMN_NAME = 'depart_id') |
||||||
|
OR (TABLE_NAME = 'sup_police' AND COLUMN_NAME IN ('id_code', 'org_id', 'del')) |
||||||
|
) |
||||||
|
ORDER BY TABLE_NAME, ORDINAL_POSITION; |
||||||
|
|
||||||
|
-- JSON 计划中的 attached_condition 可显示隐式转换,SHOW WARNINGS 紧随 EXPLAIN 执行。 |
||||||
|
EXPLAIN FORMAT=JSON |
||||||
|
SELECT n.id, nb.blameIdCode |
||||||
|
FROM negative n |
||||||
|
LEFT JOIN negative_blame nb ON nb.negativeId = n.id |
||||||
|
WHERE n.crtTime BETWEEN '1949-01-01 00:00:00' AND NOW() |
||||||
|
LIMIT 10; |
||||||
|
SHOW WARNINGS; |
||||||
|
|
||||||
|
EXPLAIN FORMAT=JSON |
||||||
|
SELECT d.id, p.police_size |
||||||
|
FROM sup_depart d |
||||||
|
LEFT JOIN sup_depart_police_size p ON p.depart_id = d.id |
||||||
|
WHERE d.level = 3 |
||||||
|
LIMIT 10; |
||||||
|
SHOW WARNINGS; |
||||||
|
|
||||||
|
EXPLAIN FORMAT=JSON |
||||||
|
SELECT d.id |
||||||
|
FROM sup_depart d |
||||||
|
WHERE d.level = 3 AND EXISTS ( |
||||||
|
SELECT 1 FROM negative n |
||||||
|
WHERE n.involveDepartId = d.id |
||||||
|
AND n.crtTime BETWEEN '1949-01-01 00:00:00' AND NOW() |
||||||
|
); |
||||||
|
SHOW WARNINGS; |
||||||
@ -0,0 +1,256 @@ |
|||||||
|
-- MySQL 5.7.21:result1.txt 确认类型/字符集不一致后的复测,无 DDL、无业务数据修改。 |
||||||
|
-- 步骤一:先单独执行以下检查。affected_rows 必须全部为 0,才部署新版单位查询。 |
||||||
|
-- 非零时请返回计数,先处理编号语义差异,不要直接部署。 |
||||||
|
SELECT 'negative.involveDepartId 非标准编号' AS check_item, COUNT(*) AS affected_rows |
||||||
|
FROM negative n JOIN sup_depart d ON n.involveDepartId = d.id |
||||||
|
WHERE d.level = 3 |
||||||
|
AND NOT (n.involveDepartId = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci) |
||||||
|
UNION ALL |
||||||
|
SELECT 'sup_depart_police_size.depart_id 非标准编号', COUNT(*) |
||||||
|
FROM sup_depart_police_size p JOIN sup_depart d ON p.depart_id = d.id |
||||||
|
WHERE d.level = 3 |
||||||
|
AND NOT (p.depart_id = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci) |
||||||
|
UNION ALL |
||||||
|
SELECT 'negative.id 无法无损转成 utf8', COUNT(*) |
||||||
|
FROM negative |
||||||
|
WHERE BINARY id <> BINARY CONVERT(CONVERT(id USING utf8) USING utf8mb4); |
||||||
|
|
||||||
|
-- 步骤二:以上计数全为 0 后,执行下列 EXPLAIN 和实际查询。 |
||||||
|
-- 预期:nb 不再全索引扫描+Block Nested Loop,p 使用主键,单位总数中的 n 使用单位索引。 |
||||||
|
-- 查询时间仍需实测;请返回四份 EXPLAIN 和 SHOW PROFILES 的耗时,无需返回人员明细。 |
||||||
|
SET @beginTime = '1949-01-01 00:00:00'; |
||||||
|
SET @endTime = NOW(); |
||||||
|
SET profiling = 1; |
||||||
|
|
||||||
|
-- 单位问题库:优化后列表查询(第一页 10 条) |
||||||
|
EXPLAIN |
||||||
|
SELECT DISTINCT |
||||||
|
d.id depart_id, |
||||||
|
d1.short_name parent_depart_name, |
||||||
|
d.short_name depart_name, |
||||||
|
p.police_size, |
||||||
|
p.aux_size, |
||||||
|
stats.verify_police_size, |
||||||
|
stats.verify_size |
||||||
|
FROM ( |
||||||
|
SELECT d.id depart_id, |
||||||
|
count(DISTINCT nb.blameIdCode) verify_police_size, |
||||||
|
count(DISTINCT n.id) verify_size |
||||||
|
FROM sup_depart d |
||||||
|
INNER JOIN negative n ON n.involveDepartId = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
LEFT JOIN negative_blame nb ON nb.negativeId = CONVERT(n.id USING utf8) COLLATE utf8_general_ci |
||||||
|
WHERE |
||||||
|
d.level = 3 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AND n.crtTime BETWEEN @beginTime AND @endTime |
||||||
|
GROUP BY d.id |
||||||
|
) stats |
||||||
|
INNER JOIN sup_depart d ON d.id = stats.depart_id |
||||||
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id |
||||||
|
LEFT JOIN sup_depart_police_size p ON p.depart_id = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
ORDER BY |
||||||
|
verify_size |
||||||
|
DESC , d.id ASC |
||||||
|
LIMIT 0, 10; |
||||||
|
SHOW WARNINGS; |
||||||
|
|
||||||
|
SELECT SQL_NO_CACHE DISTINCT |
||||||
|
d.id depart_id, |
||||||
|
d1.short_name parent_depart_name, |
||||||
|
d.short_name depart_name, |
||||||
|
p.police_size, |
||||||
|
p.aux_size, |
||||||
|
stats.verify_police_size, |
||||||
|
stats.verify_size |
||||||
|
FROM ( |
||||||
|
SELECT d.id depart_id, |
||||||
|
count(DISTINCT nb.blameIdCode) verify_police_size, |
||||||
|
count(DISTINCT n.id) verify_size |
||||||
|
FROM sup_depart d |
||||||
|
INNER JOIN negative n ON n.involveDepartId = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
LEFT JOIN negative_blame nb ON nb.negativeId = CONVERT(n.id USING utf8) COLLATE utf8_general_ci |
||||||
|
WHERE |
||||||
|
d.level = 3 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AND n.crtTime BETWEEN @beginTime AND @endTime |
||||||
|
GROUP BY d.id |
||||||
|
) stats |
||||||
|
INNER JOIN sup_depart d ON d.id = stats.depart_id |
||||||
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id |
||||||
|
LEFT JOIN sup_depart_police_size p ON p.depart_id = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
ORDER BY |
||||||
|
verify_size |
||||||
|
DESC , d.id ASC |
||||||
|
LIMIT 0, 10; |
||||||
|
|
||||||
|
-- 单位问题库:优化后分页总数 |
||||||
|
EXPLAIN |
||||||
|
SELECT count(*) FROM ( |
||||||
|
SELECT DISTINCT d.id, p.police_size, p.aux_size |
||||||
|
FROM sup_depart d |
||||||
|
LEFT JOIN sup_depart_police_size p ON p.depart_id = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
WHERE |
||||||
|
d.level = 3 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 FROM negative n |
||||||
|
WHERE n.involveDepartId = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
AND n.crtTime BETWEEN @beginTime AND @endTime |
||||||
|
) |
||||||
|
) counted; |
||||||
|
SHOW WARNINGS; |
||||||
|
|
||||||
|
SELECT SQL_NO_CACHE count(*) FROM ( |
||||||
|
SELECT DISTINCT d.id, p.police_size, p.aux_size |
||||||
|
FROM sup_depart d |
||||||
|
LEFT JOIN sup_depart_police_size p ON p.depart_id = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
WHERE |
||||||
|
d.level = 3 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 FROM negative n |
||||||
|
WHERE n.involveDepartId = CAST(d.id AS CHAR CHARACTER SET utf8) COLLATE utf8_general_ci |
||||||
|
AND n.crtTime BETWEEN @beginTime AND @endTime |
||||||
|
) |
||||||
|
) counted; |
||||||
|
|
||||||
|
-- 个人问题库:优化后列表查询(第一页 10 条) |
||||||
|
EXPLAIN |
||||||
|
SELECT DISTINCT |
||||||
|
p.id_code, p.name, p.emp_no, p.position, p.employment_date, p.person_type, |
||||||
|
d.short_name depart_name, d.id depart_id, d1.short_name parent_depart_name |
||||||
|
, stats.verify_size |
||||||
|
FROM ( |
||||||
|
SELECT nb.blameIdCode, count(DISTINCT n.id) verify_size |
||||||
|
FROM negative n |
||||||
|
INNER JOIN negative_blame nb ON nb.negativeId = n.id |
||||||
|
WHERE |
||||||
|
nb.type = 'personal' |
||||||
|
AND n.checkStatus IN ('1', '2') |
||||||
|
AND n.processing_status = 'completed' |
||||||
|
AND n.discoveryTime BETWEEN @beginTime AND @endTime |
||||||
|
|
||||||
|
GROUP BY nb.blameIdCode |
||||||
|
) stats |
||||||
|
INNER JOIN sup_police p ON p.id_code = stats.blameIdCode |
||||||
|
LEFT JOIN sup_depart d ON p.org_id = d.id |
||||||
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id AND d1.level >= 2 |
||||||
|
WHERE |
||||||
|
p.del = 0 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ORDER BY verify_size |
||||||
|
DESC , p.id_code ASC |
||||||
|
LIMIT 0, 10; |
||||||
|
SHOW WARNINGS; |
||||||
|
|
||||||
|
SELECT SQL_NO_CACHE DISTINCT |
||||||
|
p.id_code, p.name, p.emp_no, p.position, p.employment_date, p.person_type, |
||||||
|
d.short_name depart_name, d.id depart_id, d1.short_name parent_depart_name |
||||||
|
, stats.verify_size |
||||||
|
FROM ( |
||||||
|
SELECT nb.blameIdCode, count(DISTINCT n.id) verify_size |
||||||
|
FROM negative n |
||||||
|
INNER JOIN negative_blame nb ON nb.negativeId = n.id |
||||||
|
WHERE |
||||||
|
nb.type = 'personal' |
||||||
|
AND n.checkStatus IN ('1', '2') |
||||||
|
AND n.processing_status = 'completed' |
||||||
|
AND n.discoveryTime BETWEEN @beginTime AND @endTime |
||||||
|
|
||||||
|
GROUP BY nb.blameIdCode |
||||||
|
) stats |
||||||
|
INNER JOIN sup_police p ON p.id_code = stats.blameIdCode |
||||||
|
LEFT JOIN sup_depart d ON p.org_id = d.id |
||||||
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id AND d1.level >= 2 |
||||||
|
WHERE |
||||||
|
p.del = 0 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ORDER BY verify_size |
||||||
|
DESC , p.id_code ASC |
||||||
|
LIMIT 0, 10; |
||||||
|
|
||||||
|
-- 个人问题库:优化后分页总数 |
||||||
|
EXPLAIN |
||||||
|
SELECT count(*) FROM ( |
||||||
|
SELECT DISTINCT |
||||||
|
p.id_code, p.name, p.emp_no, p.position, p.employment_date, p.person_type, |
||||||
|
d.short_name depart_name, d.id depart_id, d1.short_name parent_depart_name |
||||||
|
|
||||||
|
FROM sup_police p |
||||||
|
LEFT JOIN sup_depart d ON p.org_id = d.id |
||||||
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id AND d1.level >= 2 |
||||||
|
WHERE |
||||||
|
p.del = 0 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 FROM negative_blame nb |
||||||
|
WHERE nb.blameIdCode = p.id_code AND nb.type = 'personal' |
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 FROM negative n |
||||||
|
WHERE n.id = nb.negativeId |
||||||
|
AND |
||||||
|
n.checkStatus IN ('1', '2') |
||||||
|
AND n.processing_status = 'completed' |
||||||
|
AND n.discoveryTime BETWEEN @beginTime AND @endTime |
||||||
|
|
||||||
|
) |
||||||
|
) |
||||||
|
) counted; |
||||||
|
SHOW WARNINGS; |
||||||
|
|
||||||
|
SELECT SQL_NO_CACHE count(*) FROM ( |
||||||
|
SELECT DISTINCT |
||||||
|
p.id_code, p.name, p.emp_no, p.position, p.employment_date, p.person_type, |
||||||
|
d.short_name depart_name, d.id depart_id, d1.short_name parent_depart_name |
||||||
|
|
||||||
|
FROM sup_police p |
||||||
|
LEFT JOIN sup_depart d ON p.org_id = d.id |
||||||
|
LEFT JOIN sup_depart d1 ON d.pid = d1.id AND d1.level >= 2 |
||||||
|
WHERE |
||||||
|
p.del = 0 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 FROM negative_blame nb |
||||||
|
WHERE nb.blameIdCode = p.id_code AND nb.type = 'personal' |
||||||
|
AND EXISTS ( |
||||||
|
SELECT 1 FROM negative n |
||||||
|
WHERE n.id = nb.negativeId |
||||||
|
AND |
||||||
|
n.checkStatus IN ('1', '2') |
||||||
|
AND n.processing_status = 'completed' |
||||||
|
AND n.discoveryTime BETWEEN @beginTime AND @endTime |
||||||
|
|
||||||
|
) |
||||||
|
) |
||||||
|
) counted; |
||||||
|
|
||||||
|
SHOW PROFILES; |
||||||
|
SET profiling = 0; |
||||||
@ -0,0 +1,56 @@ |
|||||||
|
package com.biutag.supervision.controller; |
||||||
|
|
||||||
|
import com.biutag.supervision.controller.sensitiveperception.ProfileDepartController; |
||||||
|
import com.biutag.supervision.mapper.ProfileDepartMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.Negative; |
||||||
|
import com.biutag.supervision.service.*; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
import org.junit.jupiter.api.extension.ExtendWith; |
||||||
|
import org.mockito.InjectMocks; |
||||||
|
import org.mockito.Mock; |
||||||
|
import org.mockito.junit.jupiter.MockitoExtension; |
||||||
|
|
||||||
|
import java.util.Arrays; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
||||||
|
import static org.mockito.Mockito.when; |
||||||
|
import static org.mockito.Mockito.verify; |
||||||
|
|
||||||
|
@ExtendWith(MockitoExtension.class) |
||||||
|
class ProfileDepartComplaintCountTest { |
||||||
|
@Mock ProfileDepartMapper mapper; |
||||||
|
@Mock SupDepartService departService; |
||||||
|
@Mock SupPoliceService policeService; |
||||||
|
@Mock NegativeService negativeService; |
||||||
|
@Mock BusinessDepartService businessDepartService; |
||||||
|
@Mock NegativeScoreDepartService scoreService; |
||||||
|
@Mock NegativeProblemRelationService relationService; |
||||||
|
@Mock SupDepartPoliceSizeService sizeService; |
||||||
|
@Mock NegativeBlameService blameService; |
||||||
|
@InjectMocks ProfileDepartController controller; |
||||||
|
|
||||||
|
@Test |
||||||
|
void countsAllComplaintChildrenButNotOtherOrMissingSources() { |
||||||
|
Date begin = new Date(0); |
||||||
|
Date end = new Date(1000); |
||||||
|
List<Negative> negatives = Arrays.asList("21", "22", "23", "24", "25", "21", "17", "9", "", null) |
||||||
|
.stream().map(source -> { |
||||||
|
Negative negative = new Negative(); |
||||||
|
negative.setId("problem-" + source); |
||||||
|
negative.setProblemSourcesCode(source); |
||||||
|
return negative; |
||||||
|
}).toList(); |
||||||
|
when(mapper.selectDepartProblems("depart-1", begin, end)).thenReturn(negatives); |
||||||
|
|
||||||
|
assertEquals(6, controller.profile("depart-1", begin, end).getData().getComplaintCount()); |
||||||
|
verify(mapper).selectDepartProblems("depart-1", begin, end); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
void emptyDepartmentReturnsZero() { |
||||||
|
assertEquals(0, controller.profile("empty-depart", new Date(0), new Date(1000)) |
||||||
|
.getData().getComplaintCount()); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue