浏览代码

Merge remote-tracking branch 'origin/master'

yanliming 5 年之前
父节点
当前提交
e47a7900bc

+ 181 - 0
picc-admin-server/picc-admin-server.iml

@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="ExternalSystem" externalSystem="Maven" />
+  <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
+    <facet type="web" name="Web">
+      <configuration>
+        <webroots>
+          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+        </webroots>
+        <sourceRoots>
+          <root url="file://$MODULE_DIR$/src/main/java" />
+          <root url="file://$MODULE_DIR$/src/main/resources" />
+        </sourceRoots>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="picc-common" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-annotations-api:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.1.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" />
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.3" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.4" level="project" />
+    <orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt-api:0.10.5" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: io.jsonwebtoken:jjwt-impl:0.10.5" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: io.jsonwebtoken:jjwt-jackson:0.10.5" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.lazyluke:log4jdbc-remix:0.2.7" level="project" />
+    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.1" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
+    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.27" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.12" level="project" />
+    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.0.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.9" level="project" />
+    <orderEntry type="library" name="Maven: com.github.dozermapper:dozer-core:6.4.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
+    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
+    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.13" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.13" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" />
+    <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
+    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.1.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
+    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: fr.opensagres.xdocreport:xdocreport:1.0.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:ooxml-schemas:1.3" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun.oss:aliyun-sdk-oss:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.10" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.12" level="project" />
+    <orderEntry type="library" name="Maven: org.jdom:jdom:1.1" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.jersey:jersey-json:1.9" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
+    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.3-1" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.9" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:3.4.0" level="project" />
+    <orderEntry type="library" name="Maven: org.json:json:20170516" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ram:3.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-sts:3.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ecs:4.2.0" level="project" />
+    <orderEntry type="library" name="Maven: com.taobao:taobao-sdk-java:1.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.13" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itext-asian:5.2.0" level="project" />
+  </component>
+</module>

+ 1 - 0
picc-admin-server/src/test/java/com/jpsoft/picc/test/CompanyTest.java

@@ -11,6 +11,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 import java.util.Date;
 import java.util.UUID;
 import java.util.function.Consumer;
+import java.util.function.Function;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest

+ 46 - 0
picc-admin-server/src/test/java/com/jpsoft/picc/test/NewApiTest.java

@@ -0,0 +1,46 @@
+package com.jpsoft.picc.test;
+
+import lombok.Data;
+import org.junit.Test;
+
+import java.util.Optional;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+public class NewApiTest {
+    @Data
+    private class Subject{
+        private Integer score;
+    }
+
+    @Data
+    private class Student{
+        private Subject subject;
+    }
+
+    @Test
+    public void testFunction(){
+        Function<Integer,Integer> func1 = i->i+2;
+        Function<Integer,Integer> func2 = i->i*3;
+
+        Consumer c = System.out::println;
+
+        c.accept(func2.andThen(func1).apply(2));
+    }
+
+    @Test
+    public void testOptional(){
+        Student student = new Student();
+        Subject subject = new Subject();
+        subject.setScore(100);
+
+        student.setSubject(subject);
+
+        Integer score = Optional.ofNullable(student)
+                        .map(Student::getSubject)
+                        .map(Subject::getScore)
+                        .orElse(null);
+
+        System.out.println(score);
+    }
+}

+ 23 - 0
picc-admin-server/src/test/java/com/jpsoft/picc/test/PdfTest.java

@@ -0,0 +1,23 @@
+package com.jpsoft.picc.test;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-2-4 13:10
+ */
+
+
+import com.jpsoft.picc.modules.common.utils.ItextPDFUtil;
+import java.util.ArrayList;
+
+/**
+ * 创建的pdf适合于桌面设备查看
+ */
+
+public class PdfTest {
+    public static void main(String[] args) throws Exception {
+
+        ItextPDFUtil.createPdf(new ArrayList());
+
+    }
+
+}

