!591 发布 5.2.3 正式版
Merge pull request !591 from 疯狂的狮子Li/dev
已修改62个文件
已添加1个文件
已重命名8个文件
| | |
| | | <configuration default="false" name="ruoyi-monitor-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
| | | <deployment type="dockerfile"> |
| | | <settings> |
| | | <option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.2.2" /> |
| | | <option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.2.3" /> |
| | | <option name="buildOnly" value="true" /> |
| | | <option name="sourceFilePath" value="ruoyi-extend/ruoyi-monitor-admin/Dockerfile" /> |
| | | </settings> |
| | |
| | | <configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="æ¼ç¤ºæº"> |
| | | <deployment type="dockerfile"> |
| | | <settings> |
| | | <option name="imageTag" value="ruoyi/ruoyi-server:5.2.2" /> |
| | | <option name="imageTag" value="ruoyi/ruoyi-server:5.2.3" /> |
| | | <option name="buildOnly" value="true" /> |
| | | <option name="sourceFilePath" value="ruoyi-admin/Dockerfile" /> |
| | | </settings> |
| | | </deployment> |
| | | <method v="2" /> |
| | | </configuration> |
| | | </component> |
| | | </component> |
| | |
| | | <configuration default="false" name="ruoyi-snailjob-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> |
| | | <deployment type="dockerfile"> |
| | | <settings> |
| | | <option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.2.2" /> |
| | | <option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.2.3" /> |
| | | <option name="buildOnly" value="true" /> |
| | | <option name="sourceFilePath" value="ruoyi-extend/ruoyi-snailjob-server/Dockerfile" /> |
| | | </settings> |
| | |
| | | [](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/master/LICENSE) |
| | | [](https://www.jetbrains.com/?from=RuoYi-Vue-Plus) |
| | | <br> |
| | | [](https://gitee.com/dromara/RuoYi-Vue-Plus) |
| | | [](https://gitee.com/dromara/RuoYi-Vue-Plus) |
| | | []() |
| | | []() |
| | | []() |
| | |
| | | <description>RuoYi-Vue-Pluså¤ç§æ·ç®¡çç³»ç»</description> |
| | | |
| | | <properties> |
| | | <revision>5.2.2</revision> |
| | | <spring-boot.version>3.2.9</spring-boot.version> |
| | | <revision>5.2.3</revision> |
| | | <spring-boot.version>3.2.11</spring-boot.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <java.version>17</java.version> |
| | | <mybatis.version>3.5.16</mybatis.version> |
| | | <springdoc.version>2.6.0</springdoc.version> |
| | | <therapi-javadoc.version>0.15.0</therapi-javadoc.version> |
| | | <easyexcel.version>4.0.2</easyexcel.version> |
| | | <easyexcel.version>4.0.3</easyexcel.version> |
| | | <velocity.version>2.3</velocity.version> |
| | | <satoken.version>1.38.0</satoken.version> |
| | | <mybatis-plus.version>3.5.7</mybatis-plus.version> |
| | | <satoken.version>1.39.0</satoken.version> |
| | | <mybatis-plus.version>3.5.8</mybatis-plus.version> |
| | | <p6spy.version>3.9.1</p6spy.version> |
| | | <hutool.version>5.8.31</hutool.version> |
| | | <okhttp.version>4.10.0</okhttp.version> |
| | | <spring-boot-admin.version>3.2.3</spring-boot-admin.version> |
| | | <redisson.version>3.34.1</redisson.version> |
| | | <redisson.version>3.37.0</redisson.version> |
| | | <lock4j.version>2.2.7</lock4j.version> |
| | | <dynamic-ds.version>4.3.1</dynamic-ds.version> |
| | | <snailjob.version>1.1.2</snailjob.version> |
| | | <mapstruct-plus.version>1.4.4</mapstruct-plus.version> |
| | | <mapstruct-plus.version>1.4.5</mapstruct-plus.version> |
| | | <mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version> |
| | | <lombok.version>1.18.34</lombok.version> |
| | | <bouncycastle.version>1.76</bouncycastle.version> |
| | | <justauth.version>1.16.6</justauth.version> |
| | | <!-- 离线IPå°åå®ä½åº --> |
| | | <ip2region.version>2.7.0</ip2region.version> |
| | | <undertow.version>2.3.15.Final</undertow.version> |
| | | |
| | | <!-- OSS é
ç½® --> |
| | | <aws.sdk.version>2.25.15</aws.sdk.version> |
| | | <aws.crt.version>0.29.13</aws.crt.version> |
| | | <aws.sdk.version>2.28.22</aws.sdk.version> |
| | | <aws.crt.version>0.31.3</aws.crt.version> |
| | | <!-- SMS é
ç½® --> |
| | | <sms4j.version>3.3.2</sms4j.version> |
| | | <sms4j.version>3.3.3</sms4j.version> |
| | | <!-- éå¶æ¡æ¶ä¸çfastjsonçæ¬ --> |
| | | <fastjson.version>1.2.83</fastjson.version> |
| | | <!-- é¢åè¿è¡æ¶çD-ORMä¾èµ --> |
| | | <anyline.version>8.7.2-20240808</anyline.version> |
| | | <anyline.version>8.7.2-20241022</anyline.version> |
| | | <!--工使µé
ç½®--> |
| | | <flowable.version>7.0.1</flowable.version> |
| | | |
| | |
| | | <!-- ç¯å¢æ è¯ï¼éè¦ä¸é
ç½®æä»¶çåç§°ç¸å¯¹åº --> |
| | | <profiles.active>local</profiles.active> |
| | | <logging.level>info</logging.level> |
| | | <monitor.username>ruoyi</monitor.username> |
| | | <monitor.password>123456</monitor.password> |
| | | </properties> |
| | | </profile> |
| | | <profile> |
| | |
| | | <!-- ç¯å¢æ è¯ï¼éè¦ä¸é
ç½®æä»¶çåç§°ç¸å¯¹åº --> |
| | | <profiles.active>dev</profiles.active> |
| | | <logging.level>info</logging.level> |
| | | <monitor.username>ruoyi</monitor.username> |
| | | <monitor.password>123456</monitor.password> |
| | | </properties> |
| | | <activation> |
| | | <!-- é»è®¤ç¯å¢ --> |
| | |
| | | <properties> |
| | | <profiles.active>prod</profiles.active> |
| | | <logging.level>warn</logging.level> |
| | | <monitor.username>ruoyi</monitor.username> |
| | | <monitor.password>123456</monitor.password> |
| | | </properties> |
| | | </profile> |
| | | </profiles> |
| | |
| | | <version>${p6spy.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | <version>${okhttp.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- AWS SDK for Java 2.x --> |
| | | <dependency> |
| | | <groupId>software.amazon.awssdk</groupId> |
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.undertow</groupId> |
| | | <artifactId>undertow-core</artifactId> |
| | | <version>${undertow.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.undertow</groupId> |
| | | <artifactId>undertow-servlet</artifactId> |
| | | <version>${undertow.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.undertow</groupId> |
| | | <artifactId>undertow-websockets-jsr</artifactId> |
| | | <version>${undertow.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <artifactId>commons-compress</artifactId> |
| | | <groupId>org.apache.commons</groupId> |
| | | <version>1.26.2</version> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>2.15.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | metadata: |
| | | username: ${spring.boot.admin.client.username} |
| | | userpassword: ${spring.boot.admin.client.password} |
| | | username: ruoyi |
| | | password: 123456 |
| | | username: @monitor.username@ |
| | | password: @monitor.password@ |
| | | |
| | | --- # snail-job é
ç½® |
| | | snail-job: |
| | |
| | | namespace: ${spring.profiles.active} |
| | | # é主åºç¨ç«¯å£é£é¸ |
| | | port: 2${server.port} |
| | | # 客æ·ç«¯ipæå® |
| | | host: |
| | | |
| | | --- # æ°æ®æºé
ç½® |
| | | spring: |
| | |
| | | metadata: |
| | | username: ${spring.boot.admin.client.username} |
| | | userpassword: ${spring.boot.admin.client.password} |
| | | username: ruoyi |
| | | password: 123456 |
| | | username: @monitor.username@ |
| | | password: @monitor.password@ |
| | | |
| | | --- # snail-job é
ç½® |
| | | snail-job: |
| | |
| | | namespace: ${spring.profiles.active} |
| | | # é主åºç¨ç«¯å£é£é¸ |
| | | port: 2${server.port} |
| | | # 客æ·ç«¯ipæå® |
| | | host: |
| | | |
| | | --- # æ°æ®æºé
ç½® |
| | | spring: |
| | |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | excludeUrls: |
| | | - /system/notice |
| | | - /workflow/model/save |
| | | - /workflow/model/editModelXml |
| | | |
| | | # å
¨å±çº¿ç¨æ± ç¸å
³é
ç½® |
| | | # å¦ä½¿ç¨JDK21è¯·ç´æ¥ä½¿ç¨èæçº¿ç¨ ä¸è¦å¼å¯æ¤é
ç½® |
| | |
| | | </description> |
| | | |
| | | <properties> |
| | | <revision>5.2.2</revision> |
| | | <revision>5.2.3</revision> |
| | | </properties> |
| | | |
| | | <dependencyManagement> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.core.exception; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * sse ç¹å¶å¼å¸¸ |
| | | * |
| | | * @author LionLi |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public final class SseException extends RuntimeException { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * é误ç |
| | | */ |
| | | private Integer code; |
| | | |
| | | /** |
| | | * é误æç¤º |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * é误æç»ï¼å
é¨è°è¯é误 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | public SseException(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public SseException(String message, Integer code) { |
| | | this.message = message; |
| | | this.code = code; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public SseException setMessage(String message) { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | |
| | | public SseException setDetailMessage(String detailMessage) { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | } |
| | |
| | | import cn.hutool.core.lang.tree.TreeNodeConfig; |
| | | import cn.hutool.core.lang.tree.TreeUtil; |
| | | import cn.hutool.core.lang.tree.parser.NodeParser; |
| | | import org.dromara.common.core.utils.reflect.ReflectUtils; |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import org.dromara.common.core.utils.reflect.ReflectUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * æ©å± hutool TreeUtil å°è£
ç³»ç»æ æå»º |
| | |
| | | */ |
| | | public static final TreeNodeConfig DEFAULT_CONFIG = TreeNodeConfig.DEFAULT_CONFIG.setNameKey("label"); |
| | | |
| | | /** |
| | | * æå»ºæ å½¢ç»æ |
| | | * |
| | | * @param <T> è¾å
¥èç¹çç±»å |
| | | * @param <K> èç¹IDçç±»å |
| | | * @param list èç¹å表ï¼å
¶ä¸å
å«äºè¦æå»ºæ å½¢ç»æçææèç¹ |
| | | * @param nodeParser è§£æå¨ï¼ç¨äºå°è¾å
¥èç¹è½¬æ¢ä¸ºæ èç¹ |
| | | * @return æå»ºå¥½çæ å½¢ç»æå表 |
| | | */ |
| | | public static <T, K> List<Tree<K>> build(List<T> list, NodeParser<T, K> nodeParser) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return null; |
| | | return CollUtil.newArrayList(); |
| | | } |
| | | K k = ReflectUtils.invokeGetter(list.get(0), "parentId"); |
| | | return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser); |
| | | } |
| | | |
| | | /** |
| | | * è·åèç¹åè¡¨ä¸ææèç¹çå¶åèç¹ |
| | | * |
| | | * @param <K> èç¹IDçç±»å |
| | | * @param nodes èç¹å表 |
| | | * @return å
嫿æå¶åèç¹çå表 |
| | | */ |
| | | public static <K> List<Tree<K>> getLeafNodes(List<Tree<K>> nodes) { |
| | | if (CollUtil.isEmpty(nodes)) { |
| | | return CollUtil.newArrayList(); |
| | | } |
| | | return nodes.stream() |
| | | .flatMap(TreeBuildUtils::extractLeafNodes) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå®èç¹ä¸çææå¶åèç¹ |
| | | * |
| | | * @param <K> èç¹IDçç±»å |
| | | * @param node è¦æ¥æ¾å¶åèç¹çæ ¹èç¹ |
| | | * @return å
嫿æå¶åèç¹çå表 |
| | | */ |
| | | private static <K> Stream<Tree<K>> extractLeafNodes(Tree<K> node) { |
| | | if (!node.hasChild()) { |
| | | return Stream.of(node); |
| | | } else { |
| | | // éå½è°ç¨ï¼è·åææåèç¹çå¶åèç¹ |
| | | return node.getChildren().stream() |
| | | .flatMap(TreeBuildUtils::extractLeafNodes); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public static String extractFromString(String input, String regex, String defaultInput) { |
| | | try { |
| | | return ReUtil.get(regex, input, 1); |
| | | String str = ReUtil.get(regex, input, 1); |
| | | return str == null ? defaultInput : str; |
| | | } catch (Exception e) { |
| | | return defaultInput; |
| | | } |
| | |
| | | /** |
| | | * å®ä¹å¸¸ç¨ç sqlå
³é®å |
| | | */ |
| | | public static final String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare "; |
| | | public static String SQL_REGEX = "and |extractvalue|updatexml|sleep|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()"; |
| | | |
| | | /** |
| | | * ä»
æ¯æåæ¯ãæ°åãä¸å线ãç©ºæ ¼ãéå·ãå°æ°ç¹ï¼æ¯æå¤ä¸ªå段æåºï¼ |
| | |
| | | import org.springframework.util.ClassUtils; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | /** |
| | | * ç¼åå å¯å¨ |
| | | */ |
| | | Map<EncryptContext, IEncryptor> encryptorMap = new ConcurrentHashMap<>(); |
| | | Map<Integer, IEncryptor> encryptorMap = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * ç±»å å¯å段ç¼å |
| | |
| | | * @param encryptContext å 坿§è¡è
éè¦çç¸å
³é
ç½®åæ° |
| | | */ |
| | | public IEncryptor registAndGetEncryptor(EncryptContext encryptContext) { |
| | | if (encryptorMap.containsKey(encryptContext)) { |
| | | return encryptorMap.get(encryptContext); |
| | | int key = encryptContext.hashCode(); |
| | | if (encryptorMap.containsKey(key)) { |
| | | return encryptorMap.get(key); |
| | | } |
| | | IEncryptor encryptor = ReflectUtil.newInstance(encryptContext.getAlgorithm().getClazz(), encryptContext); |
| | | encryptorMap.put(encryptContext, encryptor); |
| | | encryptorMap.put(key, encryptor); |
| | | return encryptor; |
| | | } |
| | | |
| | |
| | | * @param encryptContext å 坿§è¡è
éè¦çç¸å
³é
ç½®åæ° |
| | | */ |
| | | public void removeEncryptor(EncryptContext encryptContext) { |
| | | this.encryptorMap.remove(encryptContext); |
| | | this.encryptorMap.remove(encryptContext.hashCode()); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <artifactId>commons-compress</artifactId> |
| | | <groupId>org.apache.commons</groupId> |
| | | <version>1.26.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception { |
| | | Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); |
| | | String requestMethod = operLog.getRequestMethod(); |
| | | if (MapUtil.isEmpty(paramsMap) |
| | | && HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) { |
| | | if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) { |
| | | String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames); |
| | | operLog.setOperParam(StringUtils.substring(params, 0, 2000)); |
| | | } else { |
| | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * èªå®ä¹ Mapper æ¥å£, å®ç° èªå®ä¹æ©å± |
| | |
| | | * @return æå
¥æä½æ¯å¦æåçå¸å°å¼ |
| | | */ |
| | | default boolean insertBatch(Collection<T> entityList) { |
| | | Db.saveBatch(entityList); |
| | | // 临æ¶è§£å³ æ°çæ¬ mp æå
¥ç¶æå¤æé误é®é¢ |
| | | return true; |
| | | return Db.saveBatch(entityList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æ´æ°æä½æ¯å¦æåçå¸å°å¼ |
| | | */ |
| | | default boolean updateBatchById(Collection<T> entityList) { |
| | | Db.updateBatchById(entityList); |
| | | // 临æ¶è§£å³ æ°çæ¬ mp æå
¥ç¶æå¤æé误é®é¢ |
| | | return true; |
| | | return Db.updateBatchById(entityList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æå
¥ææ´æ°æä½æ¯å¦æåçå¸å°å¼ |
| | | */ |
| | | default boolean insertOrUpdateBatch(Collection<T> entityList) { |
| | | Db.saveOrUpdateBatch(entityList); |
| | | // 临æ¶è§£å³ æ°çæ¬ mp æå
¥ç¶æå¤æé误é®é¢ |
| | | return true; |
| | | return Db.saveOrUpdateBatch(entityList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æå
¥æä½æ¯å¦æåçå¸å°å¼ |
| | | */ |
| | | default boolean insertBatch(Collection<T> entityList, int batchSize) { |
| | | Db.saveBatch(entityList, batchSize); |
| | | // 临æ¶è§£å³ æ°çæ¬ mp æå
¥ç¶æå¤æé误é®é¢ |
| | | return true; |
| | | return Db.saveBatch(entityList, batchSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æ´æ°æä½æ¯å¦æåçå¸å°å¼ |
| | | */ |
| | | default boolean updateBatchById(Collection<T> entityList, int batchSize) { |
| | | Db.updateBatchById(entityList, batchSize); |
| | | // 临æ¶è§£å³ æ°çæ¬ mp æå
¥ç¶æå¤æé误é®é¢ |
| | | return true; |
| | | return Db.updateBatchById(entityList, batchSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æå
¥ææ´æ°æä½æ¯å¦æåçå¸å°å¼ |
| | | */ |
| | | default boolean insertOrUpdateBatch(Collection<T> entityList, int batchSize) { |
| | | Db.saveOrUpdateBatch(entityList, batchSize); |
| | | // 临æ¶è§£å³ æ°çæ¬ mp æå
¥ç¶æå¤æé误é®é¢ |
| | | return true; |
| | | return Db.saveOrUpdateBatch(entityList, batchSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param idList 主é®IDéå |
| | | * @return æ¥è¯¢å°çVO对象å表 |
| | | */ |
| | | default List<V> selectVoBatchIds(Collection<? extends Serializable> idList) { |
| | | return selectVoBatchIds(idList, this.currentVoClass()); |
| | | default List<V> selectVoByIds(Collection<? extends Serializable> idList) { |
| | | return selectVoByIds(idList, this.currentVoClass()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param <C> VOç±»çç±»å |
| | | * @return æ¥è¯¢å°çVO对象å表ï¼ç»è¿è½¬æ¢ä¸ºæå®çVOç±»åè¿å |
| | | */ |
| | | default <C> List<C> selectVoBatchIds(Collection<? extends Serializable> idList, Class<C> voClass) { |
| | | List<T> list = this.selectBatchIds(idList); |
| | | default <C> List<C> selectVoByIds(Collection<? extends Serializable> idList, Class<C> voClass) { |
| | | List<T> list = this.selectByIds(idList); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return CollUtil.newArrayList(); |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.sf.jsqlparser.JSQLParserException; |
| | | import net.sf.jsqlparser.expression.Expression; |
| | | import net.sf.jsqlparser.expression.Parenthesis; |
| | | import net.sf.jsqlparser.expression.operators.conditional.AndExpression; |
| | | import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList; |
| | | import net.sf.jsqlparser.parser.CCJSqlParserUtil; |
| | | import org.apache.ibatis.io.Resources; |
| | | import org.dromara.common.core.domain.dto.RoleDTO; |
| | |
| | | try { |
| | | Expression expression = CCJSqlParserUtil.parseExpression(dataFilterSql); |
| | | // æ°æ®æé使ç¨åç¬çæ¬å· 鲿¢ä¸å
¶ä»æ¡ä»¶å²çª |
| | | Parenthesis parenthesis = new Parenthesis(expression); |
| | | ParenthesedExpressionList<Expression> parenthesis = new ParenthesedExpressionList<>(expression); |
| | | if (ObjectUtil.isNotNull(where)) { |
| | | return new AndExpression(where, parenthesis); |
| | | } else { |
| | |
| | | // charindex(',100,' , ',0,100,101,') <> 0 |
| | | return "charindex(',%s,' , ','+%s+',') <> 0".formatted(var, var2); |
| | | } else if (dataBasyType == DataBaseType.POSTGRE_SQL) { |
| | | // (select position(',100,' in ',0,100,101,')) <> 0 |
| | | return "(select position(',%s,' in ','||%s||',')) <> 0".formatted(var, var2); |
| | | // (select strpos(',0,100,101,' , ',100,')) <> 0 |
| | | return "(select strpos(','||%s||',' , ',%s,')) <> 0".formatted(var2, var); |
| | | } else if (dataBasyType == DataBaseType.ORACLE) { |
| | | // instr(',0,100,101,' , ',100,') <> 0 |
| | | return "instr(','||%s||',' , ',%s,') <> 0".formatted(var2, var); |
| | |
| | | import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; |
| | | import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; |
| | | import software.amazon.awssdk.core.ResponseInputStream; |
| | | import software.amazon.awssdk.core.async.AsyncRequestBody; |
| | | import software.amazon.awssdk.core.async.AsyncResponseTransformer; |
| | | import software.amazon.awssdk.core.async.BlockingInputStreamAsyncRequestBody; |
| | | import software.amazon.awssdk.regions.Region; |
| | | import software.amazon.awssdk.services.s3.S3AsyncClient; |
| | | import software.amazon.awssdk.services.s3.S3Configuration; |
| | | import software.amazon.awssdk.services.s3.crt.S3CrtHttpConfiguration; |
| | | import software.amazon.awssdk.services.s3.model.GetObjectResponse; |
| | | import software.amazon.awssdk.services.s3.model.NoSuchBucketException; |
| | | import software.amazon.awssdk.services.s3.model.S3Exception; |
| | |
| | | StaticCredentialsProvider credentialsProvider = StaticCredentialsProvider.create( |
| | | AwsBasicCredentials.create(properties.getAccessKey(), properties.getSecretKey())); |
| | | |
| | | //MinIO ä½¿ç¨ HTTPS éå¶ä½¿ç¨åå访é®ï¼ç«ç¹å¡«ååãéè¦å¯ç¨è·¯å¾æ ·å¼è®¿é® |
| | | boolean isStyle = !StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE); |
| | | //使ç¨å¯¹è±¡å卿塿¶è¦æ±æç¡®é
ç½®è®¿é®æ ·å¼ï¼è·¯å¾æ ·å¼æèææç®¡æ ·å¼ï¼ãéè¦å¯ç¨è·¯å¾æ ·å¼è®¿é® |
| | | boolean isStyle = true; |
| | | |
| | | //å建AWSåºäº CRT ç S3 客æ·ç«¯ |
| | | this.client = S3AsyncClient.crtBuilder() |
| | |
| | | .minimumPartSizeInBytes(10 * 1025 * 1024L) |
| | | .checksumValidationEnabled(false) |
| | | .forcePathStyle(isStyle) |
| | | .httpConfiguration(S3CrtHttpConfiguration.builder() |
| | | .connectionTimeout(Duration.ofSeconds(60)) // è®¾ç½®è¿æ¥è¶
æ¶ |
| | | .build()) |
| | | .build(); |
| | | |
| | | //AWSåºäº CRT ç S3 AsyncClient å®ä¾ç¨ä½ S3 ä¼ è¾ç®¡çå¨çåºå±å®¢æ·ç«¯ |
| | |
| | | .key(key) |
| | | .contentMD5(StringUtils.isNotEmpty(md5Digest) ? md5Digest : null) |
| | | .contentType(contentType) |
| | | .acl(getAccessPolicy().getObjectCannedACL()) |
| | | // ç¨äºè®¾ç½®å¯¹è±¡çè®¿é®æ§å¶å表ï¼ACLï¼ãä¸åäºåå对ACLçæ¯æåå®ç°æ¹å¼ææä¸åï¼ |
| | | // å æ¤æ ¹æ®å
·ä½çäºæå¡æä¾åï¼ä½ å¯è½éè¦è¿è¡ä¸åçé
ç½®ï¼èªè¡å¼å¯ï¼é¿éäºæaclæéé
ç½®ï¼è
¾è®¯äºæ²¡æaclæéé
ç½®ï¼ |
| | | //.acl(getAccessPolicy().getObjectCannedACL()) |
| | | .build()) |
| | | .addTransferListener(LoggingTransferListener.create()) |
| | | .source(filePath).build()); |
| | |
| | | } |
| | | try { |
| | | // åå»ºå¼æ¥è¯·æ±ä½ï¼lengthå¦æä¸ºç©ºä¼æ¥éï¼ |
| | | BlockingInputStreamAsyncRequestBody body = AsyncRequestBody.forBlockingInputStream(length); |
| | | BlockingInputStreamAsyncRequestBody body = BlockingInputStreamAsyncRequestBody.builder() |
| | | .contentLength(length) |
| | | .subscribeTimeout(Duration.ofSeconds(30)) |
| | | .build(); |
| | | |
| | | // ä½¿ç¨ transferManager è¿è¡ä¸ä¼ |
| | | Upload upload = transferManager.upload( |
| | |
| | | y -> y.bucket(properties.getBucketName()) |
| | | .key(key) |
| | | .contentType(contentType) |
| | | .acl(getAccessPolicy().getObjectCannedACL()) |
| | | // ç¨äºè®¾ç½®å¯¹è±¡çè®¿é®æ§å¶å表ï¼ACLï¼ãä¸åäºåå对ACLçæ¯æåå®ç°æ¹å¼ææä¸åï¼ |
| | | // å æ¤æ ¹æ®å
·ä½çäºæå¡æä¾åï¼ä½ å¯è½éè¦è¿è¡ä¸åçé
ç½®ï¼èªè¡å¼å¯ï¼é¿éäºæaclæéé
ç½®ï¼è
¾è®¯äºæ²¡æaclæéé
ç½®ï¼ |
| | | //.acl(getAccessPolicy().getObjectCannedACL()) |
| | | .build()) |
| | | .build()); |
| | | |
| | |
| | | * @return UploadResult å
å«ä¸ä¼ åçæä»¶ä¿¡æ¯ |
| | | * @throws OssException 妿ä¸ä¼ å¤±è´¥ï¼æåºèªå®ä¹å¼å¸¸ |
| | | */ |
| | | public UploadResult uploadSuffix(byte[] data, String suffix) { |
| | | return upload(new ByteArrayInputStream(data), getPath(properties.getPrefix(), suffix), Long.valueOf(data.length), FileUtils.getMimeType(suffix)); |
| | | public UploadResult uploadSuffix(byte[] data, String suffix, String contentType) { |
| | | return upload(new ByteArrayInputStream(data), getPath(properties.getPrefix(), suffix), Long.valueOf(data.length), contentType); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return UploadResult å
å«ä¸ä¼ åçæä»¶ä¿¡æ¯ |
| | | * @throws OssException 妿ä¸ä¼ å¤±è´¥ï¼æåºèªå®ä¹å¼å¸¸ |
| | | */ |
| | | public UploadResult uploadSuffix(InputStream inputStream, String suffix, Long length) { |
| | | return upload(inputStream, getPath(properties.getPrefix(), suffix), length, FileUtils.getMimeType(suffix)); |
| | | public UploadResult uploadSuffix(InputStream inputStream, String suffix, Long length, String contentType) { |
| | | return upload(inputStream, getPath(properties.getPrefix(), suffix), length, contentType); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public <T> T get(Object key, Class<T> type) { |
| | | Object o = CAFFEINE.get(getUniqueKey(key), k -> cache.get(key, type)); |
| | | return (T) o; |
| | |
| | | cache.put(key, value); |
| | | } |
| | | |
| | | @Override |
| | | public ValueWrapper putIfAbsent(Object key, Object value) { |
| | | CAFFEINE.invalidate(getUniqueKey(key)); |
| | | return cache.putIfAbsent(key, value); |
| | |
| | | evictIfPresent(key); |
| | | } |
| | | |
| | | @Override |
| | | public boolean evictIfPresent(Object key) { |
| | | boolean b = cache.evictIfPresent(key); |
| | | if (b) { |
| | |
| | | cache.clear(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean invalidate() { |
| | | return cache.invalidate(); |
| | | } |
| | |
| | | package org.dromara.common.redis.utils; |
| | | |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import org.redisson.api.RMap; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.springframework.cache.Cache; |
| | | import org.springframework.cache.CacheManager; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * ç¼åæä½å·¥å
·ç±» {@link } |
| | | * ç¼åæä½å·¥å
·ç±» |
| | | * |
| | | * @author Michelle.Chung |
| | | * @date 2022/8/13 |
| | | */ |
| | | @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| | | @SuppressWarnings(value = {"unchecked"}) |
| | | public class CacheUtils { |
| | | |
| | | private static final CacheManager CACHE_MANAGER = SpringUtils.getBean(CacheManager.class); |
| | | |
| | | /** |
| | | * è·åç¼åç»å
ææçKEY |
| | | * |
| | | * @param cacheNames ç¼åç»åç§° |
| | | */ |
| | | public static Set<Object> keys(String cacheNames) { |
| | | RMap<Object, Object> rmap = (RMap<Object, Object>) CACHE_MANAGER.getCache(cacheNames).getNativeCache(); |
| | | return rmap.keySet(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¼åå¼ |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·å¾ç¼åçåºæ¬å¯¹è±¡å表 |
| | | * è·å¾ç¼åçåºæ¬å¯¹è±¡å表(å
¨å±å¹é
忽ç¥ç§æ· èªè¡æ¼æ¥ç§æ·id) |
| | | * |
| | | * @param pattern å符串åç¼ |
| | | * @return 对象å表 |
| | |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¼åçåºæ¬å¯¹è±¡å表 |
| | | * å é¤ç¼åçåºæ¬å¯¹è±¡å表(å
¨å±å¹é
忽ç¥ç§æ· èªè¡æ¼æ¥ç§æ·id) |
| | | * |
| | | * @param pattern å符串åç¼ |
| | | */ |
| | |
| | | import cn.dev33.satoken.router.SaRouter; |
| | | import cn.dev33.satoken.stp.StpUtil; |
| | | import cn.dev33.satoken.util.SaResult; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.dromara.common.core.constant.HttpStatus; |
| | | import org.dromara.common.core.exception.SseException; |
| | | import org.dromara.common.core.utils.ServletUtils; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | .match(allUrlHandler.getUrls()) |
| | | // å¯¹æªæé¤çè·¯å¾è¿è¡æ£æ¥ |
| | | .check(() -> { |
| | | HttpServletRequest request = ServletUtils.getRequest(); |
| | | // æ£æ¥æ¯å¦ç»å½ æ¯å¦ætoken |
| | | StpUtil.checkLogin(); |
| | | try { |
| | | StpUtil.checkLogin(); |
| | | } catch (NotLoginException e) { |
| | | if (request.getRequestURI().contains("sse")) { |
| | | throw new SseException(e.getMessage(), e.getCode()); |
| | | } else { |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | // æ£æ¥ header ä¸ param éç clientid ä¸ token éçæ¯å¦ä¸è´ |
| | | String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY); |
| | | String headerCid = request.getHeader(LoginHelper.CLIENT_KEY); |
| | | String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY); |
| | | String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString(); |
| | | if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) { |
| | |
| | | package org.dromara.common.sse.core; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.dromara.common.redis.utils.RedisUtils; |
| | | import org.dromara.common.sse.dto.SseMessageDto; |
| | | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.function.Consumer; |
| | |
| | | * @param sseMessageDto è¦åå¸çSSEæ¶æ¯å¯¹è±¡ |
| | | */ |
| | | public void publishMessage(SseMessageDto sseMessageDto) { |
| | | List<Long> unsentUserIds = new ArrayList<>(); |
| | | // å½åæå¡å
ç¨æ·,ç´æ¥åéæ¶æ¯ |
| | | for (Long userId : sseMessageDto.getUserIds()) { |
| | | if (USER_TOKEN_EMITTERS.containsKey(userId)) { |
| | | sendMessage(userId, sseMessageDto.getMessage()); |
| | | continue; |
| | | } |
| | | unsentUserIds.add(userId); |
| | | } |
| | | // ä¸å¨å½åæå¡å
ç¨æ·,åå¸è®¢é
æ¶æ¯ |
| | | if (CollUtil.isNotEmpty(unsentUserIds)) { |
| | | SseMessageDto broadcastMessage = new SseMessageDto(); |
| | | broadcastMessage.setMessage(sseMessageDto.getMessage()); |
| | | broadcastMessage.setUserIds(unsentUserIds); |
| | | RedisUtils.publish(SSE_TOPIC, broadcastMessage, consumer -> { |
| | | log.info("SSEåé主é¢è®¢é
æ¶æ¯topic:{} session keys:{} message:{}", |
| | | SSE_TOPIC, unsentUserIds, sseMessageDto.getMessage()); |
| | | }); |
| | | } |
| | | SseMessageDto broadcastMessage = new SseMessageDto(); |
| | | broadcastMessage.setMessage(sseMessageDto.getMessage()); |
| | | broadcastMessage.setUserIds(sseMessageDto.getUserIds()); |
| | | RedisUtils.publish(SSE_TOPIC, broadcastMessage, consumer -> { |
| | | log.info("SSEåé主é¢è®¢é
æ¶æ¯topic:{} session keys:{} message:{}", |
| | | SSE_TOPIC, sseMessageDto.getUserIds(), sseMessageDto.getMessage()); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | String tenantId = TenantHelper.getTenantId(); |
| | | if (StringUtils.isBlank(tenantId)) { |
| | | log.error("æ æ³è·åææçç§æ·id -> Null"); |
| | | log.debug("æ æ³è·åææçç§æ·id -> Null"); |
| | | return super.map(name); |
| | | } |
| | | if (StringUtils.startsWith(name, tenantId + "")) { |
| | | // 妿åå¨åç´æ¥è¿å |
| | |
| | | } |
| | | String tenantId = TenantHelper.getTenantId(); |
| | | if (StringUtils.isBlank(tenantId)) { |
| | | log.error("æ æ³è·åææçç§æ·id -> Null"); |
| | | log.debug("æ æ³è·åææçç§æ·id -> Null"); |
| | | return super.unmap(name); |
| | | } |
| | | if (StringUtils.startsWith(unmap, tenantId + "")) { |
| | | // 妿åå¨åå é¤ |
| | |
| | | package org.dromara.common.tenant.helper; |
| | | |
| | | import cn.dev33.satoken.stp.StpUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | |
| | | if (!isEnable()) { |
| | | return; |
| | | } |
| | | if (!isLogin() || !global) { |
| | | if (!LoginHelper.isLogin() || !global) { |
| | | TEMP_DYNAMIC_TENANT.set(tenantId); |
| | | return; |
| | | } |
| | |
| | | if (!isEnable()) { |
| | | return null; |
| | | } |
| | | if (!isLogin()) { |
| | | if (!LoginHelper.isLogin()) { |
| | | return TEMP_DYNAMIC_TENANT.get(); |
| | | } |
| | | // å¦æçº¿ç¨å
æå¼ ä¼å
è¿å |
| | |
| | | if (!isEnable()) { |
| | | return; |
| | | } |
| | | if (!isLogin()) { |
| | | if (!LoginHelper.isLogin()) { |
| | | TEMP_DYNAMIC_TENANT.remove(); |
| | | return; |
| | | } |
| | |
| | | tenantId = LoginHelper.getTenantId(); |
| | | } |
| | | return tenantId; |
| | | } |
| | | |
| | | private static boolean isLogin() { |
| | | try { |
| | | StpUtil.checkLogin(); |
| | | return true; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.undertow</groupId> |
| | | <artifactId>undertow-core</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.undertow</groupId> |
| | | <artifactId>undertow-servlet</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.undertow</groupId> |
| | | <artifactId>undertow-websockets-jsr</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | |
| | | package org.dromara.common.web.config; |
| | | |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import jakarta.servlet.DispatcherType; |
| | | import org.dromara.common.web.config.properties.XssProperties; |
| | | import org.dromara.common.web.filter.RepeatableFilter; |
| | | import org.dromara.common.web.filter.XssFilter; |
| | | import jakarta.servlet.DispatcherType; |
| | | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Filteré
ç½® |
| | |
| | | @EnableConfigurationProperties(XssProperties.class) |
| | | public class FilterConfig { |
| | | |
| | | @SuppressWarnings({"rawtypes", "unchecked"}) |
| | | @Bean |
| | | @ConditionalOnProperty(value = "xss.enabled", havingValue = "true") |
| | | public FilterRegistrationBean xssFilterRegistration(XssProperties xssProperties) { |
| | | FilterRegistrationBean registration = new FilterRegistrationBean(); |
| | | public FilterRegistrationBean<XssFilter> xssFilterRegistration() { |
| | | FilterRegistrationBean<XssFilter> registration = new FilterRegistrationBean<>(); |
| | | registration.setDispatcherTypes(DispatcherType.REQUEST); |
| | | registration.setFilter(new XssFilter()); |
| | | registration.addUrlPatterns(StringUtils.split(xssProperties.getUrlPatterns(), StringUtils.SEPARATOR)); |
| | | registration.addUrlPatterns("/*"); |
| | | registration.setName("xssFilter"); |
| | | registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); |
| | | Map<String, String> initParameters = new HashMap<>(); |
| | | initParameters.put("excludes", xssProperties.getExcludes()); |
| | | registration.setInitParameters(initParameters); |
| | | registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE + 1); |
| | | return registration; |
| | | } |
| | | |
| | | @SuppressWarnings({"rawtypes", "unchecked"}) |
| | | @Bean |
| | | public FilterRegistrationBean someFilterRegistration() { |
| | | FilterRegistrationBean registration = new FilterRegistrationBean(); |
| | | public FilterRegistrationBean<RepeatableFilter> someFilterRegistration() { |
| | | FilterRegistrationBean<RepeatableFilter> registration = new FilterRegistrationBean<>(); |
| | | registration.setFilter(new RepeatableFilter()); |
| | | registration.addUrlPatterns("/*"); |
| | | registration.setName("repeatableFilter"); |
| | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * xssè¿æ»¤ é
ç½®å±æ§ |
| | | * |
| | |
| | | public class XssProperties { |
| | | |
| | | /** |
| | | * è¿æ»¤å¼å
³ |
| | | * Xsså¼å
³ |
| | | */ |
| | | private String enabled; |
| | | private Boolean enabled; |
| | | |
| | | /** |
| | | * æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | * æé¤è·¯å¾ |
| | | */ |
| | | private String excludes; |
| | | |
| | | /** |
| | | * å¹é
龿¥ |
| | | */ |
| | | private String urlPatterns; |
| | | private List<String> excludeUrls = new ArrayList<>(); |
| | | |
| | | } |
| | |
| | | package org.dromara.common.web.filter; |
| | | |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.web.config.properties.XssProperties; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | import jakarta.servlet.*; |
| | |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException { |
| | | String tempExcludes = filterConfig.getInitParameter("excludes"); |
| | | if (StringUtils.isNotEmpty(tempExcludes)) { |
| | | String[] url = tempExcludes.split(StringUtils.SEPARATOR); |
| | | for (int i = 0; url != null && i < url.length; i++) { |
| | | excludes.add(url[i]); |
| | | } |
| | | } |
| | | XssProperties properties = SpringUtils.getBean(XssProperties.class); |
| | | excludes.addAll(properties.getExcludeUrls()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * XSSè¿æ»¤å¤ç |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String getParameter(String name) { |
| | | String value = super.getParameter(name); |
| | | if (value != null) { |
| | | return HtmlUtil.cleanHtmlTag(value).trim(); |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String[]> getParameterMap() { |
| | | Map<String, String[]> valueMap = super.getParameterMap(); |
| | | for (Map.Entry<String, String[]> entry : valueMap.entrySet()) { |
| | | String[] values = entry.getValue(); |
| | | if (values != null) { |
| | | int length = values.length; |
| | | String[] escapseValues = new String[length]; |
| | | for (int i = 0; i < length; i++) { |
| | | // é²xssæ»å»åè¿æ»¤ååç©ºæ ¼ |
| | | escapseValues[i] = HtmlUtil.cleanHtmlTag(values[i]).trim(); |
| | | } |
| | | valueMap.put(entry.getKey(), escapseValues); |
| | | } |
| | | } |
| | | return valueMap; |
| | | } |
| | | |
| | | @Override |
| | | public String[] getParameterValues(String name) { |
| | | String[] values = super.getParameterValues(name); |
| | | if (values != null) { |
| | |
| | | } |
| | | return escapseValues; |
| | | } |
| | | return super.getParameterValues(name); |
| | | return values; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.http.HttpStatus; |
| | | import jakarta.servlet.ServletException; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.validation.ConstraintViolation; |
| | | import jakarta.validation.ConstraintViolationException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.exception.SseException; |
| | | import org.dromara.common.core.exception.base.BaseException; |
| | | import org.dromara.common.core.utils.StreamUtils; |
| | | import org.dromara.common.json.utils.JsonUtils; |
| | | import org.springframework.context.support.DefaultMessageSourceResolvable; |
| | | import org.springframework.validation.BindException; |
| | | import org.springframework.web.HttpRequestMethodNotSupportedException; |
| | |
| | | log.error(e.getMessage()); |
| | | Integer code = e.getCode(); |
| | | return ObjectUtil.isNotNull(code) ? R.fail(code, e.getMessage()) : R.fail(e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 认è¯å¤±è´¥ |
| | | */ |
| | | @ResponseStatus(org.springframework.http.HttpStatus.UNAUTHORIZED) |
| | | @ExceptionHandler(SseException.class) |
| | | public String handleNotLoginException(SseException e, HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请æ±å°å'{}',认è¯å¤±è´¥'{}',æ æ³è®¿é®ç³»ç»èµæº", requestURI, e.getMessage()); |
| | | return JsonUtils.toJsonString(R.fail(HttpStatus.HTTP_UNAUTHORIZED, "认è¯å¤±è´¥ï¼æ æ³è®¿é®ç³»ç»èµæº")); |
| | | } |
| | | |
| | | /** |
| | | * servletå¼å¸¸ |
| | | */ |
| | | @ExceptionHandler(ServletException.class) |
| | | public R<Void> handleServletException(ServletException e, HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请æ±å°å'{}',åçæªç¥å¼å¸¸.", requestURI, e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ExceptionHandler(MethodArgumentNotValidException.class) |
| | | public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { |
| | | log.error(e.getMessage()); |
| | | String message = e.getBindingResult().getFieldError().getDefaultMessage(); |
| | | String message = StreamUtils.join(e.getBindingResult().getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", "); |
| | | return R.fail(message); |
| | | } |
| | | |
| | |
| | | |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.map.MapUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Override |
| | | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
| | | StopWatch stopWatch = KEY_CACHE.get(); |
| | | stopWatch.stop(); |
| | | log.info("[PLUS]ç»æè¯·æ± => URL[{}],èæ¶:[{}]毫ç§", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime()); |
| | | KEY_CACHE.remove(); |
| | | if (ObjectUtil.isNotNull(stopWatch)) { |
| | | stopWatch.stop(); |
| | | log.info("[PLUS]ç»æè¯·æ± => URL[{}],èæ¶:[{}]毫ç§", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime()); |
| | | KEY_CACHE.remove(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | spring: |
| | | security: |
| | | user: |
| | | name: ruoyi |
| | | password: 123456 |
| | | name: @monitor.username@ |
| | | password: @monitor.password@ |
| | | boot: |
| | | admin: |
| | | ui: |
| | |
| | | metadata: |
| | | username: ${spring.boot.admin.client.username} |
| | | userpassword: ${spring.boot.admin.client.password} |
| | | username: ruoyi |
| | | password: 123456 |
| | | username: @monitor.username@ |
| | | password: @monitor.password@ |
| | |
| | | <groupId>com.aizuda</groupId> |
| | | <artifactId>snail-job-server-starter</artifactId> |
| | | <version>${snailjob.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.scala-lang</groupId> |
| | | <artifactId>scala-library</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.scala-lang</groupId> |
| | | <artifactId>scala-library</artifactId> |
| | | <version>2.13.9</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | metadata: |
| | | username: ${spring.boot.admin.client.username} |
| | | userpassword: ${spring.boot.admin.client.password} |
| | | username: ruoyi |
| | | password: 123456 |
| | | username: @monitor.username@ |
| | | password: @monitor.password@ |
| | |
| | | metadata: |
| | | username: ${spring.boot.admin.client.username} |
| | | userpassword: ${spring.boot.admin.client.password} |
| | | username: ruoyi |
| | | password: 123456 |
| | | username: @monitor.username@ |
| | | password: @monitor.password@ |
| | |
| | | @DataColumn(key = "deptName", value = "dept_id"), |
| | | @DataColumn(key = "userName", value = "user_id") |
| | | }, joinStr = "AND") |
| | | List<TestDemo> selectBatchIds(@Param(Constants.COLL) Collection<? extends Serializable> idList); |
| | | List<TestDemo> selectByIds(@Param(Constants.COLL) Collection<? extends Serializable> idList); |
| | | |
| | | @Override |
| | | @DataPermission({ |
| | |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if (isValid) { |
| | | // åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | List<TestDemo> list = baseMapper.selectBatchIds(ids); |
| | | List<TestDemo> list = baseMapper.selectByIds(ids); |
| | | if (list.size() != ids.size()) { |
| | | throw new ServiceException("æ¨æ²¡æå 餿é!"); |
| | | } |
| | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.anyline</groupId>--> |
| | | <!-- <artifactId>anyline-data-jdbc-oracle</artifactId>--> |
| | | <!-- <version>${anyline.version}</version>--> |
| | | <!-- <version>${anyline.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.anyline</groupId>--> |
| | | <!-- <artifactId>anyline-data-jdbc-postgresql</artifactId>--> |
| | | <!-- <version>${anyline.version}</version>--> |
| | | <!-- <version>${anyline.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.anyline</groupId>--> |
| | | <!-- <artifactId>anyline-data-jdbc-mssql</artifactId>--> |
| | | <!-- <version>${anyline.version}</version>--> |
| | | <!-- <version>${anyline.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | </dependencies> |
| | |
| | | * æ°æ®åºæ¶é´ç±»å |
| | | */ |
| | | String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp", "year", "interval", |
| | | "smalldatetime", "datetime2", "datetimeoffset"}; |
| | | "smalldatetime", "datetime2", "datetimeoffset", "timestamptz"}; |
| | | |
| | | /** |
| | | * æ°æ®åºæ°åç±»å |
| | | */ |
| | | String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", |
| | | "bit", "bigint", "float", "double", "decimal", "numeric", "real", "double precision", |
| | | String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "int2", "int4", "int8", "number", "integer", |
| | | "bit", "bigint", "float", "float4", "float8", "double", "decimal", "numeric", "real", "double precision", |
| | | "smallserial", "serial", "bigserial", "money", "smallmoney"}; |
| | | |
| | | /** |
| | |
| | | * ä¸çº§èåIDåæ®µ |
| | | */ |
| | | @TableField(exist = false) |
| | | private String parentMenuId; |
| | | private Long parentMenuId; |
| | | |
| | | /** |
| | | * ä¸çº§èååç§°åæ®µ |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.generator.domain.GenTable; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | GenTable selectGenTableByName(String tableName); |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®æ°æ®æºä¸çææè¡¨åå表 |
| | | * |
| | | * @param dataName æ°æ®æºåç§°ï¼ç¨äºéæ©ä¸åçæ°æ®æº |
| | | * @return å½åæ°æ®åºä¸ç表åå表 |
| | | * |
| | | * @DS("") 使ç¨é»è®¤æ°æ®æºæ§è¡æ¥è¯¢æä½ |
| | | */ |
| | | @DS("") |
| | | List<String> selectTableNameList(String dataName); |
| | | } |
| | |
| | | } |
| | | // è¿æ»¤å¹¶è½¬æ¢è¡¨æ ¼æ°æ® |
| | | List<GenTable> tables = tablesMap.values().stream() |
| | | .filter(x -> !StringUtils.containsAnyIgnoreCase(x.getName(), TABLE_IGNORE)) |
| | | .filter(x -> !startWithAnyIgnoreCase(x.getName(), TABLE_IGNORE)) |
| | | .filter(x -> { |
| | | if (CollUtil.isEmpty(tableNames)) { |
| | | return true; |
| | |
| | | // æå¨å页 setæ°æ® |
| | | page.setRecords(CollUtil.page((int) page.getCurrent() - 1, (int) page.getSize(), tables)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | public static boolean startWithAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { |
| | | // 夿æ¯å¦æ¯ä»¥æå®å符串å¼å¤´ |
| | | for (CharSequence searchCharSequence : searchCharSequences) { |
| | | if (StringUtils.startsWithIgnoreCase(cs, searchCharSequence)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | String treeCode = paramsObj.getStr(GenConstants.TREE_CODE); |
| | | String treeParentCode = paramsObj.getStr(GenConstants.TREE_PARENT_CODE); |
| | | String treeName = paramsObj.getStr(GenConstants.TREE_NAME); |
| | | String parentMenuId = paramsObj.getStr(GenConstants.PARENT_MENU_ID); |
| | | Long parentMenuId = paramsObj.getLong(GenConstants.PARENT_MENU_ID); |
| | | String parentMenuName = paramsObj.getStr(GenConstants.PARENT_MENU_NAME); |
| | | |
| | | genTable.setTreeCode(treeCode); |
| | |
| | | * ${column.columnComment}Url |
| | | */ |
| | | @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "${column.javaField}") |
| | | private String ${column.javaField}Url"; |
| | | private String ${column.javaField}Url; |
| | | #end |
| | | #end |
| | | #end |
| | |
| | | return toAjax(TenantHelper.ignore(() -> tenantService.syncTenantPackage(tenantId, packageId))); |
| | | } |
| | | |
| | | /** |
| | | * åæ¥ç§æ·åå
¸ |
| | | */ |
| | | @SaCheckRole(TenantConstants.SUPER_ADMIN_ROLE_KEY) |
| | | @Log(title = "åæ¥ç§æ·åå
¸", businessType = BusinessType.INSERT) |
| | | @GetMapping("/syncTenantDict") |
| | | public R<Void> syncTenantDict() { |
| | | if (!TenantHelper.isEnable()) { |
| | | return R.fail("å½åæªå¼å¯ç§æ·æ¨¡å¼"); |
| | | } |
| | | tenantService.syncTenantDict(); |
| | | return R.ok("åæ¥ç§æ·åå
¸æå"); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.crypto.digest.BCrypt; |
| | | import cn.hutool.http.HtmlUtil; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import jakarta.validation.ConstraintViolation; |
| | | import jakarta.validation.ConstraintViolationException; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StreamUtils; |
| | | import org.dromara.common.core.utils.ValidatorUtils; |
| | | import org.dromara.common.excel.core.ExcelListener; |
| | | import org.dromara.common.excel.core.ExcelResult; |
| | |
| | | } |
| | | } catch (Exception e) { |
| | | failureNum++; |
| | | String msg = "<br/>" + failureNum + "ãè´¦å· " + userVo.getUserName() + " 导å
¥å¤±è´¥ï¼"; |
| | | failureMsg.append(msg).append(e.getMessage()); |
| | | String msg = "<br/>" + failureNum + "ãè´¦å· " + HtmlUtil.cleanHtmlTag(userVo.getUserName()) + " 导å
¥å¤±è´¥ï¼"; |
| | | String message = e.getMessage(); |
| | | if (e instanceof ConstraintViolationException cvException) { |
| | | message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", "); |
| | | } |
| | | failureMsg.append(msg).append(message); |
| | | log.error(msg, e); |
| | | } |
| | | } |
| | |
| | | * åæ¥ç§æ·å¥é¤ |
| | | */ |
| | | Boolean syncTenantPackage(String tenantId, Long packageId); |
| | | |
| | | /** |
| | | * åæ¥ç§æ·åå
¸ |
| | | */ |
| | | void syncTenantDict(); |
| | | } |
| | |
| | | dept.setAncestors(newAncestors); |
| | | updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); |
| | | } |
| | | } else { |
| | | dept.setAncestors(oldDept.getAncestors()); |
| | | } |
| | | int result = baseMapper.updateById(dept); |
| | | if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) |
| | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.core.utils.ip.AddressUtils; |
| | | import org.dromara.common.log.event.OperLogEvent; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.system.domain.SysOperLog; |
| | | import org.dromara.system.domain.bo.SysOperLogBo; |
| | | import org.dromara.system.domain.vo.SysOperLogVo; |
| | | import org.dromara.system.mapper.SysOperLogMapper; |
| | | import org.dromara.system.service.ISysOperLogService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Override |
| | | public TableDataInfo<SysOperLogVo> selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysOperLog> lqw = buildQueryWrapper(operLog); |
| | | if (StringUtils.isBlank(pageQuery.getOrderByColumn())) { |
| | | pageQuery.setOrderByColumn("oper_id"); |
| | | pageQuery.setIsAsc("desc"); |
| | | } |
| | | Page<SysOperLogVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysOperLog> buildQueryWrapper(SysOperLogBo operLog) { |
| | | Map<String, Object> params = operLog.getParams(); |
| | | LambdaQueryWrapper<SysOperLog> lqw = new LambdaQueryWrapper<SysOperLog>() |
| | | return new LambdaQueryWrapper<SysOperLog>() |
| | | .like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp()) |
| | | .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | |
| | | .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")); |
| | | if (StringUtils.isBlank(pageQuery.getOrderByColumn())) { |
| | | pageQuery.setOrderByColumn("oper_id"); |
| | | pageQuery.setIsAsc("desc"); |
| | | } |
| | | Page<SysOperLogVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<SysOperLogVo> selectOperLogList(SysOperLogBo operLog) { |
| | | Map<String, Object> params = operLog.getParams(); |
| | | return baseMapper.selectVoList(new LambdaQueryWrapper<SysOperLog>() |
| | | .like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp()) |
| | | .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | | SysOperLog::getBusinessType, operLog.getBusinessType()) |
| | | .func(f -> { |
| | | if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())) { |
| | | f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); |
| | | } |
| | | }) |
| | | .eq(operLog.getStatus() != null && operLog.getStatus() > 0, |
| | | SysOperLog::getStatus, operLog.getStatus()) |
| | | .like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime")) |
| | | .orderByDesc(SysOperLog::getOperId)); |
| | | LambdaQueryWrapper<SysOperLog> lqw = buildQueryWrapper(operLog); |
| | | return baseMapper.selectVoList(lqw.orderByDesc(SysOperLog::getOperId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | OssClient storage = OssFactory.instance(); |
| | | UploadResult uploadResult; |
| | | try { |
| | | uploadResult = storage.uploadSuffix(file.getBytes(), suffix); |
| | | uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType()); |
| | | } catch (IOException e) { |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | |
| | | if (isValid) { |
| | | // åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | List<SysOss> list = baseMapper.selectBatchIds(ids); |
| | | List<SysOss> list = baseMapper.selectByIds(ids); |
| | | for (SysOss sysOss : list) { |
| | | OssClient storage = OssFactory.instance(sysOss.getService()); |
| | | storage.delete(sysOss.getUrl()); |
| | |
| | | package org.dromara.system.service.impl; |
| | | |
| | | import cn.dev33.satoken.secure.BCrypt; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StreamUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.redis.utils.CacheUtils; |
| | | import org.dromara.common.tenant.core.TenantEntity; |
| | | import org.dromara.common.tenant.helper.TenantHelper; |
| | | import org.dromara.system.domain.*; |
| | | import org.dromara.system.domain.bo.SysTenantBo; |
| | | import org.dromara.system.domain.vo.SysTenantVo; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ç§æ·Serviceä¸å¡å±å¤ç |
| | |
| | | String numbers = RandomUtil.randomNumbers(6); |
| | | // 夿æ¯å¦åå¨ï¼å¦æåå¨åéæ°çæ |
| | | if (tenantIds.contains(numbers)) { |
| | | generateTenantId(tenantIds); |
| | | return generateTenantId(tenantIds); |
| | | } |
| | | return numbers; |
| | | } |
| | |
| | | @CacheEvict(cacheNames = CacheNames.SYS_TENANT, key = "#bo.tenantId") |
| | | @Override |
| | | public int updateTenantStatus(SysTenantBo bo) { |
| | | SysTenant tenant = MapstructUtils.convert(bo, SysTenant.class); |
| | | SysTenant tenant = new SysTenant(); |
| | | tenant.setId(bo.getId()); |
| | | tenant.setStatus(bo.getStatus()); |
| | | return baseMapper.updateById(tenant); |
| | | } |
| | | |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * åæ¥ç§æ·åå
¸ |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void syncTenantDict() { |
| | | // æ¥è¯¢è¶
管 ææåå
¸æ°æ® |
| | | List<SysDictType> dictTypeList = new ArrayList<>(); |
| | | List<SysDictData> dictDataList = new ArrayList<>(); |
| | | TenantHelper.ignore(() -> { |
| | | dictTypeList.addAll(dictTypeMapper.selectList()); |
| | | dictDataList.addAll(dictDataMapper.selectList()); |
| | | }); |
| | | Map<String, List<SysDictType>> typeMap = StreamUtils.groupByKey(dictTypeList, TenantEntity::getTenantId); |
| | | Map<String, Map<String, List<SysDictData>>> typeDataMap = StreamUtils.groupBy2Key( |
| | | dictDataList, TenantEntity::getTenantId, SysDictData::getDictType); |
| | | // 管çç§æ·åå
¸æ°æ® |
| | | List<SysDictType> defaultTypeMap = typeMap.get(TenantConstants.DEFAULT_TENANT_ID); |
| | | Map<String, List<SysDictData>> defaultTypeDataMap = typeDataMap.get(TenantConstants.DEFAULT_TENANT_ID); |
| | | |
| | | // è·åææç§æ·ç¼å· |
| | | List<String> tenantIds = baseMapper.selectObjs( |
| | | new LambdaQueryWrapper<SysTenant>().select(SysTenant::getTenantId) |
| | | .eq(SysTenant::getStatus, TenantConstants.NORMAL), x -> {return Convert.toStr(x);}); |
| | | List<SysDictType> saveTypeList = new ArrayList<>(); |
| | | List<SysDictData> saveDataList = new ArrayList<>(); |
| | | Set<String> set = new HashSet<>(); |
| | | for (String tenantId : tenantIds) { |
| | | if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { |
| | | continue; |
| | | } |
| | | for (SysDictType dictType : defaultTypeMap) { |
| | | List<String> typeList = StreamUtils.toList(typeMap.get(tenantId), SysDictType::getDictType); |
| | | List<SysDictData> dataList = defaultTypeDataMap.get(dictType.getDictType()); |
| | | if (typeList.contains(dictType.getDictType())) { |
| | | List<SysDictData> dataListTenant = typeDataMap.get(tenantId).get(dictType.getDictType()); |
| | | Map<String, SysDictData> map = StreamUtils.toIdentityMap(dataListTenant, SysDictData::getDictValue); |
| | | for (SysDictData dictData : dataList) { |
| | | if (!map.containsKey(dictData.getDictValue())) { |
| | | SysDictData data = BeanUtil.toBean(dictData, SysDictData.class); |
| | | // 设置åå
¸ç¼ç 为 null |
| | | data.setDictCode(null); |
| | | data.setTenantId(tenantId); |
| | | data.setCreateTime(null); |
| | | data.setUpdateTime(null); |
| | | set.add(tenantId); |
| | | saveDataList.add(data); |
| | | } |
| | | } |
| | | } else { |
| | | SysDictType type = BeanUtil.toBean(dictType, SysDictType.class); |
| | | type.setDictId(null); |
| | | type.setTenantId(tenantId); |
| | | type.setCreateTime(null); |
| | | type.setUpdateTime(null); |
| | | set.add(tenantId); |
| | | saveTypeList.add(type); |
| | | if (CollUtil.isNotEmpty(dataList)) { |
| | | // çéåº dictType 对åºç data |
| | | for (SysDictData dictData : dataList) { |
| | | SysDictData data = BeanUtil.toBean(dictData, SysDictData.class); |
| | | // 设置åå
¸ç¼ç 为 null |
| | | data.setDictCode(null); |
| | | data.setTenantId(tenantId); |
| | | data.setCreateTime(null); |
| | | data.setUpdateTime(null); |
| | | set.add(tenantId); |
| | | saveDataList.add(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | TenantHelper.ignore(() -> { |
| | | if (CollUtil.isNotEmpty(saveTypeList)) { |
| | | dictTypeMapper.insertBatch(saveTypeList); |
| | | } |
| | | if (CollUtil.isNotEmpty(saveDataList)) { |
| | | dictDataMapper.insertBatch(saveDataList); |
| | | } |
| | | }); |
| | | for (String tenantId : set) { |
| | | TenantHelper.dynamic(tenantId, () -> CacheUtils.clear(CacheNames.SYS_DICT)); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * ç¨æ· ä¸å¡å±å¤ç |
| | |
| | | return ObjectUtil.isNull(sysUser) ? null : sysUser.getEmail(); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ç¨æ·IDæ¥è¯¢ç¨æ·å表 |
| | | * |
| | | * @param userIds ç¨æ·ids |
| | | * @return ç¨æ·å表 |
| | | */ |
| | | @Override |
| | | public List<UserDTO> selectListByIds(List<Long> userIds) { |
| | | if (CollUtil.isEmpty(userIds)) { |
| | |
| | | List<SysUserVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysUser>() |
| | | .select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName, SysUser::getEmail, SysUser::getPhonenumber) |
| | | .eq(SysUser::getStatus, UserConstants.USER_NORMAL) |
| | | .in(CollUtil.isNotEmpty(userIds), SysUser::getUserId, userIds)); |
| | | .in(SysUser::getUserId, userIds)); |
| | | return BeanUtil.copyToList(list, UserDTO.class); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è§è²IDæ¥è¯¢ç¨æ·ID |
| | | * |
| | | * @param roleIds è§è²ids |
| | | * @return ç¨æ·ids |
| | | */ |
| | | @Override |
| | | public List<Long> selectUserIdsByRoleIds(List<Long> roleIds) { |
| | | List<SysUserRole> userRoles = userRoleMapper.selectList( |
| | | new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roleIds)); |
| | | return StreamUtils.toList(userRoles, SysUserRole::getUserId); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserDTO> selectUsersByRoleIds(List<Long> roleIds) { |
| | | if (CollUtil.isEmpty(roleIds)) { |
| | | return List.of(); |
| | | } |
| | | List<SysUserRole> userRoles = userRoleMapper.selectList( |
| | | new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roleIds)); |
| | | List<Long> userIds = StreamUtils.toList(userRoles, SysUserRole::getUserId); |
| | | return selectListByIds(userIds); |
| | | return StreamUtils.toList(userRoles, SysUserRole::getUserId); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è§è²IDæ¥è¯¢ç¨æ· |
| | | * |
| | | * @param roleIds è§è²ids |
| | | * @return ç¨æ· |
| | | */ |
| | | @Override |
| | | public List<UserDTO> selectUsersByRoleIds(List<Long> roleIds) { |
| | | if (CollUtil.isEmpty(roleIds)) { |
| | | return List.of(); |
| | | } |
| | | |
| | | // éè¿è§è²IDè·åç¨æ·è§è²ä¿¡æ¯ |
| | | List<SysUserRole> userRoles = userRoleMapper.selectList( |
| | | new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roleIds)); |
| | | |
| | | // è·åç¨æ·IDå表 |
| | | Set<Long> userIds = StreamUtils.toSet(userRoles, SysUserRole::getUserId); |
| | | |
| | | return selectListByIds(new ArrayList<>(userIds)); |
| | | } |
| | | |
| | | /** |
| | | * éè¿é¨é¨IDæ¥è¯¢ç¨æ· |
| | | * |
| | | * @param deptIds é¨é¨ids |
| | | * @return ç¨æ· |
| | | */ |
| | | @Override |
| | | public List<UserDTO> selectUsersByDeptIds(List<Long> deptIds) { |
| | | if (CollUtil.isEmpty(deptIds)) { |
| | |
| | | List<SysUserVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysUser>() |
| | | .select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName, SysUser::getEmail, SysUser::getPhonenumber) |
| | | .eq(SysUser::getStatus, UserConstants.USER_NORMAL) |
| | | .in(CollUtil.isNotEmpty(deptIds), SysUser::getDeptId, deptIds)); |
| | | .in(SysUser::getDeptId, deptIds)); |
| | | return BeanUtil.copyToList(list, UserDTO.class); |
| | | } |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(taskBo.getProcessDefinitionKey())) { |
| | | queryWrapper.eq("t.processDefinitionKey", taskBo.getProcessDefinitionKey()); |
| | | } |
| | | queryWrapper.orderByDesc("t.CREATE_TIME_"); |
| | | Page<TaskVo> page = actTaskMapper.getTaskWaitByPage(pageQuery.build(), queryWrapper); |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | |
| | | queryWrapper.like(StringUtils.isNotBlank(taskBo.getProcessDefinitionName()), "t.processDefinitionName", taskBo.getProcessDefinitionName()); |
| | | queryWrapper.eq(StringUtils.isNotBlank(taskBo.getProcessDefinitionKey()), "t.processDefinitionKey", taskBo.getProcessDefinitionKey()); |
| | | queryWrapper.eq("t.assignee_", userId); |
| | | queryWrapper.orderByDesc("t.START_TIME_"); |
| | | Page<TaskVo> page = actTaskMapper.getTaskFinishByPage(pageQuery.build(), queryWrapper); |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | |
| | | queryWrapper.eq("t.processDefinitionKey", taskBo.getProcessDefinitionKey()); |
| | | } |
| | | queryWrapper.eq("t.assignee_", userId); |
| | | queryWrapper.orderByDesc("t.START_TIME_"); |
| | | Page<TaskVo> page = actTaskMapper.getTaskCopyByPage(pageQuery.build(), queryWrapper); |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | |
| | | * |
| | | * @param processTaskEvent åæ° |
| | | */ |
| | | @EventListener(condition = "#processTaskEvent.key=='leave1' && #processTaskEvent.taskDefinitionKey=='Activity_14633hx'") |
| | | @EventListener(condition = "#processTaskEvent.key.startsWith('leave')") |
| | | public void processTaskHandler(ProcessTaskEvent processTaskEvent) { |
| | | log.info("å½å任塿§è¡äº{}", processTaskEvent.toString()); |
| | | TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey())); |
| | | testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus()); |
| | | baseMapper.updateById(testLeave); |
| | | // æædemoæ¡ä¾çç³è¯·äººèç¹id |
| | | String[] ids = {"Activity_14633hx", "Activity_19b1i4j", "Activity_0uscrk3", |
| | | "Activity_0uscrk3", "Activity_0x6b71j", "Activity_0zy3g6j", "Activity_06a55t0"}; |
| | | if (StringUtils.equalsAny(processTaskEvent.getTaskDefinitionKey(), ids)) { |
| | | log.info("å½å任塿§è¡äº{}", processTaskEvent.toString()); |
| | | TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey())); |
| | | testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus()); |
| | | baseMapper.updateById(testLeave); |
| | | } |
| | | } |
| | | } |
| | |
| | | baseMapper.delete(new LambdaQueryWrapper<WfDefinitionConfig>().eq(WfDefinitionConfig::getTableName, bo.getTableName())); |
| | | add.setTableName(add.getTableName().toLowerCase()); |
| | | boolean flag = baseMapper.insertOrUpdate(add); |
| | | if (baseMapper.insertOrUpdate(add)) { |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | |
| | | |
| | | @Override |
| | | public List<WfFormManageVo> queryByIds(List<Long> ids) { |
| | | return baseMapper.selectVoBatchIds(ids); |
| | | return baseMapper.selectVoByIds(ids); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.dromara.workflow.service.IActHiProcinstService; |
| | | import org.dromara.workflow.service.IActProcessInstanceService; |
| | | import org.dromara.workflow.utils.WorkflowUtils; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public class WorkflowServiceImpl implements WorkflowService { |
| | | |
| | | @Autowired(required = false) |
| | | private RuntimeService runtimeService; |
| | | private final IActProcessInstanceService iActProcessInstanceService; |
| | | private final IActHiProcinstService iActHiProcinstService; |
| | | private TaskService taskService; |
| | | private final IActProcessInstanceService actProcessInstanceService; |
| | | private final IActHiProcinstService actHiProcinstService; |
| | | /** |
| | | * è¿è¡ä¸çå®ä¾ å é¤ç¨å®ä¾ï¼å é¤åå²è®°å½ï¼å é¤ä¸å¡ä¸æµç¨å
³èä¿¡æ¯ |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public boolean deleteRunAndHisInstance(List<String> businessKeys) { |
| | | return iActProcessInstanceService.deleteRunAndHisInstance(businessKeys); |
| | | return actProcessInstanceService.deleteRunAndHisInstance(businessKeys); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void setVariable(String taskId, String variableName, Object value) { |
| | | runtimeService.setVariable(taskId, variableName, value); |
| | | taskService.setVariable(taskId, variableName, value); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void setVariables(String taskId, Map<String, Object> variables) { |
| | | runtimeService.setVariables(taskId, variables); |
| | | taskService.setVariables(taskId, variables); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void setVariableLocal(String taskId, String variableName, Object value) { |
| | | runtimeService.setVariableLocal(taskId, variableName, value); |
| | | taskService.setVariableLocal(taskId, variableName, value); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void setVariablesLocal(String taskId, Map<String, Object> variables) { |
| | | runtimeService.setVariablesLocal(taskId, variables); |
| | | taskService.setVariablesLocal(taskId, variables); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public String getInstanceIdByBusinessKey(String businessKey) { |
| | | ActHiProcinst actHiProcinst = iActHiProcinstService.selectByBusinessKey(businessKey); |
| | | ActHiProcinst actHiProcinst = actHiProcinstService.selectByBusinessKey(businessKey); |
| | | if (actHiProcinst == null) { |
| | | return StrUtil.EMPTY; |
| | | } |
| | |
| | | FROM ACT_RU_TASK RES |
| | | INNER JOIN ACT_HI_PROCINST AHP ON RES.PROC_INST_ID_ = AHP.PROC_INST_ID_ |
| | | INNER JOIN ACT_RE_PROCDEF ARP ON ARP.ID_ = RES.PROC_DEF_ID_ |
| | | WHERE RES.PARENT_TASK_ID_ IS NULL |
| | | ORDER BY RES.CREATE_TIME_ DESC) t ${ew.getCustomSqlSegment} |
| | | WHERE RES.PARENT_TASK_ID_ IS NULL) t ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="getTaskFinishByPage" resultMap="TaskVoResult"> |
| | |
| | | INNER JOIN ACT_HI_PROCINST AHP ON HTI.PROC_INST_ID_ = AHP.PROC_INST_ID_ |
| | | INNER JOIN ACT_RE_PROCDEF ARP ON ARP.ID_ = HTI.PROC_DEF_ID_ |
| | | WHERE HTI.PARENT_TASK_ID_ IS NULL AND HTI.END_TIME_ IS NOT NULL |
| | | ORDER BY HTI.START_TIME_ DESC) t ${ew.getCustomSqlSegment} |
| | | ) t ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="getTaskCopyByPage" resultMap="TaskVoResult"> |
| | |
| | | INNER JOIN ACT_RE_PROCDEF ARP ON ARP.ID_ = AHT.PROC_DEF_ID_ |
| | | WHERE AHT.PARENT_TASK_ID_ IS NOT NULL |
| | | and AHT.scope_type_ = 'copy' |
| | | ORDER BY AHT.START_TIME_ DESC) t ${ew.getCustomSqlSegment} |
| | | ) t ${ew.getCustomSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | network_mode: "host" |
| | | |
| | | ruoyi-server1: |
| | | image: ruoyi/ruoyi-server:5.2.2 |
| | | image: ruoyi/ruoyi-server:5.2.3 |
| | | container_name: ruoyi-server1 |
| | | environment: |
| | | # æ¶åºä¸æµ· |
| | |
| | | network_mode: "host" |
| | | |
| | | ruoyi-server2: |
| | | image: ruoyi/ruoyi-server:5.2.2 |
| | | image: ruoyi/ruoyi-server:5.2.3 |
| | | container_name: ruoyi-server2 |
| | | environment: |
| | | # æ¶åºä¸æµ· |
| | |
| | | network_mode: "host" |
| | | |
| | | ruoyi-monitor-admin: |
| | | image: ruoyi/ruoyi-monitor-admin:5.2.2 |
| | | image: ruoyi/ruoyi-monitor-admin:5.2.3 |
| | | container_name: ruoyi-monitor-admin |
| | | environment: |
| | | # æ¶åºä¸æµ· |
| | |
| | | network_mode: "host" |
| | | |
| | | ruoyi-snailjob-server: |
| | | image: ruoyi/ruoyi-snailjob-server:5.2.2 |
| | | image: ruoyi/ruoyi-snailjob-server:5.2.3 |
| | | container_name: ruoyi-snailjob-server |
| | | environment: |
| | | # æ¶åºä¸æµ· |
ÎļþÃû´Ó script/sql/oracle/snail_job_oracle.sql ÐÞ¸Ä |
| | |
| | | COMMENT ON TABLE sj_group_config IS 'ç»é
ç½®'; |
| | | |
| | | INSERT INTO sj_group_config (namespace_id, group_name, description, token, group_status, version, group_partition, id_generator_mode, init_scene, bucket_index, create_dt, update_dt) VALUES ('dev', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, sysdate, sysdate); |
| | | INSERT INTO sj_group_config (namespace_id, group_name, description, token, group_status, version, group_partition, id_generator_mode, init_scene, bucket_index, create_dt, update_dt) VALUES ('prod', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, sysdate, sysdate); |
| | | |
| | | -- sj_notify_config |
| | | CREATE TABLE sj_notify_config |
ÎļþÃû´Ó script/sql/postgres/snail_job_postgre.sql ÐÞ¸Ä |
| | |
| | | COMMENT ON TABLE sj_group_config IS 'ç»é
ç½®'; |
| | | |
| | | INSERT INTO sj_group_config VALUES (1, 'dev', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, now(), now()); |
| | | INSERT INTO sj_group_config VALUES (2, 'prod', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, now(), now()); |
| | | |
| | | -- sj_notify_config |
| | | CREATE TABLE sj_notify_config |
| | |
| | | -- ---------------------------- |
| | | -- ä¸çº§èå |
| | | insert into sys_menu values('1', 'ç³»ç»ç®¡ç', '0', '1', 'system', null, '', '1', '0', 'M', '0', '0', '', 'system', 103, 1, now(), null, null, 'ç³»ç»ç®¡çç®å½'); |
| | | insert into sys_menu values('6', 'ç³»ç»ç®¡ç', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, 'ç§æ·ç®¡çç®å½'); |
| | | insert into sys_menu values('6', 'ç§æ·ç®¡ç', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, 'ç§æ·ç®¡çç®å½'); |
| | | insert into sys_menu values('2', 'ç³»ç»çæ§', '0', '3', 'monitor', null, '', '1', '0', 'M', '0', '0', '', 'monitor', 103, 1, now(), null, null, 'ç³»ç»çæ§ç®å½'); |
| | | insert into sys_menu values('3', 'ç³»ç»å·¥å
·', '0', '4', 'tool', null, '', '1', '0', 'M', '0', '0', '', 'tool', 103, 1, now(), null, null, 'ç³»ç»å·¥å
·ç®å½'); |
| | | insert into sys_menu values('4', 'PLUSå®ç½', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', '0', '0', 'M', '0', '0', '', 'guide', 103, 1, now(), null, null, 'RuoYi-Vue-Pluså®ç½å°å'); |
ÎļþÃû´Ó script/sql/snail_job.sql ÐÞ¸Ä |
| | |
| | | DEFAULT CHARSET = utf8mb4 COMMENT ='ç»é
ç½®'; |
| | | |
| | | INSERT INTO `sj_group_config` VALUES (1, 'dev', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, now(), now()); |
| | | INSERT INTO `sj_group_config` VALUES (2, 'prod', 'ruoyi_group', '', 'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, now(), now()); |
| | | |
| | | CREATE TABLE `sj_notify_config` |
| | | ( |
ÎļþÃû´Ó script/sql/sqlserver/snail_job_sqlserver.sql ÐÞ¸Ä |
| | |
| | | |
| | | INSERT INTO sj_group_config(namespace_id, group_name, description, token, group_status, version, group_partition, id_generator_mode, init_scene, bucket_index, create_dt, update_dt) VALUES (N'dev', N'ruoyi_group', N'', N'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', N'1', N'1', N'0', N'1', N'1', N'4', getdate(), getdate()) |
| | | GO |
| | | INSERT INTO sj_group_config(namespace_id, group_name, description, token, group_status, version, group_partition, id_generator_mode, init_scene, bucket_index, create_dt, update_dt) VALUES (N'prod', N'ruoyi_group', N'', N'SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', N'1', N'1', N'0', N'1', N'1', N'4', getdate(), getdate()) |
| | | GO |
| | | |
| | | -- sj_notify_config |
| | | CREATE TABLE sj_notify_config |