Sfoglia il codice sorgente

合并system分支代码

songyh 4 anni fa
parent
commit
1e5fbca1d0
100 ha cambiato i file con 2015 aggiunte e 1585 eliminazioni
  1. 1 0
      jeecg-boot-base/jeecg-boot-base-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseApi.java
  2. 13 0
      jeecg-boot-base/jeecg-boot-base-core/pom.xml
  3. 3 3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/api/vo/Result.java
  4. 0 51
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/AutoLogAspect.java
  5. 0 9
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/UrlMatchEnum.java
  6. 27 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/annotation/Document.java
  7. 16 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/annotation/EsId.java
  8. 26 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/annotation/FieId.java
  9. 29 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/AnalyzerType.java
  10. 4 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
  11. 40 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/FieldType.java
  12. 15 28
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/ProvinceCityArea.java
  13. 13 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/SystemDateConstant.java
  14. 0 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/WebsocketConst.java
  15. 165 167
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/es/JeecgElasticsearchTemplate.java
  16. 1 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootException.java
  17. 1 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysDataSource.java
  18. 0 9
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/entity/SysUser.java
  19. 1 2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java
  20. 0 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JeecgDataAutorUtils.java
  21. 1 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/DictModel.java
  22. 0 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/SysUserCacheInfo.java
  23. 1 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java
  24. 26 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java
  25. 0 70
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DySmsEnum.java
  26. 16 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/MD5Util.java
  27. 1 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/PasswordUtil.java
  28. 0 5
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java
  29. 4 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/DataSourceCachePool.java
  30. 31 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/db/DbValidationQueryEnum.java
  31. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/DynamicDBUtil.java
  32. 167 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/db/FreemarkerParseFactory.java
  33. 5 5
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DataSourceCachePool.java
  34. 31 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DbValidationQueryEnum.java
  35. 1 3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DynamicDBUtil.java
  36. 14 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/FreemarkerParseFactory.java
  37. 2 3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/SqlUtils.java
  38. 23 24
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java
  39. 28 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/BaseColumn.java
  40. 170 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/CommonProperty.java
  41. 87 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/JsonSchemaDescrip.java
  42. 68 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/JsonschemaUtil.java
  43. 61 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/DictProperty.java
  44. 37 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/HiddenProperty.java
  45. 66 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/LinkDownProperty.java
  46. 152 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/NumberProperty.java
  47. 74 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/PopupProperty.java
  48. 118 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/StringProperty.java
  49. 46 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/SwitchProperty.java
  50. 145 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/TreeSelectProperty.java
  51. 13 15
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oss/OssBootUtil.java
  52. 0 2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java
  53. 152 99
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  54. 2 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/mapper/BaseCommonMapper.java
  55. 3 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/mapper/xml/BaseCommonMapper.xml
  56. 2 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/BaseCommonService.java
  57. 8 0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/BaseCommonServiceImpl.java
  58. 2 0
      jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/constant/CacheConstant.java
  59. 22 0
      jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/modules/redis/config/RedisConfig.java
  60. 0 1
      jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/util/RedisUtil.java
  61. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/MaterialInfoController.java
  62. 22 8
      jeecg-boot-module-system/pom.xml
  63. 1 9
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventSendController.java
  64. 1 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmRuleRecordController.java
  65. 1 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountTemplateController.java
  66. 1 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountThresholdController.java
  67. 2 9
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleBaseController.java
  68. 4 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleConditionController.java
  69. 1 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleGroupController.java
  70. 2 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleIndicatorController.java
  71. 1 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleTemplateController.java
  72. 5 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java
  73. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/check/controller/CtopCheckTaskExecuteLogCtrl.java
  74. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/check/controller/CtopCheckTaskListCtrl.java
  75. 0 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/check/entity/CtopCheckTaskExecuteLog.java
  76. 0 39
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/annotation/AutoLog.java
  77. 0 60
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/annotation/Dict.java
  78. 0 25
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/annotation/PermissionData.java
  79. 0 212
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/SqlUtils.java
  80. 0 92
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/dynamic/DataSourceCachePool.java
  81. 0 299
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/dynamic/DynamicDBUtil.java
  82. 0 213
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/dynamic/SqlUtils.java
  83. 0 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java
  84. 23 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/DataLabels.java
  85. 1 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/Product.java
  86. 0 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysAnnouncement.java
  87. 1 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysDepartRole.java
  88. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysDictItem.java
  89. 0 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysLog.java
  90. 1 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java
  91. 1 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java
  92. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/CtopCorpWexinUserMapper.java
  93. 0 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MaterialCutFrameMapper.java
  94. 0 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MusicTypeMapper.java
  95. 0 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/RuleDateUnitKuaishouMapper.java
  96. 3 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementMapper.java
  97. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementSendMapper.java
  98. 1 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysCategoryMapper.java
  99. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysDataSourceMapper.java
  100. 0 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysDepartMapper.java

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseApi.java

@@ -434,6 +434,7 @@ public interface ISysBaseApi extends CommonAPI {
      * @param dbSourceCode
      * @return
      */
+    @Override
     DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode);
 
     /**

+ 13 - 0
jeecg-boot-base/jeecg-boot-base-core/pom.xml

@@ -75,6 +75,19 @@
 			<artifactId>commons-lang</artifactId>
 			<version>${commons.version}</version>
 		</dependency>
+
+		<!-- ureport -->
+		<dependency>
+			<groupId>com.bstek.ureport</groupId>
+			<artifactId>ureport2-core</artifactId>
+			<version>2.2.9</version>
+		</dependency>
+		<dependency>
+			<groupId>com.bstek.ureport</groupId>
+			<artifactId>ureport2-console</artifactId>
+			<version>2.2.9</version>
+		</dependency>
+
 		<!-- freemarker -->
 		<dependency>
 			<groupId>org.springframework.boot</groupId>

+ 3 - 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/api/vo/Result.java

@@ -50,6 +50,9 @@ public class Result<T> implements Serializable {
 	@ApiModelProperty(value = "时间戳")
 	private long timestamp = System.currentTimeMillis();
 
+	@JsonIgnore
+	private String onlTable;
+
 	public Result() {
 		
 	}
@@ -167,7 +170,4 @@ public class Result<T> implements Serializable {
 		return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg);
 	}
 
-	@JsonIgnore
-	private String onlTable;
-
 }

+ 0 - 51
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/AutoLogAspect.java

@@ -216,55 +216,4 @@ public class AutoLogAspect {
         }
         return content;
     }
-
-
-    /*    private void saveSysLog(ProceedingJoinPoint joinPoint, long time, Object obj) {
-        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
-        Method method = signature.getMethod();
-
-        SysLog sysLog = new SysLog();
-        AutoLog syslog = method.getAnnotation(AutoLog.class);
-        if(syslog != null){
-            //update-begin-author:taoyan date:
-            String content = syslog.value();
-            if(syslog.module()== ModuleType.ONLINE){
-                content = getOnlineLogContent(obj, content);
-            }
-            //注解上的描述,操作日志内容
-            sysLog.setLogContent(content);
-            sysLog.setLogType(syslog.logType());
-        }
-
-        //请求的方法名
-        String className = joinPoint.getTarget().getClass().getName();
-        String methodName = signature.getName();
-        sysLog.setMethod(className + "." + methodName + "()");
-
-
-        //设置操作类型
-        if (sysLog.getLogType() == CommonConstant.LOG_TYPE_2) {
-            sysLog.setOperateType(getOperateType(methodName, syslog.operateType()));
-        }
-
-        //获取request
-        HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
-        //请求的参数
-        sysLog.setRequestParam(getReqestParams(request,joinPoint));
-
-        //设置IP地址
-        sysLog.setIp(IPUtils.getIpAddr(request));
-
-        //获取登录用户信息
-        LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
-        if(sysUser!=null){
-            sysLog.setUserid(sysUser.getUsername());
-            sysLog.setUsername(sysUser.getRealname());
-
-        }
-        //耗时
-        sysLog.setCostTime(time);
-        sysLog.setCreateTime(new Date());
-        //保存系统日志
-        sysLogService.save(sysLog);
-    }*/
 }

+ 0 - 9
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/UrlMatchEnum.java

@@ -46,13 +46,4 @@ public enum UrlMatchEnum {
         }
         return null;
     }
-
-
-//    public static void main(String[] args) {
-//        /**
-//         * 比如request真实请求URL: /online/cgform/api/getData/81fcf7d8922d45069b0d5ba983612d3a
-//         * 转换匹配路由URL后(对应配置的菜单路径):/online/cgformList/81fcf7d8922d45069b0d5ba983612d3a
-//         */
-//        System.out.println(UrlMatchEnum.getMatchResultByUrl("/online/cgform/api/getData/81fcf7d8922d45069b0d5ba983612d3a"));
-//    }
 }

+ 27 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/annotation/Document.java

@@ -0,0 +1,27 @@
+package org.jeecg.common.aspect.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * Es 文档注解,用于做索引实体映射
+ * 作用在类上
+ * @author zzy
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Documented
+@Inherited
+public @interface  Document {
+
+    /**
+     * index : 索引名称
+     * @return
+     */
+    String index();
+
+    /**
+     * 类型名称
+     * @return
+     */
+    String type();
+}

+ 16 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/annotation/EsId.java

@@ -0,0 +1,16 @@
+package org.jeecg.common.aspect.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 用于标识使用 该字段作为ES数据中的id
+ * @author zzy
+ * @create: 2021-07-12
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+@Documented
+@Inherited
+public @interface EsId {
+
+}

+ 26 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/aspect/annotation/FieId.java

@@ -0,0 +1,26 @@
+package org.jeecg.common.aspect.annotation;
+
+import org.jeecg.common.constant.AnalyzerType;
+import org.jeecg.common.constant.FieldType;
+
+import java.lang.annotation.*;
+
+/**
+ * 作用在字段上,用于定义类型,映射关系
+ * @author zzy
+ * @create: 2021-07-12
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+@Documented
+@Inherited
+public @interface FieId {
+    FieldType type() default FieldType.TEXT;
+
+    /**
+     * 指定分词器
+     * @return
+     */
+    AnalyzerType analyzer() default AnalyzerType.STANDARD;
+
+}

+ 29 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/AnalyzerType.java

@@ -0,0 +1,29 @@
+package org.jeecg.common.constant;
+
+import lombok.Getter;
+
+@Getter
+public enum AnalyzerType {
+    NO("不使用分词"),
+    /**
+     * 标准分词,默认分词器
+     */
+    STANDARD("standard"),
+
+    /**
+     * ik_smart:会做最粗粒度的拆分;已被分出的词语将不会再次被其它词语占有
+     */
+    IK_SMART("ik_smart"),
+
+    /**
+     * ik_max_word :会将文本做最细粒度的拆分;尽可能多的拆分出词语
+     */
+    IK_MAX_WORD("ik_max_word");
+
+    private String type;
+
+    AnalyzerType(String type) {
+        this.type = type;
+    }
+
+}

+ 4 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java

@@ -321,5 +321,9 @@ public interface CommonConstant {
     String ANNOUNCEMENT_SEND_STATUS_1 = "1";
     /** 系统通告消息状态:2=已撤销 */
     String ANNOUNCEMENT_SEND_STATUS_2 = "2";
+    /** 登录用户拥有角色缓存KEY前缀 */
+    public static String LOGIN_USER_CACHERULES_ROLE = "loginUser_cacheRules::Roles_";
+    /** 登录用户拥有权限缓存KEY前缀 */
+    public static String LOGIN_USER_CACHERULES_PERMISSION  = "loginUser_cacheRules::Permissions_";
 
 }

+ 40 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/FieldType.java

@@ -0,0 +1,40 @@
+package org.jeecg.common.constant;
+
+import lombok.Getter;
+
+@Getter
+public enum FieldType {
+    /**
+     * text
+     */
+    TEXT("text"),
+
+    KEYWORD("keyword"),
+
+    INTEGER("integer"),
+
+    DOUBLE("double"),
+
+    DATE("date"),
+
+    /**
+     * 单条数据
+     */
+    OBJECT("object"),
+
+    /**
+     * 嵌套数组
+     */
+    NESTED("nested"),
+
+
+    ;
+
+
+    FieldType(String type) {
+        this.type = type;
+    }
+
+    private String type;
+
+}

+ 15 - 28
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/ProvinceCityArea.java

@@ -39,16 +39,6 @@ public class ProvinceCityArea {
         return null;
     }
 
-    public void getAreaByCode(String code,List<String> ls){
-        for(Area area: areaList){
-            if(area.getId().equals(code)){
-                String pid = area.getPid();
-                ls.add(0,area.getText());
-                getAreaByCode(pid,ls);
-            }
-        }
-    }
-
     private void initAreaList(){
         //System.out.println("=====================");
         if(this.areaList==null || this.areaList.size()==0){
@@ -87,24 +77,6 @@ public class ProvinceCityArea {
     }
 
 
-    private String jsonRead(File file){
-        Scanner scanner = null;
-        StringBuilder buffer = new StringBuilder();
-        try {
-            scanner = new Scanner(file, "utf-8");
-            while (scanner.hasNextLine()) {
-                buffer.append(scanner.nextLine());
-            }
-        } catch (Exception e) {
-
-        } finally {
-            if (scanner != null) {
-                scanner.close();
-            }
-        }
-        return buffer.toString();
-    }
-
     class Area{
         String id;
         String text;
@@ -128,4 +100,19 @@ public class ProvinceCityArea {
             return pid;
         }
     }
+
+
+    @Value("classpath:static/pca.json")
+    private Resource jsonData;
+
+    public void getAreaByCode(String code,List<String> ls){
+        for(Area area: areaList){
+            if(area.getId().equals(code)){
+                String pid = area.getPid();
+                ls.add(0,area.getText());
+                getAreaByCode(pid,ls);
+            }
+        }
+    }
+
 }

+ 13 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/SystemDateConstant.java

@@ -0,0 +1,13 @@
+package org.jeecg.common.constant;
+
+public class SystemDateConstant {
+
+    //系統年月日时间格式
+    public static String yyyy_MM_dd="yyyy-MM-dd";
+
+    public static String yyyy_MM="yyyy-MM";
+
+    //系统数据起始时间
+    public static String BEGIN_TIME="2019-09-01";
+
+}

+ 0 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/WebsocketConst.java

@@ -57,5 +57,4 @@ public class WebsocketConst {
      * 消息类型 新闻发布/取消
      */
     public static final String NEWS_PUBLISH = "publish";
-
 }

+ 165 - 167
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/es/JeecgElasticsearchTemplate.java

@@ -46,28 +46,6 @@ public class JeecgElasticsearchTemplate {
         }
     }
 