+ 116 - 0
picc-common/picc-common.iml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="ExternalSystem" externalSystem="Maven" />
+  <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.3" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
+    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-annotations-api:9.0.27" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.12" level="project" />
+    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.0.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.9" level="project" />
+    <orderEntry type="library" name="Maven: com.github.dozermapper:dozer-core:6.4.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
+    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
+    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.13" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.13" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.2" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" />
+    <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
+    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.1.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
+    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: fr.opensagres.xdocreport:xdocreport:1.0.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:ooxml-schemas:1.3" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun.oss:aliyun-sdk-oss:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.10" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.12" level="project" />
+    <orderEntry type="library" name="Maven: org.jdom:jdom:1.1" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.jersey:jersey-json:1.9" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
+    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.3-1" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.9" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:3.4.0" level="project" />
+    <orderEntry type="library" name="Maven: org.json:json:20170516" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ram:3.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-sts:3.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ecs:4.2.0" level="project" />
+    <orderEntry type="library" name="Maven: com.taobao:taobao-sdk-java:1.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.13" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itext-asian:5.2.0" level="project" />
+  </component>
+</module>

+ 4 - 0
picc-common/pom.xml

@@ -16,5 +16,9 @@
             <artifactId>pagehelper-spring-boot-starter</artifactId>
             <version>LATEST</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.embed</groupId>
+            <artifactId>tomcat-embed-core</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 372 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/ItextPDFUtil.java

