humuyu преди 2 години
родител
ревизия
f4f15aa844

+ 20 - 0
eladmin-system/src/main/java/me/zhengjie/archives/plus/QueryMapUtil.java

@@ -0,0 +1,20 @@
+package me.zhengjie.archives.plus;
+
+import java.util.Map;
+
+public class QueryMapUtil {
+	Map<String, Object> map;
+
+	public Map<String, Object> getMap() {
+		return map;
+	}
+
+	public void setMap(Map<String, Object> map) {
+		this.map = map;
+	}
+
+	public QueryMapUtil() {
+
+	}
+
+}

+ 132 - 0
eladmin-system/src/main/java/me/zhengjie/archives/util/AddWatermarkText.java

@@ -0,0 +1,132 @@
+///*
+// * Licensed to the Apache Software Foundation (ASF) under one or more
+// * contributor license agreements.  See the NOTICE file distributed with
+// * this work for additional information regarding copyright ownership.
+// * The ASF licenses this file to You under the Apache License, Version 2.0
+// * (the "License"); you may not use this file except in compliance with
+// * the License.  You may obtain a copy of the License at
+// *
+// *      http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS,
+// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// * See the License for the specific language governing permissions and
+// * limitations under the License.
+// */
+//package org.apache.pdfbox.examples.util;
+//
+//import java.awt.Color;
+//import java.io.File;
+//import java.io.IOException;
+//
+//import org.apache.pdfbox.Loader;
+//import org.apache.pdfbox.pdmodel.PDDocument;
+//import org.apache.pdfbox.pdmodel.PDPage;
+//import org.apache.pdfbox.pdmodel.PDPageContentStream;
+//import org.apache.pdfbox.pdmodel.font.PDFont;
+//import org.apache.pdfbox.pdmodel.font.PDType1Font;
+//import org.apache.pdfbox.pdmodel.font.Standard14Fonts.FontName;
+//import org.apache.pdfbox.pdmodel.graphics.blend.BlendMode;
+//import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState;
+//import org.apache.pdfbox.util.Matrix;
+//
+///**
+// * Add a diagonal watermark text to each page of a PDF.
+// *
+// * @author Tilman Hausherr
+// */
+//public class AddWatermarkText
+//{
+//    private AddWatermarkText()
+//    {
+//    }
+//
+//    public static void main(String[] args) throws IOException
+//    {
+//        if (args.length != 3)
+//        {
+//            usage();
+//        }
+//        else
+//        {
+//            File srcFile = new File(args[0]);
+//            File dstFile = new File(args[1]);
+//            String text = args[2];
+//
+//            try (PDDocument doc = Loader.loadPDF(srcFile))
+//            {
+//                for (PDPage page : doc.getPages())
+//                {
+//                    PDFont font = new PDType1Font("Helvetica"FontName.HELVETICA);
+//                    addWatermarkText(doc, page, font, text);
+//                }
+//                doc.save(dstFile);
+//            }
+//        }
+//    }
+//
+//    private static void addWatermarkText(PDDocument doc, PDPage page, PDFont font, String text)
+//            throws IOException
+//    {
+//        try (PDPageContentStream cs
+//                = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.APPEND, true, true))
+//        {
+//            float fontHeight = 100; // arbitrary for short text
+//            float width = page.getMediaBox().getWidth();
+//            float height = page.getMediaBox().getHeight();
+//            
+//            int rotation = page.getRotation();
+//            switch (rotation)
+//            {
+//                case 90:
+//                    width = page.getMediaBox().getHeight();
+//                    height = page.getMediaBox().getWidth();
+//                    cs.transform(Matrix.getRotateInstance(Math.toRadians(90), height, 0));
+//                    break;
+//                case 180:
+//                    cs.transform(Matrix.getRotateInstance(Math.toRadians(180), width, height));
+//                    break;
+//                case 270:
+//                    width = page.getMediaBox().getHeight();
+//                    height = page.getMediaBox().getWidth();
+//                    cs.transform(Matrix.getRotateInstance(Math.toRadians(270), 0, width));
+//                    break;
+//                default:
+//                    break;
+//            }
+//
+//            float stringWidth = font.getStringWidth(text) / 1000 * fontHeight;
+//            float diagonalLength = (float) Math.sqrt(width * width + height * height);
+//            float angle = (float) Math.atan2(height, width);
+//            float x = (diagonalLength - stringWidth) / 2; // "horizontal" position in rotated world
+//            float y = -fontHeight / 4; // 4 is a trial-and-error thing, this lowers the text a bit
+//            cs.transform(Matrix.getRotateInstance(angle, 0, 0));
+//            cs.setFont(font, fontHeight);
+//            // cs.setRenderingMode(RenderingMode.STROKE) // for "hollow" effect
+//
+//            PDExtendedGraphicsState gs = new PDExtendedGraphicsState();
+//            gs.setNonStrokingAlphaConstant(0.2f);
+//            gs.setStrokingAlphaConstant(0.2f);
+//            gs.setBlendMode(BlendMode.MULTIPLY);
+//            gs.setLineWidth(3f);
+//            cs.setGraphicsStateParameters(gs);
+//
+//            cs.setNonStrokingColor(Color.red);
+//            cs.setStrokingColor(Color.red);
+//
+//            cs.beginText();
+//            cs.newLineAtOffset(x, y);
+//            cs.showText(text);
+//            cs.endText();
+//        }
+//    }
+//
+//    /**
+//     * This will print the usage.
+//     */
+//    private static void usage()
+//    {
+//        System.err.println("Usage: java " + AddWatermarkText.class.getName() + " <input-pdf> <output-pdf> <short text>");
+//    }
+//}

