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
index bc90c074a..a8b5a79a0 100644
--- 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
@@ -33,6 +33,7 @@ import java.util.Locale;
/**
* 盖亚自动装配
+ *
* @author lr
* @since 2021-01-11
*/
@@ -40,166 +41,166 @@ import java.util.Locale;
@EnableConfigurationProperties(GaeaProperties.class)
public class GaeaAutoConfiguration {
- @Bean
- @ConditionalOnMissingBean
- public Jackson2ObjectMapperBuilderCustomizer customizer() {
- return builder -> {
- builder.locale(Locale.CHINA);
- builder.serializerByType(Long.class, ToStringSerializer.instance);
- };
- }
+ @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();
- }
+ /**
+ * spring上下文工具类
+ * @return
+ */
+ @Bean
+ public ApplicationContextUtils applicationContextUtils() {
+ return new ApplicationContextUtils();
+ }
- /**
- * jwt实例
- * @param gaeaProperties
- * @return
- */
- @Bean
- public JwtBean jwtBean(GaeaProperties gaeaProperties) {
- return new JwtBean(gaeaProperties);
- }
+ /**
+ * 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();
- }
+ @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 {
- /**
- * 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();
- }
+ /**
+ * 获取当前应用所有的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 {
+ /**
+ * 国际化
+ *
+ * @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();
- }
+ /**
+ * 根据请求头识别国际化locale
+ * @return
+ */
+ @Bean
+ public MessageLocaleResolver localeResolver() {
+ return new MessageLocaleResolver();
+ }
- /**
- * 国际化
- *
- * @return
- */
- @Bean
- public MessageSourceHolder messageSourceHolder() {
- return new MessageSourceHolder();
- }
- }
- }
+ /**
+ * 国际化
+ * @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("/**");
- }
- }
+ /**
+ * 异常监听
+ * @return
+ */
+ @Bean
+ public ExceptionApplicationListener exceptionApplicationListener() {
+ return new ExceptionApplicationListener();
+ }
- /**
- * 持久层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();
- }
+ /**
+ * Web配置
+ */
+ @Configuration
+ @ConditionalOnClass(WebMvcConfigurer.class)
+ public static class GaeaWebMvcConfigurer implements WebMvcConfigurer {
- /**
- * 填充sql
- *
- * @return
- */
- @Bean
- public CustomSqlInjector customSqlInjector() {
- return new CustomSqlInjector();
- }
+ /**
+ * 拦截器
+ * @param registry
+ */
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ InterceptorRegistration interceptorRegistration = registry.addInterceptor(new AccessKeyInterceptor());
+ interceptorRegistration.addPathPatterns("/**");
+ }
- /**
- * 分页
- *
- * @return
- */
- @Bean
- public PaginationInterceptor paginationInterceptor() {
- return new PaginationInterceptor();
- }
+ }
+
+ /**
+ * 持久层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();
+ }
+
+ }
- /**
- * 默认填充
- *
- * @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 eb350f37f..2f27486b7 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,12 +13,14 @@ 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 c3f2eb485..aab90bf7c 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,6 +6,7 @@ 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 f0e8c6666..3a00b9575 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 7cb03a5b5..625881c0a 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,6 +1,5 @@
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;
@@ -16,135 +15,133 @@ 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 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 String regKey(String key) {
+ return CacheHelper.super.regKey(key);
+ }
- @Override
- public void stringSet(String key, String value) {
- cache.put(key, value);
- }
+ @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 Map hashGet(String key) {
+ Cache.ValueWrapper t = cache.get(key);
+ if (t != null) {
+ return (Map) t.get();
+ }
+ return Maps.newHashMap();
+ }
- @Override
- public String regKey(String key) {
- return CacheHelper.super.regKey(key);
- }
+ @Override
+ public String hashGetString(String key, String hashKey) {
+ Map stringStringMap = hashGet(key);
+ return stringStringMap.get(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 hashDel(String key, String hashKey) {
+ Map stringStringMap = hashGet(key);
+ stringStringMap.remove(hashKey);
+ }
- @Override
- public Map hashGet(String key) {
- Cache.ValueWrapper t = cache.get(key);
- if (t != null) {
- return (Map) t.get();
- }
- return Maps.newHashMap();
- }
+ @Override
+ public void hashBatchDel(String key, Set hashKeys) {
+ Map stringStringMap = hashGet(key);
+ hashKeys.forEach(stringStringMap::remove);
+ }
- @Override
- public String hashGetString(String key, String hashKey) {
- Map stringStringMap = hashGet(key);
- return stringStringMap.get(hashKey);
- }
+ @Override
+ public boolean hashExist(String key, String hashKey) {
+ if (exist(key)) {
+ Map map = hashGet(key);
+ return map.containsKey(hashKey);
+ }
+ return false;
+ }
- @Override
- public void hashDel(String key, String hashKey) {
- Map stringStringMap = hashGet(key);
- stringStringMap.remove(hashKey);
- }
+ @Override
+ public boolean hashAnyExist(String key, String[] hashKeys) {
+ return CacheHelper.super.hashAnyExist(key, hashKeys);
+ }
- @Override
- public void hashBatchDel(String key, Set hashKeys) {
- Map stringStringMap = hashGet(key);
- hashKeys.forEach(stringStringMap::remove);
- }
+ @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 boolean hashExist(String key, String hashKey) {
- if (exist(key)) {
- Map map = hashGet(key);
- return map.containsKey(hashKey);
- }
- return false;
- }
+ @Override
+ public void hashSet(String key, Map hash) {
+ cache.put(key, hash);
+ }
- @Override
- public boolean hashAnyExist(String key, String[] hashKeys) {
- return CacheHelper.super.hashAnyExist(key, hashKeys);
- }
+ @Override
+ public boolean delete(String key) {
+ if (exist(key)) {
+ cache.evict(key);
+ }
+ 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 boolean delete(List keys) {
+ keys.forEach(this::delete);
+ return true;
+ }
- @Override
- public void hashSet(String key, Map hash) {
- cache.put(key, hash);
- }
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ /* 基于内存的本地缓存 */
+ cache = (Cache) applicationContext.getBean("ehCacheCache");
+ }
- @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 f0fe70390..b29c442e4 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,137 +2,173 @@ package com.anjiplus.template.gaea.business.code;
/**
* 响应码
+ *
* @author lr
* @since 2021-02-22
*/
public interface ResponseCode {
- 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_NULL = "field.not.null";
- String USER_PASSWORD_ERROR = "User.password.error";
- /**
- * 用户名或者密码不正确
- */
- String LOGIN_ERROR = "login.error";
+ String NOT_EMPTY = "field.not.empty";
- /**
- * 新密码不能和原密码一致
- */
- String USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL = "user.password.config.password.canot.equal";
+ String MIN = "field.min";
- /**
- * 密码和确认密码不一致
- */
- String USER_INCONSISTENT_PASSWORD_ERROR = "user.inconsistent.password.error";
+ String MAX = "field.max";
- /**
- * 旧密码不正确
- */
- String USER_OLD_PASSWORD_ERROR = "user.old.password.error";
+ String DICT_ERROR = "field.dict.error";
+ String USER_PASSWORD_ERROR = "User.password.error";
+ /**
+ * 用户名或者密码不正确
+ */
+ String LOGIN_ERROR = "login.error";
- /**
- * 用户token过期
- */
- String USER_TOKEN_EXPIRED = "User.token.expired";
+ /**
+ * 新密码不能和原密码一致
+ */
+ String USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL = "user.password.config.password.canot.equal";
- /**
- * 字典项重复
- */
- String DICT_ITEM_REPEAT = "Dict.item.code.exist";
+ /**
+ * 密码和确认密码不一致
+ */
+ String USER_INCONSISTENT_PASSWORD_ERROR = "user.inconsistent.password.error";
- /**
- * 数字字典国际化标识不能为null
- */
- String DICT_CODE_LOCALE_NULL = "500-00002";
+ /**
+ * 旧密码不正确
+ */
+ String USER_OLD_PASSWORD_ERROR = "user.old.password.error";
- /**
- * 参数为空
- */
- String PARAM_IS_NULL = "Rule.execute.param.null";
+ /**
+ * 用户token过期
+ */
+ String USER_TOKEN_EXPIRED = "User.token.expired";
- /**
- * 规则编译不通过
- */
- String RULE_CONTENT_COMPILE_ERROR = "Rule.content.compile.error";
+ /**
+ * 字典项重复
+ */
+ String DICT_ITEM_REPEAT = "Dict.item.code.exist";
- /**
- * 规则执行不通过
- */
- String RULE_CONTENT_EXECUTE_ERROR = "Rule.content.execute.error";
+ /**
+ * 数字字典国际化标识不能为null
+ */
+ String DICT_CODE_LOCALE_NULL = "500-00002";
- /**
- * 规则编码已存在
- */
- String RULE_CODE_EXIST = "Rule.code.exist";
+ /**
+ * 参数为空
+ */
+ String PARAM_IS_NULL = "Rule.execute.param.null";
- /**
- * 对应规则内容不存在
- */
- String RULE_CONTENT_NOT_EXIST = "Rule.content.not.exist";
+ /**
+ * 规则编译不通过
+ */
+ String RULE_CONTENT_COMPILE_ERROR = "Rule.content.compile.error";
- /**
- * 对应规则字段值不存在
- */
- String RULE_FIELDS_NOT_EXIST = "Rule.fields.not.exist";
+ /**
+ * 规则执行不通过
+ */
+ String RULE_CONTENT_EXECUTE_ERROR = "Rule.content.execute.error";
- /**
- * 规则字段必填
- */
- String RULE_FIELD_VALUE_IS_REQUIRED = "Rule.field.value.is.required";
+ /**
+ * 规则编码已存在
+ */
+ String RULE_CODE_EXIST = "Rule.code.exist";
- /**
- * 规则字段值类型错误
- */
- String RULE_FIELD_VALUE_TYPE_ERROR = "Rule.field.value.type.error";
+ /**
+ * 对应规则内容不存在
+ */
+ String RULE_CONTENT_NOT_EXIST = "Rule.content.not.exist";
- /**
- * 规则参数校验不通过
- */
- String RULE_FIELDS_CHECK_ERROR = "Rule.fields.check.error";
- /**
- * 组件未加载
- */
- String COMPONENT_NOT_LOAD = "Component.load.check.error";
+ /**
+ * 对应规则字段值不存在
+ */
+ String RULE_FIELDS_NOT_EXIST = "Rule.fields.not.exist";
- 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_IS_REQUIRED = "Rule.field.value.is.required";
- String REPORT_SHARE_LINK_INVALID = "report.share.link.invalid";
+ /**
+ * 规则字段值类型错误
+ */
+ 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 EXECUTE_GROOVY_ERROR = "4011";
+
+ 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
index b495d7732..d29fb909f 100644
--- 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
@@ -7,23 +7,22 @@ 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"
-})
+@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();
- }
+ /**
+ * 系统启动完执行
+ * @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
index 129c42dd8..0658a93a6 100644
--- 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
@@ -19,38 +19,40 @@ import java.sql.Statement;
@Slf4j
@Component
@AllArgsConstructor
-@ConditionalOnProperty(value = {"spring.flyway.enabled"})
+@ConditionalOnProperty(value = { "spring.flyway.enabled" })
public class DatabaseInitializer {
- private final FlywayProperties flywayProperties;
- private final DataSourceProperties dataSourceProperties;
+ private final FlywayProperties flywayProperties;
- @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");
- }
+ 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 8e373310f..d7f19289f 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,72 +12,74 @@ import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "spring.druid")
@Data
public class DruidProperties {
- /**
- * 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
- */
- private int initialSize;
- /**
- * 最小连接池数量
- */
- private int minIdle;
+ /**
+ * 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
+ */
+ private int initialSize;
- /**
- * 最大连接池数量
- */
- private int maxActive;
+ /**
+ * 最小连接池数量
+ */
+ private int minIdle;
- /**
- * 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置
- */
- private int maxWait;
+ /**
+ * 最大连接池数量
+ */
+ private int maxActive;
- /**
- * 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间,如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。
- */
- private int timeBetweenEvictionRunsMillis;
+ /**
+ * 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置
+ */
+ private int maxWait;
- /**
- * 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间
- */
- private int minEvictableIdleTimeMillis;
+ /**
+ * 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间,如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。
+ */
+ private int timeBetweenEvictionRunsMillis;
- /**
- * 申请连接时检测空闲时间,根据空闲时间再检测连接是否有效.建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRun
- */
- private boolean testWhileIdle;
+ /**
+ * 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间
+ */
+ private int minEvictableIdleTimeMillis;
- /**
- * 开启PSCache
- */
- private boolean poolPreparedStatements;
+ /**
+ * 申请连接时检测空闲时间,根据空闲时间再检测连接是否有效.建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRun
+ */
+ private boolean testWhileIdle;
- /**
- * 设置PSCache值
- */
- private int maxPoolPreparedStatementPerConnectionSize;
+ /**
+ * 开启PSCache
+ */
+ private boolean poolPreparedStatements;
- /**
- * 连接出错后再尝试连接三次
- */
- private int connectionErrorRetryAttempts;
+ /**
+ * 设置PSCache值
+ */
+ private int maxPoolPreparedStatementPerConnectionSize;
- /**
- * 数据库服务宕机自动重连机制
- */
- private boolean breakAfterAcquireFailure;
+ /**
+ * 连接出错后再尝试连接三次
+ */
+ private int connectionErrorRetryAttempts;
- /**
- * 连接出错后重试时间间隔
- */
- private int timeBetweenConnectErrorMillis;
+ /**
+ * 数据库服务宕机自动重连机制
+ */
+ 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;
+ }
- 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/constant/BusinessConstant.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/constant/BusinessConstant.java
index 4e2aa8f54..f509c9e59 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,44 @@ package com.anjiplus.template.gaea.business.constant;
/**
* 常量
+ *
* @author lr
* @since 2021-03-26
*/
public interface BusinessConstant {
- String LEFT_BIG_BOAST = "{";
- String RIGTH_BIG_BOAST = "}";
- String LEFT_MIDDLE_BOAST = "[";
- String RIGHT_MIDDLE_BOAST = "]";
- String SLASH = "/";
+ String LEFT_BIG_BOAST = "{";
- String USER_GUEST = "guest";
- String USER_ADMIN = "admin";
+ String RIGTH_BIG_BOAST = "}";
+ String LEFT_MIDDLE_BOAST = "[";
- /**
- * 字典项重复
- */
- String DICT_ITEM_EXIST_GROUP = "dictItemExist";
+ String RIGHT_MIDDLE_BOAST = "]";
- /**
- * 所有url的权限码缓存key
- */
- String GAEA_SECURITY_AUTHORITIES= "gaea:security:authorities:all";
+ String SLASH = "/";
- /**
- * 用户登录的token缓存key
- */
- String GAEA_SECURITY_LOGIN_TOKEN = "gaea:security:login:token:%s";
+ String USER_GUEST = "guest";
+
+ String USER_ADMIN = "admin";
+
+ /**
+ * 字典项重复
+ */
+ String DICT_ITEM_EXIST_GROUP = "dictItemExist";
+
+ /**
+ * 所有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";
- /**
- * 用户登录的主信息缓存信息
- */
- 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 a883408df..5e69b708b 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,47 +1,55 @@
package com.anjiplus.template.gaea.business.enums;
+
public enum DeleteFlagEnum {
- DELETED(1,"已删除"),
- UNDELETED(0,"未删除"),
- ;
- private int codeValue;
- private String codeDesc;
+ DELETED(1, "已删除"), UNDELETED(0, "未删除"),;
- private DeleteFlagEnum(int codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ private int codeValue;
- public int getCodeValue(){ return this.codeValue;}
+ private String codeDesc;
- public String getCodeDesc(){ return this.codeDesc;}
+ private DeleteFlagEnum(int codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- //根据codeValue获取枚举
- public static DeleteFlagEnum parseFromCodeValue(int codeValue){
- for (DeleteFlagEnum e : DeleteFlagEnum.values()){
- if(e.codeValue == codeValue){ return e;}
- }
- return null;
- }
+ public int getCodeValue() {
+ return this.codeValue;
+ }
- //根据codeValue获取描述
- public static String getCodeDescByCodeValue(int codeValue){
- DeleteFlagEnum enumItem = parseFromCodeValue(codeValue);
- return enumItem == null ? "" : enumItem.getCodeDesc();
- }
+ public String getCodeDesc() {
+ return this.codeDesc;
+ }
- //验证codeValue是否有效
- public static boolean validateCodeValue(int codeValue){ return parseFromCodeValue(codeValue)!=null;}
+ // 根据codeValue获取枚举
+ public static DeleteFlagEnum parseFromCodeValue(int codeValue) {
+ for (DeleteFlagEnum e : DeleteFlagEnum.values()) {
+ if (e.codeValue == codeValue) {
+ return e;
+ }
+ }
+ return 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();
- }
+ // 根据codeValue获取描述
+ public static String getCodeDescByCodeValue(int codeValue) {
+ DeleteFlagEnum enumItem = parseFromCodeValue(codeValue);
+ return enumItem == null ? "" : enumItem.getCodeDesc();
+ }
+ // 验证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 5d4b207b7..b410ca21e 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,47 +1,55 @@
package com.anjiplus.template.gaea.business.enums;
+
public enum EnableFlagEnum {
- ENABLE(1,"启用"),
- DISABLE(0,"禁用"),
- ;
- private int codeValue;
- private String codeDesc;
+ ENABLE(1, "启用"), DISABLE(0, "禁用"),;
- private EnableFlagEnum(int codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ private int codeValue;
- public int getCodeValue(){ return this.codeValue;}
+ private String codeDesc;
- public String getCodeDesc(){ return this.codeDesc;}
+ private EnableFlagEnum(int codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- //根据codeValue获取枚举
- public static EnableFlagEnum parseFromCodeValue(int codeValue){
- for (EnableFlagEnum e : EnableFlagEnum.values()){
- if(e.codeValue == codeValue){ return e;}
- }
- return null;
- }
+ public int getCodeValue() {
+ return this.codeValue;
+ }
- //根据codeValue获取描述
- public static String getCodeDescByCodeBalue(int codeValue){
- EnableFlagEnum enumItem = parseFromCodeValue(codeValue);
- return enumItem == null ? "" : enumItem.getCodeDesc();
- }
+ public String getCodeDesc() {
+ return this.codeDesc;
+ }
- //验证codeValue是否有效
- public static boolean validateCodeValue(int codeValue){ return parseFromCodeValue(codeValue)!=null;}
+ // 根据codeValue获取枚举
+ public static EnableFlagEnum parseFromCodeValue(int codeValue) {
+ for (EnableFlagEnum e : EnableFlagEnum.values()) {
+ if (e.codeValue == codeValue) {
+ return e;
+ }
+ }
+ return 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();
- }
+ // 根据codeValue获取描述
+ public static String getCodeDescByCodeBalue(int codeValue) {
+ EnableFlagEnum enumItem = parseFromCodeValue(codeValue);
+ return enumItem == null ? "" : enumItem.getCodeDesc();
+ }
+ // 验证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 b0efbc6eb..945157a95 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,68 +6,67 @@ 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, "居中"),
- ;
- /**
- * excel居中code
- */
- private final short excelCode;
+ /**
+ * 左对齐
+ */
+ LEFT((short) 1, 1, "左对齐"),
+ /**
+ * 右对齐
+ */
+ RIGHT((short) 3, 2, "右对齐"),
+ /**
+ * 居中
+ */
+ CENTER((short) 2, 0, "居中"),;
- /**
- * 在线文档居中code
- */
- private final Integer onlineExcelCode;
+ /**
+ * excel居中code
+ */
+ private final short excelCode;
- /**
- * 名称
- */
- private final String name;
+ /**
+ * 在线文档居中code
+ */
+ private final Integer onlineExcelCode;
+ /**
+ * 名称
+ */
+ 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 6b01a17e0..b08ead076 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 codeDesc;
+ private String codeValue;
- private ExportTypeEnum(String codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ private String codeDesc;
- public String getCodeValue() {
- return this.codeValue;
- }
+ private ExportTypeEnum(String codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- public String getCodeDesc() {
- return this.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/ReportTypeEnum.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/enums/ReportTypeEnum.java
index f2d267a34..a42ed080a 100644
--- 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
@@ -5,29 +5,29 @@ package com.anjiplus.template.gaea.business.enums;
*/
public enum ReportTypeEnum {
- /**report_screen*/
- report_screen("report_screen", "大屏报表"),
- /**report_excel*/
- report_excel("report_excel", "excel报表"),
- ;
+ /** report_screen */
+ report_screen("report_screen", "大屏报表"),
+ /** report_excel */
+ report_excel("report_excel", "excel报表"),;
- private String codeValue;
- private String codeDesc;
+ private String codeValue;
- ReportTypeEnum() {
- }
+ private String codeDesc;
- private ReportTypeEnum(String codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ ReportTypeEnum() {
+ }
- public String getCodeValue() {
- return this.codeValue;
- }
+ private ReportTypeEnum(String codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- public String getCodeDesc() {
- return this.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 a0242f376..2f0dd1fc8 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,56 +1,55 @@
package com.anjiplus.template.gaea.business.enums;
public enum SetTypeEnum {
- SQL("sql", "sql"),
- HTTP("http", "http"),
- ;
- private String codeValue;
- private String codeDesc;
+ SQL("sql", "sql"), HTTP("http", "http"),;
- private SetTypeEnum(String codeValue, String codeDesc) {
- this.codeValue = codeValue;
- this.codeDesc = codeDesc;
- }
+ private String codeValue;
- public String getCodeValue() {
- return this.codeValue;
- }
+ private String codeDesc;
- public String getCodeDesc() {
- return this.codeDesc;
- }
+ private SetTypeEnum(String codeValue, String codeDesc) {
+ this.codeValue = codeValue;
+ this.codeDesc = codeDesc;
+ }
- //根据codeValue获取枚举
- public static SetTypeEnum parseFromCodeValue(String codeValue) {
- for (SetTypeEnum e : SetTypeEnum.values()) {
- if (e.codeValue == codeValue) {
- return e;
- }
- }
- return null;
- }
+ public String getCodeValue() {
+ return this.codeValue;
+ }
- //根据codeValue获取描述
- public static String getCodeDescByCodeBalue(String codeValue) {
- SetTypeEnum enumItem = parseFromCodeValue(codeValue);
- return enumItem == null ? "" : enumItem.getCodeDesc();
- }
+ public String getCodeDesc() {
+ return this.codeDesc;
+ }
- //验证codeValue是否有效
- public static boolean validateCodeValue(String codeValue) {
- return parseFromCodeValue(codeValue) != null;
- }
+ // 根据codeValue获取枚举
+ public static SetTypeEnum parseFromCodeValue(String codeValue) {
+ for (SetTypeEnum e : SetTypeEnum.values()) {
+ if (e.codeValue == codeValue) {
+ return e;
+ }
+ }
+ return 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();
- }
+ // 根据codeValue获取描述
+ public static String getCodeDescByCodeBalue(String codeValue) {
+ SetTypeEnum enumItem = parseFromCodeValue(codeValue);
+ return enumItem == null ? "" : enumItem.getCodeDesc();
+ }
+ // 验证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 243a7fd02..0f75d2311 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,28 +16,29 @@ 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 destroy() {
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ }
- @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
index 7db13c7e6..36c34ed52 100755
--- 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,43 +20,45 @@ 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();
- }
+ @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);
+ }
- /**
- * 获取一二级菜单
- * @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
index 78e4b4064..ad736a28a 100755
--- 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,46 +10,47 @@ 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 = "菜单代码")
- @NotEmpty(message = "6002")
- private String target;
+ /** 父菜单代码 */
+ @ApiModelProperty(value = "父菜单代码")
+ private String parentTarget;
- /** 目标菜单名称 */
- @ApiModelProperty(value = "菜单名称")
- @NotEmpty(message = "6002")
- private String targetName;
+ /** 目标菜单 */
+ @ApiModelProperty(value = "菜单代码")
+ @NotEmpty(message = "6002")
+ private String target;
- /** 目标按钮 */
- @ApiModelProperty(value = "按钮代码")
- @NotEmpty(message = "6002")
- private String action;
+ /** 目标菜单名称 */
+ @ApiModelProperty(value = "菜单名称")
+ @NotEmpty(message = "6002")
+ private String targetName;
- /** 目标按钮名称 */
- @ApiModelProperty(value = "按钮名称")
- @NotEmpty(message = "6002")
- private String actionName;
+ /** 目标按钮 */
+ @ApiModelProperty(value = "按钮代码")
+ @NotEmpty(message = "6002")
+ private String action;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
- private Integer deleteFlag;
+ /** 目标按钮名称 */
+ @ApiModelProperty(value = "按钮名称")
+ @NotEmpty(message = "6002")
+ private String actionName;
- /** 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=ENABLE_FLAG */
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ @NotNull(message = "6002")
+ private Integer enableFlag;
+
+ @ApiModelProperty(value = "sort")
+ private Integer sort;
- @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
index b4983f4fc..95b84a7e4 100755
--- 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,34 +9,35 @@ 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;
+ /** 按钮名称 */
+ @Query(value = QueryEnum.LIKE)
+ private String actionName;
+
+ // 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/accessauthority/dao/AccessAuthorityMapper.java b/pigx-visual/pigx-report-platform/src/main/java/com/anjiplus/template/gaea/business/modules/accessauthority/dao/AccessAuthorityMapper.java
index 50e53410c..3b8c8d58e 100755
--- 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,10 +5,11 @@ 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
index 5ad2a2a52..15392054b 100755
--- 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,36 +6,35 @@ 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 target;
+ /** 父菜单代码 */
+ private String parentTarget;
- /** 菜单名称 */
- private String targetName;
+ /** 菜单代码 */
+ private String target;
- /** 按钮代码 */
- private String action;
+ /** 菜单名称 */
+ private String targetName;
- /** 按钮名称 */
- private String actionName;
+ /** 按钮代码 */
+ private String action;
- /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
- private Integer deleteFlag;
+ /** 按钮名称 */
+ private String actionName;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- private Integer enableFlag;
-
- private Integer sort;
+ /** 0--未删除 1--已删除 DIC_NAME=DEL_FLAG */
+ private Integer deleteFlag;
+ /** 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
index ddef0ecd1..d44b83d60 100755
--- 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,21 +9,22 @@ 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);
+ /**
+ * @param loginName 当前登录的用户名
+ * @param withActionNode 带第三层的按钮节点
+ * @return
+ */
+ List getAuthorityTree(String loginName, boolean withActionNode);
+
+ /**
+ * 扫描所有mvc url的需要权限码,建立拦截体系
+ */
+ void scanGaeaSecurityAuthorities();
- /**
- * 扫描所有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
index 68bf1ef37..b155b32b5 100755
--- 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,117 +23,116 @@ 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="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存入到缓存中
- 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
index 633b64a71..2cc256104 100755
--- 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,54 +17,55 @@ 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 = "分配权限")
+ @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 = "分配权限")
- @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
index a47a71b5d..9f5b849e7 100755
--- 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;
+ /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ @NotNull(message = "6002")
+ private Integer enableFlag;
+
+ /** 角色保存的权限 */
+ private List authorityList;
- /** 角色保存的权限 */
- 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
index b25fea557..60642990e 100755
--- 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
index 7fe9995ef..bf810efa5 100755
--- 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,10 +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 {
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
index bd08c38c3..c2fc8d55b 100755
--- 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,13 +6,16 @@ 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
index 25bb2b8d2..165ff4de3 100755
--- 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 eb08c1519..31aa551d2 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,31 +12,32 @@ 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 Date updateTime;
+
+ @TableField(exist = false)
+ private Integer version;
- @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
index 556caf35b..f4aa02eba 100755
--- 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,23 +9,25 @@ 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
index 381f0a879..b0f347732 100755
--- 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,78 +24,81 @@ 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);
+ // 先清除该角色已保存的权限
+ 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;
+ }
- // 保存勾选的权限(菜单和按钮)
- 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
index 8dc9420fd..9997f8bce 100755
--- 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,89 +20,87 @@ 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 = "分配角色")
- @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 = "分配角色")
- @PostMapping("/saveRoleTree")
- public ResponseBean saveRoleTree(@RequestBody AccessUserDto dto){
- Boolean data = accessUserService.saveRoleTree(dto);
- return responseSuccessWithData(data);
- }
+ /**
+ * 重置密码
+ * @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
- */
- @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));
- }
+ /**
+ * 修改自己的密码
+ * @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
index 1488d6141..fd3dee914 100755
--- 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;
+ /** 备注 */
+ @ApiModelProperty(value = "备注")
+ private String remark;
+
+ /** 用户勾选的角色 */
+ private List roleCodeList;
- /** 用户勾选的角色 */
- 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 02a9d194e..1da9381dc 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,20 +11,21 @@ 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 String token;
+
+ /** 用户所拥有的权限合集 */
+ private List authorities;
- /** 用户所拥有的权限合集 */
- 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 dfca9b1df..4dec1569d 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,15 +10,16 @@ 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 password;
+
+ @ApiModelProperty(value = "密码")
+ @NotBlank
+ private String confirmPassword;
- @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
index 193c4749c..763be8e9e 100755
--- 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
index cd9a10106..47e8e57d4 100755
--- 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,17 +6,21 @@ 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
index 2e4e68764..088d8fac9 100755
--- 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,10 +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 {
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
index 3df4863d4..66c1c9fa5 100755
--- 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,43 +6,44 @@ 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
index a56be7ab9..b2050f836 100755
--- 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,32 +9,33 @@ 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 Date updateTime;
+
+ @TableField(exist = false)
+ private Integer version;
- @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
index f3d445872..021f34da0 100755
--- 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,42 +11,46 @@ 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 accessUserDto
- * @return
- */
- Boolean saveRoleTree(AccessUserDto accessUserDto);
+ /**
+ * 重置密码
+ * @param gaeaUserDto
+ * @return
+ */
+ Boolean resetPassword(GaeaUserDto gaeaUserDto);
- /** 重置密码
- * @param gaeaUserDto
- * @return
- */
- Boolean resetPassword(GaeaUserDto gaeaUserDto);
+ /**
+ * 用户登录
+ * @param gaeaUserDto
+ * @return
+ */
+ GaeaUserDto login(GaeaUserDto gaeaUserDto);
- /** 用户登录
- * @param gaeaUserDto
- * @return
- */
- GaeaUserDto login(GaeaUserDto gaeaUserDto);
+ /**
+ * 修改密码
+ * @param dto
+ * @return
+ */
+ Boolean updatePassword(UpdatePasswordDto dto);
- /**
- * 修改密码
- * @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
index d825445d8..0874f03a1 100755
--- 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,226 +37,228 @@ 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()));
- 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;
+ }
- accessUserMapper.updateById(accessUser);
- return true;
- }
+ /**
+ * 操作前处理
+ * @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:
- /**
- * 操作前处理
- *
- * @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;
+ }
- 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 45b7735c3..601c81a10 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,90 +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 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 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();
+ }
- /**
- * 导出大屏
- * @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();
- }
+ @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 d6b67f871..90188c079 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,46 +6,43 @@ 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 endTime;
+ /** 时间区间 */
+ private String startTime;
+ /** 时间区间 */
+ 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 681235241..276761a0f 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,48 +8,47 @@ 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 title;
+ /** 报表编码 */
+ private String reportCode;
- /** 宽度px */
- private Long width;
+ /** 看板标题 */
+ private String title;
- /** 高度px */
- private Long height;
+ /** 宽度px */
+ private Long width;
- /** 背景色 */
- private String backgroundColor;
+ /** 高度px */
+ private Long height;
- /** 背景图片 */
- private String backgroundImage;
+ /** 背景色 */
+ private String backgroundColor;
- /** 工作台中的辅助线 */
- private String presetLine;
+ /** 背景图片 */
+ private String backgroundImage;
- /** 自动刷新间隔秒,数据字典REFRESH_TYPE */
- private Integer refreshSeconds;
+ /** 工作台中的辅助线 */
+ private String presetLine;
- /** 0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG */
- private Integer enableFlag;
+ /** 自动刷新间隔秒,数据字典REFRESH_TYPE */
+ private Integer refreshSeconds;
- /** 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=DEL_FLAG */
+ private Integer deleteFlag;
- private List widgets;
+ /** 排序,降序 */
+ private Integer sort;
+
+ 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 cc4ca08ec..60486ea00 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,26 +7,25 @@ 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 ReportDashboardDto dashboard;
+ /** 报表编码 */
+ private String reportCode;
- /**
- * 大屏画布中的组件
- */
- private List widgets;
+ /**
+ * 报表编码
+ */
+ private ReportDashboardDto dashboard;
+
+ /**
+ * 大屏画布中的组件
+ */
+ 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 fe81546a0..6b279558b 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
-**/
+ * @desc ReportDashboard 大屏设计查询输入类
+ * @author Raod
+ * @date 2021-04-12 14:52:21.761
+ **/
@Data
-public class ReportDashboardParam extends PageParam implements Serializable{
+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 f7b47d687..308042800 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,10 +5,11 @@ 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 76ad6cb6b..d7eb14ffb 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 = "看板标题")
- private String title;
+ @ApiModelProperty(value = "报表编码")
+ @Unique(code = ResponseCode.REPORT_CODE_ISEXIST)
+ private String reportCode;
- @ApiModelProperty(value = "宽度px")
- private Long width;
+ @ApiModelProperty(value = "看板标题")
+ private String title;
- @ApiModelProperty(value = "高度px")
- private Long height;
+ @ApiModelProperty(value = "宽度px")
+ private Long width;
- @ApiModelProperty(value = "背景色")
- private String backgroundColor;
+ @ApiModelProperty(value = "高度px")
+ private Long height;
- @ApiModelProperty(value = "背景图片")
- private String backgroundImage;
+ @ApiModelProperty(value = "背景色")
+ private String backgroundColor;
- @ApiModelProperty(value = "工作台中的辅助线")
- private String presetLine;
+ @ApiModelProperty(value = "背景图片")
+ private String backgroundImage;
- @ApiModelProperty(value = "自动刷新间隔秒,数据字典REFRESH_TYPE")
- private Integer refreshSeconds;
+ @ApiModelProperty(value = "工作台中的辅助线")
+ private String presetLine;
- @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
- private Integer enableFlag;
+ @ApiModelProperty(value = "自动刷新间隔秒,数据字典REFRESH_TYPE")
+ private Integer refreshSeconds;
- @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
- private Integer deleteFlag;
+ @ApiModelProperty(value = "0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG")
+ private Integer enableFlag;
- @ApiModelProperty(value = "排序,降序")
- private Integer sort;
+ @ApiModelProperty(value = " 0--未删除 1--已删除 DIC_NAME=DEL_FLAG")
+ private Integer deleteFlag;
+ @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 ccaa4b047..bea7ee643 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();
+ /**
+ * 图表类型
+ * @return
+ */
+ String type();
+
+ /**
+ * 针对每种图表类型做单独的数据转换解析
+ * @param dto
+ * @return
+ */
+ Object transform(ChartDto dto, List data);
- /**
- * 针对每种图表类型做单独的数据转换解析
- *
- * @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 2b8c1e359..fd6924667 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,49 +13,47 @@ 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);
- /**
- * 获取单个图表数据
- * @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);
+ /**
+ * 导入大屏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 7874721d5..83656301c 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,72 +8,54 @@ 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";
- }
- /**
- * 针对每种图表类型做单独的数据转换解析
- *
- * @param dto
- * @param data
- * @return
- */
- @Override
- public Object transform(ChartDto dto, List data) {
-// JSONObject json = new JSONObject();
-// List