-    public StringBuilder getBaseUrl(String indexName, String typeName) {
-        typeName = typeName.trim().toLowerCase();
-        return this.getBaseUrl(indexName).append("/").append(typeName);
-    }
-
-    public StringBuilder getBaseUrl(String indexName) {
-        indexName = indexName.trim().toLowerCase();
-        return this.getBaseUrl().append("/").append(indexName);
-    }
-
-    public StringBuilder getBaseUrl() {
-        return new StringBuilder("http://").append(this.baseUrl);
-    }
-
-    /**
-     * cat 查询ElasticSearch系统数据,返回json
-     */
-    public <T> ResponseEntity<T> _cat(String urlAfter, Class<T> responseType) {
-        String url = this.getBaseUrl().append("/_cat").append(urlAfter).append("?").append(FORMAT_JSON).toString();
-        return RestUtil.request(url, HttpMethod.GET, null, null, null, responseType);
-    }
-
     /**
      * 查询所有索引
      * <p>
@@ -108,6 +86,171 @@ public class JeecgElasticsearchTemplate {
     }
 
     /**
+     * 保存数据,详见:saveOrUpdate
+     */
+    public boolean save(String indexName, String typeName, String dataId, JSONObject data) {
+        return this.saveOrUpdate(indexName, typeName, dataId, data);
+    }
+
+    /**
+     * 更新数据,详见:saveOrUpdate
+     */
+    public boolean update(String indexName, String typeName, String dataId, JSONObject data) {
+        return this.saveOrUpdate(indexName, typeName, dataId, data);
+    }
+    /**
+     * 批量保存数据
+     *
+     * @param indexName 索引名称
+     * @param typeName  type,一个任意字符串,用于分类
+     * @param dataList  要存储的数据数组,每行数据必须包含id
+     * @return
+     */
+    public boolean saveBatch(String indexName, String typeName, JSONArray dataList) {
+        String url = this.getBaseUrl().append("/_bulk").append("?refresh=wait_for").toString();
+        StringBuilder bodySB = new StringBuilder();
+        for (int i = 0; i < dataList.size(); i++) {
+            JSONObject data = dataList.getJSONObject(i);
+            String id = data.getString("id");
+            // 该行的操作
+            // {"create": {"_id":"${id}", "_index": "${indexName}", "_type": "${typeName}"}}
+            JSONObject action = new JSONObject();
+            JSONObject actionInfo = new JSONObject();
+            actionInfo.put("_id", id);
+            actionInfo.put("_index", indexName);
+            actionInfo.put("_type", typeName);
+            action.put("create", actionInfo);
+            bodySB.append(action.toJSONString()).append("\n");
+            // 该行的数据
+            data.remove("id");
+            bodySB.append(data.toJSONString()).append("\n");
+        }
+        System.out.println("+-+-+-: bodySB.toString(): " + bodySB.toString());
+        HttpHeaders headers = RestUtil.getHeaderApplicationJson();
+        RestUtil.request(url, HttpMethod.PUT, headers, null, bodySB, JSONObject.class);
+        return true;
+    }
+
+    /**
+     * @param _source (源滤波器)指定返回的字段,传null返回所有字段
+     * @param query
+     * @param from    从第几条数据开始
+     * @param size    返回条目数
+     * @return { "query": query }
+     */
+    public JSONObject buildQuery(List<String> _source, JSONObject query, int from, int size) {
+        JSONObject json = new JSONObject();
+        if (_source != null) {
+            json.put("_source", _source);
+        }
+        json.put("query", query);
+        json.put("from", from);
+        json.put("size", size);
+        return json;
+    }
+
+    /**
+     * @return { "bool" : { "must": must, "must_not": mustNot, "should": should } }
+     */
+    public JSONObject buildBoolQuery(JSONArray must, JSONArray mustNot, JSONArray should) {
+        JSONObject bool = new JSONObject();
+        if (must != null) {
+            bool.put("must", must);
+        }
+        if (mustNot != null) {
+            bool.put("must_not", mustNot);
+        }
+        if (should != null) {
+            bool.put("should", should);
+        }
+        JSONObject json = new JSONObject();
+        json.put("bool", bool);
+        return json;
+    }
+
+    /**
+     * @param field 要查询的字段
+     * @param args  查询参数,参考: *哈哈* OR *哒* NOT *呵* OR *啊*
+     * @return
+     */
+    public JSONObject buildQueryString(String field, String... args) {
+        if (field == null) {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder(field).append(":(");
+        if (args != null) {
+            for (String arg : args) {
+                sb.append(arg).append(" ");
+            }
+        }
+        sb.append(")");
+        return this.buildQueryString(sb.toString());
+    }
+
+    /**
+     * @return { "query_string": { "query": query }  }
+     */
+    public JSONObject buildQueryString(String query) {
+        JSONObject queryString = new JSONObject();
+        queryString.put("query", query);
+        JSONObject json = new JSONObject();
+        json.put("query_string", queryString);
+        return json;
+    }
+
+    /**
+     * @param field      查询字段
+     * @param min        最小值
+     * @param max        最大值
+     * @param containMin 范围内是否包含最小值
+     * @param containMax 范围内是否包含最大值
+     * @return { "range" : { field : { 『 "gt『e』?containMin" : min 』?min!=null , 『 "lt『e』?containMax" : max 』}} }
+     */
+    public JSONObject buildRangeQuery(String field, Object min, Object max, boolean containMin, boolean containMax) {
+        JSONObject inner = new JSONObject();
+        if (min != null) {
+            if (containMin) {
+                inner.put("gte", min);
+            } else {
+                inner.put("gt", min);
+            }
+        }
+        if (max != null) {
+            if (containMax) {
+                inner.put("lte", max);
+            } else {
+                inner.put("lt", max);
+            }
+        }
+        JSONObject range = new JSONObject();
+        range.put(field, inner);
+        JSONObject json = new JSONObject();
+        json.put("range", range);
+        return json;
+    }
+
+    public StringBuilder getBaseUrl(String indexName, String typeName) {
+        typeName = typeName.trim().toLowerCase();
+        return this.getBaseUrl(indexName).append("/").append(typeName);
+    }
+
+    public StringBuilder getBaseUrl(String indexName) {
+        indexName = indexName.trim().toLowerCase();
+        return this.getBaseUrl().append("/").append(indexName);
+    }
+
+    public StringBuilder getBaseUrl() {
+        return new StringBuilder("http://").append(this.baseUrl);
+    }
+
+    /**
+     * cat 查询ElasticSearch系统数据,返回json
+     */
+    public <T> ResponseEntity<T> _cat(String urlAfter, Class<T> responseType) {
+        String url = this.getBaseUrl().append("/_cat").append(urlAfter).append("?").append(FORMAT_JSON).toString();
+        return RestUtil.request(url, HttpMethod.GET, null, null, null, responseType);
+    }
+    /**
      * 根据ID获取索引数据,未查询到返回null
      * <p>
      * 查询地址:GET http://{baseUrl}/{indexName}/{typeName}/{dataId}
@@ -254,20 +397,6 @@ public class JeecgElasticsearchTemplate {
     }
 
     /**
-     * 保存数据,详见:saveOrUpdate
-     */
-    public boolean save(String indexName, String typeName, String dataId, JSONObject data) {
-        return this.saveOrUpdate(indexName, typeName, dataId, data);
-    }
-
-    /**
-     * 更新数据,详见:saveOrUpdate
-     */
-    public boolean update(String indexName, String typeName, String dataId, JSONObject data) {
-        return this.saveOrUpdate(indexName, typeName, dataId, data);
-    }
-
-    /**
      * 保存或修改索引数据
      * <p>
      * 查询地址:PUT http://{baseUrl}/{indexName}/{typeName}/{dataId}
@@ -330,39 +459,6 @@ public class JeecgElasticsearchTemplate {
     }
 
     /**
-     * 批量保存数据
-     *
-     * @param indexName 索引名称
-     * @param typeName  type,一个任意字符串,用于分类
-     * @param dataList  要存储的数据数组,每行数据必须包含id
-     * @return
-     */
-    public boolean saveBatch(String indexName, String typeName, JSONArray dataList) {
-        String url = this.getBaseUrl().append("/_bulk").append("?refresh=wait_for").toString();
-        StringBuilder bodySB = new StringBuilder();
-        for (int i = 0; i < dataList.size(); i++) {
-            JSONObject data = dataList.getJSONObject(i);
-            String id = data.getString("id");
-            // 该行的操作
-            // {"create": {"_id":"${id}", "_index": "${indexName}", "_type": "${typeName}"}}
-            JSONObject action = new JSONObject();
-            JSONObject actionInfo = new JSONObject();
-            actionInfo.put("_id", id);
-            actionInfo.put("_index", indexName);
-            actionInfo.put("_type", typeName);
-            action.put("create", actionInfo);
-            bodySB.append(action.toJSONString()).append("\n");
-            // 该行的数据
-            data.remove("id");
-            bodySB.append(data.toJSONString()).append("\n");
-        }
-        System.out.println("+-+-+-: bodySB.toString(): " + bodySB.toString());
-        HttpHeaders headers = RestUtil.getHeaderApplicationJson();
-        RestUtil.request(url, HttpMethod.PUT, headers, null, bodySB, JSONObject.class);
-        return true;
-    }
-
-    /**
      * 删除索引数据
      * <p>
      * 请求地址:DELETE http://{baseUrl}/{indexName}/{typeName}/{dataId}
@@ -413,103 +509,5 @@ public class JeecgElasticsearchTemplate {
         return res;
     }
 
-    /**
-     * @param _source (源滤波器)指定返回的字段,传null返回所有字段
-     * @param query
-     * @param from    从第几条数据开始
-     * @param size    返回条目数
-     * @return { "query": query }
-     */
-    public JSONObject buildQuery(List<String> _source, JSONObject query, int from, int size) {
-        JSONObject json = new JSONObject();
-        if (_source != null) {
-            json.put("_source", _source);
-        }
-        json.put("query", query);
-        json.put("from", from);
-        json.put("size", size);
-        return json;
-    }
-
-    /**
-     * @return { "bool" : { "must": must, "must_not": mustNot, "should": should } }
-     */
-    public JSONObject buildBoolQuery(JSONArray must, JSONArray mustNot, JSONArray should) {
-        JSONObject bool = new JSONObject();
-        if (must != null) {
-            bool.put("must", must);
-        }
-        if (mustNot != null) {
-            bool.put("must_not", mustNot);
-        }
-        if (should != null) {
-            bool.put("should", should);
-        }
-        JSONObject json = new JSONObject();
-        json.put("bool", bool);
-        return json;
-    }
-
-    /**
-     * @param field 要查询的字段
-     * @param args  查询参数,参考: *哈哈* OR *哒* NOT *呵* OR *啊*
-     * @return
-     */
-    public JSONObject buildQueryString(String field, String... args) {
-        if (field == null) {
-            return null;
-        }
-        StringBuilder sb = new StringBuilder(field).append(":(");
-        if (args != null) {
-            for (String arg : args) {
-                sb.append(arg).append(" ");
-            }
-        }
-        sb.append(")");
-        return this.buildQueryString(sb.toString());
-    }
-
-    /**
-     * @return { "query_string": { "query": query }  }
-     */
-    public JSONObject buildQueryString(String query) {
-        JSONObject queryString = new JSONObject();
-        queryString.put("query", query);
-        JSONObject json = new JSONObject();
-        json.put("query_string", queryString);
-        return json;
-    }
-
-    /**
-     * @param field      查询字段
-     * @param min        最小值
-     * @param max        最大值
-     * @param containMin 范围内是否包含最小值
-     * @param containMax 范围内是否包含最大值
-     * @return { "range" : { field : { 『 "gt『e』?containMin" : min 』?min!=null , 『 "lt『e』?containMax" : max 』}} }
-     */
-    public JSONObject buildRangeQuery(String field, Object min, Object max, boolean containMin, boolean containMax) {
-        JSONObject inner = new JSONObject();
-        if (min != null) {
-            if (containMin) {
-                inner.put("gte", min);
-            } else {
-                inner.put("gt", min);
-            }
-        }
-        if (max != null) {
-            if (containMax) {
-                inner.put("lte", max);
-            } else {
-                inner.put("lt", max);
-            }
-        }
-        JSONObject range = new JSONObject();
-        range.put(field, inner);
-        JSONObject json = new JSONObject();
-        json.put("range", range);
-        return json;
-    }
-
 }
 

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootException.java

@@ -16,4 +16,5 @@ public class JeecgBootException extends RuntimeException {
 	{
 		super(message,cause);
 	}
+
 }

+ 1 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysDataSource.java

@@ -1,6 +1,5 @@
-package cn.com.ctop.common.module.entity;
+package org.jeecg.common.system.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -53,7 +52,6 @@ public class SysDataSource {
     /**
      * 数据库类型
      */
-    @Dict(dicCode = "database_type")
     @Excel(name = "数据库类型", width = 15, dicCode = "database_type")
     @ApiModelProperty(value = "数据库类型")
     private String dbType;

+ 0 - 9
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/entity/SysUser.java

@@ -67,14 +67,6 @@ public class SysUser implements Serializable {
     private String avatar;
 
     /**
-     * 生日
-     */
-    @Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date birthday;
-
-    /**
      * 性别(1:男 2:女)
      */
     @Excel(name = "性别", width = 15,dicCode="sex")
@@ -229,5 +221,4 @@ public class SysUser implements Serializable {
     private String leaderName;
 
     private String departId;
-
 }

+ 1 - 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java

@@ -221,7 +221,6 @@ public class QueryGenerator {
 		if(parameterMap!=null&& parameterMap.containsKey(ORDER_TYPE)) {
 			order = parameterMap.get(ORDER_TYPE)[0];
 		}
-        log.info("排序规则>>列:" + column + ",排序方式:" + order);
 		if (oConvertUtils.isNotEmpty(column) && oConvertUtils.isNotEmpty(order)) {
 			//字典字段,去掉字典翻译文本后缀
 			if(column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) {
@@ -234,7 +233,7 @@ public class QueryGenerator {
 			// 排序规则修改
 			// 将现有排序 _ 前端传递排序条件{....,column: 'column1,column2',order: 'desc'} 翻译成sql "column1,column2 desc"
 			// 修改为 _ 前端传递排序条件{....,column: 'column1,column2',order: 'desc'} 翻译成sql "column1 desc,column2 desc"
-			if (order.toUpperCase().indexOf(ORDER_TYPE_ASC)>=0) {
+			if (order.toUpperCase().contains(ORDER_TYPE_ASC)) {
 				//queryWrapper.orderByAsc(oConvertUtils.camelToUnderline(column));
 				String columnStr = oConvertUtils.camelToUnderline(column);
 				String[] columnArray = columnStr.split(",");

+ 0 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JeecgDataAutorUtils.java

@@ -99,6 +99,5 @@ public class JeecgDataAutorUtils {
 	 */
 	public static synchronized SysUserCacheInfo loadUserInfo() {
 		return (SysUserCacheInfo) SpringContextUtils.getHttpServletRequest().getAttribute(SYS_USER_INFO);
-				
 	}
 }

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/DictModel.java

@@ -40,4 +40,5 @@ public class DictModel implements Serializable{
 		return this.text;
 	}
 
+
 }

+ 0 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/SysUserCacheInfo.java

@@ -63,5 +63,4 @@ public class SysUserCacheInfo {
 	public void setSysMultiOrgCode(List<String> sysMultiOrgCode) {
 		this.sysMultiOrgCode = sysMultiOrgCode;
 	}
-
 }

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/CommonUtils.java

@@ -167,4 +167,5 @@ public class CommonUtils {
         return DB_TYPE;
 
     }
+
 }

+ 26 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -7,6 +7,7 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
+import org.jeecg.common.constant.SystemDateConstant;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.StringUtils;
@@ -90,7 +91,6 @@ public class DateUtils extends PropertyEditorSupport {
         }
         return date2Str(date_sdf.get());
     }
-
     /**
      * 字符串转换时间戳
      *
@@ -1692,4 +1692,29 @@ public class DateUtils extends PropertyEditorSupport {
 
         return days;
     }
+    private static Logger logger = LoggerFactory.getLogger(DateUtils.class);
+    /**
+     * 判断time是否在from,to之内
+     *
+     * @param time 指定日期
+     * @param from 开始日期
+     * @param to   结束日期
+     * @throws
+     */
+    public static boolean checkTimeLimit(Date time, Date from, Date to) {
+        Calendar date = Calendar.getInstance();
+        date.setTime(time);
+
+        Calendar after = Calendar.getInstance();
+        after.setTime(from);
+
+        Calendar before = Calendar.getInstance();
+        before.setTime(to);
+
+        if (date.after(after) && date.before(before)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
 }

+ 0 - 70
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DySmsEnum.java

@@ -1,70 +0,0 @@
-package org.jeecg.common.util;
-
-import org.apache.commons.lang3.StringUtils;
-
-public enum DySmsEnum {
-	
-	LOGIN_TEMPLATE_CODE("SMS_175435174","JEECG","code"),
-	FORGET_PASSWORD_TEMPLATE_CODE("SMS_175435174","JEECG","code"),
-	REGISTER_TEMPLATE_CODE("SMS_175430166","JEECG","code"),
-	/**会议通知*/
-	MEET_NOTICE_TEMPLATE_CODE("SMS_201480469","H5活动之家","username,title,minute,time"),
-	/**我的计划通知*/
-	PLAN_NOTICE_TEMPLATE_CODE("SMS_201470515","H5活动之家","username,title,time");
-
-	/**
-	 * 短信模板编码
-	 */
-	private String templateCode;
-	/**
-	 * 签名
-	 */
-	private String signName;
-	/**
-	 * 短信模板必需的数据名称,多个key以逗号分隔,此处配置作为校验
-	 */
-	private String keys;
-	
-	private DySmsEnum(String templateCode,String signName,String keys) {
-		this.templateCode = templateCode;
-		this.signName = signName;
-		this.keys = keys;
-	}
-	
-	public String getTemplateCode() {
-		return templateCode;
-	}
-	
-	public void setTemplateCode(String templateCode) {
-		this.templateCode = templateCode;
-	}
-	
-	public String getSignName() {
-		return signName;
-	}
-	
-	public void setSignName(String signName) {
-		this.signName = signName;
-	}
-	
-	public String getKeys() {
-		return keys;
-	}
-
-	public void setKeys(String keys) {
-		this.keys = keys;
-	}
-
-	public static DySmsEnum toEnum(String templateCode) {
-		if(StringUtils.isEmpty(templateCode)){
-			return null;
-		}
-		for(DySmsEnum item : DySmsEnum.values()) {
-			if(item.getTemplateCode().equals(templateCode)) {
-				return item;
-			}
-		}
-		return null;
-	}
-}
-

+ 16 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/MD5Util.java

@@ -79,4 +79,20 @@ public class MD5Util {
 	public static String getFileMd5(String path) throws Exception {
 		return DigestUtils.md5DigestAsHex(new FileInputStream(path));
 	}
+
+	public static String md5Encode(String origin, String charsetname) {
+		String resultString = null;
+		try {
+			resultString = new String(origin);
+			MessageDigest md = MessageDigest.getInstance("MD5");
+			if (charsetname == null || "".equals(charsetname)) {
+				resultString = byteArrayToHexString(md.digest(resultString.getBytes()));
+			} else {
+				resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname)));
+			}
+		} catch (Exception exception) {
+		}
+		return resultString;
+	}
+
 }

+ 1 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/PasswordUtil.java

@@ -177,4 +177,5 @@ public class PasswordUtil {
 	}
 
 
+
 }

+ 0 - 5
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/YouBianCodeUtil.java

@@ -165,9 +165,4 @@ public class YouBianCodeUtil {
 		}
 		
 	}
-//	public static void main(String[] args) {
-//		// org.jeecgframework.core.util.LogUtil.info(getNextZiMu('C'));
-//		// org.jeecgframework.core.util.LogUtil.info(getNextNum(8));
-//	    // org.jeecgframework.core.util.LogUtil.info(cutYouBianCode("C99A01B01")[2]);
-//	}
 }

+ 4 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/DataSourceCachePool.java

@@ -1,10 +1,10 @@
-package cn.com.ctop.common.module.db;
+package org.jeecg.common.util.db;
 
 import com.alibaba.druid.pool.DruidDataSource;
 import org.jeecg.common.constant.CacheConstant;
-import org.jeecg.common.system.api.ISysBaseApi;
 import org.jeecg.common.system.vo.DynamicDataSourceModel;
 import org.jeecg.common.util.SpringContextUtils;
+import org.jeecg.modules.base.service.BaseCommonService;
 import org.springframework.data.redis.core.RedisTemplate;
 
 import java.util.HashMap;