+ 13 - 0
eladmin-system/src/main/java/me/zhengjie/archives/vo/CaseNumVo.java

@@ -0,0 +1,13 @@
+package me.zhengjie.archives.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@Getter
+@Setter
+@ToString
+public class CaseNumVo {
+	private String year;
+	private String catalogNum;
+}

+ 131 - 0
eladmin-system/src/main/resources/config/application-test.yml

@@ -0,0 +1,131 @@
+#配置数据源
+spring:
+  datasource:
+    druid:
+      db-type: com.alibaba.druid.pool.DruidDataSource
+      driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
+      url: jdbc:log4jdbc:mysql://114.55.230.80:3306/efs?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
+      username: root
+      password: QopraffaQWPRPPR123
+      # 初始连接数
+      initial-size: 5
+      # 最小连接数
+      min-idle: 15
+      # 最大连接数
+      max-active: 30
+      # 超时时间(以秒数为单位)
+      remove-abandoned-timeout: 180
+      # 获取连接超时时间
+      max-wait: 3000
+      # 连接有效性检测时间
+      time-between-eviction-runs-millis: 60000
+      # 连接在池中最小生存的时间
+      min-evictable-idle-time-millis: 300000
+      # 连接在池中最大生存的时间
+      max-evictable-idle-time-millis: 900000
+      # 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
+      test-while-idle: true
+      # 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
+      test-on-borrow: true
+      # 是否在归还到池中前进行检验
+      test-on-return: false
+      # 检测连接是否有效
+      validation-query: select 1
+      # 配置监控统计
+      webStatFilter:
+        enabled: true
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+      filter:
+        stat:
+          enabled: true
+          # 记录慢SQL
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+  redis:
+    #数据库索引
+    database: 0
+    host: 114.55.230.80
+    port: 6379
+    password: 123qysd!@#
+    #连接超时时间
+    timeout: 5000
+# 登录相关配置
+login:
+  #  是否限制单用户登录
+  single-login: false
+  # Redis用户登录缓存配置
+  user-cache:
+    # 存活时间/秒
+    idle-time: 7200
+  #  验证码
+  login-code:
+    #  验证码类型配置 查看 LoginProperties 类
+    code-type: arithmetic
+    #  登录图形验证码有效时间/分钟
+    expiration: 2
+    #  验证码高度
+    width: 111
+    #  验证码宽度
+    height: 36
+    # 内容长度
+    length: 2
+    # 字体名称,为空则使用默认字体
+    font-name:
+    # 字体大小
+    font-size: 25
+
+#jwt
+jwt:
+  header: Authorization
+  # 令牌前缀
+  token-start-with: Bearer
+  # 必须使用最少88位的Base64对该令牌进行编码
+  base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
+  # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
+  token-validity-in-seconds: 14400000
+  # 在线用户key
+  online-key: online-token-
+  # 验证码
+  code-key: code-key-
+  # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
+  detect: 1800000
+  # 续期时间范围,默认1小时,单位毫秒
+  renew: 3600000
+
+#是否允许生成代码,生产环境设置为false
+generator:
+  enabled: true
+
+#是否开启 swagger-ui
+swagger:
+  enabled: true
+
+# IP 本地解析
+ip:
+  local-parsing: true
+
+# 文件存储路径
+file:
+  mac:
+    path: ~/file/
+    avatar: ~/avatar/
+  linux:
+    path: /home/eladmin/file/
+    avatar: /home/eladmin/avatar/
+  windows:
+    path: C:\eladmin\file\
+    avatar: C:\eladmin\avatar\
+  # 文件大小 /M
+  maxSize: 100
+  avatarMaxSize: 5
+html2Pdf:
+  simsumPath: font/simsun.ttf
+  simfangPath: font/simfang.ttf
+  toolName: OpenPDF

BIN
eladmin-system/src/main/resources/font/simfang.ttf


BIN
eladmin-system/src/main/resources/font/simsun.ttf


+ 6 - 0
eladmin-system/src/main/resources/snippet/Snippet.java

@@ -0,0 +1,6 @@
+package snippet;
+
+public class Snippet {
+	
+}
+