| | |
| | | * éæ Feign æ¥å£å管ç Http 请æ±(å¦ä¸æ¹è¯·æ± æ¯ä»,çä¿¡,æ¨éç) |
| | | * ç§»é¤ èªå¸¦æå¡çæ§ æ¹ä¸º spring-boot-admin å
¨æ¹ä½çæ§ |
| | | * å¢å demo 模å示ä¾(ç»ä¸ä¼å¢å 模åçå°ä¼ä¼´ååè) |
| | | * å¢å redisson æ¯æåå¸å¼é åè½æ´å¼ºå¤§ |
| | | |
| | | ### ä»£ç æ¹å¨ |
| | | |
| | |
| | | * 代ç çææ¨¡æ¿ å¢å ææ¡£æ³¨è§£ ä¸ æ ¡éªæ³¨è§£ ç®åéç¨æä½ |
| | | * 项ç®ä¿®æ¹ä¸º mavenå¤ç¯å¢é
ç½® |
| | | * 项ç®é
置修æ¹ä¸º application.yml ç»ä¸ç®¡ç |
| | | * æ°æ®æéä¿®æ¹ä¸º éé
æ¯æå表ãå¤è¡¨ |
| | | |
| | | ### å
¶ä» |
| | | |
| | |
| | | * 代ç çæéæ©æ 表çæå³å¯ |
| | | |
| | | å
³äºæ°æ®æé |
| | | * åèï¼ç¨æ·ï¼è§è²ï¼é¨é¨ï¼å表æ¥å£ç¨æ³ |
| | | * ç®åä»
æ¯æ XML æ¹å¼ä½¿ç¨(åç»ä¿®æ¹ä¸ºæ¯æMP) |
| | | * å建表 éé¢ç dept_id åæ®µ å¦éç¨æ·æé è¿éé¢ç user_id åæ®µ |
| | | * æ¯æ Mybatis-Plus æ¹å¼æ³¨å
¥ åè demo 模åç¨æ³(é导å
¥ test.sql æä»¶) |
| | | * æ¯æ XML æ¹å¼æ³¨å
¥ åè system 模åç¨æ³ |
| | | |
| | | å
³äºvueä¸bootæ´åé¨ç½² |
| | | * [å端éæèµæºå¦ä½æ´åå°å端访é®](https://doc.ruoyi.vip/ruoyi-vue/other/faq.html#å端éæèµæºå¦ä½æ´åå°å端访é®) |
| | |
| | | <description>RuoYi-Vue-Plusåå°ç®¡çç³»ç»</description> |
| | | |
| | | <properties> |
| | | <ruoyi-vue-plus.version>2.2.1</ruoyi-vue-plus.version> |
| | | <ruoyi-vue-plus.version>2.3.0</ruoyi-vue-plus.version> |
| | | <spring-boot.version>2.3.11.RELEASE</spring-boot.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | |
| | | <feign.version>2.2.6.RELEASE</feign.version> |
| | | <feign-okhttp.version>11.0</feign-okhttp.version> |
| | | <spring-boot-admin.version>2.3.1</spring-boot-admin.version> |
| | | <redisson.version>3.15.2</redisson.version> |
| | | </properties> |
| | | |
| | | <!-- ä¾èµå£°æ --> |
| | |
| | | <version>${ruoyi-vue-plus.version}</version> |
| | | </dependency> |
| | | |
| | | <!--redisson--> |
| | | <dependency> |
| | | <groupId>org.redisson</groupId> |
| | | <artifactId>redisson-spring-boot-starter</artifactId> |
| | | <version>${redisson.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | |
| | | password: |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | # æ¯å¦å¼å¯ssl |
| | | ssl: false |
| | | |
| | | --- # redisson 客æ·ç«¯é
ç½® |
| | | redisson: |
| | | # çº¿ç¨æ± æ°é |
| | | threads: 16 |
| | | # Nettyçº¿ç¨æ± æ°é |
| | | nettyThreads: 32 |
| | | # ä¼ è¾æ¨¡å¼ |
| | | transportMode: "NIO" |
| | | # åèç¹é
ç½® |
| | | singleServerConfig: |
| | | # 客æ·ç«¯åç§° |
| | | clientName: ${ruoyi-vue-plus.name} |
| | | # æå°ç©ºé²è¿æ¥æ° |
| | | connectionMinimumIdleSize: 32 |
| | | # è¿æ¥æ± å¤§å° |
| | | connectionPoolSize: 64 |
| | | # è¿æ¥ç©ºé²è¶
æ¶ï¼åä½ï¼æ¯«ç§ |
| | | idleConnectionTimeout: 10000 |
| | | # å½ä»¤çå¾
è¶
æ¶ï¼åä½ï¼æ¯«ç§ |
| | | timeout: 3000 |
| | | # 妿å°è¯å¨æ¤éå¶ä¹å
åéæåï¼åå¼å§å¯ç¨ timeout 计æ¶ã |
| | | retryAttempts: 3 |
| | | # å½ä»¤éè¯åéæ¶é´é´éï¼åä½ï¼æ¯«ç§ |
| | | retryInterval: 1500 |
| | | # åå¸å订é
è¿æ¥çæå°ç©ºé²è¿æ¥æ° |
| | | subscriptionConnectionMinimumIdleSize: 1 |
| | | # åå¸å订é
è¿æ¥æ± å¤§å° |
| | | subscriptionConnectionPoolSize: 50 |
| | | # åä¸ªè¿æ¥æå¤§è®¢é
æ°é |
| | | subscriptionsPerConnection: 5 |
| | | # DNSçæµæ¶é´é´éï¼åä½ï¼æ¯«ç§ |
| | | dnsMonitoringInterval: 5000 |
| | |
| | | password: |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | # æ¯å¦å¼å¯ssl |
| | | ssl: false |
| | | |
| | | --- # redisson 客æ·ç«¯é
ç½® |
| | | redisson: |
| | | # çº¿ç¨æ± æ°é |
| | | threads: 16 |
| | | # Nettyçº¿ç¨æ± æ°é |
| | | nettyThreads: 32 |
| | | # ä¼ è¾æ¨¡å¼ |
| | | transportMode: "NIO" |
| | | # åèç¹é
ç½® |
| | | singleServerConfig: |
| | | # 客æ·ç«¯åç§° |
| | | clientName: ${ruoyi-vue-plus.name} |
| | | # æå°ç©ºé²è¿æ¥æ° |
| | | connectionMinimumIdleSize: 32 |
| | | # è¿æ¥æ± å¤§å° |
| | | connectionPoolSize: 64 |
| | | # è¿æ¥ç©ºé²è¶
æ¶ï¼åä½ï¼æ¯«ç§ |
| | | idleConnectionTimeout: 10000 |
| | | # å½ä»¤çå¾
è¶
æ¶ï¼åä½ï¼æ¯«ç§ |
| | | timeout: 3000 |
| | | # 妿å°è¯å¨æ¤éå¶ä¹å
åéæåï¼åå¼å§å¯ç¨ timeout 计æ¶ã |
| | | retryAttempts: 3 |
| | | # å½ä»¤éè¯åéæ¶é´é´éï¼åä½ï¼æ¯«ç§ |
| | | retryInterval: 1500 |
| | | # åå¸å订é
è¿æ¥çæå°ç©ºé²è¿æ¥æ° |
| | | subscriptionConnectionMinimumIdleSize: 1 |
| | | # åå¸å订é
è¿æ¥æ± å¤§å° |
| | | subscriptionConnectionPoolSize: 50 |
| | | # åä¸ªè¿æ¥æå¤§è®¢é
æ°é |
| | | subscriptionsPerConnection: 5 |
| | | # DNSçæµæ¶é´é´éï¼åä½ï¼æ¯«ç§ |
| | | dnsMonitoringInterval: 5000 |
| | |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | </dependency> |
| | | |
| | | <!--redisson--> |
| | | <dependency> |
| | | <groupId>org.redisson</groupId> |
| | | <artifactId>redisson-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | * ç¨æ·è¡¨çå«å |
| | | */ |
| | | public String userAlias() default ""; |
| | | |
| | | /** |
| | | * æ¯å¦è¿æ»¤ç¨æ·æé |
| | | */ |
| | | public boolean isUser() default false; |
| | | } |
| | |
| | | package com.ruoyi.common.core.redis; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import com.google.common.collect.Lists; |
| | | import org.redisson.api.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.BoundSetOperations; |
| | | import org.springframework.data.redis.core.HashOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * spring redis å·¥å
·ç±» |
| | | * |
| | | * @author ruoyi |
| | | * @author shenxinquan |
| | | **/ |
| | | @SuppressWarnings(value = { "unchecked", "rawtypes" }) |
| | | @Component |
| | | public class RedisCache |
| | | { |
| | | public class RedisCache { |
| | | |
| | | @Autowired |
| | | public RedisTemplate redisTemplate; |
| | | private RedissonClient redissonClient; |
| | | |
| | | /** |
| | | * ç¼ååºæ¬ç对象ï¼IntegerãStringãå®ä½ç±»ç |
| | |
| | | * @param key ç¼åçé®å¼ |
| | | * @param value ç¼åçå¼ |
| | | */ |
| | | public <T> void setCacheObject(final String key, final T value) |
| | | { |
| | | redisTemplate.opsForValue().set(key, value); |
| | | public <T> void setCacheObject(final String key, final T value) { |
| | | redissonClient.getBucket(key).set(value); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param timeout æ¶é´ |
| | | * @param timeUnit æ¶é´é¢ç²åº¦ |
| | | */ |
| | | public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) |
| | | { |
| | | redisTemplate.opsForValue().set(key, value, timeout, timeUnit); |
| | | public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) { |
| | | RBucket<T> result = redissonClient.getBucket(key); |
| | | result.set(value); |
| | | result.expire(timeout, timeUnit); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param timeout è¶
æ¶æ¶é´ |
| | | * @return true=设置æåï¼false=设置失败 |
| | | */ |
| | | public boolean expire(final String key, final long timeout) |
| | | { |
| | | public boolean expire(final String key, final long timeout) { |
| | | return expire(key, timeout, TimeUnit.SECONDS); |
| | | } |
| | | |
| | |
| | | * @param unit æ¶é´åä½ |
| | | * @return true=设置æåï¼false=设置失败 |
| | | */ |
| | | public boolean expire(final String key, final long timeout, final TimeUnit unit) |
| | | { |
| | | return redisTemplate.expire(key, timeout, unit); |
| | | public boolean expire(final String key, final long timeout, final TimeUnit unit) { |
| | | RBucket rBucket = redissonClient.getBucket(key); |
| | | return rBucket.expire(timeout, unit); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param key ç¼åé®å¼ |
| | | * @return ç¼åé®å¼å¯¹åºçæ°æ® |
| | | */ |
| | | public <T> T getCacheObject(final String key) |
| | | { |
| | | ValueOperations<String, T> operation = redisTemplate.opsForValue(); |
| | | return operation.get(key); |
| | | public <T> T getCacheObject(final String key) { |
| | | RBucket<T> rBucket = redissonClient.getBucket(key); |
| | | return rBucket.get(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param key |
| | | */ |
| | | public boolean deleteObject(final String key) |
| | | { |
| | | return redisTemplate.delete(key); |
| | | public boolean deleteObject(final String key) { |
| | | return redissonClient.getBucket(key).delete(); |
| | | } |
| | | |
| | | /* */ |
| | | |
| | | /** |
| | | * å é¤éå对象 |
| | |
| | | * @param collection å¤ä¸ªå¯¹è±¡ |
| | | * @return |
| | | */ |
| | | public long deleteObject(final Collection collection) |
| | | { |
| | | return redisTemplate.delete(collection); |
| | | public long deleteObject(final Collection collection) { |
| | | return redissonClient.getKeys().delete(Arrays.toString(collection.toArray())); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param dataList å¾
ç¼åçListæ°æ® |
| | | * @return ç¼åç对象 |
| | | */ |
| | | public <T> long setCacheList(final String key, final List<T> dataList) |
| | | { |
| | | Long count = redisTemplate.opsForList().rightPushAll(key, dataList); |
| | | return count == null ? 0 : count; |
| | | public <T> boolean setCacheList(final String key, final List<T> dataList) { |
| | | RList<T> rList = redissonClient.getList(key); |
| | | return rList.addAll(dataList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param key ç¼åçé®å¼ |
| | | * @return ç¼åé®å¼å¯¹åºçæ°æ® |
| | | */ |
| | | public <T> List<T> getCacheList(final String key) |
| | | { |
| | | return redisTemplate.opsForList().range(key, 0, -1); |
| | | public <T> List<T> getCacheList(final String key) { |
| | | RList<T> rList = redissonClient.getList(key); |
| | | return rList.readAll(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param dataSet ç¼åçæ°æ® |
| | | * @return ç¼åæ°æ®ç对象 |
| | | */ |
| | | public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet) |
| | | { |
| | | BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key); |
| | | Iterator<T> it = dataSet.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | | setOperation.add(it.next()); |
| | | } |
| | | return setOperation; |
| | | public <T> boolean setCacheSet(final String key, final Set<T> dataSet) { |
| | | RSet<T> rSet = redissonClient.getSet(key); |
| | | return rSet.addAll(dataSet); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public <T> Set<T> getCacheSet(final String key) |
| | | { |
| | | return redisTemplate.opsForSet().members(key); |
| | | public <T> Set<T> getCacheSet(final String key) { |
| | | RSet<T> rSet = redissonClient.getSet(key); |
| | | return rSet.readAll(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param key |
| | | * @param dataMap |
| | | */ |
| | | public <T> void setCacheMap(final String key, final Map<String, T> dataMap) |
| | | { |
| | | public <T> void setCacheMap(final String key, final Map<String, T> dataMap) { |
| | | if (dataMap != null) { |
| | | redisTemplate.opsForHash().putAll(key, dataMap); |
| | | RMap<String, T> rMap = redissonClient.getMap(key); |
| | | rMap.putAll(dataMap); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public <T> Map<String, T> getCacheMap(final String key) |
| | | { |
| | | return redisTemplate.opsForHash().entries(key); |
| | | public <T> Map<String, T> getCacheMap(final String key) { |
| | | RMap<String, T> rMap = redissonClient.getMap(key); |
| | | return rMap.getAll(rMap.keySet()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param hKey Hashé® |
| | | * @param value å¼ |
| | | */ |
| | | public <T> void setCacheMapValue(final String key, final String hKey, final T value) |
| | | { |
| | | redisTemplate.opsForHash().put(key, hKey, value); |
| | | public <T> void setCacheMapValue(final String key, final String hKey, final T value) { |
| | | RMap<String, T> rMap = redissonClient.getMap(key); |
| | | rMap.put(hKey, value); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param hKey Hashé® |
| | | * @return Hashä¸ç对象 |
| | | */ |
| | | public <T> T getCacheMapValue(final String key, final String hKey) |
| | | { |
| | | HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash(); |
| | | return opsForHash.get(key, hKey); |
| | | public <T> T getCacheMapValue(final String key, final String hKey) { |
| | | RMap<String, T> rMap = redissonClient.getMap(key); |
| | | return rMap.get(hKey); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param hKeys Hashé®éå |
| | | * @return Hash对象éå |
| | | */ |
| | | public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys) |
| | | { |
| | | return redisTemplate.opsForHash().multiGet(key, hKeys); |
| | | public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys) { |
| | | RListMultimap rListMultimap = redissonClient.getListMultimap(key); |
| | | return rListMultimap.getAll(hKeys); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param pattern å符串åç¼ |
| | | * @return 对象å表 |
| | | */ |
| | | public Collection<String> keys(final String pattern) |
| | | { |
| | | return redisTemplate.keys(pattern); |
| | | public Collection<String> keys(final String pattern) { |
| | | Iterable<String> iterable = redissonClient.getKeys().getKeysByPattern(pattern); |
| | | return Lists.newArrayList(iterable); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµè¯æ·»å 对象 chkj_test |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯æ·»å 对象") |
| | | public class ChkjTestAddBo { |
| | | |
| | | /** keyé® */ |
| | | @ApiModelProperty("keyé®") |
| | | @NotBlank(message = "keyé®ä¸è½ä¸ºç©º") |
| | | private String testKey; |
| | | /** å¼ */ |
| | | @ApiModelProperty("å¼") |
| | | @NotBlank(message = "å¼ä¸è½ä¸ºç©º") |
| | | private String value; |
| | | /** çæ¬ */ |
| | | @ApiModelProperty("çæ¬") |
| | | private Long version; |
| | | /** å建æ¶é´ */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | /** å 餿 å¿ */ |
| | | @ApiModelProperty("å 餿 å¿") |
| | | private Long deleted; |
| | | /** ç¶id */ |
| | | @ApiModelProperty("ç¶id") |
| | | @NotNull(message = "ç¶idä¸è½ä¸ºç©º") |
| | | private Long parentId; |
| | | /** æåºå· */ |
| | | @ApiModelProperty("æåºå·") |
| | | @NotNull(message = "æåºå·ä¸è½ä¸ºç©º") |
| | | private Long orderNum; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * æµè¯ç¼è¾å¯¹è±¡ chkj_test |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯ç¼è¾å¯¹è±¡") |
| | | public class ChkjTestEditBo { |
| | | |
| | | |
| | | /** ä¸»é® */ |
| | | @ApiModelProperty("主é®") |
| | | @NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | private Long id; |
| | | |
| | | /** keyé® */ |
| | | @ApiModelProperty("keyé®") |
| | | @NotBlank(message = "keyé®ä¸è½ä¸ºç©º") |
| | | private String testKey; |
| | | |
| | | /** å¼ */ |
| | | @ApiModelProperty("å¼") |
| | | @NotBlank(message = "å¼ä¸è½ä¸ºç©º") |
| | | private String value; |
| | | |
| | | /** çæ¬ */ |
| | | @ApiModelProperty("çæ¬") |
| | | private Long version; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** å 餿 å¿ */ |
| | | @ApiModelProperty("å 餿 å¿") |
| | | private Long deleted; |
| | | |
| | | /** ç¶id */ |
| | | @ApiModelProperty("ç¶id") |
| | | @NotNull(message = "ç¶idä¸è½ä¸ºç©º") |
| | | private Long parentId; |
| | | |
| | | /** æåºå· */ |
| | | @ApiModelProperty("æåºå·") |
| | | @NotNull(message = "æåºå·ä¸è½ä¸ºç©º") |
| | | private Long orderNum; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * æµè¯å页æ¥è¯¢å¯¹è±¡ chkj_test |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("æµè¯å页æ¥è¯¢å¯¹è±¡") |
| | | public class ChkjTestQueryBo extends BaseEntity { |
| | | |
| | | /** åé¡µå¤§å° */ |
| | | @ApiModelProperty("å页大å°") |
| | | private Integer pageSize; |
| | | /** å½åé¡µæ° */ |
| | | @ApiModelProperty("å½å页æ°") |
| | | private Integer pageNum; |
| | | /** æåºå */ |
| | | @ApiModelProperty("æåºå") |
| | | private String orderByColumn; |
| | | /** æåºçæ¹ådescæè
asc */ |
| | | @ApiModelProperty(value = "æåºçæ¹å", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | |
| | | /** keyé® */ |
| | | @ApiModelProperty("keyé®") |
| | | private String testKey; |
| | | /** å¼ */ |
| | | @ApiModelProperty("å¼") |
| | | private String value; |
| | | /** çæ¬ */ |
| | | @ApiModelProperty("çæ¬") |
| | | private Long version; |
| | | /** å 餿 å¿ */ |
| | | @ApiModelProperty("å 餿 å¿") |
| | | private Long deleted; |
| | | /** ç¶id */ |
| | | @ApiModelProperty("ç¶id") |
| | | private Long parentId; |
| | | /** æåºå· */ |
| | | @ApiModelProperty("æåºå·") |
| | | private Long orderNum; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµè¯å表添å 对象 test_demo |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯å表添å 对象") |
| | | public class TestDemoAddBo { |
| | | |
| | | /** é¨é¨id */ |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | /** ç¨æ·id */ |
| | | @ApiModelProperty("ç¨æ·id") |
| | | private Long userId; |
| | | |
| | | /** æåºå· */ |
| | | @ApiModelProperty("æåºå·") |
| | | private Long orderNum; |
| | | |
| | | /** keyé® */ |
| | | @ApiModelProperty("keyé®") |
| | | @NotBlank(message = "keyé®ä¸è½ä¸ºç©º") |
| | | private String testKey; |
| | | |
| | | /** å¼ */ |
| | | @ApiModelProperty("å¼") |
| | | @NotBlank(message = "å¼ä¸è½ä¸ºç©º") |
| | | private String value; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | |
| | | /** |
| | | * æµè¯å表ç¼è¾å¯¹è±¡ test_demo |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯å表ç¼è¾å¯¹è±¡") |
| | | public class TestDemoEditBo { |
| | | |
| | | |
| | | /** ä¸»é® */ |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | |
| | | /** é¨é¨id */ |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | |
| | | /** ç¨æ·id */ |
| | | @ApiModelProperty("ç¨æ·id") |
| | | private Long userId; |
| | | |
| | | |
| | | /** æåºå· */ |
| | | @ApiModelProperty("æåºå·") |
| | | private Long orderNum; |
| | | |
| | | |
| | | /** keyé® */ |
| | | @ApiModelProperty("keyé®") |
| | | @NotBlank(message = "keyé®ä¸è½ä¸ºç©º") |
| | | private String testKey; |
| | | |
| | | |
| | | /** å¼ */ |
| | | @ApiModelProperty("å¼") |
| | | @NotBlank(message = "å¼ä¸è½ä¸ºç©º") |
| | | private String value; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * æµè¯å表å页æ¥è¯¢å¯¹è±¡ test_demo |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("æµè¯å表å页æ¥è¯¢å¯¹è±¡") |
| | | public class TestDemoQueryBo extends BaseEntity { |
| | | |
| | | /** åé¡µå¤§å° */ |
| | | @ApiModelProperty("å页大å°") |
| | | private Integer pageSize; |
| | | /** å½åé¡µæ° */ |
| | | @ApiModelProperty("å½å页æ°") |
| | | private Integer pageNum; |
| | | /** æåºå */ |
| | | @ApiModelProperty("æåºå") |
| | | private String orderByColumn; |
| | | /** æåºçæ¹ådescæè
asc */ |
| | | @ApiModelProperty(value = "æåºçæ¹å", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | |
| | | /** keyé® */ |
| | | @ApiModelProperty("keyé®") |
| | | private String testKey; |
| | | /** å¼ */ |
| | | @ApiModelProperty("å¼") |
| | | private String value; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | import javax.validation.constraints.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµè¯æ 表添å 对象 test_tree |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯æ 表添å 对象") |
| | | public class TestTreeAddBo { |
| | | |
| | | /** ç¶id */ |
| | | @ApiModelProperty("ç¶id") |
| | | private Long parentId; |
| | | |
| | | /** é¨é¨id */ |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | /** ç¨æ·id */ |
| | | @ApiModelProperty("ç¨æ·id") |
| | | private Long userId; |
| | | |
| | | /** æ èç¹å */ |
| | | @ApiModelProperty("æ èç¹å") |
| | | @NotBlank(message = "æ èç¹åä¸è½ä¸ºç©º") |
| | | private String treeName; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | import javax.validation.constraints.*; |
| | | |
| | | |
| | | /** |
| | | * æµè¯æ 表ç¼è¾å¯¹è±¡ test_tree |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯æ 表ç¼è¾å¯¹è±¡") |
| | | public class TestTreeEditBo { |
| | | |
| | | |
| | | /** ä¸»é® */ |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | |
| | | /** ç¶id */ |
| | | @ApiModelProperty("ç¶id") |
| | | private Long parentId; |
| | | |
| | | |
| | | /** é¨é¨id */ |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | |
| | | /** ç¨æ·id */ |
| | | @ApiModelProperty("ç¨æ·id") |
| | | private Long userId; |
| | | |
| | | |
| | | /** æ èç¹å */ |
| | | @ApiModelProperty("æ èç¹å") |
| | | @NotBlank(message = "æ èç¹åä¸è½ä¸ºç©º") |
| | | private String treeName; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.bo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * æµè¯æ 表å页æ¥è¯¢å¯¹è±¡ test_tree |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("æµè¯æ 表å页æ¥è¯¢å¯¹è±¡") |
| | | public class TestTreeQueryBo extends BaseEntity { |
| | | |
| | | /** åé¡µå¤§å° */ |
| | | @ApiModelProperty("å页大å°") |
| | | private Integer pageSize; |
| | | /** å½åé¡µæ° */ |
| | | @ApiModelProperty("å½å页æ°") |
| | | private Integer pageNum; |
| | | /** æåºå */ |
| | | @ApiModelProperty("æåºå") |
| | | private String orderByColumn; |
| | | /** æåºçæ¹ådescæè
asc */ |
| | | @ApiModelProperty(value = "æåºçæ¹å", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | |
| | | /** æ èç¹å */ |
| | | @ApiModelProperty("æ èç¹å") |
| | | private String treeName; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.controller; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.demo.bo.ChkjTestAddBo; |
| | | import com.ruoyi.demo.bo.ChkjTestEditBo; |
| | | import com.ruoyi.demo.bo.ChkjTestQueryBo; |
| | | import com.ruoyi.demo.service.IChkjTestService; |
| | | import com.ruoyi.demo.vo.ChkjTestVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµè¯Controller |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Api(value = "æµè¯æ§å¶å¨", tags = {"æµè¯ç®¡ç"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/demo/test") |
| | | public class ChkjTestController extends BaseController { |
| | | |
| | | private final IChkjTestService iChkjTestService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢æµè¯å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:test:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<ChkjTestVo> list(@Validated ChkjTestQueryBo bo) { |
| | | return iChkjTestService.queryPageList(bo); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæµè¯å表 |
| | | */ |
| | | @ApiOperation("å¯¼åºæµè¯å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:test:export')") |
| | | @Log(title = "æµè¯", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult<ChkjTestVo> export(@Validated ChkjTestQueryBo bo) { |
| | | List<ChkjTestVo> list = iChkjTestService.queryList(bo); |
| | | ExcelUtil<ChkjTestVo> util = new ExcelUtil<ChkjTestVo>(ChkjTestVo.class); |
| | | return util.exportExcel(list, "æµè¯"); |
| | | } |
| | | |
| | | /** |
| | | * è·åæµè¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åæµè¯è¯¦ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('demo:test:query')") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult<ChkjTestVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable("id") Long id) { |
| | | return AjaxResult.success(iChkjTestService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æµè¯ |
| | | */ |
| | | @ApiOperation("æ°å¢æµè¯") |
| | | @PreAuthorize("@ss.hasPermi('demo:test:add')") |
| | | @Log(title = "æµè¯", businessType = BusinessType.INSERT) |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated @RequestBody ChkjTestAddBo bo) { |
| | | return toAjax(iChkjTestService.insertByAddBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æµè¯ |
| | | */ |
| | | @ApiOperation("ä¿®æ¹æµè¯") |
| | | @PreAuthorize("@ss.hasPermi('demo:test:edit')") |
| | | @Log(title = "æµè¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated @RequestBody ChkjTestEditBo bo) { |
| | | return toAjax(iChkjTestService.updateByEditBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * å 餿µè¯ |
| | | */ |
| | | @ApiOperation("å 餿µè¯") |
| | | @PreAuthorize("@ss.hasPermi('demo:test:remove')") |
| | | @Log(title = "æµè¯" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(iChkjTestService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.controller; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.demo.bo.TestDemoAddBo; |
| | | import com.ruoyi.demo.bo.TestDemoEditBo; |
| | | import com.ruoyi.demo.bo.TestDemoQueryBo; |
| | | import com.ruoyi.demo.service.ITestDemoService; |
| | | import com.ruoyi.demo.vo.TestDemoVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµè¯å表Controller |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Api(value = "æµè¯å表æ§å¶å¨", tags = {"æµè¯å表管ç"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/demo/demo") |
| | | public class TestDemoController extends BaseController { |
| | | |
| | | private final ITestDemoService iTestDemoService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯å表å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢æµè¯å表å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<TestDemoVo> list(@Validated TestDemoQueryBo bo) { |
| | | return iTestDemoService.queryPageList(bo); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæµè¯å表å表 |
| | | */ |
| | | @ApiOperation("å¯¼åºæµè¯å表å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:export')") |
| | | @Log(title = "æµè¯å表", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult<TestDemoVo> export(@Validated TestDemoQueryBo bo) { |
| | | List<TestDemoVo> list = iTestDemoService.queryList(bo); |
| | | ExcelUtil<TestDemoVo> util = new ExcelUtil<TestDemoVo>(TestDemoVo.class); |
| | | return util.exportExcel(list, "æµè¯å表"); |
| | | } |
| | | |
| | | /** |
| | | * è·åæµè¯å表详ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åæµè¯å表详ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:query')") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult<TestDemoVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable("id") Long id) { |
| | | return AjaxResult.success(iTestDemoService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æµè¯å表 |
| | | */ |
| | | @ApiOperation("æ°å¢æµè¯å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:add')") |
| | | @Log(title = "æµè¯å表", businessType = BusinessType.INSERT) |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated @RequestBody TestDemoAddBo bo) { |
| | | return toAjax(iTestDemoService.insertByAddBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æµè¯å表 |
| | | */ |
| | | @ApiOperation("ä¿®æ¹æµè¯å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:edit')") |
| | | @Log(title = "æµè¯å表", businessType = BusinessType.UPDATE) |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated @RequestBody TestDemoEditBo bo) { |
| | | return toAjax(iTestDemoService.updateByEditBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * å 餿µè¯å表 |
| | | */ |
| | | @ApiOperation("å 餿µè¯å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:remove')") |
| | | @Log(title = "æµè¯å表" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.controller; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.demo.bo.TestTreeAddBo; |
| | | import com.ruoyi.demo.bo.TestTreeEditBo; |
| | | import com.ruoyi.demo.bo.TestTreeQueryBo; |
| | | import com.ruoyi.demo.service.ITestTreeService; |
| | | import com.ruoyi.demo.vo.TestTreeVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµè¯æ 表Controller |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Api(value = "æµè¯æ 表æ§å¶å¨", tags = {"æµè¯æ 表管ç"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/demo/tree") |
| | | public class TestTreeController extends BaseController { |
| | | |
| | | private final ITestTreeService iTestTreeService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æµè¯æ 表å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢æµè¯æ 表å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:tree:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult<List<TestTreeVo>> list(@Validated TestTreeQueryBo bo) { |
| | | return AjaxResult.success(iTestTreeService.queryList(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæµè¯æ 表å表 |
| | | */ |
| | | @ApiOperation("å¯¼åºæµè¯æ 表å表") |
| | | @PreAuthorize("@ss.hasPermi('demo:tree:export')") |
| | | @Log(title = "æµè¯æ 表", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult<TestTreeVo> export(@Validated TestTreeQueryBo bo) { |
| | | List<TestTreeVo> list = iTestTreeService.queryList(bo); |
| | | ExcelUtil<TestTreeVo> util = new ExcelUtil<TestTreeVo>(TestTreeVo.class); |
| | | return util.exportExcel(list, "æµè¯æ 表"); |
| | | } |
| | | |
| | | /** |
| | | * è·åæµè¯æ 表详ç»ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("è·åæµè¯æ 表详ç»ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('demo:tree:query')") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult<TestTreeVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable("id") Long id) { |
| | | return AjaxResult.success(iTestTreeService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æµè¯æ 表 |
| | | */ |
| | | @ApiOperation("æ°å¢æµè¯æ 表") |
| | | @PreAuthorize("@ss.hasPermi('demo:tree:add')") |
| | | @Log(title = "æµè¯æ 表", businessType = BusinessType.INSERT) |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated @RequestBody TestTreeAddBo bo) { |
| | | return toAjax(iTestTreeService.insertByAddBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æµè¯æ 表 |
| | | */ |
| | | @ApiOperation("ä¿®æ¹æµè¯æ 表") |
| | | @PreAuthorize("@ss.hasPermi('demo:tree:edit')") |
| | | @Log(title = "æµè¯æ 表", businessType = BusinessType.UPDATE) |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated @RequestBody TestTreeEditBo bo) { |
| | | return toAjax(iTestTreeService.updateByEditBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | | /** |
| | | * å 餿µè¯æ 表 |
| | | */ |
| | | @ApiOperation("å 餿µè¯æ 表") |
| | | @PreAuthorize("@ss.hasPermi('demo:tree:remove')") |
| | | @Log(title = "æµè¯æ 表" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æµè¯å¯¹è±¡ chkj_test |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("chkj_test") |
| | | public class ChkjTest implements Serializable { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** keyé® */ |
| | | private String testKey; |
| | | |
| | | /** å¼ */ |
| | | private String value; |
| | | |
| | | /** çæ¬ */ |
| | | private Long version; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** å 餿 å¿ */ |
| | | private Long deleted; |
| | | |
| | | /** ç¶id */ |
| | | private Long parentId; |
| | | |
| | | /** æåºå· */ |
| | | private Long orderNum; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æµè¯å表对象 test_demo |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("test_demo") |
| | | public class TestDemo implements Serializable { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** é¨é¨id */ |
| | | private Long deptId; |
| | | |
| | | /** ç¨æ·id */ |
| | | private Long userId; |
| | | |
| | | /** æåºå· */ |
| | | @OrderBy(isDesc = false, sort = 1) |
| | | private Long orderNum; |
| | | |
| | | /** keyé® */ |
| | | private String testKey; |
| | | |
| | | /** å¼ */ |
| | | private String value; |
| | | |
| | | /** çæ¬ */ |
| | | @Version |
| | | private Long version; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** å建人 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String createBy; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** æ´æ°äºº */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private String updateBy; |
| | | |
| | | /** å 餿 å¿ */ |
| | | @TableLogic |
| | | private Long delFlag; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | |
| | | /** |
| | | * æµè¯æ 表对象 test_tree |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("test_tree") |
| | | public class TestTree implements Serializable { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** ç¶id */ |
| | | private Long parentId; |
| | | |
| | | /** é¨é¨id */ |
| | | private Long deptId; |
| | | |
| | | /** ç¨æ·id */ |
| | | private Long userId; |
| | | |
| | | /** æ èç¹å */ |
| | | private String treeName; |
| | | |
| | | /** çæ¬ */ |
| | | @Version |
| | | private Long version; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** å建人 */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String createBy; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** æ´æ°äºº */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private String updateBy; |
| | | |
| | | /** å 餿 å¿ */ |
| | | @TableLogic |
| | | private Long delFlag; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.mapper; |
| | | |
| | | import com.ruoyi.demo.domain.ChkjTest; |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | |
| | | /** |
| | | * æµè¯Mapperæ¥å£ |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | public interface ChkjTestMapper extends BaseMapperPlus<ChkjTest> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.mapper; |
| | | |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | |
| | | /** |
| | | * æµè¯å表Mapperæ¥å£ |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | public interface TestDemoMapper extends BaseMapperPlus<TestDemo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.mapper; |
| | | |
| | | import com.ruoyi.demo.domain.TestTree; |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | |
| | | /** |
| | | * æµè¯æ 表Mapperæ¥å£ |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | public interface TestTreeMapper extends BaseMapperPlus<TestTree> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.service; |
| | | |
| | | import com.ruoyi.demo.domain.ChkjTest; |
| | | import com.ruoyi.demo.vo.ChkjTestVo; |
| | | import com.ruoyi.demo.bo.ChkjTestQueryBo; |
| | | import com.ruoyi.demo.bo.ChkjTestAddBo; |
| | | import com.ruoyi.demo.bo.ChkjTestEditBo; |
| | | import com.ruoyi.common.core.page.IServicePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµè¯Serviceæ¥å£ |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | public interface IChkjTestService extends IServicePlus<ChkjTest> { |
| | | /** |
| | | * æ¥è¯¢å个 |
| | | * @return |
| | | */ |
| | | ChkjTestVo queryById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | TableDataInfo<ChkjTestVo> queryPageList(ChkjTestQueryBo bo); |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | List<ChkjTestVo> queryList(ChkjTestQueryBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®æ°å¢ä¸å¡å¯¹è±¡æå
¥æµè¯ |
| | | * @param bo æµè¯æ°å¢ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean insertByAddBo(ChkjTestAddBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼è¾ä¸å¡å¯¹è±¡ä¿®æ¹æµè¯ |
| | | * @param bo æµè¯ç¼è¾ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean updateByEditBo(ChkjTestEditBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶å 餿°æ® |
| | | * @param ids 主é®éå |
| | | * @param isValid æ¯å¦æ ¡éª,true-å é¤åæ ¡éª,false-䏿 ¡éª |
| | | * @return |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.service; |
| | | |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import com.ruoyi.demo.vo.TestDemoVo; |
| | | import com.ruoyi.demo.bo.TestDemoQueryBo; |
| | | import com.ruoyi.demo.bo.TestDemoAddBo; |
| | | import com.ruoyi.demo.bo.TestDemoEditBo; |
| | | import com.ruoyi.common.core.page.IServicePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµè¯å表Serviceæ¥å£ |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | public interface ITestDemoService extends IServicePlus<TestDemo> { |
| | | /** |
| | | * æ¥è¯¢å个 |
| | | * @return |
| | | */ |
| | | TestDemoVo queryById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | TableDataInfo<TestDemoVo> queryPageList(TestDemoQueryBo bo); |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | List<TestDemoVo> queryList(TestDemoQueryBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®æ°å¢ä¸å¡å¯¹è±¡æå
¥æµè¯å表 |
| | | * @param bo æµè¯å表æ°å¢ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean insertByAddBo(TestDemoAddBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼è¾ä¸å¡å¯¹è±¡ä¿®æ¹æµè¯å表 |
| | | * @param bo æµè¯å表ç¼è¾ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean updateByEditBo(TestDemoEditBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶å 餿°æ® |
| | | * @param ids 主é®éå |
| | | * @param isValid æ¯å¦æ ¡éª,true-å é¤åæ ¡éª,false-䏿 ¡éª |
| | | * @return |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.service; |
| | | |
| | | import com.ruoyi.common.core.page.IServicePlus; |
| | | import com.ruoyi.demo.bo.TestTreeAddBo; |
| | | import com.ruoyi.demo.bo.TestTreeEditBo; |
| | | import com.ruoyi.demo.bo.TestTreeQueryBo; |
| | | import com.ruoyi.demo.domain.TestTree; |
| | | import com.ruoyi.demo.vo.TestTreeVo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµè¯æ 表Serviceæ¥å£ |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | public interface ITestTreeService extends IServicePlus<TestTree> { |
| | | /** |
| | | * æ¥è¯¢å个 |
| | | * @return |
| | | */ |
| | | TestTreeVo queryById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | List<TestTreeVo> queryList(TestTreeQueryBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®æ°å¢ä¸å¡å¯¹è±¡æå
¥æµè¯æ 表 |
| | | * @param bo æµè¯æ 表æ°å¢ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean insertByAddBo(TestTreeAddBo bo); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¼è¾ä¸å¡å¯¹è±¡ä¿®æ¹æµè¯æ 表 |
| | | * @param bo æµè¯æ 表ç¼è¾ä¸å¡å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | Boolean updateByEditBo(TestTreeEditBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶å 餿°æ® |
| | | * @param ids 主é®éå |
| | | * @param isValid æ¯å¦æ ¡éª,true-å é¤åæ ¡éª,false-䏿 ¡éª |
| | | * @return |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.demo.bo.ChkjTestAddBo; |
| | | import com.ruoyi.demo.bo.ChkjTestEditBo; |
| | | import com.ruoyi.demo.bo.ChkjTestQueryBo; |
| | | import com.ruoyi.demo.domain.ChkjTest; |
| | | import com.ruoyi.demo.mapper.ChkjTestMapper; |
| | | import com.ruoyi.demo.service.IChkjTestService; |
| | | import com.ruoyi.demo.vo.ChkjTestVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµè¯Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Service |
| | | public class ChkjTestServiceImpl extends ServiceImpl<ChkjTestMapper, ChkjTest> implements IChkjTestService { |
| | | |
| | | @Override |
| | | public ChkjTestVo queryById(Long id){ |
| | | return getVoById(id, obj -> BeanUtil.toBean(obj, ChkjTestVo.class)); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<ChkjTestVo> queryPageList(ChkjTestQueryBo bo) { |
| | | PagePlus<ChkjTest, ChkjTestVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo), ChkjTestVo.class); |
| | | return PageUtils.buildDataInfo(result); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChkjTestVo> queryList(ChkjTestQueryBo bo) { |
| | | return listVo(buildQueryWrapper(bo), ChkjTestVo.class); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<ChkjTest> buildQueryWrapper(ChkjTestQueryBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<ChkjTest> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StrUtil.isNotBlank(bo.getTestKey()), ChkjTest::getTestKey, bo.getTestKey()); |
| | | lqw.eq(StrUtil.isNotBlank(bo.getValue()), ChkjTest::getValue, bo.getValue()); |
| | | lqw.eq(bo.getVersion() != null, ChkjTest::getVersion, bo.getVersion()); |
| | | lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, |
| | | ChkjTest::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime")); |
| | | lqw.eq(bo.getDeleted() != null, ChkjTest::getDeleted, bo.getDeleted()); |
| | | lqw.eq(bo.getParentId() != null, ChkjTest::getParentId, bo.getParentId()); |
| | | lqw.eq(bo.getOrderNum() != null, ChkjTest::getOrderNum, bo.getOrderNum()); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean insertByAddBo(ChkjTestAddBo bo) { |
| | | ChkjTest add = BeanUtil.toBean(bo, ChkjTest.class); |
| | | validEntityBeforeSave(add); |
| | | return save(add); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateByEditBo(ChkjTestEditBo bo) { |
| | | ChkjTest update = BeanUtil.toBean(bo, ChkjTest.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | * |
| | | * @param entity å®ä½ç±»æ°æ® |
| | | */ |
| | | private void validEntityBeforeSave(ChkjTest entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return removeByIds(ids); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.demo.bo.TestDemoAddBo; |
| | | import com.ruoyi.demo.bo.TestDemoEditBo; |
| | | import com.ruoyi.demo.bo.TestDemoQueryBo; |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import com.ruoyi.demo.mapper.TestDemoMapper; |
| | | import com.ruoyi.demo.service.ITestDemoService; |
| | | import com.ruoyi.demo.vo.TestDemoVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµè¯å表Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Service |
| | | public class TestDemoServiceImpl extends ServiceImpl<TestDemoMapper, TestDemo> implements ITestDemoService { |
| | | |
| | | @Override |
| | | public TestDemoVo queryById(Long id) { |
| | | return getVoById(id, TestDemoVo.class); |
| | | } |
| | | |
| | | @DataScope(isUser = true) |
| | | @Override |
| | | public TableDataInfo<TestDemoVo> queryPageList(TestDemoQueryBo bo) { |
| | | PagePlus<TestDemo, TestDemoVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo), TestDemoVo.class); |
| | | return PageUtils.buildDataInfo(result); |
| | | } |
| | | |
| | | @DataScope(isUser = true) |
| | | @Override |
| | | public List<TestDemoVo> queryList(TestDemoQueryBo bo) { |
| | | return listVo(buildQueryWrapper(bo), TestDemoVo.class); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoQueryBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | Object dataScope = params.get("dataScope"); |
| | | LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StrUtil.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey()); |
| | | lqw.eq(StrUtil.isNotBlank(bo.getValue()), TestDemo::getValue, bo.getValue()); |
| | | lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, |
| | | TestDemo::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); |
| | | lqw.apply(dataScope != null && StrUtil.isNotBlank(dataScope.toString()), |
| | | dataScope != null ? dataScope.toString() : null); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean insertByAddBo(TestDemoAddBo bo) { |
| | | TestDemo add = BeanUtil.toBean(bo, TestDemo.class); |
| | | validEntityBeforeSave(add); |
| | | return save(add); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateByEditBo(TestDemoEditBo bo) { |
| | | TestDemo update = BeanUtil.toBean(bo, TestDemo.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | * |
| | | * @param entity å®ä½ç±»æ°æ® |
| | | */ |
| | | private void validEntityBeforeSave(TestDemo entity) { |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if (isValid) { |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return removeByIds(ids); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataScope; |
| | | import com.ruoyi.demo.bo.TestTreeAddBo; |
| | | import com.ruoyi.demo.bo.TestTreeEditBo; |
| | | import com.ruoyi.demo.bo.TestTreeQueryBo; |
| | | import com.ruoyi.demo.domain.TestTree; |
| | | import com.ruoyi.demo.mapper.TestTreeMapper; |
| | | import com.ruoyi.demo.service.ITestTreeService; |
| | | import com.ruoyi.demo.vo.TestTreeVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµè¯æ 表Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Service |
| | | public class TestTreeServiceImpl extends ServiceImpl<TestTreeMapper, TestTree> implements ITestTreeService { |
| | | |
| | | @Override |
| | | public TestTreeVo queryById(Long id) { |
| | | return getVoById(id, TestTreeVo.class); |
| | | } |
| | | |
| | | @DataScope(isUser = true) |
| | | @Override |
| | | public List<TestTreeVo> queryList(TestTreeQueryBo bo) { |
| | | return listVo(buildQueryWrapper(bo), TestTreeVo.class); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<TestTree> buildQueryWrapper(TestTreeQueryBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | Object dataScope = params.get("dataScope"); |
| | | LambdaQueryWrapper<TestTree> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StrUtil.isNotBlank(bo.getTreeName()), TestTree::getTreeName, bo.getTreeName()); |
| | | lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, |
| | | TestTree::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime")); |
| | | lqw.apply(dataScope != null && StrUtil.isNotBlank(dataScope.toString()), |
| | | dataScope != null ? dataScope.toString() : null); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean insertByAddBo(TestTreeAddBo bo) { |
| | | TestTree add = BeanUtil.toBean(bo, TestTree.class); |
| | | validEntityBeforeSave(add); |
| | | return save(add); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateByEditBo(TestTreeEditBo bo) { |
| | | TestTree update = BeanUtil.toBean(bo, TestTree.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | * |
| | | * @param entity å®ä½ç±»æ°æ® |
| | | */ |
| | | private void validEntityBeforeSave(TestTree entity) { |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if (isValid) { |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return removeByIds(ids); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.vo; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµè¯è§å¾å¯¹è±¡ mall_package |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-14 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯è§å¾å¯¹è±¡") |
| | | public class ChkjTestVo { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | /** keyé® */ |
| | | @Excel(name = "keyé®") |
| | | @ApiModelProperty("keyé®") |
| | | private String testKey; |
| | | /** å¼ */ |
| | | @Excel(name = "å¼") |
| | | @ApiModelProperty("å¼") |
| | | private String value; |
| | | /** çæ¬ */ |
| | | @Excel(name = "çæ¬") |
| | | @ApiModelProperty("çæ¬") |
| | | private Long version; |
| | | /** å建æ¶é´ */ |
| | | @Excel(name = "å建æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("å建æ¶é´") |
| | | private Date createTime; |
| | | /** å 餿 å¿ */ |
| | | @Excel(name = "å 餿 å¿") |
| | | @ApiModelProperty("å 餿 å¿") |
| | | private Long deleted; |
| | | /** ç¶id */ |
| | | @Excel(name = "ç¶id") |
| | | @ApiModelProperty("ç¶id") |
| | | private Long parentId; |
| | | /** æåºå· */ |
| | | @Excel(name = "æåºå·") |
| | | @ApiModelProperty("æåºå·") |
| | | private Long orderNum; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.vo; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµè¯å表è§å¾å¯¹è±¡ test_demo |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯å表è§å¾å¯¹è±¡") |
| | | public class TestDemoVo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | /** é¨é¨id */ |
| | | @Excel(name = "é¨é¨id") |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | /** ç¨æ·id */ |
| | | @Excel(name = "ç¨æ·id") |
| | | @ApiModelProperty("ç¨æ·id") |
| | | private Long userId; |
| | | |
| | | /** æåºå· */ |
| | | @Excel(name = "æåºå·") |
| | | @ApiModelProperty("æåºå·") |
| | | private Long orderNum; |
| | | |
| | | /** keyé® */ |
| | | @Excel(name = "keyé®") |
| | | @ApiModelProperty("keyé®") |
| | | private String testKey; |
| | | |
| | | /** å¼ */ |
| | | @Excel(name = "å¼") |
| | | @ApiModelProperty("å¼") |
| | | private String value; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @Excel(name = "å建æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | /** å建人 */ |
| | | @Excel(name = "å建人") |
| | | @ApiModelProperty("å建人") |
| | | private String createBy; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @Excel(name = "æ´æ°æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | |
| | | /** æ´æ°äºº */ |
| | | @Excel(name = "æ´æ°äºº") |
| | | @ApiModelProperty("æ´æ°äºº") |
| | | private String updateBy; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.demo.vo; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµè¯æ 表è§å¾å¯¹è±¡ test_tree |
| | | * |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel("æµè¯æ 表è§å¾å¯¹è±¡") |
| | | public class TestTreeVo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | /** ç¶id */ |
| | | @Excel(name = "ç¶id") |
| | | @ApiModelProperty("ç¶id") |
| | | private Long parentId; |
| | | |
| | | /** é¨é¨id */ |
| | | @Excel(name = "é¨é¨id") |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | /** ç¨æ·id */ |
| | | @Excel(name = "ç¨æ·id") |
| | | @ApiModelProperty("ç¨æ·id") |
| | | private Long userId; |
| | | |
| | | /** æ èç¹å */ |
| | | @Excel(name = "æ èç¹å") |
| | | @ApiModelProperty("æ èç¹å") |
| | | private String treeName; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @Excel(name = "å建æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.demo.mapper.ChkjTestMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.demo.domain.ChkjTest" id="ChkjTestResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="testKey" column="test_key"/> |
| | | <result property="value" column="value"/> |
| | | <result property="version" column="version"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="deleted" column="deleted"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | </resultMap> |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.demo.mapper.TestDemoMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.demo.domain.TestDemo" id="TestDemoResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="testKey" column="test_key"/> |
| | | <result property="value" column="value"/> |
| | | <result property="version" column="version"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.demo.mapper.TestTreeMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.demo.domain.TestTree" id="TestTreeResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="treeName" column="tree_name"/> |
| | | <result property="version" column="version"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | /** |
| | | * æ°æ®è¿æ»¤å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @author Lion Li |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class DataScopeAspect |
| | | { |
| | | public class DataScopeAspect { |
| | | |
| | | /** |
| | | * å
¨é¨æ°æ®æé |
| | | */ |
| | |
| | | |
| | | // é
ç½®ç»å
¥ç¹ |
| | | @Pointcut("@annotation(com.ruoyi.common.annotation.DataScope)") |
| | | public void dataScopePointCut() |
| | | { |
| | | public void dataScopePointCut() { |
| | | } |
| | | |
| | | @Before("dataScopePointCut()") |
| | | public void doBefore(JoinPoint point) throws Throwable |
| | | { |
| | | public void doBefore(JoinPoint point) throws Throwable { |
| | | clearDataScope(point); |
| | | handleDataScope(point); |
| | | } |
| | | |
| | | protected void handleDataScope(final JoinPoint joinPoint) |
| | | { |
| | | protected void handleDataScope(final JoinPoint joinPoint) { |
| | | // è·å¾æ³¨è§£ |
| | | DataScope controllerDataScope = getAnnotationLog(joinPoint); |
| | | if (controllerDataScope == null) |
| | | { |
| | | if (controllerDataScope == null) { |
| | | return; |
| | | } |
| | | // è·åå½åçç¨æ· |
| | | LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest()); |
| | | if (Validator.isNotNull(loginUser)) |
| | | { |
| | | if (Validator.isNotNull(loginUser)) { |
| | | SysUser currentUser = loginUser.getUser(); |
| | | // 妿æ¯è¶
级管çåï¼åä¸è¿æ»¤æ°æ® |
| | | if (Validator.isNotNull(currentUser) && !currentUser.isAdmin()) |
| | | { |
| | | if (Validator.isNotNull(currentUser) && !currentUser.isAdmin()) { |
| | | dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), |
| | | controllerDataScope.userAlias()); |
| | | controllerDataScope.userAlias(), controllerDataScope.isUser()); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param user ç¨æ· |
| | | * @param userAlias å«å |
| | | */ |
| | | public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) |
| | | { |
| | | public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, boolean isUser) { |
| | | StringBuilder sqlString = new StringBuilder(); |
| | | |
| | | for (SysRole role : user.getRoles()) |
| | | { |
| | | // å° "." æååº,ä¸åå«å为å表æ¥è¯¢,åå«å为å¤è¡¨æ¥è¯¢ |
| | | deptAlias = StrUtil.isNotBlank(deptAlias) ? deptAlias + "." : ""; |
| | | userAlias = StrUtil.isNotBlank(userAlias) ? userAlias + "." : ""; |
| | | |
| | | for (SysRole role : user.getRoles()) { |
| | | String dataScope = role.getDataScope(); |
| | | if (DATA_SCOPE_ALL.equals(dataScope)) |
| | | { |
| | | if (DATA_SCOPE_ALL.equals(dataScope)) { |
| | | sqlString = new StringBuilder(); |
| | | break; |
| | | } |
| | | else if (DATA_SCOPE_CUSTOM.equals(dataScope)) |
| | | { |
| | | } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { |
| | | sqlString.append(StrUtil.format( |
| | | " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, |
| | | role.getRoleId())); |
| | | } |
| | | else if (DATA_SCOPE_DEPT.equals(dataScope)) |
| | | { |
| | | sqlString.append(StrUtil.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); |
| | | } |
| | | else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) |
| | | { |
| | | " OR {}dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", |
| | | deptAlias, role.getRoleId())); |
| | | } else if (DATA_SCOPE_DEPT.equals(dataScope)) { |
| | | sqlString.append(StrUtil.format(" OR {}dept_id = {} ", |
| | | deptAlias, user.getDeptId())); |
| | | } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { |
| | | sqlString.append(StrUtil.format( |
| | | " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", |
| | | " OR {}dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", |
| | | deptAlias, user.getDeptId(), user.getDeptId())); |
| | | } |
| | | else if (DATA_SCOPE_SELF.equals(dataScope)) |
| | | { |
| | | if (StrUtil.isNotBlank(userAlias)) |
| | | { |
| | | sqlString.append(StrUtil.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); |
| | | } |
| | | else |
| | | { |
| | | } else if (DATA_SCOPE_SELF.equals(dataScope)) { |
| | | if (isUser) { |
| | | sqlString.append(StrUtil.format(" OR {}user_id = {} ", |
| | | userAlias, user.getUserId())); |
| | | } else { |
| | | // æ°æ®æé为ä»
æ¬äººä¸æ²¡æuserAliaså«å䏿¥è¯¢ä»»ä½æ°æ® |
| | | sqlString.append(" OR 1=0 "); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(sqlString.toString())) |
| | | { |
| | | putDataScope(joinPoint, "AND (" + sqlString.substring(4) + ")"); |
| | | if (StrUtil.isNotBlank(sqlString.toString())) { |
| | | putDataScope(joinPoint, sqlString.substring(4)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦å卿³¨è§£ï¼å¦æåå¨å°±è·å |
| | | */ |
| | | private DataScope getAnnotationLog(JoinPoint joinPoint) |
| | | { |
| | | private DataScope getAnnotationLog(JoinPoint joinPoint) { |
| | | Signature signature = joinPoint.getSignature(); |
| | | MethodSignature methodSignature = (MethodSignature) signature; |
| | | Method method = methodSignature.getMethod(); |
| | | |
| | | if (method != null) |
| | | { |
| | | if (method != null) { |
| | | return method.getAnnotation(DataScope.class); |
| | | } |
| | | return null; |
| | |
| | | /** |
| | | * æ¼æ¥æésqlåå
æ¸
空params.dataScope忰鲿¢æ³¨å
¥ |
| | | */ |
| | | private void clearDataScope(final JoinPoint joinPoint) |
| | | { |
| | | private void clearDataScope(final JoinPoint joinPoint) { |
| | | Object params = joinPoint.getArgs()[0]; |
| | | if (Validator.isNotNull(params)) |
| | | { |
| | | if (Validator.isNotNull(params)) { |
| | | putDataScope(joinPoint, ""); |
| | | } |
| | | } |
| | | |
| | | private static void putDataScope(JoinPoint joinPoint, String sql) { |
| | | Object params = joinPoint.getArgs()[0]; |
| | | if (Validator.isNotNull(params)) |
| | | { |
| | | if (Validator.isNotNull(params)) { |
| | | if(params instanceof BaseEntity) { |
| | | BaseEntity baseEntity = (BaseEntity) params; |
| | | baseEntity.getParams().put(DATA_SCOPE, ""); |
| | | baseEntity.getParams().put(DATA_SCOPE, sql); |
| | | } else { |
| | | try { |
| | | Method getParams = params.getClass().getDeclaredMethod("getParams", null); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.AsyncConfigurerSupport; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.security.concurrent.DelegatingSecurityContextExecutorService; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.concurrent.Executor; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | @EnableAsync |
| | | @Configuration |
| | | public class AsyncConfig extends AsyncConfigurerSupport { |
| | | |
| | | /** |
| | | * 弿¥æ§è¡éè¦ä½¿ç¨æéæ¡æ¶èªå¸¦çå
è£
çº¿ç¨æ± ä¿è¯æéä¿¡æ¯çä¼ é |
| | | */ |
| | | @Override |
| | | public Executor getAsyncExecutor() { |
| | | return new DelegatingSecurityContextExecutorService( |
| | | Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())); |
| | | } |
| | | |
| | | /** |
| | | * 弿¥æ§è¡å¼å¸¸å¤ç |
| | | */ |
| | | @Override |
| | | public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { |
| | | return (throwable, method, objects) -> { |
| | | throwable.printStackTrace(); |
| | | throw new CustomException( |
| | | "Exception message - " + throwable.getMessage() |
| | | + ", Method name - " + method.getName() |
| | | + ", Parameter value - " + Arrays.toString(objects)); |
| | | }; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer; |
| | | import com.ruoyi.framework.config.properties.RedissonProperties; |
| | | import org.redisson.Redisson; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.redisson.codec.JsonJacksonCodec; |
| | | import org.redisson.config.Config; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
| | | import org.springframework.cache.annotation.CachingConfigurerSupport; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * redisé
ç½® |
| | | * |
| | | * @author ruoyi |
| | | * @author Lion Li |
| | | */ |
| | | @Configuration |
| | | @EnableCaching |
| | | public class RedisConfig extends CachingConfigurerSupport |
| | | { |
| | | @Bean |
| | | @SuppressWarnings(value = { "unchecked", "rawtypes" }) |
| | | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory) |
| | | { |
| | | RedisTemplate<Object, Object> template = new RedisTemplate<>(); |
| | | template.setConnectionFactory(connectionFactory); |
| | | public class RedisConfig extends CachingConfigurerSupport { |
| | | |
| | | GenericFastJsonRedisSerializer serializer = new GenericFastJsonRedisSerializer(); |
| | | StringRedisSerializer keySerializer = new StringRedisSerializer(); |
| | | private static final String REDIS_PROTOCOL_PREFIX = "redis://"; |
| | | private static final String REDISS_PROTOCOL_PREFIX = "rediss://"; |
| | | |
| | | // 使ç¨StringRedisSerializeræ¥åºåååååºååredisçkeyå¼ |
| | | template.setKeySerializer(keySerializer); |
| | | template.setValueSerializer(serializer); |
| | | @Autowired |
| | | private RedisProperties redisProperties; |
| | | |
| | | // Hashçkeyä¹éç¨StringRedisSerializerçåºååæ¹å¼ |
| | | template.setHashKeySerializer(keySerializer); |
| | | template.setHashValueSerializer(serializer); |
| | | @Autowired |
| | | private RedissonProperties redissonProperties; |
| | | |
| | | template.afterPropertiesSet(); |
| | | return template; |
| | | @Bean(destroyMethod = "shutdown") |
| | | @ConditionalOnMissingBean(RedissonClient.class) |
| | | public RedissonClient redisson() throws IOException { |
| | | String prefix = REDIS_PROTOCOL_PREFIX; |
| | | if (redisProperties.isSsl()) { |
| | | prefix = REDISS_PROTOCOL_PREFIX; |
| | | } |
| | | Config config = new Config(); |
| | | config.setThreads(redissonProperties.getThreads()) |
| | | .setNettyThreads(redissonProperties.getNettyThreads()) |
| | | .setCodec(JsonJacksonCodec.INSTANCE) |
| | | .setTransportMode(redissonProperties.getTransportMode()); |
| | | |
| | | RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig(); |
| | | // 使ç¨åæºæ¨¡å¼ |
| | | config.useSingleServer() |
| | | .setAddress(prefix + redisProperties.getHost() + ":" + redisProperties.getPort()) |
| | | .setConnectTimeout(((Long) redisProperties.getTimeout().toMillis()).intValue()) |
| | | .setDatabase(redisProperties.getDatabase()) |
| | | .setPassword(redisProperties.getPassword()) |
| | | .setTimeout(singleServerConfig.getTimeout()) |
| | | .setRetryAttempts(singleServerConfig.getRetryAttempts()) |
| | | .setRetryInterval(singleServerConfig.getRetryInterval()) |
| | | .setSubscriptionsPerConnection(singleServerConfig.getSubscriptionsPerConnection()) |
| | | .setClientName(singleServerConfig.getClientName()) |
| | | .setIdleConnectionTimeout(singleServerConfig.getIdleConnectionTimeout()) |
| | | .setSubscriptionConnectionMinimumIdleSize(singleServerConfig.getSubscriptionConnectionMinimumIdleSize()) |
| | | .setSubscriptionConnectionPoolSize(singleServerConfig.getSubscriptionConnectionPoolSize()) |
| | | .setConnectionMinimumIdleSize(singleServerConfig.getConnectionMinimumIdleSize()) |
| | | .setConnectionPoolSize(singleServerConfig.getConnectionPoolSize()) |
| | | .setDnsMonitoringInterval(singleServerConfig.getDnsMonitoringInterval()); |
| | | return Redisson.create(config); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config.properties; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.redisson.client.codec.Codec; |
| | | import org.redisson.config.TransportMode; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Redisson é
ç½®å±æ§ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "redisson") |
| | | public class RedissonProperties { |
| | | |
| | | /** |
| | | * çº¿ç¨æ± æ°é,é»è®¤å¼ = å½åå¤çæ ¸æ°é * 2 |
| | | */ |
| | | private int threads; |
| | | |
| | | /** |
| | | * Nettyçº¿ç¨æ± æ°é,é»è®¤å¼ = å½åå¤çæ ¸æ°é * 2 |
| | | */ |
| | | private int nettyThreads; |
| | | |
| | | /** |
| | | * ä¼ è¾æ¨¡å¼ |
| | | */ |
| | | private TransportMode transportMode; |
| | | |
| | | /** |
| | | * åæºæå¡é
ç½® |
| | | */ |
| | | private SingleServerConfig singleServerConfig; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public static class SingleServerConfig { |
| | | |
| | | /** |
| | | * 客æ·ç«¯åç§° |
| | | */ |
| | | private String clientName; |
| | | |
| | | /** |
| | | * æå°ç©ºé²è¿æ¥æ° |
| | | */ |
| | | private int connectionMinimumIdleSize; |
| | | |
| | | /** |
| | | * è¿æ¥æ± å¤§å° |
| | | */ |
| | | private int connectionPoolSize; |
| | | |
| | | /** |
| | | * è¿æ¥ç©ºé²è¶
æ¶ï¼åä½ï¼æ¯«ç§ |
| | | */ |
| | | private int idleConnectionTimeout; |
| | | |
| | | /** |
| | | * å½ä»¤çå¾
è¶
æ¶ï¼åä½ï¼æ¯«ç§ |
| | | */ |
| | | private int timeout; |
| | | |
| | | /** |
| | | * 妿å°è¯å¨æ¤éå¶ä¹å
åéæåï¼åå¼å§å¯ç¨ timeout 计æ¶ã |
| | | */ |
| | | private int retryAttempts; |
| | | |
| | | /** |
| | | * å½ä»¤éè¯åéæ¶é´é´éï¼åä½ï¼æ¯«ç§ |
| | | */ |
| | | private int retryInterval; |
| | | |
| | | /** |
| | | * åå¸å订é
è¿æ¥çæå°ç©ºé²è¿æ¥æ° |
| | | */ |
| | | private int subscriptionConnectionMinimumIdleSize; |
| | | |
| | | /** |
| | | * åå¸å订é
è¿æ¥æ± å¤§å° |
| | | */ |
| | | private int subscriptionConnectionPoolSize; |
| | | |
| | | /** |
| | | * åä¸ªè¿æ¥æå¤§è®¢é
æ°é |
| | | */ |
| | | private int subscriptionsPerConnection; |
| | | |
| | | /** |
| | | * DNSçæµæ¶é´é´éï¼åä½ï¼æ¯«ç§ |
| | | */ |
| | | private int dnsMonitoringInterval; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | #foreach ($column in $columns) |
| | | #if($column.isInsert && $column.isPk!=1) |
| | | |
| | | /** $column.columnComment */ |
| | | @ApiModelProperty("$column.columnComment") |
| | | #if($column.javaType == 'Date') |
| | |
| | | #end |
| | | #if($column.javaField=='delFlag') |
| | | @TableLogic |
| | | #end |
| | | #if($column.javaField=='version') |
| | | @Version |
| | | #end |
| | | #if($column.isPk==1) |
| | | @TableId(value = "$column.columnName") |
| | |
| | | */ |
| | | TableDataInfo<${ClassName}Vo> queryPageList(${ClassName}QueryBo bo); |
| | | #end |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * ${functionName}è§å¾å¯¹è±¡ mall_package |
| | | * ${functionName}è§å¾å¯¹è±¡ ${tableName} |
| | | * |
| | | * @author ${author} |
| | | * @date ${datetime} |
| | |
| | | @Data |
| | | @ApiModel("${functionName}è§å¾å¯¹è±¡") |
| | | public class ${ClassName}Vo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** $pkColumn.columnComment */ |
| | |
| | | #end |
| | | @ApiModelProperty("$column.columnComment") |
| | | private $column.javaType $column.javaField; |
| | | |
| | | #end |
| | | #end |
| | | |
| | |
| | | */ |
| | | public List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); |
| | | |
| | | /** |
| | | * ä¿®æ¹åå
ç´ å
³ç³» |
| | | * |
| | | * @param depts åå
ç´ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDeptChildren(@Param("depts") List<SysDept> depts); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è§è²ä¸é¨é¨å
³è表 æ°æ®å± |
| | | * |
| | |
| | | */ |
| | | public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDept> { |
| | | |
| | | /** |
| | | * æ¹éæ°å¢è§è²é¨é¨ä¿¡æ¯ |
| | | * |
| | | * @param roleDeptList è§è²é¨é¨å表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchRoleDept(List<SysRoleDept> roleDeptList); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è§è²ä¸èåå
³è表 æ°æ®å± |
| | | * |
| | |
| | | */ |
| | | public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenu> { |
| | | |
| | | /** |
| | | * æ¹éæ°å¢è§è²èåä¿¡æ¯ |
| | | * |
| | | * @param roleMenuList è§è²èåå表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchRoleMenu(List<SysRoleMenu> roleMenuList); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·ä¸å²ä½å
³è表 æ°æ®å± |
| | | * |
| | |
| | | */ |
| | | public interface SysUserPostMapper extends BaseMapperPlus<SysUserPost> { |
| | | |
| | | /** |
| | | * æ¹éæ°å¢ç¨æ·å²ä½ä¿¡æ¯ |
| | | * |
| | | * @param userPostList ç¨æ·è§è²å表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchUserPost(List<SysUserPost> userPostList); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·ä¸è§è²å
³è表 æ°æ®å± |
| | | * |
| | |
| | | */ |
| | | public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole> { |
| | | |
| | | /** |
| | | * æ¹éæ°å¢ç¨æ·è§è²ä¿¡æ¯ |
| | | * |
| | | * @param userRoleList ç¨æ·è§è²å表 |
| | | * @return ç»æ |
| | | */ |
| | | public int batchUserRole(List<SysUserRole> userRoleList); |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | @Service |
| | | public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService { |
| | | |
| | | @Autowired |
| | | private SysConfigMapper configMapper; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | if (StrUtil.equals(UserConstants.YES, config.getConfigType())) { |
| | | throw new CustomException(String.format("å
ç½®åæ°ã%1$sãä¸è½å é¤ ", config.getConfigKey())); |
| | | } |
| | | configMapper.deleteById(configId); |
| | | redisCache.deleteObject(getCacheKey(config.getConfigKey())); |
| | | } |
| | | baseMapper.deleteBatchIds(Arrays.asList(configIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); |
| | | } |
| | | if (children.size() > 0) { |
| | | updateBatchById(children); |
| | | baseMapper.updateDeptChildren(children); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public void deleteDictDataByIds(Long[] dictCodes) { |
| | | for (Long dictCode : dictCodes) { |
| | | SysDictData data = selectDictDataById(dictCode); |
| | | baseMapper.deleteById(dictCode); |
| | | List<SysDictData> dictDatas = baseMapper.selectDictDataByType(data.getDictType()); |
| | | DictUtils.setDictCache(data.getDictType(), dictDatas); |
| | | } |
| | | baseMapper.deleteBatchIds(Arrays.asList(dictCodes)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService { |
| | | |
| | | @Autowired |
| | | private SysDictTypeMapper dictTypeMapper; |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | |
| | | .eq(SysDictData::getDictType, dictType.getDictType())) > 0) { |
| | | throw new CustomException(String.format("%1$så·²åé
,ä¸è½å é¤", dictType.getDictName())); |
| | | } |
| | | dictTypeMapper.deleteById(dictId); |
| | | DictUtils.removeDictCache(dictType.getDictType()); |
| | | } |
| | | baseMapper.deleteBatchIds(Arrays.asList(dictIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | list.add(rm); |
| | | } |
| | | if (list.size() > 0) { |
| | | for (SysRoleMenu sysRoleMenu : list) { |
| | | rows += roleMenuMapper.insert(sysRoleMenu); |
| | | } |
| | | rows = roleMenuMapper.batchRoleMenu(list); |
| | | } |
| | | return rows; |
| | | } |
| | |
| | | list.add(rd); |
| | | } |
| | | if (list.size() > 0) { |
| | | for (SysRoleDept sysRoleDept : list) { |
| | | rows += roleDeptMapper.insert(sysRoleDept); |
| | | } |
| | | rows = roleDeptMapper.batchRoleDept(list); |
| | | } |
| | | return rows; |
| | | } |
| | |
| | | private ISysConfigService configService; |
| | | |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | @DataScope(deptAlias = "d", userAlias = "u", isUser = true) |
| | | public TableDataInfo<SysUser> selectPageUserList(SysUser user) { |
| | | return PageUtils.buildDataInfo(baseMapper.selectPageUserList(PageUtils.buildPage(), user)); |
| | | } |
| | |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | @DataScope(deptAlias = "d", userAlias = "u", isUser = true) |
| | | public List<SysUser> selectUserList(SysUser user) { |
| | | return baseMapper.selectUserList(user); |
| | | } |
| | |
| | | @Override |
| | | public String selectUserRoleGroup(String userName) { |
| | | List<SysRole> list = roleMapper.selectRolesByUserName(userName); |
| | | StringBuffer idsStr = new StringBuffer(); |
| | | StringBuilder idsStr = new StringBuilder(); |
| | | for (SysRole role : list) { |
| | | idsStr.append(role.getRoleName()).append(","); |
| | | } |
| | |
| | | @Override |
| | | public String selectUserPostGroup(String userName) { |
| | | List<SysPost> list = postMapper.selectPostsByUserName(userName); |
| | | StringBuffer idsStr = new StringBuffer(); |
| | | StringBuilder idsStr = new StringBuilder(); |
| | | for (SysPost post : list) { |
| | | idsStr.append(post.getPostName()).append(","); |
| | | } |
| | |
| | | list.add(ur); |
| | | } |
| | | if (list.size() > 0) { |
| | | for (SysUserRole sysUserRole : list) { |
| | | userRoleMapper.insert(sysUserRole); |
| | | } |
| | | userRoleMapper.batchUserRole(list); |
| | | } |
| | | } |
| | | } |
| | |
| | | list.add(up); |
| | | } |
| | | if (list.size() > 0) { |
| | | for (SysUserPost sysUserPost : list) { |
| | | userPostMapper.insert(sysUserPost); |
| | | } |
| | | userPostMapper.batchUserPost(list); |
| | | } |
| | | } |
| | | } |
| | |
| | | AND status = #{status} |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | <if test="params.dataScope != null and params.dataScope != ''"> |
| | | AND ( ${params.dataScope} ) |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | <update id="updateDeptChildren" parameterType="java.util.List"> |
| | | update sys_dept set ancestors = |
| | | <foreach collection="depts" item="item" index="index" |
| | | separator=" " open="case dept_id" close="end"> |
| | | when #{item.deptId} then #{item.ancestors} |
| | | </foreach> |
| | | where dept_id in |
| | | <foreach collection="depts" item="item" index="index" |
| | | separator="," open="(" close=")"> |
| | | #{item.deptId} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <result property="deptId" column="dept_id"/> |
| | | </resultMap> |
| | | |
| | | <insert id="batchRoleDept"> |
| | | insert into sys_role_dept(role_id, dept_id) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | (#{item.roleId},#{item.deptId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | and date_format(r.create_time,'%y%m%d') <= date_format(#{role.params.endTime},'%y%m%d') |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${role.params.dataScope} |
| | | <if test="role.params.dataScope != null and role.params.dataScope != ''"> |
| | | AND ( ${role.params.dataScope} ) |
| | | </if> |
| | | order by r.role_sort |
| | | </select> |
| | | |
| | |
| | | and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | <if test="params.dataScope != null and params.dataScope != ''"> |
| | | AND ( ${params.dataScope} ) |
| | | </if> |
| | | order by r.role_sort |
| | | </select> |
| | | |
| | |
| | | <result property="menuId" column="menu_id"/> |
| | | </resultMap> |
| | | |
| | | <insert id="batchRoleMenu"> |
| | | insert into sys_role_menu(role_id, menu_id) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | (#{item.roleId},#{item.menuId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | ancestors) )) |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${user.params.dataScope} |
| | | <if test="user.params.dataScope != null and user.params.dataScope != ''"> |
| | | AND ( ${user.params.dataScope} ) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | |
| | | ancestors) )) |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | <if test="params.dataScope != null and params.dataScope != ''"> |
| | | AND ( ${params.dataScope} ) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
| | |
| | | <result property="postId" column="post_id"/> |
| | | </resultMap> |
| | | |
| | | <insert id="batchUserPost"> |
| | | insert into sys_user_post(user_id, post_id) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | (#{item.userId},#{item.postId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | <result property="roleId" column="role_id"/> |
| | | </resultMap> |
| | | |
| | | <insert id="batchUserRole"> |
| | | insert into sys_user_role(user_id, role_id) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | (#{item.userId},#{item.roleId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "name": "ruoyi-vue-plus", |
| | | "version": "2.2.1", |
| | | "version": "2.3.0", |
| | | "description": "RuoYi-Vue-Plusåå°ç®¡çç³»ç»", |
| | | "author": "LionLi", |
| | | "license": "MIT", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢æµè¯å表å表 |
| | | export function listDemo(query) { |
| | | return request({ |
| | | url: '/demo/demo/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢æµè¯åè¡¨è¯¦ç» |
| | | export function getDemo(id) { |
| | | return request({ |
| | | url: '/demo/demo/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢æµè¯å表 |
| | | export function addDemo(data) { |
| | | return request({ |
| | | url: '/demo/demo', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹æµè¯å表 |
| | | export function updateDemo(data) { |
| | | return request({ |
| | | url: '/demo/demo', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å 餿µè¯å表 |
| | | export function delDemo(id) { |
| | | return request({ |
| | | url: '/demo/demo/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // å¯¼åºæµè¯å表 |
| | | export function exportDemo(query) { |
| | | return request({ |
| | | url: '/demo/demo/export', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢æµè¯å表 |
| | | export function listTest(query) { |
| | | return request({ |
| | | url: '/demo/test/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢æµè¯è¯¦ç» |
| | | export function getTest(id) { |
| | | return request({ |
| | | url: '/demo/test/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢æµè¯ |
| | | export function addTest(data) { |
| | | return request({ |
| | | url: '/demo/test', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹æµè¯ |
| | | export function updateTest(data) { |
| | | return request({ |
| | | url: '/demo/test', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å 餿µè¯ |
| | | export function delTest(id) { |
| | | return request({ |
| | | url: '/demo/test/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // å¯¼åºæµè¯ |
| | | export function exportTest(query) { |
| | | return request({ |
| | | url: '/demo/test/export', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢æµè¯æ 表å表 |
| | | export function listTree(query) { |
| | | return request({ |
| | | url: '/demo/tree/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢æµè¯æ è¡¨è¯¦ç» |
| | | export function getTree(id) { |
| | | return request({ |
| | | url: '/demo/tree/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢æµè¯æ 表 |
| | | export function addTree(data) { |
| | | return request({ |
| | | url: '/demo/tree', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹æµè¯æ 表 |
| | | export function updateTree(data) { |
| | | return request({ |
| | | url: '/demo/tree', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å 餿µè¯æ 表 |
| | | export function delTree(id) { |
| | | return request({ |
| | | url: '/demo/tree/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // å¯¼åºæµè¯æ 表 |
| | | export function exportTree(query) { |
| | | return request({ |
| | | url: '/demo/tree/export', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="keyé®" prop="testKey"> |
| | | <el-input |
| | | v-model="queryParams.testKey" |
| | | placeholder="请è¾å
¥keyé®" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å¼" prop="value"> |
| | | <el-input |
| | | v-model="queryParams.value" |
| | | placeholder="请è¾å
¥å¼" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker |
| | | v-model="daterangeCreateTime" |
| | | size="small" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['demo:demo:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['demo:demo:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['demo:demo:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | :loading="exportLoading" |
| | | @click="handleExport" |
| | | v-hasPermi="['demo:demo:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="demoList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="主é®" align="center" prop="id" v-if="false"/> |
| | | <el-table-column label="é¨é¨id" align="center" prop="deptId" /> |
| | | <el-table-column label="ç¨æ·id" align="center" prop="userId" /> |
| | | <el-table-column label="æåºå·" align="center" prop="orderNum" /> |
| | | <el-table-column label="keyé®" align="center" prop="testKey" /> |
| | | <el-table-column label="å¼" align="center" prop="value" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建人" align="center" prop="createBy" /> |
| | | <el-table-column label="æ´æ°æ¶é´" align="center" prop="updateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ´æ°äºº" align="center" prop="updateBy" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['demo:demo:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['demo:demo:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹æµè¯åè¡¨å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="é¨é¨id" prop="deptId"> |
| | | <el-input v-model="form.deptId" placeholder="请è¾å
¥é¨é¨id" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·id" prop="userId"> |
| | | <el-input v-model="form.userId" placeholder="请è¾å
¥ç¨æ·id" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºå·" prop="orderNum"> |
| | | <el-input v-model="form.orderNum" placeholder="请è¾å
¥æåºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="keyé®" prop="testKey"> |
| | | <el-input v-model="form.testKey" placeholder="请è¾å
¥keyé®" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¼" prop="value"> |
| | | <el-input v-model="form.value" placeholder="请è¾å
¥å¼" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listDemo, getDemo, delDemo, addDemo, updateDemo, exportDemo } from "@/api/demo/demo"; |
| | | |
| | | export default { |
| | | name: "Demo", |
| | | components: { |
| | | }, |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // 导åºé®ç½©å± |
| | | exportLoading: false, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // æµè¯åè¡¨è¡¨æ ¼æ°æ® |
| | | demoList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // å建æ¶é´æ¶é´èå´ |
| | | daterangeCreateTime: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | testKey: undefined, |
| | | value: undefined, |
| | | createTime: undefined, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | testKey: [ |
| | | { required: true, message: "keyé®ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | value: [ |
| | | { required: true, message: "å¼ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢æµè¯å表å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | this.queryParams.params = {}; |
| | | if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { |
| | | this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0]; |
| | | this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; |
| | | } |
| | | listDemo(this.queryParams).then(response => { |
| | | this.demoList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: undefined, |
| | | deptId: undefined, |
| | | userId: undefined, |
| | | orderNum: undefined, |
| | | testKey: undefined, |
| | | value: undefined, |
| | | version: undefined, |
| | | createTime: undefined, |
| | | createBy: undefined, |
| | | updateTime: undefined, |
| | | updateBy: undefined, |
| | | delFlag: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.daterangeCreateTime = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å æµè¯å表"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getDemo(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹æµè¯å表"; |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateDemo(this.form).then(response => { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addDemo(this.form).then(response => { |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$confirm('æ¯å¦ç¡®è®¤å 餿µè¯å表ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(function() { |
| | | return delDemo(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | const queryParams = this.queryParams; |
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºæææµè¯åè¡¨æ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.exportLoading = true; |
| | | return exportDemo(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="keyé®" prop="testKey"> |
| | | <el-input |
| | | v-model="queryParams.testKey" |
| | | placeholder="请è¾å
¥keyé®" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å¼" prop="value"> |
| | | <el-input |
| | | v-model="queryParams.value" |
| | | placeholder="请è¾å
¥å¼" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬" prop="version"> |
| | | <el-input |
| | | v-model="queryParams.version" |
| | | placeholder="请è¾å
¥çæ¬" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker |
| | | v-model="daterangeCreateTime" |
| | | size="small" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="å 餿 å¿" prop="deleted"> |
| | | <el-input |
| | | v-model="queryParams.deleted" |
| | | placeholder="请è¾å
¥å 餿 å¿" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶id" prop="parentId"> |
| | | <el-input |
| | | v-model="queryParams.parentId" |
| | | placeholder="请è¾å
¥ç¶id" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºå·" prop="orderNum"> |
| | | <el-input |
| | | v-model="queryParams.orderNum" |
| | | placeholder="请è¾å
¥æåºå·" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['demo:test:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['demo:test:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['demo:test:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['demo:test:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="testList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="主é®" align="center" prop="id" v-if="false"/> |
| | | <el-table-column label="keyé®" align="center" prop="testKey" /> |
| | | <el-table-column label="å¼" align="center" prop="value" /> |
| | | <el-table-column label="çæ¬" align="center" prop="version" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å 餿 å¿" align="center" prop="deleted" /> |
| | | <el-table-column label="ç¶id" align="center" prop="parentId" /> |
| | | <el-table-column label="æåºå·" align="center" prop="orderNum" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['demo:test:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['demo:test:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹æµè¯å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="keyé®" prop="testKey"> |
| | | <el-input v-model="form.testKey" placeholder="请è¾å
¥keyé®" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¼" prop="value"> |
| | | <el-input v-model="form.value" placeholder="请è¾å
¥å¼" /> |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬" prop="version"> |
| | | <el-input v-model="form.version" placeholder="请è¾å
¥çæ¬" /> |
| | | </el-form-item> |
| | | <el-form-item label="å 餿 å¿" prop="deleted"> |
| | | <el-input v-model="form.deleted" placeholder="请è¾å
¥å 餿 å¿" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶id" prop="parentId"> |
| | | <el-input v-model="form.parentId" placeholder="请è¾å
¥ç¶id" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåºå·" prop="orderNum"> |
| | | <el-input v-model="form.orderNum" placeholder="请è¾å
¥æåºå·" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listTest, getTest, delTest, addTest, updateTest, exportTest } from "@/api/demo/test"; |
| | | |
| | | export default { |
| | | name: "Test", |
| | | components: { |
| | | }, |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // æµè¯è¡¨æ ¼æ°æ® |
| | | testList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // å建æ¶é´æ¶é´èå´ |
| | | daterangeCreateTime: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | testKey: undefined, |
| | | value: undefined, |
| | | version: undefined, |
| | | createTime: undefined, |
| | | deleted: undefined, |
| | | parentId: undefined, |
| | | orderNum: undefined |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢æµè¯å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | this.queryParams.params = {}; |
| | | if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { |
| | | this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0]; |
| | | this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; |
| | | } |
| | | listTest(this.queryParams).then(response => { |
| | | this.testList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: undefined, |
| | | testKey: undefined, |
| | | value: undefined, |
| | | version: undefined, |
| | | createTime: undefined, |
| | | deleted: undefined, |
| | | parentId: undefined, |
| | | orderNum: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.daterangeCreateTime = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å æµè¯"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getTest(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹æµè¯"; |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateTest(this.form).then(response => { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addTest(this.form).then(response => { |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$confirm('æ¯å¦ç¡®è®¤å 餿µè¯ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(function() { |
| | | return delTest(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | const queryParams = this.queryParams; |
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºæææµè¯æ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(function() { |
| | | return exportTest(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="æ èç¹å" prop="treeName"> |
| | | <el-input |
| | | v-model="queryParams.treeName" |
| | | placeholder="请è¾å
¥æ èç¹å" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker |
| | | v-model="daterangeCreateTime" |
| | | size="small" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['demo:tree:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="treeList" |
| | | row-key="id" |
| | | default-expand-all |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | > |
| | | <el-table-column label="ç¶id" prop="parentId" /> |
| | | <el-table-column label="é¨é¨id" align="center" prop="deptId" /> |
| | | <el-table-column label="ç¨æ·id" align="center" prop="userId" /> |
| | | <el-table-column label="æ èç¹å" align="center" prop="treeName" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['demo:tree:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)" |
| | | v-hasPermi="['demo:tree:add']" |
| | | >æ°å¢</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['demo:tree:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- æ·»å æä¿®æ¹æµè¯æ è¡¨å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="ç¶id" prop="parentId"> |
| | | <treeselect v-model="form.parentId" :options="treeOptions" :normalizer="normalizer" placeholder="è¯·éæ©ç¶id" /> |
| | | </el-form-item> |
| | | <el-form-item label="é¨é¨id" prop="deptId"> |
| | | <el-input v-model="form.deptId" placeholder="请è¾å
¥é¨é¨id" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·id" prop="userId"> |
| | | <el-input v-model="form.userId" placeholder="请è¾å
¥ç¨æ·id" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ èç¹å" prop="treeName"> |
| | | <el-input v-model="form.treeName" placeholder="请è¾å
¥æ èç¹å" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listTree, getTree, delTree, addTree, updateTree, exportTree } from "@/api/demo/tree"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | |
| | | export default { |
| | | name: "Tree", |
| | | components: { |
| | | Treeselect |
| | | }, |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æµè¯æ è¡¨è¡¨æ ¼æ°æ® |
| | | treeList: [], |
| | | // æµè¯æ 表æ é项 |
| | | treeOptions: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // å建æ¶é´æ¶é´èå´ |
| | | daterangeCreateTime: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | treeName: null, |
| | | createTime: null, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | treeName: [ |
| | | { required: true, message: "æ èç¹åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢æµè¯æ 表å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | this.queryParams.params = {}; |
| | | if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { |
| | | this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0]; |
| | | this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; |
| | | } |
| | | listTree(this.queryParams).then(response => { |
| | | this.treeList = this.handleTree(response.data, "id", "parentId"); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** è½¬æ¢æµè¯æ è¡¨æ°æ®ç»æ */ |
| | | normalizer(node) { |
| | | if (node.children && !node.children.length) { |
| | | delete node.children; |
| | | } |
| | | return { |
| | | id: node.id, |
| | | label: node.treeName, |
| | | children: node.children |
| | | }; |
| | | }, |
| | | /** æ¥è¯¢æµè¯æ è¡¨ä¸ææ ç»æ */ |
| | | getTreeselect() { |
| | | listTree().then(response => { |
| | | this.treeOptions = []; |
| | | const data = { id: 0, treeName: '顶级èç¹', children: [] }; |
| | | data.children = this.handleTree(response.data, "id", "parentId"); |
| | | this.treeOptions.push(data); |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | parentId: null, |
| | | deptId: null, |
| | | userId: null, |
| | | treeName: null, |
| | | version: null, |
| | | createTime: null, |
| | | createBy: null, |
| | | updateTime: null, |
| | | updateBy: null, |
| | | delFlag: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.daterangeCreateTime = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd(row) { |
| | | this.reset(); |
| | | this.getTreeselect(); |
| | | if (row != null && row.id) { |
| | | this.form.parentId = row.id; |
| | | } else { |
| | | this.form.parentId = 0; |
| | | } |
| | | this.open = true; |
| | | this.title = "æ·»å æµè¯æ 表"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | this.getTreeselect(); |
| | | if (row != null) { |
| | | this.form.parentId = row.id; |
| | | } |
| | | getTree(row.id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹æµè¯æ 表"; |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateTree(this.form).then(response => { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addTree(this.form).then(response => { |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å 餿µè¯æ 表ç¼å·ä¸º"' + row.id + '"çæ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(function() { |
| | | return delTree(row.id); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <span>æ´æ°æ¥å¿</span> |
| | | </div> |
| | | <el-collapse accordion> |
| | | <el-collapse-item title="v2.3.0 - 2021-6-1"> |
| | | <ol> |
| | | <li>add å级 luttuce 为 redisson æ§è½æ´å¼º å·¥å
·æ´å
¨</li> |
| | | <li>add å¢å æµè¯æ°æ®sqlæä»¶</li> |
| | | <li>add å¢å demo模å å表æ¼ç¤ºæ¡ä¾(å
嫿°æ®æé)</li> |
| | | <li>update å®ç¾ä¿®å¤ æ°æ®æéåè½(æ¯æå表å¤è¡¨è¿æ»¤)</li> |
| | | <li>update ä¼å代ç çææ¨¡æ¿</li> |
| | | <li>update ä¼å system æ¨¡å æ¹éæä½æ§è½</li> |
| | | </ol> |
| | | </el-collapse-item> |
| | | <el-collapse-item title="v2.2.1 - 2021-5-29"> |
| | | <ol> |
| | | <li>add å¢å security æéæ¡æ¶ @Async 弿¥æ³¨è§£é
ç½®</li> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off |
| | | |
| | | rem jar平级ç®å½ |
| | | set AppName=ruoyi-admin.jar |
| | | |
| | | rem JVMåæ° |
| | | set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" |
| | | |
| | | |
| | | ECHO. |
| | | ECHO. [1] å¯å¨%AppName% |
| | | ECHO. [2] å
³é%AppName% |
| | | ECHO. [3] éå¯%AppName% |
| | | ECHO. [4] å¯å¨ç¶æ %AppName% |
| | | ECHO. [5] é åº |
| | | ECHO. |
| | | |
| | | ECHO.请è¾å
¥éæ©é¡¹ç®çåºå·: |
| | | set /p ID= |
| | | IF "%id%"=="1" GOTO start |
| | | IF "%id%"=="2" GOTO stop |
| | | IF "%id%"=="3" GOTO restart |
| | | IF "%id%"=="4" GOTO status |
| | | IF "%id%"=="5" EXIT |
| | | PAUSE |
| | | :start |
| | | for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( |
| | | set pid=%%a |
| | | set image_name=%%b |
| | | ) |
| | | if defined pid ( |
| | | echo %%is running |
| | | PAUSE |
| | | ) |
| | | |
| | | start javaw -jar %JAVA_OPTS% ruoyi-admin.jar |
| | | |
| | | echo startingâ¦â¦ |
| | | echo Start %AppName% success... |
| | | goto:eof |
| | | |
| | | rem 彿°stopéè¿jpså½ä»¤æ¥æ¾pidå¹¶ç»æè¿ç¨ |
| | | :stop |
| | | for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( |
| | | set pid=%%a |
| | | set image_name=%%b |
| | | ) |
| | | if not defined pid (echo process %AppName% does not exists) else ( |
| | | echo prepare to kill %image_name% |
| | | echo start kill %pid% ... |
| | | rem æ ¹æ®è¿ç¨IDï¼killè¿ç¨ |
| | | taskkill /f /pid %pid% |
| | | ) |
| | | goto:eof |
| | | :restart |
| | | call :stop |
| | | call :start |
| | | goto:eof |
| | | :status |
| | | for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( |
| | | set pid=%%a |
| | | set image_name=%%b |
| | | ) |
| | | if not defined pid (echo process %AppName% is dead ) else ( |
| | | echo %image_name% is running |
| | | ) |
| | | goto:eof |
| | |
| | | #!/bin/bash |
| | | |
| | | #!/bin/sh |
| | | # author ruoyi |
| | | # ./ry.sh start å¯å¨ |
| | | # ./ry.sh stop 忢 |
| | | # ./ry.sh restart éå¯ |
| | | # ./ry.sh start ç¶æ |
| | | AppName=ruoyi-admin.jar |
| | | |
| | | #JVMåæ° |
¶Ô±ÈÐÂÎļþ |
| | |
| | | DROP TABLE if EXISTS test_demo; |
| | | CREATE TABLE test_demo |
| | | ( |
| | | id int(0) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | dept_id int(0) NULL DEFAULT NULL COMMENT 'é¨é¨id', |
| | | user_id int(0) NULL DEFAULT NULL COMMENT 'ç¨æ·id', |
| | | order_num int(0) NULL DEFAULT 0 COMMENT 'æåºå·', |
| | | test_key varchar(255) NULL DEFAULT NULL COMMENT 'keyé®', |
| | | value varchar(255) NULL DEFAULT NULL COMMENT 'å¼', |
| | | version int(0) NULL DEFAULT 0 COMMENT 'çæ¬', |
| | | create_time datetime(0) NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | create_by varchar(64) NULL DEFAULT NULL COMMENT 'å建人', |
| | | update_time datetime(0) NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | update_by varchar(64) NULL DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | del_flag int(0) NULL DEFAULT NULL COMMENT 'å 餿 å¿', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ) ENGINE = InnoDB COMMENT = 'æµè¯å表'; |
| | | |
| | | DROP TABLE if EXISTS test_tree; |
| | | CREATE TABLE test_tree |
| | | ( |
| | | id int(0) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | parent_id int(0) NULL DEFAULT 0 COMMENT 'ç¶id', |
| | | dept_id int(0) NULL DEFAULT NULL COMMENT 'é¨é¨id', |
| | | user_id int(0) NULL DEFAULT NULL COMMENT 'ç¨æ·id', |
| | | tree_name varchar(255) NULL DEFAULT NULL COMMENT 'å¼', |
| | | version int(0) NULL DEFAULT 0 COMMENT 'çæ¬', |
| | | create_time datetime(0) NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | create_by varchar(64) NULL DEFAULT NULL COMMENT 'å建人', |
| | | update_time datetime(0) NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | update_by varchar(64) NULL DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | del_flag int(0) NULL DEFAULT NULL COMMENT 'å 餿 å¿', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ) ENGINE = InnoDB COMMENT = 'æµè¯æ 表'; |
| | | |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (5, 'æµè¯èå', 0, 5, 'demo', NULL, 1, 0, 'M', '0', '0', NULL, 'star', 'admin', '2021-05-30 00:34:26', NULL, NULL, ''); |
| | | |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1500, 'æµè¯å表', 5, 1, 'demo', 'demo/demo/index', 1, 0, 'C', '0', '0', 'demo:demo:list', '#', 'admin', '2021-05-30 00:39:23', '', NULL, 'æµè¯å表èå'); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1501, 'æµè¯å表æ¥è¯¢', 1500, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:query', '#', 'admin', '2021-05-30 00:39:23', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1502, 'æµè¯å表æ°å¢', 1500, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:add', '#', 'admin', '2021-05-30 00:39:23', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1503, 'æµè¯å表修æ¹', 1500, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:edit', '#', 'admin', '2021-05-30 00:39:23', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1504, 'æµè¯å表å é¤', 1500, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:remove', '#', 'admin', '2021-05-30 00:39:23', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1505, 'æµè¯å表导åº', 1500, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:demo:export', '#', 'admin', '2021-05-30 00:39:23', '', NULL, ''); |
| | | |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1506, 'æµè¯æ 表', 5, 1, 'tree', 'demo/tree/index', 1, 0, 'C', '0', '0', 'demo:tree:list', '#', 'admin', '2021-05-30 00:39:30', '', NULL, 'æµè¯æ 表èå'); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1507, 'æµè¯æ 表æ¥è¯¢', 1506, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:query', '#', 'admin', '2021-05-30 00:39:30', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1508, 'æµè¯æ 表æ°å¢', 1506, 2, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:add', '#', 'admin', '2021-05-30 00:39:30', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1509, 'æµè¯æ 表修æ¹', 1506, 3, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:edit', '#', 'admin', '2021-05-30 00:39:30', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1510, 'æµè¯æ 表å é¤', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 'admin', '2021-05-30 00:39:30', '', NULL, ''); |
| | | INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1511, 'æµè¯æ 表导åº', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 'admin', '2021-05-30 00:39:30', '', NULL, ''); |
| | | |
| | | INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (3, 'æ¬é¨é¨å以ä¸', 'test1', 3, '4', 1, 1, '0', '0', 'admin', '2021-05-08 22:31:37', 'admin', '2021-05-08 22:32:03', NULL); |
| | | INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (4, 'ä»
æ¬äºº', 'test2', 4, '5', 1, 1, '0', '0', 'admin', '2021-05-30 01:14:52', 'admin', '2021-05-30 01:18:38', NULL); |
| | | |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 5); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 100); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 101); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 102); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 103); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 104); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 105); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 106); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 107); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 108); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 500); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 501); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1001); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1002); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1003); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1004); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1005); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1006); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1007); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1008); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1009); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1010); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1011); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1012); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1013); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1014); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1015); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1016); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1017); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1018); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1019); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1020); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1021); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1022); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1023); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1024); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1025); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1026); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1027); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1028); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1029); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1030); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1031); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1032); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1033); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1034); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1035); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1036); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1037); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1038); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1039); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1040); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1041); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1042); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1043); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1044); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1045); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1500); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1501); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1502); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1503); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1504); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1505); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1506); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1507); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1508); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1509); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1510); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1511); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 5); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1500); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1501); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1502); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1503); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1504); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1505); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1506); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1507); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1508); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1509); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1510); |
| | | INSERT INTO sys_role_menu(role_id, menu_id) VALUES (4, 1511); |
| | | |
| | | INSERT INTO sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) VALUES (3, 108, 'test', 'æ¬é¨é¨åä»¥ä¸ å¯ç 666', '00', '', '', '0', '', '$2a$10$M6tZRpUZbWKq11O/z6YISePQc./Jhru8E18mmVJTr9aV8whzfjacC', '0', '0', '127.0.0.1', '2021-05-30 02:00:37', 'admin', '2021-04-22 09:50:41', 'test', '2021-05-30 02:00:37', NULL); |
| | | INSERT INTO sys_user(user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark) VALUES (4, 102, 'test1', 'ä»
æ¬äºº å¯ç 666', '00', '', '', '0', '', '$2a$10$yBSXp5Ba1m402cxXTPSy4eXUO8CXCGvXfquNVP/XMWwZ8nf9GaoMy', '0', '0', '127.0.0.1', '2021-05-30 01:48:03', 'admin', '2021-05-30 01:16:02', 'test1', '2021-05-30 01:48:03', NULL); |
| | | |
| | | INSERT INTO sys_user_role(user_id, role_id) VALUES (3, 3); |
| | | INSERT INTO sys_user_role(user_id, role_id) VALUES (4, 4); |
| | | |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (1, 102, 4, 1, 'æµè¯æ°æ®æé', 'æµè¯', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (2, 102, 3, 2, 'åèç¹1', '111', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (3, 102, 3, 3, 'åèç¹2', '222', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (4, 108, 4, 4, 'æµè¯æ°æ®', 'demo', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (5, 108, 3, 13, 'åèç¹11', '1111', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (6, 108, 3, 12, 'åèç¹22', '2222', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (7, 108, 3, 11, 'åèç¹33', '3333', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (8, 108, 3, 10, 'åèç¹44', '4444', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (9, 108, 3, 9, 'åèç¹55', '5555', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (10, 108, 3, 8, 'åèç¹66', '6666', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (11, 108, 3, 7, 'åèç¹77', '7777', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (12, 108, 3, 6, 'åèç¹88', '8888', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_demo(id, dept_id, user_id, order_num, test_key, value, version, create_time, create_by, update_time, update_by, del_flag) VALUES (13, 108, 3, 5, 'åèç¹99', '9999', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (1, 0, 102, 4, 'æµè¯æ°æ®æé', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (2, 1, 102, 3, 'åèç¹1', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (3, 2, 102, 3, 'åèç¹2', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (4, 0, 108, 4, 'æµè¯æ 1', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (5, 4, 108, 3, 'åèç¹11', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (6, 4, 108, 3, 'åèç¹22', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (7, 4, 108, 3, 'åèç¹33', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (8, 5, 108, 3, 'åèç¹44', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (9, 6, 108, 3, 'åèç¹55', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (10, 7, 108, 3, 'åèç¹66', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (11, 7, 108, 3, 'åèç¹77', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (12, 10, 108, 3, 'åèç¹88', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |
| | | INSERT INTO test_tree(id, parent_id, dept_id, user_id, tree_name, version, create_time, create_by, update_time, update_by, del_flag) VALUES (13, 10, 108, 3, 'åèç¹99', 0, '2021-06-01 10:00:00', 'admin', NULL, NULL, 0); |