Commit ba76c7eb authored by frank.xa.zhang's avatar frank.xa.zhang

Merge branch 'dev' into dev_frank

parents ac09da2d d7aaf7ed
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>pwc.taxtech.atms</groupId> <groupId>pwc.taxtech.atms</groupId>
<artifactId>atms-api</artifactId> <artifactId>atms-api</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>0.1.1</version> <version>0.1.1</version>
<properties> <properties>
<maven.test.skip>false</maven.test.skip> <maven.test.skip>false</maven.test.skip>
<maven.test.failure.ignore>false</maven.test.failure.ignore> <maven.test.failure.ignore>false</maven.test.failure.ignore>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<!-- hibernate versions starts --> <!-- hibernate versions starts -->
<!-- hibernate versions ends --> <!-- hibernate versions ends -->
<!-- cxf version --> <!-- cxf version -->
<spring.version>4.3.13.RELEASE</spring.version> <spring.version>4.3.13.RELEASE</spring.version>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version> <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<database_driver_scope>runtime</database_driver_scope> <database_driver_scope>runtime</database_driver_scope>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss z</maven.build.timestamp.format> <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss z</maven.build.timestamp.format>
<timestamp>${maven.build.timestamp}</timestamp> <timestamp>${maven.build.timestamp}</timestamp>
<sonar.exclusions>**/*Mapper.*,**/*Example.*,**/*Test.java,**/*IT.java,**/*Dto.java,**/atms/entitiy/**/*.java,**/atms/thirdparty/**/*.java,**/atms/common/message/**/*.java,**/atms/dto/**/*.java,**/atms/constant/**/*.java</sonar.exclusions> <sonar.exclusions>
</properties> **/*Mapper.*,**/*Example.*,**/*Test.java,**/*IT.java,**/*Dto.java,**/atms/entitiy/**/*.java,**/atms/thirdparty/**/*.java,**/atms/common/message/**/*.java,**/atms/dto/**/*.java,**/atms/constant/**/*.java
</sonar.exclusions>
</properties>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId> <artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId> <artifactId>spring-context-support</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId> <artifactId>spring-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId> <artifactId>spring-jdbc</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId> <artifactId>spring-aspects</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId> <artifactId>spring-data-commons</artifactId>
<version>1.13.8.RELEASE</version> <version>1.13.8.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId> <artifactId>spring-security-config</artifactId>
<version>4.2.3.RELEASE</version> <version>4.2.3.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId> <artifactId>spring-security-taglibs</artifactId>
<version>4.2.3.RELEASE</version> <version>4.2.3.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId> <artifactId>spring-security-web</artifactId>
<version>4.2.3.RELEASE</version> <version>4.2.3.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version> <version>2.8.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId> <artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version> <version>2.8.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId> <artifactId>jjwt</artifactId>
<version>0.9.0</version> <version>0.9.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.9.4</version> <version>2.9.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId> <artifactId>mybatis</artifactId>
<version>3.4.5</version> <version>3.4.5</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId> <artifactId>mybatis-spring</artifactId>
<version>1.3.1</version> <version>1.3.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId> <artifactId>pagehelper</artifactId>
<version>5.1.2</version> <version>5.1.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-fileupload</groupId> <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId> <artifactId>commons-fileupload</artifactId>
<version>1.3.3</version> <version>1.3.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.6</version> <version>2.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version> <version>1.7.25</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId> <artifactId>thymeleaf</artifactId>
<version>${thymeleaf.version}</version> <version>${thymeleaf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId> <artifactId>thymeleaf-spring4</artifactId>
<version>${thymeleaf.version}</version> <version>${thymeleaf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.thymeleaf.extras</groupId> <groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId> <artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version> <version>3.0.2.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid</artifactId> <artifactId>druid</artifactId>
<version>1.1.5</version> <version>1.1.5</version>
</dependency> </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
<dependency> <dependency>
<groupId>com.microsoft.sqlserver</groupId> <groupId>org.nutz</groupId>
<artifactId>mssql-jdbc</artifactId> <artifactId>nutz</artifactId>
<version>6.2.2.jre7</version> <version>1.r.63.r2</version>
</dependency> </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
<dependency> <dependency>
<groupId>org.nutz</groupId> <groupId>jstl</groupId>
<artifactId>nutz</artifactId> <artifactId>jstl</artifactId>
<version>1.r.63.r2</version> <version>1.2</version>
</dependency> </dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<groupId>jstl</groupId> <dependency>
<artifactId>jstl</artifactId> <groupId>javax.servlet</groupId>
<version>1.2</version> <artifactId>javax.servlet-api</artifactId>
</dependency> <version>3.1.0</version>
<dependency> <scope>provided</scope>
<groupId>taglibs</groupId> </dependency>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.40</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring31</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
</dependency>
<!-- https://github.com/monitorjbl/excel-streaming-reader -->
<!-- <dependency> <groupId>com.monitorjbl</groupId> <artifactId>xlsx-streamer</artifactId>
<version>1.2.0</version> </dependency> -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> <dependency>
<dependency> <groupId>org.apache.commons</groupId>
<groupId>com.alibaba</groupId> <artifactId>commons-text</artifactId>
<artifactId>fastjson</artifactId> <version>1.2</version>
<version>1.2.40</version> </dependency>
</dependency> <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring31</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
</dependency>
<!-- https://github.com/monitorjbl/excel-streaming-reader -->
<!-- <dependency> <groupId>com.monitorjbl</groupId> <artifactId>xlsx-streamer</artifactId>
<version>1.2.0</version> </dependency> -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.8.47</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.9.1</version> <!-- Stay on 1.7.1 to support Java 6 -->
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.apache.tika</groupId>
<artifactId>spring-test</artifactId> <artifactId>tika-core</artifactId>
<scope>test</scope> <version>1.17</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>junit</groupId> <dependency>
<artifactId>junit</artifactId> <groupId>org.apache.tika</groupId>
<version>4.12</version> <artifactId>tika-parsers</artifactId>
<scope>test</scope> <version>1.17</version>
</dependency> <scope>test</scope>
<dependency> </dependency>
<groupId>org.mockito</groupId> <dependency>
<artifactId>mockito-core</artifactId> <groupId>com.javaaxp</groupId>
<version>2.8.47</version> <artifactId>java-axp</artifactId>
<scope>test</scope> <version>1.0</version>
</dependency> <scope>system</scope>
<dependency> <systemPath>${basedir}/lib/java-axp-1.0-SNAPSHOT.jar</systemPath>
<groupId>org.assertj</groupId> </dependency>
<artifactId>assertj-core</artifactId> <dependency>
<version>3.9.1</version> <!-- Stay on 1.7.1 to support Java 6 --> <groupId>com.google.guava</groupId>
<scope>test</scope> <artifactId>guava</artifactId>
</dependency> <version>24.0-jre</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.0</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.eclipse.jetty.aggregate</groupId>-->
<!--<artifactId>jetty-all</artifactId>-->
<!--<version>9.4.10.v20180503</version>-->
<!--<type>pom</type>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.eclipse.jetty</groupId>-->
<!--<artifactId>apache-jsp</artifactId>-->
<!--<version>9.4.10.v20180503</version>-->
<!--</dependency>-->
</dependencies>
<dependency> <profiles>
<groupId>org.apache.tika</groupId> <profile>
<artifactId>tika-core</artifactId> <id>dev</id>
<version>1.17</version> <activation>
</dependency> <activeByDefault>true</activeByDefault>
<dependency> </activation>
<groupId>org.apache.tika</groupId> <build>
<artifactId>tika-parsers</artifactId> <filters>
<version>1.17</version> <filter>src/main/resources/conf/conf_profile_dev.properties</filter>
</dependency> </filters>
<dependency> </build>
<groupId>com.javaaxp</groupId> <properties>
<artifactId>java-axp</artifactId> <env>dev</env>
<version>1.0</version> </properties>
<scope>system</scope> </profile>
<systemPath>${basedir}/lib/java-axp-1.0-SNAPSHOT.jar</systemPath> <profile>
</dependency> <id>staging</id>
<dependency> <build>
<groupId>com.google.guava</groupId> <filters>
<artifactId>guava</artifactId> <filter>src/main/resources/conf/conf_profile_staging.properties</filter>
<version>24.0-jre</version> </filters>
</dependency> </build>
<dependency> <properties>
<groupId>org.projectlombok</groupId> <env>staging</env>
<artifactId>lombok</artifactId> </properties>
<version>1.18.0</version> </profile>
</dependency> <profile>
<!--<dependency>--> <id>pub</id>
<!--<groupId>org.eclipse.jetty.aggregate</groupId>--> <build>
<!--<artifactId>jetty-all</artifactId>--> <filters>
<!--<version>9.4.10.v20180503</version>--> <filter>src/main/resources/conf/conf_profile_pub.properties</filter>
<!--<type>pom</type>--> </filters>
<!--</dependency>--> </build>
<!--<dependency>--> <properties>
<!--<groupId>org.eclipse.jetty</groupId>--> <env>pub</env>
<!--<artifactId>apache-jsp</artifactId>--> </properties>
<!--<version>9.4.10.v20180503</version>--> </profile>
<!--</dependency>--> </profiles>
</dependencies>
<profiles> <build>
<profile> <finalName>atms-api</finalName>
<id>dev</id> <!-- idea不会编译src的java目录的xml文件,将IDEA maven项目中src源代码下的xml等资源文件编译进classes文件夹 -->
<activation> <resources>
<activeByDefault>true</activeByDefault> <resource>
</activation> <directory>src/main/resources</directory>
<build> <filtering>true</filtering><!-- replace variable attribute or not -->
<filters> </resource>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter> </resources>
</filters> <plugins>
</build> <plugin>
<properties> <groupId>org.apache.maven.plugins</groupId>
<env>dev</env> <artifactId>maven-compiler-plugin</artifactId>
</properties> <version>3.2</version>
</profile> <configuration>
<profile> <source>1.8</source>
<id>staging</id> <target>1.8</target>
<build> <encoding>UTF-8</encoding>
<filters> </configuration>
<filter>src/main/resources/conf/conf_profile_staging.properties</filter> </plugin>
</filters> <plugin>
</build> <groupId>org.apache.tomcat.maven</groupId>
<properties> <!-- tomcat7的插件, 不同tomcat版本这个也不一样 -->
<env>staging</env> <artifactId>tomcat7-maven-plugin</artifactId>
</properties> <version>2.1</version>
</profile> <configuration>
<profile> <!-- 通过maven tomcat7:run运行项目时,访问项目的端口号 -->
<id>pub</id> <port>8180</port>
<build> <!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa-->
<filters> <path>/</path>
<filter>src/main/resources/conf/conf_profile_pub.properties</filter> <uriEncoding>UTF-8</uriEncoding>
</filters> </configuration>
</build> </plugin>
<properties> </plugins>
<env>pub</env> </build>
</properties>
</profile>
</profiles>
<build>
<finalName>atms-api</finalName>
<!-- idea不会编译src的java目录的xml文件,将IDEA maven项目中src源代码下的xml等资源文件编译进classes文件夹 -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.sql</include>
</includes>
<filtering>true</filtering><!-- replace variable attribute or not -->
</resource>
<resource>
<directory>src/main/resources/Document</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<targetPath>${basedir}/target/classes/document</targetPath>
</resource>
<resource>
<directory>test/resources</directory>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<webResources>
<resource>
<directory>test</directory>
<includes>
<include>**</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<includes>
<include>**/*IT.java</include>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<!-- See: http://www.jacoco.org/jacoco/trunk/doc/maven.html -->
<!-- See: http://www.jacoco.org/jacoco/trunk/doc/examples/build/pom.xml -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- See: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
<!-- 资源文件拷贝插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
<!-- java编译插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<!-- tomcat7的插件, 不同tomcat版本这个也不一样 -->
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- 通过maven tomcat7:run运行项目时,访问项目的端口号 -->
<port>8180</port>
<!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa-->
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>
package pwc.taxtech.atms;
public interface MyMailMapper {
}
...@@ -36,13 +36,4 @@ public class MybatisConfig implements InitializingBean { ...@@ -36,13 +36,4 @@ public class MybatisConfig implements InitializingBean {
return bean; return bean;
} }
@Bean
public static MapperScannerConfigurer userMapperConfigurerMail() {
MapperScannerConfigurer bean = new MapperScannerConfigurer();
bean.setMarkerInterface(MyMailMapper.class);
bean.setBasePackage(BASE_PACKAGE);
bean.setSqlSessionTemplateBeanName("sqlSessionTemplateMail");
// bean.setSqlSessionFactoryBeanName("sqlSessionFactoryMail");
return bean;
}
} }
package pwc.taxtech.atms.common.datasource; package pwc.taxtech.atms.common.datasource;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.beust.jcommander.ParameterException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.pool2.KeyedPooledObjectFactory; import org.apache.commons.pool2.KeyedPooledObjectFactory;
import org.apache.commons.pool2.PooledObject; import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.DefaultPooledObject; import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.exception.ParameterException;
public class DataSourceFactory implements KeyedPooledObjectFactory<String, DruidDataSource> { public class DataSourceFactory implements KeyedPooledObjectFactory<String, DruidDataSource> {
private static final Logger logger = LoggerFactory.getLogger(DataSourceFactory.class); private static final Logger logger = LoggerFactory.getLogger(DataSourceFactory.class);
......
...@@ -26,11 +26,11 @@ public final class Constant { ...@@ -26,11 +26,11 @@ public final class Constant {
public static final String UPLOAD_FOLDER_NAME = "Upload"; public static final String UPLOAD_FOLDER_NAME = "Upload";
public static final String CURRENT_USER_HOME = "~"; public static final String CURRENT_USER_HOME = "~";
public static final String CURRENT_USER_UPLOAD_FOLDER = CURRENT_USER_HOME + File.separator + UPLOAD_FOLDER_NAME; public static final String CURRENT_USER_UPLOAD_FOLDER = CURRENT_USER_HOME + File.separator + UPLOAD_FOLDER_NAME;
public static final String CURRENT_IMAGE_PATH=CURRENT_USER_HOME+File.separator+"Resource"+File.separator+"Images"; public static final String CURRENT_IMAGE_PATH = CURRENT_USER_HOME + File.separator + "Resource" + File.separator + "Images";
public static final String IMAGE_PATH_INFORMATION=CURRENT_IMAGE_PATH+File.separator+"information.png"; public static final String IMAGE_PATH_INFORMATION = CURRENT_IMAGE_PATH + File.separator + "information.png";
public static final String IMAGE_PATH_ERROR=CURRENT_IMAGE_PATH+File.separator+"error.png"; public static final String IMAGE_PATH_ERROR = CURRENT_IMAGE_PATH + File.separator + "error.png";
public static final String IMAGE_PATH_SUCCESS=CURRENT_IMAGE_PATH+File.separator+"success.png"; public static final String IMAGE_PATH_SUCCESS = CURRENT_IMAGE_PATH + File.separator + "success.png";
public static final String IMAGE_PATH_WARN=CURRENT_IMAGE_PATH+File.separator+"warning1.png"; public static final String IMAGE_PATH_WARN = CURRENT_IMAGE_PATH + File.separator + "warning1.png";
public static final boolean DEFAULT_RESULT = true; public static final boolean DEFAULT_RESULT = true;
...@@ -41,4 +41,5 @@ public final class Constant { ...@@ -41,4 +41,5 @@ public final class Constant {
public static final boolean DEFAULT_HAS_HEADER = true; public static final boolean DEFAULT_HAS_HEADER = true;
public static final String IMAGE_FORMART_ = "png"; public static final String IMAGE_FORMART_ = "png";
public static final String EMPTY = "";
} }
\ No newline at end of file
...@@ -2,7 +2,6 @@ package pwc.taxtech.atms.controller; ...@@ -2,7 +2,6 @@ package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -31,6 +30,9 @@ import java.util.Map; ...@@ -31,6 +30,9 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
@RestController @RestController
@RequestMapping(value = "api/v1/CustomsInvoice") @RequestMapping(value = "api/v1/CustomsInvoice")
public class CustomsInvoiceController { public class CustomsInvoiceController {
...@@ -84,9 +86,9 @@ public class CustomsInvoiceController { ...@@ -84,9 +86,9 @@ public class CustomsInvoiceController {
int count = getDownloadFilePath(filter, os); int count = getDownloadFilePath(filter, os);
if (count == 0) { if (count == 0) {
response.setStatus(HttpStatus.SC_NO_CONTENT); response.setStatus(SC_NO_CONTENT);
} else { } else {
response.setStatus(HttpStatus.SC_OK); response.setStatus(SC_OK);
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.constant.enums.EnumModule; import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter; import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.Response;
import static pwc.taxtech.atms.constant.Constant.USER_ID_FOR_UPLOAD; import static pwc.taxtech.atms.constant.Constant.USER_ID_FOR_UPLOAD;
@RestController @RestController
...@@ -28,6 +20,6 @@ public class FileUploadController { ...@@ -28,6 +20,6 @@ public class FileUploadController {
@RequestMapping(value = "NewFile", method = RequestMethod.POST, produces = MediaType.MULTIPART_FORM_DATA_VALUE) @RequestMapping(value = "NewFile", method = RequestMethod.POST, produces = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity getInputInvoiceTreeViewData(MultipartHttpServletRequest request) { public ResponseEntity getInputInvoiceTreeViewData(MultipartHttpServletRequest request) {
return fileUploadAdapter.upload(request,EnumModule.TrailBalance, USER_ID_FOR_UPLOAD); return fileUploadAdapter.upload(request, EnumModule.TrailBalance, USER_ID_FOR_UPLOAD);
} }
} }
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -28,6 +27,9 @@ import java.util.List; ...@@ -28,6 +27,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
@RestController @RestController
@RequestMapping(value = "api/v1/inputInvoiceImport") @RequestMapping(value = "api/v1/inputInvoiceImport")
public class InputInvoiceImportController { public class InputInvoiceImportController {
...@@ -52,9 +54,9 @@ public class InputInvoiceImportController { ...@@ -52,9 +54,9 @@ public class InputInvoiceImportController {
int count = getDownloadFilePath(paras, os); int count = getDownloadFilePath(paras, os);
if (count == 0) { if (count == 0) {
response.setStatus(HttpStatus.SC_NO_CONTENT); response.setStatus(SC_NO_CONTENT);
} else { } else {
response.setStatus(HttpStatus.SC_OK); response.setStatus(SC_OK);
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -24,6 +23,9 @@ import java.util.List; ...@@ -24,6 +23,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
@RestController @RestController
@RequestMapping(value = "api/v1/outputInvoiceImport") @RequestMapping(value = "api/v1/outputInvoiceImport")
public class OutputInvoiceController { public class OutputInvoiceController {
...@@ -48,9 +50,9 @@ public class OutputInvoiceController { ...@@ -48,9 +50,9 @@ public class OutputInvoiceController {
int count = getDownloadFilePath(paras, os); int count = getDownloadFilePath(paras, os);
if (count == 0) { if (count == 0) {
response.setStatus(HttpStatus.SC_NO_CONTENT); response.setStatus(SC_NO_CONTENT);
} else { } else {
response.setStatus(HttpStatus.SC_OK); response.setStatus(SC_OK);
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -3,7 +3,6 @@ package pwc.taxtech.atms.controller; ...@@ -3,7 +3,6 @@ package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.util.NPOIHelper;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.BalanceSubTotalDto; import pwc.taxtech.atms.dto.vatdto.BalanceSubTotalDto;
import pwc.taxtech.atms.dto.vatdto.BalanceWithSubTotalsResultDto; import pwc.taxtech.atms.dto.vatdto.BalanceWithSubTotalsResultDto;
...@@ -27,7 +27,6 @@ import pwc.taxtech.atms.dto.vatdto.VatEnterpriseAccountDto; ...@@ -27,7 +27,6 @@ import pwc.taxtech.atms.dto.vatdto.VatEnterpriseAccountDto;
import pwc.taxtech.atms.service.ICitTBDataImportService; import pwc.taxtech.atms.service.ICitTBDataImportService;
import pwc.taxtech.atms.service.IdentityService; import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.service.impl.DataImportServiceImpl; import pwc.taxtech.atms.service.impl.DataImportServiceImpl;
import pwc.taxtech.atms.common.util.NPOIHelper;
import pwc.taxtech.atms.vat.dao.DataImportModel; import pwc.taxtech.atms.vat.dao.DataImportModel;
import pwc.taxtech.atms.vat.service.TBDataImportService; import pwc.taxtech.atms.vat.service.TBDataImportService;
import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter; import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter;
...@@ -44,6 +43,7 @@ import java.util.List; ...@@ -44,6 +43,7 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
import static pwc.taxtech.atms.constant.Constant.DEFAULT_HAS_HEADER; import static pwc.taxtech.atms.constant.Constant.DEFAULT_HAS_HEADER;
import static pwc.taxtech.atms.constant.Constant.HEADER_ROW_INDEX; import static pwc.taxtech.atms.constant.Constant.HEADER_ROW_INDEX;
...@@ -478,10 +478,10 @@ public class TBDataImportController { ...@@ -478,10 +478,10 @@ public class TBDataImportController {
return ResponseEntity.ok(dataImportModel); return ResponseEntity.ok(dataImportModel);
} catch (FileNotFoundException e) {//TODO: replace exception filter (neo) } catch (FileNotFoundException e) {//TODO: replace exception filter (neo)
e.printStackTrace(); e.printStackTrace();
return ResponseEntity.status(HttpStatus.SC_INTERNAL_SERVER_ERROR).build(); return ResponseEntity.status(SC_INTERNAL_SERVER_ERROR).build();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
return ResponseEntity.status(HttpStatus.SC_INTERNAL_SERVER_ERROR).build(); return ResponseEntity.status(SC_INTERNAL_SERVER_ERROR).build();
} }
} else { } else {
return ResponseEntity.ok().build(); return ResponseEntity.ok().build();
......
package pwc.taxtech.atms.dao; package pwc.taxtech.atms.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMailMapper; import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entitiy.MailQueue; import pwc.taxtech.atms.entitiy.MailQueue;
import pwc.taxtech.atms.entitiy.MailQueueExample; import pwc.taxtech.atms.entitiy.MailQueueExample;
import java.util.List;
@Mapper @Mapper
public interface MailQueueMapper extends MyMailMapper { public interface MailQueueMapper extends MyMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dbo.MAILQUEUE * This method corresponds to the database table dbo.MAILQUEUE
......
package pwc.taxtech.atms.dto.vatdto; package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
......
package pwc.taxtech.atms.exception;
public class NotSupportedException extends ApplicationException {
public NotSupportedException() {
}
public NotSupportedException(String message) {
super(message);
}
}
package pwc.taxtech.atms.exception;
public class ParameterException extends ApplicationException{
public ParameterException() {
super();
}
public ParameterException(String message) {
super(message);
}
}
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.beust.jcommander.ParameterException;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.pool2.impl.GenericKeyedObjectPool; import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
...@@ -19,6 +18,7 @@ import org.springframework.stereotype.Service; ...@@ -19,6 +18,7 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.datasource.DataSourceConfig; import pwc.taxtech.atms.common.datasource.DataSourceConfig;
import pwc.taxtech.atms.common.datasource.DataSourceFactory; import pwc.taxtech.atms.common.datasource.DataSourceFactory;
import pwc.taxtech.atms.common.datasource.ShardingContextHolder; import pwc.taxtech.atms.common.datasource.ShardingContextHolder;
import pwc.taxtech.atms.exception.ParameterException;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.sql.DataSource; import javax.sql.DataSource;
......
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import com.beust.jcommander.internal.Lists;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import org.apache.ibatis.io.Resources; import org.apache.ibatis.io.Resources;
import org.apache.ibatis.jdbc.ScriptRunner; import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
......
package pwc.taxtech.atms.vat.service.impl.report.functions; package pwc.taxtech.atms.vat.service.impl;
import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.common.util.SpringContextUtil; import org.springframework.stereotype.Repository;
import pwc.taxtech.atms.constant.enums.EnumServiceType; import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dao.FormulaAdminMapper;
import pwc.taxtech.atms.dto.GroupId; import pwc.taxtech.atms.dto.GroupId;
import pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto; import pwc.taxtech.atms.dto.vatdto.CellTemplatePerGroupDto;
import pwc.taxtech.atms.entitiy.ProjectServiceType; import pwc.taxtech.atms.entitiy.ProjectServiceType;
import pwc.taxtech.atms.entitiy.ProjectServiceTypeExample; import pwc.taxtech.atms.entitiy.ProjectServiceTypeExample;
import pwc.taxtech.atms.vat.dao.CellDataMapper;
import pwc.taxtech.atms.vat.dao.FormulaProjectMapper;
import pwc.taxtech.atms.vat.dao.ReportMapper;
import pwc.taxtech.atms.vat.entity.CellData; import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.CellDataExample; import pwc.taxtech.atms.vat.entity.CellDataExample;
import pwc.taxtech.atms.vat.entity.Report; import pwc.taxtech.atms.vat.entity.Report;
...@@ -16,32 +20,33 @@ import java.util.List; ...@@ -16,32 +20,33 @@ import java.util.List;
import static pwc.taxtech.atms.constant.Constant.FIRST_OR_DEFAULT; import static pwc.taxtech.atms.constant.Constant.FIRST_OR_DEFAULT;
@Service @Repository
public class FormulaAgent { public class FormulaAgent extends VatAbstractService {
// @Autowired @Autowired
// public FormulaAdminMapper formulaAdminMapper; public FormulaAdminMapper adminMp;
// @Autowired @Autowired
// public FormulaProjectMapper projectMp; public FormulaProjectMapper projectMp;
// @Autowired @Autowired
// public ReportMapper reportMapper; public ReportMapper reportMapper;
// @Autowired @Autowired
// public CellDataMapper cellDataMapper; public CellDataMapper cellDataMapper;
public List<CellTemplatePerGroupDto> getCellTemplateGroupDto(Long templateGroupId, String projectId) { public List<CellTemplatePerGroupDto> getCellTemplateGroupDto(Long templateGroupId, String projectId) {
ProjectServiceTypeExample pst = new ProjectServiceTypeExample(); ProjectServiceTypeExample pst = new ProjectServiceTypeExample();
pst.createCriteria().andTemplateGroupIDEqualTo(Long.valueOf(templateGroupId)) pst.createCriteria().andTemplateGroupIDEqualTo(Long.valueOf(templateGroupId))
.andServiceTypeIDEqualTo(EnumServiceType.VAT.getCode() + ""); .andServiceTypeIDEqualTo(EnumServiceType.VAT.getCode() + "");
List<ProjectServiceType> pstReult = SpringContextUtil.projectServiceTypeMapper.selectByExample(pst); List<ProjectServiceType> pstReult = projectServiceTypeMapper.selectByExample(pst);
List<CellTemplatePerGroupDto> cellTemplates = SpringContextUtil.formulaAdminMapper.getCellTemplatePerGroupDto(templateGroupId); List<CellTemplatePerGroupDto> cellTemplates = adminMp.getCellTemplatePerGroupDto(templateGroupId);
if (pstReult == null || pstReult.isEmpty()) { if (pstReult == null || pstReult.isEmpty()) {
List<GroupId> groupIds = SpringContextUtil.formulaAdminMapper.getTemplateGroupId(projectId); List<GroupId> groupIds = adminMp.getTemplateGroupId(projectId);
GroupId groupId; GroupId groupId;
if (groupIds.size() > 0) { if (groupIds.size() > 0) {
groupId = groupIds.stream().filter(m -> m.isDefault != 1).findFirst().get(); groupId = groupIds.stream().filter(m -> m.isDefault != 1).findFirst().get();
if (groupId == null) groupId = groupIds.get(0); if (groupId == null) groupId = groupIds.get(0);
cellTemplates.addAll(SpringContextUtil.formulaAdminMapper.getCellTemplatePerGroupDto(groupId.groupId)); cellTemplates.addAll(adminMp.getCellTemplatePerGroupDto(groupId.groupId));
} }
} }
return cellTemplates; return cellTemplates;
...@@ -51,7 +56,7 @@ public class FormulaAgent { ...@@ -51,7 +56,7 @@ public class FormulaAgent {
ReportExample example = new ReportExample(); ReportExample example = new ReportExample();
example.createCriteria().andTemplateIdEqualTo(Long.valueOf(templateId)) example.createCriteria().andTemplateIdEqualTo(Long.valueOf(templateId))
.andPeriodEqualTo(periodId); .andPeriodEqualTo(periodId);
List<Report> reports = SpringContextUtil.reportMapper.selectByExample(example); List<Report> reports = reportMapper.selectByExample(example);
if (reports != null || !reports.isEmpty()) return reports.get(FIRST_OR_DEFAULT); if (reports != null || !reports.isEmpty()) return reports.get(FIRST_OR_DEFAULT);
return null; return null;
...@@ -60,9 +65,10 @@ public class FormulaAgent { ...@@ -60,9 +65,10 @@ public class FormulaAgent {
public CellData getCellDataListByTemplate(String templateId, Long reportId) { public CellData getCellDataListByTemplate(String templateId, Long reportId) {
CellDataExample dataExample = new CellDataExample(); CellDataExample dataExample = new CellDataExample();
dataExample.createCriteria().andCellTemplateIdEqualTo(Long.valueOf(templateId)); dataExample.createCriteria().andCellTemplateIdEqualTo(Long.valueOf(templateId));
List<CellData> cellDataList = SpringContextUtil.cellDataMapper.selectByExample(dataExample); List<CellData> cellDataList = cellDataMapper.selectByExample(dataExample);
if (cellDataList != null || !cellDataList.isEmpty()) return cellDataList.get(FIRST_OR_DEFAULT); if (cellDataList != null || !cellDataList.isEmpty()) return cellDataList.get(FIRST_OR_DEFAULT);
return null; return null;
} }
} }
...@@ -18,7 +18,6 @@ import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; ...@@ -18,7 +18,6 @@ import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.CellData; import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.Report; import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaAgent;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext; import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext;
import java.math.BigDecimal; import java.math.BigDecimal;
......
package pwc.taxtech.atms.vat.service.impl; package pwc.taxtech.atms.vat.service.impl;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.apache.poi.ss.formula.udf.AggregatingUDFFinder; import org.apache.poi.ss.formula.udf.AggregatingUDFFinder;
import org.apache.poi.ss.formula.udf.DefaultUDFFinder; import org.apache.poi.ss.formula.udf.DefaultUDFFinder;
import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.formula.udf.UDFFinder;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -15,17 +19,38 @@ import org.springframework.stereotype.Service; ...@@ -15,17 +19,38 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.POIUtil; import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.constant.enums.CellDataSourceType; import pwc.taxtech.atms.constant.enums.CellDataSourceType;
import pwc.taxtech.atms.service.impl.DistributedIDService; import pwc.taxtech.atms.service.impl.DistributedIDService;
import pwc.taxtech.atms.vat.dao.*; import pwc.taxtech.atms.vat.dao.CellDataMapper;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.dao.PeriodCellTemplateConfigMapper;
import pwc.taxtech.atms.vat.dao.PeriodCellTemplateMapper;
import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper;
import pwc.taxtech.atms.vat.dao.ReportMapper;
import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplate;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfigExample;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.service.ReportGenerator; import pwc.taxtech.atms.vat.service.ReportGenerator;
import pwc.taxtech.atms.vat.service.impl.report.functions.*; import pwc.taxtech.atms.vat.service.impl.report.functions.FSJZ;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext;
import pwc.taxtech.atms.vat.service.impl.report.functions.ND;
import pwc.taxtech.atms.vat.service.impl.report.functions.SGSR;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static pwc.taxtech.atms.constant.Constant.EMPTY;
@Service @Service
public class ReportGeneratorImpl implements ReportGenerator { public class ReportGeneratorImpl implements ReportGenerator {
@Autowired @Autowired
...@@ -55,7 +80,7 @@ public class ReportGeneratorImpl implements ReportGenerator { ...@@ -55,7 +80,7 @@ public class ReportGeneratorImpl implements ReportGenerator {
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample); List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<Long> periodTemplateIDList = periodTemplateList.stream().map(PeriodTemplate::getTemplateId).collect(Collectors.toList()); List<Long> periodTemplateIDList = periodTemplateList.stream().map(PeriodTemplate::getTemplateId).collect(Collectors.toList());
Long templateGroupID = periodTemplateList.size()>0?periodTemplateList.get(0).getTemplateGroupId():0; Long templateGroupID = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0;
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample(); PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
periodCellTemplateExample.createCriteria().andReportTemplateIdIn(periodTemplateIDList); periodCellTemplateExample.createCriteria().andReportTemplateIdIn(periodTemplateIDList);
...@@ -74,10 +99,7 @@ public class ReportGeneratorImpl implements ReportGenerator { ...@@ -74,10 +99,7 @@ public class ReportGeneratorImpl implements ReportGenerator {
Workbook newWorkbook = workbook.get(); Workbook newWorkbook = workbook.get();
addFunctionsToWorkbook(newWorkbook, templateGroupID);
addFunctionsToWorkbook(newWorkbook,templateGroupID);
int sheetCount = newWorkbook.getNumberOfSheets(); int sheetCount = newWorkbook.getNumberOfSheets();
for (int i = 0; i < sheetCount; i++) { for (int i = 0; i < sheetCount; i++) {
Sheet sheet = newWorkbook.getSheetAt(i); Sheet sheet = newWorkbook.getSheetAt(i);
...@@ -119,7 +141,7 @@ public class ReportGeneratorImpl implements ReportGenerator { ...@@ -119,7 +141,7 @@ public class ReportGeneratorImpl implements ReportGenerator {
cell = row.getCell(k.getColumnIndex()); cell = row.getCell(k.getColumnIndex());
//todo:后面单独处理kv的公式 //todo:后面单独处理kv的公式
if(!v.getFormula().contains("@")) { if (!v.getFormula().contains("@")) {
cell.setCellFormula(v.getFormula()); cell.setCellFormula(v.getFormula());
} }
}); });
...@@ -157,21 +179,20 @@ public class ReportGeneratorImpl implements ReportGenerator { ...@@ -157,21 +179,20 @@ public class ReportGeneratorImpl implements ReportGenerator {
List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream().filter(a -> a.getReportTemplateId().equals(templateID)).collect(Collectors.toList()); List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream().filter(a -> a.getReportTemplateId().equals(templateID)).collect(Collectors.toList());
for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) { for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) {
Optional<PeriodCellTemplate> tempPeriodCellTemplate = periodCellTemplateList.stream().filter(a->a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId())).findFirst(); Optional<PeriodCellTemplate> tempPeriodCellTemplate = periodCellTemplateList.stream().filter(a -> a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId())).findFirst();
if (tempPeriodCellTemplate!=null){ if (tempPeriodCellTemplate != null) {
CellData cellData = new CellData(); CellData cellData = new CellData();
cellData.setId(distributedIDService.nextId()); cellData.setId(distributedIDService.nextId());
cellData.setReportId(reportID); cellData.setReportId(reportID);
cellData.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId()); cellData.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId());
String data; String data;
if(sheet.getRow(tempPeriodCellTemplate.get().getRowIndex())!=null&&sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex())!=null){ if (sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()) != null && sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex()) != null) {
data =Double.toString(sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex()).getNumericCellValue()); data = Double.toString(sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex()).getNumericCellValue());
} } else {
else{ data = EMPTY;
data = StringUtils.EMPTY;
} }
cellData.setData(data); cellData.setData(data);
cellData.setFormulaExp(StringUtils.EMPTY); cellData.setFormulaExp(EMPTY);
cellData.setCreateBy("Admin"); cellData.setCreateBy("Admin");
cellData.setCreateTime(createTime); cellData.setCreateTime(createTime);
cellData.setUpdateBy("Admin"); cellData.setUpdateBy("Admin");
...@@ -236,15 +257,16 @@ public class ReportGeneratorImpl implements ReportGenerator { ...@@ -236,15 +257,16 @@ public class ReportGeneratorImpl implements ReportGenerator {
* *
* @param workbook 工作簿 * @param workbook 工作簿
*/ */
private void addFunctionsToWorkbook(Workbook workbook,Long templateGroupID) { private void addFunctionsToWorkbook(Workbook workbook, Long templateGroupID) {
String[] functionNames = {"SGSR","FSJZ","ND"}; String[] functionNames = {"SGSR", "FSJZ", "ND", "BB"};
FormulaContext formulaContext = new FormulaContext(); FormulaContext formulaContext = new FormulaContext();
formulaContext.setFormulaAgent(formulaAgent); formulaContext.setFormulaAgent(formulaAgent);
formulaContext.setPeriod(6);//todo: assign value later formulaContext.setPeriod(6);//todo: assign value later
formulaContext.setReportTemplateGroupID(templateGroupID); formulaContext.setReportTemplateGroupID(templateGroupID);
FreeRefFunction[] functionImpls = {new SGSR(formulaContext),new FSJZ(formulaContext),new ND(formulaContext)}; FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext),
new ReportFormulaFactory.BB(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functionNames, functionImpls); UDFFinder udfs = new DefaultUDFFinder(functionNames, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs); UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
workbook.addToolPack(udfToolpack); workbook.addToolPack(udfToolpack);
} }
} }
...@@ -8,14 +8,19 @@ import pwc.taxtech.atms.dto.OperationResultDto; ...@@ -8,14 +8,19 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.CellTemplateReferenceDto; import pwc.taxtech.atms.dto.vatdto.CellTemplateReferenceDto;
import pwc.taxtech.atms.dto.vatdto.ReportDto; import pwc.taxtech.atms.dto.vatdto.ReportDto;
import pwc.taxtech.atms.entitiy.*; import pwc.taxtech.atms.entitiy.*;
import pwc.taxtech.atms.exception.NotSupportedException;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplate; import pwc.taxtech.atms.vat.entity.PeriodCellTemplate;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig; import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodTemplate; import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample; import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import pwc.taxtech.atms.vat.service.ReportService; import pwc.taxtech.atms.vat.service.ReportService;
import javax.ws.rs.NotSupportedException; import java.util.ArrayList;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -87,7 +92,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -87,7 +92,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
} }
@Override @Override
public OperationResultDto updateConfig(String projectId, Integer period,Boolean ifDeleteManualDataSource, String generator) { public OperationResultDto updateConfig(String projectId, Integer period, Boolean ifDeleteManualDataSource, String generator) {
OperationResultDto result = new OperationResultDto(); OperationResultDto result = new OperationResultDto();
if (period == null) { if (period == null) {
...@@ -118,7 +123,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -118,7 +123,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
dataSourceMapper.clearTaxPayerReportWithPeriod(period); dataSourceMapper.clearTaxPayerReportWithPeriod(period);
dataSourceMapper.clearDataSourceWithPeriod(period); dataSourceMapper.clearDataSourceWithPeriod(period);
dataSourceMapper.clearDataSourceDetailWithPeriod(period); dataSourceMapper.clearDataSourceDetailWithPeriod(period);
dataSourceMapper.clearCellDataWithPeriod( strExceptTemplateIDs); dataSourceMapper.clearCellDataWithPeriod(strExceptTemplateIDs);
// 根据templategroupid 把 template 插入到 periodTemplate // 根据templategroupid 把 template 插入到 periodTemplate
TemplateExample example = new TemplateExample(); TemplateExample example = new TemplateExample();
......
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
@Setter @Setter
@Getter @Getter
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<!-- DruidDataSource数据源配置) -->
<!-- See: https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_DruidDataSource%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE -->
<bean id="dataSourceMail" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init" destroy-method="close">
<!-- 基本属性 url、user、password -->
<property name="url" value="${mail_jdbc_url}" />
<property name="username" value="${mail_jdbc_user}" />
<property name="password" value="${mail_jdbc_password}" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="${atms.config.druid.initialSize:0}" />
<property name="minIdle" value="${atms.config.druid.minIdle:1}" />
<property name="maxActive" value="${atms.config.druid.maxActive:20}" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="${atms.config.druid.maxWait:60000}" />
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="${atms.config.druid.timeBetweenEvictionRunsMillis:60000}" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="${atms.config.druid.minEvictableIdleTimeMillis:300000}" />
<property name="validationQuery" value="${jdbc_validationQuery:select 1 from INFORMATION_SCHEMA.SYSTEM_USERS}" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize"
value="20" />
<!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat" />
</bean>
</beans>
\ No newline at end of file
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
</context:component-scan> </context:component-scan>
<import resource="applicationContext-datasource.xml" /> <import resource="applicationContext-datasource.xml" />
<import resource="applicationContext-datasource-mail.xml" />
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
...@@ -47,20 +46,6 @@ ...@@ -47,20 +46,6 @@
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"> <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactory" /> <constructor-arg ref="sqlSessionFactory" />
</bean> </bean>
<bean id="sqlSessionFactoryMail" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSourceMail" />
<property name="configLocation" value="classpath:sqlMapConfig.xml" />
<property name="mapperLocations">
<array>
<value>classpath:pwc/taxtech/atms/dao/*Mapper.xml</value>
</array>
</property>
</bean>
<bean id="sqlSessionTemplateMail" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactoryMail" />
</bean>
<!-- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pwc.taxtech.atms" /> </bean> --> <!-- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pwc.taxtech.atms" /> </bean> -->
...@@ -74,13 +59,14 @@ ...@@ -74,13 +59,14 @@
</tx:attributes> </tx:attributes>
</tx:advice> </tx:advice>
<aop:config> <aop:config proxy-target-class="true">
<aop:pointcut id="txPointcut2" expression="execution(public * pwc.taxtech.atms..*.*(..)) &amp;&amp; @target(org.springframework.stereotype.Service)" /> <aop:pointcut id="txPointcut2" expression="execution(public * pwc.taxtech.atms..*.*(..)) &amp;&amp; @target(org.springframework.stereotype.Service)
and !execution(* pwc.taxtech.atms.vat.service.impl.FormulaAgent.*(..))" />
<aop:advisor pointcut-ref="txPointcut2" advice-ref="txAdvice" /> <aop:advisor pointcut-ref="txPointcut2" advice-ref="txAdvice" />
</aop:config> </aop:config>
<aop:aspectj-autoproxy /> <aop:aspectj-autoproxy />
<tx:annotation-driven proxy-target-class="true" /> <tx:annotation-driven proxy-target-class="true" />
</beans> </beans>
\ No newline at end of file
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.util.Date;
import javax.annotation.Resource;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT; import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dao.MailQueueMapper; import pwc.taxtech.atms.dao.MailQueueMapper;
import pwc.taxtech.atms.dto.MailMto; import pwc.taxtech.atms.dto.MailMto;
import pwc.taxtech.atms.entitiy.MailQueue; import pwc.taxtech.atms.entitiy.MailQueue;
import pwc.taxtech.atms.service.CommonService; import pwc.taxtech.atms.service.CommonService;
import java.util.Date;
public class MailServiceIT extends CommonIT { public class MailServiceIT extends CommonIT {
private static final Logger logger = LoggerFactory.getLogger(MailServiceIT.class); private static final Logger logger = LoggerFactory.getLogger(MailServiceIT.class);
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
@Autowired @Autowired
private MailQueueMapper mailQueueMapper; private MailQueueMapper mailQueueMapper;
@Resource
private SqlSessionTemplate sqlSessionTemplateMail;
@Before @Before
public void setUp() { public void setUp() {
......
<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 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>4.0.0</modelVersion> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<groupId>pwc.taxtech.atms</groupId> <modelVersion>4.0.0</modelVersion>
<artifactId>atms-web</artifactId> <groupId>pwc.taxtech.atms</groupId>
<packaging>war</packaging> <artifactId>atms-web</artifactId>
<version>0.1.1</version> <packaging>war</packaging>
<version>0.1.1</version>
<properties> <properties>
<maven.test.skip>true</maven.test.skip> <maven.test.skip>true</maven.test.skip>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<spring.version>4.3.13.RELEASE</spring.version> <spring.version>4.3.13.RELEASE</spring.version>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version> <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss z</maven.build.timestamp.format> <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss z</maven.build.timestamp.format>
<timestamp>${maven.build.timestamp}</timestamp> <timestamp>${maven.build.timestamp}</timestamp>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId> <artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.2.3.RELEASE</version>
</dependency>
<dependency> <dependencies>
<groupId>org.springframework.security</groupId> <dependency>
<artifactId>spring-security-web</artifactId> <groupId>org.springframework</groupId>
<version>4.2.3.RELEASE</version> <artifactId>spring-webmvc</artifactId>
</dependency> </dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>jstl</groupId> <groupId>org.springframework.security</groupId>
<artifactId>jstl</artifactId> <artifactId>spring-security-web</artifactId>
<version>1.2</version> <version>4.2.3.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>taglibs</groupId> <groupId>commons-fileupload</groupId>
<artifactId>standard</artifactId> <artifactId>commons-fileupload</artifactId>
<version>1.1.2</version> <version>1.3.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>org.slf4j</groupId>
<artifactId>commons-codec</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.10</version> <version>1.7.25</version>
</dependency> </dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>jstl</groupId>
<artifactId>httpclient</artifactId> <artifactId>jstl</artifactId>
<version>4.5.5</version> <version>1.2</version>
</dependency> </dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>servlet-api</artifactId> <artifactId>httpclient</artifactId>
<version>2.5</version> <version>4.5.5</version>
<scope>provided</scope> </dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> <dependency>
<dependency> <groupId>javax.servlet</groupId>
<groupId>com.alibaba</groupId> <artifactId>servlet-api</artifactId>
<artifactId>fastjson</artifactId> <version>2.5</version>
<version>1.2.40</version> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>1.r.63.r2</version>
</dependency>
<dependency> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<groupId>joda-time</groupId> <dependency>
<artifactId>joda-time</artifactId> <groupId>com.alibaba</groupId>
<version>2.9.9</version> <artifactId>fastjson</artifactId>
</dependency> <version>1.2.40</version>
<dependency> </dependency>
<groupId>org.jasypt</groupId> <!--<dependency>-->
<artifactId>jasypt</artifactId> <!--<groupId>org.nutz</groupId>-->
<version>1.9.2</version> <!--<artifactId>nutz</artifactId>-->
</dependency> <!--<version>1.r.63.r2</version>-->
<dependency> <!--</dependency>-->
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring31</artifactId>
<version>1.9.2</version>
</dependency>
<!-- jackson json -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
<!--<dependency>-->
<!--<groupId>joda-time</groupId>-->
<!--<artifactId>joda-time</artifactId>-->
<!--<version>2.9.9</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring31</artifactId>
<version>1.9.2</version>
</dependency>
<!--&lt;!&ndash; jackson json &ndash;&gt;-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
<dependency> </dependencies>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles> <profiles>
<profile> <profile>
...@@ -206,58 +172,58 @@ ...@@ -206,58 +172,58 @@
</profile> </profile>
</profiles> </profiles>
<build> <build>
<finalName>atms-web</finalName> <finalName>atms-web</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<includes> <includes>
<include>**/*.properties</include> <include>**/*.properties</include>
<include>**/*.xml</include> <include>**/*.xml</include>
</includes> </includes>
<filtering>true</filtering><!-- replace variable attribute or not --> <filtering>true</filtering><!-- replace variable attribute or not -->
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version> <version>3.2.0</version>
<configuration> <configuration>
<archive> <archive>
<addMavenDescriptor>false</addMavenDescriptor> <addMavenDescriptor>false</addMavenDescriptor>
</archive> </archive>
<packagingExcludes> <packagingExcludes>
Gruntfile.js, Gruntfile.js,
package-lock.json, package-lock.json,
package.json, package.json,
run_grunt.bat run_grunt.bat
</packagingExcludes> </packagingExcludes>
<webResources> <webResources>
<resource> <resource>
<directory>src/main/webapp-filtered</directory> <directory>src/main/webapp-filtered</directory>
<includes> <includes>
<include>**</include> <include>**</include>
</includes> </includes>
<filtering>true</filtering> <filtering>true</filtering>
</resource> </resource>
</webResources> </webResources>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.tomcat.maven</groupId> <groupId>org.apache.tomcat.maven</groupId>
<!-- tomcat7的插件, 不同tomcat版本这个也不一样 --> <!-- tomcat7的插件, 不同tomcat版本这个也不一样 -->
<artifactId>tomcat7-maven-plugin</artifactId> <artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version> <version>2.1</version>
<configuration> <configuration>
<!-- 通过maven tomcat7:run运行项目时,访问项目的端口号 --> <!-- 通过maven tomcat7:run运行项目时,访问项目的端口号 -->
<port>8080</port> <port>8080</port>
<!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa--> <!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa-->
<path>/</path> <path>/</path>
<uriEncoding>UTF-8</uriEncoding> <uriEncoding>UTF-8</uriEncoding>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd"> http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">
<!-- **************************************************************** --> <!-- **************************************************************** -->
<!-- Spring-MVC配置 --> <!-- Spring-MVC配置 -->
<!-- **************************************************************** --> <!-- **************************************************************** -->
<mvc:resources mapping="/**" location="/" /> <mvc:resources mapping="/**" location="/"/>
<mvc:annotation-driven> <mvc:annotation-driven>
<mvc:message-converters> <mvc:message-converters>
<!-- <ref bean="fastJsonHttpMessageConverter" /> --> <!-- <ref bean="fastJsonHttpMessageConverter" /> -->
<ref bean="mappingJackson2HttpMessageConverter" /> <ref bean="mappingJackson2HttpMessageConverter"/>
</mvc:message-converters> </mvc:message-converters>
</mvc:annotation-driven> </mvc:annotation-driven>
<!-- **************************************************************** --> <!-- **************************************************************** -->
<!-- 整合Thymeleaf3 --> <!-- 整合Thymeleaf3 -->
<!-- See: http://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html --> <!-- See: http://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html -->
<!-- **************************************************************** --> <!-- **************************************************************** -->
<bean id="templateResolver" <bean id="templateResolver"
class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver"> class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">
<property name="prefix" value="/WEB-INF/templates/" /> <property name="prefix" value="/WEB-INF/templates/"/>
<property name="suffix" value=".html" /> <property name="suffix" value=".html"/>
<property name="templateMode" value="HTML" /> <property name="templateMode" value="HTML"/>
<property name="cacheable" value="false" /> <property name="cacheable" value="false"/>
<property name="characterEncoding" value="UTF-8" /> <property name="characterEncoding" value="UTF-8"/>
</bean> </bean>
<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine"> <bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" /> <property name="templateResolver" ref="templateResolver"/>
<property name="enableSpringELCompiler" value="true" /> <property name="enableSpringELCompiler" value="true"/>
<property name="additionalDialects"> <property name="additionalDialects">
<set> <set>
<!-- Note the package would change to 'springsecurity3' if you are using <!-- Note the package would change to 'springsecurity3' if you are using
that version --> that version -->
<bean <bean
class="org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect" /> class="org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect"/>
</set> </set>
</property> </property>
</bean> </bean>
<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver"> <bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine" /> <property name="templateEngine" ref="templateEngine"/>
<property name="characterEncoding" value="UTF-8" /> <property name="characterEncoding" value="UTF-8"/>
<property name="order" value="100" /> <property name="order" value="100"/>
</bean> </bean>
</beans> </beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd ">
<bean id="standardPBEStringEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"> <bean id="standardPBEStringEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="password" <property name="password"
value="${atms_password:9C7jLBQ62cDbVwIzP85DIlzdAm76DdMb}" /> value="${atms_password:9C7jLBQ62cDbVwIzP85DIlzdAm76DdMb}"/>
</bean> </bean>
<bean id="encryptablePropertyPlaceholderConfigurer" <bean id="encryptablePropertyPlaceholderConfigurer"
class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer"> class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true" /> <property name="ignoreUnresolvablePlaceholders" value="true"/>
<constructor-arg ref="standardPBEStringEncryptor" /> <constructor-arg ref="standardPBEStringEncryptor"/>
<property name="locations"> <property name="locations">
<list> <list>
<!-- Base settings for all environments --> <!-- Base settings for all environments -->
<value>classpath:conf_base.properties</value> <value>classpath:conf_base.properties</value>
<!-- Settings for selected environment --> <!-- Settings for selected environment -->
<value>classpath:conf.properties <value>classpath:conf.properties
</value> </value>
</list> </list>
</property> </property>
</bean> </bean>
<context:component-scan base-package="pwc.taxtech.atms.web" /> <context:component-scan base-package="pwc.taxtech.atms.web"/>
<!-- <tx:annotation-driven proxy-target-class="true" /> --> <!-- <tx:annotation-driven proxy-target-class="true" /> -->
</beans> </beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment