From d9e18a70c784899b4c98c382197db4c82a9e54d1 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sat, 22 Sep 2018 21:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B0=20Spring=20Boot=202?= =?UTF-8?q?.0.5=20=E4=BB=A5=E5=8F=8A=E7=9B=B8=E5=85=B3=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=BA=93=E5=85=A8=E9=9D=A2=E5=8D=87=E7=BA=A7=EF=BC=8C=E9=87=87?= =?UTF-8?q?=E7=94=A8J2Cache=E4=BD=9C=E4=B8=BA=E7=BC=93=E5=AD=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + common/.settings/org.eclipse.jdt.core.prefs | 6 +- ....eclipse.wst.common.project.facet.core.xml | 10 +- common/pom.xml | 227 +++-- .../com/jeesite/common/codec/EncodeUtils.java | 2 +- .../com/jeesite/common/codec/Md5Utils.java | 7 +- .../java/com/jeesite/common/io/FileUtils.java | 14 +- .../java/com/jeesite/common/io/IOUtils.java | 23 + .../jeesite/common/io/PropertiesUtils.java | 26 +- .../com/jeesite/common/io/ResourceUtils.java | 6 +- .../com/jeesite/common/lang/ObjectUtils.java | 38 +- .../com/jeesite/common/lang/StringUtils.java | 4 +- .../com/jeesite/common/mail/EmailUtils.java | 37 - .../com/jeesite/common/mapper/BeanMapper.java | 59 -- .../jeesite/common/reflect/ReflectUtils.java | 26 +- .../core/.settings/org.eclipse.jdt.core.prefs | 6 +- ....eclipse.wst.common.project.facet.core.xml | 14 +- modules/core/db/core.erm | 10 +- modules/core/db/db2/core.sql | 918 ++++++++++++++++++ modules/core/db/mysql/create_user.sql | 13 - modules/core/db/oracle/create_user.sql | 15 - modules/core/pom.xml | 28 +- .../jeesite/modules/config/ShiroConfig.java | 4 +- .../modules/config/web/DruidStatConfig.java | 8 +- .../modules/config/web/PageCacheConfig.java | 63 +- .../web/interceptor/LogInterceptorConfig.java | 4 +- .../MobileViewInterceptorConfig.java | 4 +- .../com/jeesite/modules/sys/entity/Area.java | 2 +- .../jeesite/modules/sys/entity/Company.java | 2 +- .../com/jeesite/modules/sys/entity/Log.java | 2 +- .../jeesite/modules/sys/entity/Office.java | 2 +- .../com/jeesite/modules/sys/entity/Post.java | 2 +- .../main/resources/config/jeesite-core.yml | 151 ++- .../src/main/resources/config/logger-core.xml | 18 +- .../templates/modules/gen/config.xml | 106 ++ .../templates/modules/gen/crud/controller.xml | 268 +++++ .../templates/modules/gen/crud/dao.xml | 26 + .../templates/modules/gen/crud/entity.xml | 343 +++++++ .../templates/modules/gen/crud/mapper.xml | 23 + .../templates/modules/gen/crud/service.xml | 170 ++++ .../templates/modules/gen/crud/viewForm.xml | 96 ++ .../templates/modules/gen/crud/viewList.xml | 145 +++ .../modules/gen/include/formChildTable.html | 14 + .../gen/include/formChildTableScript.html | 172 ++++ .../modules/gen/include/formControl.html | 213 ++++ .../modules/gen/include/searchForm.html | 72 ++ .../modules/sys/sysIndex/topMenuMsg.html | 4 +- .../java/com/jeesite/test/MsgPushTest.java | 25 +- .../config/{jeesite.yml => application.yml} | 0 .../test/resource/config/j2cache.properties | 8 + .../.settings/org.eclipse.jdt.core.prefs | 6 +- modules/template/pom.xml | 2 +- parent/pom.xml | 43 +- root/pom.xml | 2 +- .../org.eclipse.wst.common.component | 11 +- ....eclipse.wst.common.project.facet.core.xml | 2 +- web/bin/run-web.bat | 2 +- web/pom.xml | 18 +- .../modules/{config => }/Application.java | 15 +- .../jeesite/modules/test/entity/TestTree.java | 2 +- .../main/resources/cache/ehcache-local.xml | 30 - web/src/main/resources/cache/ehcache-rmi.xml | 66 -- web/src/main/resources/config/application.yml | 532 +++++++++- .../main/resources/config/j2cache.properties | 92 ++ web/src/main/resources/config/jeesite.yml | 511 ---------- web/src/main/resources/logback.xml | 3 - web/src/main/webapp/WEB-INF/startup.bat | 10 +- web/src/main/webapp/WEB-INF/startup.sh | 8 +- web/src/main/webapp/WEB-INF/web.xml | 6 +- .../java/com/jeesite/test/InitCoreData.java | 2 +- .../jeesite/test/{Test.java => MainTest.java} | 2 +- 71 files changed, 3664 insertions(+), 1138 deletions(-) delete mode 100644 common/src/main/java/com/jeesite/common/mail/EmailUtils.java delete mode 100644 common/src/main/java/com/jeesite/common/mapper/BeanMapper.java create mode 100644 modules/core/db/db2/core.sql delete mode 100644 modules/core/db/mysql/create_user.sql delete mode 100644 modules/core/db/oracle/create_user.sql create mode 100644 modules/core/src/main/resources/templates/modules/gen/config.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/controller.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/dao.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/entity.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/mapper.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/service.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml create mode 100644 modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html create mode 100644 modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html create mode 100644 modules/core/src/main/resources/templates/modules/gen/include/formControl.html create mode 100644 modules/core/src/main/resources/templates/modules/gen/include/searchForm.html rename modules/core/src/test/resource/config/{jeesite.yml => application.yml} (100%) create mode 100644 modules/core/src/test/resource/config/j2cache.properties rename web/src/main/java/com/jeesite/modules/{config => }/Application.java (60%) delete mode 100644 web/src/main/resources/cache/ehcache-local.xml delete mode 100644 web/src/main/resources/cache/ehcache-rmi.xml create mode 100644 web/src/main/resources/config/j2cache.properties delete mode 100644 web/src/main/resources/config/jeesite.yml rename web/src/test/java/com/jeesite/test/{Test.java => MainTest.java} (70%) diff --git a/README.md b/README.md index abf5a56b..3886169e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ JeeSite 自开源以来已被广大爱好者用到了企业、政府、医疗、 * 前端组件:jQuery 1.12、jqGrid 4.7、layer 3.0、zTree 3.5、jquery-validation * 工具组件:Apache Commons、Logback 1.1、Jackson 2.8、POI 3.14、Quartz 2.2 * JFlow工作流引擎: +* 乐云短信网关:SmsUtils.java : * 技术选型详情: ## 内置功能菜单 diff --git a/common/.settings/org.eclipse.jdt.core.prefs b/common/.settings/org.eclipse.jdt.core.prefs index 443e0859..6e80039d 100644 --- a/common/.settings/org.eclipse.jdt.core.prefs +++ b/common/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/common/.settings/org.eclipse.wst.common.project.facet.core.xml b/common/.settings/org.eclipse.wst.common.project.facet.core.xml index 4f92af54..ee260d97 100644 --- a/common/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/common/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,5 +1,5 @@ - - - - - + + + + + diff --git a/common/pom.xml b/common/pom.xml index dde44c93..3dda0cf2 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -6,7 +6,7 @@ com.jeesite jeesite-parent - 4.0.7-SNAPSHOT + 4.1.0-SNAPSHOT ../parent/pom.xml @@ -27,17 +27,16 @@ org.apache.commons commons-lang3 - ${commons-lang3.version} + + + commons-codec + commons-codec commons-io commons-io ${commons-io.version} - - commons-codec - commons-codec - commons-fileupload commons-fileupload @@ -46,19 +45,33 @@ commons-beanutils commons-beanutils + ${commons-beanutils.version} + + + org.apache.commons + commons-text + ${commons-text.version} + + + + + org.apache.ant + ant + ${ant.version} de.ruedigermoeller fst - ${ruedigermoeller-fst.version} + ${fst.version} - + org.json json + ${json.version} @@ -93,11 +106,91 @@ snakeyaml - + - net.sf.dozer - dozer - ${dozer.version} + org.apache.httpcomponents + httpclient + + + + + org.jsoup + jsoup + ${jsoup.version} + + + + + org.apache.commons + commons-email + ${commons-email.version} + + + javax.activation + activation + ${activation.version} + + + + + eu.bitwalker + UserAgentUtils + ${UserAgentUtils.version} + + + + + com.drewnoakes + metadata-extractor + ${metadata-extractor.version} + + + + net.coobird + thumbnailator + ${thumbnailator.version} + + + + com.bladejava + blade-patchca + ${blade-patchca.version} + + + + net.sf.jmimemagic + jmimemagic + ${jmimemagic.version} + + + xerces + xercesImpl + + + org.codehaus.jackson + jackson-xc + + + org.codehaus.jackson + jackson-jaxrs + + + log4j + log4j + + + + + + + com.google.zxing + core + ${zxing.version} + + + com.google.zxing + javase + ${zxing.version} @@ -128,109 +221,14 @@ ${poi.version} - - - org.apache.commons - commons-email - 1.4 - - - javax.activation - activation - 1.1.1 - - - - - com.google.zxing - core - 3.3.0 - - - com.google.zxing - javase - 3.3.0 - - - - - eu.bitwalker - UserAgentUtils - 1.20 - - - - - org.apache.httpcomponents - httpclient - - - - - org.jsoup - jsoup - 1.9.1 - - - - - com.drewnoakes - metadata-extractor - 2.9.1 - - - - net.coobird - thumbnailator - 0.4.8 - - - - com.bladejava - blade-patchca - 1.0.5 - - - - - org.apache.ant - ant - 1.9.7 - - - - - net.sf.jmimemagic - jmimemagic - 0.1.3 - - - xerces - xercesImpl - - - org.codehaus.jackson - jackson-xc - - - org.codehaus.jackson - jackson-jaxrs - - - log4j - log4j - - - - com.belerweb pinyin4j - 2.5.0 + ${pinyin4j.version} - + org.slf4j slf4j-api @@ -255,9 +253,9 @@ ch.qos.logback logback-classic - + - + org.springframework spring-core @@ -266,12 +264,7 @@ org.springframework spring-web - - - - org.hibernate - hibernate-validator - + diff --git a/common/src/main/java/com/jeesite/common/codec/EncodeUtils.java b/common/src/main/java/com/jeesite/common/codec/EncodeUtils.java index 07d229a5..5188b183 100644 --- a/common/src/main/java/com/jeesite/common/codec/EncodeUtils.java +++ b/common/src/main/java/com/jeesite/common/codec/EncodeUtils.java @@ -15,7 +15,7 @@ import java.util.regex.Pattern; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Hex; -import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.text.StringEscapeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/common/src/main/java/com/jeesite/common/codec/Md5Utils.java b/common/src/main/java/com/jeesite/common/codec/Md5Utils.java index 9a03273e..cebeb9ba 100644 --- a/common/src/main/java/com/jeesite/common/codec/Md5Utils.java +++ b/common/src/main/java/com/jeesite/common/codec/Md5Utils.java @@ -76,13 +76,12 @@ public class Md5Utils { /** * 获取文件的MD5值,支持获取文件部分的MD5值 + * uploader.md5File(file, 0, 10 * 1024 * 1024) */ public static String md5File(File file, int size) { if (file != null && file.exists()){ - InputStream in = null; - try { + try (InputStream in = FileUtils.openInputStream(file)){ byte[] bytes = null; - in = FileUtils.openInputStream(file); if (size != -1 && file.length() >= size){ bytes = IOUtils.toByteArray(in, size); }else{ @@ -91,8 +90,6 @@ public class Md5Utils { return EncodeUtils.encodeHex(md5(bytes)); } catch (IOException e) { return StringUtils.EMPTY; - } finally { - IOUtils.closeQuietly(in); } } return StringUtils.EMPTY; diff --git a/common/src/main/java/com/jeesite/common/io/FileUtils.java b/common/src/main/java/com/jeesite/common/io/FileUtils.java index 631af865..85ffc605 100644 --- a/common/src/main/java/com/jeesite/common/io/FileUtils.java +++ b/common/src/main/java/com/jeesite/common/io/FileUtils.java @@ -242,14 +242,10 @@ public class FileUtils extends org.apache.commons.io.FileUtils { * @author ThinkGem 2016-7-4 */ public static String readFileToString(String classResourcePath){ - InputStream in = null; - try { - in = new ClassPathResource(classResourcePath).getInputStream(); + try (InputStream in = new ClassPathResource(classResourcePath).getInputStream()){ return IOUtils.toString(in, Charsets.toCharset("UTF-8")); } catch (IOException e) { logger.warn("Error file convert: {}", e.getMessage()); - }finally{ - IOUtils.closeQuietly(in); } return null; } @@ -944,9 +940,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils { projectPath = file.toString(); } } catch (FileNotFoundException e) { - ; + // 忽略异常 } catch (IOException e) { - e.printStackTrace(); + // 忽略异常 } // 取不到,取当前工作路径 if (StringUtils.isBlank(projectPath)){ @@ -982,9 +978,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils { webappPath = file.toString(); } } catch (FileNotFoundException e) { - ; + // 忽略异常 } catch (IOException e) { - e.printStackTrace(); + // 忽略异常 } // 取不到,取当前工作路径 if (StringUtils.isBlank(webappPath)){ diff --git a/common/src/main/java/com/jeesite/common/io/IOUtils.java b/common/src/main/java/com/jeesite/common/io/IOUtils.java index 6436340d..e2a09ff3 100644 --- a/common/src/main/java/com/jeesite/common/io/IOUtils.java +++ b/common/src/main/java/com/jeesite/common/io/IOUtils.java @@ -3,10 +3,13 @@ */ package com.jeesite.common.io; +import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; /** * 数据流工具类 @@ -80,4 +83,24 @@ public class IOUtils extends org.apache.commons.io.IOUtils { return fileOutputStream; } + /** + * Closes a Closeable unconditionally. + */ + public static void closeQuietly(final InputStream input) { + closeQuietly((Closeable) input); + } + + /** + * Closes a Closeable unconditionally. + */ + public static void closeQuietly(final Closeable closeable) { + try { + if (closeable != null) { + closeable.close(); + } + } catch (final IOException ioe) { + // ignore + } + } + } \ No newline at end of file diff --git a/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java b/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java index 288652b2..2acab3be 100644 --- a/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java +++ b/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java @@ -12,7 +12,6 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; @@ -37,7 +36,7 @@ public class PropertiesUtils { "classpath:config/application.yml", "classpath:application.yml"}; private static Logger logger = PropertiesUtils.initLogger(); - + private final Set configSet = SetUtils.newLinkedHashSet(); private final Properties properties = new Properties(); /** @@ -55,7 +54,7 @@ public class PropertiesUtils { for(Resource resource : resources){ configSet.add("classpath:config/"+resource.getFilename()); } - configSet.add("classpath:config/jeesite.yml"); + //configSet.add("classpath:config/jeesite.yml"); // 获取全局设置默认的配置文件(以下是支持环境配置的属性文件) Set set = SetUtils.newLinkedHashSet(); for (String configFile : DEFAULT_CONFIG_FILE){ @@ -83,7 +82,7 @@ public class PropertiesUtils { } for (String location : configFiles){ configSet.add(location); - if (StringUtils.isNotBlank(profiles) && !StringUtils.equals(profiles, "default")){ + if (StringUtils.isNotBlank(profiles)){ if (location.endsWith(".properties")){ configSet.add(StringUtils.substringBeforeLast(location, ".properties") + "-" + profiles + ".properties"); @@ -108,14 +107,11 @@ public class PropertiesUtils { Resource resource = ResourceUtils.getResource(location); if (resource.exists()){ if (location.endsWith(".properties")){ - InputStreamReader is = null; - try { - is = new InputStreamReader(resource.getInputStream(), "UTF-8"); + try (InputStreamReader is = new InputStreamReader(resource.getInputStream(), "UTF-8")){ properties.load(is); + configSet.add(location); } catch (IOException ex) { logger.error("Load " + location + " failure. ", ex); - } finally { - IOUtils.closeQuietly(is); } } else if (location.endsWith(".yml")){ @@ -125,18 +121,24 @@ public class PropertiesUtils { properties.put(ObjectUtils.toString(entry.getKey()), ObjectUtils.toString(entry.getValue())); } + configSet.add(location); } } } catch (Exception e) { logger.error("Load " + location + " failure. ", e); } - // 存储当前加载的配置文件路径和名称 - properties.setProperty("configFiles", StringUtils.join(configFiles, ",")); } } /** - * 获取当前加载的属性 + * 获取当前加载的属性文件 + */ + public Set getConfigSet() { + return configSet; + } + + /** + * 获取当前加载的属性数据 */ public Properties getProperties() { return properties; diff --git a/common/src/main/java/com/jeesite/common/io/ResourceUtils.java b/common/src/main/java/com/jeesite/common/io/ResourceUtils.java index 64fd5bc4..f35b6c63 100644 --- a/common/src/main/java/com/jeesite/common/io/ResourceUtils.java +++ b/common/src/main/java/com/jeesite/common/io/ResourceUtils.java @@ -67,14 +67,10 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils { * @author ThinkGem */ public static String getResourceFileContent(String location){ - InputStream is = null; - try{ - is = ResourceUtils.getResourceFileStream(location); + try(InputStream is = ResourceUtils.getResourceFileStream(location)){ return IOUtils.toString(is, "UTF-8"); }catch (IOException e) { throw ExceptionUtils.unchecked(e); - }finally{ - IOUtils.closeQuietly(is); } } diff --git a/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java b/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java index 7e32fb90..657d10bf 100644 --- a/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java +++ b/common/src/main/java/com/jeesite/common/lang/ObjectUtils.java @@ -16,8 +16,6 @@ import org.nustaq.serialization.FSTConfiguration; import org.springframework.beans.BeanUtils; import org.springframework.core.NamedThreadLocal; -import com.jeesite.common.io.IOUtils; - /** * 对象操作工具类, 继承org.apache.commons.lang3.ObjectUtils类 * @author ThinkGem @@ -118,9 +116,13 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils { if (source == null){ return null; } - Object target = BeanUtils.instantiate(source.getClass()); - BeanUtils.copyProperties(source, target, ignoreProperties); - return target; + try { + Object target = source.getClass().newInstance(); + BeanUtils.copyProperties(source, target, ignoreProperties); + return target; + } catch (InstantiationException | IllegalAccessException e) { + throw ExceptionUtils.unchecked(e); + } } /** @@ -162,18 +164,12 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils { } long beginTime = System.currentTimeMillis(); byte[] bytes = null; - ObjectOutputStream oos = null; - ByteArrayOutputStream baos = null; - try { - baos = new ByteArrayOutputStream(); - oos = new ObjectOutputStream(baos); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos);) { oos.writeObject(object); bytes = baos.toByteArray(); } catch (Exception e) { e.printStackTrace(); - } finally { - IOUtils.closeQuietly(oos); - IOUtils.closeQuietly(baos); } long totalTime = System.currentTimeMillis() - beginTime; if (totalTime > 3000){ @@ -193,19 +189,13 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils { } long beginTime = System.currentTimeMillis(); Object object = null; - ByteArrayInputStream bais = null; - ObjectInputStream ois = null; - try { - if (bytes.length > 0) { - bais = new ByteArrayInputStream(bytes); - ois = new ObjectInputStream(bais); + if (bytes.length > 0) { + try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes); + ObjectInputStream ois = new ObjectInputStream(bais);) { object = ois.readObject(); + } catch (Exception e) { + e.printStackTrace(); } - } catch (Exception e) { - e.printStackTrace(); - } finally { - IOUtils.closeQuietly(ois); - IOUtils.closeQuietly(bais); } long totalTime = System.currentTimeMillis() - beginTime; if (totalTime > 3000){ diff --git a/common/src/main/java/com/jeesite/common/lang/StringUtils.java b/common/src/main/java/com/jeesite/common/lang/StringUtils.java index a0eb094e..e53e6d5f 100644 --- a/common/src/main/java/com/jeesite/common/lang/StringUtils.java +++ b/common/src/main/java/com/jeesite/common/lang/StringUtils.java @@ -9,8 +9,6 @@ import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang3.StringEscapeUtils; - import com.jeesite.common.codec.EncodeUtils; import com.jeesite.common.collect.ListUtils; @@ -140,7 +138,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { try { StringBuilder sb = new StringBuilder(); int currentLength = 0; - for (char c : stripHtml(StringEscapeUtils.unescapeHtml4(str)).toCharArray()) { + for (char c : stripHtml(EncodeUtils.decodeHtml(str)).toCharArray()) { currentLength += String.valueOf(c).getBytes("GBK").length; if (currentLength <= length - 3) { sb.append(c); diff --git a/common/src/main/java/com/jeesite/common/mail/EmailUtils.java b/common/src/main/java/com/jeesite/common/mail/EmailUtils.java deleted file mode 100644 index 8454eecd..00000000 --- a/common/src/main/java/com/jeesite/common/mail/EmailUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2013-Now http://jeesite.com All rights reserved. - */ -package com.jeesite.common.mail; - -/** - * 发送电子邮件 - */ -@Deprecated -public class EmailUtils { - - /** - * 发送邮件 - * @param toAddress 接收地址 - * @param subject 标题 - * @param content 内容 - * @return - */ - @Deprecated - public static boolean sendEmail(String toAddress, String subject, String content) { - return com.jeesite.common.msg.EmailUtils.send(toAddress, subject, content); - } - - /** - * 发送邮件 - * @param toAddress 接收地址 - * @param subject 标题 - * @param content 内容 - * @return - */ - @Deprecated - public static boolean sendEmail(String fromAddress, String fromPassword, String fromHostName, - String sslOnConnect, String sslSmtpPort, String toAddress, String subject, String content) { - return com.jeesite.common.msg.EmailUtils.send(fromAddress, fromPassword, fromHostName, sslOnConnect, sslSmtpPort, toAddress, subject, content); - } - -} \ No newline at end of file diff --git a/common/src/main/java/com/jeesite/common/mapper/BeanMapper.java b/common/src/main/java/com/jeesite/common/mapper/BeanMapper.java deleted file mode 100644 index 00c90eb6..00000000 --- a/common/src/main/java/com/jeesite/common/mapper/BeanMapper.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2005-2012 springside.org.cn - * - * Licensed under the Apache License, Version 2.0 (the "License"); - */ -package com.jeesite.common.mapper; - -import java.util.Collection; -import java.util.List; - -import org.dozer.DozerBeanMapper; - -import com.jeesite.common.collect.ListUtils; - -/** - * 简单封装Dozer, 实现深度转换Bean<->Bean的Mapper.实现: - * - * 1. 持有Mapper的单例. - * 2. 返回值类型转换. - * 3. 批量转换Collection中的所有对象. - * 4. 区分创建新的B对象与将对象A值复制到已存在的B对象两种函数. - * - * @author calvin - * @version 2013-01-15 - */ -public class BeanMapper { - - /** - * 持有Dozer单例, 避免重复创建DozerMapper消耗资源. - */ - private static DozerBeanMapper dozer = new DozerBeanMapper(); - - /** - * 基于Dozer转换对象的类型. - */ - public static T map(Object source, Class destinationClass) { - return dozer.map(source, destinationClass); - } - - /** - * 基于Dozer转换Collection中对象的类型. - */ - @SuppressWarnings("rawtypes") - public static List mapList(Collection sourceList, Class destinationClass) { - List destinationList = ListUtils.newArrayList(); - for (Object sourceObject : sourceList) { - T destinationObject = dozer.map(sourceObject, destinationClass); - destinationList.add(destinationObject); - } - return destinationList; - } - - /** - * 基于Dozer将对象A的值拷贝到对象B中. - */ - public static void copy(Object source, Object destinationObject) { - dozer.map(source, destinationObject); - } -} \ No newline at end of file diff --git a/common/src/main/java/com/jeesite/common/reflect/ReflectUtils.java b/common/src/main/java/com/jeesite/common/reflect/ReflectUtils.java index 62204337..8acd7de4 100644 --- a/common/src/main/java/com/jeesite/common/reflect/ReflectUtils.java +++ b/common/src/main/java/com/jeesite/common/reflect/ReflectUtils.java @@ -43,20 +43,21 @@ public class ReflectUtils { * 调用Getter方法. * 支持多级,如:对象名.对象名.方法 */ - public static Object invokeGetter(Object obj, String propertyName) { + @SuppressWarnings("unchecked") + public static E invokeGetter(Object obj, String propertyName) { Object object = obj; for (String name : StringUtils.split(propertyName, ".")){ String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); } - return object; + return (E)object; } /** * 调用Setter方法, 仅匹配方法名。 * 支持多级,如:对象名.对象名.方法 */ - public static void invokeSetter(Object obj, String propertyName, Object value) { + public static void invokeSetter(Object obj, String propertyName, E value) { Object object = obj; String[] names = StringUtils.split(propertyName, "."); for (int i=0; i E getFieldValue(final Object obj, final String fieldName) { Field field = getAccessibleField(obj, fieldName); if (field == null) { //throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); return null; } - Object result = null; + E result = null; try { - result = field.get(obj); + result = (E)field.get(obj); } catch (IllegalAccessException e) { logger.error("不可能抛出的异常{}", e.getMessage()); } @@ -92,7 +94,7 @@ public class ReflectUtils { /** * 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数. */ - public static void setFieldValue(final Object obj, final String fieldName, final Object value) { + public static void setFieldValue(final Object obj, final String fieldName, final E value) { Field field = getAccessibleField(obj, fieldName); if (field == null) { //throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); @@ -111,7 +113,8 @@ public class ReflectUtils { * 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用. * 同时匹配方法名+参数类型, */ - public static Object invokeMethod(final Object obj, final String methodName, final Class[] parameterTypes, + @SuppressWarnings("unchecked") + public static E invokeMethod(final Object obj, final String methodName, final Class[] parameterTypes, final Object[] args) { if (obj == null || methodName == null){ return null; @@ -123,7 +126,7 @@ public class ReflectUtils { return null; } try { - return method.invoke(obj, args); + return (E)method.invoke(obj, args); } catch (Exception e) { String msg = "method: "+method+", obj: "+obj+", args: "+args+""; throw convertReflectionExceptionToUnchecked(msg, e); @@ -135,7 +138,8 @@ public class ReflectUtils { * 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用. * 只匹配函数名,如果有多个同名函数调用第一个。 */ - public static Object invokeMethodByName(final Object obj, final String methodName, final Object[] args) { + @SuppressWarnings("unchecked") + public static E invokeMethodByName(final Object obj, final String methodName, final Object[] args) { Method method = getAccessibleMethodByName(obj, methodName, args.length); if (method == null) { // 如果为空不报错,直接返回空。 @@ -171,7 +175,7 @@ public class ReflectUtils { } } } - return method.invoke(obj, args); + return (E)method.invoke(obj, args); } catch (Exception e) { String msg = "method: "+method+", obj: "+obj+", args: "+args+""; throw convertReflectionExceptionToUnchecked(msg, e); diff --git a/modules/core/.settings/org.eclipse.jdt.core.prefs b/modules/core/.settings/org.eclipse.jdt.core.prefs index 443e0859..6e80039d 100644 --- a/modules/core/.settings/org.eclipse.jdt.core.prefs +++ b/modules/core/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/modules/core/.settings/org.eclipse.wst.common.project.facet.core.xml b/modules/core/.settings/org.eclipse.wst.common.project.facet.core.xml index e4a5a385..349d4d7b 100644 --- a/modules/core/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/modules/core/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/modules/core/db/core.erm b/modules/core/db/core.erm index 4bb35026..15544510 100644 --- a/modules/core/db/core.erm +++ b/modules/core/db/core.erm @@ -11,8 +11,8 @@ 0 1.0 - 1503 - 1793 + 1547 + 1390 128 128 @@ -1464,8 +1464,8 @@ nvarchar(n) - 0bbe27dfbb4fb1be15148f1904053a2096f96af1 - 38 + 4f74582c7985a857816f60e5cb57e552173d6786 + 31 null false null @@ -4910,7 +4910,7 @@ - 0bbe27dfbb4fb1be15148f1904053a2096f96af1 + 4f74582c7985a857816f60e5cb57e552173d6786 db462e1b37a2d6bd5111a1ae2c1315cf186c5ded diff --git a/modules/core/db/db2/core.sql b/modules/core/db/db2/core.sql new file mode 100644 index 00000000..bc7d8620 --- /dev/null +++ b/modules/core/db/db2/core.sql @@ -0,0 +1,918 @@ + +/* Drop Tables */ + +DROP TABLE js_gen_table_column; +DROP TABLE js_gen_table; +DROP TABLE js_sys_company_office; +DROP TABLE js_sys_employee_post; +DROP TABLE js_sys_user_data_scope; +DROP TABLE js_sys_user_role; +DROP TABLE js_sys_user; +DROP TABLE js_sys_employee; +DROP TABLE js_sys_company; +DROP TABLE js_sys_area; +DROP TABLE js_sys_config; +DROP TABLE js_sys_dict_data; +DROP TABLE js_sys_dict_type; +DROP TABLE js_sys_file_upload; +DROP TABLE js_sys_file_entity; +DROP TABLE js_sys_job_log; +DROP TABLE js_sys_job; +DROP TABLE js_sys_lang; +DROP TABLE js_sys_log; +DROP TABLE js_sys_role_menu; +DROP TABLE js_sys_menu; +DROP TABLE js_sys_module; +DROP TABLE js_sys_msg_inner_record; +DROP TABLE js_sys_msg_inner; +DROP TABLE js_sys_msg_push; +DROP TABLE js_sys_msg_pushed; +DROP TABLE js_sys_msg_template; +DROP TABLE js_sys_office; +DROP TABLE js_sys_post; +DROP TABLE js_sys_role_data_scope; +DROP TABLE js_sys_role; + + + + +/* Create Tables */ + +-- 代码生成表 +CREATE TABLE js_gen_table +( + table_name varchar(64) NOT NULL, + class_name varchar(100) NOT NULL, + comments varchar(500) NOT NULL, + parent_table_name varchar(64), + parent_table_fk_name varchar(64), + tpl_category varchar(200), + package_name varchar(500), + module_name varchar(30), + sub_module_name varchar(30), + function_name varchar(200), + function_name_simple varchar(50), + function_author varchar(50), + gen_base_dir varchar(1000), + options varchar(1000), + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (table_name) +); + + +-- 代码生成表列 +CREATE TABLE js_gen_table_column +( + id varchar(64) NOT NULL, + table_name varchar(64) NOT NULL, + column_name varchar(64) NOT NULL, + column_sort decimal(10), + column_type varchar(100) NOT NULL, + column_label varchar(50), + comments varchar(500) NOT NULL, + attr_name varchar(200) NOT NULL, + attr_type varchar(200) NOT NULL, + is_pk char(1), + is_null char(1), + is_insert char(1), + is_update char(1), + is_list char(1), + is_query char(1), + query_type varchar(200), + is_edit char(1), + show_type varchar(200), + options varchar(1000), + PRIMARY KEY (id) +); + + +-- 行政区划 +CREATE TABLE js_sys_area +( + area_code varchar(100) NOT NULL, + parent_code varchar(64) NOT NULL, + parent_codes varchar(1000) NOT NULL, + tree_sort decimal(10) NOT NULL, + tree_sorts varchar(1000) NOT NULL, + tree_leaf char(1) NOT NULL, + tree_level decimal(4) NOT NULL, + tree_names varchar(1000) NOT NULL, + area_name varchar(100) NOT NULL, + area_type char(1), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (area_code) +); + + +-- 公司表 +CREATE TABLE js_sys_company +( + company_code varchar(64) NOT NULL, + parent_code varchar(64) NOT NULL, + parent_codes varchar(1000) NOT NULL, + tree_sort decimal(10) NOT NULL, + tree_sorts varchar(1000) NOT NULL, + tree_leaf char(1) NOT NULL, + tree_level decimal(4) NOT NULL, + tree_names varchar(1000) NOT NULL, + view_code varchar(100) NOT NULL, + company_name varchar(200) NOT NULL, + full_name varchar(200) NOT NULL, + area_code varchar(100), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + extend_s1 varchar(500), + extend_s2 varchar(500), + extend_s3 varchar(500), + extend_s4 varchar(500), + extend_s5 varchar(500), + extend_s6 varchar(500), + extend_s7 varchar(500), + extend_s8 varchar(500), + extend_i1 decimal(19), + extend_i2 decimal(19), + extend_i3 decimal(19), + extend_i4 decimal(19), + extend_f1 decimal(19,4), + extend_f2 decimal(19,4), + extend_f3 decimal(19,4), + extend_f4 decimal(19,4), + extend_d1 timestamp, + extend_d2 timestamp, + extend_d3 timestamp, + extend_d4 timestamp, + PRIMARY KEY (company_code) +); + + +-- 公司部门关联表 +CREATE TABLE js_sys_company_office +( + company_code varchar(64) NOT NULL, + office_code varchar(64) NOT NULL, + PRIMARY KEY (company_code, office_code) +); + + +-- 参数配置表 +CREATE TABLE js_sys_config +( + id varchar(64) NOT NULL, + config_name varchar(100) NOT NULL, + config_key varchar(100) NOT NULL, + config_value varchar(1000), + is_sys char(1) NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (id) +); + + +-- 字典数据表 +CREATE TABLE js_sys_dict_data +( + dict_code varchar(64) NOT NULL, + parent_code varchar(64) NOT NULL, + parent_codes varchar(1000) NOT NULL, + tree_sort decimal(10) NOT NULL, + tree_sorts varchar(1000) NOT NULL, + tree_leaf char(1) NOT NULL, + tree_level decimal(4) NOT NULL, + tree_names varchar(1000) NOT NULL, + dict_label varchar(100) NOT NULL, + dict_value varchar(100) NOT NULL, + dict_type varchar(100) NOT NULL, + is_sys char(1) NOT NULL, + description varchar(500), + css_style varchar(500), + css_class varchar(500), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + extend_s1 varchar(500), + extend_s2 varchar(500), + extend_s3 varchar(500), + extend_s4 varchar(500), + extend_s5 varchar(500), + extend_s6 varchar(500), + extend_s7 varchar(500), + extend_s8 varchar(500), + extend_i1 decimal(19), + extend_i2 decimal(19), + extend_i3 decimal(19), + extend_i4 decimal(19), + extend_f1 decimal(19,4), + extend_f2 decimal(19,4), + extend_f3 decimal(19,4), + extend_f4 decimal(19,4), + extend_d1 timestamp, + extend_d2 timestamp, + extend_d3 timestamp, + extend_d4 timestamp, + PRIMARY KEY (dict_code) +); + + +-- 字典类型表 +CREATE TABLE js_sys_dict_type +( + id varchar(64) NOT NULL, + dict_name varchar(100) NOT NULL, + dict_type varchar(100) NOT NULL, + is_sys char(1) NOT NULL, + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (id) +); + + +-- 员工表 +CREATE TABLE js_sys_employee +( + emp_code varchar(64) NOT NULL, + emp_name varchar(100) NOT NULL, + emp_name_en varchar(100), + office_code varchar(64) NOT NULL, + office_name varchar(100) NOT NULL, + company_code varchar(64), + company_name varchar(200), + status char(1) NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + PRIMARY KEY (emp_code) +); + + +-- 员工与岗位关联表 +CREATE TABLE js_sys_employee_post +( + emp_code varchar(64) NOT NULL, + post_code varchar(64) NOT NULL, + PRIMARY KEY (emp_code, post_code) +); + + +-- 文件实体表 +CREATE TABLE js_sys_file_entity +( + file_id varchar(64) NOT NULL, + file_md5 varchar(64) NOT NULL UNIQUE, + file_path varchar(1000) NOT NULL, + file_content_type varchar(200) NOT NULL, + file_extension varchar(100) NOT NULL, + file_size decimal(31) NOT NULL, + PRIMARY KEY (file_id) +); + + +-- 文件上传表 +CREATE TABLE js_sys_file_upload +( + id varchar(64) NOT NULL, + file_id varchar(64) NOT NULL, + file_name varchar(500) NOT NULL, + file_type varchar(20) NOT NULL, + biz_key varchar(64), + biz_type varchar(64), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (id) +); + + +-- 作业调度表 +CREATE TABLE js_sys_job +( + job_name varchar(64) NOT NULL, + job_group varchar(64) NOT NULL, + description varchar(100) NOT NULL, + invoke_target varchar(1000) NOT NULL, + cron_expression varchar(255) NOT NULL, + misfire_instruction decimal(1) NOT NULL, + concurrent char(1) NOT NULL, + status char(1) NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (job_name, job_group) +); + + +-- 作业调度日志表 +CREATE TABLE js_sys_job_log +( + id varchar(64) NOT NULL, + job_name varchar(64) NOT NULL, + job_group varchar(64) NOT NULL, + job_type varchar(50), + job_event varchar(200), + job_message varchar(500), + is_exception char(1), + exception_info clob, + create_date timestamp, + PRIMARY KEY (id) +); + + +-- 国际化语言 +CREATE TABLE js_sys_lang +( + id varchar(64) NOT NULL, + module_code varchar(64) NOT NULL, + lang_code varchar(500) NOT NULL, + lang_text varchar(500) NOT NULL, + lang_type varchar(50) NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (id) +); + + +-- 操作日志表 +CREATE TABLE js_sys_log +( + id varchar(64) NOT NULL, + log_type varchar(50) NOT NULL, + log_title varchar(500) NOT NULL, + create_by varchar(64) NOT NULL, + create_by_name varchar(100) NOT NULL, + create_date timestamp NOT NULL, + request_uri varchar(500), + request_method varchar(10), + request_params clob, + diff_modify_data clob, + biz_key varchar(64), + biz_type varchar(64), + remote_addr varchar(255) NOT NULL, + server_addr varchar(255) NOT NULL, + is_exception char(1), + exception_info clob, + user_agent varchar(500), + device_name varchar(100), + browser_name varchar(100), + execute_time decimal(19), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + PRIMARY KEY (id) +); + + +-- 菜单表 +CREATE TABLE js_sys_menu +( + menu_code varchar(64) NOT NULL, + parent_code varchar(64) NOT NULL, + parent_codes varchar(1000) NOT NULL, + tree_sort decimal(10) NOT NULL, + tree_sorts varchar(1000) NOT NULL, + tree_leaf char(1) NOT NULL, + tree_level decimal(4) NOT NULL, + tree_names varchar(1000) NOT NULL, + menu_name varchar(100) NOT NULL, + menu_type char(1) NOT NULL, + menu_href varchar(1000), + menu_target varchar(20), + menu_icon varchar(100), + menu_color varchar(50), + permission varchar(1000), + weight decimal(4), + is_show char(1) NOT NULL, + sys_code varchar(64) NOT NULL, + module_codes varchar(500) NOT NULL, + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + extend_s1 varchar(500), + extend_s2 varchar(500), + extend_s3 varchar(500), + extend_s4 varchar(500), + extend_s5 varchar(500), + extend_s6 varchar(500), + extend_s7 varchar(500), + extend_s8 varchar(500), + extend_i1 decimal(19), + extend_i2 decimal(19), + extend_i3 decimal(19), + extend_i4 decimal(19), + extend_f1 decimal(19,4), + extend_f2 decimal(19,4), + extend_f3 decimal(19,4), + extend_f4 decimal(19,4), + extend_d1 timestamp, + extend_d2 timestamp, + extend_d3 timestamp, + extend_d4 timestamp, + PRIMARY KEY (menu_code) +); + + +-- 模块表 +CREATE TABLE js_sys_module +( + module_code varchar(64) NOT NULL, + module_name varchar(100) NOT NULL, + description varchar(500), + main_class_name varchar(500), + current_version varchar(50), + upgrade_info varchar(300), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (module_code) +); + + +-- 内部消息 +CREATE TABLE js_sys_msg_inner +( + id varchar(64) NOT NULL, + msg_title varchar(200) NOT NULL, + content_level char(1) NOT NULL, + content_type char(1), + msg_content clob NOT NULL, + receive_type char(1) NOT NULL, + receive_codes clob NOT NULL, + receive_names clob NOT NULL, + send_user_code varchar(64) NOT NULL, + send_user_name varchar(100) NOT NULL, + send_date timestamp NOT NULL, + is_attac char(1), + notify_types varchar(100) NOT NULL, + status char(1) NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (id) +); + + +-- 内部消息发送记录表 +CREATE TABLE js_sys_msg_inner_record +( + id varchar(64) NOT NULL, + msg_inner_id varchar(64) NOT NULL, + receive_user_code varchar(64), + receive_user_name varchar(100) NOT NULL, + read_status char(1) NOT NULL, + read_date timestamp, + is_star char(1), + PRIMARY KEY (id) +); + + +-- 消息推送表 +CREATE TABLE js_sys_msg_push +( + id varchar(64) NOT NULL, + msg_type varchar(16) NOT NULL, + msg_title varchar(200) NOT NULL, + msg_content clob NOT NULL, + biz_key varchar(64), + biz_type varchar(64), + receive_code varchar(64) NOT NULL, + receive_user_code varchar(64) NOT NULL, + receive_user_name varchar(100) NOT NULL, + send_user_code varchar(64) NOT NULL, + send_user_name varchar(100) NOT NULL, + send_date timestamp NOT NULL, + is_merge_push char(1), + plan_push_date timestamp, + push_number int, + push_return_code varchar(200), + push_return_msg_id varchar(200), + push_return_content clob, + push_status char(1), + push_date timestamp, + read_status char(1), + read_date timestamp, + PRIMARY KEY (id) +); + + +-- 消息已推送表 +CREATE TABLE js_sys_msg_pushed +( + id varchar(64) NOT NULL, + msg_type varchar(16) NOT NULL, + msg_title varchar(200) NOT NULL, + msg_content clob NOT NULL, + biz_key varchar(64), + biz_type varchar(64), + receive_code varchar(64) NOT NULL, + receive_user_code varchar(64) NOT NULL, + receive_user_name varchar(100) NOT NULL, + send_user_code varchar(64) NOT NULL, + send_user_name varchar(100) NOT NULL, + send_date timestamp NOT NULL, + is_merge_push char(1), + plan_push_date timestamp, + push_number int, + push_return_content clob, + push_return_code varchar(200), + push_return_msg_id varchar(200), + push_status char(1), + push_date timestamp, + read_status char(1), + read_date timestamp, + PRIMARY KEY (id) +); + + +-- 消息模板 +CREATE TABLE js_sys_msg_template +( + id varchar(64) NOT NULL, + module_code varchar(64), + tpl_key varchar(100) NOT NULL, + tpl_name varchar(100) NOT NULL, + tpl_type varchar(16) NOT NULL, + tpl_content clob NOT NULL, + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + PRIMARY KEY (id) +); + + +-- 组织机构表 +CREATE TABLE js_sys_office +( + office_code varchar(64) NOT NULL, + parent_code varchar(64) NOT NULL, + parent_codes varchar(1000) NOT NULL, + tree_sort decimal(10) NOT NULL, + tree_sorts varchar(1000) NOT NULL, + tree_leaf char(1) NOT NULL, + tree_level decimal(4) NOT NULL, + tree_names varchar(1000) NOT NULL, + view_code varchar(100) NOT NULL, + office_name varchar(100) NOT NULL, + full_name varchar(200) NOT NULL, + office_type char(1) NOT NULL, + leader varchar(100), + phone varchar(100), + address varchar(255), + zip_code varchar(100), + email varchar(300), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + extend_s1 varchar(500), + extend_s2 varchar(500), + extend_s3 varchar(500), + extend_s4 varchar(500), + extend_s5 varchar(500), + extend_s6 varchar(500), + extend_s7 varchar(500), + extend_s8 varchar(500), + extend_i1 decimal(19), + extend_i2 decimal(19), + extend_i3 decimal(19), + extend_i4 decimal(19), + extend_f1 decimal(19,4), + extend_f2 decimal(19,4), + extend_f3 decimal(19,4), + extend_f4 decimal(19,4), + extend_d1 timestamp, + extend_d2 timestamp, + extend_d3 timestamp, + extend_d4 timestamp, + PRIMARY KEY (office_code) +); + + +-- 员工岗位表 +CREATE TABLE js_sys_post +( + post_code varchar(64) NOT NULL, + post_name varchar(100) NOT NULL, + post_type varchar(100), + post_sort decimal(10), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + PRIMARY KEY (post_code) +); + + +-- 角色表 +CREATE TABLE js_sys_role +( + role_code varchar(64) NOT NULL, + role_name varchar(100) NOT NULL, + role_type varchar(100), + role_sort decimal(10), + is_sys char(1), + user_type varchar(16), + data_scope char(1), + status char(1) DEFAULT '0' NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + PRIMARY KEY (role_code) +); + + +-- 角色数据权限表 +CREATE TABLE js_sys_role_data_scope +( + role_code varchar(64) NOT NULL, + ctrl_type varchar(20) NOT NULL, + ctrl_data varchar(64) NOT NULL, + ctrl_permi varchar(64) NOT NULL, + PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi) +); + + +-- 角色与菜单关联表 +CREATE TABLE js_sys_role_menu +( + role_code varchar(64) NOT NULL, + menu_code varchar(64) NOT NULL, + PRIMARY KEY (role_code, menu_code) +); + + +-- 用户表 +CREATE TABLE js_sys_user +( + user_code varchar(100) NOT NULL, + login_code varchar(100) NOT NULL, + user_name varchar(100) NOT NULL, + password varchar(100) NOT NULL, + email varchar(300), + mobile varchar(100), + phone varchar(100), + sex char(1), + avatar varchar(1000), + sign varchar(200), + wx_openid varchar(100), + mobile_imei varchar(100), + user_type varchar(16) NOT NULL, + ref_code varchar(64), + ref_name varchar(100), + mgr_type char(1) NOT NULL, + pwd_security_level decimal(1), + pwd_update_date timestamp, + pwd_update_record varchar(1000), + pwd_question varchar(200), + pwd_question_answer varchar(200), + pwd_question_2 varchar(200), + pwd_question_answer_2 varchar(200), + pwd_question_3 varchar(200), + pwd_question_answer_3 varchar(200), + pwd_quest_update_date timestamp, + last_login_ip varchar(100), + last_login_date timestamp, + freeze_date timestamp, + freeze_cause varchar(200), + user_weight decimal(8) DEFAULT 0, + status char NOT NULL, + create_by varchar(64) NOT NULL, + create_date timestamp NOT NULL, + update_by varchar(64) NOT NULL, + update_date timestamp NOT NULL, + remarks varchar(500), + corp_code varchar(64) DEFAULT '0' NOT NULL, + corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL, + extend_s1 varchar(500), + extend_s2 varchar(500), + extend_s3 varchar(500), + extend_s4 varchar(500), + extend_s5 varchar(500), + extend_s6 varchar(500), + extend_s7 varchar(500), + extend_s8 varchar(500), + extend_i1 decimal(19), + extend_i2 decimal(19), + extend_i3 decimal(19), + extend_i4 decimal(19), + extend_f1 decimal(19,4), + extend_f2 decimal(19,4), + extend_f3 decimal(19,4), + extend_f4 decimal(19,4), + extend_d1 timestamp, + extend_d2 timestamp, + extend_d3 timestamp, + extend_d4 timestamp, + PRIMARY KEY (user_code) +); + + +-- 用户数据权限表 +CREATE TABLE js_sys_user_data_scope +( + user_code varchar(100) NOT NULL, + ctrl_type varchar(20) NOT NULL, + ctrl_data varchar(64) NOT NULL, + ctrl_permi varchar(64) NOT NULL, + PRIMARY KEY (user_code, ctrl_type, ctrl_data, ctrl_permi) +); + + +-- 用户与角色关联表 +CREATE TABLE js_sys_user_role +( + user_code varchar(100) NOT NULL, + role_code varchar(64) NOT NULL, + PRIMARY KEY (user_code, role_code) +); + + + +/* Create Indexes */ + +CREATE INDEX idx_gen_table_ptn ON js_gen_table (parent_table_name); +CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column (table_name); +CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code); +CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort); +CREATE INDEX idx_sys_area_status ON js_sys_area (status); +CREATE INDEX idx_sys_area_pcs ON js_sys_area (parent_codes); +CREATE INDEX idx_sys_area_tss ON js_sys_area (tree_sorts); +CREATE INDEX idx_sys_company_cc ON js_sys_company (corp_code); +CREATE INDEX idx_sys_company_pc ON js_sys_company (parent_code); +CREATE INDEX idx_sys_company_ts ON js_sys_company (tree_sort); +CREATE INDEX idx_sys_company_status ON js_sys_company (status); +CREATE INDEX idx_sys_company_vc ON js_sys_company (view_code); +CREATE INDEX idx_sys_company_pcs ON js_sys_company (parent_codes); +CREATE INDEX idx_sys_company_tss ON js_sys_company (tree_sorts); +CREATE INDEX idx_sys_config_key ON js_sys_config (config_key); +CREATE INDEX idx_sys_dict_data_cc ON js_sys_dict_data (corp_code); +CREATE INDEX idx_sys_dict_data_dt ON js_sys_dict_data (dict_type); +CREATE INDEX idx_sys_dict_data_pc ON js_sys_dict_data (parent_code); +CREATE INDEX idx_sys_dict_data_status ON js_sys_dict_data (status); +CREATE INDEX idx_sys_dict_data_pcs ON js_sys_dict_data (parent_codes); +CREATE INDEX idx_sys_dict_data_ts ON js_sys_dict_data (tree_sort); +CREATE INDEX idx_sys_dict_data_tss ON js_sys_dict_data (tree_sorts); +CREATE INDEX idx_sys_dict_data_dv ON js_sys_dict_data (dict_value); +CREATE INDEX idx_sys_dict_type_is ON js_sys_dict_type (is_sys); +CREATE INDEX idx_sys_dict_type_status ON js_sys_dict_type (status); +CREATE INDEX idx_sys_employee_cco ON js_sys_employee (company_code); +CREATE INDEX idx_sys_employee_cc ON js_sys_employee (corp_code); +CREATE INDEX idx_sys_employee_ud ON js_sys_employee (update_date); +CREATE INDEX idx_sys_employee_oc ON js_sys_employee (office_code); +CREATE INDEX idx_sys_employee_status ON js_sys_employee (status); +CREATE INDEX idx_sys_file_entity_md5 ON js_sys_file_entity (file_md5); +CREATE INDEX idx_sys_file_entity_size ON js_sys_file_entity (file_size); +CREATE INDEX idx_sys_file_biz_ft ON js_sys_file_upload (file_type); +CREATE INDEX idx_sys_file_biz_fi ON js_sys_file_upload (file_id); +CREATE INDEX idx_sys_file_biz_status ON js_sys_file_upload (status); +CREATE INDEX idx_sys_file_biz_cb ON js_sys_file_upload (create_by); +CREATE INDEX idx_sys_file_biz_ud ON js_sys_file_upload (update_date); +CREATE INDEX idx_sys_file_biz_bt ON js_sys_file_upload (biz_type); +CREATE INDEX idx_sys_file_biz_bk ON js_sys_file_upload (biz_key); +CREATE INDEX idx_sys_job_status ON js_sys_job (status); +CREATE INDEX idx_sys_job_log_jn ON js_sys_job_log (job_name); +CREATE INDEX idx_sys_job_log_jg ON js_sys_job_log (job_group); +CREATE INDEX idx_sys_job_log_t ON js_sys_job_log (job_type); +CREATE INDEX idx_sys_job_log_e ON js_sys_job_log (job_event); +CREATE INDEX idx_sys_job_log_ie ON js_sys_job_log (is_exception); +CREATE INDEX idx_sys_lang_code ON js_sys_lang (lang_code); +CREATE INDEX idx_sys_lang_type ON js_sys_lang (lang_type); +CREATE INDEX idx_sys_log_cb ON js_sys_log (create_by); +CREATE INDEX idx_sys_log_cc ON js_sys_log (corp_code); +CREATE INDEX idx_sys_log_lt ON js_sys_log (log_type); +CREATE INDEX idx_sys_log_bk ON js_sys_log (biz_key); +CREATE INDEX idx_sys_log_bt ON js_sys_log (biz_type); +CREATE INDEX idx_sys_log_ie ON js_sys_log (is_exception); +CREATE INDEX idx_sys_log_cd ON js_sys_log (create_date); +CREATE INDEX idx_sys_menu_pc ON js_sys_menu (parent_code); +CREATE INDEX idx_sys_menu_ts ON js_sys_menu (tree_sort); +CREATE INDEX idx_sys_menu_status ON js_sys_menu (status); +CREATE INDEX idx_sys_menu_mt ON js_sys_menu (menu_type); +CREATE INDEX idx_sys_menu_pss ON js_sys_menu (parent_codes); +CREATE INDEX idx_sys_menu_tss ON js_sys_menu (tree_sorts); +CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code); +CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show); +CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes); +CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight); +CREATE INDEX idx_sys_module_status ON js_sys_module (status); +CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by); +CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status); +CREATE INDEX idx_sys_msg_inner_cl ON js_sys_msg_inner (content_level); +CREATE INDEX idx_sys_msg_inner_sc ON js_sys_msg_inner (send_user_code); +CREATE INDEX idx_sys_msg_inner_sd ON js_sys_msg_inner (send_date); +CREATE INDEX idx_sys_msg_inner_r_mi ON js_sys_msg_inner_record (msg_inner_id); +CREATE INDEX idx_sys_msg_inner_r_rc ON js_sys_msg_inner_record (receive_user_code); +CREATE INDEX idx_sys_msg_inner_r_ruc ON js_sys_msg_inner_record (receive_user_code); +CREATE INDEX idx_sys_msg_inner_r_status ON js_sys_msg_inner_record (read_status); +CREATE INDEX idx_sys_msg_inner_r_star ON js_sys_msg_inner_record (is_star); +CREATE INDEX idx_sys_msg_push_type ON js_sys_msg_push (msg_type); +CREATE INDEX idx_sys_msg_push_rc ON js_sys_msg_push (receive_code); +CREATE INDEX idx_sys_msg_push_uc ON js_sys_msg_push (receive_user_code); +CREATE INDEX idx_sys_msg_push_suc ON js_sys_msg_push (send_user_code); +CREATE INDEX idx_sys_msg_push_pd ON js_sys_msg_push (plan_push_date); +CREATE INDEX idx_sys_msg_push_ps ON js_sys_msg_push (push_status); +CREATE INDEX idx_sys_msg_push_rs ON js_sys_msg_push (read_status); +CREATE INDEX idx_sys_msg_push_bk ON js_sys_msg_push (biz_key); +CREATE INDEX idx_sys_msg_push_bt ON js_sys_msg_push (biz_type); +CREATE INDEX idx_sys_msg_push_imp ON js_sys_msg_push (is_merge_push); +CREATE INDEX idx_sys_msg_pushed_type ON js_sys_msg_pushed (msg_type); +CREATE INDEX idx_sys_msg_pushed_rc ON js_sys_msg_pushed (receive_code); +CREATE INDEX idx_sys_msg_pushed_uc ON js_sys_msg_pushed (receive_user_code); +CREATE INDEX idx_sys_msg_pushed_suc ON js_sys_msg_pushed (send_user_code); +CREATE INDEX idx_sys_msg_pushed_pd ON js_sys_msg_pushed (plan_push_date); +CREATE INDEX idx_sys_msg_pushed_ps ON js_sys_msg_pushed (push_status); +CREATE INDEX idx_sys_msg_pushed_rs ON js_sys_msg_pushed (read_status); +CREATE INDEX idx_sys_msg_pushed_bk ON js_sys_msg_pushed (biz_key); +CREATE INDEX idx_sys_msg_pushed_bt ON js_sys_msg_pushed (biz_type); +CREATE INDEX idx_sys_msg_pushed_imp ON js_sys_msg_pushed (is_merge_push); +CREATE INDEX idx_sys_msg_tpl_key ON js_sys_msg_template (tpl_key); +CREATE INDEX idx_sys_msg_tpl_type ON js_sys_msg_template (tpl_type); +CREATE INDEX idx_sys_msg_tpl_status ON js_sys_msg_template (status); +CREATE INDEX idx_sys_office_cc ON js_sys_office (corp_code); +CREATE INDEX idx_sys_office_pc ON js_sys_office (parent_code); +CREATE INDEX idx_sys_office_pcs ON js_sys_office (parent_codes); +CREATE INDEX idx_sys_office_status ON js_sys_office (status); +CREATE INDEX idx_sys_office_ot ON js_sys_office (office_type); +CREATE INDEX idx_sys_office_vc ON js_sys_office (view_code); +CREATE INDEX idx_sys_office_ts ON js_sys_office (tree_sort); +CREATE INDEX idx_sys_office_tss ON js_sys_office (tree_sorts); +CREATE INDEX idx_sys_post_cc ON js_sys_post (corp_code); +CREATE INDEX idx_sys_post_status ON js_sys_post (status); +CREATE INDEX idx_sys_post_ps ON js_sys_post (post_sort); +CREATE INDEX idx_sys_role_cc ON js_sys_role (corp_code); +CREATE INDEX idx_sys_role_is ON js_sys_role (is_sys); +CREATE INDEX idx_sys_role_status ON js_sys_role (status); +CREATE INDEX idx_sys_role_rs ON js_sys_role (role_sort); +CREATE INDEX idx_sys_user_lc ON js_sys_user (login_code); +CREATE INDEX idx_sys_user_email ON js_sys_user (email); +CREATE INDEX idx_sys_user_mobile ON js_sys_user (mobile); +CREATE INDEX idx_sys_user_wo ON js_sys_user (wx_openid); +CREATE INDEX idx_sys_user_imei ON js_sys_user (mobile_imei); +CREATE INDEX idx_sys_user_rt ON js_sys_user (user_type); +CREATE INDEX idx_sys_user_rc ON js_sys_user (ref_code); +CREATE INDEX idx_sys_user_mt ON js_sys_user (mgr_type); +CREATE INDEX idx_sys_user_us ON js_sys_user (user_weight); +CREATE INDEX idx_sys_user_ud ON js_sys_user (update_date); +CREATE INDEX idx_sys_user_status ON js_sys_user (status); +CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code); + + + diff --git a/modules/core/db/mysql/create_user.sql b/modules/core/db/mysql/create_user.sql deleted file mode 100644 index b58c02f2..00000000 --- a/modules/core/db/mysql/create_user.sql +++ /dev/null @@ -1,13 +0,0 @@ - --- 打开 my.ini 给 [mysqld] 增加如下配置: --- sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION - -set global read_only=0; - -create user 'jeesite'@'%' identified by 'jeesite'; - -create database jeesite DEFAULT CHARSET utf8 COLLATE utf8_general_ci; - -grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite'; - -flush privileges; diff --git a/modules/core/db/oracle/create_user.sql b/modules/core/db/oracle/create_user.sql deleted file mode 100644 index a270e674..00000000 --- a/modules/core/db/oracle/create_user.sql +++ /dev/null @@ -1,15 +0,0 @@ - -create user jeesite - identified by jeesite - quota unlimited on users; - -grant connect,resource,create session,select any table, - create any view,create any table,create any index, - drop any table,drop any view,drop any index - to jeesite; - --- 多数据源分布式事务下,需要对目标用户进行如下授权,否则会提示错误:ResourceException: Error in recovery -grant select on sys.dba_pending_transactions to jeesite; -grant select on sys.pending_trans$ to jeesite; -grant select on sys.dba_2pc_pending to jeesite; -grant execute on sys.dbms_system to jeesite; diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7657c68d..8c98f33e 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -6,7 +6,7 @@ com.jeesite jeesite-parent - 4.0.7-SNAPSHOT + 4.1.0-SNAPSHOT ../../parent/pom.xml @@ -23,12 +23,38 @@ + + + com.oracle + ojdbc6 + 11.2.0.3 + runtime + + + mysql + mysql-connector-java + runtime + + + net.sourceforge.jtds + jtds + runtime + + + org.postgresql + postgresql + runtime + + + + com.jeesite jeesite-common ${project.parent.version} + com.jeesite jeesite-framework diff --git a/modules/core/src/main/java/com/jeesite/modules/config/ShiroConfig.java b/modules/core/src/main/java/com/jeesite/modules/config/ShiroConfig.java index 1c7fc44a..bdc242c2 100644 --- a/modules/core/src/main/java/com/jeesite/modules/config/ShiroConfig.java +++ b/modules/core/src/main/java/com/jeesite/modules/config/ShiroConfig.java @@ -54,8 +54,8 @@ public class ShiroConfig { @Bean @Order(3000) @ConditionalOnMissingBean(name="shiroFilterProxy") - public FilterRegistrationBean shiroFilterProxy(ShiroFilterFactoryBean shiroFilter) throws Exception { - FilterRegistrationBean bean = new FilterRegistrationBean(); + public FilterRegistrationBean shiroFilterProxy(ShiroFilterFactoryBean shiroFilter) throws Exception { + FilterRegistrationBean bean = new FilterRegistrationBean<>(); bean.setFilter((Filter) shiroFilter.getInstance()); bean.addUrlPatterns("/*"); return bean; diff --git a/modules/core/src/main/java/com/jeesite/modules/config/web/DruidStatConfig.java b/modules/core/src/main/java/com/jeesite/modules/config/web/DruidStatConfig.java index f4c6c53e..9f86a281 100644 --- a/modules/core/src/main/java/com/jeesite/modules/config/web/DruidStatConfig.java +++ b/modules/core/src/main/java/com/jeesite/modules/config/web/DruidStatConfig.java @@ -25,8 +25,8 @@ public class DruidStatConfig { * 注册DruidFilter拦截 */ @Bean - public FilterRegistrationBean duridFilter() { - FilterRegistrationBean bean = new FilterRegistrationBean(); + public FilterRegistrationBean duridFilter() { + FilterRegistrationBean bean = new FilterRegistrationBean<>(); bean.setFilter(new WebStatFilter()); bean.addInitParameter("exclusions", "*.css,*.js,*.png," + "*.jpg,*.gif,*.jpeg,*.bmp,*.ico,*.swf,*.psd,*.htc,*.htm,*.html," @@ -40,8 +40,8 @@ public class DruidStatConfig { * 注册DruidServlet */ @Bean - public ServletRegistrationBean druidServlet() { - ServletRegistrationBean bean = new ServletRegistrationBean(); + public ServletRegistrationBean druidServlet() { + ServletRegistrationBean bean = new ServletRegistrationBean<>(); bean.setServlet(new StatViewServlet()); bean.addUrlMappings("/druid/*"); return bean; diff --git a/modules/core/src/main/java/com/jeesite/modules/config/web/PageCacheConfig.java b/modules/core/src/main/java/com/jeesite/modules/config/web/PageCacheConfig.java index ac9c15a3..574fa514 100644 --- a/modules/core/src/main/java/com/jeesite/modules/config/web/PageCacheConfig.java +++ b/modules/core/src/main/java/com/jeesite/modules/config/web/PageCacheConfig.java @@ -3,42 +3,47 @@ */ package com.jeesite.modules.config.web; -import org.apache.commons.lang3.StringUtils; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; - -import com.jeesite.common.config.Global; -import com.jeesite.common.web.PageCachingFilter; /** - * Filter 配置 + * 页面缓存,如果需要,则加入如下依赖并取消下面注释 + +1、pom.xml: + + net.sf.ehcache + ehcache-web + 2.0.4 + + +2、application.yml: +# 页面缓存配置 +ehcache: + pageCaching: + enabled: false + urlPatterns: "*.html" + * @author ThinkGem * @version 2017年11月30日 */ @Configuration public class PageCacheConfig { - - /** - * PageCache Filter, cache .html suffix. - */ - @Bean - @Order(2000) - @ConditionalOnProperty(name = "ehcache.pageCaching.enabled", havingValue = "true") - @ConditionalOnMissingBean(name="pageCachingFilter") - public FilterRegistrationBean pageCachingFilter(EhCacheManagerFactoryBean ehCacheManager) { - FilterRegistrationBean bean = new FilterRegistrationBean(); - PageCachingFilter pageCachingFilter = new PageCachingFilter(); - pageCachingFilter.setCacheManager(ehCacheManager.getObject()); - bean.setFilter(pageCachingFilter); - bean.addInitParameter("cacheName", "pageCachingFilter"); - bean.addUrlPatterns(StringUtils.split(Global.getProperty( - "ehcache.pageCaching.urlPatterns"), ",")); - return bean; - } + +// /** +// * PageCache Filter, cache .html suffix. +// */ +// @Bean +// @Order(2000) +// @ConditionalOnProperty(name = "ehcache.pageCaching.enabled", havingValue = "true") +// @ConditionalOnMissingBean(name="pageCachingFilter") +// public FilterRegistrationBean pageCachingFilter(EhCacheManagerFactoryBean ehCacheManager) { +// FilterRegistrationBean bean = new FilterRegistrationBean<>(); +// SimplePageCachingFilter pageCachingFilter = new SimplePageCachingFilter(); +// pageCachingFilter.setCacheManager(ehCacheManager.getObject()); +// bean.setFilter(pageCachingFilter); +// bean.addInitParameter("cacheName", "pageCachingFilter"); +// bean.addUrlPatterns(StringUtils.split(Global.getProperty( +// "ehcache.pageCaching.urlPatterns"), ",")); +// return bean; +// } } diff --git a/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/LogInterceptorConfig.java b/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/LogInterceptorConfig.java index 8606adf0..8e7ce1db 100644 --- a/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/LogInterceptorConfig.java +++ b/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/LogInterceptorConfig.java @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import com.jeesite.common.config.Global; import com.jeesite.common.lang.StringUtils; @@ -22,7 +22,7 @@ import com.jeesite.modules.sys.interceptor.LogInterceptor; @Configuration @EnableWebMvc @ConditionalOnProperty(name="web.interceptor.log.enabled", havingValue="true", matchIfMissing=true) -public class LogInterceptorConfig extends WebMvcConfigurerAdapter { +public class LogInterceptorConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { diff --git a/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/MobileViewInterceptorConfig.java b/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/MobileViewInterceptorConfig.java index d78d6599..903ca881 100644 --- a/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/MobileViewInterceptorConfig.java +++ b/modules/core/src/main/java/com/jeesite/modules/config/web/interceptor/MobileViewInterceptorConfig.java @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.InterceptorRegistration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import com.jeesite.common.config.Global; import com.jeesite.common.lang.StringUtils; @@ -22,7 +22,7 @@ import com.jeesite.modules.sys.interceptor.MobileInterceptor; @Configuration @EnableWebMvc @ConditionalOnProperty(name="web.interceptor.mobile.enabled", havingValue="true", matchIfMissing=false) -public class MobileViewInterceptorConfig extends WebMvcConfigurerAdapter { +public class MobileViewInterceptorConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Area.java b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Area.java index 17db7401..17bdb6ff 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Area.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Area.java @@ -4,7 +4,7 @@ package com.jeesite.modules.sys.entity; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import com.jeesite.common.entity.DataEntity; import com.jeesite.common.entity.TreeEntity; diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Company.java b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Company.java index 6c48b343..22f51e2a 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Company.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Company.java @@ -9,7 +9,7 @@ import javax.validation.constraints.Pattern; import org.apache.commons.lang3.StringUtils; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import com.jeesite.common.collect.ListUtils; import com.jeesite.common.entity.BaseEntity; diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Log.java b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Log.java index 0c5a2354..533a5246 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Log.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Log.java @@ -7,7 +7,7 @@ import java.util.Map; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import com.jeesite.common.collect.MapUtils; import com.jeesite.common.entity.BaseEntity; diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Office.java b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Office.java index 8b0de704..78dd5831 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Office.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Office.java @@ -6,7 +6,7 @@ package com.jeesite.modules.sys.entity; import javax.validation.constraints.Pattern; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import com.fasterxml.jackson.annotation.JsonIgnore; import com.jeesite.common.entity.BaseEntity; diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Post.java b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Post.java index ff23c8f2..86eb9465 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/entity/Post.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/entity/Post.java @@ -4,7 +4,7 @@ package com.jeesite.modules.sys.entity; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; +import javax.validation.constraints.NotBlank; import com.jeesite.common.entity.BaseEntity; import com.jeesite.common.entity.DataEntity; diff --git a/modules/core/src/main/resources/config/jeesite-core.yml b/modules/core/src/main/resources/config/jeesite-core.yml index 2c449733..e7ce64a1 100644 --- a/modules/core/src/main/resources/config/jeesite-core.yml +++ b/modules/core/src/main/resources/config/jeesite-core.yml @@ -1,8 +1,8 @@ -# 温馨提示:不建议直接修改此文件,为了平台升级方便,建议将需要修改的参数值,复制到jeesite.yml里进行覆盖该参数值。 +# 温馨提示:不建议直接修改此文件,为了平台升级方便,建议将需要修改的参数值,复制到application.yml里进行覆盖该参数值。 -#============================# -#===== Database sttings =====# -#============================# +#======================================# +#========== Database sttings ==========# +#======================================# # 数据库连接 jdbc: @@ -73,38 +73,46 @@ jdbc: stat: enabled: true -# Redis 配置 -redis: - enabled: false - - # Redis 连接参数 - host: 127.0.0.1 - port: 6379 - isSSL: false - timeout: 2000 - password: 1234 - database: 0 - clientName: ~ - - # Redis 连接池配置 - pool: - maxIdle: 3 - maxTotal: 20 - - # 是否启用Redis系统缓存及会话(专业版) - cacheAndSession: false - - # 定义Key的前缀标识 - keyPrefix: ${jdbc.tablePrefix} +#======================================# +#========== Spring settings ===========# +#======================================# -#============================# -#===== System settings ======# -#============================# +spring: + + # Redis 连接参数 (RedisProperties) + redis: + host: 127.0.0.1 + port: 6379 + ssl: false + database: 0 + password: 1234 + timeout: 2000 + lettuce: + pool: + # 最大空闲连接数 + maxIdle: 3 + # 最大活动连接数 + maxActive: 20 + + # 缓存配置 + cache: + # 缓存及会话共享(专业版) + isClusterMode: false + # 清理全部缓存按钮所清理的缓存列表 + clearNames: sysCache,corpCache,userCache,cmsCache + + # 关闭 Spring Boot Banner 打印 + main: + bannerMode: "off" + +#======================================# +#========== System settings ===========# +#======================================# -#管理基础路径 +# 管理基础路径 adminPath: /a -#前端基础路径 +# 前端基础路径 frontPath: /f # 分页配置 @@ -232,15 +240,15 @@ job: trigger: enabled: false -# 内容管理 -cms: - - # 内容管理主站点编码 - mainSiteCode: main +## 内容管理 +#cms: +# +# # 内容管理主站点编码 +# mainSiteCode: main -#============================# -#==== Framework settings ====# -#============================# +#======================================# +#========= Framework settings =========# +#======================================# # Shiro 相关配置 shiro: @@ -296,7 +304,7 @@ shiro: isAllowExternalSiteIframe: true # 是否允许跨域访问,如果允许,设置允许的域名,全部域名设置*号,如果不允许,此设置应该为空 -# accessControlAllowOrigin: http://demo.jeesite.net +# accessControlAllowOrigin: http://demo.jeesite.com # accessControlAllowOrigin: '*' # 是否在登录后生成新的Session(默认false) @@ -339,19 +347,19 @@ shiro: # Session 相关 session: - #全局会话超时,单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms, 12h=43200000ms, 1day=86400000ms + # 全局会话超时,单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms, 12h=43200000ms, 1day=86400000ms sessionTimeout: 1800000 - #手机APP设备会话超时参数设置,登录请求参数加 param_deviceType=mobileApp 时有效 + # 手机APP设备会话超时参数设置,登录请求参数加 param_deviceType=mobileApp 时有效 mobileAppSessionTimeout: 43200000 - #定时清理失效会话,清理用户直接关闭浏览器造成的孤立会话 + # 定时清理失效会话,清理用户直接关闭浏览器造成的孤立会话 sessionTimeoutClean: 1200000 - #会话唯一标识SessionId在Cookie中的名称。 + # 会话唯一标识SessionId在Cookie中的名称。 sessionIdCookieName: jeesite.session.id - #共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。 + # 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。 #shareSessionIdCookieName: ${session.sessionIdCookieName} # MyBatis 相关 @@ -371,21 +379,6 @@ mybatis: sleepSeconds: 3 mappingPath: mappings -# 缓存设置 -ehcache: - - # 缓存配置文件路径 - configFile: cache/ehcache-local.xml -# configFile: cache/ehcache-rmi.xml - - # 清理缓存的缓存名称 - clearNames: sysCache,userCache,corpCache,cmsCache,pageCachingFilter - - # 页面缓存配置 - pageCaching: - enabled: false - urlPatterns: "*.html" - # Web 相关 web: @@ -431,21 +424,25 @@ web: # 自定义正则表达式验证(主键、登录名) validator: - id: '[a-zA-Z0-9_\-/\u4e00-\u9fa5]{0,64}' + id: '[a-zA-Z0-9_\-/#\u4e00-\u9fa5]{0,64}' user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}' # 关闭核心模块的Web功能(仅作为微服务时设为false) core: enabled: true - + + # 在线API文档工具 + swagger: + enabled: true + # 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false) error: page: printErrorInfo: true -#============================# -#=== FileUpload settings ====# -#============================# +#======================================# +#======== FileUpload settings =========# +#======================================# file: enabled: true @@ -470,13 +467,14 @@ file: # application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, # application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation -#============================# -#===== Message settings =====# -#============================# +#======================================# +#========== Message settings ==========# +#======================================# # 消息提醒中心(专业版) msg: - + enabled: true + # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。 realtime: # 是否开启 @@ -521,11 +519,11 @@ msg: debug: true # 微信OAuth登录授权回调地址 oauth: - redirectUri: http://demo.jeesite.com/jeesite + redirectUri: http://demo.jeesite.com/js -#============================# -#===== Video settings =======# -#============================# +#======================================# +#========== Video settings ============# +#======================================# video: @@ -538,8 +536,3 @@ video: # 将mp4视频的元数据信息转到视频第一帧 qtFaststartFile: d:/tools/video/qt-faststart/qt-faststart.exe - -#============================# -#===== Project settings =====# -#============================# - diff --git a/modules/core/src/main/resources/config/logger-core.xml b/modules/core/src/main/resources/config/logger-core.xml index 2d46a2df..cdca16e6 100644 --- a/modules/core/src/main/resources/config/logger-core.xml +++ b/modules/core/src/main/resources/config/logger-core.xml @@ -1,15 +1,23 @@ - + + + + + + + + + - - - + + + @@ -19,5 +27,5 @@ - + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/config.xml b/modules/core/src/main/resources/templates/modules/gen/config.xml new file mode 100644 index 00000000..28b50e28 --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/config.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml b/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml new file mode 100644 index 00000000..9c511be5 --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml @@ -0,0 +1,268 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/dao.xml b/modules/core/src/main/resources/templates/modules/gen/crud/dao.xml new file mode 100644 index 00000000..adcbc63e --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/dao.xml @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml b/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml new file mode 100644 index 00000000..50d65e5f --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/entity.xml @@ -0,0 +1,343 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/mapper.xml b/modules/core/src/main/resources/templates/modules/gen/crud/mapper.xml new file mode 100644 index 00000000..1baa8810 --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/mapper.xml @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/service.xml b/modules/core/src/main/resources/templates/modules/gen/crud/service.xml new file mode 100644 index 00000000..a6f7ab7b --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/service.xml @@ -0,0 +1,170 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml b/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml new file mode 100644 index 00000000..20239df5 --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml @@ -0,0 +1,96 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml b/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml new file mode 100644 index 00000000..d44c90a5 --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/crud/viewList.xml @@ -0,0 +1,145 @@ + + \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html b/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html new file mode 100644 index 00000000..c6c9e30a --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/include/formChildTable.html @@ -0,0 +1,14 @@ +<% + // 输出子表控件 + for (child in table.childList){ +%> +

\${text('${child.comments}')}

+
+
+ \<% if (hasPermi('${permissionPrefix}:edit')){ %> + \${text('增行')} + \<% } %> +
+<% + } +%> \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html new file mode 100644 index 00000000..7ec6a5db --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/include/formChildTableScript.html @@ -0,0 +1,172 @@ +<% // 输出子表 Script脚本 +if (table.childList.~size > 0){ %> + +<% if(treeselectExists){ %> + +<% } %> +<% } %> \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html new file mode 100644 index 00000000..84be69e3 --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html @@ -0,0 +1,213 @@ +<% + var rowFlag = -1, preGridRowCol; + for (c in table.columnList){ + if (c.isEdit == '1'){ + // 如果是树结构的字段,则自动忽略 + if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code', + 'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')){ + } + // 如果是隐藏域 + else if (c.showType == 'hidden'){ +%> + <${'#'}form:hidden path="${c.attrName}"/> +<% + } + // 输出表单字段 + else{ + // 栅格参数获取 + var gridRowCol = @StringUtils.split(c.optionMap['gridRowCol'], '/'); + if (isBlank(gridRowCol) || gridRowCol.~size != 3){ + if (c.showType == 'textarea'){ + gridRowCol = @StringUtils.split('12/2/10', '/'); + }else{ + gridRowCol = @StringUtils.split('6/4/8', '/'); + } + } + // 是否强制新行获取,生成字段界面用户设定的 + var isNewLine = @Global.YES.equals(c.optionMap['isNewLine']); + if (isBlank(c.optionMap['isNewLine'])){ + if (c.showType == 'textarea'){ + isNewLine = true; + } + } + // 如果上一个控件占12列,则强制新行算了 + if (isNotEmpty(preGridRowCol) && preGridRowCol[0] == '12'){ + isNewLine = true; + } + // 保存上一个控件输出栅格对象 + preGridRowCol = gridRowCol; + // 如果完成输出2列,则换行 + if(rowFlag == 2){ + isNewLine = true; + } + // 如果是扩展字段,则输出子标题,并且强制换行 + if (c.columnName == 'extend_s1'){ + isNewLine = true; + } + // 如果是第一个控件 + if (rowFlag == -1){ +%> +
+<% + } + // 如果不是第一个控件,并且是新行,或者是扩展字段,则输出结束符 + else if(isNewLine){ +%> +
+<% + } + // 如果是扩展字段,则输出子标题,并且强制换行 + if (c.columnName == 'extend_s1'){ +%> +
\${text('扩展字段')}
+<% + } + // 如果是新行,则换行 + if(isNewLine){ + rowFlag = 0; // 输出行标记清零 +%> +
+<% + } + // 开始输出控件 +%> +
+
+ +
+ <% + var attrs = ''; + if (c.dataLength != '0'){ + var s = { %> maxlength="${c.dataLength}"<% }; + attrs = attrs + s; + } + if (c.isPk == '1'){ + var s = { %> readonly="\${!${className}.isNewRecord}"<% }; + attrs = attrs + s; + } + var cssClass = ''; + if (c.isRequired == '1'){ + cssClass = cssClass + ' required'; + } + var fieldValid = c.optionMap['fieldValid']; + if (isNotEmpty(fieldValid)){ + if (type.name(fieldValid) == 'String[]'){ + for (var fv in fieldValid){ + cssClass = cssClass + ' ' + fv; + } + }else if(isNotBlank(fieldValid)){ + cssClass = cssClass + ' ' + fieldValid; + } + } + if (c.showType == 'input'){ + // 如果为自定义主键,则第一个pk字段需输出isNewRecord + if (c.isPk == '1' && table.pkList[0].columnName == c.columnName){ + %> + <${'#'}form:hidden path="isNewRecord"/> + <% + } + %> + <${'#'}form:input path="${c.attrName}"${attrs} class="form-control${cssClass}"/> + <% + } else if (c.showType == 'textarea') { + %> + <${'#'}form:textarea path="${c.attrName}" rows="4"${attrs} class="form-control${cssClass}"/> + <% + } else if (c.showType == 'select' || c.showType == 'select_multiple') { + var isMultiple = (c.showType == 'select_multiple'); + %> + <${'#'}form:select path="${c.attrName}" dictType="${c.optionMap['dictType']}"${isMultiple?' multiple="true"':''}${c.isRequired != '1'?' blankOption="true"':''} class="form-control${cssClass}" /> + <% + } else if (c.showType == 'radio') { + %> + <${'#'}form:radio path="${c.attrName}" dictType="${c.optionMap['dictType']}" class="form-control${cssClass}" /> + <% + } else if (c.showType == 'checkbox') { + %> + <${'#'}form:checkbox path="${c.attrName}" dictType="${c.optionMap['dictType']}" class="form-control${cssClass}" /> + <% + } else if (c.showType == 'date' || c.showType == 'datetime') { + var isTime = (c.showType == 'datetime'); + %> + <${'#'}form:input path="${c.attrName}" readonly="true" maxlength="20" class="form-control Wdate${cssClass}" + dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:false});"/> + <% + } else if (c.showType == 'userselect') { + %> + <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('用户选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/office/treeData?isLoadUser=true" + class="${cssClass}" allowClear="true"/> + <% + } else if (c.showType == 'officeselect') { + %> + <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('机构选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/office/treeData" + class="${cssClass}" allowClear="true"/> + <% + } else if (c.showType == 'areaselect') { + %> + <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/area/treeData" + class="${cssClass}" allowClear="true"/> + <% + } + %> +
+
+
+<% + // 如果是第一个控件输出 + if (rowFlag == -1){ + rowFlag = 1; + } + // 行标记+1,代表完成输出1列 + else{ + rowFlag = rowFlag + 1; + } + } + // 输出控件 End + } + } + // 如果没有输出row结束符,则输出 + if (rowFlag > 0){ +%> +
+<% + } + // 输出上传图片控件 + if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload'])){ +%> +
+
+
+ +
+ <${'#'}form:fileupload id="uploadImage" bizKey="\${${className}.id}" bizType="${className}_image" + uploadType="image" class="" readonly="false"/> +
+
+
+
+<% + } + // 输出上传附件控件 + if(@ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){ +%> +
+
+
+ +
+ <${'#'}form:fileupload id="uploadFile" bizKey="\${${className}.id}" bizType="${className}_file" + uploadType="all" class="" readonly="false"/> +
+
+
+
+<% + } +%> \ No newline at end of file diff --git a/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html b/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html new file mode 100644 index 00000000..c12e8ded --- /dev/null +++ b/modules/core/src/main/resources/templates/modules/gen/include/searchForm.html @@ -0,0 +1,72 @@ +<% /* 查询表单 begin // 此行是为了去除空行 */ %> + <${'#'}form:form id="searchForm" model="\${${className}}" action="\${ctx}/${urlPrefix}/listData" method="post" class="form-inline hide" + data-page-no="\${parameter.pageNo}" data-page-size="\${parameter.pageSize}" data-order-by="\${parameter.orderBy}"> + <% for(c in table.columnList){ %> + <% if(c.isQuery == "1" && !c.isTreeEntityColumn){ %> +
+ + <% if(c.showType == 'input' || c.showType == 'textarea'){ %> +
+ <% if (c.queryType == 'BETWEEN'){ %> + <${'#'}form:input path="${c.attrName}_gte"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''} class="form-control width-60"/> +  --  + <${'#'}form:input path="${c.attrName}_lte"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''} class="form-control width-60"/> + <% } else { %> + <${'#'}form:input path="${c.attrName}"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''} class="form-control width-120"/> + <% } %> +
+ <% }else if(c.showType == 'select' || c.showType == 'select_multiple'){ + var isMultiple = (c.showType == 'select_multiple'); %> +
+ <${'#'}form:select path="${c.attrName}" dictType="${c.optionMap['dictType']}"${isMultiple?' multiple="true"':''} blankOption="true" class="form-control"/> +
+ <% }else if(c.showType == 'radio'){ %> +
+ <${'#'}form:radio path="${c.attrName}" dictType="${c.optionMap['dictType']}" blankOption="true" class="form-control"/> +
+ <% }else if(c.showType == 'checkbox'){ %> +
+ <${'#'}form:checkbox path="${c.attrName}" dictType="${c.optionMap['dictType']}" blankOption="true" class="form-control"/> +
+ <% }else if(c.showType == 'date' || c.showType == 'datetime'){ + var isTime = (c.showType == 'datetime'); %> +
+ <% if (c.queryType == 'BETWEEN'){ %> + <${'#'}form:input path="${c.attrName}_gte" readonly="true" maxlength="20" class="form-control Wdate-date${isTime?'time':''}" + dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:false,onpicked:function(){${c.attrName}_lte.click()}});"/> +  --  + <${'#'}form:input path="${c.attrName}_lte" readonly="true" maxlength="20" class="form-control Wdate-date${isTime?'time':''}" + dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:false});"/> + <% } else { %> + <${'#'}form:input path="${c.attrName}" readonly="true" maxlength="20" class="form-control Wdate-date${isTime?'time':''}" + dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:false});"/> + <% } %> +
+ <% }else if(c.showType == 'userselect'){ %> +
+ <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('用户选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/> +
+ <% }else if(c.showType == 'officeselect'){ %> +
+ <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('机构选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/office/treeData" allowClear="true"/> +
+ <% }else if(c.showType == 'areaselect'){ %> +
+ <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}" + path="${c.attrName}" labelPath="${c.attrName2}" + url="\${ctx}/sys/area/treeData" allowClear="true"/> +
+ <% } %> +
+ <% } %> + <% } %> +
+ + +
+ +<% /* 查询表单 end // 此行是为了去除空行 */ %> \ No newline at end of file diff --git a/modules/core/src/main/resources/views/themes/default/modules/sys/sysIndex/topMenuMsg.html b/modules/core/src/main/resources/views/themes/default/modules/sys/sysIndex/topMenuMsg.html index 94ddf14b..1823b4c0 100644 --- a/modules/core/src/main/resources/views/themes/default/modules/sys/sysIndex/topMenuMsg.html +++ b/modules/core/src/main/resources/views/themes/default/modules/sys/sysIndex/topMenuMsg.html @@ -1,3 +1,4 @@ +<% if(@Global.getPropertyToBoolean('msg.enabled', 'true')){ %> \ No newline at end of file + +<% } %> \ No newline at end of file diff --git a/modules/core/src/test/java/com/jeesite/test/MsgPushTest.java b/modules/core/src/test/java/com/jeesite/test/MsgPushTest.java index 8300cf14..3174451b 100644 --- a/modules/core/src/test/java/com/jeesite/test/MsgPushTest.java +++ b/modules/core/src/test/java/com/jeesite/test/MsgPushTest.java @@ -4,6 +4,7 @@ package com.jeesite.test; import java.util.Date; +import java.util.List; import org.apache.commons.lang3.StringUtils; import org.junit.Test; @@ -15,14 +16,17 @@ import org.springframework.test.context.ActiveProfiles; import com.jeesite.common.config.Global; import com.jeesite.common.lang.DateUtils; import com.jeesite.common.tests.BaseSpringContextTests; +import com.jeesite.modules.msg.entity.MsgTemplate; import com.jeesite.modules.msg.entity.content.AppMsgContent; import com.jeesite.modules.msg.entity.content.EmailMsgContent; import com.jeesite.modules.msg.entity.content.PcMsgContent; import com.jeesite.modules.msg.entity.content.SmsMsgContent; +import com.jeesite.modules.msg.service.MsgTemplateService; import com.jeesite.modules.msg.task.impl.MsgLocalMergePushTask; import com.jeesite.modules.msg.task.impl.MsgLocalPushTask; import com.jeesite.modules.msg.utils.MsgPushUtils; import com.jeesite.modules.sys.entity.User; +import com.jeesite.modules.sys.service.UserService; import com.jeesite.modules.sys.utils.UserUtils; /** @@ -35,11 +39,16 @@ import com.jeesite.modules.sys.utils.UserUtils; @Rollback(false) public class MsgPushTest extends BaseSpringContextTests { + @Autowired + private UserService userService; + @Test public void testSend(){ User user = UserUtils.get("system"); if (StringUtils.isAnyBlank(user.getMobile(), user.getEmail())){ - throw new RuntimeException("请设置system用户的手机号码和邮箱地址"); + user.setMobile("18555555555"); + user.setEmail("test@163.com"); + userService.updateUserInfo(user); } for (int i=0; i<1; i++){ testPC(); @@ -102,10 +111,22 @@ public class MsgPushTest extends BaseSpringContextTests { // 延迟推送消息 MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", new Date(), Global.YES); } + + @Autowired + private MsgTemplateService msgTemplateService; public void testMailTpl(){ + MsgTemplate msgTemplate = new MsgTemplate(); + msgTemplate.setTplKey("mail_send_test"); + List tplList = msgTemplateService.findList(msgTemplate); + if (tplList.size() == 0){ + msgTemplate.setTplName("邮件提示信息"); + msgTemplate.setTplContent("你好,${keyword1},请于 ${keyword2},准时参加${keyword3}"); + msgTemplate.setTplType("email"); + msgTemplateService.save(msgTemplate); + } EmailMsgContent msgContent = new EmailMsgContent(); - msgContent.setTitle("提示信息"); + msgContent.setTitle("邮件提示信息"); msgContent.setTplKey("mail_send_test"); msgContent.addTplData("keyword1", "小王"); msgContent.addTplData("keyword2", "2018-8-28 20:00"); diff --git a/modules/core/src/test/resource/config/jeesite.yml b/modules/core/src/test/resource/config/application.yml similarity index 100% rename from modules/core/src/test/resource/config/jeesite.yml rename to modules/core/src/test/resource/config/application.yml diff --git a/modules/core/src/test/resource/config/j2cache.properties b/modules/core/src/test/resource/config/j2cache.properties new file mode 100644 index 00000000..decc9d2c --- /dev/null +++ b/modules/core/src/test/resource/config/j2cache.properties @@ -0,0 +1,8 @@ +#J2Cache configuration + +j2cache.broadcast = none + +j2cache.L1.provider_class = caffeine +j2cache.L2.provider_class = none + +caffeine.region.default = 10000, 1h \ No newline at end of file diff --git a/modules/template/.settings/org.eclipse.jdt.core.prefs b/modules/template/.settings/org.eclipse.jdt.core.prefs index ec4300d5..714351ae 100644 --- a/modules/template/.settings/org.eclipse.jdt.core.prefs +++ b/modules/template/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/modules/template/pom.xml b/modules/template/pom.xml index 7034223b..ab8d0f00 100644 --- a/modules/template/pom.xml +++ b/modules/template/pom.xml @@ -6,7 +6,7 @@ com.jeesite jeesite-parent - 4.0.7-SNAPSHOT + 4.1.0-SNAPSHOT ../../parent/pom.xml diff --git a/parent/pom.xml b/parent/pom.xml index b13444c6..fd27f6d6 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -6,12 +6,12 @@ org.springframework.boot spring-boot-starter-parent - 1.5.10.RELEASE + 2.0.5.RELEASE com.jeesite jeesite-parent - 4.0.7-SNAPSHOT + 4.1.0-SNAPSHOT pom JeeSite Parent @@ -21,26 +21,37 @@ - 3.4 - 2.5 - 1.3.1 - 2.56 - 20170516 - 5.5.1 + 2.6 + 1.3.3 + 1.9.3 + 1.3 + 1.9.7 + 2.57 + 20180130 + 1.11.3 + 1.5 + 1.1.1 + 1.21 + 2.11.0 + 0.4.8 + 1.1.0 + 0.1.5 + 3.3.2 3.14 + 2.5.1 - 3.4.5 - 1.3.1 + 3.4.6 + 1.3.2 1.1 1.1.10 1.4.0 + 2.7.0-release 2.7-SNAPSHOT - 2.0.4 - 2.2.3 + 1.5.20 - 1.7 + 1.8 true false false @@ -153,8 +164,10 @@ org.apache.maven.plugins maven-war-plugin - - + + WEB-INF/classes/*.lic, + userfiles/** + ${project.build.directory}/${project.artifactId} ${project.artifactId} diff --git a/root/pom.xml b/root/pom.xml index 81a36f5d..fef9ea10 100644 --- a/root/pom.xml +++ b/root/pom.xml @@ -5,7 +5,7 @@ com.jeesite jeesite-root - 4.0.7-SNAPSHOT + 4.1.0-SNAPSHOT pom JeeSite diff --git a/web/.settings/org.eclipse.wst.common.component b/web/.settings/org.eclipse.wst.common.component index b6f69725..55868798 100644 --- a/web/.settings/org.eclipse.wst.common.component +++ b/web/.settings/org.eclipse.wst.common.component @@ -1,17 +1,20 @@ - + uses - + uses - + + uses + + uses - + diff --git a/web/.settings/org.eclipse.wst.common.project.facet.core.xml b/web/.settings/org.eclipse.wst.common.project.facet.core.xml index 9bd9e6f7..021b0e1f 100644 --- a/web/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/web/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -3,5 +3,5 @@ - + diff --git a/web/bin/run-web.bat b/web/bin/run-web.bat index 87fff68b..dbea3e52 100644 --- a/web/bin/run-web.bat +++ b/web/bin/run-web.bat @@ -37,7 +37,7 @@ set RUN_JAVA=java goto runJava :gotJavaHome -set RUN_JAVA="%JAVA_HOME%\bin\java" +set "RUN_JAVA=%JAVA_HOME%\bin\java" goto runJava :runJava diff --git a/web/pom.xml b/web/pom.xml index 89d11cfa..009aeef5 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -6,7 +6,7 @@ com.jeesite jeesite-parent - 4.0.7-SNAPSHOT + 4.1.0-SNAPSHOT ../parent/pom.xml @@ -20,10 +20,9 @@ web - com.jeesite.modules.config.Application + com.jeesite.modules.Application - 1.8 false false @@ -45,6 +44,13 @@ ${project.parent.version}
+ + + com.jeesite + jeesite-module-swagger + ${project.parent.version} + + - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web/src/main/resources/cache/ehcache-rmi.xml b/web/src/main/resources/cache/ehcache-rmi.xml deleted file mode 100644 index d080abf2..00000000 --- a/web/src/main/resources/cache/ehcache-rmi.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web/src/main/resources/config/application.yml b/web/src/main/resources/config/application.yml index c237e97a..a9470e85 100644 --- a/web/src/main/resources/config/application.yml +++ b/web/src/main/resources/config/application.yml @@ -1,15 +1,539 @@ + +#======================================# +#========== Project settings ==========# +#======================================# + +# 产品或项目名称、软件开发公司名称 +productName: JeeSite Demo +companyName: ThinkGem + +# 产品版本、版权年份 +productVersion: V4.0 +copyrightYear: 2018 + +#是否演示模式 +demoMode: false + +#======================================# +#========== Server settings ===========# +#======================================# + server: port: 8980 - context-path: /js + servlet: + context-path: /js tomcat: uri-encoding: UTF-8 + +#======================================# +#========== Database sttings ==========# +#======================================# + +# 数据库连接 +jdbc: + + # Mysql 数据库配置 + type: mysql + driver: com.mysql.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/jeesite?useSSL=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull + username: root + password: 123456 + testSql: SELECT 1 + +# # Oracle 数据库配置 +# type: oracle +# driver: oracle.jdbc.driver.OracleDriver +# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl +# username: jeesite +# password: jeesite +# testSql: SELECT 1 FROM DUAL + +# # Sql Server 数据库配置 +# type: mssql +# driver: net.sourceforge.jtds.jdbc.Driver +# url: jdbc:jtds:sqlserver://127.0.0.1:1433/jeesite +# username: jeesite +# password: jeesite +# testSql: SELECT 1 + +# # PostgreSql 数据库配置(注意:一定要创建的schema与username相同,否则将找不到数据表字典信息) +# type: postgresql +# driver: org.postgresql.Driver +# url: jdbc:postgresql://127.0.0.1:5432/jeesite +# username: jeesite +# password: jeesite +# testSql: SELECT 1 + +# # 连接信息加密 +# encrypt: +# +# # 加密连接用户名 +# username: false +# # 加密连接密码 +# password: true +# +# # 数据库连接池配置 +# pool: +# +# # 初始化连接数 +# init: 1 +# # 最小连接数 +# minIdle: 3 +# # 最大连接数 +# maxActive: 20 # 数据库连接池配置 +# +# # 获取连接等待超时时间,单位毫秒(4.0.6+) +# maxWait: 60000 +# +# # 从池中取出连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个。(4.0.6+) +# testOnBorrow: false +# testOnReturn: false +# +# # 间隔多久才进行一次检测,检测需要关闭的空闲连接,单位毫秒(4.0.6+) +# timeBetweenEvictionRunsMillis: 60000 +# +# # 一个连接在池中最小生存的时间,单位毫秒(4.0.6+) +# minEvictableIdleTimeMillis: 300000 +# +# # 配置是否自动回收超时连接,超时时间,单位秒 (4.0.6+) +# removeAbandoned: true +# removeAbandonedTimeout: 1800 + +# # 多数据源名称列表,启用方式:@MyBatisDao(dataSourceName="ds2") +# dataSourceNames: ds2 +# +# # 多数据源配置:ds2 +# ds2: +# type: oracle +# driver: oracle.jdbc.driver.OracleDriver +# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl +# username: jeesite +# password: jeesite +# testSql: SELECT 1 FROM DUAL +# encrypt: +# username: false +# password: true +# pool: +# init: 1 +# minIdle: 3 +# maxActive: 20 + +# # JTA 分布式事务(v4.0.4+) +# jta: +# enabled: false + +# # 表名前缀 +# tablePrefix: js_ + +# # Druid连接池监控 +# druid: +# stat: +# enabled: true + +#======================================# +#========== Spring settings ===========# +#======================================# spring: + + # 应用程序名称 + application: + name: jeesite-web profiles: - # 当前激活环境名称,(注意:不可设置为 test 它是单元测试用的环境名称) + # 当前环境名称(注意:不可设置为 test 它是单元测试专用的名称) active: default - main: - banner-mode: "off" +# # Redis 连接参数 (RedisProperties) +# redis: +# host: 127.0.0.1 +# port: 6379 +# ssl: false +# database: 0 +# password: 1234 +# timeout: 2000 +# lettuce: +# pool: +# # 最大空闲连接数 +# maxIdle: 3 +# # 最大活动连接数 +# maxActive: 20 +# +# # 缓存配置 +# cache: +# # 缓存及会话共享(专业版) +# isClusterMode: false +# # 清理全部缓存按钮所清理的缓存列表 +# clearNames: sysCache,corpCache,userCache,cmsCache + +#======================================# +#========== System settings ===========# +#======================================# + +# 管理基础路径 +#adminPath: /a +# +# 前端基础路径 +#frontPath: /f +# +# 分页配置 +#page: +# +# # 分页默认大小 +# pageSize: 20 + +# 用户相关参数 +#user: +# +# # 指定超级管理员编号(研发团队使用的账号) +# superAdminCode: system +# +# # 超级管理员获取菜单的最小权重(默认20;>=40二级管理员;>=60系统管理员;>=80超级管理员) +# superAdminGetMenuMinWeight: 40 +# +# # 系统管理员角色编号(客户方管理员使用的角色) +# corpAdminRoleCode: corpAdmin +# +# # 用户类型配置信息(employee员工,member会员,btype往来单位,persion个人,expert专家,...) +# # JSON格式说明:{"用户类型":{"dao":"Dao的Bean名称","loginView":"登录视图","indexView":"主页框架面视图"}} +# userTypeMap: > +# { +# "employee":{"dao":"employeeDao","loginView":"","indexView":""}, +# "member":{"dao":"memberDao","loginView":"","indexView":"modules/sys/sysIndexMember"}, +# "btype":{"dao":"btypeInfoDao","loginView":"","indexView":"modules/sys/sysIndexBtype"}, +# "persion":{"dao":"persionDao","loginView":"","indexView":"modules/sys/sysIndexPersion"}, +# "expert":{"dao":"expertDao","loginView":"","indexView":"modules/sys/sysIndexExpert"} +# } +# +# # 数据权限设置参数,可新增自定义数据权限,moduleCode: 针对模块, ctrlPermi: 权限类型, 0全部 1拥有权限 2管理权限 +# dataScopes: > +# [{ +# moduleCode: "core", +# ctrlPermi: "0", +# ctrlName: "机构权限", +# ctrlName_en: "Office", +# ctrlType: "Office", +# ctrlDataUrl: "/sys/office/treeData", +# chkboxType: {"Y":"ps","N":"ps"}, +# expandLevel: -1, +# remarks: "" +# },{ +# moduleCode: "core", +# ctrlName: "公司权限", +# ctrlName_en: "Company", +# ctrlType: "Company", +# ctrlPermi: "0", +# ctrlDataUrl: "/sys/company/treeData", +# chkboxType: {"Y":"ps","N":"ps"}, +# expandLevel: -1, +# remarks: "" +# },{ +# moduleCode: "core", +# ctrlName: "角色权限", +# ctrlName_en: "Role", +# ctrlType: "Role", +# ctrlPermi: "2", +# ctrlDataUrl: "/sys/role/treeData", +# chkboxType: {"Y":"ps","N":"ps"}, +# expandLevel: -1, +# remarks: "" +# }] +# +# # 多租户模式(SAAS模式)(专业版) +# useCorpModel: false + +# 菜单管理 +#menu: +# # 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false) +# updateStatusByModuleStatus: true + +# 国际化管理(专业版+) +#lang: +# enabled: true + +# 任务调度(个人版+) +#job: +# enabled: true +# +# # 是否自动启动任务调度(可关闭) +# autoStartup: true +# +# # 任务调度启动延迟设置(单位:秒)(建议设置项目启动完成后的时间) +# startupDelay: 60 +# +# # 任务调度线程池 +# threadPool: +# threadCount: 10 +# threadPriority: 5 +# +# # 调度设置,集群中每一个实例都必须使用相同的instanceName名称 (区分特定的调度器实例) +# # 每一个instanceId必须不同,设置AUTO则自动生成 +# scheduler: +# instanceName: JeeSiteScheduler +# instanceId: AUTO +# +# # 任务调度集群设置 +# jobStore: +# isClustered: true +# dataSourceName: job +# clusterCheckinInterval: 1000 +# +# # 调度日志 +# log: +# # 计划调度日志 +# scheduler: +# enabled: true +# # 是否只保存错误日志 +# errorLevel: true +# # 任务执行日志 +# jobDetail: +# enabled: true +# # 是否只保存错误日志 +# errorLevel: true +# # 计划触发日志 +# trigger: +# enabled: false + +#======================================# +#========= Framework settings =========# +#======================================# + +# Shiro 相关配置 +#shiro: +# +# #索引页路径 +# defaultPath: ${shiro.loginUrl} +# +# # 登录相关设置 +# loginUrl: ${adminPath}/login +# logoutUrl: ${shiro.loginUrl} +# successUrl: ${adminPath}/index +# +## # Jasig CAS 相关配置 +## casServerUrl: http://127.0.0.1:8981/cas +## casClientUrl: http://127.0.0.1:8980/js +## loginUrl: ${shiro.casServerUrl}?service=${shiro.casClientUrl}${adminPath}/login-cas +## logoutUrl: ${shiro.casServerUrl}/logout?service=${shiro.loginUrl} +## successUrl: ${shiro.casClientUrl}${adminPath}/index +# +# # 简单 SSO 登录相关配置 +# sso: +# +# # 如果启用/sso/{username}/{token}单点登录,请修改此安全key并与单点登录系统key一致。 +# secretKey: ~ +# +# # 是否加密单点登录安全Key +# encryptKey: true +# +# # 登录提交信息加密(如果不需要加密,设置为空即可) +# loginSubmit: +# +# # 登录提交信息安全Key,加密用户名、密码、验证码,后再提交(key设置为3个,用逗号分隔) +# secretKey: thinkgem,jeesite,com +# +# # 记住我密钥设置(设置为空则使用默认) +# rememberMe: +# # 密钥必须通过 com.jeesite.common.shiro.web.RememberMeManager 的main方法生成 +# secretKey: ~ +# +# # 指定获取客户端IP的Header名称,防止IP伪造。指定为空,则使用原生方法获取IP。 +# remoteAddrHeaderName: X-Forwarded-For +# +# # 允许的请求方法设定,解决安全审计问题 +# allowRequestMethods: GET,POST +# +# # 是否允许账号多地登录,如果设置为false,同一个设备类型的其它地点登录的相同账号被踢下线 +# isAllowMultiAddrLogin: true +# +# # 是否允许刷新主框架页,如果设置为false,刷新主页将导致重新登录。如安全性比较高的,如银行个人首页不允许刷新。 +# isAllowRefreshIndex: true +# +# # 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许) +# isAllowExternalSiteIframe: true +# +# # 是否允许跨域访问,如果允许,设置允许的域名,全部域名设置*号,如果不允许,此设置应该为空 +## accessControlAllowOrigin: http://demo.jeesite.com +## accessControlAllowOrigin: '*' +# +# # 是否在登录后生成新的Session(默认false) +# isGenerateNewSessionAfterLogin: false +# +# # URI 权限过滤器定义 +# filterChainDefinitions: | +# /ReportServer/** = user +# ${adminPath}/** = user + +# Session 相关 +#session: +# +# # 全局会话超时,单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms, 12h=43200000ms, 1day=86400000ms +# sessionTimeout: 1800000 +# +# # 手机APP设备会话超时参数设置,登录请求参数加 param_deviceType=mobileApp 时有效 +# mobileAppSessionTimeout: 43200000 +# +# # 定时清理失效会话,清理用户直接关闭浏览器造成的孤立会话 +# sessionTimeoutClean: 1200000 +# +# # 会话唯一标识SessionId在Cookie中的名称。 +# sessionIdCookieName: jeesite.session.id +# +# # 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。 +# #shareSessionIdCookieName: ${session.sessionIdCookieName} + +# MyBatis 相关 +#mybatis: +# +# # @MyBatisDao、Aliases 扫描基础包,如果多个,用“,”分隔 +# scanBasePackage: com.jeesite.modules +# +# # TypeHandlers 扫描基础包,如果多个,用“,”分隔 +# scanTypeHandlersPackage: ~ +# +# # Mapper文件刷新线程 +# mapper: +# refresh: +# enabled: true +# delaySeconds: 60 +# sleepSeconds: 3 +# mappingPath: mappings + +# Web 相关 +#web: +# +# # MVC 视图相关 +# view: +# +# # 系统主题名称,主题视图优先级最高,如果主题下无这个视图文件则访问默认视图 +# # 引入页面头部:'/themes/'+themeName+'/include/header.html' +# # 引入页面尾部:'/themes/'+themeName+'/include/footer.html' +# themeName: default +# +# # MVC 拦截器 +# interceptor: +# +# # 后台管理日志记录拦截器 +# log: +# enabled: true +# addPathPatterns: > +# ${adminPath}/** +# excludePathPatterns: > +# ${adminPath}/index, +# ${adminPath}/login, +# ${adminPath}/desktop, +# ${adminPath}/sys/online/count, +# ${adminPath}/state/server/rtInfo, +# ${adminPath}/**/treeData, +# ${adminPath}/file/**, +# ${adminPath}/tags/*, +# ${adminPath}/msg/** +# +# # 前台自动切换到手机视图拦截器 +# mobile: +# enabled: false +# addPathPatterns: > +# ${frontPath}/** +# excludePathPatterns: ~ +# +# # 静态文件后缀,过滤静态文件,以提高访问性能。 +# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2 +# +# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。 +# staticFileExcludeUri: /druid/ +# +# # 自定义正则表达式验证(主键、登录名) +# validator: +# id: '[a-zA-Z0-9_\-/#\u4e00-\u9fa5]{0,64}' +# user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}' +# +# # 关闭核心模块的Web功能(仅作为微服务时设为false) +# core: +# enabled: true + +# 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false) +#error: +# page: +# printErrorInfo: true + +#======================================# +#======== FileUpload settings =========# +#======================================# + +#file: +# enabled: true +# +# # 文件上传根路径,设置路径中不允许包含“userfiles”,在指定目录中系统会自动创建userfiles目录,如果不设置默认为contextPath路径 +## baseDir: D:/jeesite +# +# # 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E) +# uploadPath: '{yyyy}{MM}/' +# +# # 上传单个文件最大字节(500M),在这之上还有 > Tomcat限制 > Nginx限制,等。 +# maxFileSize: 500*1024*1024 +# +# #设置允许上传的文件后缀 +# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff, +# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv, +# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk, +# +# #允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证) +## allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png, +## application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, +## application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, +## application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation + +#======================================# +#========== Message settings ==========# +#======================================# + +# 消息提醒中心(专业版) +#msg: +# enabled: true +# +# # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。 +# realtime: +# # 是否开启 +# enabled: true +# # 消息实时推送任务Bean名称 +# beanName: msgLocalPushTask + +# # 推送失败次数,如果推送次数超过了设定次数,仍不成功,则放弃并保存到历史 +# pushFailNumber: 3 + +# # 邮件发送参数 +# email: +# beanName: emailSendService +# fromAddress: test@163.com +# fromPassword: 123456 +# fromHostName: smtp.163.com +# sslOnConnect: false +# sslSmtpPort: 994 +# +# # 短信网关 +# sms: +# beanName: smsSendService +# url: http://localhost:80/msg/sms/send +# data: username=jeesite&password=jeesite.com +# prefix: 【JeeSite】 +# suffix: ~ + +#======================================# +#========== Video settings ============# +#======================================# + +#video: +# +# # 视频格式转换 ffmpeg.exe 所放的路径 +# ffmpegFile: d:/tools/video/ffmpeg-4.9/bin/ffmpeg.exe +## ffmpegFile: d:/tools/video/libav-10.6-win64/bin/avconv.exe +# +# # 视频格式转换 mencoder.exe 所放的路径 +# mencoderFile: d:/tools/video/mencoder-4.9/mencoder.exe +# +# # 将mp4视频的元数据信息转到视频第一帧 +# qtFaststartFile: d:/tools/video/qt-faststart/qt-faststart.exe + +#======================================# +#========== Project settings ==========# +#======================================# diff --git a/web/src/main/resources/config/j2cache.properties b/web/src/main/resources/config/j2cache.properties new file mode 100644 index 00000000..981d5e41 --- /dev/null +++ b/web/src/main/resources/config/j2cache.properties @@ -0,0 +1,92 @@ +#J2Cache configuration + +######################################### +# Cache Broadcast Method +# values: +# redis -> use redis publish/subscribe mechanism (using jedis) +# lettuce -> use redis publish/subscribe mechanism (using lettuce) +# jgroups -> use jgroups's multicast +# rabbitmq -> use RabbitMQ publisher/consumer mechanism +# rocketmq -> use RocketMQ publisher/consumer mechanism +# none -> don't notify the other nodes in cluster +# xx.xxxx.xxxx.Xxxxx your own cache broadcast policy classname that implement net.oschina.j2cache.cluster.ClusterPolicy +######################################### + +#j2cache.broadcast = redis +j2cache.broadcast = com.jeesite.common.j2cache.cache.support.redis.SpringRedisPubSubPolicy + +######################################### +# Cache Clean Mode +# active -> 主动清除,二级缓存过期主动通知各节点清除,优点在于所有节点可以同时收到缓存清除 +# passive -> 被动清除,一级缓存过期进行通知各节点清除一二级缓存 +# blend -> 两种模式一起运作,对于各个节点缓存准确以及及时性要求高的可以使用,正常用前两种模式中一个就可 +######################################### + +j2cache.broadcast.cache_clean_mode = passive + +######################################### +# Level 1&2 provider +# values: +# none -> disable this level cache +# ehcache -> use ehcache2 as level 1 cache +# ehcache3 -> use ehcache3 as level 1 cache +# caffeine -> use caffeine as level 1 cache(only in memory) +# redis -> use redis as level 2 cache (using jedis) +# lettuce -> use redis as level 2 cache (using lettuce) +# readonly-redis -> use redis as level 2 cache ,but never write data to it. if use this provider, you must uncomment `j2cache.L2.config_section` to make the redis configurations available. +# memcached -> use memcached as level 2 cache (xmemcached), +# [classname] -> use custom provider +######################################### + +j2cache.L1.provider_class = caffeine +#j2cache.L2.provider_class = redis +j2cache.L2.provider_class = com.jeesite.common.j2cache.cache.support.redis.SpringRedisProvider + +# When L2 provider isn't `redis`, using `L2.config_section = redis` to read redis configurations +j2cache.L2.config_section = redis + +# Enable/Disable ttl in redis cache data (if disabled, the object in redis will never expire, default:true) +# NOTICE: redis hash mode (redis.storage = hash) do not support this feature) +j2cache.sync_ttl_to_redis = true + +# Whether to cache null objects by default (default false) +j2cache.default_cache_null_object = true + +######################################### +# Cache Serialization Provider +# values: +# fst -> using fast-serialization (recommend) +# kyro -> using kyro serialization +# json -> using fst's json serialization (testing) +# fastjson -> using fastjson serialization (embed non-static class not support) +# java -> java standard +# [classname implements Serializer] +######################################### + +j2cache.serialization = fst + +######################################### +# Caffeine configuration +# caffeine.region.[name] = size, xxxx[s|m|h|d] +######################################### + +#caffeine.properties = /config/caffeine.properties +caffeine.region.default = 10000, 1h +caffeine.region.sessionCache = 100000, 30m + +######################################### +# Redis connection configuration +######################################### + +#redis storage mode (generic|hash) +redis.storage = generic +#redis.storage = hash + +## redis pub/sub channel name +redis.channel = j2cache +## redis pub/sub server (using redis.hosts when empty) +redis.channel.host = + +## redis cache namespace optional, default[j2cache] +redis.namespace = jeesite + diff --git a/web/src/main/resources/config/jeesite.yml b/web/src/main/resources/config/jeesite.yml deleted file mode 100644 index 3ff0d290..00000000 --- a/web/src/main/resources/config/jeesite.yml +++ /dev/null @@ -1,511 +0,0 @@ - -#============================# -#===== Project settings =====# -#============================# - -# 产品或项目名称、软件开发公司名称 -productName: JeeSite Demo -companyName: ThinkGem - -# 产品版本、版权年份 -productVersion: V4.0 -copyrightYear: 2018 - -#是否演示模式 -demoMode: false - -#============================# -#===== Database sttings =====# -#============================# - -# 数据库连接 -jdbc: - - # Mysql 数据库配置 - type: mysql - driver: com.mysql.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/jeesite?useSSL=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull - username: root - password: 123456 - testSql: SELECT 1 - -# # Oracle 数据库配置 -# type: oracle -# driver: oracle.jdbc.driver.OracleDriver -# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl -# username: jeesite -# password: jeesite -# testSql: SELECT 1 FROM DUAL - -# # Sql Server 数据库配置 -# type: mssql -# driver: net.sourceforge.jtds.jdbc.Driver -# url: jdbc:jtds:sqlserver://127.0.0.1:1433/jeesite -# username: jeesite -# password: jeesite -# testSql: SELECT 1 - -# # PostgreSql 数据库配置(注意:一定要创建的schema与username相同,否则将找不到数据表字典信息) -# type: postgresql -# driver: org.postgresql.Driver -# url: jdbc:postgresql://127.0.0.1:5432/jeesite -# username: jeesite -# password: jeesite -# testSql: SELECT 1 - -# # 连接信息加密 -# encrypt: -# -# # 加密连接用户名 -# username: false -# # 加密连接密码 -# password: true -# -# # 数据库连接池配置 -# pool: -# -# # 初始化连接数 -# init: 1 -# # 最小连接数 -# minIdle: 3 -# # 最大连接数 -# maxActive: 20 - -# # 多数据源名称列表,启用方式:@MyBatisDao(dataSourceName="ds2") -# dataSourceNames: ds2 -# -# # 多数据源配置:ds2 -# ds2: -# type: oracle -# driver: oracle.jdbc.driver.OracleDriver -# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl -# username: jeesite -# password: jeesite -# testSql: SELECT 1 FROM DUAL -# encrypt: -# username: false -# password: true -# pool: -# init: 1 -# minIdle: 3 -# maxActive: 20 - -# # JTA 分布式事务(v4.0.4+) -# jta: -# enabled: false - -# # 表名前缀 -# tablePrefix: js_ - -# # Druid连接池监控 -# druid: -# stat: -# enabled: true - -# Redis 配置 -#redis: -# enabled: false -# -# # Redis 连接参数 -# host: 127.0.0.1 -# port: 6379 -# isSSL: false -# timeout: 2000 -# password: 1234 -# database: 0 -# clientName: ~ -# -# # Redis 连接池配置 -# pool: -# maxIdle: 3 -# maxTotal: 20 -# -# # 是否启用Redis系统缓存及会话(专业版) -# cacheAndSession: false -# -# # 定义Key的前缀标识 -# keyPrefix: ${jdbc.tablePrefix} - -#============================# -#===== System settings ======# -#============================# - -# 管理基础路径 -#adminPath: /a -# -# 前端基础路径 -#frontPath: /f -# -# 分页配置 -#page: -# -# # 分页默认大小 -# pageSize: 20 - -# 用户相关参数 -#user: -# -# # 指定超级管理员编号(研发团队使用的账号) -# superAdminCode: system -# -# # 超级管理员获取菜单的最小权重(默认20;>=40二级管理员;>=60系统管理员;>=80超级管理员) -# superAdminGetMenuMinWeight: 40 -# -# # 系统管理员角色编号(客户方管理员使用的角色) -# corpAdminRoleCode: corpAdmin -# -# # 用户类型配置信息(employee员工,member会员,btype往来单位,persion个人,expert专家,...) -# # JSON格式说明:{"用户类型":{"dao":"Dao的Bean名称","loginView":"登录视图","indexView":"主页框架面视图"}} -# userTypeMap: > -# { -# "employee":{"dao":"employeeDao","loginView":"","indexView":""}, -# "member":{"dao":"memberDao","loginView":"","indexView":"modules/sys/sysIndexMember"}, -# "btype":{"dao":"btypeInfoDao","loginView":"","indexView":"modules/sys/sysIndexBtype"}, -# "persion":{"dao":"persionDao","loginView":"","indexView":"modules/sys/sysIndexPersion"}, -# "expert":{"dao":"expertDao","loginView":"","indexView":"modules/sys/sysIndexExpert"} -# } -# -# # 数据权限设置参数,可新增自定义数据权限,moduleCode: 针对模块, ctrlPermi: 权限类型, 0全部 1拥有权限 2管理权限 -# dataScopes: > -# [{ -# moduleCode: "core", -# ctrlPermi: "0", -# ctrlName: "机构权限", -# ctrlName_en: "Office", -# ctrlType: "Office", -# ctrlDataUrl: "/sys/office/treeData", -# chkboxType: {"Y":"ps","N":"ps"}, -# expandLevel: -1, -# remarks: "" -# },{ -# moduleCode: "core", -# ctrlName: "公司权限", -# ctrlName_en: "Company", -# ctrlType: "Company", -# ctrlPermi: "0", -# ctrlDataUrl: "/sys/company/treeData", -# chkboxType: {"Y":"ps","N":"ps"}, -# expandLevel: -1, -# remarks: "" -# },{ -# moduleCode: "core", -# ctrlName: "角色权限", -# ctrlName_en: "Role", -# ctrlType: "Role", -# ctrlPermi: "2", -# ctrlDataUrl: "/sys/role/treeData", -# chkboxType: {"Y":"ps","N":"ps"}, -# expandLevel: -1, -# remarks: "" -# }] -# -# # 多租户模式(SAAS模式)(专业版) -# useCorpModel: false - -# 菜单管理 -#menu: -# # 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false) -# updateStatusByModuleStatus: true - -# 国际化管理(专业版+) -#lang: -# enabled: true - -# 任务调度(个人版+) -#job: -# enabled: true -# -# # 是否自动启动任务调度(可关闭) -# autoStartup: true -# -# # 任务调度启动延迟设置(单位:秒)(建议设置项目启动完成后的时间) -# startupDelay: 60 -# -# # 任务调度线程池 -# threadPool: -# threadCount: 10 -# threadPriority: 5 -# -# # 调度设置,集群中每一个实例都必须使用相同的instanceName名称 (区分特定的调度器实例) -# # 每一个instanceId必须不同,设置AUTO则自动生成 -# scheduler: -# instanceName: JeeSiteScheduler -# instanceId: AUTO -# -# # 任务调度集群设置 -# jobStore: -# isClustered: true -# dataSourceName: job -# clusterCheckinInterval: 1000 -# -# # 调度日志 -# log: -# # 计划调度日志 -# scheduler: -# enabled: true -# # 是否只保存错误日志 -# errorLevel: true -# # 任务执行日志 -# jobDetail: -# enabled: true -# # 是否只保存错误日志 -# errorLevel: true -# # 计划触发日志 -# trigger: -# enabled: false - -#============================# -#==== Framework settings ====# -#============================# - -# Shiro 相关配置 -#shiro: -# -# #索引页路径 -# defaultPath: ${shiro.loginUrl} -# -# # 登录相关设置 -# loginUrl: ${adminPath}/login -# logoutUrl: ${shiro.loginUrl} -# successUrl: ${adminPath}/index -# -## # Jasig CAS 相关配置 -## casServerUrl: http://127.0.0.1:8981/cas -## casClientUrl: http://127.0.0.1:8980/js -## loginUrl: ${shiro.casServerUrl}?service=${shiro.casClientUrl}${adminPath}/login-cas -## logoutUrl: ${shiro.casServerUrl}/logout?service=${shiro.loginUrl} -## successUrl: ${shiro.casClientUrl}${adminPath}/index -# -# # 简单 SSO 登录相关配置 -# sso: -# -# # 如果启用/sso/{username}/{token}单点登录,请修改此安全key并与单点登录系统key一致。 -# secretKey: ~ -# -# # 是否加密单点登录安全Key -# encryptKey: true -# -# # 登录提交信息加密(如果不需要加密,设置为空即可) -# loginSubmit: -# -# # 登录提交信息安全Key,加密用户名、密码、验证码,后再提交(key设置为3个,用逗号分隔) -# secretKey: thinkgem,jeesite,com -# -# # 记住我密钥设置(设置为空则使用默认) -# rememberMe: -# # 密钥必须通过 com.jeesite.common.shiro.web.RememberMeManager 的main方法生成 -# secretKey: ~ -# -# # 指定获取客户端IP的Header名称,防止IP伪造。指定为空,则使用原生方法获取IP。 -# remoteAddrHeaderName: X-Forwarded-For -# -# # 允许的请求方法设定,解决安全审计问题 -# allowRequestMethods: GET,POST -# -# # 是否允许账号多地登录,如果设置为false,同一个设备类型的其它地点登录的相同账号被踢下线 -# isAllowMultiAddrLogin: true -# -# # 是否允许刷新主框架页,如果设置为false,刷新主页将导致重新登录。如安全性比较高的,如银行个人首页不允许刷新。 -# isAllowRefreshIndex: true -# -# # 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许) -# isAllowExternalSiteIframe: true -# -# # 是否允许跨域访问,如果允许,设置允许的域名,全部域名设置*号,如果不允许,此设置应该为空 -## accessControlAllowOrigin: http://demo.jeesite.com -## accessControlAllowOrigin: '*' -# -# # 是否在登录后生成新的Session(默认false) -# isGenerateNewSessionAfterLogin: false -# -# # URI 权限过滤器定义 -# filterChainDefinitions: | -# /ReportServer/** = user -# ${adminPath}/** = user -# -# Session 相关 -#session: -# -# #全局会话超时,单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms, 12h=43200000ms, 1day=86400000ms -# sessionTimeout: 1800000 -# -# #手机APP设备会话超时参数设置,登录请求参数加 param_deviceType=mobileApp 时有效 -# mobileAppSessionTimeout: 43200000 -# -# #定时清理失效会话,清理用户直接关闭浏览器造成的孤立会话 -# sessionTimeoutClean: 1200000 -# -# #会话唯一标识SessionId在Cookie中的名称。 -# sessionIdCookieName: jeesite.session.id -# -# #共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。 -# #shareSessionIdCookieName: ${session.sessionIdCookieName} -# -# MyBatis 相关 -#mybatis: -# -# # @MyBatisDao、Aliases 扫描基础包,如果多个,用“,”分隔 -# scanBasePackage: com.jeesite.modules -# -# # TypeHandlers 扫描基础包,如果多个,用“,”分隔 -# scanTypeHandlersPackage: ~ -# -# # Mapper文件刷新线程 -# mapper: -# refresh: -# enabled: true -# delaySeconds: 60 -# sleepSeconds: 3 -# mappingPath: mappings -# -# 缓存设置 -#ehcache: -# -# # 缓存配置文件路径 -# configFile: cache/ehcache-local.xml -## configFile: cache/ehcache-rmi.xml -# -# # 清理缓存的缓存名称 -# clearNames: sysCache,userCache,corpCache,cmsCache,pageCachingFilter -# -# # 页面缓存配置 -# pageCaching: -# enabled: false -# urlPatterns: "*.html" -# -# Web 相关 -#web: -# -# # MVC 视图相关 -# view: -# -# # 系统主题名称,主题视图优先级最高,如果主题下无这个视图文件则访问默认视图 -# # 引入页面头部:'/themes/'+themeName+'/include/header.html' -# # 引入页面尾部:'/themes/'+themeName+'/include/footer.html' -# themeName: default -# -# # MVC 拦截器 -# interceptor: -# -# # 后台管理日志记录拦截器 -# log: -# enabled: true -# addPathPatterns: > -# ${adminPath}/** -# excludePathPatterns: > -# ${adminPath}/index, -# ${adminPath}/login, -# ${adminPath}/desktop, -# ${adminPath}/sys/online/count, -# ${adminPath}/state/server/rtInfo, -# ${adminPath}/**/treeData, -# ${adminPath}/file/**, -# ${adminPath}/tags/*, -# ${adminPath}/msg/** -# -# # 前台自动切换到手机视图拦截器 -# mobile: -# enabled: false -# addPathPatterns: > -# ${frontPath}/** -# excludePathPatterns: ~ -# -# # 静态文件后缀,过滤静态文件,以提高访问性能。 -# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2 -# -# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。 -# staticFileExcludeUri: /druid/ -# -# # 自定义正则表达式验证(主键、登录名) -# validator: -# id: '[a-zA-Z0-9_\-/\u4e00-\u9fa5]{0,64}' -# user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}' -# -# # 关闭核心模块的Web功能(仅作为微服务时设为false) -# core: -# enabled: true - -# -# 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false) -#error: -# page: -# printErrorInfo: true - -#============================# -#=== FileUpload settings ====# -#============================# - -#file: -# enabled: true -# -# # 文件上传根路径,设置路径中不允许包含“userfiles”,在指定目录中系统会自动创建userfiles目录,如果不设置默认为contextPath路径 -## baseDir: D:/jeesite -# -# # 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E) -# uploadPath: '{yyyy}{MM}/' -# -# # 上传单个文件最大字节(500M),在这之上还有 > Tomcat限制 > Nginx限制,等。 -# maxFileSize: 500*1024*1024 -# -# #设置允许上传的文件后缀 -# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff, -# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv, -# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk, -# -# #允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证) -## allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png, -## application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, -## application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, -## application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation - -#============================# -#===== Message settings =====# -#============================# - -# 消息提醒中心(专业版) -#msg: -# -# # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。 -# realtime: -# # 是否开启 -# enabled: true -# # 消息实时推送任务Bean名称 -# beanName: msgLocalPushTask -# -# # 邮件发送参数 -# email: -# beanName: emailSendService -# fromAddress: test@163.com -# fromPassword: 123456 -# fromHostName: smtp.163.com -# sslOnConnect: false -# sslSmtpPort: 994 -# -# # 短信网关 -# sms: -# beanName: smsSendService -# url: http://localhost:80/msg/sendSms -# data: account=demo&pswd=demo&product= -# prefix: ~ -# suffix: 【JeeSite】 - -#============================# -#===== Video settings =======# -#============================# - -#video: -# -# # 视频格式转换 ffmpeg.exe 所放的路径 -# ffmpegFile: d:/tools/video/ffmpeg-4.9/bin/ffmpeg.exe -## ffmpegFile: d:/tools/video/libav-10.6-win64/bin/avconv.exe -# -# # 视频格式转换 mencoder.exe 所放的路径 -# mencoderFile: d:/tools/video/mencoder-4.9/mencoder.exe -# -# # 将mp4视频的元数据信息转到视频第一帧 -# qtFaststartFile: d:/tools/video/qt-faststart/qt-faststart.exe - -#============================# -#===== Project settings =====# -#============================# - diff --git a/web/src/main/resources/logback.xml b/web/src/main/resources/logback.xml index dace0c59..7fa43cae 100644 --- a/web/src/main/resources/logback.xml +++ b/web/src/main/resources/logback.xml @@ -4,9 +4,6 @@ - - - diff --git a/web/src/main/webapp/WEB-INF/startup.bat b/web/src/main/webapp/WEB-INF/startup.bat index 6dd3ce9c..51bd29a0 100644 --- a/web/src/main/webapp/WEB-INF/startup.bat +++ b/web/src/main/webapp/WEB-INF/startup.bat @@ -19,12 +19,12 @@ title %cd% rem ŻJVM set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -rem ʽһû -rem set JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod - -rem ʽⲿļ飩 +rem ʽһⲿԶļ飩 rem set JAVA_OPTS=%JAVA_OPTS% -Dspring.config.location=%cd%\app.yml +rem ʽûƣزͬļ +rem set JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod + if "%JAVA_HOME%" == "" goto noJavaHome if not "%JAVA_HOME%" == "" goto gotJavaHome goto end @@ -34,7 +34,7 @@ set RUN_JAVA=java goto runJava :gotJavaHome -set RUN_JAVA="%JAVA_HOME%\bin\java" +set "RUN_JAVA=%JAVA_HOME%\bin\java" goto runJava :runJava diff --git a/web/src/main/webapp/WEB-INF/startup.sh b/web/src/main/webapp/WEB-INF/startup.sh index 417e5bab..0f2f6ea4 100644 --- a/web/src/main/webapp/WEB-INF/startup.sh +++ b/web/src/main/webapp/WEB-INF/startup.sh @@ -12,12 +12,12 @@ echo "" # 优化JVM参数 JAVA_OPTS="$MAVEN_OPTS -Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m" -# 方式一、配置环境名称 -# JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=prod" - -# 方式二、配置外部属性文件(建议) +# 方式一、配置外部自定义的属性文件(建议) # JAVA_OPTS="$JAVA_OPTS -Dspring.config.location=$PWD\app.yml" +# 方式二、配置环境名称,加载不同的属性文件 +# JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=prod" + if [ -z "$JAVA_HOME" ]; then RUN_JAVA=java else diff --git a/web/src/main/webapp/WEB-INF/web.xml b/web/src/main/webapp/WEB-INF/web.xml index 2bffa502..67e6ef59 100644 --- a/web/src/main/webapp/WEB-INF/web.xml +++ b/web/src/main/webapp/WEB-INF/web.xml @@ -1,8 +1,8 @@ + xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd" + version="3.1"> JeeSite diff --git a/web/src/test/java/com/jeesite/test/InitCoreData.java b/web/src/test/java/com/jeesite/test/InitCoreData.java index d38ef833..de19706c 100644 --- a/web/src/test/java/com/jeesite/test/InitCoreData.java +++ b/web/src/test/java/com/jeesite/test/InitCoreData.java @@ -8,7 +8,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ActiveProfiles; -import com.jeesite.modules.config.Application; +import com.jeesite.modules.Application; /** * 初始化核心表数据 diff --git a/web/src/test/java/com/jeesite/test/Test.java b/web/src/test/java/com/jeesite/test/MainTest.java similarity index 70% rename from web/src/test/java/com/jeesite/test/Test.java rename to web/src/test/java/com/jeesite/test/MainTest.java index 9abcb8b9..c55c6b03 100644 --- a/web/src/test/java/com/jeesite/test/Test.java +++ b/web/src/test/java/com/jeesite/test/MainTest.java @@ -1,6 +1,6 @@ package com.jeesite.test; -public class Test { +public class MainTest { public static void main(String[] args) {