@@ -0,0 +1,372 @@
+package com.jpsoft.picc.modules.common.utils;
+
+import com.itextpdf.text.*;
+import com.itextpdf.text.pdf.*;
+import com.itextpdf.text.pdf.codec.Base64;
+import com.itextpdf.text.pdf.draw.LineSeparator;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-2-5 18:39
+ */
+public class ItextPDFUtil {
+
+    /**
+     * 斜角排列、全屏多个重复的花式文字水印
+     *
+     * @param input             需要加水印的PDF读取输入流
+     * @param output            输出生成PDF的输出流
+     * @param waterMarkString   水印字符
+     * @param xAmout            x轴重复数量
+     * @param yAmout            y轴重复数量
+     * @param opacity           水印透明度
+     * @param rotation          水印文字旋转角度,一般为45度角
+     * @param waterMarkFontSize 水印字体大小
+     * @param color             水印字体颜色
+     */
+    public static void stringWaterMark(InputStream input, OutputStream output, String waterMarkString, int xAmout, int yAmout, float opacity, float rotation, int waterMarkFontSize, BaseColor color) {
+        try {
+
+            PdfReader reader = new PdfReader(input);
+            PdfStamper stamper = new PdfStamper(reader, output);
+
+            // 添加中文字体
+            BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
+
+            int total = reader.getNumberOfPages() + 1;
+
+            PdfContentByte over;
+            // 给每一页加水印
+            for (int i = 1; i < total; i++) {
+                Rectangle pageRect = stamper.getReader().getPageSizeWithRotation(i);
+                // 计算水印每个单位步长X,Y
+                float x = pageRect.getWidth() / xAmout;
+                float y = pageRect.getHeight() / yAmout;
+
+                over = stamper.getOverContent(i);
+                PdfGState gs = new PdfGState();
+                // 设置透明度为
+                gs.setFillOpacity(opacity);
+
+                over.setGState(gs);
+                over.saveState();
+
+                over.beginText();
+                over.setColorFill(color);
+                over.setFontAndSize(baseFont, waterMarkFontSize);
+
+                for (int n = 0; n < xAmout + 1; n++) {
+                    for (int m = 0; m < yAmout + 1; m++) {
+                        over.showTextAligned(Element.ALIGN_CENTER, waterMarkString, x * n, y * m, rotation);
+                    }
+                }
+
+                over.endText();
+            }
+            stamper.close();
+        } catch (Exception e) {
+            new Exception("NetAnd PDF add Text Watermark error" + e.getMessage());
+        }
+    }
+
+
+    public static void addPdfTextMark(String InPdfFile, String outPdfFile, String textMark, int textWidth, int textHeight) throws Exception {
+        PdfReader reader = new PdfReader(InPdfFile, "PDF".getBytes());
+        PdfStamper stamp = new PdfStamper(reader, new FileOutputStream(new File(outPdfFile)));
+        PdfContentByte under;
+        BaseFont font = BaseFont.createFont("C:/WINDOWS/Fonts/SIMSUN.TTC,1", "Identity-H", true);// 使用系统字体
+        int pageSize = reader.getNumberOfPages();// 原pdf文件的总页数
+        for (int i = 1; i <= pageSize; i++) {
+            under = stamp.getUnderContent(i);// 水印在之前文本下
+          //  under = stamp.getOverContent(i);//水印在之前文本上
+            under.beginText();
+            under.setColorFill(new BaseColor(211, 211, 211));// 文字水印 颜色
+            under.setFontAndSize(font, 38);// 文字水印 字体及字号
+            under.setTextMatrix(textWidth, textHeight);// 文字水印 起始位置
+            under.showTextAligned(Element.ALIGN_CENTER, textMark, textWidth, textHeight, 45);
+            under.endText();
+        }
+        stamp.close();// 关闭
+    }
+
+
+    public static void createPdf(List list)throws Exception{
+        //测试pdf保存路径
+        String filePath = "C:/Users/Administrator/Desktop/test4.pdf";
+        File file = new File(filePath);
+
+
+        //创建文件
+        Document document = new Document(PageSize.A4, 80, 80, 30, 20);
+        //建立一个书写器
+        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
+
+
+        writer.setPageEvent(new Watermark("PICC"));
+
+
+        // 页眉/页脚
+        writer.setPageEvent(new MyHeaderFooter());
+        //打开文件
+        document.open();
+        // 4.向文档中添加内容
+        new ItextPDFUtil().generatePDF(document);
+        //关闭文档
+        document.close();
+        //关闭书写器
+        writer.close();
+
+    }
+
+    // 定义全局的字体静态变量
+    private static Font titlefont;
+    private static Font headfont;
+    private static Font keyfont;
+    private static Font textfont;
+    // 最大宽度
+    private static int maxWidth = 520;
+
+    // 静态代码块
+    static {
+        try {
+            // 不同字体(这里定义为同一种字体:包含不同字号、不同style)
+
+            BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
+            titlefont = new Font(bfChinese, 16, Font.BOLD);
+            headfont = new Font(bfChinese, 14, Font.BOLD);
+            keyfont = new Font(bfChinese, 10, Font.BOLD);
+            textfont = new Font(bfChinese, 11, Font.NORMAL);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    // 生成PDF文件
+
+    public void generatePDF(Document document) throws Exception {
+        Image image1 = Image.getInstance("C:/Users/Administrator/Desktop/picc/logo.png");
+        Paragraph p1 = new Paragraph("00000000000001", titlefont);
+        //设置文字居中 0靠左   1,居中     2,靠右
+        p1.setAlignment(2);
+        //设置左缩进
+        p1.setIndentationLeft(12);
+        p1.setIndentationRight(12); //设置右缩进
+        p1.setFirstLineIndent(24); //设置首行缩进
+        p1.setLeading(0f); //行间距
+        p1.setSpacingBefore(5f); //设置段落上空白
+        p1.setSpacingAfter(5f); //设置段落下空白
+
+        // 直线
+        LineSeparator line = new LineSeparator(2f, 110, BaseColor.RED, Element.ALIGN_CENTER, -5f);
+
+        //段落2
+        Paragraph p2 = new Paragraph("雇主责任保险(2015版) 投保单", headfont);
+        p2.setAlignment(1);
+        p2.setSpacingBefore(5f); //设置段落上空白
+        p2.setSpacingAfter(5f); //设置段落下空白
+
+        //段落3
+        Paragraph p3 = new Paragraph("尊敬的投保人:在您填写本投保单前请先详细阅读《中国人民财产保险股份有限公司雇主责任保险条款(2015版)》,阅读条款时请您特别注意条款中的保险责任、责任免除、投保人被保险人义务、赔偿处理等内容并听取保险人就条款(包括前述需特别注意的内容)所作的说明。", textfont);
+        p3.setAlignment(0);
+        p3.setIndentationLeft(8);
+        p3.setFirstLineIndent(24); //设置首行缩进
+        p3.setSpacingAfter(10f);
+
+        //表格
+        PdfPTable table = PdfTable.createTable(new float[]{20, 65, 60, 70, 60, 65,120});
+        table.addCell(PdfTable.createCell("一、投保人、被保险人信息", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
+        table.addCell(PdfTable.createCell("投保人名称", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("联系电话", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("被保险人信息", textfont, Element.ALIGN_CENTER,1,5,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("名    称", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("营业性质", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("证件类型", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("□组织机构代码证\n" +"□税务登记证\n" +"□工商登记证\n"+"□营业执照", textfont, Element.ALIGN_LEFT,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("证件号码", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("营业范围", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("行业类别", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("雇员人数", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("投保人数", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("联系电话", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("联系地址", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("邮    编", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("近三年损失情况(时间、原因、损失金额)", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,5,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("二、承保信息", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
+
+        table.addCell(PdfTable.createCell("主险", textfont, Element.ALIGN_CENTER,2,7,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("限额名称", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("责任限额/免赔额", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("保险费(元)", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("累计责任限额", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,6,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("每次事故责任限额", textfont, Element.ALIGN_CENTER,1,4,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("每次事故责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("每人伤亡责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("每人医疗费用责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("法律费用责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("每次事故每人医疗费用免赔额", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("附加险", textfont, Element.ALIGN_CENTER,2,4,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("□附加职业病责任保险", textfont, Element.ALIGN_LEFT,4,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell(" ", textfont, Element.ALIGN_CENTER,4,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell(" ", textfont, Element.ALIGN_CENTER,4,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell(" ", textfont, Element.ALIGN_CENTER,4,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("保险费合计(人民币)", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("(大写):\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000(小写):¥ ", textfont, Element.ALIGN_LEFT,5,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("保险期间", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("自\u3000\u3000\u3000年\u3000月\u3000日零时起至\u3000\u3000\u3000年\u3000月\u3000日二十四时止。", textfont, Element.ALIGN_CENTER,5,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("保险合同争议处理", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("□提交______________仲裁委员会仲裁  □诉讼", textfont, Element.ALIGN_LEFT,5,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("司法管辖", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_LEFT,5,1,BaseColor.WHITE,false));
+
+        table.addCell(PdfTable.createCell("三、特别约定", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
+        table.addCell(PdfTable.createCell("特别约定", textfont, Element.ALIGN_CENTER, 2,1,BaseColor.WHITE, true));
+        table.addCell(PdfTable.createCell("1、发生保险事故后,被保险人必须在24小时内拨打95518电话报案,及时通知保险公司,未及时报案造成的损失和后果由被保险人负责。\n" +
+                "2、每次事故每人医疗费用免赔率10%,每次事故误工补贴50元/天,免赔天数3天,最高赔付180天。\n" +
+                "3、雇员残疾的,保险人按照《人身保险伤残评定标准》所对应伤残等级的给付比例乘以每人伤亡责任限额赔偿。《人身保险伤残评定标准》指中国保险行业协会发布的人身保险伤残程度评定与保险金给付比例标准,详见《关于印发<人身保险伤残评定标准>的通知》(中保协发【2013】88号)。\n" +
+                "4、本标准对功能和残疾进行了分类和分级,将人身保险伤残程度划分为一至十级,最重为第一级,最轻为第十级。与人身保险伤残程度等级相对应的保险金给付比例分为十档,伤残程度第一级对应的保险金给付比例为100%,伤残程度第十级对应的保险金给付比例为10%,每级相差10%。\n" +
+                "5、本保险单项下已扩展24小时(即全天候)。无论员工在工作或非工作期间所受意外伤害,我公司均负责赔偿。", textfont, Element.ALIGN_LEFT, new float[]{0,1,1,0},new float[]{5,10},5,1,BaseColor.WHITE, false));
+
+        table.addCell(PdfTable.createCell("四、投保人声明", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
+        table.addCell(PdfTable.createCell("投保人声明", keyfont, Element.ALIGN_CENTER, 2,2,BaseColor.WHITE, true));
+        table.addCell(PdfTable.createCell("\u3000\u3000保险人已向本人提供并详细介绍了中国人民财产保险雇主责任保险条款(2015版),并对其中免除保险人责任的条款(包括但不限于责任免除、投保人被保险人义务、赔偿处理、其他事项等),以及本保险合同中付费约定和特别约定的内容向本人做了明确说明,本人已充分理解并接受上述内容,同意以此作为订立保险合同的依据,自愿投保本保险。\n" +
+                "\u3000\u3000本人授权贵公司可以从第三方就有关保险服务事宜查询、收集与本人相关的信息。本人同意贵公司将本人提供的信息、本人接受贵公司保险服务产生的信息以及贵公司从第三方查询、收集的信息(包括本单证签署之前提供、查询收集和产生的),用于人保集团及其因服务必要而委托的第三方,向本人提供服务、推介产品、开展市场调查与信息数据分析。人保集团及其委托的第三方对上述个人信息依法承担保密和信息安全义务。本条中贵公司是指中国人民财产保险股份有限公司,“人保集团”是指中国人民保险集团股份有限公司及其作为控股股东、实际控制人的公司。本授权自本单证签署时生效,具有独立法律效力,不受合同成立与否及效力状态变化的影响。如取消或变更授权,请携带有效证件在办理业务的我公司营业网点办理。\n" +
+                "\u3000\u3000上述所填写的内容均属实。", keyfont, Element.ALIGN_LEFT, new float[]{0,1,0,0},new float[]{5,5},5,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("投保人签名 / 签章:\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000_________年____月____日", textfont, Element.ALIGN_RIGHT, new float[]{0,1,0,1},new float[]{50,5},5,1,BaseColor.WHITE, false));
+
+
+
+        PdfPTable table2 = PdfTable.createTable(new float[]{70, 70, 70, 70, 70, 110});
+        table2.setSpacingBefore(20F);
+        table2.setSpacingAfter(90F);
+        table2.addCell(PdfTable.createCell("以下内容由保险公司填写", keyfont, Element.ALIGN_LEFT, new float[]{2,2,2,2},new float[]{0,7},6,1,BaseColor.WHITE, false));
+
+        PdfPTable table3 = PdfTable.createTable(new float[]{70, 70, 70, 70, 80, 100});
+        table3.setSpacingBefore(10F);
+        table3.addCell(PdfTable.createCell("业务来源", textfont, Element.ALIGN_LEFT, new float[]{2,0,2,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell(" ", textfont, Element.ALIGN_CENTER, new float[]{0,2,2,0},new float[]{0,7},6,1,BaseColor.WHITE, false));
+
+        table3.addCell(PdfTable.createCell(" ", textfont, Element.ALIGN_CENTER, new float[]{2,0,0,0},new float[]{0,7},1,2,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("□直接业务", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("□个人代理", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("□电话业务", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("□网上投保", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell(" ", textfont, Element.ALIGN_CENTER, new float[]{0,2,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+
+        table3.addCell(PdfTable.createCell("□专业代理", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("□兼业代理", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("□经纪业务", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("名称及代码:", textfont, Element.ALIGN_LEFT, new float[]{0,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("_____________", textfont, Element.ALIGN_LEFT, new float[]{0,2,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+
+        table3.addCell(PdfTable.createCell("销售机构:", textfont, Element.ALIGN_LEFT, new float[]{2,0,0,0},new float[]{0,7},1,1,BaseColor.WHITE, false));
+        table3.addCell(PdfTable.createCell("__________________________________________________________", textfont, Element.ALIGN_LEFT, new float[]{0,2,0,0},new float[]{0,7},5,1,BaseColor.WHITE, false));
+
+        table3.addCell(PdfTable.createCell("业务员:___________ 代码:__________  联系电话:_____________ 日期:______________", textfont, Element.ALIGN_LEFT, new float[]{2,2,0,2},new float[]{0,7},6,1,BaseColor.WHITE, false));
+        document.add(image1);
+        document.add(p1);
+        document.add(line);
+        document.add(p2);
+        document.add(p3);
+        document.add(table);
+        document.add(table2);
+        document.add(table3);
+        document.newPage();
+
+        Paragraph newP1 = new Paragraph("中国人民财产保险股份有限公司  雇主责任保险(2015版)  投保清单", headfont);
+        newP1.setAlignment(1);
+        newP1.setSpacingBefore(5f); //设置段落上空白
+        newP1.setSpacingAfter(5f); //设置段落下空白
+
+        Paragraph newP2 = new Paragraph("投保单号:____________________", textfont);
+        //设置文字居中 0靠左   1,居中     2,靠右
+        newP2.setAlignment(2);
+        newP2.setSpacingBefore(10F);
+
+        PdfPTable table4 = PdfTable.createTable(new float[]{30, 50, 50, 110, 30, 30,80,80});
+        table4.setSpacingBefore(10F);
+        table4.addCell(PdfTable.createCell("序号", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("姓名", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("证件类型", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("证件号码", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("性别", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("年龄", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("岗位/工种", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        table4.addCell(PdfTable.createCell("健康情况", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+
+        List list = new ArrayList();
+        for (int i =0;i<list.size();i++){
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+        }
+
+
+
+        document.add(image1);
+        document.add(line);
+        document.add(newP1);
+        document.add(newP2);
+        document.add(table4);
+
+    }
+
+}

+ 72 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/MyHeaderFooter.java

@@ -0,0 +1,72 @@
+package com.jpsoft.picc.modules.common.utils;
+
+import com.itextpdf.text.*;
+import com.itextpdf.text.pdf.*;
+
+import java.io.IOException;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-2-5 13:39
+ * 页眉页脚
+ */
+public class MyHeaderFooter extends PdfPageEventHelper {
+
+
+    // 总页数
+
+    PdfTemplate totalPage;
+
+    Font hfFont;
+
+    {
+        try {
+            hfFont = new Font(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED), 8, Font.NORMAL);
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    // 打开文档时,创建一个总页数的模版
+    @Override
+    public void onOpenDocument(PdfWriter writer, Document document) {
+        PdfContentByte cb = writer.getDirectContent();
+        totalPage = cb.createTemplate(30, 16);
+    }
+
+    // 一页加载完成触发,写入页眉和页脚
+    @Override
+    public void onEndPage(PdfWriter writer, Document document) {
+        PdfPTable table = new PdfPTable(3);
+        try {
+            table.setTotalWidth(PageSize.A4.getWidth() - 100);
+            table.setWidths(new int[]{24, 24, 3});
+            table.setLockedWidth(true);
+            table.getDefaultCell().setFixedHeight(-10);
+            table.getDefaultCell().setBorder(Rectangle.BOTTOM);
+          //  table.addCell(new Paragraph("我是页眉/页脚", hfFont));// 可以直接使用addCell(str),不过不能指定字体,中文无法显示
+            table.addCell("");
+            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
+            table.addCell(new Paragraph("第" + writer.getPageNumber() + "页/", hfFont));
+            // 总页数
+            PdfPCell cell = new PdfPCell(Image.getInstance(totalPage));
+            cell.setBorder(Rectangle.BOTTOM);
+            table.addCell(cell);
+            // 将页眉写到document中,位置可以指定,指定到下面就是页脚
+            table.writeSelectedRows(0, -1, 50, PageSize.A4.getHeight() - 822, writer.getDirectContent());
+        } catch (Exception de) {
+            throw new ExceptionConverter(de);
+        }
+    }
+
+    // 全部完成后,将总页数的pdf模版写到指定位置
+    @Override
+    public void onCloseDocument(PdfWriter writer, Document document) {
+        String text = "总" + (writer.getPageNumber()) + "页";
+        ColumnText.showTextAligned(totalPage, Element.ALIGN_LEFT, new Paragraph(text, hfFont), 1, 6, 0);
+    }
+
+
+}

+ 243 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/PdfTable.java

@@ -0,0 +1,243 @@
+package com.jpsoft.picc.modules.common.utils;
+
+import com.itextpdf.text.*;
+import com.itextpdf.text.pdf.PdfPCell;
+import com.itextpdf.text.pdf.PdfPTable;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-2-5 15:38
+ */
+public class PdfTable {
+
+    private static int maxWidth = 460;
+    /**
+     * 创建单元格(指定字体)
+     * @param value
+     * @param font
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font) {
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setPhrase(new Phrase(value, font));
+        return cell;
+    }
+
+    /**
+     * 创建单元格(指定字体、水平..)
+     * @param value
+     * @param font
+     * @param align
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font, int align) {
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(align);
+        cell.setPhrase(new Phrase(value, font));
+        return cell;
+    }
+
+    /**
+     * 创建单元格(指定字体、水平居..、单元格跨x列合并)
+     * @param value
+     * @param font
+     * @param align
+     * @param colspan
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font, int align, int colspan) {
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(align);
+        cell.setColspan(colspan);
+        cell.setPhrase(new Phrase(value, font));
+        return cell;
+    }
+
+    /**
+     * 创建单元格(指定字体、水平居..、单元格跨x列合并、设置单元格内边距)
+     * @param value
+     * @param font
+     * @param align
+     * @param colspan
+     * @param boderFlag
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font, int align, int colspan, boolean boderFlag) {
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(align);
+        cell.setColspan(colspan);
+        cell.setPhrase(new Phrase(value, font));
+        cell.setPadding(3.0f);
+        if (!boderFlag) {
+            cell.setBorder(0);
+            cell.setPaddingTop(15.0f);
+            cell.setPaddingBottom(8.0f);
+        } else if (boderFlag) {
+            cell.setBorder(0);
+        //    cell.setBackgroundColor(BaseColor.PINK);
+        //    cell.setRowspan(6);
+            cell.setPaddingTop(0.0f);
+            cell.setPaddingBottom(15.0f);
+        }
+        return cell;
+    }
+
+    /**
+     * 创建单元格(指定字体、水平居..、单元格跨x列合并、设置单元格内边距)
+     * @param value
+     * @param font
+     * @param align
+     * @param colspan
+     * @param boderFlag
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font, int align, int colspan,int rowspan,BaseColor baseColor, boolean boderFlag) {
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(align);
+        cell.setColspan(colspan);
+        cell.setRowspan(rowspan);
+        cell.setBackgroundColor(baseColor);
+        cell.setPhrase(new Phrase(value, font));
+        cell.setPadding(3.0f);
+        if (!boderFlag) {
+         //   cell.setBorder(0);
+            cell.setPaddingTop(3.0f);
+            cell.setPaddingBottom(6.0f);
+        } else if (boderFlag) {
+         //   cell.setBorder(0);
+            cell.setPaddingTop(2.0f);
+            cell.setPaddingBottom(4.0f);
+        }
+        return cell;
+    }
+
+    /**
+     * 创建单元格(指定字体、水平..、边框宽度:0表示无边框、内边距)
+     * @param value
+     * @param font
+     * @param align
+     * @param borderWidth
+     * @param paddingSize
+     * @param flag
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font, int align, float[] borderWidth, float[] paddingSize, boolean flag) {
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(align);
+        cell.setPhrase(new Phrase(value, font));
+        cell.setBorderWidthLeft(borderWidth[0]);
+        cell.setBorderWidthRight(borderWidth[1]);
+        cell.setBorderWidthTop(borderWidth[2]);
+        cell.setBorderWidthBottom(borderWidth[3]);
+        cell.setPaddingTop(paddingSize[0]);
+        cell.setPaddingBottom(paddingSize[1]);
+        if (flag) {
+            cell.setColspan(2);
+        }
+        return cell;
+    }
+
+    /**
+     * 创建单元格(指定字体、水平..、边框宽度:0表示无边框、内边距)
+     * @param value
+     * @param font
+     * @param align
+     * @param borderWidth
+     * @param paddingSize
+     * @param flag
+     * @return
+     */
+    public static PdfPCell createCell(String value, Font font, int align, float[] borderWidth, float[] paddingSize,int colspan,int rowspan,BaseColor baseColor,  boolean flag) {
+
+        /*Paragraph paragraph = new Paragraph(value);
+        paragraph.setLeading(0,4);*/
+        /*paragraph.setAlignment(0);
+        paragraph.setIndentationLeft(8);
+        paragraph.setFirstLineIndent(24); //设置首行缩进
+        paragraph.setSpacingAfter(10f);*/
+      //  paragraph.setPaddingTop(5);
+
+        PdfPCell cell = new PdfPCell();
+        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+        cell.setHorizontalAlignment(align);
+        cell.setLeading(1.5F,1.5F);
+        cell.setColspan(colspan);
+        cell.setRowspan(rowspan);
+        cell.setBackgroundColor(baseColor);
+        cell.setPhrase(new Phrase(value, font));
+        cell.setBorderWidthLeft(borderWidth[0]);
+        cell.setBorderWidthRight(borderWidth[1]);
+        cell.setBorderWidthTop(borderWidth[2]);
+        cell.setBorderWidthBottom(borderWidth[3]);
+        cell.setPaddingLeft(4F);
+        cell.setPaddingRight(4F);
+        cell.setPaddingTop(paddingSize[0]);
+        cell.setPaddingBottom(paddingSize[1]);
+        if (flag) {
+            cell.setColspan(2);
+        }
+        return cell;
+    }
+
+    /**------------------------创建表格单元格的方法end----------------------------*/
+
+
+    /**--------------------------创建表格的方法start------------------- ---------*/
+    /**
+     * 创建默认列宽,指定列数、水平(居中、右、左)的表格
+     * @param colNumber
+     * @param align
+     * @return
+     */
+    public static PdfPTable createTable(int colNumber, int align) {
+        PdfPTable table = new PdfPTable(colNumber);
+        try {
+            table.setTotalWidth(maxWidth);
+            table.setLockedWidth(true);
+            table.setHorizontalAlignment(align);
+            table.getDefaultCell().setBorder(1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return table;
+    }
+
+    /**
+     * 创建指定列宽、列数的表格
+     * @param widths
+     * @return
+     */
+    public static PdfPTable createTable(float[] widths) {
+        PdfPTable table = new PdfPTable(widths);
+        try {
+            table.setTotalWidth(maxWidth);
+            table.setLockedWidth(true);
+            table.setHorizontalAlignment(Element.ALIGN_CENTER);
+            table.getDefaultCell().setBorder(1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return table;
+    }
+
+    /**
+     * 创建空白的表格
+     * @return
+     */
+    public static PdfPTable createBlankTable(Font keyfont) {
+        PdfPTable table = new PdfPTable(1);
+        table.getDefaultCell().setBorder(0);
+        table.addCell(createCell("", keyfont));
+        table.setSpacingAfter(20.0f);
+        table.setSpacingBefore(20.0f);
+        return table;
+    }/**--------------------------创建表格的方法end------------------- ---------*/
+
+}

+ 43 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/Watermark.java

@@ -0,0 +1,43 @@
+package com.jpsoft.picc.modules.common.utils;
+
+import com.itextpdf.text.Document;
+import com.itextpdf.text.Element;
+import com.itextpdf.text.Font;
+import com.itextpdf.text.Phrase;
+import com.itextpdf.text.pdf.ColumnText;
+import com.itextpdf.text.pdf.GrayColor;
+import com.itextpdf.text.pdf.PdfPageEventHelper;
+import com.itextpdf.text.pdf.PdfWriter;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-2-5 13:30
+ * 水印
+ */
+public class Watermark extends PdfPageEventHelper {
+
+
+    Font FONT = new Font(Font.FontFamily.HELVETICA, 30, Font.BOLD, new GrayColor(0.95f));
+    private String waterCont;//水印内容
+
+    public Watermark() {
+    }
+
+    public Watermark(String waterCont) {
+        this.waterCont = waterCont;
+    }
+
+    @Override
+    public void onEndPage(PdfWriter writer, Document document) {
+        for (int i = 0; i < 5; i++) {
+            for (int j = 0; j < 5; j++) {
+                ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER,
+                        new Phrase(this.waterCont == null ? "PICC" : this.waterCont, FONT),
+                        (50.5f + i * 250),
+                        (40.0f + j * 150),
+                        writer.getPageNumber() % 2 == 1 ? 45 : -45);
+            }
+        }
+    }
+
+}

+ 169 - 0
picc-enterprise-server/picc-enterperise-server.iml

@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="picc-common" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-annotations-api:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: net.unicon.cas:cas-client-autoconfig-support:2.3.0-GA" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
+    <orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jasig.cas.client:cas-client-core:3.5.1" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: org.jasig.cas.client:cas-client-support-saml:3.5.1" level="project" />
+    <orderEntry type="library" name="Maven: joda-time:joda-time:2.10.5" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.5.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.1.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.13.2" level="project" />
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.1" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.3" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.4" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.13" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.13" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" />
+    <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
+    <orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.1.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.7.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.lazyluke:log4jdbc-remix:0.2.7" level="project" />
+    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.1" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
+    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
+    <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.9.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.27" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.27" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.12" level="project" />
+    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.0.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.9" level="project" />
+    <orderEntry type="library" name="Maven: com.github.dozermapper:dozer-core:6.4.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
+    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
+    <orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
+    <orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.29" level="project" />
+    <orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
+    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: fr.opensagres.xdocreport:xdocreport:1.0.6" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:ooxml-schemas:1.3" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun.oss:aliyun-sdk-oss:3.1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.10" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.12" level="project" />
+    <orderEntry type="library" name="Maven: org.jdom:jdom:1.1" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.jersey:jersey-json:1.9" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
+    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.3-1" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.3" level="project" />
+    <orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.9" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:3.4.0" level="project" />
+    <orderEntry type="library" name="Maven: org.json:json:20170516" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ram:3.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-sts:3.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ecs:4.2.0" level="project" />
+    <orderEntry type="library" name="Maven: com.taobao:taobao-sdk-java:1.0.0" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.13" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itext-asian:5.2.0" level="project" />
+  </component>
+</module>

+ 13 - 0
pom.xml

@@ -122,5 +122,18 @@
             <version>1.0.0</version>
         </dependency>
         <!-- 阿里大鱼短信jar包 end-->
+
+
+        <!--html转pdf start-->
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>itextpdf</artifactId>
+            <version>5.5.13</version>
+        </dependency>
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>itext-asian</artifactId>
+            <version>5.2.0</version>
+        </dependency>
     </dependencies>
 </project>