diff --git a/pigx-visual/pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/config/WebSecurityConfigurer.java b/pigx-visual/pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/config/WebSecurityConfigurer.java
deleted file mode 100755
index 7687ccf37..000000000
--- a/pigx-visual/pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/config/WebSecurityConfigurer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.monitor.config;
-
-import de.codecentric.boot.admin.server.config.AdminServerProperties;
-import lombok.SneakyThrows;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
-
-/**
- * WebSecurityConfigurer
- *
- * @author lishangbu
- * @date 2019/2/1
- */
-@Configuration
-public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
-
- private final String adminContextPath;
-
- public WebSecurityConfigurer(AdminServerProperties adminServerProperties) {
- this.adminContextPath = adminServerProperties.getContextPath();
- }
-
- @Override
- @SneakyThrows
- protected void configure(HttpSecurity http) {
- // @formatter:off
- SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
- successHandler.setTargetUrlParameter("redirectTo");
- successHandler.setDefaultTargetUrl(adminContextPath + "/");
-
- http
- .headers().frameOptions().disable()
- .and().authorizeRequests()
- .antMatchers(adminContextPath + "/assets/**"
- ,adminContextPath + "/login"
- , adminContextPath + "/actuator/**"
- , adminContextPath + "/instances/**"
- , adminContextPath + "/redis/info"
- ).permitAll()
- .anyRequest().authenticated()
- .and()
- .formLogin().loginPage(adminContextPath + "/login")
- .successHandler(successHandler).and()
- .logout().logoutUrl(adminContextPath + "/logout")
- .and()
- .httpBasic().and()
- .csrf()
- .disable();
- // @formatter:on
- }
-
-}
diff --git a/pigx-visual/pigx-report-platform/pom.xml b/pigx-visual/pigx-report-platform/pom.xml
index f4e6ebc7d..0792f18ef 100644
--- a/pigx-visual/pigx-report-platform/pom.xml
+++ b/pigx-visual/pigx-report-platform/pom.xml
@@ -1,168 +1,179 @@
-
- com.pig4cloud
- pigx-visual
- 4.5.0-SNAPSHOT
-
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ com.pig4cloud
+ pigx-visual
+ 4.5.0-SNAPSHOT
+
- pigx-report-platform
- 4.0.0
+ pigx-report-platform
+ 4.0.0
- jar
+ jar
- 基于 aj-report 的大屏设计系统
+ 基于 aj-report 的大屏设计系统
-
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
-
- org.springframework.boot
- spring-boot-starter-web
-
+
+ org.springframework.boot
+ spring-boot-starter-web
+
-
- com.anji-plus
- spring-boot-gaea
- 2.0.3.RELEASE
-
+
+ com.anji-plus
+ spring-boot-gaea
+ 2.0.3.RELEASE
+
-
- com.baomidou
- mybatis-plus-boot-starter
- 3.3.2
-
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.3.2
+
-
- com.oracle.database.jdbc
- ojdbc8
-
+
+ com.oracle.database.jdbc
+ ojdbc8
+
-
-
- mysql
- mysql-connector-java
-
+
+
+ mysql
+ mysql-connector-java
+
-
- com.oracle.database.jdbc
- ojdbc8
-
+
+ com.oracle.database.jdbc
+ ojdbc8
+
-
-
- org.postgresql
- postgresql
-
+
+
+ org.postgresql
+ postgresql
+
-
- jakarta.servlet
- jakarta.servlet-api
-
+
+ jakarta.servlet
+ jakarta.servlet-api
+
-
- org.apache.httpcomponents
- httpclient
-
+
+ org.apache.httpcomponents
+ httpclient
+
-
- com.itextpdf
- itextpdf
- 5.5.13.2
-
-
- com.itextpdf
- itext-asian
- 5.2.0
-
+
+ com.itextpdf
+ itextpdf
+ 5.5.13.2
+
+
+ com.itextpdf
+ itext-asian
+ 5.2.0
+
-
- org.apache.poi
- poi
- 4.1.2
-
-
- org.apache.poi
- poi-ooxml
- 4.1.2
-
-
- org.apache.poi
- poi-ooxml-schemas
- 4.1.2
-
+
+ org.apache.poi
+ poi
+ 4.1.2
+
+
+ org.apache.poi
+ poi-ooxml
+ 4.1.2
+
+
+ org.apache.poi
+ poi-ooxml-schemas
+ 4.1.2
+
-
-
- org.springframework.boot
- spring-boot-starter-undertow
-
+
+ org.codehaus.groovy
+ groovy
+ 3.0.9
+
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-nacos-config
-
+
+
+ org.springframework.boot
+ spring-boot-starter-undertow
+
-
-
- com.alibaba
- druid-spring-boot-starter
-
-
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
-
-
-
- com.baomidou
- mybatis-plus-extension
- 3.3.2
-
-
-
+
+
+ com.alibaba
+ druid-spring-boot-starter
+
+
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
-
- true
-
-
-
- io.fabric8
- docker-maven-plugin
-
- false
-
-
-
-
-
- src/main/resources
- true
-
- **/*.woff
- **/*.woff2
- **/*.ttf
-
-
-
- src/main/resources
- false
-
- **/*.woff
- **/*.woff2
- **/*.ttf
-
-
-
-
+
+
+
+ com.baomidou
+ mybatis-plus-extension
+ 3.3.2
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ true
+
+
+
+ io.fabric8
+ docker-maven-plugin
+
+ false
+
+
+
+
+
+ src/main/resources
+ true
+
+ **/*.woff
+ **/*.woff2
+ **/*.ttf
+
+
+
+ src/main/resources
+ false
+
+ **/*.woff
+ **/*.woff2
+ **/*.ttf
+
+
+
+
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anji/plus/gaea/GaeaAutoConfiguration.java b/pigx-visual/pigx-report-platform/src/main/java/com/anji/plus/gaea/GaeaAutoConfiguration.java
new file mode 100644
index 000000000..bc90c074a
--- /dev/null
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anji/plus/gaea/GaeaAutoConfiguration.java
@@ -0,0 +1,205 @@
+package com.anji.plus.gaea;
+
+import com.anji.plus.gaea.cache.CacheHelper;
+import com.anji.plus.gaea.cache.RedisCacheHelper;
+import com.anji.plus.gaea.config.MybatisPlusMetaObjectHandler;
+import com.anji.plus.gaea.curd.mapper.injected.CustomSqlInjector;
+import com.anji.plus.gaea.event.listener.ExceptionApplicationListener;
+import com.anji.plus.gaea.i18.MessageLocaleResolver;
+import com.anji.plus.gaea.i18.MessageSourceHolder;
+import com.anji.plus.gaea.init.InitRequestUrlMappings;
+import com.anji.plus.gaea.intercept.AccessKeyInterceptor;
+import com.anji.plus.gaea.utils.ApplicationContextUtils;
+import com.anji.plus.gaea.utils.JwtBean;
+import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
+import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
+import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.LocaleResolver;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.util.Locale;
+
+/**
+ * 盖亚自动装配
+ * @author lr
+ * @since 2021-01-11
+ */
+@Configuration
+@EnableConfigurationProperties(GaeaProperties.class)
+public class GaeaAutoConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean
+ public Jackson2ObjectMapperBuilderCustomizer customizer() {
+ return builder -> {
+ builder.locale(Locale.CHINA);
+ builder.serializerByType(Long.class, ToStringSerializer.instance);
+ };
+ }
+
+ /**
+ * spring上下文工具类
+ * @return
+ */
+ @Bean
+ public ApplicationContextUtils applicationContextUtils() {
+ return new ApplicationContextUtils();
+ }
+
+ /**
+ * jwt实例
+ * @param gaeaProperties
+ * @return
+ */
+ @Bean
+ public JwtBean jwtBean(GaeaProperties gaeaProperties) {
+ return new JwtBean(gaeaProperties);
+ }
+
+ @Bean
+ @ConditionalOnClass(RedisAutoConfiguration.class)
+ @ConditionalOnMissingBean
+ public CacheHelper cacheHelper() {
+ return new RedisCacheHelper();
+ }
+
+
+ /**
+ * web服务器环境,网关不加载
+ */
+ @Configuration
+ @ConditionalOnClass(WebMvcConfigurer.class)
+ @ComponentScan(value = {"com.anji.plus.gaea.controller", "com.anji.plus.gaea.exception.advice"})
+ public static class WebGaeaAutoConfiguration {
+ /**
+ * 获取当前应用所有的RequestMapping信息,用于权限配置
+ * @return
+ */
+ @Bean
+ public InitRequestUrlMappings initRequestUrlMappings() {
+ return new InitRequestUrlMappings();
+ }
+
+ /**
+ * 国际化
+ *
+ * @author lr
+ * @since 2021-01-01
+ */
+ @Configuration
+ @ConditionalOnClass(LocaleResolver.class)
+ @ConditionalOnMissingBean(MessageLocaleResolver.class)
+ public class MessageI18AutoConfiguration {
+
+ /**
+ * 根据请求头识别国际化locale
+ *
+ * @return
+ */
+ @Bean
+ public MessageLocaleResolver localeResolver() {
+ return new MessageLocaleResolver();
+ }
+
+ /**
+ * 国际化
+ *
+ * @return
+ */
+ @Bean
+ public MessageSourceHolder messageSourceHolder() {
+ return new MessageSourceHolder();
+ }
+ }
+ }
+
+ /**
+ * 异常监听
+ * @return
+ */
+ @Bean
+ public ExceptionApplicationListener exceptionApplicationListener() {
+ return new ExceptionApplicationListener();
+ }
+
+ /**
+ * Web配置
+ */
+ @Configuration
+ @ConditionalOnClass(WebMvcConfigurer.class)
+ public static class GaeaWebMvcConfigurer implements WebMvcConfigurer{
+
+ /**
+ * 拦截器
+ * @param registry
+ */
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ InterceptorRegistration interceptorRegistration = registry.addInterceptor(new AccessKeyInterceptor());
+ interceptorRegistration.addPathPatterns("/**");
+ }
+ }
+
+ /**
+ * 持久层mybatis-plus自动装配
+ *
+ * @author lr
+ * @since 2021-01-01
+ */
+ @Configuration
+ @ConditionalOnClass(MybatisPlusAutoConfiguration.class)
+ public class GaeaMybatisPlusAutoConfiguration {
+ /**
+ * 乐观锁,需要在version字段上加@Version
+ *
+ * @return
+ */
+ @Bean
+ public OptimisticLockerInterceptor optimisticLockerInterceptor() {
+ return new OptimisticLockerInterceptor();
+ }
+
+ /**
+ * 填充sql
+ *
+ * @return
+ */
+ @Bean
+ public CustomSqlInjector customSqlInjector() {
+ return new CustomSqlInjector();
+ }
+
+ /**
+ * 分页
+ *
+ * @return
+ */
+ @Bean
+ public PaginationInterceptor paginationInterceptor() {
+ return new PaginationInterceptor();
+ }
+
+ /**
+ * 默认填充
+ *
+ * @return
+ */
+ @Bean
+ @ConditionalOnMissingBean(value = {MetaObjectHandler.class})
+ public MybatisPlusMetaObjectHandler mybatisPlusMetaObjectHandler() {
+ return new MybatisPlusMetaObjectHandler();
+ }
+ }
+}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java
index 2f27486b7..eb350f37f 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseController.java
@@ -13,14 +13,12 @@ import org.springframework.context.i18n.LocaleContextHolder;
* @date 2021/3/26
*/
public abstract class BaseController
- extends GaeaBaseController
{
-
- /**
- * 获取当前语言类型
- * @return
- */
- public String getI18nLang() {
- return LocaleContextHolder.getLocale().getLanguage();
- }
-
+ extends GaeaBaseController
{
+ /**
+ * 获取当前语言类型
+ * @return
+ */
+ public String getI18nLang(){
+ return LocaleContextHolder.getLocale().getLanguage();
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseService.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseService.java
index aab90bf7c..c3f2eb485 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseService.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/BaseService.java
@@ -6,7 +6,6 @@ import com.anji.plus.gaea.curd.service.GaeaBaseService;
/**
* 项目级的Service公共处理基类
- *
* @author WongBin
* @date 2021/3/26
*/
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/HealthController.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/HealthController.java
index 3a00b9575..f0e8c6666 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/HealthController.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/base/HealthController.java
@@ -12,9 +12,9 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class HealthController {
- @GetMapping("health")
- public ResponseBean health() {
- return ResponseBean.builder().build();
- }
+ @GetMapping("health")
+ public ResponseBean health() {
+ return ResponseBean.builder().build();
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/cache/ReportCacheHelper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/cache/ReportCacheHelper.java
index 625881c0a..7cb03a5b5 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/cache/ReportCacheHelper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/cache/ReportCacheHelper.java
@@ -1,5 +1,6 @@
package com.anjiplus.template.gaea.business.cache;
+
import com.anji.plus.gaea.cache.CacheHelper;
import com.google.common.collect.Maps;
import org.springframework.beans.BeansException;
@@ -15,133 +16,135 @@ import java.util.Set;
public class ReportCacheHelper implements CacheHelper, ApplicationContextAware {
- @Autowired
- private Cache cache;
+ @Autowired
+ private Cache cache;
- @Override
- public String stringGet(String key) {
- Cache.ValueWrapper valueWrapper = cache.get(key);
- if (valueWrapper != null) {
- return (String) valueWrapper.get();
- }
- return CacheHelper.super.stringGet(key);
- }
+ @Override
+ public String stringGet(String key) {
+ Cache.ValueWrapper valueWrapper = cache.get(key);
+ if (valueWrapper != null) {
+ return (String) valueWrapper.get();
+ }
+ return CacheHelper.super.stringGet(key);
+ }
- @Override
- public Boolean setIfAbsent(String key, String value) {
- cache.putIfAbsent(key, value);
- return true;
- }
+ @Override
+ public Boolean setIfAbsent(String key, String value) {
+ cache.putIfAbsent(key, value);
+ return true;
+ }
- @Override
- public boolean exist(String key) {
- String cacheHoldTime = stringGet(key + "_HoldTime");
- if (cacheHoldTime != null && Long.parseLong(cacheHoldTime) > 0) {
- if (Long.parseLong(cacheHoldTime) < System.currentTimeMillis()) {
- delete(key + "_HoldTime");
- delete(key);
- return false;
- }
- }
- return cache.get(key) != null;
- }
- @Override
- public void stringSet(String key, String value) {
- cache.put(key, value);
- }
+ @Override
+ public boolean exist(String key) {
+ String cacheHoldTime = stringGet(key + "_HoldTime");
+ if (cacheHoldTime != null && Long.parseLong(cacheHoldTime) > 0) {
+ if (Long.parseLong(cacheHoldTime) < System.currentTimeMillis()) {
+ delete(key + "_HoldTime");
+ delete(key);
+ return false;
+ }
+ }
+ return cache.get(key) != null;
+ }
- @Override
- public String regKey(String key) {
- return CacheHelper.super.regKey(key);
- }
- @Override
- public void stringSetExpire(String key, String value, long seconds) {
- stringSet(key, value);
- if (seconds > 0) {
- // 缓存失效时间
- stringSet(key + "_HoldTime", String.valueOf(System.currentTimeMillis() + seconds * 1000));
- }
- }
+ @Override
+ public void stringSet(String key, String value) {
+ cache.put(key, value);
+ }
- @Override
- public Map hashGet(String key) {
- Cache.ValueWrapper t = cache.get(key);
- if (t != null) {
- return (Map) t.get();
- }
- return Maps.newHashMap();
- }
- @Override
- public String hashGetString(String key, String hashKey) {
- Map stringStringMap = hashGet(key);
- return stringStringMap.get(hashKey);
- }
+ @Override
+ public String regKey(String key) {
+ return CacheHelper.super.regKey(key);
+ }
- @Override
- public void hashDel(String key, String hashKey) {
- Map stringStringMap = hashGet(key);
- stringStringMap.remove(hashKey);
- }
+ @Override
+ public void stringSetExpire(String key, String value, long seconds) {
+ stringSet(key, value);
+ if (seconds > 0) {
+ //缓存失效时间
+ stringSet(key + "_HoldTime", String.valueOf(System.currentTimeMillis() + seconds * 1000));
+ }
+ }
- @Override
- public void hashBatchDel(String key, Set hashKeys) {
- Map stringStringMap = hashGet(key);
- hashKeys.forEach(stringStringMap::remove);
- }
+ @Override
+ public Map hashGet(String key) {
+ Cache.ValueWrapper t = cache.get(key);
+ if (t != null) {
+ return (Map) t.get();
+ }
+ return Maps.newHashMap();
+ }
- @Override
- public boolean hashExist(String key, String hashKey) {
- if (exist(key)) {
- Map map = hashGet(key);
- return map.containsKey(hashKey);
- }
- return false;
- }
+ @Override
+ public String hashGetString(String key, String hashKey) {
+ Map stringStringMap = hashGet(key);
+ return stringStringMap.get(hashKey);
+ }
- @Override
- public boolean hashAnyExist(String key, String[] hashKeys) {
- return CacheHelper.super.hashAnyExist(key, hashKeys);
- }
+ @Override
+ public void hashDel(String key, String hashKey) {
+ Map stringStringMap = hashGet(key);
+ stringStringMap.remove(hashKey);
+ }
- @Override
- public void hashSet(String key, String hashKey, String hashValue) {
- Map map;
- if (exist(key)) {
- map = hashGet(key);
- }
- else {
- map = new HashMap<>();
- }
- map.put(hashKey, hashValue);
- hashSet(key, map);
- }
+ @Override
+ public void hashBatchDel(String key, Set hashKeys) {
+ Map stringStringMap = hashGet(key);
+ hashKeys.forEach(stringStringMap::remove);
+ }
- @Override
- public void hashSet(String key, Map hash) {
- cache.put(key, hash);
- }
+ @Override
+ public boolean hashExist(String key, String hashKey) {
+ if (exist(key)) {
+ Map map = hashGet(key);
+ return map.containsKey(hashKey);
+ }
+ return false;
+ }
- @Override
- public boolean delete(String key) {
- if (exist(key)) {
- cache.evict(key);
- }
- return true;
- }
+ @Override
+ public boolean hashAnyExist(String key, String[] hashKeys) {
+ return CacheHelper.super.hashAnyExist(key, hashKeys);
+ }
- @Override
- public boolean delete(List keys) {
- keys.forEach(this::delete);
- return true;
- }
+ @Override
+ public void hashSet(String key, String hashKey, String hashValue) {
+ Map map;
+ if (exist(key)) {
+ map = hashGet(key);
+ } else {
+ map = new HashMap<>();
+ }
+ map.put(hashKey, hashValue);
+ hashSet(key, map);
+ }
- @Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- /* 基于内存的本地缓存 */
- cache = (Cache) applicationContext.getBean("ehCacheCache");
- }
+ @Override
+ public void hashSet(String key, Map hash) {
+ cache.put(key, hash);
+ }
+ @Override
+ public boolean delete(String key) {
+ if (exist(key)) {
+ cache.evict(key);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean delete(List keys) {
+ keys.forEach(this::delete);
+ return true;
+ }
+
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ /*基于内存的本地缓存*/
+ cache = (Cache) applicationContext.getBean("ehCacheCache");
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java
index 6752e32c9..f0fe70390 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java
@@ -2,171 +2,137 @@ package com.anjiplus.template.gaea.business.code;
/**
* 响应码
- *
* @author lr
* @since 2021-02-22
*/
public interface ResponseCode {
- String NOT_NULL = "field.not.null";
+ String NOT_NULL = "field.not.null";
+ String NOT_EMPTY = "field.not.empty";
+ String MIN = "field.min";
+ String MAX = "field.max";
+ String DICT_ERROR = "field.dict.error";
- String NOT_EMPTY = "field.not.empty";
+ String USER_PASSWORD_ERROR = "User.password.error";
+ /**
+ * 用户名或者密码不正确
+ */
+ String LOGIN_ERROR = "login.error";
- String MIN = "field.min";
+ /**
+ * 新密码不能和原密码一致
+ */
+ String USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL = "user.password.config.password.canot.equal";
- String MAX = "field.max";
+ /**
+ * 密码和确认密码不一致
+ */
+ String USER_INCONSISTENT_PASSWORD_ERROR = "user.inconsistent.password.error";
- String DICT_ERROR = "field.dict.error";
+ /**
+ * 旧密码不正确
+ */
+ String USER_OLD_PASSWORD_ERROR = "user.old.password.error";
- String USER_PASSWORD_ERROR = "User.password.error";
- /**
- * 用户名或者密码不正确
- */
- String LOGIN_ERROR = "login.error";
- /**
- * 新密码不能和原密码一致
- */
- String USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL = "user.password.config.password.canot.equal";
+ /**
+ * 用户token过期
+ */
+ String USER_TOKEN_EXPIRED = "User.token.expired";
- /**
- * 密码和确认密码不一致
- */
- String USER_INCONSISTENT_PASSWORD_ERROR = "user.inconsistent.password.error";
+ /**
+ * 字典项重复
+ */
+ String DICT_ITEM_REPEAT = "Dict.item.code.exist";
- /**
- * 旧密码不正确
- */
- String USER_OLD_PASSWORD_ERROR = "user.old.password.error";
+ /**
+ * 数字字典国际化标识不能为null
+ */
+ String DICT_CODE_LOCALE_NULL = "500-00002";
- /**
- * 用户token过期
- */
- String USER_TOKEN_EXPIRED = "User.token.expired";
+ /**
+ * 参数为空
+ */
+ String PARAM_IS_NULL = "Rule.execute.param.null";
- /**
- * 字典项重复
- */
- String DICT_ITEM_REPEAT = "Dict.item.code.exist";
+ /**
+ * 规则编译不通过
+ */
+ String RULE_CONTENT_COMPILE_ERROR = "Rule.content.compile.error";
- /**
- * 数字字典国际化标识不能为null
- */
- String DICT_CODE_LOCALE_NULL = "500-00002";
+ /**
+ * 规则执行不通过
+ */
+ String RULE_CONTENT_EXECUTE_ERROR = "Rule.content.execute.error";
- /**
- * 参数为空
- */
- String PARAM_IS_NULL = "Rule.execute.param.null";
+ /**
+ * 规则编码已存在
+ */
+ String RULE_CODE_EXIST = "Rule.code.exist";
- /**
- * 规则编译不通过
- */
- String RULE_CONTENT_COMPILE_ERROR = "Rule.content.compile.error";
+ /**
+ * 对应规则内容不存在
+ */
+ String RULE_CONTENT_NOT_EXIST = "Rule.content.not.exist";
- /**
- * 规则执行不通过
- */
- String RULE_CONTENT_EXECUTE_ERROR = "Rule.content.execute.error";
+ /**
+ * 对应规则字段值不存在
+ */
+ String RULE_FIELDS_NOT_EXIST = "Rule.fields.not.exist";
- /**
- * 规则编码已存在
- */
- String RULE_CODE_EXIST = "Rule.code.exist";
+ /**
+ * 规则字段必填
+ */
+ String RULE_FIELD_VALUE_IS_REQUIRED = "Rule.field.value.is.required";
- /**
- * 对应规则内容不存在
- */
- String RULE_CONTENT_NOT_EXIST = "Rule.content.not.exist";
+ /**
+ * 规则字段值类型错误
+ */
+ String RULE_FIELD_VALUE_TYPE_ERROR = "Rule.field.value.type.error";
- /**
- * 对应规则字段值不存在
- */
- String RULE_FIELDS_NOT_EXIST = "Rule.fields.not.exist";
+ /**
+ * 规则参数校验不通过
+ */
+ String RULE_FIELDS_CHECK_ERROR = "Rule.fields.check.error";
+ /**
+ * 组件未加载
+ */
+ String COMPONENT_NOT_LOAD = "Component.load.check.error";
- /**
- * 规则字段必填
- */
- String RULE_FIELD_VALUE_IS_REQUIRED = "Rule.field.value.is.required";
+ String AUTH_PASSWORD_NOTSAME = "1001";
+ String OLD_PASSWORD_ERROR = "1003";
+ String USER_ONTEXIST_ORGINFO = "1004";
+ String USER_ONTEXIST_ROLEINFO = "1005";
+ String MENU_TABLE_CODE_EXIST = "1006";
+ String USER_CODE_ISEXIST = "1007";
+ String ROLE_CODE_ISEXIST = "1008";
+ String MENU_CODE_ISEXIST = "1009";
+ String ORG_CODE_ISEXIST = "1010";
+ String SEARCHNAME_ISEXIST = "1011";
+ String SETTINGNAME_ISEXIST = "1012";
+ String DICCODE_ISEXIST = "1013";
+ String DEVICEID_LENGTH = "1014";
+ String USERINFO_EMPTY = "1015";
+ String FILE_EMPTY_FILENAME = "2001";
+ String FILE_SUFFIX_UNSUPPORTED = "2002";
+ String FILE_UPLOAD_ERROR = "2003";
+ String FILE_ONT_EXSIT = "2004";
+ String LIST_IS_EMPTY = "2005";
+ String PUSHCODE_NEED_UNIQUE = "3001";
+ String RECEIVER_IS_EMPTY = "3002";
+ String DATA_SOURCE_CONNECTION_FAILED = "4001";
+ String DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY = "4002";
+ String EXECUTE_SQL_ERROR = "4003";
+ String INCOMPLETE_PARAMETER_REPLACEMENT_VALUES = "4004";
+ String EXECUTE_JS_ERROR = "4005";
+ String ANALYSIS_DATA_ERROR = "4006";
+ String REPORT_CODE_ISEXIST = "4007";
+ String SET_CODE_ISEXIST = "4008";
+ String SOURCE_CODE_ISEXIST = "4009";
+ String CLASS_NOT_FOUND = "4010";
+ String EXECUTE_GROOVY_ERROR = "4011";
- /**
- * 规则字段值类型错误
- */
- String RULE_FIELD_VALUE_TYPE_ERROR = "Rule.field.value.type.error";
-
- /**
- * 规则参数校验不通过
- */
- String RULE_FIELDS_CHECK_ERROR = "Rule.fields.check.error";
-
- /**
- * 组件未加载
- */
- String COMPONENT_NOT_LOAD = "Component.load.check.error";
-
- String AUTH_PASSWORD_NOTSAME = "1001";
-
- String OLD_PASSWORD_ERROR = "1003";
-
- String USER_ONTEXIST_ORGINFO = "1004";
-
- String USER_ONTEXIST_ROLEINFO = "1005";
-
- String MENU_TABLE_CODE_EXIST = "1006";
-
- String USER_CODE_ISEXIST = "1007";
-
- String ROLE_CODE_ISEXIST = "1008";
-
- String MENU_CODE_ISEXIST = "1009";
-
- String ORG_CODE_ISEXIST = "1010";
-
- String SEARCHNAME_ISEXIST = "1011";
-
- String SETTINGNAME_ISEXIST = "1012";
-
- String DICCODE_ISEXIST = "1013";
-
- String DEVICEID_LENGTH = "1014";
-
- String USERINFO_EMPTY = "1015";
-
- String FILE_EMPTY_FILENAME = "2001";
-
- String FILE_SUFFIX_UNSUPPORTED = "2002";
-
- String FILE_UPLOAD_ERROR = "2003";
-
- String FILE_ONT_EXSIT = "2004";
-
- String LIST_IS_EMPTY = "2005";
-
- String PUSHCODE_NEED_UNIQUE = "3001";
-
- String RECEIVER_IS_EMPTY = "3002";
-
- String DATA_SOURCE_CONNECTION_FAILED = "4001";
-
- String DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY = "4002";
-
- String EXECUTE_SQL_ERROR = "4003";
-
- String INCOMPLETE_PARAMETER_REPLACEMENT_VALUES = "4004";
-
- String EXECUTE_JS_ERROR = "4005";
-
- String ANALYSIS_DATA_ERROR = "4006";
-
- String REPORT_CODE_ISEXIST = "4007";
-
- String SET_CODE_ISEXIST = "4008";
-
- String SOURCE_CODE_ISEXIST = "4009";
-
- String CLASS_NOT_FOUND = "4010";
-
- String REPORT_SHARE_LINK_INVALID = "report.share.link.invalid";
+ String REPORT_SHARE_LINK_INVALID = "report.share.link.invalid";
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/BusinessAutoConfiguration.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/BusinessAutoConfiguration.java
new file mode 100644
index 000000000..b495d7732
--- /dev/null
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/BusinessAutoConfiguration.java
@@ -0,0 +1,29 @@
+package com.anjiplus.template.gaea.business.config;
+
+import com.anjiplus.template.gaea.business.runner.ApplicationInitRunner;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * business配置类
+ * @author lr
+ * @since 2021-04-08
+ */
+@Configuration
+@MapperScan(basePackages = {
+ "com.anjiplus.template.gaea.business.modules.*.dao",
+ "com.anjiplus.template.gaea.business.modules.*.**.dao"
+})
+public class BusinessAutoConfiguration {
+
+ /**
+ * 系统启动完执行
+ * @return
+ */
+ @Bean
+ public ApplicationInitRunner applicationInitRunner() {
+ return new ApplicationInitRunner();
+ }
+
+}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DatabaseInitializer.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DatabaseInitializer.java
new file mode 100644
index 000000000..129c42dd8
--- /dev/null
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DatabaseInitializer.java
@@ -0,0 +1,56 @@
+package com.anjiplus.template.gaea.business.config;
+
+import com.zaxxer.hikari.HikariDataSource;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.flyway.FlywayProperties;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+/**
+ * Created by raodeming on 2021/7/5.
+ */
+@Slf4j
+@Component
+@AllArgsConstructor
+@ConditionalOnProperty(value = {"spring.flyway.enabled"})
+public class DatabaseInitializer {
+
+ private final FlywayProperties flywayProperties;
+ private final DataSourceProperties dataSourceProperties;
+
+ @PostConstruct
+ public void init() throws SQLException {
+ log.info("DatabaseInitializer uses flyway init-sqls to initiate database");
+ String url = dataSourceProperties.getUrl();
+ // jdbc url最后一个 '/' 用于分割具体 schema?参数
+ int lastSplitIndex = url.lastIndexOf('?');
+ // 获取spring.datasource.url具体数据库schema前的jdbc url
+ String addressUrl = url.substring(0, lastSplitIndex);
+ String addresslast = url.substring(lastSplitIndex);
+ addressUrl = addressUrl.substring(0, addressUrl.lastIndexOf("/"));
+ // 直连数据库地址:jdbc:mysql://yourIp:port
+ HikariDataSource dataSource = new HikariDataSource();
+ dataSource.setJdbcUrl(addressUrl.concat(addresslast));
+ dataSource.setUsername(dataSourceProperties.getUsername());
+ dataSource.setPassword(dataSourceProperties.getPassword());
+ Connection connection = dataSource.getConnection();
+ Statement statement = connection.createStatement();
+ for (String sql : flywayProperties.getInitSqls()) {
+ // 通过flyway的init-sqls配置进行建库与数据库配置
+ // executeUpdate:执行给定的SQL语句,该语句可以是INSERT,UPDATE或DELETE语句或不返回任何内容的SQL语句,例如SQL DDL语句。
+ statement.executeUpdate(sql);
+ }
+ statement.close();
+ connection.close();
+ dataSource.close();
+ log.info("DatabaseInitializer initialize completed");
+ }
+
+}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DruidProperties.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DruidProperties.java
index d7f19289f..8e373310f 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DruidProperties.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/DruidProperties.java
@@ -12,74 +12,72 @@ import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "spring.druid")
@Data
public class DruidProperties {
+ /**
+ * 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
+ */
+ private int initialSize;
- /**
- * 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
- */
- private int initialSize;
+ /**
+ * 最小连接池数量
+ */
+ private int minIdle;
- /**
- * 最小连接池数量
- */
- private int minIdle;
+ /**
+ * 最大连接池数量
+ */
+ private int maxActive;
- /**
- * 最大连接池数量
- */
- private int maxActive;
+ /**
+ * 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置
+ */
+ private int maxWait;
- /**
- * 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置
- */
- private int maxWait;
+ /**
+ * 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间,如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。
+ */
+ private int timeBetweenEvictionRunsMillis;
- /**
- * 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间,如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。
- */
- private int timeBetweenEvictionRunsMillis;
+ /**
+ * 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间
+ */
+ private int minEvictableIdleTimeMillis;
- /**
- * 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间
- */
- private int minEvictableIdleTimeMillis;
+ /**
+ * 申请连接时检测空闲时间,根据空闲时间再检测连接是否有效.建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRun
+ */
+ private boolean testWhileIdle;
- /**
- * 申请连接时检测空闲时间,根据空闲时间再检测连接是否有效.建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRun
- */
- private boolean testWhileIdle;
+ /**
+ * 开启PSCache
+ */
+ private boolean poolPreparedStatements;
- /**
- * 开启PSCache
- */
- private boolean poolPreparedStatements;
+ /**
+ * 设置PSCache值
+ */
+ private int maxPoolPreparedStatementPerConnectionSize;
- /**
- * 设置PSCache值
- */
- private int maxPoolPreparedStatementPerConnectionSize;
+ /**
+ * 连接出错后再尝试连接三次
+ */
+ private int connectionErrorRetryAttempts;
- /**
- * 连接出错后再尝试连接三次
- */
- private int connectionErrorRetryAttempts;
+ /**
+ * 数据库服务宕机自动重连机制
+ */
+ private boolean breakAfterAcquireFailure;
- /**
- * 数据库服务宕机自动重连机制
- */
- private boolean breakAfterAcquireFailure;
-
- /**
- * 连接出错后重试时间间隔
- */
- private int timeBetweenConnectErrorMillis;
-
- public DruidDataSource dataSource(String url, String username, String password, String driverClassName) {
- DruidDataSource datasource = new DruidDataSource();
- datasource.setUrl(url);
- datasource.setUsername(username);
- datasource.setPassword(password);
- datasource.setDriverClassName(driverClassName);
- return datasource;
- }
+ /**
+ * 连接出错后重试时间间隔
+ */
+ private int timeBetweenConnectErrorMillis;
+ public DruidDataSource dataSource(String url, String username, String password, String driverClassName) {
+ DruidDataSource datasource = new DruidDataSource();
+ datasource.setUrl(url);
+ datasource.setUsername(username);
+ datasource.setPassword(password);
+ datasource.setDriverClassName(driverClassName);
+ return datasource;
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/JacksonConfiguration.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/JacksonConfiguration.java
deleted file mode 100644
index a009f3cd2..000000000
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/config/JacksonConfiguration.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.anjiplus.template.gaea.business.config;
-
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.Locale;
-import java.util.TimeZone;
-
-/**
- * @author lengleng
- * @date 2022/2/13
- */
-@Configuration
-public class JacksonConfiguration {
-
- private static final String ASIA_SHANGHAI = "Asia/Shanghai";
-
- @Bean
- public Jackson2ObjectMapperBuilderCustomizer customizer() {
- return builder -> {
- builder.locale(Locale.CHINA);
- builder.timeZone(TimeZone.getTimeZone(ASIA_SHANGHAI));
- builder.simpleDateFormat("yyyy-MM-dd HH:mm:ss");
- builder.serializerByType(Long.class, ToStringSerializer.instance);
- };
- }
-
-}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/constant/BusinessConstant.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/constant/BusinessConstant.java
index 1a29822c2..4e2aa8f54 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/constant/BusinessConstant.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/constant/BusinessConstant.java
@@ -2,38 +2,38 @@ package com.anjiplus.template.gaea.business.constant;
/**
* 常量
- *
* @author lr
* @since 2021-03-26
*/
public interface BusinessConstant {
- String LEFT_BIG_BOAST = "{";
+ String LEFT_BIG_BOAST = "{";
+ String RIGTH_BIG_BOAST = "}";
+ String LEFT_MIDDLE_BOAST = "[";
+ String RIGHT_MIDDLE_BOAST = "]";
+ String SLASH = "/";
- String RIGTH_BIG_BOAST = "}";
+ String USER_GUEST = "guest";
+ String USER_ADMIN = "admin";
- String LEFT_MIDDLE_BOAST = "[";
- String RIGHT_MIDDLE_BOAST = "]";
+ /**
+ * 字典项重复
+ */
+ String DICT_ITEM_EXIST_GROUP = "dictItemExist";
- /**
- * 字典项重复
- */
- String DICT_ITEM_EXIST_GROUP = "dictItemExist";
+ /**
+ * 所有url的权限码缓存key
+ */
+ String GAEA_SECURITY_AUTHORITIES= "gaea:security:authorities:all";
- /**
- * 所有url的权限码缓存key
- */
- String GAEA_SECURITY_AUTHORITIES = "gaea:security:authorities:all";
-
- /**
- * 用户登录的token缓存key
- */
- String GAEA_SECURITY_LOGIN_TOKEN = "gaea:security:login:token:%s";
-
- /**
- * 用户登录的主信息缓存信息
- */
- String GAEA_SECURITY_LOGIN_USER = "gaea:security:login:user:%s";
+ /**
+ * 用户登录的token缓存key
+ */
+ String GAEA_SECURITY_LOGIN_TOKEN = "gaea:security:login:token:%s";
+ /**
+ * 用户登录的主信息缓存信息
+ */
+ String GAEA_SECURITY_LOGIN_USER = "gaea:security:login:user:%s";
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/DeleteFlagEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/DeleteFlagEnum.java
index 5e69b708b..a883408df 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/DeleteFlagEnum.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/DeleteFlagEnum.java
@@ -1,55 +1,47 @@
package com.anjiplus.template.gaea.business.enums;
-
public enum DeleteFlagEnum {
+ DELETED(1,"已删除"),
+ UNDELETED(0,"未删除"),
+ ;
- DELETED(1, "已删除"), UNDELETED(0, "未删除"),;
+ private int codeValue;
+ private String codeDesc;
- private int codeValue;
+ private DeleteFlagEnum(int codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- private String codeDesc;
+ public int getCodeValue(){ return this.codeValue;}
- private DeleteFlagEnum(int codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ public String getCodeDesc(){ return this.codeDesc;}
- public int getCodeValue() {
- return this.codeValue;
- }
+ //根据codeValue获取枚举
+ public static DeleteFlagEnum parseFromCodeValue(int codeValue){
+ for (DeleteFlagEnum e : DeleteFlagEnum.values()){
+ if(e.codeValue == codeValue){ return e;}
+ }
+ return null;
+ }
- public String getCodeDesc() {
- return this.codeDesc;
- }
+ //根据codeValue获取描述
+ public static String getCodeDescByCodeValue(int codeValue){
+ DeleteFlagEnum enumItem = parseFromCodeValue(codeValue);
+ return enumItem == null ? "" : enumItem.getCodeDesc();
+ }
- // 根据codeValue获取枚举
- public static DeleteFlagEnum parseFromCodeValue(int codeValue) {
- for (DeleteFlagEnum e : DeleteFlagEnum.values()) {
- if (e.codeValue == codeValue) {
- return e;
- }
- }
- return null;
- }
+ //验证codeValue是否有效
+ public static boolean validateCodeValue(int codeValue){ return parseFromCodeValue(codeValue)!=null;}
- // 根据codeValue获取描述
- public static String getCodeDescByCodeValue(int codeValue) {
- DeleteFlagEnum enumItem = parseFromCodeValue(codeValue);
- return enumItem == null ? "" : enumItem.getCodeDesc();
- }
+ //列出所有值字符串
+ public static String getString(){
+ StringBuffer buffer = new StringBuffer();
+ for (DeleteFlagEnum e : DeleteFlagEnum.values()){
+ buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
+ }
+ buffer.deleteCharAt(buffer.lastIndexOf(","));
+ return buffer.toString().trim();
+ }
- // 验证codeValue是否有效
- public static boolean validateCodeValue(int codeValue) {
- return parseFromCodeValue(codeValue) != null;
- }
-
- // 列出所有值字符串
- public static String getString() {
- StringBuffer buffer = new StringBuffer();
- for (DeleteFlagEnum e : DeleteFlagEnum.values()) {
- buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
- }
- buffer.deleteCharAt(buffer.lastIndexOf(","));
- return buffer.toString().trim();
- }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/EnableFlagEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/EnableFlagEnum.java
index b410ca21e..5d4b207b7 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/EnableFlagEnum.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/EnableFlagEnum.java
@@ -1,55 +1,47 @@
package com.anjiplus.template.gaea.business.enums;
-
public enum EnableFlagEnum {
+ ENABLE(1,"启用"),
+ DISABLE(0,"禁用"),
+ ;
- ENABLE(1, "启用"), DISABLE(0, "禁用"),;
+ private int codeValue;
+ private String codeDesc;
- private int codeValue;
+ private EnableFlagEnum(int codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- private String codeDesc;
+ public int getCodeValue(){ return this.codeValue;}
- private EnableFlagEnum(int codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ public String getCodeDesc(){ return this.codeDesc;}
- public int getCodeValue() {
- return this.codeValue;
- }
+ //根据codeValue获取枚举
+ public static EnableFlagEnum parseFromCodeValue(int codeValue){
+ for (EnableFlagEnum e : EnableFlagEnum.values()){
+ if(e.codeValue == codeValue){ return e;}
+ }
+ return null;
+ }
- public String getCodeDesc() {
- return this.codeDesc;
- }
+ //根据codeValue获取描述
+ public static String getCodeDescByCodeBalue(int codeValue){
+ EnableFlagEnum enumItem = parseFromCodeValue(codeValue);
+ return enumItem == null ? "" : enumItem.getCodeDesc();
+ }
- // 根据codeValue获取枚举
- public static EnableFlagEnum parseFromCodeValue(int codeValue) {
- for (EnableFlagEnum e : EnableFlagEnum.values()) {
- if (e.codeValue == codeValue) {
- return e;
- }
- }
- return null;
- }
+ //验证codeValue是否有效
+ public static boolean validateCodeValue(int codeValue){ return parseFromCodeValue(codeValue)!=null;}
- // 根据codeValue获取描述
- public static String getCodeDescByCodeBalue(int codeValue) {
- EnableFlagEnum enumItem = parseFromCodeValue(codeValue);
- return enumItem == null ? "" : enumItem.getCodeDesc();
- }
+ //列出所有值字符串
+ public static String getString(){
+ StringBuffer buffer = new StringBuffer();
+ for (EnableFlagEnum e : EnableFlagEnum.values()){
+ buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
+ }
+ buffer.deleteCharAt(buffer.lastIndexOf(","));
+ return buffer.toString().trim();
+ }
- // 验证codeValue是否有效
- public static boolean validateCodeValue(int codeValue) {
- return parseFromCodeValue(codeValue) != null;
- }
-
- // 列出所有值字符串
- public static String getString() {
- StringBuffer buffer = new StringBuffer();
- for (EnableFlagEnum e : EnableFlagEnum.values()) {
- buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
- }
- buffer.deleteCharAt(buffer.lastIndexOf(","));
- return buffer.toString().trim();
- }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExcelCenterStyleEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExcelCenterStyleEnum.java
index 945157a95..b0efbc6eb 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExcelCenterStyleEnum.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExcelCenterStyleEnum.java
@@ -6,67 +6,68 @@ package com.anjiplus.template.gaea.business.enums;
* @date 2021/4/26
*/
public enum ExcelCenterStyleEnum {
+ /**
+ * 左对齐
+ */
+ LEFT((short) 1, 1, "左对齐"),
+ /**
+ * 右对齐
+ */
+ RIGHT((short) 3, 2, "右对齐"),
+ /**
+ * 居中
+ */
+ CENTER((short) 2, 0, "居中"),
+ ;
- /**
- * 左对齐
- */
- LEFT((short) 1, 1, "左对齐"),
- /**
- * 右对齐
- */
- RIGHT((short) 3, 2, "右对齐"),
- /**
- * 居中
- */
- CENTER((short) 2, 0, "居中"),;
+ /**
+ * excel居中code
+ */
+ private final short excelCode;
- /**
- * excel居中code
- */
- private final short excelCode;
+ /**
+ * 在线文档居中code
+ */
+ private final Integer onlineExcelCode;
- /**
- * 在线文档居中code
- */
- private final Integer onlineExcelCode;
+ /**
+ * 名称
+ */
+ private final String name;
- /**
- * 名称
- */
- private final String name;
- public Integer getOnlineExcelCode() {
- return onlineExcelCode;
- }
+ public Integer getOnlineExcelCode() {
+ return onlineExcelCode;
+ }
- public String getName() {
- return name;
- }
+ public String getName() {
+ return name;
+ }
- public short getExcelCode() {
- return excelCode;
- }
+ public short getExcelCode() {
+ return excelCode;
+ }
- ExcelCenterStyleEnum(short excelCode, Integer onlineExcelCode, String name) {
- this.excelCode = excelCode;
- this.onlineExcelCode = onlineExcelCode;
- this.name = name;
- }
+ ExcelCenterStyleEnum(short excelCode, Integer onlineExcelCode, String name) {
+ this.excelCode = excelCode;
+ this.onlineExcelCode = onlineExcelCode;
+ this.name = name;
+ }
- /**
- * @param code excel居中样式code
- * @return Enum_ExcelCenterStyle
- * @description 根据excel居中样式获取在线文档居中样式
- * @author zhouhang
- * @date 2021/4/26
- */
- public static ExcelCenterStyleEnum getExcelCenterStyleByExcelCenterCode(short code) {
- for (ExcelCenterStyleEnum value : ExcelCenterStyleEnum.values()) {
- if (code == value.getExcelCode()) {
- return value;
- }
- }
- return CENTER;
- }
+ /**
+ * @param code excel居中样式code
+ * @return Enum_ExcelCenterStyle
+ * @description 根据excel居中样式获取在线文档居中样式
+ * @author zhouhang
+ * @date 2021/4/26
+ */
+ public static ExcelCenterStyleEnum getExcelCenterStyleByExcelCenterCode(short code) {
+ for (ExcelCenterStyleEnum value : ExcelCenterStyleEnum.values()) {
+ if (code == value.getExcelCode()) {
+ return value;
+ }
+ }
+ return CENTER;
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExportTypeEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExportTypeEnum.java
index b08ead076..6b01a17e0 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExportTypeEnum.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ExportTypeEnum.java
@@ -5,26 +5,26 @@ package com.anjiplus.template.gaea.business.enums;
*/
public enum ExportTypeEnum {
- /** gaea_excel */
- GAEA_TEMPLATE_EXCEL("gaea_template_excel", "gaea_template_excel"),
- /** gaea_pdf */
- GAEA_TEMPLATE_PDF("gaea_template_pdf", "gaea_template_pdf"),;
+ /**gaea_excel*/
+ GAEA_TEMPLATE_EXCEL("gaea_template_excel", "gaea_template_excel"),
+ /**gaea_pdf*/
+ GAEA_TEMPLATE_PDF("gaea_template_pdf", "gaea_template_pdf"),
+ ;
- private String codeValue;
+ private String codeValue;
+ private String codeDesc;
- private String codeDesc;
+ private ExportTypeEnum(String codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- private ExportTypeEnum(String codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ public String getCodeValue() {
+ return this.codeValue;
+ }
- public String getCodeValue() {
- return this.codeValue;
- }
-
- public String getCodeDesc() {
- return this.codeDesc;
- }
+ public String getCodeDesc() {
+ return this.codeDesc;
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ReportTypeEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ReportTypeEnum.java
new file mode 100644
index 000000000..f2d267a34
--- /dev/null
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ReportTypeEnum.java
@@ -0,0 +1,33 @@
+package com.anjiplus.template.gaea.business.enums;
+
+/**
+ * Created by raodeming on 2022/5/8.
+ */
+public enum ReportTypeEnum {
+
+ /**report_screen*/
+ report_screen("report_screen", "大屏报表"),
+ /**report_excel*/
+ report_excel("report_excel", "excel报表"),
+ ;
+
+ private String codeValue;
+ private String codeDesc;
+
+ ReportTypeEnum() {
+ }
+
+ private ReportTypeEnum(String codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
+
+ public String getCodeValue() {
+ return this.codeValue;
+ }
+
+ public String getCodeDesc() {
+ return this.codeDesc;
+ }
+
+}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/SetTypeEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/SetTypeEnum.java
index 2f0dd1fc8..a0242f376 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/SetTypeEnum.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/SetTypeEnum.java
@@ -1,55 +1,56 @@
package com.anjiplus.template.gaea.business.enums;
public enum SetTypeEnum {
+ SQL("sql", "sql"),
+ HTTP("http", "http"),
+ ;
- SQL("sql", "sql"), HTTP("http", "http"),;
+ private String codeValue;
+ private String codeDesc;
- private String codeValue;
+ private SetTypeEnum(String codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- private String codeDesc;
+ public String getCodeValue() {
+ return this.codeValue;
+ }
- private SetTypeEnum(String codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ public String getCodeDesc() {
+ return this.codeDesc;
+ }
- public String getCodeValue() {
- return this.codeValue;
- }
+ //根据codeValue获取枚举
+ public static SetTypeEnum parseFromCodeValue(String codeValue) {
+ for (SetTypeEnum e : SetTypeEnum.values()) {
+ if (e.codeValue == codeValue) {
+ return e;
+ }
+ }
+ return null;
+ }
- public String getCodeDesc() {
- return this.codeDesc;
- }
+ //根据codeValue获取描述
+ public static String getCodeDescByCodeBalue(String codeValue) {
+ SetTypeEnum enumItem = parseFromCodeValue(codeValue);
+ return enumItem == null ? "" : enumItem.getCodeDesc();
+ }
- // 根据codeValue获取枚举
- public static SetTypeEnum parseFromCodeValue(String codeValue) {
- for (SetTypeEnum e : SetTypeEnum.values()) {
- if (e.codeValue == codeValue) {
- return e;
- }
- }
- return null;
- }
+ //验证codeValue是否有效
+ public static boolean validateCodeValue(String codeValue) {
+ return parseFromCodeValue(codeValue) != null;
+ }
- // 根据codeValue获取描述
- public static String getCodeDescByCodeBalue(String codeValue) {
- SetTypeEnum enumItem = parseFromCodeValue(codeValue);
- return enumItem == null ? "" : enumItem.getCodeDesc();
- }
+ //列出所有值字符串
+ public static String getString() {
+ StringBuffer buffer = new StringBuffer();
+ for (SetTypeEnum e : SetTypeEnum.values()) {
+ buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
+ }
+ buffer.deleteCharAt(buffer.lastIndexOf(","));
+ return buffer.toString().trim();
+ }
- // 验证codeValue是否有效
- public static boolean validateCodeValue(String codeValue) {
- return parseFromCodeValue(codeValue) != null;
- }
-
- // 列出所有值字符串
- public static String getString() {
- StringBuffer buffer = new StringBuffer();
- for (SetTypeEnum e : SetTypeEnum.values()) {
- buffer.append(e.codeValue).append("--").append(e.getCodeDesc()).append(", ");
- }
- buffer.deleteCharAt(buffer.lastIndexOf(","));
- return buffer.toString().trim();
- }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/filter/CorsFilter.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/filter/CorsFilter.java
index 0f75d2311..243a7fd02 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/filter/CorsFilter.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/filter/CorsFilter.java
@@ -16,29 +16,28 @@ import java.io.IOException;
@Order(Ordered.HIGHEST_PRECEDENCE)
public class CorsFilter implements Filter {
- @Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
- throws IOException, ServletException {
- HttpServletRequest req = (HttpServletRequest) request;
- HttpServletResponse res = (HttpServletResponse) response;
- // 设置允许Cookie
- res.addHeader("Access-Control-Allow-Credentials", "true");
- // 允许http://www.xxx.com域(自行设置,这里只做示例)发起跨域请求
- res.addHeader("Access-Control-Allow-Origin", req.getHeader("Origin"));
- // 设置允许跨域请求的方法
- res.addHeader("Access-Control-Allow-Methods", "*");
- // 允许跨域请求包含content-type
- res.addHeader("Access-Control-Allow-Headers", "*");
- res.addHeader("Access-Control-Expose-Headers", "*");
- chain.doFilter(req, res);
- }
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException {
+ HttpServletRequest req = (HttpServletRequest) request;
+ HttpServletResponse res = (HttpServletResponse) response;
+ // 设置允许Cookie
+ res.addHeader("Access-Control-Allow-Credentials", "true");
+ // 允许http://www.xxx.com域(自行设置,这里只做示例)发起跨域请求
+ res.addHeader("Access-Control-Allow-Origin", req.getHeader("Origin"));
+ // 设置允许跨域请求的方法
+ res.addHeader("Access-Control-Allow-Methods", "*");
+ // 允许跨域请求包含content-type
+ res.addHeader("Access-Control-Allow-Headers", "*");
+ res.addHeader("Access-Control-Expose-Headers", "*");
+ chain.doFilter(req, res);
+ }
- @Override
- public void destroy() {
- }
-
- @Override
- public void init(FilterConfig filterConfig) throws ServletException {
- }
+ @Override
+ public void destroy() {
+ }
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/AccessAuthorityController.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/AccessAuthorityController.java
old mode 100644
new mode 100755
index 36c34ed52..7db13c7e6
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/AccessAuthorityController.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/AccessAuthorityController.java
@@ -20,45 +20,43 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
- * @desc 权限管理 controller
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
+* @desc 权限管理 controller
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
@RestController
@Api(tags = "权限管理管理")
@RequestMapping("/accessAuthority")
@Permission(code = "authorityManage", name = "权限管理")
-public class AccessAuthorityController
- extends GaeaBaseController {
+public class AccessAuthorityController extends GaeaBaseController {
- @Autowired
- private AccessAuthorityService accessAuthorityService;
+ @Autowired
+ private AccessAuthorityService accessAuthorityService;
- @Override
- public GaeaBaseService getService() {
- return accessAuthorityService;
- }
+ @Override
+ public GaeaBaseService getService() {
+ return accessAuthorityService;
+ }
- @Override
- public AccessAuthority getEntity() {
- return new AccessAuthority();
- }
+ @Override
+ public AccessAuthority getEntity() {
+ return new AccessAuthority();
+ }
- @Override
- public AccessAuthorityDto getDTO() {
- return new AccessAuthorityDto();
- }
-
- /**
- * 获取一二级菜单
- * @return
- */
- @Permission(code = "query", name = "查询")
- @GetMapping("/menuTree")
- public ResponseBean menuTree() {
- String username = UserContentHolder.getContext().getUsername();
- List parentTreeList = accessAuthorityService.getAuthorityTree(username, false);
- return responseSuccessWithData(parentTreeList);
- }
+ @Override
+ public AccessAuthorityDto getDTO() {
+ return new AccessAuthorityDto();
+ }
+ /**
+ * 获取一二级菜单
+ * @return
+ */
+ @Permission( code = "query", name = "查询")
+ @GetMapping("/menuTree")
+ public ResponseBean menuTree(){
+ String username = UserContentHolder.getContext().getUsername();
+ List parentTreeList = accessAuthorityService.getAuthorityTree(username, false);
+ return responseSuccessWithData(parentTreeList);
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/dto/AccessAuthorityDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/dto/AccessAuthorityDto.java
old mode 100644
new mode 100755
index ad736a28a..78e4b4064
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/dto/AccessAuthorityDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/dto/AccessAuthorityDto.java
@@ -10,47 +10,46 @@ import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
- * @description 权限管理 dto
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
+*
+* @description 权限管理 dto
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
@Data
public class AccessAuthorityDto extends GaeaBaseDTO implements Serializable {
+ /** 父菜单代码 */
+ @ApiModelProperty(value = "父菜单代码")
+ private String parentTarget;
- /** 父菜单代码 */
- @ApiModelProperty(value = "父菜单代码")
- private String parentTarget;
+ /** 目标菜单 */
+ @ApiModelProperty(value = "菜单代码")
+ @NotEmpty(message = "6002")
+ private String target;
- /** 目标菜单 */
- @ApiModelProperty(value = "菜单代码")
- @NotEmpty(message = "6002")
- private String target;
+ /** 目标菜单名称 */
+ @ApiModelProperty(value = "菜单名称")
+ @NotEmpty(message = "6002")
+ private String targetName;
- /** 目标菜单名称 */
- @ApiModelProperty(value = "菜单名称")
- @NotEmpty(message = "6002")
- private String targetName;
+ /** 目标按钮 */
+ @ApiModelProperty(value = "按钮代码")
+ @NotEmpty(message = "6002")
+ private String action;
- /** 目标按钮 */
- @ApiModelProperty(value = "按钮代码")
- @NotEmpty(message = "6002")
- private String action;
+ /** 目标按钮名称 */
+ @ApiModelProperty(value = "按钮名称")
+ @NotEmpty(message = "6002")
+ private String actionName;
- /** 目标按钮名称 */
- @ApiModelProperty(value = "按钮名称")
- @NotEmpty(message = "6002")
- private String actionName;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
+ private Integer deleteFlag;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
- private Integer deleteFlag;
-
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
- @NotNull(message = "6002")
- private Integer enableFlag;
-
- @ApiModelProperty(value = "sort")
- private Integer sort;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ @NotNull(message = "6002")
+ private Integer enableFlag;
+ @ApiModelProperty(value = "sort")
+ private Integer sort;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/param/AccessAuthorityParam.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/param/AccessAuthorityParam.java
old mode 100644
new mode 100755
index 95b84a7e4..b4983f4fc
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/param/AccessAuthorityParam.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/controller/param/AccessAuthorityParam.java
@@ -9,35 +9,34 @@ import lombok.Data;
import java.io.Serializable;
/**
- * @desc AccessAuthority 权限管理查询输入类
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
+* @desc AccessAuthority 权限管理查询输入类
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
@Data
-public class AccessAuthorityParam extends PageParam implements Serializable {
+public class AccessAuthorityParam extends PageParam implements Serializable{
- /** 父菜单代码 */
- @Query(value = QueryEnum.LIKE)
- private String parentTarget;
+ /** 父菜单代码 */
+ @Query(value = QueryEnum.LIKE)
+ private String parentTarget;
- /** 菜单代码 */
- @Query(value = QueryEnum.LIKE)
- private String target;
+ /** 菜单代码 */
+ @Query(value = QueryEnum.LIKE)
+ private String target;
- /** 菜单名称 */
- @Query(value = QueryEnum.LIKE)
- private String targetName;
+ /** 菜单名称 */
+ @Query(value = QueryEnum.LIKE)
+ private String targetName;
- /** 按钮代码 */
- @Query(value = QueryEnum.LIKE)
- private String action;
+ /** 按钮代码 */
+ @Query(value = QueryEnum.LIKE)
+ private String action;
- /** 按钮名称 */
- @Query(value = QueryEnum.LIKE)
- private String actionName;
-
- // 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
- @Query
- private Integer enableFlag;
+ /** 按钮名称 */
+ @Query(value = QueryEnum.LIKE)
+ private String actionName;
+ // 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
+ @Query
+ private Integer enableFlag;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/AccessAuthorityMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/AccessAuthorityMapper.java
old mode 100644
new mode 100755
index 3b8c8d58e..50e53410c
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/AccessAuthorityMapper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/AccessAuthorityMapper.java
@@ -5,11 +5,10 @@ import com.anjiplus.template.gaea.business.modules.accessauthority.dao.entity.Ac
import org.apache.ibatis.annotations.Mapper;
/**
- * AccessAuthority Mapper
- *
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
+* AccessAuthority Mapper
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
@Mapper
public interface AccessAuthorityMapper extends GaeaBaseMapper {
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/entity/AccessAuthority.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/entity/AccessAuthority.java
old mode 100644
new mode 100755
index 15392054b..5ad2a2a52
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/entity/AccessAuthority.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/entity/AccessAuthority.java
@@ -6,35 +6,36 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
- * @description 权限管理 entity
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
-@TableName(keepGlobalPrefix = true, value = "access_authority")
+* @description 权限管理 entity
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
+@TableName(keepGlobalPrefix=true, value="access_authority")
@Data
public class AccessAuthority extends GaeaBaseEntity {
+ /** 父菜单代码 */
+ private String parentTarget;
- /** 父菜单代码 */
- private String parentTarget;
+ /** 菜单代码 */
+ private String target;
- /** 菜单代码 */
- private String target;
+ /** 菜单名称 */
+ private String targetName;
- /** 菜单名称 */
- private String targetName;
+ /** 按钮代码 */
+ private String action;
- /** 按钮代码 */
- private String action;
+ /** 按钮名称 */
+ private String actionName;
- /** 按钮名称 */
- private String actionName;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ private Integer deleteFlag;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- private Integer deleteFlag;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ private Integer enableFlag;
+
+ private Integer sort;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- private Integer enableFlag;
- private Integer sort;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/AccessAuthorityService.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/AccessAuthorityService.java
old mode 100644
new mode 100755
index d44b83d60..ddef0ecd1
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/AccessAuthorityService.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/AccessAuthorityService.java
@@ -9,22 +9,21 @@ import com.anjiplus.template.gaea.business.modules.accessauthority.dao.entity.Ac
import java.util.List;
/**
- * @desc AccessAuthority 权限管理服务接口
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
+* @desc AccessAuthority 权限管理服务接口
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
public interface AccessAuthorityService extends GaeaBaseService {
- /**
- * @param loginName 当前登录的用户名
- * @param withActionNode 带第三层的按钮节点
- * @return
- */
- List getAuthorityTree(String loginName, boolean withActionNode);
-
- /**
- * 扫描所有mvc url的需要权限码,建立拦截体系
- */
- void scanGaeaSecurityAuthorities();
+ /**
+ * @param loginName 当前登录的用户名
+ * @param withActionNode 带第三层的按钮节点
+ * @return
+ */
+ List getAuthorityTree(String loginName, boolean withActionNode);
+ /**
+ * 扫描所有mvc url的需要权限码,建立拦截体系
+ */
+ void scanGaeaSecurityAuthorities();
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/impl/AccessAuthorityServiceImpl.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/impl/AccessAuthorityServiceImpl.java
old mode 100644
new mode 100755
index b155b32b5..68bf1ef37
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/impl/AccessAuthorityServiceImpl.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/service/impl/AccessAuthorityServiceImpl.java
@@ -23,116 +23,117 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
- * @desc AccessAuthority 权限管理服务实现
- * @author 木子李·De
- * @date 2019-02-17 08:50:10.009
- **/
+* @desc AccessAuthority 权限管理服务实现
+* @author 木子李·De
+* @date 2019-02-17 08:50:10.009
+**/
@Service
public class AccessAuthorityServiceImpl implements AccessAuthorityService {
- @Autowired
- private InitRequestUrlMappings initRequestUrlMappings;
+ @Autowired
+ private InitRequestUrlMappings initRequestUrlMappings;
- @Autowired
- private CacheHelper cacheHelper;
+ @Autowired
+ private CacheHelper cacheHelper;
- @Autowired
- private AccessAuthorityMapper accessAuthorityMapper;
+ @Autowired
+ private AccessAuthorityMapper accessAuthorityMapper;
- @Override
- public GaeaBaseMapper getMapper() {
- return accessAuthorityMapper;
- }
+ @Override
+ public GaeaBaseMapper getMapper() {
+ return accessAuthorityMapper;
+ }
- @Override
- public List getAuthorityTree(String loginName, boolean withActionNode) {
- // 查询出所有的菜单记录
- LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.select(AccessAuthority::getParentTarget, AccessAuthority::getTarget, AccessAuthority::getTargetName,
- AccessAuthority::getAction, AccessAuthority::getActionName).eq(AccessAuthority::getEnableFlag, 1)
- .eq(AccessAuthority::getDeleteFlag, 0).orderByAsc(AccessAuthority::getSort);
- // 按operator去筛选 后面再加where
- List accessAuthorityList = getMapper().selectList(wrapper);
+ @Override
+ public List getAuthorityTree(String loginName, boolean withActionNode) {
+ // 查询出所有的菜单记录
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.select(AccessAuthority::getParentTarget, AccessAuthority::getTarget, AccessAuthority::getTargetName, AccessAuthority::getAction, AccessAuthority::getActionName)
+ .eq(AccessAuthority::getEnableFlag, 1)
+ .eq(AccessAuthority::getDeleteFlag, 0)
+ .orderByAsc(AccessAuthority::getSort);
+ // 按operator去筛选 后面再加where
+ List accessAuthorityList = getMapper().selectList(wrapper);
- // 筛选出一级菜单
- List parentNodes = accessAuthorityList.stream()
- .filter(accessAuthority -> StringUtils.isBlank(accessAuthority.getParentTarget())).map(item -> {
- TreeNode treeNode = new TreeNode();
- treeNode.setId(item.getTarget());
- treeNode.setLabel(item.getTargetName());
- return treeNode;
- }).collect(Collectors.toList());
+ // 筛选出一级菜单
+ List parentNodes = accessAuthorityList.stream().filter(accessAuthority -> StringUtils.isBlank(accessAuthority.getParentTarget()))
+ .map(item -> {
+ TreeNode treeNode = new TreeNode();
+ treeNode.setId(item.getTarget());
+ treeNode.setLabel(item.getTargetName());
+ return treeNode;
+ }).collect(Collectors.toList());
- // 菜单-按钮的map
- Map> targetActionsMap = accessAuthorityList.stream()
- .filter(accessAuthority -> StringUtils.isNoneBlank(accessAuthority.getParentTarget()))
- .collect(Collectors.groupingBy(AccessAuthority::getTarget));
+ // 菜单-按钮的map
+ Map> targetActionsMap = accessAuthorityList.stream()
+ .filter(accessAuthority -> StringUtils.isNoneBlank(accessAuthority.getParentTarget()))
+ .collect(Collectors.groupingBy(AccessAuthority::getTarget));
- // 设置每个一级菜单的二菜单
- parentNodes.stream().forEach(parentNode -> {
- List alreadyTargets = new ArrayList<>();
+ // 设置每个一级菜单的二菜单
+ parentNodes.stream().forEach(parentNode -> {
+ List alreadyTargets = new ArrayList<>();
- accessAuthorityList.stream().forEach(authority -> {
- if (!StringUtils.equals(parentNode.getId(), authority.getParentTarget())
- || alreadyTargets.contains(authority.getTarget())) {
- return;
- }
- // 找到一级菜单对应的二级菜单
+ accessAuthorityList.stream().forEach(authority -> {
+ if(!StringUtils.equals(parentNode.getId(), authority.getParentTarget()) || alreadyTargets.contains(authority.getTarget())){
+ return;
+ }
+ // 找到一级菜单对应的二级菜单
- // 初始化二级菜单节点
- TreeNode levelTwoMenuNode = new TreeNode();
- levelTwoMenuNode.setId(authority.getTarget());
- levelTwoMenuNode.setLabel(authority.getTargetName());
- levelTwoMenuNode.setChildren(new ArrayList());
+ // 初始化二级菜单节点
+ TreeNode levelTwoMenuNode = new TreeNode();
+ levelTwoMenuNode.setId(authority.getTarget());
+ levelTwoMenuNode.setLabel(authority.getTargetName());
+ levelTwoMenuNode.setChildren(new ArrayList());
- // 初始化二级菜单的按钮
- if (withActionNode) {
- List actionList = targetActionsMap.get(authority.getTarget());
- if (actionList != null && !actionList.isEmpty()) {
- actionList.stream().forEach(action -> {
- TreeNode buttonNode = new TreeNode();
- buttonNode.setId(String.format("%s_%s", action.getTarget(), action.getAction()));
- buttonNode.setLabel(action.getActionName());
- levelTwoMenuNode.getChildren().add(buttonNode);
- });
- }
- }
+ // 初始化二级菜单的按钮
+ if(withActionNode){
+ List actionList = targetActionsMap.get(authority.getTarget());
+ if(actionList != null && !actionList.isEmpty()){
+ actionList.stream().forEach(action ->{
+ TreeNode buttonNode = new TreeNode();
+ buttonNode.setId(String.format("%s_%s", action.getTarget(), action.getAction()));
+ buttonNode.setLabel(action.getActionName());
+ levelTwoMenuNode.getChildren().add(buttonNode);
+ });
+ }
+ }
- // 将上面找到的二级菜单加入到一菜单的子树中去
- List children = parentNode.getChildren();
- if (children == null) {
- children = new ArrayList();
- }
- children.add(levelTwoMenuNode);
- parentNode.setChildren(children);
+ // 将上面找到的二级菜单加入到一菜单的子树中去
+ List children = parentNode.getChildren();
+ if(children == null){
+ children = new ArrayList();
+ }
+ children.add(levelTwoMenuNode);
+ parentNode.setChildren(children);
- // 已经找过的二级菜单,后面不在重复添加
- alreadyTargets.add(authority.getTarget());
- });
- });
+ // 已经找过的二级菜单,后面不在重复添加
+ alreadyTargets.add(authority.getTarget());
+ });
+ });
- return parentNodes;
- }
+ return parentNodes;
+ }
- @Override
- public void scanGaeaSecurityAuthorities() {
- /*
- * 获取当前应用中所有的请求信息 { "applicationName": "aj-report", "authCode":
- * "authorityManage:query", "authName": "权限管理查询", "beanName":
- * "accessAuthorityController", "menuCode": "authorityManage", "path":
- * "GET#/accessAuthority/menuTree" }
- */
- List requestInfos = initRequestUrlMappings
- .getRequestInfos(Enabled.YES.getValue());
+ @Override
+ public void scanGaeaSecurityAuthorities() {
+ /* 获取当前应用中所有的请求信息
+ {
+ "applicationName": "aj-report",
+ "authCode": "authorityManage:query",
+ "authName": "权限管理查询",
+ "beanName": "accessAuthorityController",
+ "menuCode": "authorityManage",
+ "path": "GET#/accessAuthority/menuTree"
+ }*/
+ List requestInfos = initRequestUrlMappings.getRequestInfos(Enabled.YES.getValue());
- // key="GET#/accessAuthority/menuTree" value="authorityManage:query"
- Map securityAuthorityMap = new HashMap();
- requestInfos.stream().forEach(requestInfo -> {
- securityAuthorityMap.put(requestInfo.getPath(), requestInfo.getAuthCode());
- });
-
- // 将key存入到缓存中
- cacheHelper.hashSet(BusinessConstant.GAEA_SECURITY_AUTHORITIES, securityAuthorityMap);
- }
+ // key="GET#/accessAuthority/menuTree" value="authorityManage:query"
+ Map securityAuthorityMap = new HashMap();
+ requestInfos.stream().forEach(requestInfo -> {
+ securityAuthorityMap.put(requestInfo.getPath(), requestInfo.getAuthCode());
+ });
+ // 将key存入到缓存中
+ cacheHelper.hashSet(BusinessConstant.GAEA_SECURITY_AUTHORITIES, securityAuthorityMap);
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/AccessRoleController.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/AccessRoleController.java
old mode 100644
new mode 100755
index 2cc256104..633b64a71
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/AccessRoleController.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/AccessRoleController.java
@@ -17,55 +17,54 @@ import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
- * @desc 角色管理 controller
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+* @desc 角色管理 controller
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
@RestController
@Api(tags = "角色管理管理")
@RequestMapping("/accessRole")
@Permission(code = "roleManage", name = "角色管理")
public class AccessRoleController extends GaeaBaseController {
- @Autowired
- private AccessRoleService accessRoleService;
+ @Autowired
+ private AccessRoleService accessRoleService;
- @Override
- public GaeaBaseService getService() {
- return accessRoleService;
- }
+ @Override
+ public GaeaBaseService getService() {
+ return accessRoleService;
+ }
- @Override
- public AccessRole getEntity() {
- return new AccessRole();
- }
+ @Override
+ public AccessRole getEntity() {
+ return new AccessRole();
+ }
- @Override
- public AccessRoleDto getDTO() {
- return new AccessRoleDto();
- }
+ @Override
+ public AccessRoleDto getDTO() {
+ return new AccessRoleDto();
+ }
- /**
- * 获取角色的 菜单按钮树 一级菜单 二级菜单 三级按钮
- * @return
- */
- @Permission(code = "grantAuthority", name = "分配权限")
- @GetMapping("/authorityTree/{roleCode}")
- public ResponseBean authorityTree(@PathVariable("roleCode") String roleCode) {
- String operator = UserContentHolder.getContext().getUsername();
- Map map = accessRoleService.getAuthorityTree(roleCode, operator);
- return responseSuccessWithData(map);
- }
-
- /**
- * 保存角色的权限
- * @return
- */
- @Permission(code = "grantAuthority", name = "分配权限")
- @PostMapping("/saveAuthorityTree")
- public ResponseBean saveAuthorityTree(@RequestBody AccessRoleDto dto) {
- Boolean data = accessRoleService.saveAuthorityTree(dto);
- return responseSuccessWithData(data);
- }
+ /**
+ * 获取角色的 菜单按钮树 一级菜单 二级菜单 三级按钮
+ * @return
+ */
+ @Permission( code = "grantAuthority", name = "分配权限")
+ @GetMapping("/authorityTree/{roleCode}")
+ public ResponseBean authorityTree(@PathVariable("roleCode")String roleCode){
+ String operator = UserContentHolder.getContext().getUsername();
+ Map map = accessRoleService.getAuthorityTree(roleCode, operator);
+ return responseSuccessWithData(map);
+ }
+ /**
+ * 保存角色的权限
+ * @return
+ */
+ @Permission( code = "grantAuthority", name = "分配权限")
+ @PostMapping("/saveAuthorityTree")
+ public ResponseBean saveAuthorityTree(@RequestBody AccessRoleDto dto){
+ Boolean data = accessRoleService.saveAuthorityTree(dto);
+ return responseSuccessWithData(data);
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/dto/AccessRoleDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/dto/AccessRoleDto.java
old mode 100644
new mode 100755
index 9f5b849e7..a47a71b5d
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/dto/AccessRoleDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/dto/AccessRoleDto.java
@@ -11,33 +11,33 @@ import java.io.Serializable;
import java.util.List;
/**
- * @description 角色管理 dto
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+*
+* @description 角色管理 dto
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
@Data
public class AccessRoleDto extends GaeaBaseDTO implements Serializable {
- /** 角色编码 */
- @ApiModelProperty(value = "角色编码")
- @NotEmpty(message = "6002")
- private String roleCode;
+ /** 角色编码 */
+ @ApiModelProperty(value = "角色编码")
+ @NotEmpty(message = "6002")
+ private String roleCode;
- /** 角色名称 */
- @ApiModelProperty(value = "角色名称")
- @NotEmpty(message = "6002")
- private String roleName;
+ /** 角色名称 */
+ @ApiModelProperty(value = "角色名称")
+ @NotEmpty(message = "6002")
+ private String roleName;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
- private Integer deleteFlag;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
+ private Integer deleteFlag;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
- @NotNull(message = "6002")
- private Integer enableFlag;
-
- /** 角色保存的权限 */
- private List authorityList;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ @NotNull(message = "6002")
+ private Integer enableFlag;
+ /** 角色保存的权限 */
+ private List authorityList;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/param/AccessRoleParam.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/param/AccessRoleParam.java
old mode 100644
new mode 100755
index 60642990e..b25fea557
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/param/AccessRoleParam.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/controller/param/AccessRoleParam.java
@@ -9,23 +9,23 @@ import lombok.Data;
import java.io.Serializable;
/**
- * @desc AccessRole 角色管理查询输入类
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+* @desc AccessRole 角色管理查询输入类
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
@Data
-public class AccessRoleParam extends PageParam implements Serializable {
+public class AccessRoleParam extends PageParam implements Serializable{
- /** 角色编码 */
- @Query(value = QueryEnum.LIKE)
- private String roleCode;
+ /** 角色编码 */
+ @Query(value = QueryEnum.LIKE)
+ private String roleCode;
- // 角色名称
- @Query(value = QueryEnum.LIKE)
- private String roleName;
+ // 角色名称
+ @Query(value = QueryEnum.LIKE)
+ private String roleName;
- // 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
- @Query
- private Integer enableFlag;
+ // 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
+ @Query
+ private Integer enableFlag;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleAuthorityMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleAuthorityMapper.java
old mode 100644
new mode 100755
index c649f0b39..7fe9995ef
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleAuthorityMapper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleAuthorityMapper.java
@@ -5,12 +5,11 @@ import com.anjiplus.template.gaea.business.modules.accessrole.dao.entity.AccessR
import org.apache.ibatis.annotations.Mapper;
/**
- * AccessRoleAuthority Mapper
- *
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+* AccessRoleAuthority Mapper
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
@Mapper
public interface AccessRoleAuthorityMapper extends GaeaBaseMapper {
-}
+}
\ No newline at end of file
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleMapper.java
old mode 100644
new mode 100755
index c2fc8d55b..bd08c38c3
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleMapper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/AccessRoleMapper.java
@@ -6,16 +6,13 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
-
/**
- * AccessRole Mapper
- *
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+* AccessRole Mapper
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
@Mapper
public interface AccessRoleMapper extends GaeaBaseMapper {
- List checkedAuthoritys(@Param("roleCode") String roleCode);
-
+ List checkedAuthoritys(@Param("roleCode")String roleCode);
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRole.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRole.java
old mode 100644
new mode 100755
index 165ff4de3..25bb2b8d2
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRole.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRole.java
@@ -6,24 +6,24 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
- * @description 角色管理 entity
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
-@TableName(keepGlobalPrefix = true, value = "access_role")
+* @description 角色管理 entity
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
+@TableName(keepGlobalPrefix=true, value="access_role")
@Data
public class AccessRole extends GaeaBaseEntity {
- /** 角色编码 */
- private String roleCode;
+ /** 角色编码 */
+ private String roleCode;
- /** 角色名称 */
- private String roleName;
+ /** 角色名称 */
+ private String roleName;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- private Integer deleteFlag;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ private Integer deleteFlag;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- private Integer enableFlag;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ private Integer enableFlag;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRoleAuthority.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRoleAuthority.java
index 31aa551d2..eb08c1519 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRoleAuthority.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/dao/entity/AccessRoleAuthority.java
@@ -12,32 +12,31 @@ import java.util.Date;
* @author 木子李·De
* @date 2019-02-17 08:50:14.136
**/
-@TableName(keepGlobalPrefix = true, value = "access_role_authority")
+@TableName(keepGlobalPrefix=true, value="access_role_authority")
@Data
public class AccessRoleAuthority extends GaeaBaseEntity {
- /** 角色编码 */
- private String roleCode;
+ /** 角色编码 */
+ private String roleCode;
- /** 菜单代码 */
- private String target;
+ /** 菜单代码 */
+ private String target;
- /** 按钮代码 */
- private String action;
+ /** 按钮代码 */
+ private String action;
- @TableField(exist = false)
- private String createBy;
+ @TableField(exist = false)
+ private String createBy;
- @TableField(exist = false)
- private Date createTime;
+ @TableField(exist = false)
+ private Date createTime;
- @TableField(exist = false)
- private String updateBy;
+ @TableField(exist = false)
+ private String updateBy;
- @TableField(exist = false)
- private Date updateTime;
-
- @TableField(exist = false)
- private Integer version;
+ @TableField(exist = false)
+ private Date updateTime;
+ @TableField(exist = false)
+ private Integer version;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/AccessRoleService.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/AccessRoleService.java
old mode 100644
new mode 100755
index f4aa02eba..556caf35b
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/AccessRoleService.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/AccessRoleService.java
@@ -9,25 +9,23 @@ import com.anjiplus.template.gaea.business.modules.accessrole.dao.entity.AccessR
import java.util.Map;
/**
- * @desc AccessRole 角色管理服务接口
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+* @desc AccessRole 角色管理服务接口
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
public interface AccessRoleService extends GaeaBaseService {
- /**
- * 查询某角色的权限树
- * @param roleCode 被操作的对象
- * @param operator 当前登录者
- * @return
- */
- Map getAuthorityTree(String roleCode, String operator);
+ /** 查询某角色的权限树
+ * @param roleCode 被操作的对象
+ * @param operator 当前登录者
+ * @return
+ */
+ Map getAuthorityTree(String roleCode, String operator);
- /**
- * 保存角色的权限
- * @param accessRoleDto
- * @return
- */
- Boolean saveAuthorityTree(AccessRoleDto accessRoleDto);
+ /** 保存角色的权限
+ * @param accessRoleDto
+ * @return
+ */
+ Boolean saveAuthorityTree(AccessRoleDto accessRoleDto);
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/impl/AccessRoleServiceImpl.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/impl/AccessRoleServiceImpl.java
old mode 100644
new mode 100755
index b0f347732..381f0a879
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/impl/AccessRoleServiceImpl.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessrole/service/impl/AccessRoleServiceImpl.java
@@ -24,81 +24,78 @@ import java.util.Map;
import java.util.stream.Collectors;
/**
- * @desc AccessRole 角色管理服务实现
- * @author 木子李·De
- * @date 2019-02-17 08:50:14.136
- **/
+* @desc AccessRole 角色管理服务实现
+* @author 木子李·De
+* @date 2019-02-17 08:50:14.136
+**/
@Service
public class AccessRoleServiceImpl implements AccessRoleService {
- @Autowired
- private AccessRoleMapper accessRoleMapper;
+ @Autowired
+ private AccessRoleMapper accessRoleMapper;
- @Autowired
- private AccessRoleAuthorityMapper accessRoleAuthorityMapper;
+ @Autowired
+ private AccessRoleAuthorityMapper accessRoleAuthorityMapper;
- @Autowired
- private AccessAuthorityService accessAuthorityService;
+ @Autowired
+ private AccessAuthorityService accessAuthorityService;
- @Override
- public GaeaBaseMapper getMapper() {
- return accessRoleMapper;
- }
+ @Override
+ public GaeaBaseMapper getMapper() {
+ return accessRoleMapper;
+ }
- @Override
- public Map getAuthorityTree(String roleCode, String operator) {
- Map result = new HashMap();
+ @Override
+ public Map getAuthorityTree(String roleCode, String operator) {
+ Map result = new HashMap();
- // 菜单按钮树
- List treeData = accessAuthorityService.getAuthorityTree(operator, true);
+ // 菜单按钮树
+ List treeData = accessAuthorityService.getAuthorityTree(operator, true);
- // 该角色已选中的菜单及按钮
- // List checkedKeys = accessRoleMapper.checkedAuthoritys(roleCode);
+ // 该角色已选中的菜单及按钮
+// List checkedKeys = accessRoleMapper.checkedAuthoritys(roleCode);
- LambdaQueryWrapper accessRoleAuthorityWrapper = Wrappers.lambdaQuery();
- accessRoleAuthorityWrapper.select(AccessRoleAuthority::getTarget, AccessRoleAuthority::getAction);
- accessRoleAuthorityWrapper.eq(AccessRoleAuthority::getRoleCode, roleCode);
- List accessRoleAuthorities = accessRoleAuthorityMapper
- .selectList(accessRoleAuthorityWrapper);
- List checkedKeys = accessRoleAuthorities.stream().map(accessRoleAuthority -> accessRoleAuthority
- .getTarget().concat("_").concat(accessRoleAuthority.getAction())).distinct()
- .collect(Collectors.toList());
+ LambdaQueryWrapper accessRoleAuthorityWrapper = Wrappers.lambdaQuery();
+ accessRoleAuthorityWrapper.select(AccessRoleAuthority::getTarget, AccessRoleAuthority::getAction);
+ accessRoleAuthorityWrapper.eq(AccessRoleAuthority::getRoleCode, roleCode);
+ List accessRoleAuthorities = accessRoleAuthorityMapper.selectList(accessRoleAuthorityWrapper);
+ List checkedKeys = accessRoleAuthorities.stream()
+ .map(accessRoleAuthority -> accessRoleAuthority.getTarget().concat("_").concat(accessRoleAuthority.getAction())).distinct().collect(Collectors.toList());
- result.put("treeData", treeData);
- result.put("checkedKeys", checkedKeys);
- return result;
- }
+ result.put("treeData", treeData);
+ result.put("checkedKeys", checkedKeys);
+ return result;
+ }
- @Override
- public Boolean saveAuthorityTree(AccessRoleDto accessRoleDto) {
- // 校验
- String roleCode = accessRoleDto.getRoleCode();
- List authorityList = accessRoleDto.getAuthorityList();
- if (StringUtils.isBlank(roleCode)) {
- throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, roleCode);
- }
- if (authorityList == null || authorityList.isEmpty()) {
- throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, authorityList);
- }
+ @Override
+ public Boolean saveAuthorityTree(AccessRoleDto accessRoleDto) {
+ // 校验
+ String roleCode = accessRoleDto.getRoleCode();
+ List authorityList = accessRoleDto.getAuthorityList();
+ if(StringUtils.isBlank(roleCode)){
+ throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, roleCode);
+ }
+ if(authorityList == null || authorityList.isEmpty()){
+ throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, authorityList);
+ }
- // 先清除该角色已保存的权限
- LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.eq(AccessRoleAuthority::getRoleCode, roleCode);
- accessRoleAuthorityMapper.delete(wrapper);
-
- // 保存勾选的权限(菜单和按钮)
- authorityList.stream().forEach(authorityStr -> {
- if (!authorityStr.contains("_")) {
- return;
- }
- String[] array = authorityStr.split("_");
- AccessRoleAuthority accessRoleAuthority = new AccessRoleAuthority();
- accessRoleAuthority.setRoleCode(roleCode);
- accessRoleAuthority.setTarget(array[0].trim());
- accessRoleAuthority.setAction(array[1].trim());
- accessRoleAuthorityMapper.insert(accessRoleAuthority);
- });
- return true;
- }
+ // 先清除该角色已保存的权限
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(AccessRoleAuthority::getRoleCode, roleCode);
+ accessRoleAuthorityMapper.delete(wrapper);
+ // 保存勾选的权限(菜单和按钮)
+ authorityList.stream().forEach(authorityStr -> {
+ if(!authorityStr.contains("_")){
+ return;
+ }
+ String[] array = authorityStr.split("_");
+ AccessRoleAuthority accessRoleAuthority = new AccessRoleAuthority();
+ accessRoleAuthority.setRoleCode(roleCode);
+ accessRoleAuthority.setTarget(array[0].trim());
+ accessRoleAuthority.setAction(array[1].trim());
+ accessRoleAuthorityMapper.insert(accessRoleAuthority);
+ });
+ return true;
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/AccessUserController.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/AccessUserController.java
old mode 100644
new mode 100755
index 9997f8bce..8dc9420fd
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/AccessUserController.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/AccessUserController.java
@@ -20,87 +20,89 @@ import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
- * @desc 用户管理 controller
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+* @desc 用户管理 controller
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
@RestController
@Api(tags = "用户管理管理")
@RequestMapping("/accessUser")
@Permission(code = "userManage", name = "用户管理")
public class AccessUserController extends GaeaBaseController {
- @Autowired
- private AccessUserService accessUserService;
+ @Autowired
+ private AccessUserService accessUserService;
- @Override
- public GaeaBaseService getService() {
- return accessUserService;
- }
+ @Override
+ public GaeaBaseService getService() {
+ return accessUserService;
+ }
- @Override
- public AccessUser getEntity() {
- return new AccessUser();
- }
+ @Override
+ public AccessUser getEntity() {
+ return new AccessUser();
+ }
- @Override
- public AccessUserDto getDTO() {
- return new AccessUserDto();
- }
+ @Override
+ public AccessUserDto getDTO() {
+ return new AccessUserDto();
+ }
- /**
- * 获取用户的角色树
- * @return
- */
- @Permission(code = "grantRole", name = "分配角色")
- @GetMapping("/roleTree/{loginName}")
- public ResponseBean getRoleTree(@PathVariable("loginName") String loginName) {
- String operator = UserContentHolder.getContext().getUsername();
- Map map = accessUserService.getRoleTree(loginName, operator);
- return responseSuccessWithData(map);
- }
- /**
- * 保存用户的角色树
- * @return
- */
- @Permission(code = "grantRole", name = "分配角色")
- @PostMapping("/saveRoleTree")
- public ResponseBean saveRoleTree(@RequestBody AccessUserDto dto) {
- Boolean data = accessUserService.saveRoleTree(dto);
- return responseSuccessWithData(data);
- }
+ /**
+ * 获取用户的角色树
+ * @return
+ */
+ @Permission( code = "grantRole", name = "分配角色")
+ @GetMapping("/roleTree/{loginName}")
+ public ResponseBean getRoleTree(@PathVariable("loginName")String loginName){
+ String operator = UserContentHolder.getContext().getUsername();
+ Map map = accessUserService.getRoleTree(loginName, operator);
+ return responseSuccessWithData(map);
+ }
- /**
- * 重置密码
- * @param dto
- * @return
- */
- @Permission(code = "resetPassword", name = "重置密码")
- @PostMapping({ "/resetPassword" })
- public ResponseBean resetPassword(@RequestBody @Validated GaeaUserDto dto) {
- Boolean data = accessUserService.resetPassword(dto);
- return responseSuccessWithData(data);
- }
+ /**
+ * 保存用户的角色树
+ * @return
+ */
+ @Permission( code = "grantRole", name = "分配角色")
+ @PostMapping("/saveRoleTree")
+ public ResponseBean saveRoleTree(@RequestBody AccessUserDto dto){
+ Boolean data = accessUserService.saveRoleTree(dto);
+ return responseSuccessWithData(data);
+ }
- /**
- * 简单实现登录
- * @param dto
- * @return
- */
- @PostMapping({ "/login" })
- public ResponseBean login(@RequestBody @Validated GaeaUserDto dto) {
- return responseSuccessWithData(accessUserService.login(dto));
- }
- /**
- * 修改自己的密码
- * @param dto
- * @return
- */
- @PostMapping("/updatePassword")
- public ResponseBean updatePassword(@RequestBody UpdatePasswordDto dto) {
- return responseSuccessWithData(accessUserService.updatePassword(dto));
- }
+ /**
+ * 重置密码
+ * @param dto
+ * @return
+ */
+ @Permission( code = "resetPassword", name = "重置密码")
+ @PostMapping({"/resetPassword"})
+ public ResponseBean resetPassword(@RequestBody @Validated GaeaUserDto dto) {
+ Boolean data = accessUserService.resetPassword(dto);
+ return responseSuccessWithData(data);
+ }
+
+ /**
+ * 简单实现登录
+ * @param dto
+ * @return
+ */
+ @PostMapping({"/login"})
+ public ResponseBean login(@RequestBody @Validated GaeaUserDto dto) {
+ return responseSuccessWithData(accessUserService.login(dto));
+ }
+
+ /**
+ * 修改自己的密码
+ * @param dto
+ * @return
+ */
+ @PostMapping("/updatePassword")
+ public ResponseBean updatePassword(@RequestBody UpdatePasswordDto dto) {
+ return responseSuccessWithData(accessUserService.updatePassword(dto));
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/AccessUserDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/AccessUserDto.java
old mode 100644
new mode 100755
index fd3dee914..1488d6141
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/AccessUserDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/AccessUserDto.java
@@ -12,53 +12,53 @@ import java.util.Date;
import java.util.List;
/**
- * @description 用户管理 dto
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+*
+* @description 用户管理 dto
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
@Data
public class AccessUserDto extends GaeaBaseDTO implements Serializable {
- /** 登录名 */
- @ApiModelProperty(value = " 登录名")
- @NotEmpty(message = "6002")
- private String loginName;
+ /** 登录名 */
+ @ApiModelProperty(value = " 登录名")
+ @NotEmpty(message = "6002")
+ private String loginName;
- /** 真实用户 */
- @ApiModelProperty(value = "真实用户")
- @NotEmpty(message = "6002")
- private String realName;
+ /** 真实用户 */
+ @ApiModelProperty(value = "真实用户")
+ @NotEmpty(message = "6002")
+ private String realName;
- /** 手机号码 */
- @ApiModelProperty(value = "手机号码")
- private String phone;
+ /** 手机号码 */
+ @ApiModelProperty(value = "手机号码")
+ private String phone;
- /** 用户邮箱 */
- @ApiModelProperty(value = "用户邮箱")
- private String email;
+ /** 用户邮箱 */
+ @ApiModelProperty(value = "用户邮箱")
+ private String email;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
- @NotNull(message = "6002")
- private Integer enableFlag;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ @NotNull(message = "6002")
+ private Integer enableFlag;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
- private Integer deleteFlag;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
+ private Integer deleteFlag;
- /** 最后一次登录IP */
- @ApiModelProperty(value = "最后一次登录IP")
- private String lastLoginIp;
+ /** 最后一次登录IP */
+ @ApiModelProperty(value = "最后一次登录IP")
+ private String lastLoginIp;
- /** 最后一次登陆时间 */
- @ApiModelProperty(value = "最后一次登陆时间")
- private Date lastLoginTime;
+ /** 最后一次登陆时间 */
+ @ApiModelProperty(value = "最后一次登陆时间")
+ private Date lastLoginTime;
- /** 备注 */
- @ApiModelProperty(value = "备注")
- private String remark;
-
- /** 用户勾选的角色 */
- private List roleCodeList;
+ /** 备注 */
+ @ApiModelProperty(value = "备注")
+ private String remark;
+ /** 用户勾选的角色 */
+ private List roleCodeList;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/GaeaUserDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/GaeaUserDto.java
index 1da9381dc..02a9d194e 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/GaeaUserDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/GaeaUserDto.java
@@ -11,21 +11,20 @@ import java.util.List;
@Data
public class GaeaUserDto {
- @ApiModelProperty(value = "登录名")
- @NotBlank
- private String loginName;
+ @ApiModelProperty(value = "登录名")
+ @NotBlank
+ private String loginName;
- @ApiModelProperty(value = "密码")
- @NotBlank
- private String password;
+ @ApiModelProperty(value = "密码")
+ @NotBlank
+ private String password;
- /** 真实用户 */
- private String realName;
+ /** 真实用户 */
+ private String realName;
- /** 登录成功后的 */
- private String token;
-
- /** 用户所拥有的权限合集 */
- private List authorities;
+ /** 登录成功后的 */
+ private String token;
+ /** 用户所拥有的权限合集 */
+ private List authorities;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/UpdatePasswordDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/UpdatePasswordDto.java
index 4dec1569d..dfca9b1df 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/UpdatePasswordDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/dto/UpdatePasswordDto.java
@@ -10,16 +10,15 @@ import javax.validation.constraints.NotBlank;
@Data
public class UpdatePasswordDto {
- @ApiModelProperty(value = "旧密码密码")
- @NotBlank
- private String oldPassword;
+ @ApiModelProperty(value = "旧密码密码")
+ @NotBlank
+ private String oldPassword;
- @ApiModelProperty(value = "密码")
- @NotBlank
- private String password;
-
- @ApiModelProperty(value = "密码")
- @NotBlank
- private String confirmPassword;
+ @ApiModelProperty(value = "密码")
+ @NotBlank
+ private String password;
+ @ApiModelProperty(value = "密码")
+ @NotBlank
+ private String confirmPassword;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/param/AccessUserParam.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/param/AccessUserParam.java
old mode 100644
new mode 100755
index 763be8e9e..193c4749c
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/param/AccessUserParam.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/controller/param/AccessUserParam.java
@@ -9,27 +9,27 @@ import lombok.Data;
import java.io.Serializable;
/**
- * @desc AccessUser 用户管理查询输入类
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+* @desc AccessUser 用户管理查询输入类
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
@Data
-public class AccessUserParam extends PageParam implements Serializable {
+public class AccessUserParam extends PageParam implements Serializable{
- // 登录名
- @Query(value = QueryEnum.LIKE)
- private String loginName;
+ // 登录名
+ @Query(value = QueryEnum.LIKE)
+ private String loginName;
- // 真实用户
- @Query(value = QueryEnum.LIKE)
- private String realName;
+ // 真实用户
+ @Query(value = QueryEnum.LIKE)
+ private String realName;
- // 手机号码
- @Query(value = QueryEnum.LIKE)
- private String phone;
+ // 手机号码
+ @Query(value = QueryEnum.LIKE)
+ private String phone;
- // 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
- @Query
- private Integer enableFlag;
+ // 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
+ @Query
+ private Integer enableFlag;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserMapper.java
old mode 100644
new mode 100755
index 47e8e57d4..cd9a10106
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserMapper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserMapper.java
@@ -6,21 +6,17 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
-
/**
- * AccessUser Mapper
- *
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+* AccessUser Mapper
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
@Mapper
public interface AccessUserMapper extends GaeaBaseMapper {
- /**
- * 查询用户所拥有的所有角色下的权限
- * @param loginName
- * @return
- */
- List queryAuthoritiesByLoginName(@Param("loginName") String loginName);
-
+ /** 查询用户所拥有的所有角色下的权限
+ * @param loginName
+ * @return
+ */
+ List queryAuthoritiesByLoginName(@Param("loginName")String loginName);
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserRoleMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserRoleMapper.java
old mode 100644
new mode 100755
index 1cfdc9471..2e4e68764
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserRoleMapper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/AccessUserRoleMapper.java
@@ -5,12 +5,11 @@ import com.anjiplus.template.gaea.business.modules.accessuser.dao.entity.AccessU
import org.apache.ibatis.annotations.Mapper;
/**
- * AccessUser Mapper
- *
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+* AccessUser Mapper
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
@Mapper
public interface AccessUserRoleMapper extends GaeaBaseMapper {
-}
+}
\ No newline at end of file
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUser.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUser.java
old mode 100644
new mode 100755
index 66c1c9fa5..3df4863d4
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUser.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUser.java
@@ -6,44 +6,43 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
-
/**
- * @description 用户管理 entity
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
-@TableName(keepGlobalPrefix = true, value = "access_user")
+* @description 用户管理 entity
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
+@TableName(keepGlobalPrefix=true, value="access_user")
@Data
public class AccessUser extends GaeaBaseEntity {
- /** 登录名 */
- private String loginName;
+ /** 登录名 */
+ private String loginName;
- /** 密码 */
- private String password;
+ /** 密码 */
+ private String password;
- /** 真实用户 */
- private String realName;
+ /** 真实用户 */
+ private String realName;
- /** 手机号码 */
- private String phone;
+ /** 手机号码 */
+ private String phone;
- /** 用户邮箱 */
- private String email;
+ /** 用户邮箱 */
+ private String email;
- /** 备注 */
- private String remark;
+ /** 备注 */
+ private String remark;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- private Integer enableFlag;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ private Integer enableFlag;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- private Integer deleteFlag;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ private Integer deleteFlag;
- /** 最后一次登录IP */
- private String lastLoginIp;
+ /** 最后一次登录IP */
+ private String lastLoginIp;
- /** 最后一次登陆时间 */
- private Date lastLoginTime;
+ /** 最后一次登陆时间 */
+ private Date lastLoginTime;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUserRole.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUserRole.java
old mode 100644
new mode 100755
index b2050f836..a56be7ab9
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUserRole.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/dao/entity/AccessUserRole.java
@@ -9,33 +9,32 @@ import lombok.Data;
import java.util.Date;
/**
- * @description 用户--角色关联关系 entity
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
-@TableName(keepGlobalPrefix = true, value = "access_user_role")
+* @description 用户--角色关联关系 entity
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
+@TableName(keepGlobalPrefix=true, value="access_user_role")
@Data
public class AccessUserRole extends GaeaBaseEntity {
- /** 登录名 */
- private String loginName;
+ /** 登录名 */
+ private String loginName;
- /** 角色编码 */
- private String roleCode;
+ /** 角色编码 */
+ private String roleCode;
- @TableField(exist = false)
- private String createBy;
+ @TableField(exist = false)
+ private String createBy;
- @TableField(exist = false)
- private Date createTime;
+ @TableField(exist = false)
+ private Date createTime;
- @TableField(exist = false)
- private String updateBy;
+ @TableField(exist = false)
+ private String updateBy;
- @TableField(exist = false)
- private Date updateTime;
-
- @TableField(exist = false)
- private Integer version;
+ @TableField(exist = false)
+ private Date updateTime;
+ @TableField(exist = false)
+ private Integer version;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/AccessUserService.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/AccessUserService.java
old mode 100644
new mode 100755
index 021f34da0..f3d445872
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/AccessUserService.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/AccessUserService.java
@@ -11,46 +11,42 @@ import com.anjiplus.template.gaea.business.modules.accessuser.dao.entity.AccessU
import java.util.Map;
/**
- * @desc AccessUser 用户管理服务接口
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+* @desc AccessUser 用户管理服务接口
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
public interface AccessUserService extends GaeaBaseService {
- /**
- * 获取用户的角色树
- * @param loginName 被操作的对象
- * @param operator 当前登录者
- * @return
- */
- Map getRoleTree(String loginName, String operator);
+ /** 获取用户的角色树
+ * @param loginName 被操作的对象
+ * @param operator 当前登录者
+ * @return
+ */
+ Map getRoleTree(String loginName, String operator);
- /**
- * 保存用户的角色树
- * @param accessUserDto
- * @return
- */
- Boolean saveRoleTree(AccessUserDto accessUserDto);
- /**
- * 重置密码
- * @param gaeaUserDto
- * @return
- */
- Boolean resetPassword(GaeaUserDto gaeaUserDto);
+ /** 保存用户的角色树
+ * @param accessUserDto
+ * @return
+ */
+ Boolean saveRoleTree(AccessUserDto accessUserDto);
- /**
- * 用户登录
- * @param gaeaUserDto
- * @return
- */
- GaeaUserDto login(GaeaUserDto gaeaUserDto);
+ /** 重置密码
+ * @param gaeaUserDto
+ * @return
+ */
+ Boolean resetPassword(GaeaUserDto gaeaUserDto);
- /**
- * 修改密码
- * @param dto
- * @return
- */
- Boolean updatePassword(UpdatePasswordDto dto);
+ /** 用户登录
+ * @param gaeaUserDto
+ * @return
+ */
+ GaeaUserDto login(GaeaUserDto gaeaUserDto);
+ /**
+ * 修改密码
+ * @param dto
+ * @return
+ */
+ Boolean updatePassword(UpdatePasswordDto dto);
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/impl/AccessUserServiceImpl.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/impl/AccessUserServiceImpl.java
old mode 100644
new mode 100755
index 0874f03a1..d825445d8
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/impl/AccessUserServiceImpl.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessuser/service/impl/AccessUserServiceImpl.java
@@ -37,228 +37,226 @@ import java.util.*;
import java.util.stream.Collectors;
/**
- * @desc AccessUser 用户管理服务实现
- * @author 木子李·De
- * @date 2019-02-17 08:50:11.902
- **/
+* @desc AccessUser 用户管理服务实现
+* @author 木子李·De
+* @date 2019-02-17 08:50:11.902
+**/
@Service
public class AccessUserServiceImpl implements AccessUserService {
- @Autowired
- private AccessRoleMapper accessRoleMapper;
+ @Autowired
+ private AccessRoleMapper accessRoleMapper;
- @Autowired
- private AccessUserMapper accessUserMapper;
+ @Autowired
+ private AccessUserMapper accessUserMapper;
- @Autowired
- private AccessUserRoleMapper accessUserRoleMapper;
+ @Autowired
+ private AccessUserRoleMapper accessUserRoleMapper;
- @Autowired
- private AccessRoleAuthorityMapper accessRoleAuthorityMapper;
+ @Autowired
+ private AccessRoleAuthorityMapper accessRoleAuthorityMapper;
- @Value("${customer.user.default.password:'123456'}")
- private String defaultPassword;
+ @Value("${customer.user.default.password:'123456'}")
+ private String defaultPassword;
- @Override
- public GaeaBaseMapper getMapper() {
- return accessUserMapper;
- }
+ @Override
+ public GaeaBaseMapper getMapper() {
+ return accessUserMapper;
+ }
- @Autowired
- private JwtBean jwtBean;
+ @Autowired
+ private JwtBean jwtBean;
- @Autowired
- private CacheHelper cacheHelper;
+ @Autowired
+ private CacheHelper cacheHelper;
- @Override
- public Map getRoleTree(String loginName, String operator) {
- Map result = new HashMap();
- List treeData = new ArrayList<>();
- List checkedKeys = new ArrayList();
+ @Override
+ public Map getRoleTree(String loginName, String operator) {
+ Map result = new HashMap();
+ List treeData = new ArrayList<>();
+ List checkedKeys = new ArrayList();
- // 角色树
- LambdaQueryWrapper roleQuery = Wrappers.lambdaQuery();
- roleQuery.select(AccessRole::getRoleCode, AccessRole::getRoleName);
- // 按operator去筛选role 后面再加where
- List roleList = accessRoleMapper.selectList(roleQuery);
- if (roleList == null || roleList.isEmpty()) {
- result.put("treeData", treeData);
- result.put("checkedKeys", checkedKeys);
- return result;
- }
- treeData = roleList.stream().map(role -> {
- TreeNode treeNode = new TreeNode();
- treeNode.setId(role.getRoleCode());
- treeNode.setLabel(role.getRoleName());
- return treeNode;
- }).collect(Collectors.toList());
+ // 角色树
+ LambdaQueryWrapper roleQuery = Wrappers.lambdaQuery();
+ roleQuery.select(AccessRole::getRoleCode, AccessRole::getRoleName);
+ // 按operator去筛选role 后面再加where
+ List roleList = accessRoleMapper.selectList(roleQuery);
+ if(roleList == null || roleList.isEmpty()){
+ result.put("treeData", treeData);
+ result.put("checkedKeys", checkedKeys);
+ return result;
+ }
+ treeData = roleList.stream().map(role -> {
+ TreeNode treeNode = new TreeNode();
+ treeNode.setId(role.getRoleCode());
+ treeNode.setLabel(role.getRoleName());
+ return treeNode;
+ }).collect(Collectors.toList());
- // 该用户已保存的角色
- LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery();
- queryWrapper.select(AccessUserRole::getRoleCode).eq(AccessUserRole::getLoginName, loginName);
- checkedKeys = accessUserRoleMapper.selectObjs(queryWrapper);
+ // 该用户已保存的角色
+ LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery();
+ queryWrapper.select(AccessUserRole::getRoleCode)
+ .eq(AccessUserRole::getLoginName, loginName);
+ checkedKeys = accessUserRoleMapper.selectObjs(queryWrapper);
- result.put("treeData", treeData);
- result.put("checkedKeys", checkedKeys);
- return result;
- }
+ result.put("treeData", treeData);
+ result.put("checkedKeys", checkedKeys);
+ return result;
+ }
- @Override
- public Boolean saveRoleTree(AccessUserDto accessUserDto) {
- // 校验
- String loginName = accessUserDto.getLoginName();
- List roleCodeList = accessUserDto.getRoleCodeList();
- if (StringUtils.isBlank(loginName)) {
- throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, loginName);
- }
- if (roleCodeList == null || roleCodeList.isEmpty()) {
- throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, roleCodeList);
- }
+ @Override
+ public Boolean saveRoleTree(AccessUserDto accessUserDto) {
+ // 校验
+ String loginName = accessUserDto.getLoginName();
+ List roleCodeList = accessUserDto.getRoleCodeList();
+ if(StringUtils.isBlank(loginName)){
+ throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, loginName);
+ }
+ if(roleCodeList == null || roleCodeList.isEmpty()){
+ throw BusinessExceptionBuilder.build(ResponseCode.NOT_EMPTY, roleCodeList);
+ }
- // 先清除该用户已保存的角色
- LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.eq(AccessUserRole::getLoginName, loginName);
- accessUserRoleMapper.delete(wrapper);
+ // 先清除该用户已保存的角色
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(AccessUserRole::getLoginName, loginName);
+ accessUserRoleMapper.delete(wrapper);
- // 保存勾选的角色
- roleCodeList.stream().forEach(roleCode -> {
- AccessUserRole accessUserRole = new AccessUserRole();
- accessUserRole.setLoginName(loginName);
- accessUserRole.setRoleCode(roleCode);
- accessUserRoleMapper.insert(accessUserRole);
- });
- return true;
- }
+ // 保存勾选的角色
+ roleCodeList.stream().forEach(roleCode -> {
+ AccessUserRole accessUserRole = new AccessUserRole();
+ accessUserRole.setLoginName(loginName);
+ accessUserRole.setRoleCode(roleCode);
+ accessUserRoleMapper.insert(accessUserRole);
+ });
+ return true;
+ }
- @Override
- public Boolean resetPassword(GaeaUserDto gaeaUserDto) {
- return false;
- }
+ @Override
+ public Boolean resetPassword(GaeaUserDto gaeaUserDto) {
+ return false;
+ }
- @Override
- public GaeaUserDto login(GaeaUserDto gaeaUserDto) {
+ @Override
+ public GaeaUserDto login(GaeaUserDto gaeaUserDto) {
- String loginName = gaeaUserDto.getLoginName();
- String password = gaeaUserDto.getPassword();
+ String loginName = gaeaUserDto.getLoginName();
+ String password = gaeaUserDto.getPassword();
- // 1.判断用户是否存在
- LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.eq(AccessUser::getLoginName, loginName);
- AccessUser accessUser = accessUserMapper.selectOne(wrapper);
- if (null == accessUser) {
- throw BusinessExceptionBuilder.build(ResponseCode.LOGIN_ERROR);
- }
- // 2.密码错误
- if (!accessUser.getPassword().equals(MD5Util.encrypt(password))) {
- throw BusinessExceptionBuilder.build(ResponseCode.USER_PASSWORD_ERROR);
- }
+ // 1.判断用户是否存在
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(AccessUser::getLoginName, loginName);
+ AccessUser accessUser = accessUserMapper.selectOne(wrapper);
+ if (null == accessUser) {
+ throw BusinessExceptionBuilder.build(ResponseCode.LOGIN_ERROR);
+ }
+ // 2.密码错误
+ if (!accessUser.getPassword().equals(MD5Util.encrypt(password))) {
+ throw BusinessExceptionBuilder.build(ResponseCode.USER_PASSWORD_ERROR);
+ }
- // 3.如果该用户登录未过期,这里允许一个用户在多个终端登录
- String tokenKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_TOKEN, loginName);
- String token = "";
- GaeaUserDto gaeaUser = new GaeaUserDto();
- if (cacheHelper.exist(tokenKey)) {
- token = cacheHelper.stringGet(tokenKey);
- }
- else {
- // 生成用户token
- String uuid = GaeaUtils.UUID();
- token = jwtBean.createToken(loginName, uuid);
- cacheHelper.stringSetExpire(tokenKey, token, 3600);
- }
+ // 3.如果该用户登录未过期,这里允许一个用户在多个终端登录
+ String tokenKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_TOKEN, loginName);
+ String token = "";
+ GaeaUserDto gaeaUser = new GaeaUserDto();
+ if (cacheHelper.exist(tokenKey)) {
+ token = cacheHelper.stringGet(tokenKey);
+ } else {
+ // 生成用户token
+ String uuid = GaeaUtils.UUID();
+ token = jwtBean.createToken(loginName, uuid);
+ cacheHelper.stringSetExpire(tokenKey, token, 3600);
+ }
- // 4.读取用户最新人权限主信息
- String userKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_USER, loginName);
+ // 4.读取用户最新人权限主信息
+ String userKey = String.format(BusinessConstant.GAEA_SECURITY_LOGIN_USER, loginName);
- // 为了兼容底层其他数据库,不再写自定义sql
- // List authorities =
- // accessUserMapper.queryAuthoritiesByLoginName(loginName);
+ //为了兼容底层其他数据库,不再写自定义sql
+// List authorities = accessUserMapper.queryAuthoritiesByLoginName(loginName);
- // 当前用户的roleCode集合
- LambdaQueryWrapper accessUserWrapper = Wrappers.lambdaQuery();
- accessUserWrapper.select(AccessUserRole::getRoleCode);
- accessUserWrapper.eq(AccessUserRole::getLoginName, loginName);
- List accessUserRoles = accessUserRoleMapper.selectList(accessUserWrapper);
- Set roleCodeSet = accessUserRoles.stream().map(AccessUserRole::getRoleCode).collect(Collectors.toSet());
- if (roleCodeSet.size() < 1) {
- gaeaUser.setAuthorities(new ArrayList<>());
- }
- else {
- LambdaQueryWrapper accessRoleAuthorityWrapper = Wrappers.lambdaQuery();
- accessRoleAuthorityWrapper.select(AccessRoleAuthority::getTarget, AccessRoleAuthority::getAction);
- accessRoleAuthorityWrapper.in(AccessRoleAuthority::getRoleCode, roleCodeSet);
- List accessRoleAuthorities = accessRoleAuthorityMapper
- .selectList(accessRoleAuthorityWrapper);
- List authorities = accessRoleAuthorities.stream().map(accessRoleAuthority -> accessRoleAuthority
- .getTarget().concat(":").concat(accessRoleAuthority.getAction())).distinct()
- .collect(Collectors.toList());
- gaeaUser.setAuthorities(authorities);
- }
+ //当前用户的roleCode集合
+ LambdaQueryWrapper accessUserWrapper = Wrappers.lambdaQuery();
+ accessUserWrapper.select(AccessUserRole::getRoleCode);
+ accessUserWrapper.eq(AccessUserRole::getLoginName, loginName);
+ List accessUserRoles = accessUserRoleMapper.selectList(accessUserWrapper);
+ Set roleCodeSet = accessUserRoles.stream().map(AccessUserRole::getRoleCode).collect(Collectors.toSet());
+ if (roleCodeSet.size() < 1) {
+ gaeaUser.setAuthorities(new ArrayList<>());
+ }else {
+ LambdaQueryWrapper accessRoleAuthorityWrapper = Wrappers.lambdaQuery();
+ accessRoleAuthorityWrapper.select(AccessRoleAuthority::getTarget, AccessRoleAuthority::getAction);
+ accessRoleAuthorityWrapper.in(AccessRoleAuthority::getRoleCode, roleCodeSet);
+ List accessRoleAuthorities = accessRoleAuthorityMapper.selectList(accessRoleAuthorityWrapper);
+ List authorities = accessRoleAuthorities.stream()
+ .map(accessRoleAuthority -> accessRoleAuthority.getTarget().concat(":").concat(accessRoleAuthority.getAction())).distinct().collect(Collectors.toList());
+ gaeaUser.setAuthorities(authorities);
+ }
- gaeaUser.setLoginName(loginName);
- gaeaUser.setRealName(accessUser.getRealName());
- gaeaUser.setToken(token);
+ gaeaUser.setLoginName(loginName);
+ gaeaUser.setRealName(accessUser.getRealName());
+ gaeaUser.setToken(token);
- String gaeaUserStr = JSONObject.toJSONString(gaeaUser);
- cacheHelper.stringSetExpire(userKey, gaeaUserStr, 3600);
+ String gaeaUserStr = JSONObject.toJSONString(gaeaUser);
+ cacheHelper.stringSetExpire(userKey, gaeaUserStr, 3600);
- return gaeaUser;
- }
+ return gaeaUser;
+ }
- /**
- * 修改密码
- * @param dto
- * @return
- */
- @Override
- public Boolean updatePassword(UpdatePasswordDto dto) {
- if (!dto.getConfirmPassword().equals(dto.getPassword())) {
- // 密码和确认密码不一致
- throw BusinessExceptionBuilder.build(ResponseCode.USER_INCONSISTENT_PASSWORD_ERROR);
- }
- // 新密码不能与老密码一样
- if (StringUtils.equals(dto.getOldPassword(), dto.getPassword())) {
- throw BusinessExceptionBuilder.build(ResponseCode.USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL);
- }
+ /**
+ * 修改密码
+ *
+ * @param dto
+ * @return
+ */
+ @Override
+ public Boolean updatePassword(UpdatePasswordDto dto) {
+ if (!dto.getConfirmPassword().equals(dto.getPassword())) {
+ //密码和确认密码不一致
+ throw BusinessExceptionBuilder.build(ResponseCode.USER_INCONSISTENT_PASSWORD_ERROR);
+ }
+ //新密码不能与老密码一样
+ if(StringUtils.equals(dto.getOldPassword(), dto.getPassword())){
+ throw BusinessExceptionBuilder.build(ResponseCode.USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL);
+ }
- String username = UserContentHolder.getUsername();
+ String username = UserContentHolder.getUsername();
- LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.eq(AccessUser::getLoginName, username);
- AccessUser accessUser = selectOne(wrapper);
- String password = accessUser.getPassword();
- if (!MD5Util.encrypt(dto.getOldPassword()).equals(password)) {
- throw BusinessExceptionBuilder.build(ResponseCode.USER_OLD_PASSWORD_ERROR);
- }
- accessUser.setPassword(MD5Util.encrypt(dto.getPassword()));
- accessUserMapper.updateById(accessUser);
- return true;
- }
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(AccessUser::getLoginName, username);
+ AccessUser accessUser = selectOne(wrapper);
+ String password = accessUser.getPassword();
+ if (!MD5Util.encrypt(dto.getOldPassword()).equals(password)) {
+ throw BusinessExceptionBuilder.build(ResponseCode.USER_OLD_PASSWORD_ERROR);
+ }
+ accessUser.setPassword(MD5Util.encrypt(dto.getPassword()));
- /**
- * 操作前处理
- * @param entity 前端传递的对象
- * @param operationEnum 操作类型
- * @throws BusinessException 阻止程序继续执行或回滚事务
- */
- @Override
- public void processBeforeOperation(AccessUser entity, BaseOperationEnum operationEnum) throws BusinessException {
- // 过滤密码
- switch (operationEnum) {
- case INSERT:
- // gaea是为了和前端加密保持一致
- entity.setPassword(MD5Util.encrypt(MD5Util.encrypt(defaultPassword.concat("gaea"))));
- break;
- case UPDATE:
- // 更新用户不允许修改密码
- entity.setPassword(null);
- break;
- default:
+ accessUserMapper.updateById(accessUser);
+ return true;
+ }
- break;
- }
+ /**
+ * 操作前处理
+ *
+ * @param entity 前端传递的对象
+ * @param operationEnum 操作类型
+ * @throws BusinessException 阻止程序继续执行或回滚事务
+ */
+ @Override
+ public void processBeforeOperation(AccessUser entity, BaseOperationEnum operationEnum) throws BusinessException {
+ //过滤密码
+ switch (operationEnum) {
+ case INSERT:
+ //gaea是为了和前端加密保持一致
+ entity.setPassword(MD5Util.encrypt(MD5Util.encrypt(defaultPassword.concat("gaea"))));
+ break;
+ case UPDATE:
+ //更新用户不允许修改密码
+ entity.setPassword(null);
+ break;
+ default:
- }
+ break;
+ }
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/ReportDashboardController.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/ReportDashboardController.java
index a1da6fdc7..45b7735c3 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/ReportDashboardController.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/ReportDashboardController.java
@@ -20,89 +20,90 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
- * @desc 大屏设计 controller
- * @website https://gitee.com/anji-plus/gaea
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
+* @desc 大屏设计 controller
+* @website https://gitee.com/anji-plus/gaea
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
@RestController
@Api(tags = "大屏设计管理")
@Permission(code = "bigScreenManage", name = "大屏报表")
@RequestMapping("/reportDashboard")
public class ReportDashboardController {
- @Autowired
- private ReportDashboardService reportDashboardService;
+ @Autowired
+ private ReportDashboardService reportDashboardService;
- @Autowired
- private ReportShareService reportShareService;
+ @Autowired
+ private ReportShareService reportShareService;
- /**
- * 预览、查询大屏详情
- * @param reportCode
- * @return
- */
- @GetMapping({ "/{reportCode}" })
- @Permission(code = "view", name = "查看大屏")
- public ResponseBean detail(@PathVariable("reportCode") String reportCode) {
- return ResponseBean.builder().data(reportDashboardService.getDetail(reportCode)).build();
- }
+ /**
+ * 预览、查询大屏详情
+ * @param reportCode
+ * @return
+ */
+ @GetMapping({"/{reportCode}"})
+ @Permission(code = "view", name = "查看大屏")
+ public ResponseBean detail(@PathVariable("reportCode") String reportCode) {
+ return ResponseBean.builder().data(reportDashboardService.getDetail(reportCode)).build();
+ }
- /**
- * 保存大屏设计
- * @param dto
- * @return
- */
- @PostMapping
- @Permission(code = "design", name = "设计大屏")
- @GaeaAuditLog(pageTitle = "新增")
- public ResponseBean insert(@RequestBody ReportDashboardObjectDto dto) {
- reportDashboardService.insertDashboard(dto);
- return ResponseBean.builder().build();
- }
+ /**
+ * 保存大屏设计
+ * @param dto
+ * @return
+ */
+ @PostMapping
+ @Permission(code = "design", name = "设计大屏")
+ @GaeaAuditLog(pageTitle = "新增")
+ public ResponseBean insert(@RequestBody ReportDashboardObjectDto dto) {
+ reportDashboardService.insertDashboard(dto);
+ return ResponseBean.builder().build();
+ }
- /**
- * 获取去单个图层数据
- * @param dto
- * @return
- */
- @PostMapping("/getData")
- @Permission(code = "view", name = "查看大屏")
- public ResponseBean getData(@RequestBody ChartDto dto) {
- return ResponseBean.builder().data(reportDashboardService.getChartData(dto)).build();
- }
- /**
- * 导出大屏
- * @param reportCode
- * @return
- */
- @GetMapping("/export")
- @Permission(code = "export", name = "导出大屏")
- public ResponseEntity exportDashboard(HttpServletRequest request, HttpServletResponse response,
- @RequestParam("reportCode") String reportCode,
- @RequestParam(value = "showDataSet", required = false, defaultValue = "1") Integer showDataSet) {
- return reportDashboardService.exportDashboard(request, response, reportCode, showDataSet);
- }
+ /**
+ * 获取去单个图层数据
+ * @param dto
+ * @return
+ */
+ @PostMapping("/getData")
+ @Permission(code = "view", name = "查看大屏")
+ public ResponseBean getData(@RequestBody ChartDto dto) {
+ return ResponseBean.builder().data(reportDashboardService.getChartData(dto)).build();
+ }
- /**
- * 导入大屏
- * @param file 导入的zip文件
- * @param reportCode
- * @return
- */
- @PostMapping("/import/{reportCode}")
- @Permission(code = "import", name = "导入大屏")
- public ResponseBean importDashboard(@RequestParam("file") MultipartFile file,
- @PathVariable("reportCode") String reportCode) {
- reportDashboardService.importDashboard(file, reportCode);
- return ResponseBean.builder().build();
- }
- @PostMapping("/share")
- @GaeaAuditLog(pageTitle = "分享")
- public ResponseBean share(@Validated @RequestBody ReportShareDto dto) {
- return ResponseBean.builder().data(reportShareService.insertShare(dto)).build();
- }
+ /**
+ * 导出大屏
+ * @param reportCode
+ * @return
+ */
+ @GetMapping("/export")
+ @Permission(code = "export", name = "导出大屏")
+ public ResponseEntity exportDashboard(HttpServletRequest request, HttpServletResponse response,
+ @RequestParam("reportCode") String reportCode, @RequestParam(value = "showDataSet",required = false, defaultValue = "1") Integer showDataSet) {
+ return reportDashboardService.exportDashboard(request, response, reportCode, showDataSet);
+ }
+
+ /**
+ * 导入大屏
+ * @param file 导入的zip文件
+ * @param reportCode
+ * @return
+ */
+ @PostMapping("/import/{reportCode}")
+ @Permission(code = "import", name = "导入大屏")
+ public ResponseBean importDashboard(@RequestParam("file") MultipartFile file, @PathVariable("reportCode") String reportCode) {
+ reportDashboardService.importDashboard(file, reportCode);
+ return ResponseBean.builder().build();
+ }
+
+ @PostMapping("/share")
+ @GaeaAuditLog(pageTitle = "分享")
+ @Permission(code = "bigScreenManage", name = "分享报表")
+ public ResponseBean share(@Validated @RequestBody ReportShareDto dto) {
+ return ResponseBean.builder().data(reportShareService.insertShare(dto)).build();
+ }
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ChartDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ChartDto.java
index 90188c079..d6b67f871 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ChartDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ChartDto.java
@@ -6,43 +6,46 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Map;
+
/**
- * @description 大屏设计 dto
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
+*
+* @description 大屏设计 dto
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
@Data
public class ChartDto implements Serializable {
- private String chartType;
+ private String chartType;
- /** 数据集编码 */
- private String setCode;
+ /**数据集编码*/
+ private String setCode;
- /** 传入的自定义参数 */
- private Map contextData;
+ /** 传入的自定义参数*/
+ private Map contextData;
- /** 图表属性 */
- private Map chartProperties;
+ /**图表属性*/
+ private Map chartProperties;
- /** 时间字段 */
- private String timeLineFiled;
+ /**时间字段*/
+ private String timeLineFiled;
- /** 时间颗粒度 */
- private String particles;
+ /**时间颗粒度*/
+ private String particles;
- /** 时间格式化 */
- private String dataTimeFormat;
+ /**时间格式化*/
+ private String dataTimeFormat;
- /** 时间展示层 */
- private String timeLineFormat;
+ /**时间展示层*/
+ private String timeLineFormat;
- private int timeUnit;
+ private int timeUnit;
- /** 时间区间 */
- private String startTime;
+ /**时间区间*/
+ private String startTime;
+
+ /**时间区间*/
+ private String endTime;
- /** 时间区间 */
- private String endTime;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardDto.java
index 276761a0f..681235241 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardDto.java
@@ -8,47 +8,48 @@ import lombok.Data;
import java.io.Serializable;
import java.util.List;
+
/**
- * @description 大屏设计 dto
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
+*
+* @description 大屏设计 dto
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
@Data
public class ReportDashboardDto extends GaeaBaseDTO implements Serializable {
+ /** 报表编码 */
+ private String reportCode;
- /** 报表编码 */
- private String reportCode;
+ /** 看板标题 */
+ private String title;
- /** 看板标题 */
- private String title;
+ /** 宽度px */
+ private Long width;
- /** 宽度px */
- private Long width;
+ /** 高度px */
+ private Long height;
- /** 高度px */
- private Long height;
+ /** 背景色 */
+ private String backgroundColor;
- /** 背景色 */
- private String backgroundColor;
+ /** 背景图片 */
+ private String backgroundImage;
- /** 背景图片 */
- private String backgroundImage;
+ /** 工作台中的辅助线 */
+ private String presetLine;
- /** 工作台中的辅助线 */
- private String presetLine;
+ /** 自动刷新间隔秒,数据字典REFRESH_TYPE */
+ private Integer refreshSeconds;
- /** 自动刷新间隔秒,数据字典REFRESH_TYPE */
- private Integer refreshSeconds;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ private Integer enableFlag;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- private Integer enableFlag;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ private Integer deleteFlag;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- private Integer deleteFlag;
+ /** 排序,降序 */
+ private Integer sort;
- /** 排序,降序 */
- private Integer sort;
-
- private List widgets;
+ private List widgets;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardObjectDto.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardObjectDto.java
index 60486ea00..cc4ca08ec 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardObjectDto.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/dto/ReportDashboardObjectDto.java
@@ -7,25 +7,26 @@ import lombok.Data;
import java.io.Serializable;
import java.util.List;
+
/**
- * @description 大屏设计 dto
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
+*
+* @description 大屏设计 dto
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
@Data
public class ReportDashboardObjectDto implements Serializable {
- /** 报表编码 */
- private String reportCode;
+ /** 报表编码 */
+ private String reportCode;
+ /**
+ * 报表编码
+ */
+ private ReportDashboardDto dashboard;
- /**
- * 报表编码
- */
- private ReportDashboardDto dashboard;
-
- /**
- * 大屏画布中的组件
- */
- private List widgets;
+ /**
+ * 大屏画布中的组件
+ */
+ private List widgets;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/param/ReportDashboardParam.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/param/ReportDashboardParam.java
index 6b279558b..fe81546a0 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/param/ReportDashboardParam.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/controller/param/ReportDashboardParam.java
@@ -6,12 +6,12 @@ import lombok.Data;
import java.io.Serializable;
-/**
- * @desc ReportDashboard 大屏设计查询输入类
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
-@Data
-public class ReportDashboardParam extends PageParam implements Serializable {
+/**
+* @desc ReportDashboard 大屏设计查询输入类
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
+@Data
+public class ReportDashboardParam extends PageParam implements Serializable{
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/ReportDashboardMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/ReportDashboardMapper.java
index 308042800..f7b47d687 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/ReportDashboardMapper.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/ReportDashboardMapper.java
@@ -5,11 +5,10 @@ import com.anjiplus.template.gaea.business.modules.dashboard.dao.entity.ReportDa
import org.apache.ibatis.annotations.Mapper;
/**
- * ReportDashboard Mapper
- *
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
+* ReportDashboard Mapper
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
@Mapper
public interface ReportDashboardMapper extends GaeaBaseMapper {
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/entity/ReportDashboard.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/entity/ReportDashboard.java
index d7eb14ffb..76ad6cb6b 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/entity/ReportDashboard.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/dao/entity/ReportDashboard.java
@@ -9,46 +9,46 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
- * @description 大屏设计 entity
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
-@TableName(keepGlobalPrefix = true, value = "gaea_report_dashboard")
+* @description 大屏设计 entity
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
+@TableName(keepGlobalPrefix=true, value="gaea_report_dashboard")
@Data
public class ReportDashboard extends GaeaBaseEntity {
+ @ApiModelProperty(value = "报表编码")
+ @Unique(code = ResponseCode.REPORT_CODE_ISEXIST)
+ private String reportCode;
- @ApiModelProperty(value = "报表编码")
- @Unique(code = ResponseCode.REPORT_CODE_ISEXIST)
- private String reportCode;
+ @ApiModelProperty(value = "看板标题")
+ private String title;
- @ApiModelProperty(value = "看板标题")
- private String title;
+ @ApiModelProperty(value = "宽度px")
+ private Long width;
- @ApiModelProperty(value = "宽度px")
- private Long width;
+ @ApiModelProperty(value = "高度px")
+ private Long height;
- @ApiModelProperty(value = "高度px")
- private Long height;
+ @ApiModelProperty(value = "背景色")
+ private String backgroundColor;
- @ApiModelProperty(value = "背景色")
- private String backgroundColor;
+ @ApiModelProperty(value = "背景图片")
+ private String backgroundImage;
- @ApiModelProperty(value = "背景图片")
- private String backgroundImage;
+ @ApiModelProperty(value = "工作台中的辅助线")
+ private String presetLine;
- @ApiModelProperty(value = "工作台中的辅助线")
- private String presetLine;
+ @ApiModelProperty(value = "自动刷新间隔秒,数据字典REFRESH_TYPE")
+ private Integer refreshSeconds;
- @ApiModelProperty(value = "自动刷新间隔秒,数据字典REFRESH_TYPE")
- private Integer refreshSeconds;
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ private Integer enableFlag;
- @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
- private Integer enableFlag;
+ @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
+ private Integer deleteFlag;
- @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
- private Integer deleteFlag;
+ @ApiModelProperty(value = "排序,降序")
+ private Integer sort;
- @ApiModelProperty(value = "排序,降序")
- private Integer sort;
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ChartStrategy.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ChartStrategy.java
index bea7ee643..ccaa4b047 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ChartStrategy.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ChartStrategy.java
@@ -10,17 +10,17 @@ import java.util.List;
*/
public interface ChartStrategy {
- /**
- * 图表类型
- * @return
- */
- String type();
-
- /**
- * 针对每种图表类型做单独的数据转换解析
- * @param dto
- * @return
- */
- Object transform(ChartDto dto, List data);
+ /**
+ * 图表类型
+ * @return
+ */
+ String type();
+ /**
+ * 针对每种图表类型做单独的数据转换解析
+ *
+ * @param dto
+ * @return
+ */
+ Object transform(ChartDto dto, List data);
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ReportDashboardService.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ReportDashboardService.java
index fd6924667..2b8c1e359 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ReportDashboardService.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/ReportDashboardService.java
@@ -13,47 +13,49 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
- * @desc ReportDashboard 大屏设计服务接口
- * @author Raod
- * @date 2021-04-12 14:52:21.761
- **/
+* @desc ReportDashboard 大屏设计服务接口
+* @author Raod
+* @date 2021-04-12 14:52:21.761
+**/
public interface ReportDashboardService extends GaeaBaseService {
- /***
- * 查询详情
- * @param reportCode
- */
- ReportDashboardObjectDto getDetail(String reportCode);
+ /***
+ * 查询详情
+ *
+ * @param reportCode
+ */
+ ReportDashboardObjectDto getDetail(String reportCode);
- /***
- * 保存大屏设计
- * @param dto
- */
- void insertDashboard(ReportDashboardObjectDto dto);
+ /***
+ * 保存大屏设计
+ *
+ * @param dto
+ */
+ void insertDashboard(ReportDashboardObjectDto dto);
- /**
- * 获取单个图表数据
- * @param dto
- * @return
- */
- Object getChartData(ChartDto dto);
- /**
- * 导出大屏,zip文件
- * @param request
- * @param response
- * @param reportCode
- * @return
- */
- ResponseEntity exportDashboard(HttpServletRequest request, HttpServletResponse response, String reportCode,
- Integer showDataSet);
+ /**
+ * 获取单个图表数据
+ * @param dto
+ * @return
+ */
+ Object getChartData(ChartDto dto);
- /**
- * 导入大屏zip
- * @param file
- * @param reportCode
- * @return
- */
- void importDashboard(MultipartFile file, String reportCode);
+ /**
+ * 导出大屏,zip文件
+ * @param request
+ * @param response
+ * @param reportCode
+ * @return
+ */
+ ResponseEntity exportDashboard(HttpServletRequest request, HttpServletResponse response, String reportCode, Integer showDataSet);
+
+ /**
+ * 导入大屏zip
+ * @param file
+ * @param reportCode
+ * @return
+ */
+ void importDashboard(MultipartFile file, String reportCode);
}
diff --git a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/impl/BarChartServiceImpl.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/impl/BarChartServiceImpl.java
index 83656301c..7874721d5 100644
--- a/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/impl/BarChartServiceImpl.java
+++ b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/dashboard/service/impl/BarChartServiceImpl.java
@@ -8,54 +8,72 @@ import org.springframework.stereotype.Component;
import java.util.List;
/**
- * 柱状体或者折线图 Created by raodeming on 2021/4/26.
+ * 柱状体或者折线图
+ * Created by raodeming on 2021/4/26.
*/
@Component
public class BarChartServiceImpl implements ChartStrategy {
+ /**
+ * 图表类型
+ *
+ * @return
+ */
+ @Override
+ public String type() {
+ return "widget-barchart|widget-linechart";
+ }
- /**
- * 图表类型
- * @return
- */
- @Override
- public String type() {
- return "widget-barchart|widget-linechart";
- }
+ /**
+ * 针对每种图表类型做单独的数据转换解析
+ *
+ * @param dto
+ * @param data
+ * @return
+ */
+ @Override
+ public Object transform(ChartDto dto, List data) {
+// JSONObject json = new JSONObject();
+// List