Przeglądaj źródła

max-record-size.pc, page.preview.show-export-buttons etc are dynamic

sunyj 8 lat temu
rodzic
commit
81e2802e9c

+ 48 - 6
report/src/main/java/com/uas/report/SpecialProperties.java → report/src/main/java/com/uas/report/DynamicProperties.java

@@ -2,6 +2,7 @@ package com.uas.report;
 
 import com.alibaba.fastjson.JSONObject;
 import com.uas.report.annotation.DynamicValue;
+import com.uas.report.model.ExportType;
 import com.uas.report.util.FileUtils;
 import com.uas.report.util.ObjectUtils;
 import com.uas.report.util.ResourceUtils;
@@ -12,6 +13,7 @@ import org.springframework.stereotype.Component;
 
 import java.io.*;
 import java.lang.reflect.Field;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -23,7 +25,7 @@ import java.util.Set;
  * @since 2017年1月10日 下午3:32:30
  */
 @Component
-public class SpecialProperties {
+public class DynamicProperties {
 
     /**
      * 配置文件名称
@@ -65,7 +67,7 @@ public class SpecialProperties {
 	 * 本地是否拥有标准模板
 	 */
 	@DynamicValue("hasStandardJrxmls")
-	private boolean hasStandardJrxmls;
+	private Boolean hasStandardJrxmls;
 
 	/**
 	 * 标准模板地址
@@ -77,7 +79,7 @@ public class SpecialProperties {
 	 * 主账套与其子帐套是否共用模板
 	 */
 	@DynamicValue("shareJrxmlsWithSubMaster")
-	private boolean shareJrxmlsWithSubMaster;
+	private Boolean shareJrxmlsWithSubMaster;
 
 	/**
 	 * 数据源配置信息
@@ -85,7 +87,31 @@ public class SpecialProperties {
 	@DynamicValue("datasource")
 	private String dataSourceInformation;
 
-    public SpecialProperties() {
+    /**
+     * PC端支持打印的最大记录行数
+     */
+    @DynamicValue("max-record-size.pc")
+    private int maxRecordSizePc;
+
+    /**
+     * 手机端支持打印的最大记录行数
+     */
+    @DynamicValue("max-record-size.phone")
+    private int maxRecordSizePhone;
+
+    /**
+     * 是否使用 xlsx
+     */
+    @DynamicValue("use-xlsx")
+    private Boolean useXlsx;
+
+    /**
+     * 预览页面所显示的导出按钮
+     */
+    @DynamicValue("page.preview.show-export-buttons")
+    private List<ExportType> pagePreviewShowExportButtons;
+
+    public DynamicProperties() {
         mayLoad();
     }
 
@@ -220,7 +246,7 @@ public class SpecialProperties {
 		return standardMaster;
 	}
 
-	public boolean getHasStandardJrxmls() {
+	public Boolean getHasStandardJrxmls() {
         mayLoad();
 		return hasStandardJrxmls;
 	}
@@ -230,7 +256,7 @@ public class SpecialProperties {
 		return standardJrxmlsUrl;
 	}
 
-	public boolean getShareJrxmlsWithSubMaster() {
+	public Boolean getShareJrxmlsWithSubMaster() {
         mayLoad();
 		return shareJrxmlsWithSubMaster;
 	}
@@ -239,4 +265,20 @@ public class SpecialProperties {
         mayLoad();
 		return dataSourceInformation;
 	}
+
+    public int getMaxRecordSizePc() {
+        return maxRecordSizePc;
+    }
+
+    public int getMaxRecordSizePhone() {
+        return maxRecordSizePhone;
+    }
+
+    public Boolean getUseXlsx() {
+        return useXlsx;
+    }
+
+    public List<ExportType> getPagePreviewShowExportButtons() {
+        return pagePreviewShowExportButtons;
+    }
 }

+ 0 - 59
report/src/main/java/com/uas/report/SystemProperties.java

@@ -1,11 +1,8 @@
 package com.uas.report;
 
-import com.uas.report.model.ExportType;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 
-import java.util.List;
-
 /**
  * 系统参数
  * 
@@ -27,30 +24,6 @@ public class SystemProperties {
 	@Value("${schedule.auto-start}")
 	private boolean taskAutoStart;
 
-	/**
-	 * PC端支持打印的最大记录行数
-	 */
-	@Value("${max-record-size.pc}")
-	private int maxRecordSizePc;
-
-	/**
-	 * 手机端支持打印的最大记录行数
-	 */
-	@Value("${max-record-size.phone}")
-	private int maxRecordSizePhone;
-
-	/**
-	 * 是否使用 xlsx
-	 */
-	@Value("${use-xlsx}")
-	private boolean useXlsx;
-
-	/**
-	 * 预览页面所显示的导出按钮
-	 */
-	@Value("${page.preview.show-export-buttons}")
-	private List<ExportType> pagePreviewShowExportButtons;
-
 	/**
 	 * 以 spring boot jar 方式启动时,需解压的 jar
 	 */
@@ -73,38 +46,6 @@ public class SystemProperties {
 		this.taskAutoStart = taskAutoStart;
 	}
 
-	public int getMaxRecordSizePc() {
-		return maxRecordSizePc;
-	}
-
-	public void setMaxRecordSizePc(int maxRecordSizePc) {
-		this.maxRecordSizePc = maxRecordSizePc;
-	}
-
-	public int getMaxRecordSizePhone() {
-		return maxRecordSizePhone;
-	}
-
-	public void setMaxRecordSizePhone(int maxRecordSizePhone) {
-		this.maxRecordSizePhone = maxRecordSizePhone;
-	}
-
-	public boolean isUseXlsx() {
-		return useXlsx;
-	}
-
-	public void setUseXlsx(boolean useXlsx) {
-		this.useXlsx = useXlsx;
-	}
-
-	public List<ExportType> getPagePreviewShowExportButtons() {
-		return pagePreviewShowExportButtons;
-	}
-
-	public void setPagePreviewShowExportButtons(List<ExportType> pagePreviewShowExportButtons) {
-		this.pagePreviewShowExportButtons = pagePreviewShowExportButtons;
-	}
-
 	public String[] getExtractJars() {
 		return extractJars;
 	}

+ 5 - 5
report/src/main/java/com/uas/report/axis/BasicResourceHandler.java

@@ -12,7 +12,7 @@ import java.util.Map;
 
 import javax.activation.DataSource;
 
-import com.uas.report.SpecialProperties;
+import com.uas.report.DynamicProperties;
 import com.uas.report.util.CollectionUtils;
 import com.uas.report.util.ContextUtils;
 import com.uas.report.util.FileUtils;
@@ -20,7 +20,7 @@ import com.uas.report.util.StringUtils;
 
 public class BasicResourceHandler implements ResourceHandler {
 
-	private SpecialProperties specialProperties = ContextUtils.getBean(SpecialProperties.class);
+	private DynamicProperties dynamicProperties = ContextUtils.getBean(DynamicProperties.class);
 
 	private FileFilter filter = new FileFilter() {
 		@Override
@@ -39,7 +39,7 @@ public class BasicResourceHandler implements ResourceHandler {
 	};
 
 	public List<Resource> listResource(String resourceURI) throws FileNotFoundException, IOException {
-		File dir = new File(specialProperties.getLocalBaseDir() + Folder.SEPARATOR + resourceURI);
+		File dir = new File(dynamicProperties.getLocalBaseDir() + Folder.SEPARATOR + resourceURI);
 		if (!dir.exists() || !dir.isDirectory() || !filter.accept(dir)) {
 			return null;
 		}
@@ -107,12 +107,12 @@ public class BasicResourceHandler implements ResourceHandler {
 	}
 
 	protected File getFile(String resourceURI) {
-		return new File(specialProperties.getLocalBaseDir() + "/" + resourceURI);
+		return new File(dynamicProperties.getLocalBaseDir() + "/" + resourceURI);
 	}
 
 	private String getResourceURI(File file) {
 		String resourceURI = file.getPath();
-		resourceURI = resourceURI.replace(new File(specialProperties.getLocalBaseDir()).getPath(), "");
+		resourceURI = resourceURI.replace(new File(dynamicProperties.getLocalBaseDir()).getPath(), "");
 		resourceURI = resourceURI.replace("\\", Folder.SEPARATOR);
 		if (!resourceURI.startsWith(Folder.SEPARATOR)) {
 			resourceURI = Folder.SEPARATOR + resourceURI;

+ 5 - 5
report/src/main/java/com/uas/report/controller/PrintController.java

@@ -1,6 +1,6 @@
 package com.uas.report.controller;
 
-import com.uas.report.SystemProperties;
+import com.uas.report.DynamicProperties;
 import com.uas.report.model.ExportType;
 import com.uas.report.model.Platform;
 import com.uas.report.model.PrintType;
@@ -35,8 +35,8 @@ import java.util.Map;
 @RequestMapping("/print")
 public class PrintController {
 
-	@Autowired
-	private SystemProperties systemProperties;
+    @Autowired
+    private DynamicProperties dynamicProperties;
 
 	@Autowired
 	private PrintService printService;
@@ -94,7 +94,7 @@ public class PrintController {
 			break;
 		// 该下载接口供 UAS 系统使用,应其要求,printType 为{@link PrintType.EXCEL}时,下载纯数据的 excel
 		case EXCEL:
-			if (systemProperties.isUseXlsx()) {
+			if (dynamicProperties.getUseXlsx()) {
 				export(userName, profile, reportName, whereCondition, otherParameters, ExportType.XLSX_DATA.name(),
 						true, title, request, response);
 			} else {
@@ -290,6 +290,6 @@ public class PrintController {
 	@RequestMapping(value = "/exportButtons")
 	@ResponseBody
 	public List<ExportType> getPagePreviewShowExportButtons(HttpServletRequest request, HttpServletResponse response) {
-		return systemProperties.getPagePreviewShowExportButtons();
+		return dynamicProperties.getPagePreviewShowExportButtons();
 	}
 }

+ 5 - 5
report/src/main/java/com/uas/report/controller/PropertiesController.java

@@ -1,6 +1,6 @@
 package com.uas.report.controller;
 
-import com.uas.report.SpecialProperties;
+import com.uas.report.DynamicProperties;
 import org.apache.catalina.servlet4preview.http.HttpServletRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -19,18 +19,18 @@ import org.springframework.web.bind.annotation.ResponseBody;
 public class PropertiesController {
 
     @Autowired
-    private SpecialProperties specialProperties;
+    private DynamicProperties dynamicProperties;
 
     @RequestMapping("/get")
     @ResponseBody
-    public SpecialProperties get(HttpServletRequest request) {
-        return specialProperties;
+    public DynamicProperties get(HttpServletRequest request) {
+        return dynamicProperties;
     }
 
     @RequestMapping("/update")
     @ResponseBody
     public boolean update(@RequestParam String json, HttpServletRequest request) {
-        specialProperties.update(json);
+        dynamicProperties.update(json);
         return true;
     }
 }

+ 13 - 13
report/src/main/java/com/uas/report/service/impl/FileServiceImpl.java

@@ -2,7 +2,7 @@ package com.uas.report.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.lowagie.text.pdf.PdfReader;
-import com.uas.report.SpecialProperties;
+import com.uas.report.DynamicProperties;
 import com.uas.report.schedule.model.TaskInformation;
 import com.uas.report.schedule.service.Executable;
 import com.uas.report.schedule.service.TaskService;
@@ -30,7 +30,7 @@ import java.util.*;
 public class FileServiceImpl implements FileService {
 
 	@Autowired
-	private SpecialProperties specialProperties;
+	private DynamicProperties dynamicProperties;
 
 	@Autowired
 	private TaskService taskService;
@@ -72,9 +72,9 @@ public class FileServiceImpl implements FileService {
 			throw new IllegalArgumentException("参数不能为空:sourceUserName,destinationUserNames");
 		}
 		byte[] data = null;
-		String stantardJrxmlsUrl = String.format(specialProperties.getStandardJrxmlsUrl(), sourceUserName);
+		String stantardJrxmlsUrl = String.format(dynamicProperties.getStandardJrxmlsUrl(), sourceUserName);
 		// 如果本机提供标准模板下载,直接从本地获取数据
-		if (specialProperties.getHasStandardJrxmls()) {
+		if (dynamicProperties.getHasStandardJrxmls()) {
 			data = getStandardJrxmls(sourceUserName);
 		}
 		// 本机没有标准模板,则先下载标准模板数据
@@ -123,7 +123,7 @@ public class FileServiceImpl implements FileService {
 		}
 
 		String fileName = file.getOriginalFilename();
-		StringBuilder stringBuilder = new StringBuilder(specialProperties.getLocalBaseDir()).append("/");
+		StringBuilder stringBuilder = new StringBuilder(dynamicProperties.getLocalBaseDir()).append("/");
 		// jrxml模板和图片分别放在jrxml和Picture文件夹下,其他资源放在当前账套根路径下
 		if (fileType.equals("jrxml")) {
 			stringBuilder.append(userName).append("/").append("jrxml").append("/");
@@ -180,7 +180,7 @@ public class FileServiceImpl implements FileService {
 	@Override
 	public String getJrxmlFilePath(String userName, String reportName) {
 		ReportUtils.checkParameters(userName, reportName);
-		return new StringBuilder(getMasterPath(userName)).append(specialProperties.getLocalJrxmlDir()).append("/")
+		return new StringBuilder(getMasterPath(userName)).append(dynamicProperties.getLocalJrxmlDir()).append("/")
 				.append(reportName).append(".jrxml").toString();
 	}
 
@@ -189,7 +189,7 @@ public class FileServiceImpl implements FileService {
 		if (StringUtils.isEmpty(userName)) {
 			throw new IllegalArgumentException("参数不能为空:userName");
 		}
-		return new StringBuilder(specialProperties.getLocalBaseDir()).append("/").append(userName).toString();
+		return new StringBuilder(dynamicProperties.getLocalBaseDir()).append("/").append(userName).toString();
 	}
 
 	@Override
@@ -197,11 +197,11 @@ public class FileServiceImpl implements FileService {
 		if (StringUtils.isEmpty(userName)) {
 			throw new IllegalArgumentException("未传入当前账套名称!");
 		}
-		if (!specialProperties.getHasStandardJrxmls()) {
+		if (!dynamicProperties.getHasStandardJrxmls()) {
 			throw new IllegalStateException("没有" + userName + "标准模板!");
 		}
 		try {
-			return ZipUtils.zipFolder(getMasterPath(specialProperties.getStandardMaster()) + "/" + userName,
+			return ZipUtils.zipFolder(getMasterPath(dynamicProperties.getStandardMaster()) + "/" + userName,
 					FileServiceImpl.fileFilter);
 		} catch (Throwable e) {
 			throw new IOException("压缩失败", e);
@@ -213,10 +213,10 @@ public class FileServiceImpl implements FileService {
 		if (StringUtils.isEmpty(userName)) {
 			throw new IllegalArgumentException("未传入当前账套名称!");
 		}
-		if (!specialProperties.getHasStandardJrxmls()) {
+		if (!dynamicProperties.getHasStandardJrxmls()) {
 			throw new IllegalStateException("没有" + userName + "标准模板!");
 		}
-		downloadZip(specialProperties.getStandardMaster() + "/" + userName, response);
+		downloadZip(dynamicProperties.getStandardMaster() + "/" + userName, response);
 	}
 
 	@Override
@@ -514,7 +514,7 @@ public class FileServiceImpl implements FileService {
 			return null;
 		}
 		// 获取相对路径,须将本地资源根路径替换掉,并且文件分隔符统一使用 '/'
-		return file.getPath().replace(new File(specialProperties.getLocalBaseDir()).getPath(), "").replace("\\", "/");
+		return file.getPath().replace(new File(dynamicProperties.getLocalBaseDir()).getPath(), "").replace("\\", "/");
 	}
 
 	@Override
@@ -589,7 +589,7 @@ public class FileServiceImpl implements FileService {
 		}
 		// 不是绝对路径的话,则相对于模板根路径
 		if (isAbsolutePath == null || !isAbsolutePath) {
-			filePath = specialProperties.getLocalBaseDir() + "/" + filePath;
+			filePath = dynamicProperties.getLocalBaseDir() + "/" + filePath;
 		}
 		return filePath;
 	}

+ 6 - 6
report/src/main/java/com/uas/report/service/impl/PrintServiceImpl.java

@@ -3,7 +3,7 @@ package com.uas.report.service.impl;
 import com.alibaba.druid.pool.DruidDataSource;
 import com.alibaba.druid.util.JdbcUtils;
 import com.alibaba.fastjson.JSONObject;
-import com.uas.report.SpecialProperties;
+import com.uas.report.DynamicProperties;
 import com.uas.report.SystemProperties;
 import com.uas.report.jasperreports.engine.export.CustomJRXlsExporter;
 import com.uas.report.jasperreports.engine.export.CustomJRXlsxExporter;
@@ -55,7 +55,7 @@ public class PrintServiceImpl implements PrintService {
 	private SystemProperties systemProperties;
 
 	@Autowired
-	private SpecialProperties specialProperties;
+	private DynamicProperties dynamicProperties;
 
 	private Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -598,11 +598,11 @@ public class PrintServiceImpl implements PrintService {
 			File jrxmlFile = new File(jrxmlFilePath);
 			// 报表模板不存在,返回B2B标准模板账套
 			if (!jrxmlFile.exists()) {
-				return specialProperties.getStandardMaster() + "/B2B";
+				return dynamicProperties.getStandardMaster() + "/B2B";
 			}
 		} else {
 			// 如果主账套与子账套共用模板
-			if (specialProperties.getShareJrxmlsWithSubMaster()) {
+			if (dynamicProperties.getShareJrxmlsWithSubMaster()) {
 				Master master = MasterManager.getMaster(userName);
 				if (master != null) {
 					// 获取账套的主账套
@@ -623,10 +623,10 @@ public class PrintServiceImpl implements PrintService {
 		int maxRecordSize = 0;
 		switch (platform) {
 		case PC:
-			maxRecordSize = systemProperties.getMaxRecordSizePc();
+			maxRecordSize = dynamicProperties.getMaxRecordSizePc();
 			break;
 		case PHONE:
-			maxRecordSize = systemProperties.getMaxRecordSizePhone();
+			maxRecordSize = dynamicProperties.getMaxRecordSizePhone();
 			break;
 		}
 

+ 3 - 3
report/src/main/java/com/uas/report/util/MasterManager.java

@@ -2,7 +2,7 @@ package com.uas.report.util;
 
 import com.alibaba.druid.pool.DruidDataSource;
 import com.alibaba.fastjson.JSONObject;
-import com.uas.report.SpecialProperties;
+import com.uas.report.DynamicProperties;
 import com.uas.report.model.Master;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,8 +46,8 @@ public class MasterManager {
 	 */
 	private static void initAllDataSources() {
 		// 从配置中获取数据源信息
-		SpecialProperties specialProperties = ContextUtils.getBean(SpecialProperties.class);
-		JSONObject jsonObject = JSONObject.parseObject(specialProperties.getDataSourceInformation());
+		DynamicProperties dynamicProperties = ContextUtils.getBean(DynamicProperties.class);
+		JSONObject jsonObject = JSONObject.parseObject(dynamicProperties.getDataSourceInformation());
 		Set<Entry<String, Object>> entrySet = jsonObject.entrySet();
 		for (Entry<String, Object> entry : entrySet) {
 			DruidDataSource dataSource = JSONObject.parseObject(entry.getValue().toString(), DruidDataSource.class);

+ 51 - 8
report/src/main/java/com/uas/report/util/ObjectUtils.java

@@ -316,21 +316,33 @@ public class ObjectUtils {
         }
         if (value != null) {
             Type type = field.getGenericType();
-            if (type.toString().equals("class java.lang.String")) {
-            } else if (type.toString().equals("class java.lang.Long") || type.toString().equals("long")) {
+            String typeString = type.toString();
+            if (typeString.equals("class java.lang.String")) {
+            } else if (typeString.equals("class java.lang.Long") || typeString.equals("long")) {
                 value = Long.valueOf(value.toString());
-            } else if (type.toString().equals("class java.lang.Integer") || type.toString().equals("int")) {
+            } else if (typeString.equals("class java.lang.Integer") || typeString.equals("int")) {
                 value = Integer.valueOf(value.toString());
-            } else if (type.toString().equals("class java.lang.Short") || type.toString().equals("short")) {
+            } else if (typeString.equals("class java.lang.Short") || typeString.equals("short")) {
                 value = Short.valueOf(value.toString());
-            } else if (type.toString().equals("class java.lang.Double") || type.toString().equals("double")) {
+            } else if (typeString.equals("class java.lang.Double") || typeString.equals("double")) {
                 value = Double.valueOf(value.toString());
-            } else if (type.toString().equals("class java.lang.Float") || type.toString().equals("float")) {
+            } else if (typeString.equals("class java.lang.Float") || typeString.equals("float")) {
                 value = Float.valueOf(value.toString());
-            } else if (type.toString().equals("class java.lang.Byte") || type.toString().equals("byte")) {
+            } else if (typeString.equals("class java.lang.Byte") || typeString.equals("byte")) {
                 value = Byte.valueOf(value.toString());
-            } else if (type.toString().equals("class java.lang.Boolean") || type.toString().equals("boolean")) {
+            } else if (typeString.equals("class java.lang.Boolean") || typeString.equals("boolean")) {
                 value = Boolean.valueOf(value.toString());
+            } else if (typeString.startsWith("java.util.List")) {
+                Class<?> clazz = Object.class;
+                if (typeString.matches("^java.util.List<[\\s\\S]+?>$")) {
+                    try {
+                        clazz = Class.forName(typeString.substring(typeString.indexOf("<") + 1, typeString.length() - 1));
+                    } catch (ClassNotFoundException e) {
+                        throw new IllegalStateException("无法转换为 " + typeString, e);
+                    }
+                }
+                String[] strs = value.toString().split(",[ ]*");
+                value = castList(strs, clazz);
             } else {
                 throw new IllegalArgumentException("不支持的类型:type=" + type + ", value=" + value);
             }
@@ -343,4 +355,35 @@ public class ObjectUtils {
             field.set(object, value);
         }
     }
+
+    /**
+     * 转换 String 数组为指定对象列表
+     *
+     * @param strs  String 数组
+     * @param clazz 目标类型
+     * @param <T>   目标类型
+     * @return 对象列表
+     */
+    private static <T> List<T> castList(String[] strs, Class<T> clazz) {
+        if (ArrayUtils.isEmpty(strs)) {
+            return null;
+        }
+        List<T> list = new ArrayList<>();
+        for (String str : strs) {
+            list.add(cast(str, clazz));
+        }
+        return list;
+    }
+
+    /**
+     * 转换对象为指定类型
+     *
+     * @param object 对象
+     * @param clazz  目标类型
+     * @param <T>    目标类型
+     * @return 目标
+     */
+    private static <T> T cast(Object object, Class<T> clazz) {
+        return object == null ? null : (T) object;
+    }
 }

+ 0 - 11
report/src/main/resources/application.yml

@@ -29,15 +29,4 @@ schedule:
  period: 3600000
  auto-start: true
  
-max-record-size:
- pc: 100000
- phone: 10000
-
-use-xlsx: false
-
-page:
- preview:
-  # support PDF, XLS, XLS_DATA, XLSX, XLSX_DATA, DOC, TXT in com.uas.report.model.ExportType
-  show-export-buttons: PDF, XLS, XLS_DATA
-
 extract-jars: report-common, jasperreports, fastjson

+ 7 - 0
report/src/main/resources/report.properties

@@ -6,4 +6,11 @@ hasStandardJrxmls=false
 standardJrxmlsUrl=http://print.ubtob.com/report/file/standardJrxmls?userName=%s&onlyData=1
 shareJrxmlsWithSubMaster=false
 
+max-record-size.pc=100000
+max-record-size.phone=10000
+
+use-xlsx=false
+# support PDF, XLS, XLS_DATA, XLSX, XLSX_DATA, DOC, TXT in com.uas.report.model.ExportType
+page.preview.show-export-buttons=PDF, XLS, XLS_DATA
+
 datasource={"UAS":{"driverClassName":"oracle.jdbc.driver.OracleDriver","url":"jdbc:oracle:thin:@127.0.0.1:1521:orcl","username":"UAS","password":"select!#%*(","initialSize":1,"minIdle":0,"maxActive":20,"maxWait":60000,"timeBetweenEvictionRunsMillis":60000,"minEvictableIdleTimeMillis":300000,"validationQuery":"SELECT 1 FROM DUAL","testWhileIdle":true,"testOnBorrow":true,"testOnReturn":false,"removeAbandoned":true,"removeAbandonedTimeout":120,"logAbandoned":true,"timeBetweenLogStatsMillis":600000,"poolPreparedStatements":true,"maxPoolPreparedStatementPerConnectionSize":20,"filters":"stat,slf4j","connectionProperties":"druid.stat.mergeSql=false;druid.stat.slowSqlMillis=5000"}}