@@ -37,8 +37,8 @@ public class DataSourceCachePool {
         if (getRedisTemplate().hasKey(redisCacheKey)) {
             return (DynamicDataSourceModel) getRedisTemplate().opsForValue().get(redisCacheKey);
         }
-        ISysBaseApi sysBaseApi = SpringContextUtils.getBean(ISysBaseApi.class);
-        DynamicDataSourceModel dbSource = sysBaseApi.getDynamicDbSourceByCode(dbKey);
+        BaseCommonService baseCommonService = SpringContextUtils.getBean(BaseCommonService.class);
+        DynamicDataSourceModel dbSource = baseCommonService.getDynamicDbSourceByCode(dbKey);
         if (dbSource != null) {
             getRedisTemplate().opsForValue().set(redisCacheKey, dbSource);
         }

+ 31 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/db/DbValidationQueryEnum.java

@@ -0,0 +1,31 @@
+package org.jeecg.common.util.db;
+
+public enum DbValidationQueryEnum {
+    ORACLE("oracle", "SELECT 1 FROM DUAL"),
+    MYSQL("mysql", "select 1"),
+    SQLSERVER("sqlserver", "SELECT 1 FROM DUAL"),;
+
+    DbValidationQueryEnum(String dbType, String validationQuerySql) {
+        this.dbType = dbType;
+        this.validationQuerySql = validationQuerySql;
+    }
+
+    private String dbType;
+    private String validationQuerySql;
+
+    public String getDbType() {
+        return dbType;
+    }
+
+    public void setDbType(String dbType) {
+        this.dbType = dbType;
+    }
+
+    public String getValidationQuerySql() {
+        return validationQuerySql;
+    }
+
+    public void setValidationQuerySql(String validationQuerySql) {
+        this.validationQuerySql = validationQuerySql;
+    }
+}

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/DynamicDBUtil.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.common.module.db;
+package org.jeecg.common.util.db;
 
 import com.alibaba.druid.pool.DruidDataSource;
 import lombok.extern.slf4j.Slf4j;

+ 167 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/db/FreemarkerParseFactory.java

@@ -0,0 +1,167 @@
+package org.jeecg.common.util.db;
+
+import freemarker.cache.StringTemplateLoader;
+import freemarker.core.ParseException;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.jeecgframework.codegenerate.generate.util.SimpleFormat;
+
+import java.io.StringWriter;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * @author 赵俊夫
+ * @version V1.0
+ * @Title:FreemarkerHelper
+ * @description:Freemarker引擎协助类
+ * @date Jul 5, 2013 2:58:29 PM
+ */
+@Slf4j
+public class FreemarkerParseFactory {
+
+    private static final String ENCODE = "utf-8";
+    /**
+     * 参数格式化工具类
+     */
+    private static final String MINI_DAO_FORMAT = "DaoFormat";
+
+    /**
+     * 文件缓存
+     */
+    private static final Configuration _tplConfig = new Configuration();
+    /**
+     * SQL 缓存
+     */
+    private static final Configuration _sqlConfig = new Configuration();
+
+    private static StringTemplateLoader stringTemplateLoader = new StringTemplateLoader();
+
+    // 使用内嵌的(?ms)打开单行和多行模式
+    private final static Pattern p = Pattern
+            .compile("(?ms)/\\*.*?\\*/|^\\s*//.*?$");
+
+    static {
+        _tplConfig.setClassForTemplateLoading(
+                new FreemarkerParseFactory().getClass(), "/");
+        _tplConfig.setNumberFormat("0.#####################");
+        _sqlConfig.setTemplateLoader(stringTemplateLoader);
+        _sqlConfig.setNumberFormat("0.#####################");
+        //classic_compatible设置,解决报空指针错误
+        _sqlConfig.setClassicCompatible(true);
+    }
+
+    /**
+     * 判断模板是否存在
+     *
+     * @throws Exception
+     */
+    public static boolean isExistTemplate(String tplName) throws Exception {
+        try {
+            Template mytpl = _tplConfig.getTemplate(tplName, "UTF-8");
+            if (mytpl == null) {
+                return false;
+            }
+        } catch (Exception e) {
+            //update-begin--Author:scott  Date:20180320 for:解决问题 - 错误提示sql文件不存在,实际问题是sql freemarker用法错误-----
+            if (e instanceof ParseException) {
+                log.error(e.getMessage(), e.fillInStackTrace());
+                throw new Exception(e);
+            }
+            log.debug("----isExistTemplate----" + e.toString());
+            //update-end--Author:scott  Date:20180320 for:解决问题 - 错误提示sql文件不存在,实际问题是sql freemarker用法错误------
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 解析ftl模板
+     *
+     * @param tplName 模板名
+     * @param paras   参数
+     * @return
+     */
+    public static String parseTemplate(String tplName, Map<String, Object> paras) {
+        try {
+            log.debug(" minidao sql templdate : " + tplName);
+            StringWriter swriter = new StringWriter();
+            Template mytpl = _tplConfig.getTemplate(tplName, ENCODE);
+            if (paras.containsKey(MINI_DAO_FORMAT)) {
+                throw new RuntimeException("DaoFormat 是 minidao 保留关键字,不允许使用 ,请更改参数定义!");
+            }
+            paras.put(MINI_DAO_FORMAT, new SimpleFormat());
+            mytpl.process(paras, swriter);
+            String sql = getSqlText(swriter.toString());
+            paras.remove(MINI_DAO_FORMAT);
+            return sql;
+        } catch (Exception e) {
+            log.error(e.getMessage(), e.fillInStackTrace());
+            log.error("发送一次的模板key:{ " + tplName + " }");
+            throw new RuntimeException("解析SQL模板异常");
+        }
+    }
+
+    /**
+     * 解析ftl
+     *
+     * @param tplContent 模板内容
+     * @param paras      参数
+     * @return String 模板解析后内容
+     */
+    public static String parseTemplateContent(String tplContent,
+                                              Map<String, Object> paras) {
+        try {
+            StringWriter swriter = new StringWriter();
+            if (stringTemplateLoader.findTemplateSource("sql_" + tplContent.hashCode()) == null) {
+                stringTemplateLoader.putTemplate("sql_" + tplContent.hashCode(), tplContent);
+            }
+            Template mytpl = _sqlConfig.getTemplate("sql_" + tplContent.hashCode(), ENCODE);
+            if (paras.containsKey(MINI_DAO_FORMAT)) {
+                throw new RuntimeException("DaoFormat 是 minidao 保留关键字,不允许使用 ,请更改参数定义!");
+            }
+            paras.put(MINI_DAO_FORMAT, new SimpleFormat());
+            mytpl.process(paras, swriter);
+            String sql = getSqlText(swriter.toString());
+            paras.remove(MINI_DAO_FORMAT);
+            return sql;
+        } catch (Exception e) {
+            log.error(e.getMessage(), e.fillInStackTrace());
+            log.error("发送一次的模板key:{ " + tplContent + " }");
+            throw new RuntimeException("解析SQL模板异常");
+        }
+    }
+
+    /**
+     * 除去无效字段,去掉注释 不然批量处理可能报错 去除无效的等于
+     */
+    private static String getSqlText(String sql) {
+        // 将注释替换成""
+        sql = p.matcher(sql).replaceAll("");
+        sql = sql.replaceAll("\\n", " ").replaceAll("\\t", " ")
+                .replaceAll("\\s{1,}", " ").trim();
+        // 去掉 最后是 where这样的问题
+        if (sql.endsWith("where") || sql.endsWith("where ")) {
+            sql = sql.substring(0, sql.lastIndexOf("where"));
+        }
+        // 去掉where and 这样的问题
+        int index = 0;
+        while ((index = StringUtils.indexOfIgnoreCase(sql, "where and", index)) != -1) {
+            sql = sql.substring(0, index + 5)
+                    + sql.substring(index + 9, sql.length());
+        }
+        // 去掉 , where 这样的问题
+        index = 0;
+        while ((index = StringUtils.indexOfIgnoreCase(sql, ", where", index)) != -1) {
+            sql = sql.substring(0, index)
+                    + sql.substring(index + 1, sql.length());
+        }
+        // 去掉 最后是 ,这样的问题
+        if (sql.endsWith(",") || sql.endsWith(", ")) {
+            sql = sql.substring(0, sql.lastIndexOf(","));
+        }
+        return sql;
+    }
+}

+ 5 - 5
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DataSourceCachePool.java

@@ -1,12 +1,12 @@
 package org.jeecg.common.util.dynamic.db;
 
 import com.alibaba.druid.pool.DruidDataSource;
-import org.jeecg.common.api.CommonAPI;
 import org.jeecg.common.constant.CacheConstant;
 import org.jeecg.common.system.vo.DynamicDataSourceModel;
-import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.SpringContextUtils;
+import org.jeecg.modules.base.service.BaseCommonService;
 import org.springframework.data.redis.core.RedisTemplate;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -19,7 +19,7 @@ public class DataSourceCachePool {
     private static Map<String, DruidDataSource> dbSources = new HashMap<>();
     private static RedisTemplate<String, Object> redisTemplate;
 
-    private static RedisTemplate<String, Object> getRedisTemplate() {
+    public static RedisTemplate<String, Object> getRedisTemplate() {
         if (redisTemplate == null) {
             redisTemplate = (RedisTemplate<String, Object>) SpringContextUtils.getBean("redisTemplate");
         }
@@ -37,8 +37,8 @@ public class DataSourceCachePool {
         if (getRedisTemplate().hasKey(redisCacheKey)) {
             return (DynamicDataSourceModel) getRedisTemplate().opsForValue().get(redisCacheKey);
         }
-        CommonAPI commonAPI = SpringContextUtils.getBean(CommonAPI.class);
-        DynamicDataSourceModel dbSource = commonAPI.getDynamicDbSourceByCode(dbKey);
+        BaseCommonService baseCommonService = SpringContextUtils.getBean(BaseCommonService.class);
+        DynamicDataSourceModel dbSource = baseCommonService.getDynamicDbSourceByCode(dbKey);
         if (dbSource != null) {
             getRedisTemplate().opsForValue().set(redisCacheKey, dbSource);
         }

+ 31 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DbValidationQueryEnum.java

@@ -0,0 +1,31 @@
+package org.jeecg.common.util.dynamic.db;
+
+public enum DbValidationQueryEnum {
+    ORACLE("oracle", "SELECT 1 FROM DUAL"),
+    MYSQL("mysql", "select 1"),
+    SQLSERVER("sqlserver", "SELECT 1 FROM DUAL"),;
+
+    DbValidationQueryEnum(String dbType, String validationQuerySql) {
+        this.dbType = dbType;
+        this.validationQuerySql = validationQuerySql;
+    }
+
+    private String dbType;
+    private String validationQuerySql;
+
+    public String getDbType() {
+        return dbType;
+    }
+
+    public void setDbType(String dbType) {
+        this.dbType = dbType;
+    }
+
+    public String getValidationQuerySql() {
+        return validationQuerySql;
+    }
+
+    public void setValidationQuerySql(String validationQuerySql) {
+        this.validationQuerySql = validationQuerySql;
+    }
+}

+ 1 - 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/DynamicDBUtil.java

@@ -2,8 +2,7 @@ package org.jeecg.common.util.dynamic.db;
 
 import com.alibaba.druid.pool.DruidDataSource;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.ArrayUtils;
-import org.jeecg.common.exception.JeecgBootException;
+import org.apache.commons.lang.ArrayUtils;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.DynamicDataSourceModel;
 import org.jeecg.common.util.ReflectHelper;
@@ -11,7 +10,6 @@ import org.jeecg.common.util.oConvertUtils;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
 
-import javax.sql.DataSource;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.List;

+ 14 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/FreemarkerParseFactory.java

@@ -168,4 +168,18 @@ public class FreemarkerParseFactory {
         }
         return sql;
     }
+
+
+    static {
+        _tplConfig.setClassForTemplateLoading(
+                new FreemarkerParseFactory().getClass(), "/");
+        _tplConfig.setNumberFormat("0.#####################");
+        _sqlConfig.setTemplateLoader(stringTemplateLoader);
+        _sqlConfig.setNumberFormat("0.#####################");
+        //classic_compatible设置,解决报空指针错误
+        _sqlConfig.setClassicCompatible(true);
+    }
+
+
+
 }

+ 2 - 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/dynamic/db/SqlUtils.java

@@ -1,6 +1,6 @@
 package org.jeecg.common.util.dynamic.db;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.constant.DataBaseConstant;
 import org.jeecg.common.system.vo.DynamicDataSourceModel;
 
@@ -13,7 +13,6 @@ import java.util.Map;
 public class SqlUtils {
 
     public static final String DATABSE_TYPE_MYSQL = "mysql";
-    public static final String DATABSE_TYPE_MARIADB = "mariadb";
     public static final String DATABSE_TYPE_POSTGRE = "postgresql";
     public static final String DATABSE_TYPE_ORACLE = "oracle";
     public static final String DATABSE_TYPE_SQLSERVER = "sqlserver";
@@ -48,7 +47,7 @@ public class SqlUtils {
      */
 
     public static boolean dbTypeIsMySQL(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_MYSQL, DataBaseConstant.DB_TYPE_MYSQL_NUM) || dbTypeIf(dbType, DATABSE_TYPE_MARIADB, DataBaseConstant.DB_TYPE_MARIADB_NUM);
+        return dbTypeIf(dbType, DATABSE_TYPE_MYSQL, DataBaseConstant.DB_TYPE_MYSQL_NUM);
     }
 
     public static boolean dbTypeIsOracle(String dbType) {

+ 23 - 24
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java

@@ -5,6 +5,7 @@ import org.apache.shiro.codec.Base64;
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
 
 /**
  * AES 加密
@@ -23,7 +24,7 @@ public class AesEncryptUtil {
      * @return 加密的结果
      * @throws Exception
      */
-    public static String encrypt(String data, String key, String iv) throws Exception {
+    public static String encrypt(String data, String key, String iv) {
         try {
 
             Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");//"算法/模式/补码方式"NoPadding PkcsPadding
@@ -60,7 +61,7 @@ public class AesEncryptUtil {
      * @return 解密的结果
      * @throws Exception
      */
-    public static String desEncrypt(String data, String key, String iv) throws Exception {
+    public static String desEncrypt(String data, String key, String iv) {
         try {
 			byte[] encrypted1 = Base64.decode(data);
 
@@ -79,43 +80,41 @@ public class AesEncryptUtil {
         }
     }
 
+    private AesEncryptUtil() {
+    }
+
     /**
      * 使用默认的key和iv加密
+     *
      * @param data
      * @return
      * @throws Exception
      */
-    public static String encrypt(String data) throws Exception {
-        return encrypt(data, KEY, IV);
+    public static String encrypt(String data){
+        return encrypt(data, EncryptedString.key, EncryptedString.iv);
     }
 
     /**
      * 使用默认的key和iv解密
+     *
      * @param data
      * @return
-     * @throws Exception
      */
-    public static String desEncrypt(String data) throws Exception {
-        return desEncrypt(data, KEY, IV);
+    public static String desEncrypt(String data){
+        return desEncrypt(data, EncryptedString.key, EncryptedString.iv);
     }
 
 
+    public static String getUrlDecoderString(String str) {
+        String result = "";
+        if (null == str) {
+            return "";
+        }
+        try {
+            result = java.net.URLDecoder.decode(str, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+        }
+        return result;
 
-//    /**
-//     * 测试
-//     */
-//    public static void main(String args[]) throws Exception {
-//        String test1 = "sa";
-//        String test =new String(test1.getBytes(),"UTF-8");
-//        String data = null;
-//        String key =  KEY;
-//        String iv = IV;
-//        // /g2wzfqvMOeazgtsUVbq1kmJawROa6mcRAzwG1/GeJ4=
-//        data = encrypt(test, key, iv);
-//        System.out.println("数据:"+test);
-//        System.out.println("加密:"+data);
-//        String jiemi =desEncrypt(data, key, iv).trim();
-//        System.out.println("解密:"+jiemi);
-//    }
-
+    }
 }

+ 28 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/BaseColumn.java

@@ -0,0 +1,28 @@
+package org.jeecg.common.util.jsonschema;
+
+import lombok.Data;
+
+/**
+ * 列 配置基本信息
+ */
+@Data
+public class BaseColumn {
+
+    /**
+     * 列配置 描述 -对应数据库字段描述
+     */
+    private String title;
+
+    /**
+     * 列配置 名称 -对应数据库字段名
+     */
+    private String field;
+
+    public BaseColumn(){}
+
+    public BaseColumn(String title,String field){
+        this.title = title;
+        this.field = field;
+    }
+
+}

+ 170 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/CommonProperty.java

@@ -0,0 +1,170 @@
+package org.jeecg.common.util.jsonschema;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.system.vo.DictModel;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 验证通用属性
+ */
+public abstract class CommonProperty implements Serializable{
+
+	private static final long serialVersionUID = -426159949502493187L;
+
+
+	protected String key;
+
+
+	/**
+	 * <p>此关键字的值必须是字符串或数组。如果它是一个数组,那么数组的元素必须是字符串,并且必须是唯一的。
+	 * <p>字符串值必须是六种基本类型之一(“null”,“boolean”,“object”,“array”,“number”或“string”),或“integer”,它匹配任何数字,零分数部分。
+	 * <p>当且仅当实例位于为此关键字列出的任何集合中时,实例才会验证。
+	 *
+	 */
+	protected String type;
+
+	/**
+	 * 对应JsonSchema的enum
+	 * <p>该关键字的值必须是一个数组。这个数组应该至少有一个元素。数组中的元素应该是唯一的。如果实例的值等于此关键字的数组值中的某个元素,则实例将对此关键字成功验证。
+	 * 数组中的元素可以是任何值,包括null
+	 *
+	 *  {
+	 *   "type": "string",
+	 *   "enum": ["1", "2", "3"] 需要的话可以通过这个include转一下
+	 *	}
+	 */
+	protected List<DictModel> include;
+
+	/**
+	 * 对应JsonSchema的const
+	 * <p>此关键字的值可以是任何类型,包括null。
+	 *	如果实例的值等于关键字的值,则实例将针对此关键字成功验证。
+	 */
+	protected Object constant;
+
+	//三个自定义 属性
+	protected String view;// 展示类型
+	protected String title;//数据库字段备注
+	protected Integer order;//字段显示排序
+
+	protected boolean disabled;//是否禁用
+
+	protected String defVal; // 字段默认值
+
+	public String getDefVal() {
+		return defVal;
+	}
+
+	public void setDefVal(String defVal) {
+		this.defVal = defVal;
+	}
+
+	public boolean isDisabled() {
+		return disabled;
+	}
+
+	public void setDisabled(boolean disabled) {
+		this.disabled = disabled;
+	}
+
+	public String getView() {
+		return view;
+	}
+
+	public void setView(String view) {
+		this.view = view;
+	}
+
+	public String getKey() {
+		return key;
+	}
+
+	public void setKey(String key) {
+		this.key = key;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public List<DictModel> getInclude() {
+		return include;
+	}
+
+	public void setInclude(List<DictModel> include) {
+		this.include = include;
+	}
+
+	public Object getConstant() {
+		return constant;
+	}
+
+	public void setConstant(Object constant) {
+		this.constant = constant;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	/**
+	 * 返回一个map有两个key
+	 * <P>key ---> Property JSON的key
+	 * <P>prop --> JSON object
+	 * @return
+	 */
+	public abstract Map<String,Object> getPropertyJson();
+
+	public JSONObject getCommonJson() {
+		JSONObject json = new JSONObject();
+		json.put("type", type);
+		if(include!=null && include.size()>0) {
+			json.put("enum", include);
+		}
+		if(constant!=null) {
+			json.put("const", constant);
+		}
+		if(title!=null) {
+			json.put("title", title);
+		}
+		if(order!=null) {
+			json.put("order", order);
+		}
+		if(view==null) {
+			json.put("view", "input");
+		}else {
+			json.put("view", view);
+		}
+		if(disabled) {
+			String str = "{\"widgetattrs\":{\"disabled\":true}}";
+			JSONObject ui = JSONObject.parseObject(str);
+			json.put("ui", ui);
+		}
+		if (StringUtils.isNotBlank(defVal)) {
+			json.put("defVal", defVal);
+		}
+		return json;
+	}
+
+
+}

+ 87 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/JsonSchemaDescrip.java

@@ -0,0 +1,87 @@
+package org.jeecg.common.util.jsonschema;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * JsonSchema 模式类
+ * < http://json-schema.org/draft-07/schema# >
+ */
+public class JsonSchemaDescrip implements Serializable{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 7682073117441544718L;
+	
+	
+	private String $schema = "http://json-schema.org/draft-07/schema#";
+	
+	/**
+	 * 用它给我们的模式提供了标题。
+	 */
+	private String title;
+	
+	/**
+	 * 关于模式的描述。
+	 */
+	private String description;
+	
+	/**
+	 *type 关键字在我们的 JSON 数据上定义了第一个约束:必须是一个 JSON 对象。 可以直接设置成object
+	 */
+	private String type;
+	
+	private List<String> required;
+	
+	
+	public List<String> getRequired() {
+		return required;
+	}
+
+	public void setRequired(List<String> required) {
+		this.required = required;
+	}
+
+	public String get$schema() {
+		return $schema;
+	}
+
+	public void set$schema(String $schema) {
+		this.$schema = $schema;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+	
+	public JsonSchemaDescrip() {}
+	
+	public JsonSchemaDescrip(List<String> required) {
+		this.description="我是一个jsonschema description";
+		this.title="我是一个jsonschema title";
+		this.type="object";
+		this.required = required;
+	}
+
+}

+ 68 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/JsonschemaUtil.java

@@ -0,0 +1,68 @@
+package org.jeecg.common.util.jsonschema;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+public class JsonschemaUtil {
+	
+	/**
+	 * 生成JsonSchema
+	 * 
+	 * @param descrip
+	 * @param propertyList
+	 * @return
+	 */
+	public static JSONObject getJsonSchema(JsonSchemaDescrip descrip, List<CommonProperty> propertyList) {
+		JSONObject obj = new JSONObject();
+		obj.put("$schema", descrip.get$schema());
+		obj.put("type", descrip.getType());
+		obj.put("title", descrip.getTitle());
+
+		List<String> requiredArr = descrip.getRequired();
+		obj.put("required", requiredArr);
+
+		JSONObject properties = new JSONObject();
+		for (CommonProperty commonProperty : propertyList) {
+			Map<String, Object> map = commonProperty.getPropertyJson();
+			properties.put(map.get("key").toString(), map.get("prop"));
+		}
+		obj.put("properties", properties);
+		//鬼知道这里为什么报错 org.jeecg.modules.system.model.DictModel cannot be cast to org.jeecg.modules.system.model.DictModel
+		//log.info("---JSONSchema--->"+obj.toJSONString());
+		return obj;
+	}
+	
+	/**
+	 * 生成JsonSchema 用于子对象
+	 * @param title 子对象描述
+	 * @param requiredArr 子对象必填属性名集合
+	 * @param propertyList 子对象属性集合
+	 * @return
+	 */
+	public static JSONObject getSubJsonSchema(String title,List<String> requiredArr,List<CommonProperty> propertyList) {
+		JSONObject obj = new JSONObject();
+		obj.put("type", "object");
+		obj.put("view", "tab");
+		obj.put("title", title);
+
+		if(requiredArr==null) {
+			requiredArr = new ArrayList<String>();
+		}
+		obj.put("required", requiredArr);
+
+		JSONObject properties = new JSONObject();
+		for (CommonProperty commonProperty : propertyList) {
+			Map<String, Object> map = commonProperty.getPropertyJson();
+			properties.put(map.get("key").toString(), map.get("prop"));
+		}
+		obj.put("properties", properties);
+		//log.info("---JSONSchema--->"+obj.toString());
+		return obj;
+	}
+
+}

+ 61 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/DictProperty.java

@@ -0,0 +1,61 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 字典属性
+ * @author 86729
+ *
+ */
+@Data
+public class DictProperty extends CommonProperty {
+
+	private static final long serialVersionUID = 3786503639885610767L;
+
+    /**
+     * 字典三属性
+     */
+
+	private String dictCode;
+	private String dictTable;
+	private String dictText;
+
+	public DictProperty() {}
+	/**
+	 *  构造器
+	 */
+	public DictProperty(String key,String title,String dictTable,String dictCode,String dictText) {
+		this.type = "string";
+		this.view = "sel_search";
+		this.key = key;
+		this.title = title;
+		this.dictCode = dictCode;
+		this.dictTable= dictTable;
+		this.dictText= dictText;
+	}
+	
+	@Override
+	public Map<String, Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		if(dictCode!=null) {
+			prop.put("dictCode",dictCode);
+		}
+		if(dictTable!=null) {
+			prop.put("dictTable",dictTable);
+		}
+		if(dictText!=null) {
+			prop.put("dictText",dictText);
+		}
+		map.put("prop",prop);
+		return map;
+	}
+
+	//TODO 重构问题:数据字典 只是字符串类的还是有存储的数值类型?只有字符串请跳过这个 只改前端
+}

+ 37 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/HiddenProperty.java

@@ -0,0 +1,37 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 字典属性
+ * @author 86729
+ *
+ */
+public class HiddenProperty extends CommonProperty {
+	
+	private static final long serialVersionUID = -8939298551502162479L;
+	
+	public HiddenProperty() {}
+	
+	public HiddenProperty(String key,String title) {
+		this.type = "string";
+		this.view = "hidden";
+		this.key = key;
+		this.title = title;
+	}
+	
+	@Override
+	public Map<String, Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		prop.put("hidden",true);
+		map.put("prop",prop);
+		return map;
+	}
+
+}

+ 66 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/LinkDownProperty.java

@@ -0,0 +1,66 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.jsonschema.BaseColumn;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 级联下拉
+ */
+public class LinkDownProperty extends CommonProperty {
+
+    /**
+     * 配置信息
+     */
+    String dictTable;
+
+    /**
+     * 级联下拉组件 的其他级联列
+     */
+    List<BaseColumn> otherColumns;
+
+    public String getDictTable(){
+        return this.dictTable;
+    }
+
+    public void setDictTable(String dictTable){
+        this.dictTable = dictTable;
+    }
+
+    public List<BaseColumn> getOtherColumns(){
+        return this.otherColumns;
+    }
+
+    public void setOtherColumns(List<BaseColumn> otherColumns){
+        this.otherColumns = otherColumns;
+    }
+
+    public LinkDownProperty() {}
+
+    /**
+     *  构造器
+     */
+    public LinkDownProperty(String key,String title,String dictTable) {
+        this.type = "string";
+        this.view = "link_down";
+        this.key = key;
+        this.title = title;
+        this.dictTable= dictTable;
+    }
+
+    @Override
+    public Map<String, Object> getPropertyJson() {
+        Map<String, Object> map = new HashMap<>();
+        map.put("key", getKey());
+        JSONObject prop = getCommonJson();
+        JSONObject temp = JSONObject.parseObject(this.dictTable);
+        prop.put("config", temp);
+        prop.put("others", otherColumns);
+        map.put("prop", prop);
+        return map;
+    }
+}

+ 152 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/NumberProperty.java

@@ -0,0 +1,152 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.system.vo.DictModel;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NumberProperty extends CommonProperty {
+
+	private static final long serialVersionUID = -558615331436437200L;
+	
+	/**
+	 * 倍数
+	 * 验证实例是否为此数值的倍数
+	 * “multipleOf”的值必须是一个数字,严格大于0。
+	 */
+	private Integer multipleOf;
+	
+	/**
+	 * 小于等于
+	 * “maximum”的值必须是一个数字,表示数字实例的包含上限。
+	 *	如果实例是数字,则仅当实例小于或等于“最大”时,此关键字才会生效。
+	 */
+	private Integer maxinum;
+	
+	/**
+	 * 小于
+	 * “exclusiveMaximum”的值必须是数字,表示数字实例的独占上限。
+     * 如果实例是数字,则实例仅在其值严格小于(不等于)“exclusiveMaximum”时才有效。
+	 */
+	private Integer exclusiveMaximum;
+	
+	/**
+	 * 大于等于
+	 */
+	private Integer minimum;
+	
+	/**
+	 * 大于等于
+	 */
+	private Integer exclusiveMinimum;
+	
+	private String pattern;
+
+	public Integer getMultipleOf() {
+		return multipleOf;
+	}
+
+	public void setMultipleOf(Integer multipleOf) {
+		this.multipleOf = multipleOf;
+	}
+
+	public Integer getMaxinum() {
+		return maxinum;
+	}
+
+	public void setMaxinum(Integer maxinum) {
+		this.maxinum = maxinum;
+	}
+
+	public Integer getExclusiveMaximum() {
+		return exclusiveMaximum;
+	}
+
+	public void setExclusiveMaximum(Integer exclusiveMaximum) {
+		this.exclusiveMaximum = exclusiveMaximum;
+	}
+
+	public Integer getMinimum() {
+		return minimum;
+	}
+
+	public void setMinimum(Integer minimum) {
+		this.minimum = minimum;
+	}
+
+	public Integer getExclusiveMinimum() {
+		return exclusiveMinimum;
+	}
+
+	public void setExclusiveMinimum(Integer exclusiveMinimum) {
+		this.exclusiveMinimum = exclusiveMinimum;
+	}
+	
+	public String getPattern() {
+		return pattern;
+	}
+
+	public void setPattern(String pattern) {
+		this.pattern = pattern;
+	}
+
+	public NumberProperty() {}
+	
+	/**
+	  *  构造器
+	 * @param key 字段名
+	 * @param title 字段备注 
+	 * @param type number和integer
+	 */
+	public NumberProperty(String key,String title,String type) {
+		this.key = key;
+		this.type = type;
+		this.title = title;
+		this.view = "number";
+	}
+	
+	/**
+	  * 列表类型的走这个构造器  字典里存储的都是字符串 没法走这个构造器
+	 * @param key
+	 * @param type
+	 * @param view list-checkbox-radio
+	 * @param include
+	 */
+	public NumberProperty(String key,String title,String view,List<DictModel> include) {
+		this.type = "integer";
+		this.key = key;
+		this.view = view;
+		this.title = title;
+		this.include = include;
+	}
+	
+	@Override
+	public Map<String,Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		if(multipleOf!=null) {
+			prop.put("multipleOf",multipleOf);
+		}
+		if(maxinum!=null) {
+			prop.put("maxinum",maxinum);
+		}
+		if(exclusiveMaximum!=null) {
+			prop.put("exclusiveMaximum",exclusiveMaximum);
+		}
+		if(minimum!=null) {
+			prop.put("minimum",minimum);
+		}
+		if(exclusiveMinimum!=null) {
+			prop.put("exclusiveMinimum",exclusiveMinimum);
+		}
+		if(pattern!=null) {
+			prop.put("pattern",pattern);
+		}
+		map.put("prop",prop);
+		return map;
+	}
+}

+ 74 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/PopupProperty.java

@@ -0,0 +1,74 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class PopupProperty extends CommonProperty {
+	
+	private static final long serialVersionUID = -3200493311633999539L;
+	
+	private String code;
+	
+	private String destFields;
+	
+	private String orgFields;
+	
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getDestFields() {
+		return destFields;
+	}
+
+	public void setDestFields(String destFields) {
+		this.destFields = destFields;
+	}
+
+	public String getOrgFields() {
+		return orgFields;
+	}
+
+	public void setOrgFields(String orgFields) {
+		this.orgFields = orgFields;
+	}
+
+	public PopupProperty() {}
+	
+	public PopupProperty(String key,String title,String code,String destFields,String orgFields) {
+		this.view = "popup";
+		this.type = "string";
+		this.key = key;
+		this.title = title;
+		this.code = code;
+		this.destFields=destFields;
+		this.orgFields=orgFields;
+	}
+	
+
+	@Override
+	public Map<String, Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		if(code!=null) {
+			prop.put("code",code);
+		}
+		if(destFields!=null) {
+			prop.put("destFields",destFields);
+		}
+		if(orgFields!=null) {
+			prop.put("orgFields",orgFields);
+		}
+		map.put("prop",prop);
+		return map;
+	}
+
+}

+ 118 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/StringProperty.java

@@ -0,0 +1,118 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.system.vo.DictModel;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class StringProperty extends CommonProperty {
+	
+	private static final long serialVersionUID = -3200493311633999539L;
+	
+	private Integer maxLength;
+	
+	private Integer minLength;
+	
+	/**
+	 * 根据ECMA 262正则表达式方言,该字符串应该是有效的正则表达式。
+	 */
+	private String pattern;
+	
+	/**
+	 * 错误提示信息
+	 */
+	private String errorInfo;
+	
+	public Integer getMaxLength() {
+		return maxLength;
+	}
+
+
+	public void setMaxLength(Integer maxLength) {
+		this.maxLength = maxLength;
+	}
+
+	public Integer getMinLength() {
+		return minLength;
+	}
+
+	public void setMinLength(Integer minLength) {
+		this.minLength = minLength;
+	}
+
+	public String getPattern() {
+		return pattern;
+	}
+
+	public void setPattern(String pattern) {
+		this.pattern = pattern;
+	}
+	
+	public String getErrorInfo() {
+		return errorInfo;
+	}
+
+
+	public void setErrorInfo(String errorInfo) {
+		this.errorInfo = errorInfo;
+	}
+
+
+	public StringProperty() {}
+	
+	/**
+	 *  一般字符串类型走这个构造器
+	 * @param key 字段名
+	 * @param title 字段备注
+	 * @param view 展示控件
+	 * @param maxLength 数据库字段最大长度
+	 */
+	public StringProperty(String key,String title,String view,Integer maxLength) {
+		this.maxLength = maxLength;
+		this.key = key;
+		this.view = view;
+		this.title = title;
+		this.type = "string";
+	}
+	
+	/**
+         *  列表类型的走这个构造器  
+	 * @param key 字段名
+	 * @param title 字段备注 
+	 * @param view 展示控件 list-checkbox-radio
+	 * @param maxLength 数据库字段最大长度
+	 * @param include 数据字典
+	 */
+	public StringProperty(String key,String title,String view,Integer maxLength,List<DictModel> include) {
+		this.maxLength = maxLength;
+		this.key = key;
+		this.view = view;
+		this.title = title;
+		this.type = "string";
+		this.include = include;
+	}
+	@Override
+	public Map<String, Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		if(maxLength!=null) {
+			prop.put("maxLength",maxLength);
+		}
+		if(minLength!=null) {
+			prop.put("minLength",minLength);
+		}
+		if(pattern!=null) {
+			prop.put("pattern",pattern);
+		}
+		if(errorInfo!=null) {
+			prop.put("errorInfo",errorInfo);
+		}
+		map.put("prop",prop);
+		return map;
+	}
+
+}

+ 46 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/SwitchProperty.java

@@ -0,0 +1,46 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 开关 属性
+ */
+public class SwitchProperty extends CommonProperty {
+
+	//扩展参数配置信息
+	private String extendStr;
+
+	public SwitchProperty() {}
+
+	/**
+	 *  构造器
+	 */
+	public SwitchProperty(String key, String title, String extendStr) {
+		this.type = "string";
+		this.view = "switch";
+		this.key = key;
+		this.title = title;
+		this.extendStr = extendStr;
+	}
+	
+	@Override
+	public Map<String, Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		JSONArray array = new JSONArray();
+		if(extendStr!=null) {
+			array = JSONArray.parseArray(extendStr);
+			prop.put("extendOption",array);
+		}
+		map.put("prop",prop);
+		return map;
+	}
+
+	//TODO 重构问题:数据字典 只是字符串类的还是有存储的数值类型?只有字符串请跳过这个 只改前端
+}

+ 145 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/jsonschema/validate/TreeSelectProperty.java

@@ -0,0 +1,145 @@
+package org.jeecg.common.util.jsonschema.validate;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.jsonschema.CommonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 字典属性
+ * @author 86729
+ *
+ */
+public class TreeSelectProperty extends CommonProperty {
+	
+	private static final long serialVersionUID = 3786503639885610767L;
+
+	private String dict;//表名,文本,id
+	private String pidField;//父级字段 默认pid
+	private String pidValue;//父级节点的值 暂时没用到 默认为0
+	private String hasChildField;
+	private String textField;//树形下拉保存text值的字段名
+
+	/**
+	 * 是不是pid 组件 1是 0否
+	 */
+	private Integer pidComponent = 0;
+	
+	public String getDict() {
+		return dict;
+	}
+
+	public void setDict(String dict) {
+		this.dict = dict;
+	}
+
+	public String getPidField() {
+		return pidField;
+	}
+
+	public void setPidField(String pidField) {
+		this.pidField = pidField;
+	}
+
+	public String getPidValue() {
+		return pidValue;
+	}
+
+	public void setPidValue(String pidValue) {
+		this.pidValue = pidValue;
+	}
+	
+	public String getHasChildField() {
+		return hasChildField;
+	}
+
+	public void setHasChildField(String hasChildField) {
+		this.hasChildField = hasChildField;
+	}
+
+	public TreeSelectProperty() {}
+
+	public String getTextField() {
+		return textField;
+	}
+
+	public void setTextField(String textField) {
+		this.textField = textField;
+	}
+
+	public Integer getPidComponent() {
+		return pidComponent;
+	}
+
+	public void setPidComponent(Integer pidComponent) {
+		this.pidComponent = pidComponent;
+	}
+
+	/**
+	 *  构造器 构造普通树形下拉
+	 */
+	public TreeSelectProperty(String key,String title,String dict,String pidField,String pidValue) {
+		this.type = "string";
+		this.view = "sel_tree";
+		this.key = key;
+		this.title = title;
+		this.dict = dict;
+		this.pidField= pidField;
+		this.pidValue= pidValue;
+	}
+
+	/**
+	 * 分类字典下拉专用
+	 * @param key
+	 * @param title
+	 * @param pidValue
+	 */
+	public TreeSelectProperty(String key,String title,String pidValue) {
+		this.type = "string";
+		this.view = "cat_tree";
+		this.key = key;
+		this.title = title;
+		this.pidValue = pidValue;
+	}
+
+	/**
+	 * 分类字典 支持存储text 下拉专用
+	 * @param key
+	 * @param title
+	 * @param pidValue
+	 * @param textField
+	 */
+	public TreeSelectProperty(String key,String title,String pidValue,String textField) {
+		this(key,title,pidValue);
+		this.textField = textField;
+	}
+	
+	@Override
+	public Map<String, Object> getPropertyJson() {
+		Map<String,Object> map = new HashMap<>();
+		map.put("key",getKey());
+		JSONObject prop = getCommonJson();
+		if(dict!=null) {
+			prop.put("dict",dict);
+		}
+		if(pidField!=null) {
+			prop.put("pidField",pidField);
+		}
+		if(pidValue!=null) {
+			prop.put("pidValue",pidValue);
+		}
+		if(textField!=null) {
+			prop.put("textField",textField);
+		}
+		if(hasChildField!=null) {
+			prop.put("hasChildField",hasChildField);
+		}
+		if(pidComponent!=null) {
+			prop.put("pidComponent",pidComponent);
+		}
+		map.put("prop",prop);
+		return map;
+	}
+
+}

+ 13 - 15
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oss/OssBootUtil.java

@@ -286,20 +286,6 @@ public class OssBootUtil {
         return null;
     }
 
-    /**
-     * 初始化 oss 客户端
-     *
-     * @return
-     */
-    private static OSSClient initOSS(String endpoint, String accessKeyId, String accessKeySecret) {
-        if (ossClient == null) {
-            ossClient = new OSSClient(endpoint,
-                    new DefaultCredentialProvider(accessKeyId, accessKeySecret),
-                    new ClientConfiguration());
-        }
-        return ossClient;
-    }
-
 
     /**
      * 上传文件到oss
@@ -325,5 +311,17 @@ public class OssBootUtil {
         return FILE_URL;
     }
 
-
+    /**
+     * 初始化 oss 客户端
+     *
+     * @return
+     */
+    private static OSSClient initOSS(String endpoint, String accessKeyId, String accessKeySecret) {
+        if (ossClient == null) {
+            ossClient = new OSSClient(endpoint,
+                    new DefaultCredentialProvider(accessKeyId, accessKeySecret),
+                    new ClientConfiguration());
+        }
+        return ossClient;
+    }
 }

+ 0 - 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusConfig.java

@@ -141,8 +141,6 @@ public class MybatisPlusConfig {
 //        return new PerformanceInterceptor();
 //    }
 
-
-
     @Bean
     ConfigurationCustomizer mybatisConfigurationCustomizer() {
         return new ConfigurationCustomizer() {

+ 152 - 99
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -50,101 +50,180 @@ public class ShiroConfig {
     @Autowired
     private Environment env;
 
+    @Value("${spring.redis.port}")
+    private String port;
+
+    @Value("${spring.redis.host}")
+    private String host;
+
+    @Value("${spring.redis.password}")
+    private String redisPassword;
 
     /**
      * Filter Chain定义说明
-     *
+     * <p>
      * 1、一个URL可以配置多个Filter,使用逗号分隔
      * 2、当设置多个过滤器时,全部验证通过,才视为通过
      * 3、部分过滤器可指定参数,如perms,roles
      */
     @Bean("shiroFilter")
     public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
-        CustomShiroFilterFactoryBean shiroFilterFactoryBean = new CustomShiroFilterFactoryBean();
+        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
         shiroFilterFactoryBean.setSecurityManager(securityManager);
         // 拦截器
-        Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
-        if(oConvertUtils.isNotEmpty(excludeUrls)){
-            String[] permissionUrl = excludeUrls.split(",");
-            for(String url : permissionUrl){
-                filterChainDefinitionMap.put(url,"anon");
-            }
-        }
+        Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
         // 配置不会被拦截的链接 顺序判断
-        filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录
-        filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除
-        filterChainDefinitionMap.put("/sys/checkCaptcha", "anon"); //登录验证码接口排除
-        filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除
-        filterChainDefinitionMap.put("/sys/mLogin", "anon"); //登录接口排除
-        filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除
-        filterChainDefinitionMap.put("/sys/thirdLogin/**", "anon"); //第三方登录
-        filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串
-        filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码
-        filterChainDefinitionMap.put("/sys/phoneLogin", "anon");//手机登录
-        filterChainDefinitionMap.put("/sys/user/checkOnlyUser", "anon");//校验用户是否存在
-        filterChainDefinitionMap.put("/sys/user/register", "anon");//用户注册
-        filterChainDefinitionMap.put("/sys/user/querySysUser", "anon");//根据手机号获取用户信息
-        filterChainDefinitionMap.put("/sys/user/phoneVerification", "anon");//用户忘记密码验证手机号
-        filterChainDefinitionMap.put("/sys/user/passwordChange", "anon");//用户更改密码
-        filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码
-        filterChainDefinitionMap.put("/sys/common/static/**", "anon");//图片预览 &下载文件不限制token
-        filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览
-        filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
+        //登录接口排除
+        filterChainDefinitionMap.put("/sys/mLogin", "anon");
+        filterChainDefinitionMap.put("/sys/login", "anon");
+        filterChainDefinitionMap.put("/sys/wxlogin", "anon");
+        filterChainDefinitionMap.put("/ctop/rule/**", "anon");
+        //第三方登录
+        filterChainDefinitionMap.put("/thirdLogin/**", "anon");
+        //获取加密串
+        filterChainDefinitionMap.put("/sys/getEncryptedString", "anon");
+        //短信验证码
+        filterChainDefinitionMap.put("/sys/sms", "anon");
+        //手机登录
+        filterChainDefinitionMap.put("/sys/phoneLogin", "anon");
+        //校验用户是否存在
+        filterChainDefinitionMap.put("/sys/user/checkOnlyUser", "anon");
+        //用户注册
+        filterChainDefinitionMap.put("/sys/user/register", "anon");
+        //根据手机号获取用户信息
+        filterChainDefinitionMap.put("/sys/user/querySysUser", "anon");
+        //用户忘记密码验证手机号
+        filterChainDefinitionMap.put("/sys/user/phoneVerification", "anon");
+        //用户更改密码
+        filterChainDefinitionMap.put("/sys/user/passwordChange", "anon");
+        //登录验证码
+        filterChainDefinitionMap.put("/auth/2step-code", "anon");
+        //图片预览不限制token
+        filterChainDefinitionMap.put("/sys/common/view/**", "anon");
+        //文件下载不限制token
+        filterChainDefinitionMap.put("/sys/common/download/**", "anon");
+        //pdf预览
+        filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");
+        filterChainDefinitionMap.put("/ctop/bytedanceAreaInfo/**", "anon");
+        filterChainDefinitionMap.put("/ctop/bytedanceInterestCategory/**", "anon");
+        filterChainDefinitionMap.put("/template/creative/words/get", "anon");
+        filterChainDefinitionMap.put("template/bytedance/industry/list", "anon");
+        //积木报表排除
+        filterChainDefinitionMap.put("/jmreport/**", "anon");
+        filterChainDefinitionMap.put("/**/*.js.map", "anon");
+        filterChainDefinitionMap.put("/**/*.css.map", "anon");
+        filterChainDefinitionMap.put("/bytedance/batch/creative/words/get", "anon");
+        filterChainDefinitionMap.put("/bytedance/batch/action/text", "anon");
+        filterChainDefinitionMap.put("/bytedance/batch/industry/list", "anon");
+        filterChainDefinitionMap.put("/appium/crawler/*", "anon");
+
+        filterChainDefinitionMap.put("/ctop/kuaishouChannelRegInfo/*", "anon");
+        filterChainDefinitionMap.put("/ctop/byteDance/homePage/report/*", "anon");
+        filterChainDefinitionMap.put("/ctop/material/top/cost", "anon");
+        filterChainDefinitionMap.put("/dimension/report/*", "anon");
+        filterChainDefinitionMap.put("/userAllocation/updateAuthName", "anon");
+
+        filterChainDefinitionMap.put("/v1/**", "anon");
+
+        filterChainDefinitionMap.put("/generic/**", "anon");
         filterChainDefinitionMap.put("/", "anon");
         filterChainDefinitionMap.put("/doc.html", "anon");
         filterChainDefinitionMap.put("/**/*.js", "anon");
         filterChainDefinitionMap.put("/**/*.css", "anon");
         filterChainDefinitionMap.put("/**/*.html", "anon");
         filterChainDefinitionMap.put("/**/*.svg", "anon");
-        filterChainDefinitionMap.put("/**/*.pdf", "anon");
         filterChainDefinitionMap.put("/**/*.jpg", "anon");
         filterChainDefinitionMap.put("/**/*.png", "anon");
         filterChainDefinitionMap.put("/**/*.ico", "anon");
-
-        filterChainDefinitionMap.put("/**/*.ttf", "anon");
-        filterChainDefinitionMap.put("/**/*.woff", "anon");
-        filterChainDefinitionMap.put("/**/*.woff2", "anon");
-
         filterChainDefinitionMap.put("/druid/**", "anon");
         filterChainDefinitionMap.put("/swagger-ui.html", "anon");
         filterChainDefinitionMap.put("/swagger**/**", "anon");
         filterChainDefinitionMap.put("/webjars/**", "anon");
         filterChainDefinitionMap.put("/v2/**", "anon");
-
-
-        // update-begin--Author:sunjianlei Date:20210510 for:排除消息通告查看详情页面(用于第三方APP)
-        filterChainDefinitionMap.put("/sys/annountCement/show/**", "anon");
-        // update-end--Author:sunjianlei Date:20210510 for:排除消息通告查看详情页面(用于第三方APP)
-
-        //积木报表排除
-        filterChainDefinitionMap.put("/jmreport/**", "anon");
-        filterChainDefinitionMap.put("/**/*.js.map", "anon");
-        filterChainDefinitionMap.put("/**/*.css.map", "anon");
+        filterChainDefinitionMap.put("/kuaishou", "anon");
+        filterChainDefinitionMap.put("/kuaishou/report", "anon");
+        filterChainDefinitionMap.put("/ctop/bindAccount/**", "anon");
+        filterChainDefinitionMap.put("/**/*.mp4", "anon");
+        //activiti
+        filterChainDefinitionMap.put("/activiti/**", "anon");
+        filterChainDefinitionMap.put("/diagram-viewer/**", "anon");
+        filterChainDefinitionMap.put("/editor-app/**", "anon");
         //大屏设计器排除
-        filterChainDefinitionMap.put("/bigscreen/**", "anon");
+        filterChainDefinitionMap.put("/big/screen/**", "anon");
 
-        //测试示例
-        filterChainDefinitionMap.put("/test/order/**", "anon");
-        filterChainDefinitionMap.put("/test/bigScreen/**", "anon"); //大屏模板例子
-        //filterChainDefinitionMap.put("/test/jeecgDemo/rabbitMqClientTest/**", "anon"); //MQ测试
-        //filterChainDefinitionMap.put("/test/jeecgDemo/html", "anon"); //模板页面
-        //filterChainDefinitionMap.put("/test/jeecgDemo/redis/**", "anon"); //redis测试
+        //性能监控
+        filterChainDefinitionMap.put("/actuator/metrics/**", "anon");
+        filterChainDefinitionMap.put("/actuator/httptrace/**", "anon");
+        filterChainDefinitionMap.put("/actuator/redis/**", "anon");
+        //消息队列
+        filterChainDefinitionMap.put("/mq/**", "anon");
+        //模板测试
+        filterChainDefinitionMap.put("/test/**", "anon");
+        //oauth接口
+        filterChainDefinitionMap.put("/auth/**", "anon");
+        filterChainDefinitionMap.put("/ctop/syncdata/**", "anon");
+        filterChainDefinitionMap.put("/sys/dictItem/list", "anon");
+        //头条接口
+        filterChainDefinitionMap.put("/bytedance", "anon");
+        filterChainDefinitionMap.put("/toutiao/loadAllData", "anon");
+        filterChainDefinitionMap.put("/toutiao/loadSingleData", "anon");
+        filterChainDefinitionMap.put("/kuaishou/getReport/historyData", "anon");
+        filterChainDefinitionMap.put("/toutiao/advertiser/**", "anon");
+        filterChainDefinitionMap.put("/template/convert/**", "anon");
+        filterChainDefinitionMap.put("/upload/**", "anon");
+        filterChainDefinitionMap.put("/appium/appiumTask/run", "anon");
 
-        //websocket排除
-        filterChainDefinitionMap.put("/websocket/**", "anon");//系统通知和公告
-        filterChainDefinitionMap.put("/newsWebsocket/**", "anon");//CMS模块
-        filterChainDefinitionMap.put("/vxeSocket/**", "anon");//JVxeTable无痕刷新示例
-        //
-        filterChainDefinitionMap.put("/advertiser/aiBytedanceAdvertiserStrategy/**", "anon");
+        filterChainDefinitionMap.put("/system/userCompany/**", "anon");
+        filterChainDefinitionMap.put("/qywexin", "anon");
+        filterChainDefinitionMap.put("/sys/feishu/**", "anon");
+        filterChainDefinitionMap.put("/test/getGroupData/**", "anon");
+        filterChainDefinitionMap.put("/test/getVideoAndImage/**", "anon");
+        filterChainDefinitionMap.put("/test/gerCreative/**", "anon");
+        filterChainDefinitionMap.put("/test/testdouyinmusic", "anon");
+        filterChainDefinitionMap.put("/test/syncDouyinMusic", "anon");
+        filterChainDefinitionMap.put("/test/parseDouyinMusic", "anon");
+        filterChainDefinitionMap.put("/report/kuaishouReportDailyAgent/get", "anon");
 
-        //性能监控  TODO 存在安全漏洞泄露TOEKN(durid连接池也有)
-        filterChainDefinitionMap.put("/actuator/**", "anon");
+        filterChainDefinitionMap.put("/appium/appiumTask/run/login", "anon");
+        filterChainDefinitionMap.put("/zip/download", "anon");
+        //WebSocket
+        filterChainDefinitionMap.put("/websocket/*", "anon");
+        //爬虫接口
+        filterChainDefinitionMap.put("/graphql/video", "anon");
+        filterChainDefinitionMap.put("/ks/web/test", "anon");
+        filterChainDefinitionMap.put("/ureport/**", "anon");
+        filterChainDefinitionMap.put("/job/test/*", "anon");
+        filterChainDefinitionMap.put("/third/*", "anon");
+        filterChainDefinitionMap.put("/ctop/kuaishou/dailyPage/**", "anon");
+        filterChainDefinitionMap.put("/rest/script/*", "anon");
+        filterChainDefinitionMap.put("/ctop/checkTaskList/*", "anon");
+        filterChainDefinitionMap.put("/ctop/report/bytedance/*", "anon");
+        filterChainDefinitionMap.put("/shiwan/shiwanFileUpload/*", "anon");
+        filterChainDefinitionMap.put("/oa/wechatNoList/*", "anon");
+        filterChainDefinitionMap.put("/ruleGroup/*", "anon");
+        filterChainDefinitionMap.put("/kuaishou/material/*", "anon");
+        filterChainDefinitionMap.put("/kuaishou/create/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchCreativeTemplate/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchGroupTemplate/*", "anon");
+        filterChainDefinitionMap.put("/template/kuaiShouBatchCampaignTemplate/*", "anon");
+        filterChainDefinitionMap.put("/template/**", "anon");
+        filterChainDefinitionMap.put("/batch/kuaiShouGroupTemplate/*", "anon");
+        filterChainDefinitionMap.put("/kuaishouBatch/**", "anon");
+        filterChainDefinitionMap.put("/kuaishou/creative/*", "anon");
+        filterChainDefinitionMap.put("/ai/aiKuaiShouAppInfo/*", "anon");
+        filterChainDefinitionMap.put("/explore/*", "anon");
+        filterChainDefinitionMap.put("/ai/batchUpdate/*", "anon");
+        filterChainDefinitionMap.put("/ctop/kuaishou/videoReport/*", "anon");
+        filterChainDefinitionMap.put("/ai/create/*", "anon");
+        //filterChainDefinitionMap.put("/overView/*", "anon");
+        filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
+        filterChainDefinitionMap.put("/kuaishou/batch/*", "anon");
+        filterChainDefinitionMap.put("/dimension/kuaiShouDimensionAccount/*", "anon");
+        filterChainDefinitionMap.put("/ai/projectCreate/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
-        Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
-        //如果cloudServer为空 则说明是单体 需要加载跨域配置
-        Object cloudServer = env.getProperty(CommonConstant.CLOUD_SERVER_KEY);
-        filterMap.put("jwt", new JwtFilter(cloudServer==null));
+        Map<String, Filter> filterMap = new HashMap<>(1);
+        filterMap.put("jwt", new JwtFilter());
         shiroFilterFactoryBean.setFilters(filterMap);
         // <!-- 过滤链定义,从上向下顺序执行,一般将/**放在最为下边
         filterChainDefinitionMap.put("/**", "jwt");
@@ -171,13 +250,13 @@ public class ShiroConfig {
         defaultSessionStorageEvaluator.setSessionStorageEnabled(false);
         subjectDAO.setSessionStorageEvaluator(defaultSessionStorageEvaluator);
         securityManager.setSubjectDAO(subjectDAO);
-        //自定义缓存实现,使用redis
-        securityManager.setCacheManager(redisCacheManager());
+
         return securityManager;
     }
 
     /**
      * 下面的代码是添加注解支持
+     *
      * @return
      */
     @Bean
@@ -213,7 +292,6 @@ public class ShiroConfig {
      * @return
      */
     public RedisCacheManager redisCacheManager() {
-        log.info("===============(1)创建缓存管理器RedisCacheManager");
         RedisCacheManager redisCacheManager = new RedisCacheManager();
         redisCacheManager.setRedisManager(redisManager());
         //redis中针对不同用户缓存(此处的id需要对应user实体中的id字段,用于唯一标识)
@@ -230,39 +308,14 @@ public class ShiroConfig {
      * @return
      */
     @Bean
-    public IRedisManager redisManager() {
-        log.info("===============(2)创建RedisManager,连接Redis..");
-        IRedisManager manager;
-        // redis 单机支持,在集群为空,或者集群无机器时候使用 add by jzyadmin@163.com
-        if (lettuceConnectionFactory.getClusterConfiguration() == null || lettuceConnectionFactory.getClusterConfiguration().getClusterNodes().isEmpty()) {
-            RedisManager redisManager = new RedisManager();
-            redisManager.setHost(lettuceConnectionFactory.getHostName());
-            redisManager.setPort(lettuceConnectionFactory.getPort());
-            redisManager.setDatabase(lettuceConnectionFactory.getDatabase());
-            redisManager.setTimeout(0);
-            if (!StringUtils.isEmpty(lettuceConnectionFactory.getPassword())) {
-                redisManager.setPassword(lettuceConnectionFactory.getPassword());
-            }
-            manager = redisManager;
-        }else{
-            // redis集群支持,优先使用集群配置
-            RedisClusterManager redisManager = new RedisClusterManager();
-            Set<HostAndPort> portSet = new HashSet<>();
-            lettuceConnectionFactory.getClusterConfiguration().getClusterNodes().forEach(node -> portSet.add(new HostAndPort(node.getHost() , node.getPort())));
-            //update-begin--Author:scott Date:20210531 for:修改集群模式下未设置redis密码的bug issues/I3QNIC
-            if (oConvertUtils.isNotEmpty(lettuceConnectionFactory.getPassword())) {
-                JedisCluster jedisCluster = new JedisCluster(portSet, 2000, 2000, 5,
-                    lettuceConnectionFactory.getPassword(), new GenericObjectPoolConfig());
-                redisManager.setPassword(lettuceConnectionFactory.getPassword());
-                redisManager.setJedisCluster(jedisCluster);
-            } else {
-                JedisCluster jedisCluster = new JedisCluster(portSet);
-                redisManager.setJedisCluster(jedisCluster);
-            }
-            //update-end--Author:scott Date:20210531 for:修改集群模式下未设置redis密码的bug issues/I3QNIC
-            manager = redisManager;
+    public RedisManager redisManager() {
+        RedisManager redisManager = new RedisManager();
+        redisManager.setHost(host);
+        redisManager.setPort(oConvertUtils.getInt(port));
+        redisManager.setTimeout(0);
+        if (!StringUtils.isEmpty(redisPassword)) {
+            redisManager.setPassword(redisPassword);
         }
-        return manager;
+        return redisManager;
     }
-
 }

+ 2 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/mapper/BaseCommonMapper.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.base.mapper;
 import com.baomidou.mybatisplus.annotation.SqlParser;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.common.api.dto.LogDTO;
+import org.jeecg.common.system.entity.SysDataSource;
 
 public interface BaseCommonMapper {
 
@@ -13,4 +14,5 @@ public interface BaseCommonMapper {
     @SqlParser(filter=true)
     void saveLog(@Param("dto")LogDTO dto);
 
+    SysDataSource getDateSourceByCode(@Param("dto")String dbSourceCode);
 }

+ 3 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/mapper/xml/BaseCommonMapper.xml

@@ -19,5 +19,8 @@
             #{dto.createTime,jdbcType=TIMESTAMP}
         )
     </insert>
+    <select id="getDateSourceByCode" resultType="org.jeecg.common.system.entity.SysDataSource">
+        select * from sys_data_source where code = #{dbSourceCode} limit 1
+    </select>
 
 </mapper>

+ 2 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/BaseCommonService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.base.service;
 
 import org.jeecg.common.api.dto.LogDTO;
+import org.jeecg.common.system.vo.DynamicDataSourceModel;
 import org.jeecg.common.system.vo.LoginUser;
 
 /**
@@ -31,4 +32,5 @@ public interface BaseCommonService {
      */
     void addLog(String LogContent, Integer logType, Integer operateType);
 
+    DynamicDataSourceModel getDynamicDbSourceByCode(String dbKey);
 }

+ 8 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/service/impl/BaseCommonServiceImpl.java

@@ -1,9 +1,12 @@
 package org.jeecg.modules.base.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.dto.LogDTO;
+import org.jeecg.common.system.entity.SysDataSource;
+import org.jeecg.common.system.vo.DynamicDataSourceModel;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.IPUtils;
 import org.jeecg.common.util.SpringContextUtils;
@@ -80,6 +83,11 @@ public class BaseCommonServiceImpl implements BaseCommonService {
         addLog(logContent, logType, operateType, null);
     }
 
+    @Override
+    public DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode) {
+        SysDataSource dbSource = baseCommonMapper.getDateSourceByCode(dbSourceCode);
+        return new DynamicDataSourceModel(dbSource);
+    }
 
 
 }

+ 2 - 0
jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/constant/CacheConstant.java

@@ -91,4 +91,6 @@ public interface CacheConstant {
 	 * online图表
 	 */
 	public static final String ONLINE_GRAPH = "sys:cache:online:graph";
+
+
 }

+ 22 - 0
jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/modules/redis/config/RedisConfig.java

@@ -15,6 +15,7 @@ import org.jeecg.common.modules.redis.writer.JeecgRedisCacheWriter;
 import org.springframework.cache.CacheManager;
 import org.springframework.cache.annotation.CachingConfigurerSupport;
 import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.interceptor.KeyGenerator;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.cache.RedisCacheConfiguration;
@@ -29,7 +30,9 @@ import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
 import org.springframework.data.redis.serializer.*;
 
 import javax.annotation.Resource;
+import java.lang.reflect.Method;
 import java.time.Duration;
+import java.util.Arrays;
 
 import static java.util.Collections.singletonMap;
 
@@ -157,5 +160,24 @@ public class RedisConfig extends CachingConfigurerSupport {
 		return jackson2JsonRedisSerializer;
 	}
 
+	/**
+	 * @description 自定义的缓存key的生成策略 若想使用这个key
+	 *              只需要讲注解上keyGenerator的值设置为keyGenerator即可</br>
+	 * @return 自定义策略生成的key
+	 */
+	@Override
+	@Bean
+	public KeyGenerator keyGenerator() {
+		return new KeyGenerator() {
+			@Override
+			public Object generate(Object target, Method method, Object... params) {
+				StringBuilder sb = new StringBuilder();
+				sb.append(target.getClass().getName());
+				sb.append(method.getDeclaringClass().getName());
+				Arrays.stream(params).map(Object::toString).forEach(sb::append);
+				return sb.toString();
+			}
+		};
+	}
 
 }

+ 0 - 1
jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/util/RedisUtil.java

@@ -463,7 +463,6 @@ public class RedisUtil {
 	 * 
 	 * @param key   键
 	 * @param value 值
-	 * @param time  时间(秒)
 	 * @return
 	 */
 	public boolean lSet(String key, Object value) {

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/MaterialInfoController.java

@@ -24,7 +24,7 @@ import java.util.List;
 @RequestMapping("/advertiser/materialInfoController")
 @Api(tags="视频素材")
 @Slf4j
-public class MaterialInfoController {
+public class AdvertiserMaterialInfoController {
 	@Autowired
 	private IMaterialInfoService materialInfoService;
 

+ 22 - 8
jeecg-boot-module-system/pom.xml

@@ -55,6 +55,11 @@
 			</exclusions>
 		</dependency>
 		<dependency>
+			<groupId>com.aliyun</groupId>
+			<artifactId>aliyun-java-sdk-mts</artifactId>
+			<version>2.5.2</version>
+		</dependency>
+		<dependency>
 			<groupId>com.alibaba</groupId>
 			<artifactId>easyexcel</artifactId>
 			<version>1.1.2-beat1</version>
@@ -77,13 +82,6 @@
 			<artifactId>commons-lang</artifactId>
 			<version>${commons.version}</version>
 		</dependency>
-
-		<dependency>
-			<groupId>com.bstek.ureport</groupId>
-			<artifactId>ureport2-console</artifactId>
-			<version>2.2.9</version>
-		</dependency>
-
 		<dependency>
 			<groupId>org.codehaus.groovy</groupId>
 			<artifactId>groovy</artifactId>
@@ -163,6 +161,21 @@
 			<groupId>org.jeecgframework.boot</groupId>
 			<artifactId>jeecg-boot-base-tools</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>org.elasticsearch.client</groupId>
+			<artifactId>elasticsearch-rest-high-level-client</artifactId>
+			<version>7.1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.elasticsearch.client</groupId>
+			<artifactId>elasticsearch-rest-client</artifactId>
+			<version>7.1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.elasticsearch</groupId>
+			<artifactId>elasticsearch</artifactId>
+			<version>7.1.0</version>
+		</dependency>
 
 	</dependencies>
 
@@ -174,9 +187,10 @@
 				<includes>
 					<include>**/*.properties</include>
 					<include>**/*.xml</include>
+					<include>**/*.json</include>
 				</includes>
 				<!-- 是否替换资源中的属性-->
-				<filtering>false</filtering>
+				<filtering>true</filtering>
 			</resource>
 			<resource>
 				<directory>src/main/resources</directory>

+ 1 - 9
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventSendController.java

@@ -2,9 +2,7 @@ package cn.com.ctop.alarm.modules.controller;
 
 import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
 import cn.com.ctop.alarm.modules.service.IAlarmEventSendService;
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -15,6 +13,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -60,7 +59,6 @@ public class AlarmEventSendController {
      * @param req
      * @return
      */
-    @AutoLog(value = "预警事件发送表-分页列表查询")
     @ApiOperation(value = "预警事件发送表-分页列表查询", notes = "预警事件发送表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<AlarmEventSend>> queryPageList(AlarmEventSend alarmEventSend,
@@ -76,7 +74,6 @@ public class AlarmEventSendController {
         return result;
     }
 
-    @AutoLog(value = "预警事件发送表-分页列表查询")
     @ApiOperation(value = "预警事件发送表-分页列表查询", notes = "预警事件发送表-分页列表查询")
     @GetMapping(value = "/pageList")
     public Result<Object> queryPageLists(AlarmEventSend alarmEventSend,
@@ -120,7 +117,6 @@ public class AlarmEventSendController {
      * @param alarmEventSend
      * @return
      */
-    @AutoLog(value = "预警事件发送表-添加")
     @ApiOperation(value = "预警事件发送表-添加", notes = "预警事件发送表-添加")
     @PostMapping(value = "/add")
     public Result<AlarmEventSend> add(@RequestBody AlarmEventSend alarmEventSend) {
@@ -141,7 +137,6 @@ public class AlarmEventSendController {
      * @param alarmEventSend
      * @return
      */
-    @AutoLog(value = "预警事件发送表-编辑")
     @ApiOperation(value = "预警事件发送表-编辑", notes = "预警事件发送表-编辑")
     @PutMapping(value = "/edit")
     public Result<AlarmEventSend> edit(@RequestBody AlarmEventSend alarmEventSend) {
@@ -165,7 +160,6 @@ public class AlarmEventSendController {
      * @param id
      * @return
      */
-    @AutoLog(value = "预警事件发送表-通过id删除")
     @ApiOperation(value = "预警事件发送表-通过id删除", notes = "预警事件发送表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -184,7 +178,6 @@ public class AlarmEventSendController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "预警事件发送表-批量删除")
     @ApiOperation(value = "预警事件发送表-批量删除", notes = "预警事件发送表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AlarmEventSend> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -204,7 +197,6 @@ public class AlarmEventSendController {
      * @param id
      * @return
      */
-    @AutoLog(value = "预警事件发送表-通过id查询")
     @ApiOperation(value = "预警事件发送表-通过id查询", notes = "预警事件发送表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AlarmEventSend> queryById(@RequestParam(name = "id", required = true) String id) {

+ 1 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmRuleRecordController.java

@@ -2,8 +2,6 @@ package cn.com.ctop.alarm.modules.controller;
 
 import cn.com.ctop.alarm.modules.entity.AlarmRuleRecord;
 import cn.com.ctop.alarm.modules.service.IAlarmRuleRecordService;
-import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -12,6 +10,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -57,7 +56,6 @@ public class AlarmRuleRecordController {
      * @param req
      * @return
      */
-    @AutoLog(value = "预警规则记录表-分页列表查询")
     @ApiOperation(value = "预警规则记录表-分页列表查询", notes = "预警规则记录表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<AlarmRuleRecord>> queryPageList(AlarmRuleRecord alarmRuleRecord,
@@ -79,7 +77,6 @@ public class AlarmRuleRecordController {
      * @param alarmRuleRecord
      * @return
      */
-    @AutoLog(value = "预警规则记录表-添加")
     @ApiOperation(value = "预警规则记录表-添加", notes = "预警规则记录表-添加")
     @PostMapping(value = "/add")
     public Result<AlarmRuleRecord> add(@RequestBody AlarmRuleRecord alarmRuleRecord) {
@@ -100,7 +97,6 @@ public class AlarmRuleRecordController {
      * @param alarmRuleRecord
      * @return
      */
-    @AutoLog(value = "预警规则记录表-编辑")
     @ApiOperation(value = "预警规则记录表-编辑", notes = "预警规则记录表-编辑")
     @PutMapping(value = "/edit")
     public Result<AlarmRuleRecord> edit(@RequestBody AlarmRuleRecord alarmRuleRecord) {
@@ -124,7 +120,6 @@ public class AlarmRuleRecordController {
      * @param id
      * @return
      */
-    @AutoLog(value = "预警规则记录表-通过id删除")
     @ApiOperation(value = "预警规则记录表-通过id删除", notes = "预警规则记录表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -143,7 +138,6 @@ public class AlarmRuleRecordController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "预警规则记录表-批量删除")
     @ApiOperation(value = "预警规则记录表-批量删除", notes = "预警规则记录表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AlarmRuleRecord> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -163,7 +157,6 @@ public class AlarmRuleRecordController {
      * @param id
      * @return
      */
-    @AutoLog(value = "预警规则记录表-通过id查询")
     @ApiOperation(value = "预警规则记录表-通过id查询", notes = "预警规则记录表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AlarmRuleRecord> queryById(@RequestParam(name = "id", required = true) String id) {

+ 1 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountTemplateController.java

@@ -6,10 +6,8 @@ import cn.com.ctop.alarm.modules.entity.vo.TemplateAppliedVo;
 import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
 import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
 import cn.com.ctop.alarm.modules.service.IRuleTemplateService;
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -22,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -169,7 +168,6 @@ public class RuleAccountTemplateController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则模板-通过id删除")
     @ApiOperation(value = "规则模板-通过id删除", notes = "规则模板-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -198,7 +196,6 @@ public class RuleAccountTemplateController {
      * @param req
      * @return
      */
-    @AutoLog(value = "规则模板-分页列表查询")
     @ApiOperation(value = "规则模板-分页列表查询", notes = "规则模板-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<RuleAccountTemplate>> queryPageList(RuleAccountTemplate ruleAccountTemplate,
@@ -235,7 +232,6 @@ public class RuleAccountTemplateController {
      * @param ruleAccountTemplate
      * @return
      */
-    @AutoLog(value = "规则模板-添加")
     @ApiOperation(value = "规则模板-添加", notes = "规则模板-添加")
     @PostMapping(value = "/add")
     public Result<RuleAccountTemplate> add(@RequestBody RuleAccountTemplate ruleAccountTemplate) {
@@ -256,7 +252,6 @@ public class RuleAccountTemplateController {
      * @param ruleAccountTemplate
      * @return
      */
-    @AutoLog(value = "规则模板-编辑")
     @ApiOperation(value = "规则模板-编辑", notes = "规则模板-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleAccountTemplate> edit(@RequestBody RuleAccountTemplate ruleAccountTemplate) {
@@ -281,7 +276,6 @@ public class RuleAccountTemplateController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "规则模板-批量删除")
     @ApiOperation(value = "规则模板-批量删除", notes = "规则模板-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleAccountTemplate> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -301,7 +295,6 @@ public class RuleAccountTemplateController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则模板-通过id查询")
     @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleAccountTemplate> queryById(@RequestParam(name = "id", required = true) String id) {

+ 1 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleAccountThresholdController.java

@@ -2,9 +2,7 @@ package cn.com.ctop.alarm.modules.controller;
 
 import cn.com.ctop.alarm.modules.entity.RuleAccountThreshold;
 import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -14,6 +12,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -79,7 +78,6 @@ public class RuleAccountThresholdController {
      * @param req
      * @return
      */
-    @AutoLog(value = "规则关联账户 阈值-分页列表查询")
     @ApiOperation(value = "规则关联账户 阈值-分页列表查询", notes = "规则关联账户 阈值-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<RuleAccountThreshold>> queryPageList(RuleAccountThreshold ruleAccountThreshold,
@@ -101,7 +99,6 @@ public class RuleAccountThresholdController {
      * @param ruleAccountThreshold
      * @return
      */
-    @AutoLog(value = "规则关联账户 阈值-添加")
     @ApiOperation(value = "规则关联账户 阈值-添加", notes = "规则关联账户 阈值-添加")
     @PostMapping(value = "/add")
     public Result<RuleAccountThreshold> add(@RequestBody RuleAccountThreshold ruleAccountThreshold) {
@@ -122,7 +119,6 @@ public class RuleAccountThresholdController {
      * @param ruleAccountThreshold
      * @return
      */
-    @AutoLog(value = "规则关联账户 阈值-编辑")
     @ApiOperation(value = "规则关联账户 阈值-编辑", notes = "规则关联账户 阈值-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleAccountThreshold> edit(@RequestBody RuleAccountThreshold ruleAccountThreshold) {
@@ -146,7 +142,6 @@ public class RuleAccountThresholdController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则关联账户 阈值-通过id删除")
     @ApiOperation(value = "规则关联账户 阈值-通过id删除", notes = "规则关联账户 阈值-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -165,7 +160,6 @@ public class RuleAccountThresholdController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "规则关联账户 阈值-批量删除")
     @ApiOperation(value = "规则关联账户 阈值-批量删除", notes = "规则关联账户 阈值-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleAccountThreshold> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -185,7 +179,6 @@ public class RuleAccountThresholdController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则关联账户 阈值-通过id查询")
     @ApiOperation(value = "规则关联账户 阈值-通过id查询", notes = "规则关联账户 阈值-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleAccountThreshold> queryById(@RequestParam(name = "id", required = true) String id) {

+ 2 - 9
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleBaseController.java

@@ -3,8 +3,6 @@ package cn.com.ctop.alarm.modules.controller;
 import cn.com.ctop.alarm.modules.entity.RuleBase;
 import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
 import cn.com.ctop.alarm.modules.service.IRuleBaseService;
-import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -13,6 +11,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -61,7 +60,6 @@ public class RuleBaseController {
      * @param req
      * @return
      */
-    @AutoLog(value = "基础规则-分页列表查询")
     @ApiOperation(value = "基础规则-分页列表查询", notes = "基础规则-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<RuleBase>> queryPageList(RuleBase ruleBase,
@@ -70,7 +68,7 @@ public class RuleBaseController {
                                                  HttpServletRequest req) {
         Result<IPage<RuleBase>> result = new Result<>();
         QueryWrapper<RuleBase> queryWrapper = QueryGenerator.initQueryWrapper(ruleBase, req.getParameterMap());
-        Page<RuleBase> page = new Page<>(pageNo, pageSize);
+        Page<RuleBase> page = new Page<RuleBase>(pageNo, pageSize);
         IPage<RuleBase> pageList = ruleBaseService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -83,7 +81,6 @@ public class RuleBaseController {
      * @param ruleBase
      * @return
      */
-    @AutoLog(value = "基础规则-添加")
     @ApiOperation(value = "基础规则-添加", notes = "基础规则-添加")
     @PostMapping(value = "/add")
     public Result<RuleBase> add(@RequestBody RuleBase ruleBase) {
@@ -104,7 +101,6 @@ public class RuleBaseController {
      * @param ruleBase
      * @return
      */
-    @AutoLog(value = "基础规则-编辑")
     @ApiOperation(value = "基础规则-编辑", notes = "基础规则-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleBase> edit(@RequestBody RuleBase ruleBase) {
@@ -128,7 +124,6 @@ public class RuleBaseController {
      * @param id
      * @return
      */
-    @AutoLog(value = "基础规则-通过id删除")
     @ApiOperation(value = "基础规则-通过id删除", notes = "基础规则-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -152,7 +147,6 @@ public class RuleBaseController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "基础规则-批量删除")
     @ApiOperation(value = "基础规则-批量删除", notes = "基础规则-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleBase> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -172,7 +166,6 @@ public class RuleBaseController {
      * @param id
      * @return
      */
-    @AutoLog(value = "基础规则-通过id查询")
     @ApiOperation(value = "基础规则-通过id查询", notes = "基础规则-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleBase> queryById(@RequestParam(name = "id", required = true) String id) {

+ 4 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleConditionController.java

@@ -2,14 +2,13 @@ package cn.com.ctop.alarm.modules.controller;
 
 import cn.com.ctop.alarm.modules.entity.RuleCondition;
 import cn.com.ctop.alarm.modules.service.IRuleConditionService;
-import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -55,13 +54,12 @@ public class RuleConditionController {
      * @param req
      * @return
      */
-    @AutoLog(value = "规则运算符配置表-分页列表查询")
     @ApiOperation(value = "规则运算符配置表-分页列表查询", notes = "规则运算符配置表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<List<RuleCondition>> queryPageList(RuleCondition ruleCondition,
-                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                     HttpServletRequest req) {
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
         Result<List<RuleCondition>> result = new Result<>();
         QueryWrapper<RuleCondition> queryWrapper = QueryGenerator.initQueryWrapper(ruleCondition, req.getParameterMap());
 
@@ -77,7 +75,6 @@ public class RuleConditionController {
      * @param ruleCondition
      * @return
      */
-    @AutoLog(value = "规则运算符配置表-添加")
     @ApiOperation(value = "规则运算符配置表-添加", notes = "规则运算符配置表-添加")
     @PostMapping(value = "/add")
     public Result<RuleCondition> add(@RequestBody RuleCondition ruleCondition) {
@@ -98,7 +95,6 @@ public class RuleConditionController {
      * @param ruleCondition
      * @return
      */
-    @AutoLog(value = "规则运算符配置表-编辑")
     @ApiOperation(value = "规则运算符配置表-编辑", notes = "规则运算符配置表-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleCondition> edit(@RequestBody RuleCondition ruleCondition) {
@@ -122,7 +118,6 @@ public class RuleConditionController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则运算符配置表-通过id删除")
     @ApiOperation(value = "规则运算符配置表-通过id删除", notes = "规则运算符配置表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -141,7 +136,6 @@ public class RuleConditionController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "规则运算符配置表-批量删除")
     @ApiOperation(value = "规则运算符配置表-批量删除", notes = "规则运算符配置表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleCondition> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -161,7 +155,6 @@ public class RuleConditionController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则运算符配置表-通过id查询")
     @ApiOperation(value = "规则运算符配置表-通过id查询", notes = "规则运算符配置表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleCondition> queryById(@RequestParam(name = "id", required = true) String id) {

+ 1 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleGroupController.java

@@ -6,9 +6,7 @@ import cn.com.ctop.alarm.modules.service.IRuleAccountThresholdService;
 import cn.com.ctop.alarm.modules.service.IRuleBaseService;
 import cn.com.ctop.alarm.modules.service.IRuleGroupService;
 import cn.com.ctop.alarm.modules.service.IRuleTemplateService;
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -19,6 +17,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -100,7 +99,6 @@ public class RuleGroupController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则组-通过id删除")
     @ApiOperation(value = "规则组-通过id删除", notes = "规则组-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -151,7 +149,6 @@ public class RuleGroupController {
      * @param req
      * @return
      */
-    @AutoLog(value = "规则组-分页列表查询")
     @ApiOperation(value = "规则组-分页列表查询", notes = "规则组-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<RuleGroup>> queryPageList(RuleGroup ruleGroup,
@@ -173,7 +170,6 @@ public class RuleGroupController {
      * @param ruleGroup
      * @return
      */
-    @AutoLog(value = "规则组-添加")
     @ApiOperation(value = "规则组-添加", notes = "规则组-添加")
     @PostMapping(value = "/add")
     public Result<RuleGroup> add(@RequestBody RuleGroup ruleGroup) {
@@ -220,7 +216,6 @@ public class RuleGroupController {
      * @param ruleGroup
      * @return
      */
-    @AutoLog(value = "规则组-编辑")
     @ApiOperation(value = "规则组-编辑", notes = "规则组-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleGroup> edit(@RequestBody RuleGroup ruleGroup) {
@@ -245,7 +240,6 @@ public class RuleGroupController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "规则组-批量删除")
     @ApiOperation(value = "规则组-批量删除", notes = "规则组-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleGroup> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -265,7 +259,6 @@ public class RuleGroupController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则组-通过id查询")
     @ApiOperation(value = "规则组-通过id查询", notes = "规则组-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleGroup> queryById(@RequestParam(name = "id", required = true) String id) {

+ 2 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleIndicatorController.java

@@ -2,9 +2,7 @@ package cn.com.ctop.alarm.modules.controller;
 
 import cn.com.ctop.alarm.modules.entity.RuleIndicator;
 import cn.com.ctop.alarm.modules.service.IRuleIndicatorService;
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -13,6 +11,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -49,7 +48,7 @@ public class RuleIndicatorController {
     @Autowired
     private IRuleIndicatorService ruleIndicatorService;
 
-    @AutoLog(value = "规则指标信息-分页列表查询")
+
     @ApiOperation(value = "规则指标信息-分页列表查询", notes = "规则指标信息-分页列表查询")
     @GetMapping(value = "/list")
     public Result<JSONArray> queryPageList(RuleIndicator ruleIndicator) {
@@ -87,7 +86,6 @@ public class RuleIndicatorController {
      * @param ruleIndicator
      * @return
      */
-    @AutoLog(value = "规则指标信息-添加")
     @ApiOperation(value = "规则指标信息-添加", notes = "规则指标信息-添加")
     @PostMapping(value = "/add")
     public Result<RuleIndicator> add(@RequestBody RuleIndicator ruleIndicator) {
@@ -108,7 +106,6 @@ public class RuleIndicatorController {
      * @param ruleIndicator
      * @return
      */
-    @AutoLog(value = "规则指标信息-编辑")
     @ApiOperation(value = "规则指标信息-编辑", notes = "规则指标信息-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleIndicator> edit(@RequestBody RuleIndicator ruleIndicator) {
@@ -132,7 +129,6 @@ public class RuleIndicatorController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则指标信息-通过id删除")
     @ApiOperation(value = "规则指标信息-通过id删除", notes = "规则指标信息-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -151,7 +147,6 @@ public class RuleIndicatorController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "规则指标信息-批量删除")
     @ApiOperation(value = "规则指标信息-批量删除", notes = "规则指标信息-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleIndicator> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -171,7 +166,6 @@ public class RuleIndicatorController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则指标信息-通过id查询")
     @ApiOperation(value = "规则指标信息-通过id查询", notes = "规则指标信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleIndicator> queryById(@RequestParam(name = "id", required = true) String id) {

+ 1 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleTemplateController.java

@@ -3,9 +3,7 @@ package cn.com.ctop.alarm.modules.controller;
 import cn.com.ctop.alarm.modules.entity.RuleGroup;
 import cn.com.ctop.alarm.modules.entity.RuleTemplate;
 import cn.com.ctop.alarm.modules.service.*;
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -16,6 +14,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -68,7 +67,6 @@ public class RuleTemplateController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则模板-通过id查询")
     @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
     @GetMapping(value = "/queryDetailById")
     public Result<JSONObject> queryDetailById(@RequestParam(name = "id", required = true) String id) {
@@ -98,7 +96,6 @@ public class RuleTemplateController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则模板-通过id查询")
     @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
     @GetMapping(value = "/previewTemplate")
     public Result<JSONObject> previewTemplate(@RequestParam(name = "id", required = true) String id) {
@@ -149,7 +146,6 @@ public class RuleTemplateController {
      * @param req
      * @return
      */
-    @AutoLog(value = "规则模板-分页列表查询")
     @ApiOperation(value = "规则模板-分页列表查询", notes = "规则模板-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<RuleTemplate>> queryPageList(RuleTemplate ruleTemplate,
@@ -177,7 +173,6 @@ public class RuleTemplateController {
      * @param requestJson
      * @return
      */
-    @AutoLog(value = "创建规则模板")
 
     @PostMapping(value = "/createTemplate")
     public Result createTemplate(@RequestBody JSONObject requestJson) {
@@ -209,7 +204,6 @@ public class RuleTemplateController {
      * @param ruleTemplate
      * @return
      */
-    @AutoLog(value = "规则模板-添加")
     @ApiOperation(value = "规则模板-添加", notes = "规则模板-添加")
     @PostMapping(value = "/add")
     public Result<RuleTemplate> add(@RequestBody RuleTemplate ruleTemplate) {
@@ -230,7 +224,6 @@ public class RuleTemplateController {
      * @param ruleTemplate
      * @return
      */
-    @AutoLog(value = "规则模板-编辑")
     @ApiOperation(value = "规则模板-编辑", notes = "规则模板-编辑")
     @PutMapping(value = "/edit")
     public Result<RuleTemplate> edit(@RequestBody RuleTemplate ruleTemplate) {
@@ -256,7 +249,6 @@ public class RuleTemplateController {
      */
 
 
-    @AutoLog(value = "规则模板-通过id删除")
     @ApiOperation(value = "规则模板-通过id删除", notes = "规则模板-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@@ -303,7 +295,6 @@ public class RuleTemplateController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "规则模板-批量删除")
     @ApiOperation(value = "规则模板-批量删除", notes = "规则模板-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<RuleTemplate> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
@@ -323,7 +314,6 @@ public class RuleTemplateController {
      * @param id
      * @return
      */
-    @AutoLog(value = "规则模板-通过id查询")
     @ApiOperation(value = "规则模板-通过id查询", notes = "规则模板-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<RuleTemplate> queryById(@RequestParam(name = "id", required = true) String id) {

+ 5 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleGroupServiceImpl.java

@@ -158,7 +158,7 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
     /**
      * 匹配预警规则
      *
-     * @param ruleGroupMap 规则数据集
+     * @param ruleGroups 规则数据集
      * @param templates  规则模板
      * @param indicators 指标码
      * @return void
@@ -334,11 +334,12 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
      * 组合规则匹配逻辑
      *
      * @param ruleGroup    规则组对象
+     * @param ruleBaseList 单条规则数据集
      * @param thresholdObj 阈值数据
      * @param indicators   指标数据
      * @param matchData    匹配数据
      * @param type         媒体类型 1:头条2:快手
-     * @param recordList
+     * @param accountName  账户名称
      * @return void
      * @throws
      * @author ZHAOXA
@@ -650,7 +651,9 @@ public class RuleGroupServiceImpl extends ServiceImpl<RuleGroupMapper, RuleGroup
      * 发送消息
      *
      * @param ruleGroup 达标的规则组对象
+     * @param obj       达标数据对象
      * @param type      1:头条2:快手
+     * @param isNull    查询的值为空
      * @return void
      * @throws
      * @author ZHAOXA

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/check/controller/CtopCheckTaskExecuteLogCtrl.java

@@ -2,12 +2,12 @@ package cn.com.ctop.check.controller;
 
 import cn.com.ctop.check.entity.CtopCheckTaskExecuteLog;
 import cn.com.ctop.check.service.ICtopCheckTaskExecuteLogService;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/check/controller/CtopCheckTaskListCtrl.java

@@ -2,12 +2,12 @@ package cn.com.ctop.check.controller;
 
 import cn.com.ctop.check.entity.CtopCheckTaskList;
 import cn.com.ctop.check.service.ICtopCheckTaskListService;
-import cn.com.ctop.common.module.utils.QueryGenerator;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 

+ 0 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/check/entity/CtopCheckTaskExecuteLog.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.check.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -23,7 +22,6 @@ public class CtopCheckTaskExecuteLog {
 	private Long id;
 
 	/**checkTaskId*/
-	@Dict(dicCode = "id",dictTable="ctop_check_task_list",dicText="name")
 	private Integer checkTaskId;
 
 	/**startDate*/

+ 0 - 39
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/annotation/AutoLog.java

@@ -1,39 +0,0 @@
-package cn.com.ctop.common.module.annotation;
-
-import org.jeecg.common.constant.CommonConstant;
-
-import java.lang.annotation.*;
-
-/**
- * 系统日志注解
- *
- * @Author scott
- * @email jeecgos@163.com
- * @Date 2019年1月14日
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface AutoLog {
-
-	/**
-	 * 日志内容
-	 *
-	 * @return
-	 */
-	String value() default "";
-
-	/**
-	 * 日志类型
-	 *
-	 * @return 0:操作日志;1:登录日志;2:定时任务;
-	 */
-	int logType() default CommonConstant.LOG_TYPE_2;
-
-	/**
-	 * 操作日志类型
-	 *
-	 * @return (1查询,2添加,3修改,4删除)
-	 */
-	int operateType() default 0;
-}

+ 0 - 60
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/annotation/Dict.java

@@ -1,60 +0,0 @@
-package cn.com.ctop.common.module.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- *  类描述:  字典注解
- * 作    者: dangzhenghui
- * 日    期: 2019年03月17日-下午9:37:16
- */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Dict {
-    /**
-     * 方法描述:  数据code
-     * 作    者: dangzhenghui
-     * 日    期: 2019年03月17日-下午9:37:16
-     *
-     * @return 返回类型: String
-     */
-    String dicCode();
-
-    /**
-     * 方法描述:  数据Text
-     * 作    者: dangzhenghui
-     * 日    期: 2019年03月17日-下午9:37:16
-     *
-     * @return 返回类型: String
-     */
-    String dicText() default "";
-
-    /**
-     * 方法描述: 数据字典表
-     * 作    者: dangzhenghui
-     * 日    期: 2019年03月17日-下午9:37:16
-     *
-     * @return 返回类型: String
-     */
-    String dictTable() default "";
-
-    /**
-     * 方法描述: 数据字典表
-     * 作    者: dangzhenghui
-     * 日    期: 2019年03月17日-下午9:37:16
-     *
-     * @return 返回类型: String
-     */
-    String extendsKey() default "";
-
-    /**
-     * 方法描述: 数据字典表
-     * 作    者: dangzhenghui
-     * 日    期: 2019年03月17日-下午9:37:16
-     *
-     * @return 返回类型: String
-     */
-    String extendsValue() default "";
-}

+ 0 - 25
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/annotation/PermissionData.java

@@ -1,25 +0,0 @@
-package cn.com.ctop.common.module.annotation;
-
-import java.lang.annotation.*;
-
-/**
-  *  数据权限注解
- * @Author taoyan
- * @Date 2019年4月11日
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE,ElementType.METHOD})
-@Documented
-public @interface PermissionData {
-	/**
-	 * 暂时没用
-	 * @return
-	 */
-	String value() default "";
-
-
-	/**
-	 * 配置菜单的组件路径,用于数据权限
-	 */
-	String pageComponent() default "";
-}

+ 0 - 212
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/SqlUtils.java

@@ -1,212 +0,0 @@
-package cn.com.ctop.common.module.db;
-
-import org.apache.commons.lang.StringUtils;
-import org.jeecg.common.constant.DataBaseConstant;
-import org.jeecg.common.system.vo.DynamicDataSourceModel;
-
-import java.text.MessageFormat;
-import java.util.Map;
-
-/**
- * 根据不同的数据库,动态生成SQL,例如分页
- */
-public class SqlUtils {
-
-    public static final String DATABSE_TYPE_MYSQL = "mysql";
-    public static final String DATABSE_TYPE_POSTGRE = "postgresql";
-    public static final String DATABSE_TYPE_ORACLE = "oracle";
-    public static final String DATABSE_TYPE_SQLSERVER = "sqlserver";
-
-
-    /**
-     * 分页SQL
-     */
-    public static final String MYSQL_SQL = "select * from ( {0}) sel_tab00 limit {1},{2}";
-    public static final String POSTGRE_SQL = "select * from ( {0}) sel_tab00 limit {2} offset {1}";
-    public static final String ORACLE_SQL = "select * from (select row_.*,rownum rownum_ from ({0}) row_ where rownum <= {1}) where rownum_>{2}";
-    public static final String SQLSERVER_SQL = "select * from ( select row_number() over(order by tempColumn) tempRowNumber, * from (select top {1} tempColumn = 0, {0}) t ) tt where tempRowNumber > {2}";
-
-    /**
-     * 获取所有表的SQL
-     */
-    public static final String MYSQL_ALLTABLES_SQL = "select distinct table_name from information_schema.columns where table_schema = {0}";
-    public static final String POSTGRE__ALLTABLES_SQL = "SELECT distinct c.relname AS  table_name FROM pg_class c";
-    public static final String ORACLE__ALLTABLES_SQL = "select distinct colstable.table_name as  table_name from user_tab_cols colstable";
-    public static final String SQLSERVER__ALLTABLES_SQL = "select distinct c.name as  table_name from sys.objects c";
-
-    /**
-     * 获取指定表的所有列名
-     */
-    public static final String MYSQL_ALLCOLUMNS_SQL = "select column_name from information_schema.columns where table_name = {0} and table_schema = {1}";
-    public static final String POSTGRE_ALLCOLUMNS_SQL = "select table_name from information_schema.columns where table_name = {0}";
-    public static final String ORACLE_ALLCOLUMNS_SQL = "select column_name from all_tab_columns where table_name ={0}";
-    public static final String SQLSERVER_ALLCOLUMNS_SQL = "select name from syscolumns where id={0}";
-
-    /*
-     * 判断数据库类型
-     */
-
-    public static boolean dbTypeIsMySQL(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_MYSQL, DataBaseConstant.DB_TYPE_MYSQL_NUM);
-    }
-
-    public static boolean dbTypeIsOracle(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_ORACLE, DataBaseConstant.DB_TYPE_ORACLE_NUM);
-    }
-
-    public static boolean dbTypeIsSQLServer(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_SQLSERVER, DataBaseConstant.DB_TYPE_SQLSERVER_NUM);
-    }
-
-    public static boolean dbTypeIsPostgre(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_POSTGRE, DataBaseConstant.DB_TYPE_POSTGRESQL_NUM);
-    }
-
-    /**
-     * 判断数据库类型
-     */
-    public static boolean dbTypeIf(String dbType, String... correctTypes) {
-        for (String type : correctTypes) {
-            if (type.equalsIgnoreCase(dbType)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 获取全 SQL
-     * 拼接 where 条件
-     *
-     * @param sql
-     * @param params
-     * @return
-     */
-    public static String getFullSql(String sql, Map params) {
-        return getFullSql(sql, params, null, null);
-    }
-
-    /**
-     * 获取全 SQL
-     * 拼接 where 条件
-     * 拼接 order 排序
-     *
-     * @param sql
-     * @param params
-     * @param orderColumn 排序字段
-     * @param orderBy     排序方式,只能是 DESC 或 ASC
-     * @return
-     */
-    public static String getFullSql(String sql, Map params, String orderColumn, String orderBy) {
-        StringBuilder sqlBuilder = new StringBuilder();
-        sqlBuilder.append("SELECT t.* FROM ( ").append(sql).append(" ) t ");
-        if (params != null && params.size() >= 1) {
-            sqlBuilder.append("WHERE 1=1 ");
-            for (Object key : params.keySet()) {
-                String value = String.valueOf(params.get(key));
-                if (StringUtils.isNotBlank(value)) {
-                    sqlBuilder.append(" AND (").append(key).append(" = N'").append(value).append("')");
-                }
-            }
-            if (StringUtils.isNotBlank(orderColumn) && StringUtils.isNotBlank(orderBy)) {
-                sqlBuilder.append("ORDER BY ").append(orderColumn).append(" ").append("DESC".equalsIgnoreCase(orderBy) ? "DESC" : "ASC");
-            }
-        }
-        return sqlBuilder.toString();
-    }
-
-    /**
-     * 获取求数量 SQL
-     *
-     * @param sql
-     * @return
-     */
-    public static String getCountSql(String sql) {
-        return String.format("SELECT COUNT(1) \"total\" FROM ( %s ) temp_count", sql);
-    }
-
-    /**
-     * 生成分页查询 SQL
-     *
-     * @param dbType 数据库类型
-     * @param sql
-     * @param page
-     * @param rows
-     * @return
-     */
-    public static String createPageSqlByDBType(String dbType, String sql, int page, int rows) {
-        int beginNum = (page - 1) * rows;
-        Object[] sqlParam = new Object[3];
-        sqlParam[0] = sql;
-        sqlParam[1] = String.valueOf(beginNum);
-        sqlParam[2] = String.valueOf(rows);
-        if (dbTypeIsMySQL(dbType)) {
-            sql = MessageFormat.format(MYSQL_SQL, sqlParam);
-        } else if (dbTypeIsPostgre(dbType)) {
-            sql = MessageFormat.format(POSTGRE_SQL, sqlParam);
-        } else {
-            int beginIndex = (page - 1) * rows;
-            int endIndex = beginIndex + rows;
-            sqlParam[2] = Integer.toString(beginIndex);
-            sqlParam[1] = Integer.toString(endIndex);
-            if (dbTypeIsOracle(dbType)) {
-                sql = MessageFormat.format(ORACLE_SQL, sqlParam);
-            } else if (dbTypeIsSQLServer(dbType)) {
-                sqlParam[0] = sql.substring(getAfterSelectInsertPoint(sql));
-                sql = MessageFormat.format(SQLSERVER_SQL, sqlParam);
-            }
-        }
-        return sql;
-    }
-
-    /**
-     * 生成分页查询 SQL
-     *
-     * @param sql
-     * @param page
-     * @param rows
-     * @return
-     */
-    public static String createPageSqlByDBKey(String dbKey, String sql, int page, int rows) {
-        DynamicDataSourceModel dynamicSourceEntity = DataSourceCachePool.getCacheDynamicDataSourceModel(dbKey);
-        String dbType = dynamicSourceEntity.getDbType();
-        return createPageSqlByDBType(dbType, sql, page, rows);
-    }
-
-    private static int getAfterSelectInsertPoint(String sql) {
-        int selectIndex = sql.toLowerCase().indexOf("select");
-        int selectDistinctIndex = sql.toLowerCase().indexOf("select distinct");
-        return selectIndex + (selectDistinctIndex == selectIndex ? 15 : 6);
-    }
-
-    public static String getAllTableSql(String dbType, Object... params) {
-        if (StringUtils.isNotEmpty(dbType)) {
-            if (dbTypeIsMySQL(dbType)) {
-                return MessageFormat.format(MYSQL_ALLTABLES_SQL, params);
-            } else if (dbTypeIsOracle(dbType)) {
-                return ORACLE__ALLTABLES_SQL;
-            } else if (dbTypeIsPostgre(dbType)) {
-                return POSTGRE__ALLTABLES_SQL;
-            } else if (dbTypeIsSQLServer(dbType)) {
-                return SQLSERVER__ALLTABLES_SQL;
-            }
-        }
-        return null;
-    }
-
-    public static String getAllColumnSQL(String dbType, Object... params) {
-        if (StringUtils.isNotEmpty(dbType)) {
-            if (dbTypeIsMySQL(dbType)) {
-                return MessageFormat.format(MYSQL_ALLCOLUMNS_SQL, params);
-            } else if (dbTypeIsOracle(dbType)) {
-                return MessageFormat.format(ORACLE_ALLCOLUMNS_SQL, params);
-            } else if (dbTypeIsPostgre(dbType)) {
-                return MessageFormat.format(POSTGRE_ALLCOLUMNS_SQL, params);
-            } else if (dbTypeIsSQLServer(dbType)) {
-                return MessageFormat.format(SQLSERVER_ALLCOLUMNS_SQL, params);
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 92
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/dynamic/DataSourceCachePool.java

@@ -1,92 +0,0 @@
-package cn.com.ctop.common.module.db.dynamic;
-
-import com.alibaba.druid.pool.DruidDataSource;
-import org.jeecg.common.constant.CacheConstant;
-import org.jeecg.common.system.api.ISysBaseApi;
-import org.jeecg.common.system.vo.DynamicDataSourceModel;
-import org.jeecg.common.util.SpringContextUtils;
-import org.springframework.data.redis.core.RedisTemplate;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * 数据源缓存池
- */
-public class DataSourceCachePool {
-    /** 数据源连接池缓存【本地 class缓存 - 不支持分布式】 */
-    private static Map<String, DruidDataSource> dbSources = new HashMap<>();
-    private static RedisTemplate<String, Object> redisTemplate;
-
-    public static RedisTemplate<String, Object> getRedisTemplate() {
-        if (redisTemplate == null) {
-            redisTemplate = (RedisTemplate<String, Object>) SpringContextUtils.getBean("redisTemplate");
-        }
-        return redisTemplate;
-    }
-
-    /**
-     * 获取多数据源缓存
-     *
-     * @param dbKey
-     * @return
-     */
-    public static DynamicDataSourceModel getCacheDynamicDataSourceModel(String dbKey) {
-        String redisCacheKey = CacheConstant.SYS_DYNAMICDB_CACHE + dbKey;
-        if (getRedisTemplate().hasKey(redisCacheKey)) {
-            return (DynamicDataSourceModel) getRedisTemplate().opsForValue().get(redisCacheKey);
-        }
-        ISysBaseApi sysBaseApi = SpringContextUtils.getBean(ISysBaseApi.class);
-        DynamicDataSourceModel dbSource = sysBaseApi.getDynamicDbSourceByCode(dbKey);
-        if (dbSource != null) {
-            getRedisTemplate().opsForValue().set(redisCacheKey, dbSource);
-        }
-        return dbSource;
-    }
-
-    public static DruidDataSource getCacheBasicDataSource(String dbKey) {
-        return dbSources.get(dbKey);
-    }
-
-    /**
-     * put 数据源缓存
-     *
-     * @param dbKey
-     * @param db
-     */
-    public static void putCacheBasicDataSource(String dbKey, DruidDataSource db) {
-        dbSources.put(dbKey, db);
-    }
-
-    /**
-     * 清空数据源缓存
-     */
-    public static void cleanAllCache() {
-        //关闭数据源连接
-        for(Map.Entry<String, DruidDataSource> entry : dbSources.entrySet()){
-            String dbkey = entry.getKey();
-            DruidDataSource druidDataSource = entry.getValue();
-            if(druidDataSource!=null && druidDataSource.isEnable()){
-                druidDataSource.close();
-            }
-            //清空redis缓存
-            getRedisTemplate().delete(CacheConstant.SYS_DYNAMICDB_CACHE + dbkey);
-        }
-        //清空缓存
-        dbSources.clear();
-    }
-
-    public static void removeCache(String dbKey) {
-        //关闭数据源连接
-        DruidDataSource druidDataSource = dbSources.get(dbKey);
-        if(druidDataSource!=null && druidDataSource.isEnable()){
-            druidDataSource.close();
-        }
-        //清空redis缓存
-        getRedisTemplate().delete(CacheConstant.SYS_DYNAMICDB_CACHE + dbKey);
-        //清空缓存
-        dbSources.remove(dbKey);
-    }
-
-}

+ 0 - 299
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/dynamic/DynamicDBUtil.java

@@ -1,299 +0,0 @@
-package cn.com.ctop.common.module.db.dynamic;
-
-import com.alibaba.druid.pool.DruidDataSource;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.ArrayUtils;
-import org.jeecg.common.exception.JeecgBootException;
-import org.jeecg.common.system.vo.DynamicDataSourceModel;
-import org.jeecg.common.util.ReflectHelper;
-import org.jeecg.common.util.dynamic.db.FreemarkerParseFactory;
-import org.jeecg.common.util.oConvertUtils;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Spring JDBC 实时数据库访问
- *
- * @author chenguobin
- * @version 1.0
- * @date 2014-09-05
- */
-@Slf4j
-public class DynamicDBUtil {
-
-    /**
-     * 获取数据源【最底层方法,不要随便调用】
-     *
-     * @param dbSource
-     * @return
-     */
-    private static DruidDataSource getJdbcDataSource(final DynamicDataSourceModel dbSource) {
-        DruidDataSource dataSource = new DruidDataSource();
-
-        String driverClassName = dbSource.getDbDriver();
-        String url = dbSource.getDbUrl();
-        String dbUser = dbSource.getDbUsername();
-        String dbPassword = dbSource.getDbPassword();
-        dataSource.setDriverClassName(driverClassName);
-        dataSource.setUrl(url);
-        //dataSource.setValidationQuery("SELECT 1 FROM DUAL");
-        dataSource.setTestWhileIdle(true);
-        dataSource.setTestOnBorrow(false);
-        dataSource.setTestOnReturn(false);
-        dataSource.setBreakAfterAcquireFailure(true);
-        dataSource.setConnectionErrorRetryAttempts(0);
-        dataSource.setUsername(dbUser);
-        dataSource.setMaxWait(60000);
-        dataSource.setPassword(dbPassword);
-
-        log.info("******************************************");
-        log.info("*                                        *");
-        log.info("*====【"+dbSource.getCode()+"】=====Druid连接池已启用 ====*");
-        log.info("*                                        *");
-        log.info("******************************************");
-        return dataSource;
-    }
-
-    /**
-     * 通过 dbKey ,获取数据源
-     *
-     * @param dbKey
-     * @return
-     */
-    public static DruidDataSource getDbSourceByDbKey(final String dbKey) {
-        //获取多数据源配置
-        DynamicDataSourceModel dbSource = DataSourceCachePool.getCacheDynamicDataSourceModel(dbKey);
-        //先判断缓存中是否存在数据库链接
-        DruidDataSource cacheDbSource = DataSourceCachePool.getCacheBasicDataSource(dbKey);
-        if (cacheDbSource != null && !cacheDbSource.isClosed()) {
-            log.debug("--------getDbSourceBydbKey------------------从缓存中获取DB连接-------------------");
-            return cacheDbSource;
-        } else {
-            DruidDataSource dataSource = getJdbcDataSource(dbSource);
-            if(dataSource!=null && dataSource.isEnable()){
-                DataSourceCachePool.putCacheBasicDataSource(dbKey, dataSource);
-            }else{
-                throw new JeecgBootException("动态数据源连接失败,dbKey:"+dbKey);
-            }
-            log.info("--------getDbSourceBydbKey------------------创建DB数据库连接-------------------");
-            return dataSource;
-        }
-    }
-
-    /**
-     * 关闭数据库连接池
-     *
-     * @param dbKey
-     * @return
-     */
-    public static void closeDbKey(final String dbKey) {
-        DruidDataSource dataSource = getDbSourceByDbKey(dbKey);
-        try {
-            if (dataSource != null && !dataSource.isClosed()) {
-                dataSource.getConnection().commit();
-                dataSource.getConnection().close();
-                dataSource.close();
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-    }
-
-
-    private static JdbcTemplate getJdbcTemplate(String dbKey) {
-        DruidDataSource dataSource = getDbSourceByDbKey(dbKey);
-        return new JdbcTemplate(dataSource);
-    }
-
-    /**
-     * Executes the SQL statement in this <code>PreparedStatement</code> object,
-     * which must be an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
-     * <code>DELETE</code>; or an SQL statement that returns nothing,
-     * such as a DDL statement.
-     */
-    public static int update(final String dbKey, String sql, Object... param) {
-        int effectCount;
-        JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
-        if (ArrayUtils.isEmpty(param)) {
-            effectCount = jdbcTemplate.update(sql);
-        } else {
-            effectCount = jdbcTemplate.update(sql, param);
-        }
-        return effectCount;
-    }
-
-    /**
-     * 支持miniDao语法操作的Update
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持minidao语法逻辑
-     * @param data  sql语法中需要判断的数据及sql拼接注入中需要的数据
-     * @return
-     */
-    public static int updateByHash(final String dbKey, String sql, HashMap<String, Object> data) {
-        int effectCount;
-        JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
-        //根据模板获取sql
-        sql = FreemarkerParseFactory.parseTemplateContent(sql, data);
-        NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate.getDataSource());
-        effectCount = namedParameterJdbcTemplate.update(sql, data);
-        return effectCount;
-    }
-
-    public static Object findOne(final String dbKey, String sql, Object... param) {
-        List<Map<String, Object>> list;
-        list = findList(dbKey, sql, param);
-        if (oConvertUtils.listIsEmpty(list)) {
-            log.error("Except one, but not find actually");
-        }
-        if (list.size() > 1) {
-            log.error("Except one, but more than one actually");
-        }
-        return list.get(0);
-    }
-
-    /**
-     * 支持miniDao语法操作的查询 返回HashMap
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持minidao语法逻辑
-     * @param data  sql语法中需要判断的数据及sql拼接注入中需要的数据
-     * @return
-     */
-    public static Object findOneByHash(final String dbKey, String sql, HashMap<String, Object> data) {
-        List<Map<String, Object>> list;
-        list = findListByHash(dbKey, sql, data);
-        if (oConvertUtils.listIsEmpty(list)) {
-            log.error("Except one, but not find actually");
-        }
-        if (list.size() > 1) {
-            log.error("Except one, but more than one actually");
-        }
-        return list.get(0);
-    }
-
-    /**
-     * 直接sql查询 根据clazz返回单个实例
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句
-     * @param clazz 返回实例的Class
-     * @param param
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> Object findOne(final String dbKey, String sql, Class<T> clazz, Object... param) {
-        Map<String, Object> map = (Map<String, Object>) findOne(dbKey, sql, param);
-        return ReflectHelper.setAll(clazz, map);
-    }
-
-    /**
-     * 支持miniDao语法操作的查询 返回单个实例
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持minidao语法逻辑
-     * @param clazz 返回实例的Class
-     * @param data  sql语法中需要判断的数据及sql拼接注入中需要的数据
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> Object findOneByHash(final String dbKey, String sql, Class<T> clazz, HashMap<String, Object> data) {
-        Map<String, Object> map = (Map<String, Object>) findOneByHash(dbKey, sql, data);
-        return ReflectHelper.setAll(clazz, map);
-    }
-
-    public static List<Map<String, Object>> findList(final String dbKey, String sql, Object... param) {
-        List<Map<String, Object>> list;
-        JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
-
-        if (ArrayUtils.isEmpty(param)) {
-            list = jdbcTemplate.queryForList(sql);
-        } else {
-            list = jdbcTemplate.queryForList(sql, param);
-        }
-        return list;
-    }
-
-    /**
-     * 支持miniDao语法操作的查询
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持minidao语法逻辑
-     * @param data  sql语法中需要判断的数据及sql拼接注入中需要的数据
-     * @return
-     */
-    public static List<Map<String, Object>> findListByHash(final String dbKey, String sql, HashMap<String, Object> data) {
-        List<Map<String, Object>> list;
-        JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
-        //根据模板获取sql
-        sql = FreemarkerParseFactory.parseTemplateContent(sql, data);
-        NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate.getDataSource());
-        list = namedParameterJdbcTemplate.queryForList(sql, data);
-        return list;
-    }
-
-    //此方法只能返回单列,不能返回实体类
-    public static <T> List<T> findList(final String dbKey, String sql, Class<T> clazz, Object... param) {
-        List<T> list;
-        JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
-
-        if (ArrayUtils.isEmpty(param)) {
-            list = jdbcTemplate.queryForList(sql, clazz);
-        } else {
-            list = jdbcTemplate.queryForList(sql, clazz, param);
-        }
-        return list;
-    }
-
-    /**
-     * 支持miniDao语法操作的查询 返回单列数据list
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持minidao语法逻辑
-     * @param clazz 类型Long、String等
-     * @param data  sql语法中需要判断的数据及sql拼接注入中需要的数据
-     * @return
-     */
-    public static <T> List<T> findListByHash(final String dbKey, String sql, Class<T> clazz, HashMap<String, Object> data) {
-        List<T> list;
-        JdbcTemplate jdbcTemplate = getJdbcTemplate(dbKey);
-        //根据模板获取sql
-        sql = FreemarkerParseFactory.parseTemplateContent(sql, data);
-        NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate.getDataSource());
-        list = namedParameterJdbcTemplate.queryForList(sql, data, clazz);
-        return list;
-    }
-
-    /**
-     * 直接sql查询 返回实体类列表
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持 minidao 语法逻辑
-     * @param clazz 返回实体类列表的class
-     * @param param sql拼接注入中需要的数据
-     * @return
-     */
-    public static <T> List<T> findListEntities(final String dbKey, String sql, Class<T> clazz, Object... param) {
-        List<Map<String, Object>> queryList = findList(dbKey, sql, param);
-        return ReflectHelper.transList2Entrys(queryList, clazz);
-    }
-
-    /**
-     * 支持miniDao语法操作的查询 返回实体类列表
-     *
-     * @param dbKey 数据源标识
-     * @param sql   执行sql语句,sql支持minidao语法逻辑
-     * @param clazz 返回实体类列表的class
-     * @param data  sql语法中需要判断的数据及sql拼接注入中需要的数据
-     * @return
-     */
-    public static <T> List<T> findListEntitiesByHash(final String dbKey, String sql, Class<T> clazz, HashMap<String, Object> data) {
-        List<Map<String, Object>> queryList = findListByHash(dbKey, sql, data);
-        return ReflectHelper.transList2Entrys(queryList, clazz);
-    }
-}

+ 0 - 213
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/db/dynamic/SqlUtils.java

@@ -1,213 +0,0 @@
-package cn.com.ctop.common.module.db.dynamic;
-
-import cn.com.ctop.common.module.db.DataSourceCachePool;
-import org.apache.commons.lang.StringUtils;
-import org.jeecg.common.constant.DataBaseConstant;
-import org.jeecg.common.system.vo.DynamicDataSourceModel;
-
-import java.text.MessageFormat;
-import java.util.Map;
-
-/**
- * 根据不同的数据库,动态生成SQL,例如分页
- */
-public class SqlUtils {
-
-    public static final String DATABSE_TYPE_MYSQL = "mysql";
-    public static final String DATABSE_TYPE_POSTGRE = "postgresql";
-    public static final String DATABSE_TYPE_ORACLE = "oracle";
-    public static final String DATABSE_TYPE_SQLSERVER = "sqlserver";
-
-
-    /**
-     * 分页SQL
-     */
-    public static final String MYSQL_SQL = "select * from ( {0}) sel_tab00 limit {1},{2}";
-    public static final String POSTGRE_SQL = "select * from ( {0}) sel_tab00 limit {2} offset {1}";
-    public static final String ORACLE_SQL = "select * from (select row_.*,rownum rownum_ from ({0}) row_ where rownum <= {1}) where rownum_>{2}";
-    public static final String SQLSERVER_SQL = "select * from ( select row_number() over(order by tempColumn) tempRowNumber, * from (select top {1} tempColumn = 0, {0}) t ) tt where tempRowNumber > {2}";
-
-    /**
-     * 获取所有表的SQL
-     */
-    public static final String MYSQL_ALLTABLES_SQL = "select distinct table_name from information_schema.columns where table_schema = {0}";
-    public static final String POSTGRE__ALLTABLES_SQL = "SELECT distinct c.relname AS  table_name FROM pg_class c";
-    public static final String ORACLE__ALLTABLES_SQL = "select distinct colstable.table_name as  table_name from user_tab_cols colstable";
-    public static final String SQLSERVER__ALLTABLES_SQL = "select distinct c.name as  table_name from sys.objects c";
-
-    /**
-     * 获取指定表的所有列名
-     */
-    public static final String MYSQL_ALLCOLUMNS_SQL = "select column_name from information_schema.columns where table_name = {0} and table_schema = {1}";
-    public static final String POSTGRE_ALLCOLUMNS_SQL = "select table_name from information_schema.columns where table_name = {0}";
-    public static final String ORACLE_ALLCOLUMNS_SQL = "select column_name from all_tab_columns where table_name ={0}";
-    public static final String SQLSERVER_ALLCOLUMNS_SQL = "select name from syscolumns where id={0}";
-
-    /*
-     * 判断数据库类型
-     */
-
-    public static boolean dbTypeIsMySQL(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_MYSQL, DataBaseConstant.DB_TYPE_MYSQL_NUM);
-    }
-
-    public static boolean dbTypeIsOracle(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_ORACLE, DataBaseConstant.DB_TYPE_ORACLE_NUM);
-    }
-
-    public static boolean dbTypeIsSQLServer(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_SQLSERVER, DataBaseConstant.DB_TYPE_SQLSERVER_NUM);
-    }
-
-    public static boolean dbTypeIsPostgre(String dbType) {
-        return dbTypeIf(dbType, DATABSE_TYPE_POSTGRE, DataBaseConstant.DB_TYPE_POSTGRESQL_NUM);
-    }
-
-    /**
-     * 判断数据库类型
-     */
-    public static boolean dbTypeIf(String dbType, String... correctTypes) {
-        for (String type : correctTypes) {
-            if (type.equalsIgnoreCase(dbType)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 获取全 SQL
-     * 拼接 where 条件
-     *
-     * @param sql
-     * @param params
-     * @return
-     */
-    public static String getFullSql(String sql, Map params) {
-        return getFullSql(sql, params, null, null);
-    }
-
-    /**
-     * 获取全 SQL
-     * 拼接 where 条件
-     * 拼接 order 排序
-     *
-     * @param sql
-     * @param params
-     * @param orderColumn 排序字段
-     * @param orderBy     排序方式,只能是 DESC 或 ASC
-     * @return
-     */
-    public static String getFullSql(String sql, Map params, String orderColumn, String orderBy) {
-        StringBuilder sqlBuilder = new StringBuilder();
-        sqlBuilder.append("SELECT t.* FROM ( ").append(sql).append(" ) t ");
-        if (params != null && params.size() >= 1) {
-            sqlBuilder.append("WHERE 1=1 ");
-            for (Object key : params.keySet()) {
-                String value = String.valueOf(params.get(key));
-                if (StringUtils.isNotBlank(value)) {
-                    sqlBuilder.append(" AND (").append(key).append(" = N'").append(value).append("')");
-                }
-            }
-            if (StringUtils.isNotBlank(orderColumn) && StringUtils.isNotBlank(orderBy)) {
-                sqlBuilder.append("ORDER BY ").append(orderColumn).append(" ").append("DESC".equalsIgnoreCase(orderBy) ? "DESC" : "ASC");
-            }
-        }
-        return sqlBuilder.toString();
-    }
-
-    /**
-     * 获取求数量 SQL
-     *
-     * @param sql
-     * @return
-     */
-    public static String getCountSql(String sql) {
-        return String.format("SELECT COUNT(1) \"total\" FROM ( %s ) temp_count", sql);
-    }
-
-    /**
-     * 生成分页查询 SQL
-     *
-     * @param dbType 数据库类型
-     * @param sql
-     * @param page
-     * @param rows
-     * @return
-     */
-    public static String createPageSqlByDBType(String dbType, String sql, int page, int rows) {
-        int beginNum = (page - 1) * rows;
-        Object[] sqlParam = new Object[3];
-        sqlParam[0] = sql;
-        sqlParam[1] = String.valueOf(beginNum);
-        sqlParam[2] = String.valueOf(rows);
-        if (dbTypeIsMySQL(dbType)) {
-            sql = MessageFormat.format(MYSQL_SQL, sqlParam);
-        } else if (dbTypeIsPostgre(dbType)) {
-            sql = MessageFormat.format(POSTGRE_SQL, sqlParam);
-        } else {
-            int beginIndex = (page - 1) * rows;
-            int endIndex = beginIndex + rows;
-            sqlParam[2] = Integer.toString(beginIndex);
-            sqlParam[1] = Integer.toString(endIndex);
-            if (dbTypeIsOracle(dbType)) {
-                sql = MessageFormat.format(ORACLE_SQL, sqlParam);
-            } else if (dbTypeIsSQLServer(dbType)) {
-                sqlParam[0] = sql.substring(getAfterSelectInsertPoint(sql));
-                sql = MessageFormat.format(SQLSERVER_SQL, sqlParam);
-            }
-        }
-        return sql;
-    }
-
-    /**
-     * 生成分页查询 SQL
-     *
-     * @param sql
-     * @param page
-     * @param rows
-     * @return
-     */
-    public static String createPageSqlByDBKey(String dbKey, String sql, int page, int rows) {
-        DynamicDataSourceModel dynamicSourceEntity = DataSourceCachePool.getCacheDynamicDataSourceModel(dbKey);
-        String dbType = dynamicSourceEntity.getDbType();
-        return createPageSqlByDBType(dbType, sql, page, rows);
-    }
-
-    private static int getAfterSelectInsertPoint(String sql) {
-        int selectIndex = sql.toLowerCase().indexOf("select");
-        int selectDistinctIndex = sql.toLowerCase().indexOf("select distinct");
-        return selectIndex + (selectDistinctIndex == selectIndex ? 15 : 6);
-    }
-
-    public static String getAllTableSql(String dbType, Object... params) {
-        if (StringUtils.isNotEmpty(dbType)) {
-            if (dbTypeIsMySQL(dbType)) {
-                return MessageFormat.format(MYSQL_ALLTABLES_SQL, params);
-            } else if (dbTypeIsOracle(dbType)) {
-                return ORACLE__ALLTABLES_SQL;
-            } else if (dbTypeIsPostgre(dbType)) {
-                return POSTGRE__ALLTABLES_SQL;
-            } else if (dbTypeIsSQLServer(dbType)) {
-                return SQLSERVER__ALLTABLES_SQL;
-            }
-        }
-        return null;
-    }
-
-    public static String getAllColumnSQL(String dbType, Object... params) {
-        if (StringUtils.isNotEmpty(dbType)) {
-            if (dbTypeIsMySQL(dbType)) {
-                return MessageFormat.format(MYSQL_ALLCOLUMNS_SQL, params);
-            } else if (dbTypeIsOracle(dbType)) {
-                return MessageFormat.format(ORACLE_ALLCOLUMNS_SQL, params);
-            } else if (dbTypeIsPostgre(dbType)) {
-                return MessageFormat.format(POSTGRE_ALLCOLUMNS_SQL, params);
-            } else if (dbTypeIsSQLServer(dbType)) {
-                return MessageFormat.format(SQLSERVER_ALLCOLUMNS_SQL, params);
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -53,7 +52,6 @@ public class BindAccountLogin {
     @ApiModelProperty(value = "平台账户id")
     private String accountId;
 
-    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
     private String userId;
     /**
      * 账号

+ 23 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/DataLabels.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.common.module.entity;
+
+import lombok.Data;
+import org.jeecg.common.aspect.annotation.Document;
+import org.jeecg.common.aspect.annotation.EsId;
+import org.jeecg.common.aspect.annotation.FieId;
+import org.jeecg.common.constant.AnalyzerType;
+import org.jeecg.common.constant.FieldType;
+
+import java.io.Serializable;
+
+@Data
+@Document(index = "data_labels", type = "lable")
+public class DataLabels implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @EsId
+    @FieId(type = FieldType.KEYWORD)
+    private String id;
+    @FieId(type = FieldType.KEYWORD,analyzer = AnalyzerType.IK_SMART)
+    private String content;
+    @FieId(type = FieldType.KEYWORD)
+    private Integer size;
+}

+ 1 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/Product.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -9,7 +8,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.util.Date;
@@ -24,7 +23,6 @@ import java.util.Date;
 @Data
 @TableName("ctop_product")
 @EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
 @ApiModel(value = "ctop_product对象", description = "产品表")
 public class Product {
 

+ 0 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysAnnouncement.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -60,26 +59,22 @@ public class SysAnnouncement implements Serializable {
      * 优先级(L低,M中,H高)
      */
     @Excel(name = "优先级", width = 15, dicCode = "priority")
-    @Dict(dicCode = "priority")
     private String priority;
 
     /**
      * 消息类型1:通知公告2:系统消息
      */
     @Excel(name = "消息类型", width = 15, dicCode = "msg_category")
-    @Dict(dicCode = "msg_category")
     private String msgCategory;
     /**
      * 通告对象类型(USER:指定用户,ALL:全体用户)
      */
     @Excel(name = "通告对象类型", width = 15, dicCode = "msg_type")
-    @Dict(dicCode = "msg_type")
     private String msgType;
     /**
      * 发布状态(0未发布,1已发布,2已撤销)
      */
     @Excel(name = "发布状态", width = 15, dicCode = "send_status")
-    @Dict(dicCode = "send_status")
     private String sendStatus;
     /**
      * 发布时间

+ 1 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysDepartRole.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -33,8 +32,7 @@ public class SysDepartRole {
 	/**部门id*/
 	@Excel(name = "部门id", width = 15)
 	@ApiModelProperty(value = "部门id")
-	@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
-	private String departId;
+    private String departId;
 	/**部门角色名称*/
 	@Excel(name = "部门角色名称", width = 15)
     @ApiModelProperty(value = "部门角色名称")

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysDictItem.java

@@ -1,11 +1,11 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.io.Serializable;

+ 0 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/SysLog.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -100,12 +99,10 @@ public class SysLog implements Serializable {
 	/**
 	 * 日志类型(1登录日志,2操作日志)
 	 */
-	@Dict(dicCode = "log_type")
 	private Integer logType;
 
 	/**
 	 * 操作类型(1查询,2添加,3修改,4删除,5导入,6导出)
 	 */
-	@Dict(dicCode = "operate_type")
 	private Integer operateType;
 }

+ 1 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/TagInfo.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -9,6 +8,7 @@ import io.swagger.annotations.ApiModel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 
 import java.util.Date;
 import java.util.List;
@@ -27,15 +27,11 @@ import java.util.List;
 public class TagInfo {
 	@TableId(type = IdType.AUTO)
 	private Long id;
-	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
 	private Long parentId;
 	private Long tagCategoryId;
 	private String tagCategoryName;
-	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
 	private Long firstTagId;
-	@Dict(dicCode = "id",dictTable="ctop_tag_info",dicText="tag_name")
 	private Long secendTagId;
-	@Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
 	private String userId;
 	private String tagName;
 	private Integer tagOrder;
@@ -52,6 +48,4 @@ public class TagInfo {
 
 	@TableField(exist = false)
 	List<TagInfo> children;
-
-
 }

+ 1 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -10,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -161,14 +161,4 @@ public class UserAllocation implements Serializable {
     @Excel(name = "平台类型 1 头条 2快手", width = 15)
     @ApiModelProperty(value = "平台类型 1 头条 2快手")
     private String mediaId;
-
-
-
-
-   /* @TableField(exist = false)
-    private String advertiserName;
-
-    @TableField(exist = false)
-    private String projectName;*/
-
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/CtopCorpWexinUserMapper.java

@@ -1,8 +1,8 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
-import org.apache.ibatis.annotations.Param;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 企业微信用户表

+ 0 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MaterialCutFrameMapper.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.MaterialCutFrame;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;

+ 0 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/MusicTypeMapper.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.mapper;
 
-import cn.com.ctop.common.module.entity.MusicInfo;
 import cn.com.ctop.common.module.entity.MusicType;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 

+ 0 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/RuleDateUnitKuaishouMapper.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.RuleDateUnitKuaishou;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 3 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementMapper.java

@@ -14,5 +14,8 @@ import java.util.List;
  * @Version: V1.0
  */
 public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
+
+
 	List<SysAnnouncement> querySysCementListByUserId(Page<SysAnnouncement> page, @Param("userId")String userId, @Param("msgCategory")String msgCategory);
+
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysAnnouncementSendMapper.java

@@ -16,13 +16,13 @@ import java.util.List;
  */
 public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSend> {
 
-	List<String> queryByUserId(@Param("userId") String userId);
+	public List<String> queryByUserId(@Param("userId") String userId);
 
 	/**
 	 * @功能:获取我的消息
 	 * @param announcementSendModel
 	 * @return
 	 */
-	List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page, @Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
+	public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page, @Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
 
 }

+ 1 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysCategoryMapper.java

@@ -27,4 +27,5 @@ public interface SysCategoryMapper extends BaseMapper<SysCategory> {
 	@Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
 	public String queryIdByCode(@Param("code")  String code);
 
+
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysDataSourceMapper.java

@@ -1,7 +1,7 @@
 package cn.com.ctop.common.module.mapper;
 
-import cn.com.ctop.common.module.entity.SysDataSource;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.common.system.entity.SysDataSource;
 
 /**
  * @Description: 多数据源管理

+ 0 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/SysDepartMapper.java


Some files were not shown because too many files changed in this diff