diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 01d1c3664dfd89d76d2a0c722791069cda8b0f03..0000000000000000000000000000000000000000
--- a/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2019 Stone
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index 9dc2a475c59c2ffb5a511aff782078fff3db9130..0000000000000000000000000000000000000000
--- a/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
-# Stone 石头 V2.1.0 - 基于 若依 改造的互联网 SaaS 敏捷开发框架 ,一款免费开源的JAVA WBE开发平台,是开源项目中最灵活,扩展性最高的租户平台开发框架。
-
-#### 如果对您有帮助,您可以点右上角 "Star" 支持一下 ,谢谢!
-
-### 介紹
-Stone 是一个基于 SpringBoot 2.1.5 的 互联网 SaaS 敏捷开发框架,包含租户管理、数据源管理、子系统管理和权限管理等通用功能,可根据实际需要,为不同租户分配不同的子系统和数据源,代码清晰,易读易懂、界面简洁美观,没有任何重度依赖; 核心技术采用Spring Boot、MyBatis、Druid、Shiro、JWT、Thymeleaf、Lombok、Fastjson。
-
-### 体验地址:http://113.108.163.210:8849/login
-
-账号密码:admin / admin123 、 test / 123456
-
-### 框架说明
-
-1、导入项目之前请先安装 lombok 插件,方法自行百度;
-
-2、自创数据库级别动态数据源:默认一个平台库(主库),用于保存用户、角色、权限 和 系统等基础数据,其中系统管理包含系统的应用信息和数据源信息,框架可以根据系统标识自动加载对应的数据源信息;
-
-举个简单的栗子: 有个项目包含系统管理(部门、用户、角色、权限 和 系统)、CMS和CRM三个小系统,虽然功能不复杂,但由于使用率超高,导致数据量很大。这时候就可以使用动态数据源分别配置三个库,平台库、CMS库和CRM库。
-
-数据库级别动态数据源比常规多数据源更具灵活性,并且可以做到统一管理;对事务处理也没有任何入侵性。
-
-觉得本项目不错,麻烦点个 Star哦。
-
-### V-1.0.0 已实现功能
-
-1、用户管理:用户是系统操作者,该功能主要完成系统用户配置;
-
-2、部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限;
-
-3、岗位管理:配置系统用户所属担任职务;
-
-4、菜单管理:配置系统菜单,操作权限,按钮权限标识等;
-
-5、角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分;
-
-6、字典管理:对系统中经常使用的一些较为固定的数据进行维护;
-
-7、参数管理:对系统动态配置常用参数;
-
-8、通知公告:系统通知公告信息发布维护;
-
-9、操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询;
-
-10、登录日志:系统登录日志记录查询包含登录异常;
-
-11、在线用户:当前系统中活跃用户状态监控;
-
-12、定时任务:在线(添加、修改、删除)任务调度包含执行结果日志;
-
-13、系统接口:根据业务代码自动生成相关的API接口文档;
-
-14、服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息;
-
-15、连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈;
-
-### V-2.0.0 租户模式,支持一套系统给多个客户使用(已完成):
-
-1、子系统管理(配置构成平台的系统/模块);
-
-2、租户管理(管理配置租户信息);
-
-2、数据路由组件,可根据租户以及子系统,将数据的增删查路由到不同的数据库;
-
-
-### V-2.1.0 加入代码生成器 并 集成JWT,支持小程序或者App鉴权(已完成,专业版功能,需要可以联系我):
-
-1、后台无改动,登录 及 权限仍是交由Shiro控制;
-
-2、加入 JWT,并做了轻封装,支撑小程序、App 及 前后端分离 鉴权;
- 演示环境体验地址:http://113.108.163.210:8849/doc.html
- 未登录(没有获取到Token),系统提示:没有找到名为Authorization的header;
- 已登录(获取到Token),可正常访问系统中所有的RestController。
-
-### V-3.0.0 前后端分离版
-
-1、 前后端分离、技术架构改造;
-
-2、 集成ES作为数据查询中心;
-
-### 相关资料及数据库脚本请加QQ群:531346979, 点击加入
-
-
-### 更新不易,请喝咖啡
-
-![WAI](https://gitee.com/justime/stone/raw/master/wxzs.jpg)
-
-
-### 推荐另外一个项目:https://gitee.com/justime/Movie-ElasticSearch-RHLC
-
-对ES客户端进行了轻封装,极大的降低了使用ES搜索引擎的门槛
-
-### 技术视频分享 (链接: https://pan.baidu.com/s/12rMXHU8CVlb1UqBdcb-Dng 提取码: ri6v )
-
-1、Java 基础视频
-2、设计模式讲解
-3、系统架构视频
-4、SpringCloud 视频
-5、MongoDB
\ No newline at end of file
diff --git a/ak-common/src/main/java/com/ak/common/utils/http/HttpUtils.java b/ak-common/src/main/java/com/ak/common/utils/http/HttpUtils.java
deleted file mode 100644
index c00c6a2022dfc9f5d7708db8333ce5ca8c5ea340..0000000000000000000000000000000000000000
--- a/ak-common/src/main/java/com/ak/common/utils/http/HttpUtils.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package com.ak.common.utils.http;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.net.ssl.*;
-import java.io.*;
-import java.net.ConnectException;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.cert.X509Certificate;
-
-/**
- * 通用http发送方法
- *
- * @author Vean
- */
-public class HttpUtils {
- private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
-
- /**
- * 向指定 URL 发送GET方法的请求
- *
- * @param url 发送请求的 URL
- * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
- * @return 所代表远程资源的响应结果
- */
- public static String sendGet(String url, String param) {
- StringBuilder result = new StringBuilder();
- BufferedReader in = null;
- try {
- String urlNameString = url + "?" + param;
- log.info("sendGet - {}", urlNameString);
- URL realUrl = new URL(urlNameString);
- URLConnection connection = realUrl.openConnection();
- connection.setRequestProperty("accept", "*/*");
- connection.setRequestProperty("connection", "Keep-Alive");
- connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
- connection.connect();
- in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String line;
- while ((line = in.readLine()) != null) {
- result.append(line);
- }
- log.info("recv - {}", result);
- } catch (ConnectException e) {
- log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
- } catch (SocketTimeoutException e) {
- log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
- } catch (IOException e) {
- log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
- } catch (Exception e) {
- log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
- } finally {
- try {
- if (in != null) {
- in.close();
- }
- } catch (Exception ex) {
- log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
- }
- }
- return result.toString();
- }
-
- /**
- * 向指定 URL 发送POST方法的请求
- *
- * @param url 发送请求的 URL
- * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
- * @return 所代表远程资源的响应结果
- */
- public static String sendPost(String url, String param) {
- PrintWriter out = null;
- BufferedReader in = null;
- StringBuilder result = new StringBuilder();
- try {
- String urlNameString = url + "?" + param;
- log.info("sendPost - {}", urlNameString);
- URL realUrl = new URL(urlNameString);
- URLConnection conn = realUrl.openConnection();
- conn.setRequestProperty("accept", "*/*");
- conn.setRequestProperty("connection", "Keep-Alive");
- conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
- conn.setRequestProperty("Accept-Charset", "utf-8");
- conn.setRequestProperty("contentType", "utf-8");
- conn.setDoOutput(true);
- conn.setDoInput(true);
- out = new PrintWriter(conn.getOutputStream());
- out.print(param);
- out.flush();
- in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
- String line;
- while ((line = in.readLine()) != null) {
- result.append(line);
- }
- log.info("recv - {}", result);
- } catch (ConnectException e) {
- log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
- } catch (SocketTimeoutException e) {
- log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
- } catch (IOException e) {
- log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
- } catch (Exception e) {
- log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
- } finally {
- try {
- if (out != null) {
- out.close();
- }
- if (in != null) {
- in.close();
- }
- } catch (IOException ex) {
- log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
- }
- }
- return result.toString();
- }
-
- public static String sendSSLPost(String url, String param) {
- StringBuilder result = new StringBuilder();
- String urlNameString = url + "?" + param;
- try {
- log.info("sendSSLPost - {}", urlNameString);
- SSLContext sc = SSLContext.getInstance("SSL");
- sc.init(null, new TrustManager[]{new TrustAnyTrustManager()}, new java.security.SecureRandom());
- URL console = new URL(urlNameString);
- HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
- conn.setRequestProperty("accept", "*/*");
- conn.setRequestProperty("connection", "Keep-Alive");
- conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
- conn.setRequestProperty("Accept-Charset", "utf-8");
- conn.setRequestProperty("contentType", "utf-8");
- conn.setDoOutput(true);
- conn.setDoInput(true);
-
- conn.setSSLSocketFactory(sc.getSocketFactory());
- conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
- conn.connect();
- InputStream is = conn.getInputStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- String ret = "";
- while ((ret = br.readLine()) != null) {
- if (ret != null && !"".equals(ret.trim())) {
- result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
- }
- }
- log.info("recv - {}", result);
- conn.disconnect();
- br.close();
- } catch (ConnectException e) {
- log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
- } catch (SocketTimeoutException e) {
- log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
- } catch (IOException e) {
- log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
- } catch (Exception e) {
- log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
- }
- return result.toString();
- }
-
- private static class TrustAnyTrustManager implements X509TrustManager {
- @Override
- public void checkClientTrusted(X509Certificate[] chain, String authType) {
- }
-
- @Override
- public void checkServerTrusted(X509Certificate[] chain, String authType) {
- }
-
- @Override
- public X509Certificate[] getAcceptedIssuers() {
- return new X509Certificate[]{};
- }
- }
-
- private static class TrustAnyHostnameVerifier implements HostnameVerifier {
- @Override
- public boolean verify(String hostname, SSLSession session) {
- return true;
- }
- }
-}
\ No newline at end of file
diff --git a/ak-framework/src/main/java/com/ak/framework/util/CageDataSource.java b/ak-framework/src/main/java/com/ak/framework/util/CageDataSource.java
deleted file mode 100644
index 47a5eb36698fe8eae53c817dd2c48dff34c2ba58..0000000000000000000000000000000000000000
--- a/ak-framework/src/main/java/com/ak/framework/util/CageDataSource.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.ak.framework.util;
-
-import com.ak.common.config.Global;
-import com.ak.common.exception.BusinessException;
-import com.ak.framework.datasource.DataSourceBeanBuilder;
-import com.ak.framework.datasource.DataSourceHolder;
-import com.ak.platform.domain.system.SysDatasource;
-import com.ak.platform.service.system.ISysDatasourceService;
-
-/**
- * @author Vean
- *
- * 从数据库读取数据源并设置数据源
- */
-public class CageDataSource {
-
- public static void action(ISysDatasourceService dataSourceService) throws BusinessException {
-
- if (null != ShiroUtils.getSysUser() && !Global.DEFAULT_TENANT_CODE.equals(ShiroUtils.getSysUser().getTenantCode())) {
- SysDatasource _dataSource_ = dataSourceService.queryByTenant(ShiroUtils.getSysUser().getTenantCode());
- if (_dataSource_ != null) {
- DataSourceBeanBuilder builder = new DataSourceBeanBuilder(_dataSource_);
- DataSourceHolder.setDataSource(builder);
- } else {
- throw new RuntimeException("获取数据源信息异常,请检查租户 [" + ShiroUtils.getSysUser().getTenantCode() + "] 的数据源配置");
- }
- }
- }
-}
diff --git a/ak-system/src/main/java/com/ak/StoneApplication.java b/ak-system/src/main/java/com/ak/StoneApplication.java
deleted file mode 100644
index 9cd64a6db74c8e8afe97d8210ebebdcf662773e9..0000000000000000000000000000000000000000
--- a/ak-system/src/main/java/com/ak/StoneApplication.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.ak;
-
-import com.ak.common.config.Global;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.web.servlet.ServletComponentScan;
-
-/**
- * 启动程序
- *
- * @author Vean
- */
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
-@ServletComponentScan(basePackages = {"com.ak"})
-public class StoneApplication {
- public static void main(String[] args) {
- // System.setProperty("spring.devtools.restart.enabled", "false");
- SpringApplication.run(StoneApplication.class, args);
- StringBuilder sb = new StringBuilder();
- sb.append("\r\n=========================================\r\n");
- sb.append("\r\n 欢迎使用 " + Global.getConfig("ak.name") + " - Powered By Vean\r\n");
- sb.append("\r\n=========================================\r\n");
- System.out.println(sb.toString());
- }
-}
\ No newline at end of file
diff --git a/ak-system/src/main/resources/banner.txt b/ak-system/src/main/resources/banner.txt
deleted file mode 100644
index 99e4cdf3884839414e44a59bdee8e3ed3bcfec77..0000000000000000000000000000000000000000
--- a/ak-system/src/main/resources/banner.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Application Version: ${ak.version}
-Spring Boot Version: ${spring-boot.version}
-////////////////////////////////////////////////////////////////////
-// _ooOoo_ //
-// o8888888o //
-// 88" . "88 //
-// (| ^_^ |) //
-// O\ = /O //
-// ____/`---'\____ //
-// .' \\| |// `. //
-// / \\||| : |||// \ //
-// / _||||| -:- |||||- \ //
-// | | \\\ - /// | | //
-// | \_| ''\---/'' | | //
-// \ .-\__ `-` ___/-. / //
-// ___`. .' /--.--\ `. . ___ //
-// ."" '< `.___\_<|>_/___.' >'"". //
-// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
-// \ \ `-. \_ __\ /__ _/ .-` / / //
-// ========`-.____`-.___\_____/___.-`____.-'======== //
-// `=---=' //
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
-// 佛祖保佑 永不宕机 永无BUG //
-////////////////////////////////////////////////////////////////////
\ No newline at end of file
diff --git a/ak-system/src/main/resources/static/css/login.min.css b/ak-system/src/main/resources/static/css/login.min.css
deleted file mode 100644
index 30c6633c74abea8407fa72cc743a07215103e80d..0000000000000000000000000000000000000000
--- a/ak-system/src/main/resources/static/css/login.min.css
+++ /dev/null
@@ -1 +0,0 @@
-html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}
\ No newline at end of file
diff --git a/ak-system/src/main/resources/static/favicon.ico b/ak-system/src/main/resources/static/favicon.ico
deleted file mode 100644
index 15622361e7d3cde2c0da2e1b675f9c8cbc296fb3..0000000000000000000000000000000000000000
Binary files a/ak-system/src/main/resources/static/favicon.ico and /dev/null differ
diff --git a/ak-system/src/main/resources/static/img/profile.jpg b/ak-system/src/main/resources/static/img/profile.jpg
deleted file mode 100644
index fd56176c073eedf3461a91dde9ab97d2479c42d8..0000000000000000000000000000000000000000
Binary files a/ak-system/src/main/resources/static/img/profile.jpg and /dev/null differ
diff --git a/ak-system/src/main/resources/static/slogin.png b/ak-system/src/main/resources/static/slogin.png
deleted file mode 100644
index a30221216e12349c1b4be0ad34fa63c41ad02179..0000000000000000000000000000000000000000
Binary files a/ak-system/src/main/resources/static/slogin.png and /dev/null differ
diff --git a/ak-common/pom.xml b/opl-common/pom.xml
similarity index 68%
rename from ak-common/pom.xml
rename to opl-common/pom.xml
index 8186fc626a1a31de4120209fb767cb4e213864c7..cdd35b8a10249a1eb49d473d4d4bd2bd099528ea 100644
--- a/ak-common/pom.xml
+++ b/opl-common/pom.xml
@@ -3,12 +3,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- stone
- com.ak
- 2.0
+ com.opl.framework
+ opl-project
+ 1.0.0
4.0.0
- ak-common
+ opl-common
通用工具
@@ -17,7 +17,22 @@
org.springframework.boot
spring-boot-starter-web
-
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jetty
+
+
+
+ com.google.guava
+ guava
+
@@ -78,6 +93,22 @@
org.projectlombok
lombok
-
+
+
+
+ org.apache.httpcomponents
+ httpclient
+
+
+
+ com.alibaba
+ fastjson
+
+
+
+ net.sf.supercsv
+ super-csv
+ 2.4.0
+
\ No newline at end of file
diff --git a/ak-common/src/main/java/com/ak/common/annotation/DataScope.java b/opl-common/src/main/java/com/opl/framework/common/annotation/DataScope.java
similarity index 89%
rename from ak-common/src/main/java/com/ak/common/annotation/DataScope.java
rename to opl-common/src/main/java/com/opl/framework/common/annotation/DataScope.java
index 8c62f93c879ee7bc2defb14013aa5fa21f92fae1..465a5995671be555d58ef64e5c71d080890f1bb7 100644
--- a/ak-common/src/main/java/com/ak/common/annotation/DataScope.java
+++ b/opl-common/src/main/java/com/opl/framework/common/annotation/DataScope.java
@@ -1,4 +1,4 @@
-package com.ak.common.annotation;
+package com.opl.framework.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -9,7 +9,7 @@ import java.lang.annotation.Target;
/**
* 数据权限过滤注解
*
- * @author Vean
+ * @author kingrom
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/ak-common/src/main/java/com/ak/common/annotation/Excel.java b/opl-common/src/main/java/com/opl/framework/common/annotation/Excel.java
similarity index 97%
rename from ak-common/src/main/java/com/ak/common/annotation/Excel.java
rename to opl-common/src/main/java/com/opl/framework/common/annotation/Excel.java
index ad5a8ab8c1337dffe98042485828149a3c3f41b8..ca9b1b40dea2dde13296631ec7acb5c9a230f45f 100644
--- a/ak-common/src/main/java/com/ak/common/annotation/Excel.java
+++ b/opl-common/src/main/java/com/opl/framework/common/annotation/Excel.java
@@ -1,4 +1,4 @@
-package com.ak.common.annotation;
+package com.opl.framework.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
/**
* 自定义导出Excel数据注解
*
- * @author Vean
+ * @author kingrom
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
diff --git a/ak-common/src/main/java/com/ak/common/annotation/Excels.java b/opl-common/src/main/java/com/opl/framework/common/annotation/Excels.java
similarity index 82%
rename from ak-common/src/main/java/com/ak/common/annotation/Excels.java
rename to opl-common/src/main/java/com/opl/framework/common/annotation/Excels.java
index a79b44b83710e5044d9baebfb36a4d637f4f2720..44275b26ceb569e4f0f11680b27556fb6831436f 100644
--- a/ak-common/src/main/java/com/ak/common/annotation/Excels.java
+++ b/opl-common/src/main/java/com/opl/framework/common/annotation/Excels.java
@@ -1,4 +1,4 @@
-package com.ak.common.annotation;
+package com.opl.framework.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
/**
* Excel注解集
*
- * @author Vean
+ * @author kingrom
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/ak-common/src/main/java/com/ak/common/annotation/Log.java b/opl-common/src/main/java/com/opl/framework/common/annotation/Log.java
similarity index 81%
rename from ak-common/src/main/java/com/ak/common/annotation/Log.java
rename to opl-common/src/main/java/com/opl/framework/common/annotation/Log.java
index ec8927a2dd6a6611c23c434bd93d8a22c5ba41d1..3a6c33257695129d2acd584f132a2b9c58b3a588 100644
--- a/ak-common/src/main/java/com/ak/common/annotation/Log.java
+++ b/opl-common/src/main/java/com/opl/framework/common/annotation/Log.java
@@ -1,7 +1,4 @@
-package com.ak.common.annotation;
-
-import com.ak.common.enums.BusinessType;
-import com.ak.common.enums.OperatorType;
+package com.opl.framework.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -9,10 +6,13 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import com.opl.framework.common.enums.BusinessType;
+import com.opl.framework.common.enums.OperatorType;
+
/**
* 自定义操作日志记录注解
*
- * @author Vean
+ * @author kingrom
*/
@Target({ElementType.PARAMETER, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
diff --git a/opl-common/src/main/java/com/opl/framework/common/annotation/ModuleScope.java b/opl-common/src/main/java/com/opl/framework/common/annotation/ModuleScope.java
new file mode 100644
index 0000000000000000000000000000000000000000..5d3be32efd9dadb54c03308c327a505b5d72323e
--- /dev/null
+++ b/opl-common/src/main/java/com/opl/framework/common/annotation/ModuleScope.java
@@ -0,0 +1,23 @@
+package com.opl.framework.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 模块属于哪个应用
+ *
+ * @author kingrom
+ */
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ModuleScope {
+ /**
+ * 应用名
+ */
+ public String value() default "";
+
+}
diff --git a/ak-common/src/main/java/com/ak/common/annotation/RepeatSubmit.java b/opl-common/src/main/java/com/opl/framework/common/annotation/RepeatSubmit.java
similarity index 36%
rename from ak-common/src/main/java/com/ak/common/annotation/RepeatSubmit.java
rename to opl-common/src/main/java/com/opl/framework/common/annotation/RepeatSubmit.java
index 8c163a931c7a0b8417c24f42a83e6a894f34930e..3cc219d80531465084ab4979dcc1894bf04e37df 100644
--- a/ak-common/src/main/java/com/ak/common/annotation/RepeatSubmit.java
+++ b/opl-common/src/main/java/com/opl/framework/common/annotation/RepeatSubmit.java
@@ -1,11 +1,16 @@
-package com.ak.common.annotation;
+package com.opl.framework.common.annotation;
-import java.lang.annotation.*;
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
/**
* 自定义注解防止表单重复提交
*
- * @author Vean
+ * @author kingrom
*/
@Inherited
@Target(ElementType.METHOD)
diff --git a/ak-common/src/main/java/com/ak/common/config/Global.java b/opl-common/src/main/java/com/opl/framework/common/config/Global.java
similarity index 56%
rename from ak-common/src/main/java/com/ak/common/config/Global.java
rename to opl-common/src/main/java/com/opl/framework/common/config/Global.java
index 6cc55d21eb85beaefab84434cc1c53067f7b4ce6..9503bf8dc14cdafede359bb4880d7ee10ccddb39 100644
--- a/ak-common/src/main/java/com/ak/common/config/Global.java
+++ b/opl-common/src/main/java/com/opl/framework/common/config/Global.java
@@ -1,19 +1,21 @@
-package com.ak.common.config;
-
-import com.ak.common.utils.StringUtils;
-import com.ak.common.utils.YamlUtil;
-import lombok.extern.log4j.Log4j2;
+package com.opl.framework.common.config;
import java.io.FileNotFoundException;
-import java.util.HashMap;
import java.util.Map;
+import com.google.common.collect.Maps;
+import com.opl.framework.common.utils.StringUtils;
+import com.opl.framework.common.utils.YamlUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
/**
- * 全局配置类
+ * 全局配置类
*
- * @author Vean
+ * @author kingrom
*/
-@Log4j2
+
+@Slf4j
public class Global {
private static String NAME = "application.yml";
@@ -21,20 +23,20 @@ public class Global {
public static final String DEFAULT_TENANT_CODE = "000000";
/**
- * 当前对象实例
+ * 当前对象实例
*/
private static Global global;
/**
- * 保存全局属性值
+ * 保存全局属性值
*/
- private static Map map = new HashMap();
+ private static Map map = Maps.newHashMap();
private Global() {
}
/**
- * 静态工厂方法
+ * 静态工厂方法
*/
public static synchronized Global getInstance() {
if (global == null) {
@@ -44,7 +46,7 @@ public class Global {
}
/**
- * 获取配置
+ * 获取配置
*/
public static String getConfig(String key) {
String value = map.get(key);
@@ -62,63 +64,77 @@ public class Global {
}
/**
- * 获取项目名称
+ * 获取项目名称
*/
public static String getName() {
- return StringUtils.nvl(getConfig("ak.name"), "ak");
+ return StringUtils.nvl(getConfig("opl.name"), "opl-server");
}
/**
- * 获取项目版本
+ * 获取项目版本
*/
public static String getVersion() {
- return StringUtils.nvl(getConfig("ak.version"), "2.0.0");
+ return StringUtils.nvl(getConfig("opl.version"), "1.0.0");
}
/**
- * 获取版权年份
+ * 获取版权年份
*/
public static String getCopyrightYear() {
- return StringUtils.nvl(getConfig("ak.copyrightYear"), "2019");
+ return StringUtils.nvl(getConfig("opl.copyrightYear"), "2019");
}
-
+
/**
- * 实例演示开关
+ * 实例演示开关
*/
public static String isDemoEnabled() {
- return StringUtils.nvl(getConfig("ak.demoEnabled"), "true");
+ return StringUtils.nvl(getConfig("opl.demoEnabled"), "true");
}
/**
- * 获取ip地址开关
+ * 获取ip地址开关
*/
public static Boolean isAddressEnabled() {
- return Boolean.valueOf(getConfig("ak.addressEnabled"));
+ return Boolean.valueOf(getConfig("opl.addressEnabled"));
+ }
+
+ /**
+ * 获取订单接口
+ */
+ public static String getSearchOrder() {
+ return getConfig("opl.searchOrder");
+ }
+
+ /**
+ * 获取还款接口
+ */
+ public static String getSearchRepayment() {
+ return getConfig("opl.searchRepayment");
}
/**
- * 获取文件上传路径
+ * 获取文件上传路径
*/
public static String getProfile() {
- return getConfig("ak.profile");
+ return getConfig("opl.profile");
}
/**
- * 获取头像上传路径
+ * 获取头像上传路径
*/
public static String getAvatarPath() {
return getProfile() + "/avatar";
}
/**
- * 获取下载路径
+ * 获取下载路径
*/
public static String getDownloadPath() {
return getProfile() + "/download/";
}
/**
- * 获取上传路径
+ * 获取上传路径
*/
public static String getUploadPath() {
return getProfile() + "/upload";
diff --git a/ak-common/src/main/java/com/ak/common/config/ServerConfig.java b/opl-common/src/main/java/com/opl/framework/common/config/ServerConfig.java
similarity index 87%
rename from ak-common/src/main/java/com/ak/common/config/ServerConfig.java
rename to opl-common/src/main/java/com/opl/framework/common/config/ServerConfig.java
index 571c57f463f513c6d84c4d2e86acaecb0ae05aed..da2bbfeb07facc46b3e41e91e8b78800ebe41763 100644
--- a/ak-common/src/main/java/com/ak/common/config/ServerConfig.java
+++ b/opl-common/src/main/java/com/opl/framework/common/config/ServerConfig.java
@@ -1,14 +1,15 @@
-package com.ak.common.config;
+package com.opl.framework.common.config;
+
+import javax.servlet.http.HttpServletRequest;
-import com.ak.common.utils.ServletUtils;
import org.springframework.stereotype.Component;
-import javax.servlet.http.HttpServletRequest;
+import com.opl.framework.common.utils.ServletUtils;
/**
* 服务相关配置
*
- * @author Vean
+ * @author kingrom
*/
@Component
public class ServerConfig {
diff --git a/ak-common/src/main/java/com/ak/common/config/thread/ThreadPoolConfig.java b/opl-common/src/main/java/com/opl/framework/common/config/thread/ThreadPoolConfig.java
similarity index 94%
rename from ak-common/src/main/java/com/ak/common/config/thread/ThreadPoolConfig.java
rename to opl-common/src/main/java/com/opl/framework/common/config/thread/ThreadPoolConfig.java
index f2797b57d869fb0484e74f9c8a925f90754a711c..0be67abe1f9de468f683f362302709fb0d2886cc 100644
--- a/ak-common/src/main/java/com/ak/common/config/thread/ThreadPoolConfig.java
+++ b/opl-common/src/main/java/com/opl/framework/common/config/thread/ThreadPoolConfig.java
@@ -1,19 +1,20 @@
-package com.ak.common.config.thread;
+package com.opl.framework.common.config.thread;
+
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadPoolExecutor;
-import com.ak.common.utils.Threads;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
+import com.opl.framework.common.utils.Threads;
/**
* 线程池配置
*
- * @author Vean
+ * @author kingrom
**/
@Configuration
public class ThreadPoolConfig {
diff --git a/ak-common/src/main/java/com/ak/common/constant/Constants.java b/opl-common/src/main/java/com/opl/framework/common/constant/Constants.java
similarity index 95%
rename from ak-common/src/main/java/com/ak/common/constant/Constants.java
rename to opl-common/src/main/java/com/opl/framework/common/constant/Constants.java
index e9cbf9d6ad02951f030e8594ba09e2f65f198f55..a888fbb13eca3b8853a6025437967dff3017921d 100644
--- a/ak-common/src/main/java/com/ak/common/constant/Constants.java
+++ b/opl-common/src/main/java/com/opl/framework/common/constant/Constants.java
@@ -1,9 +1,9 @@
-package com.ak.common.constant;
+package com.opl.framework.common.constant;
/**
* 通用常量信息
*
- * @author Vean
+ * @author kingrom
*/
public class Constants {
/**
diff --git a/ak-common/src/main/java/com/ak/common/constant/PermissionConstants.java b/opl-common/src/main/java/com/opl/framework/common/constant/PermissionConstants.java
similarity index 91%
rename from ak-common/src/main/java/com/ak/common/constant/PermissionConstants.java
rename to opl-common/src/main/java/com/opl/framework/common/constant/PermissionConstants.java
index 01746b3d8f06c4934dcf631f2960398d2b5265f1..456feba6b357d2b3f297cf87a2772ffb2ac4f433 100644
--- a/ak-common/src/main/java/com/ak/common/constant/PermissionConstants.java
+++ b/opl-common/src/main/java/com/opl/framework/common/constant/PermissionConstants.java
@@ -1,9 +1,9 @@
-package com.ak.common.constant;
+package com.opl.framework.common.constant;
/**
* 权限通用常量
*
- * @author Vean
+ * @author kingrom
*/
public class PermissionConstants {
/**
diff --git a/ak-common/src/main/java/com/ak/common/constant/ScheduleConstants.java b/opl-common/src/main/java/com/opl/framework/common/constant/ScheduleConstants.java
similarity index 94%
rename from ak-common/src/main/java/com/ak/common/constant/ScheduleConstants.java
rename to opl-common/src/main/java/com/opl/framework/common/constant/ScheduleConstants.java
index a8065cbfa587045b9ca0792ded7baa38e30b9258..464aeae8e7d2afb3a2816681a8e3da180fd9c5e8 100644
--- a/ak-common/src/main/java/com/ak/common/constant/ScheduleConstants.java
+++ b/opl-common/src/main/java/com/opl/framework/common/constant/ScheduleConstants.java
@@ -1,9 +1,9 @@
-package com.ak.common.constant;
+package com.opl.framework.common.constant;
/**
* 任务调度通用常量
*
- * @author Vean
+ * @author kingrom
*/
public interface ScheduleConstants {
public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
diff --git a/ak-common/src/main/java/com/ak/common/constant/ShiroConstants.java b/opl-common/src/main/java/com/opl/framework/common/constant/ShiroConstants.java
similarity index 95%
rename from ak-common/src/main/java/com/ak/common/constant/ShiroConstants.java
rename to opl-common/src/main/java/com/opl/framework/common/constant/ShiroConstants.java
index 82aaa1a96b5a8a7cdcebdd85445704b26ba2110a..5b5d2fba3c888c5e645a91fbe09e3dc03324e4e8 100644
--- a/ak-common/src/main/java/com/ak/common/constant/ShiroConstants.java
+++ b/opl-common/src/main/java/com/opl/framework/common/constant/ShiroConstants.java
@@ -1,9 +1,9 @@
-package com.ak.common.constant;
+package com.opl.framework.common.constant;
/**
* Shiro通用常量
*
- * @author Vean
+ * @author kingrom
*/
public interface ShiroConstants {
/**
diff --git a/ak-common/src/main/java/com/ak/common/constant/UserConstants.java b/opl-common/src/main/java/com/opl/framework/common/constant/UserConstants.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/constant/UserConstants.java
rename to opl-common/src/main/java/com/opl/framework/common/constant/UserConstants.java
index ea74b08c852656e6f0d78b84df53f48a8bb73ba1..03face02fff50fa9329628287c820a1513346cbc 100644
--- a/ak-common/src/main/java/com/ak/common/constant/UserConstants.java
+++ b/opl-common/src/main/java/com/opl/framework/common/constant/UserConstants.java
@@ -1,9 +1,9 @@
-package com.ak.common.constant;
+package com.opl.framework.common.constant;
/**
* 用户常量信息
*
- * @author Vean
+ * @author kingrom
*/
public class UserConstants {
/**
diff --git a/ak-common/src/main/java/com/ak/common/core/controller/BaseController.java b/opl-common/src/main/java/com/opl/framework/common/core/controller/BaseController.java
similarity index 67%
rename from ak-common/src/main/java/com/ak/common/core/controller/BaseController.java
rename to opl-common/src/main/java/com/opl/framework/common/core/controller/BaseController.java
index e59c044ea57b86e17e5ada8564af9855f59f6b89..67ea1360fc0ed3887e3c61a2301e056d3d48b328 100644
--- a/ak-common/src/main/java/com/ak/common/core/controller/BaseController.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/controller/BaseController.java
@@ -1,32 +1,35 @@
-package com.ak.common.core.controller;
-
-import com.ak.common.core.domain.AjaxResult;
-import com.ak.common.core.domain.AjaxResult.Type;
-import com.ak.common.core.page.PageDomain;
-import com.ak.common.core.page.TableDataInfo;
-import com.ak.common.core.page.TableSupport;
-import com.ak.common.utils.DateUtils;
-import com.ak.common.utils.ServletUtils;
-import com.ak.common.utils.StringUtils;
-import com.ak.common.utils.sql.SqlUtil;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
+package com.opl.framework.common.core.controller;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.google.common.collect.Maps;
+import com.opl.framework.common.core.domain.AjaxResult;
+import com.opl.framework.common.core.domain.AjaxResult.Type;
+import com.opl.framework.common.core.page.PageDomain;
+import com.opl.framework.common.core.page.TableDataInfo;
+import com.opl.framework.common.core.page.TableSupport;
+import com.opl.framework.common.utils.DateUtils;
+import com.opl.framework.common.utils.ServletUtils;
+import com.opl.framework.common.utils.StringUtils;
+import com.opl.framework.common.utils.sql.SqlUtil;
/**
* web层通用数据处理
*
- * @author Vean
+ * @author kingrom
*/
public class BaseController {
@@ -56,6 +59,25 @@ public class BaseController {
PageHelper.startPage(pageNum, pageSize, orderBy);
}
}
+
+ /**
+ * 设置请求分页数据
+ * @Param
+ */
+ protected Map startPageParam() {
+ Map map = Maps.newHashMapWithExpectedSize(3);
+ PageDomain pageDomain = TableSupport.buildPageRequest();
+ Integer pageNum = pageDomain.getPageNum();
+ Integer pageSize = pageDomain.getPageSize();
+ if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
+ Map sortMap= pageDomain.getOrderByMap();
+ PageHelper.startPage(pageNum, pageSize);
+ map.putAll(sortMap);
+ }
+ map.put("pageNum", pageNum);
+ map.put("pageSize", pageSize);
+ return map;
+ }
/**
* 获取request
@@ -87,6 +109,17 @@ public class BaseController {
rspData.setCode(0);
rspData.setRows(list);
rspData.setTotal(new PageInfo(list).getTotal());
+
+ return rspData;
+ }
+ /**
+ * 响应请求分页数据
+ */
+ protected TableDataInfo getDataTable(Page> list,Integer total) {
+ TableDataInfo rspData = new TableDataInfo();
+ rspData.setCode(0);
+ rspData.setRows(list);
+ rspData.setTotal(total);
return rspData;
}
diff --git a/ak-common/src/main/java/com/ak/common/core/domain/AjaxResult.java b/opl-common/src/main/java/com/opl/framework/common/core/domain/AjaxResult.java
similarity index 96%
rename from ak-common/src/main/java/com/ak/common/core/domain/AjaxResult.java
rename to opl-common/src/main/java/com/opl/framework/common/core/domain/AjaxResult.java
index b6a9a7d59d6fb745dfd958d5ce7a5b01a0dbcd68..bd9154668e5ac02671c3459ef0c59538f5e73b29 100644
--- a/ak-common/src/main/java/com/ak/common/core/domain/AjaxResult.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/domain/AjaxResult.java
@@ -1,13 +1,13 @@
-package com.ak.common.core.domain;
-
-import com.ak.common.utils.StringUtils;
+package com.opl.framework.common.core.domain;
import java.util.HashMap;
+import com.opl.framework.common.utils.StringUtils;
+
/**
* 操作消息提醒
*
- * @author Vean
+ * @author kingrom
*/
public class AjaxResult extends HashMap {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/core/domain/BaseEntity.java b/opl-common/src/main/java/com/opl/framework/common/core/domain/BaseEntity.java
similarity index 93%
rename from ak-common/src/main/java/com/ak/common/core/domain/BaseEntity.java
rename to opl-common/src/main/java/com/opl/framework/common/core/domain/BaseEntity.java
index 747fc18be295f93dfe690ea204890529e9b970b8..72983759fe0b36a9ccd0ee31d2a2f05f99d69b55 100644
--- a/ak-common/src/main/java/com/ak/common/core/domain/BaseEntity.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/domain/BaseEntity.java
@@ -1,18 +1,19 @@
-package com.ak.common.core.domain;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Getter;
-import lombok.Setter;
+package com.opl.framework.common.core.domain;
import java.io.Serializable;
import java.util.Date;
-import java.util.HashMap;
import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.google.common.collect.Maps;
+
+import lombok.Getter;
+import lombok.Setter;
+
/**
* Entity基类
*
- * @author Vean
+ * @author kingrom
*/
public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@@ -111,7 +112,7 @@ public class BaseEntity implements Serializable {
public Map getParams() {
if (params == null) {
- params = new HashMap<>();
+ params = Maps.newHashMap();
}
return params;
}
diff --git a/ak-common/src/main/java/com/ak/common/core/domain/TreeEntity.java b/opl-common/src/main/java/com/opl/framework/common/core/domain/TreeEntity.java
similarity index 93%
rename from ak-common/src/main/java/com/ak/common/core/domain/TreeEntity.java
rename to opl-common/src/main/java/com/opl/framework/common/core/domain/TreeEntity.java
index 0b4718858e40e628ebb9034fde3a5439889953c1..928e1b25b45f8b4a3b17cd849edb40ef19537183 100644
--- a/ak-common/src/main/java/com/ak/common/core/domain/TreeEntity.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/domain/TreeEntity.java
@@ -1,4 +1,4 @@
-package com.ak.common.core.domain;
+package com.opl.framework.common.core.domain;
import lombok.Getter;
import lombok.Setter;
@@ -6,7 +6,7 @@ import lombok.Setter;
/**
* Tree基类
*
- * @author Vean
+ * @author kingrom
*/
public class TreeEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/core/domain/Ztree.java b/opl-common/src/main/java/com/opl/framework/common/core/domain/Ztree.java
similarity index 92%
rename from ak-common/src/main/java/com/ak/common/core/domain/Ztree.java
rename to opl-common/src/main/java/com/opl/framework/common/core/domain/Ztree.java
index 92256f03d63763207527fb6b84b17e6aca5604bb..12a39df67b3c3fc47a562c8ec533af75f8c5ddef 100644
--- a/ak-common/src/main/java/com/ak/common/core/domain/Ztree.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/domain/Ztree.java
@@ -1,13 +1,14 @@
-package com.ak.common.core.domain;
+package com.opl.framework.common.core.domain;
import java.io.Serializable;
-import java.util.HashMap;
import java.util.Map;
+import com.google.common.collect.Maps;
+
/**
* Ztree树结构实体类
*
- * @author Vean
+ * @author kingrom
*/
public class Ztree implements Serializable {
private static final long serialVersionUID = 1L;
@@ -110,7 +111,7 @@ public class Ztree implements Serializable {
public Map getParams() {
if (params == null) {
- params = new HashMap();
+ params = Maps.newHashMap();
}
return params;
}
diff --git a/ak-common/src/main/java/com/ak/common/core/mapper/BaseMapper.java b/opl-common/src/main/java/com/opl/framework/common/core/mapper/BaseMapper.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/core/mapper/BaseMapper.java
rename to opl-common/src/main/java/com/opl/framework/common/core/mapper/BaseMapper.java
index 271e9b2a2c6eaf4a838ef370816bde4f870a51e9..76629ae9e5a11817861c88e4ed513ab6f060dffe 100644
--- a/ak-common/src/main/java/com/ak/common/core/mapper/BaseMapper.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/mapper/BaseMapper.java
@@ -1,9 +1,9 @@
-package com.ak.common.core.mapper;
-
-import org.apache.ibatis.annotations.Param;
+package com.opl.framework.common.core.mapper;
import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
/**
* DAO支持类实现
*
diff --git a/ak-common/src/main/java/com/ak/common/core/page/PageDomain.java b/opl-common/src/main/java/com/opl/framework/common/core/page/PageDomain.java
similarity index 70%
rename from ak-common/src/main/java/com/ak/common/core/page/PageDomain.java
rename to opl-common/src/main/java/com/opl/framework/common/core/page/PageDomain.java
index 57c7cf16514a183a4db8b0a3ba64c22b1f776cdc..f5eada655e9555554984085211e09a81b2a8d63d 100644
--- a/ak-common/src/main/java/com/ak/common/core/page/PageDomain.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/page/PageDomain.java
@@ -1,11 +1,14 @@
-package com.ak.common.core.page;
+package com.opl.framework.common.core.page;
-import com.ak.common.utils.StringUtils;
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+import com.opl.framework.common.utils.StringUtils;
/**
* 分页数据
*
- * @author Vean
+ * @author kingrom
*/
public class PageDomain {
/**
@@ -31,6 +34,16 @@ public class PageDomain {
}
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
}
+
+ public Map getOrderByMap() {
+ Map map = Maps.newHashMapWithExpectedSize(2);
+ if (StringUtils.isEmpty(orderByColumn)) {
+ return null;
+ }
+ map.put("sortField", orderByColumn);
+ map.put("sortby", isAsc);
+ return map;
+ }
public Integer getPageNum() {
return pageNum;
diff --git a/ak-common/src/main/java/com/ak/common/core/page/TableDataInfo.java b/opl-common/src/main/java/com/opl/framework/common/core/page/TableDataInfo.java
similarity index 95%
rename from ak-common/src/main/java/com/ak/common/core/page/TableDataInfo.java
rename to opl-common/src/main/java/com/opl/framework/common/core/page/TableDataInfo.java
index 5c4fb97f71d137a74728bac876484b37bd0997cf..a721bebff3432283445ecc518a75938d58ea577a 100644
--- a/ak-common/src/main/java/com/ak/common/core/page/TableDataInfo.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/page/TableDataInfo.java
@@ -1,4 +1,4 @@
-package com.ak.common.core.page;
+package com.opl.framework.common.core.page;
import java.io.Serializable;
import java.util.List;
@@ -6,7 +6,7 @@ import java.util.List;
/**
* 表格分页数据对象
*
- * @author Vean
+ * @author kingrom
*/
public class TableDataInfo implements Serializable {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/core/page/TableSupport.java b/opl-common/src/main/java/com/opl/framework/common/core/page/TableSupport.java
similarity index 79%
rename from ak-common/src/main/java/com/ak/common/core/page/TableSupport.java
rename to opl-common/src/main/java/com/opl/framework/common/core/page/TableSupport.java
index b5be64ac99545857f61f40457c5be5e771c3bdde..1cbfa72b0ec50d0c04dcea4f95373b6754f17c03 100644
--- a/ak-common/src/main/java/com/ak/common/core/page/TableSupport.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/page/TableSupport.java
@@ -1,12 +1,12 @@
-package com.ak.common.core.page;
+package com.opl.framework.common.core.page;
-import com.ak.common.constant.Constants;
-import com.ak.common.utils.ServletUtils;
+import com.opl.framework.common.constant.Constants;
+import com.opl.framework.common.utils.ServletUtils;
/**
* 表格数据处理
*
- * @author Vean
+ * @author kingrom
*/
public class TableSupport {
/**
diff --git a/ak-common/src/main/java/com/ak/common/core/service/BaseService.java b/opl-common/src/main/java/com/opl/framework/common/core/service/BaseService.java
similarity index 84%
rename from ak-common/src/main/java/com/ak/common/core/service/BaseService.java
rename to opl-common/src/main/java/com/opl/framework/common/core/service/BaseService.java
index 322e7a20524b6a80de225e7b284415df2580daa4..d025cc2587a1625316d99e41ed2e22a54d09c1cb 100644
--- a/ak-common/src/main/java/com/ak/common/core/service/BaseService.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/service/BaseService.java
@@ -1,16 +1,17 @@
-package com.ak.common.core.service;
+package com.opl.framework.common.core.service;
+
+import java.util.List;
-import com.ak.common.core.domain.BaseEntity;
-import com.ak.common.core.mapper.BaseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
-import java.util.List;
+import com.opl.framework.common.core.domain.BaseEntity;
+import com.opl.framework.common.core.mapper.BaseMapper;
/**
* Service基类
*
- * @author Vean
+ * @author kingrom
* @version 2014-05-16
*/
public abstract class BaseService, T extends BaseEntity> {
diff --git a/ak-common/src/main/java/com/ak/common/core/text/CharsetKit.java b/opl-common/src/main/java/com/opl/framework/common/core/text/CharsetKit.java
similarity index 95%
rename from ak-common/src/main/java/com/ak/common/core/text/CharsetKit.java
rename to opl-common/src/main/java/com/opl/framework/common/core/text/CharsetKit.java
index 6d00a34614703333562c8f0198287b486e737369..8cca8f3ab7ed80adb4784fdd5d9364c686fa7fe2 100644
--- a/ak-common/src/main/java/com/ak/common/core/text/CharsetKit.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/text/CharsetKit.java
@@ -1,14 +1,14 @@
-package com.ak.common.core.text;
-
-import com.ak.common.utils.StringUtils;
+package com.opl.framework.common.core.text;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
+import com.opl.framework.common.utils.StringUtils;
+
/**
* 字符集工具类
*
- * @author Vean
+ * @author kingrom
*/
public class CharsetKit {
/**
diff --git a/ak-common/src/main/java/com/ak/common/core/text/Convert.java b/opl-common/src/main/java/com/opl/framework/common/core/text/Convert.java
similarity index 99%
rename from ak-common/src/main/java/com/ak/common/core/text/Convert.java
rename to opl-common/src/main/java/com/opl/framework/common/core/text/Convert.java
index b9151ab4cce551593efa1466b4b3f0a98c3208c0..0f26c14651abf346a2b162f0ab9dab851f972059 100644
--- a/ak-common/src/main/java/com/ak/common/core/text/Convert.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/text/Convert.java
@@ -1,6 +1,4 @@
-package com.ak.common.core.text;
-
-import com.ak.common.utils.StringUtils;
+package com.opl.framework.common.core.text;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -9,10 +7,12 @@ import java.nio.charset.Charset;
import java.text.NumberFormat;
import java.util.Set;
+import com.opl.framework.common.utils.StringUtils;
+
/**
* 类型转换器
*
- * @author Vean
+ * @author kingrom
*/
public class Convert {
/**
diff --git a/ak-common/src/main/java/com/ak/common/core/text/StrFormatter.java b/opl-common/src/main/java/com/opl/framework/common/core/text/StrFormatter.java
similarity index 96%
rename from ak-common/src/main/java/com/ak/common/core/text/StrFormatter.java
rename to opl-common/src/main/java/com/opl/framework/common/core/text/StrFormatter.java
index 43b9124df24867c8a93a051fe922ad389be22f14..c31e36eeaaa9a6ce0cd2458a6c57e696e483cb21 100644
--- a/ak-common/src/main/java/com/ak/common/core/text/StrFormatter.java
+++ b/opl-common/src/main/java/com/opl/framework/common/core/text/StrFormatter.java
@@ -1,11 +1,11 @@
-package com.ak.common.core.text;
+package com.opl.framework.common.core.text;
-import com.ak.common.utils.StringUtils;
+import com.opl.framework.common.utils.StringUtils;
/**
* 字符串格式化
*
- * @author Vean
+ * @author kingrom
*/
public class StrFormatter {
public static final String EMPTY_JSON = "{}";
diff --git a/ak-common/src/main/java/com/ak/common/enums/BusinessStatus.java b/opl-common/src/main/java/com/opl/framework/common/enums/BusinessStatus.java
similarity index 70%
rename from ak-common/src/main/java/com/ak/common/enums/BusinessStatus.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/BusinessStatus.java
index 2702d47f3ec3ab5d526b87d7d835a54db93e74b0..b2e08b6bbb36bb93beb8dbe1d91ebb93a2b3f6e6 100644
--- a/ak-common/src/main/java/com/ak/common/enums/BusinessStatus.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/BusinessStatus.java
@@ -1,9 +1,9 @@
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 操作状态
*
- * @author Vean
+ * @author kingrom
*/
public enum BusinessStatus {
/**
diff --git a/ak-common/src/main/java/com/ak/common/enums/BusinessType.java b/opl-common/src/main/java/com/opl/framework/common/enums/BusinessType.java
similarity index 89%
rename from ak-common/src/main/java/com/ak/common/enums/BusinessType.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/BusinessType.java
index 59372c4c56df5bc9c4a21aee486d89b8aa9dd54a..66c2092affa1ac6f6f2a99005b44f89a02fc8f58 100644
--- a/ak-common/src/main/java/com/ak/common/enums/BusinessType.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/BusinessType.java
@@ -1,9 +1,9 @@
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 业务操作类型
*
- * @author Vean
+ * @author kingrom
*/
public enum BusinessType {
/**
diff --git a/ak-common/src/main/java/com/ak/common/enums/OnlineStatus.java b/opl-common/src/main/java/com/opl/framework/common/enums/OnlineStatus.java
similarity index 83%
rename from ak-common/src/main/java/com/ak/common/enums/OnlineStatus.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/OnlineStatus.java
index d0e3192c4c43c06d3e9b9493e84879807a000fcf..2601efeff0aaecf179824fe3e5ed1d42be3753bb 100644
--- a/ak-common/src/main/java/com/ak/common/enums/OnlineStatus.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/OnlineStatus.java
@@ -1,9 +1,9 @@
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 用户会话
*
- * @author Vean
+ * @author kingrom
*/
public enum OnlineStatus {
/**
diff --git a/ak-common/src/main/java/com/ak/common/enums/OperatorType.java b/opl-common/src/main/java/com/opl/framework/common/enums/OperatorType.java
similarity index 77%
rename from ak-common/src/main/java/com/ak/common/enums/OperatorType.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/OperatorType.java
index 5c2696b348c54faf6004030179d3754fdd6de5f6..ea96f82723009a880067dc362fa31aa298ce5c17 100644
--- a/ak-common/src/main/java/com/ak/common/enums/OperatorType.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/OperatorType.java
@@ -1,9 +1,9 @@
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 操作人类别
*
- * @author Vean
+ * @author kingrom
*/
public enum OperatorType {
/**
diff --git a/ak-common/src/main/java/com/ak/common/enums/RandomType.java b/opl-common/src/main/java/com/opl/framework/common/enums/RandomType.java
similarity index 92%
rename from ak-common/src/main/java/com/ak/common/enums/RandomType.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/RandomType.java
index 240c501bb35666e1bdeaae9178cab73af4fdd4cb..c473cf7ad49450fea7284e8a4a804605318ffc35 100644
--- a/ak-common/src/main/java/com/ak/common/enums/RandomType.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/RandomType.java
@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 生成的随机数类型
*
- * @author Vean
+ * @author kingrom
*/
public enum RandomType {
/**
diff --git a/ak-common/src/main/java/com/ak/common/enums/TenantApplication.java b/opl-common/src/main/java/com/opl/framework/common/enums/TenantApplication.java
similarity index 85%
rename from ak-common/src/main/java/com/ak/common/enums/TenantApplication.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/TenantApplication.java
index 9887795b713a181706e654a6555920a8cb2b994e..58cb51dc80b973d66422443c9da9624dfe1903ae 100644
--- a/ak-common/src/main/java/com/ak/common/enums/TenantApplication.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/TenantApplication.java
@@ -1,11 +1,11 @@
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 子系统枚举类
* 开发子系统之前,先在此文件中定义好子系统编码,
* 子系统管理中的系统编码从这里读取过去的
*
- * @author Vean
+ * @author kingrom
* @date 2019-08-01
*/
public enum TenantApplication {
@@ -19,7 +19,9 @@ public enum TenantApplication {
/**
* ===== 以下是租户可使用的子系统 =====
**/
-
+ TENANT_OPERAT_APPCODE("TanantOperat", "运营平台子系统"),
+ TENANT_CONFIG_APPCODE("TenantConfig", "运营配置子系统"),
+
TENANT_BASEDATE_APPCODE("TenantBasedate", "基础数据子系统"),
TENANT_MESSAGE_APPCODE("TenantMessage", "消息中心子系统"),
TENANT_LOG_APPCODE("TenantLog", "日志查询子系统"),
diff --git a/ak-common/src/main/java/com/ak/common/enums/UserStatus.java b/opl-common/src/main/java/com/opl/framework/common/enums/UserStatus.java
similarity index 87%
rename from ak-common/src/main/java/com/ak/common/enums/UserStatus.java
rename to opl-common/src/main/java/com/opl/framework/common/enums/UserStatus.java
index bb3365352e4793bf64820c6cce3212dce48984a4..5b2de0c828e39f2ac1c69cdf285d7b36cea41d70 100644
--- a/ak-common/src/main/java/com/ak/common/enums/UserStatus.java
+++ b/opl-common/src/main/java/com/opl/framework/common/enums/UserStatus.java
@@ -1,9 +1,9 @@
-package com.ak.common.enums;
+package com.opl.framework.common.enums;
/**
* 用户状态
*
- * @author Vean
+ * @author kingrom
*/
public enum UserStatus {
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
diff --git a/ak-common/src/main/java/com/ak/common/exception/BusinessException.java b/opl-common/src/main/java/com/opl/framework/common/exception/BusinessException.java
similarity index 88%
rename from ak-common/src/main/java/com/ak/common/exception/BusinessException.java
rename to opl-common/src/main/java/com/opl/framework/common/exception/BusinessException.java
index 693087faf2c95745f792ae706d1dd712aa07a27a..a72ac7cf6c34b9c56ff5f14d3447942093afa166 100644
--- a/ak-common/src/main/java/com/ak/common/exception/BusinessException.java
+++ b/opl-common/src/main/java/com/opl/framework/common/exception/BusinessException.java
@@ -1,9 +1,9 @@
-package com.ak.common.exception;
+package com.opl.framework.common.exception;
/**
* 业务异常
*
- * @author Vean
+ * @author kingrom
*/
public class BusinessException extends RuntimeException {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/exception/base/BaseException.java b/opl-common/src/main/java/com/opl/framework/common/exception/base/BaseException.java
similarity index 90%
rename from ak-common/src/main/java/com/ak/common/exception/base/BaseException.java
rename to opl-common/src/main/java/com/opl/framework/common/exception/base/BaseException.java
index b7735bbcc8405ff5462a4b13e556499bf188e2ff..e57731286c5be4ade7e84cb308f481c1322114f8 100644
--- a/ak-common/src/main/java/com/ak/common/exception/base/BaseException.java
+++ b/opl-common/src/main/java/com/opl/framework/common/exception/base/BaseException.java
@@ -1,12 +1,12 @@
-package com.ak.common.exception.base;
+package com.opl.framework.common.exception.base;
-import com.ak.common.utils.MessageUtils;
-import com.ak.common.utils.StringUtils;
+import com.opl.framework.common.utils.MessageUtils;
+import com.opl.framework.common.utils.StringUtils;
/**
* 基础异常
*
- * @author Vean
+ * @author kingrom
*/
public class BaseException extends RuntimeException {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/exception/file/FileException.java b/opl-common/src/main/java/com/opl/framework/common/exception/file/FileException.java
similarity index 65%
rename from ak-common/src/main/java/com/ak/common/exception/file/FileException.java
rename to opl-common/src/main/java/com/opl/framework/common/exception/file/FileException.java
index 0afc6bb4e52862f028589d5e9e0fcfc4951bec3f..9ea8c02cb3dac1db1d37addaed9f4fd188d210e6 100644
--- a/ak-common/src/main/java/com/ak/common/exception/file/FileException.java
+++ b/opl-common/src/main/java/com/opl/framework/common/exception/file/FileException.java
@@ -1,11 +1,11 @@
-package com.ak.common.exception.file;
+package com.opl.framework.common.exception.file;
-import com.ak.common.exception.base.BaseException;
+import com.opl.framework.common.exception.base.BaseException;
/**
* 文件信息异常类
*
- * @author Vean
+ * @author kingrom
*/
public class FileException extends BaseException {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/exception/file/InvalidExtensionException.java b/opl-common/src/main/java/com/opl/framework/common/exception/file/InvalidExtensionException.java
similarity index 96%
rename from ak-common/src/main/java/com/ak/common/exception/file/InvalidExtensionException.java
rename to opl-common/src/main/java/com/opl/framework/common/exception/file/InvalidExtensionException.java
index 698f470d02d659d9b62e0fdabcb9e40c2ae91813..7c80de195b9e3149dcb66b11cac7864eae2b9468 100644
--- a/ak-common/src/main/java/com/ak/common/exception/file/InvalidExtensionException.java
+++ b/opl-common/src/main/java/com/opl/framework/common/exception/file/InvalidExtensionException.java
@@ -1,13 +1,13 @@
-package com.ak.common.exception.file;
-
-import org.apache.commons.fileupload.FileUploadException;
+package com.opl.framework.common.exception.file;
import java.util.Arrays;
+import org.apache.commons.fileupload.FileUploadException;
+
/**
* 文件上传 误异常类
*
- * @author Vean
+ * @author kingrom
*/
public class InvalidExtensionException extends FileUploadException {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/exception/job/TaskException.java b/opl-common/src/main/java/com/opl/framework/common/exception/job/TaskException.java
similarity index 89%
rename from ak-common/src/main/java/com/ak/common/exception/job/TaskException.java
rename to opl-common/src/main/java/com/opl/framework/common/exception/job/TaskException.java
index e879042e4b914bdea9529c99307f4b6548063dad..d262ebc294fd26024d2cbecc5c4dd7a28cb0ef40 100644
--- a/ak-common/src/main/java/com/ak/common/exception/job/TaskException.java
+++ b/opl-common/src/main/java/com/opl/framework/common/exception/job/TaskException.java
@@ -1,9 +1,9 @@
-package com.ak.common.exception.job;
+package com.opl.framework.common.exception.job;
/**
* 计划策略异常
*
- * @author Vean
+ * @author kingrom
*/
public class TaskException extends Exception {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/exception/user/UserException.java b/opl-common/src/main/java/com/opl/framework/common/exception/user/UserException.java
similarity index 65%
rename from ak-common/src/main/java/com/ak/common/exception/user/UserException.java
rename to opl-common/src/main/java/com/opl/framework/common/exception/user/UserException.java
index f67c4404c429b4bfd4e48f17550e792ab6bb97fd..6e38ef8a1f9da9a51f7fee406d815947677df049 100644
--- a/ak-common/src/main/java/com/ak/common/exception/user/UserException.java
+++ b/opl-common/src/main/java/com/opl/framework/common/exception/user/UserException.java
@@ -1,11 +1,11 @@
-package com.ak.common.exception.user;
+package com.opl.framework.common.exception.user;
-import com.ak.common.exception.base.BaseException;
+import com.opl.framework.common.exception.base.BaseException;
/**
* 用户信息异常类
*
- * @author Vean
+ * @author kingrom
*/
public class UserException extends BaseException {
private static final long serialVersionUID = 1L;
diff --git a/ak-common/src/main/java/com/ak/common/json/JSON.java b/opl-common/src/main/java/com/opl/framework/common/json/JSON.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/json/JSON.java
rename to opl-common/src/main/java/com/opl/framework/common/json/JSON.java
index 7d7b6db6ed97fa58318570af38f08ee25fe39f15..27846b386be98e7a1a9744589a6601f3fda08d48 100644
--- a/ak-common/src/main/java/com/ak/common/json/JSON.java
+++ b/opl-common/src/main/java/com/opl/framework/common/json/JSON.java
@@ -1,4 +1,9 @@
-package com.ak.common.json;
+package com.opl.framework.common.json;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
@@ -6,15 +11,10 @@ import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
/**
* JSON解析处理
*
- * @author Vean
+ * @author kingrom
*/
public class JSON {
public static final String DEFAULT_FAIL = "\"Parse failed\"";
diff --git a/ak-common/src/main/java/com/ak/common/json/JSONObject.java b/opl-common/src/main/java/com/opl/framework/common/json/JSONObject.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/json/JSONObject.java
rename to opl-common/src/main/java/com/opl/framework/common/json/JSONObject.java
index 62806262d7b19ce7a84d4abbb65124c73f5412e1..ff639b2e81c35cf315b9ac7f82f40afbcaf23f81 100644
--- a/ak-common/src/main/java/com/ak/common/json/JSONObject.java
+++ b/opl-common/src/main/java/com/opl/framework/common/json/JSONObject.java
@@ -1,16 +1,22 @@
-package com.ak.common.json;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.ak.common.utils.StringUtils;
-
-import java.util.*;
+package com.opl.framework.common.json;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Lists;
+import com.opl.framework.common.utils.StringUtils;
+
/**
* 通用消息对象,基于Map实现的可嵌套数据结构。 支持JSON数据结构。
*
- * @author Vean
+ * @author kingrom
*/
public class JSONObject extends LinkedHashMap {
private static final long serialVersionUID = 1L;
@@ -556,7 +562,7 @@ public class JSONObject extends LinkedHashMap {
* 最后数组回调。
*
* @param 回调返回数据类型。
- * @author Vean
+ * @author kingrom
*/
private interface EndArrayCallback {
/**
@@ -590,7 +596,7 @@ public class JSONObject extends LinkedHashMap {
private static int[] parseIndexes(final String s) {
int[] indexes = null;
- List list = new ArrayList();
+ List list = Lists.newArrayList();
final StringTokenizer st = new StringTokenizer(s, "[]");
while (st.hasMoreTokens()) {
diff --git a/ak-common/src/main/java/com/ak/common/utils/AddressUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/AddressUtils.java
similarity index 78%
rename from ak-common/src/main/java/com/ak/common/utils/AddressUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/AddressUtils.java
index ca9386a88ea703fa28d128715d412d4b0f9d926b..c6a47d38cdc8512111ee6bf06580277b2bec77fb 100644
--- a/ak-common/src/main/java/com/ak/common/utils/AddressUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/AddressUtils.java
@@ -1,18 +1,18 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
-import com.ak.common.config.Global;
-import com.ak.common.json.JSON;
-import com.ak.common.json.JSONObject;
-import com.ak.common.utils.http.HttpUtils;
+import com.opl.framework.common.config.Global;
+import com.opl.framework.common.json.JSON;
+import com.opl.framework.common.json.JSONObject;
+import com.opl.framework.common.utils.http.HttpUtils;
-import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
/**
* 获取地址类
*
- * @author Vean
+ * @author kingrom
*/
-@Log4j2
+@Slf4j
public class AddressUtils {
public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
diff --git a/ak-common/src/main/java/com/ak/common/utils/Arith.java b/opl-common/src/main/java/com/opl/framework/common/utils/Arith.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/utils/Arith.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/Arith.java
index b18d704f6edf25c044b88e05568bdba91a7aabc0..02a401c8b92325f9477648bf64264df4476e4d2e 100644
--- a/ak-common/src/main/java/com/ak/common/utils/Arith.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/Arith.java
@@ -1,4 +1,4 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
@@ -6,7 +6,7 @@ import java.math.RoundingMode;
/**
* 精确的浮点数运算
*
- * @author Vean
+ * @author kingrom
*/
public class Arith {
diff --git a/ak-common/src/main/java/com/ak/common/utils/CodeGenerateUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/CodeGenerateUtils.java
similarity index 81%
rename from ak-common/src/main/java/com/ak/common/utils/CodeGenerateUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/CodeGenerateUtils.java
index 2d5bb56ff30ae273c40f6d7b719d0851cbc03b09..1a35766c365bb55b61b774ceed20c66dcbfa6d57 100644
--- a/ak-common/src/main/java/com/ak/common/utils/CodeGenerateUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/CodeGenerateUtils.java
@@ -1,11 +1,11 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
-import com.ak.common.enums.RandomType;
+import com.opl.framework.common.enums.RandomType;
/**
* 编码规则生成器
*
- * @author Vean
+ * @author kingrom
*/
public class CodeGenerateUtils {
diff --git a/ak-common/src/main/java/com/ak/common/utils/DateUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/DateUtils.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/utils/DateUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/DateUtils.java
index 2da25a5d2d093fa43dee6d66e1a1796693cb5372..37fe7cde95b2edcac4f47ffacf6023ddf15a9ebe 100644
--- a/ak-common/src/main/java/com/ak/common/utils/DateUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/DateUtils.java
@@ -1,16 +1,16 @@
-package com.ak.common.utils;
-
-import org.apache.commons.lang3.time.DateFormatUtils;
+package com.opl.framework.common.utils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
+import org.apache.commons.lang3.time.DateFormatUtils;
+
/**
* 时间工具类
*
- * @author Vean
+ * @author kingrom
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static String YYYY = "yyyy";
diff --git a/ak-common/src/main/java/com/ak/common/utils/ExceptionUtil.java b/opl-common/src/main/java/com/opl/framework/common/utils/ExceptionUtil.java
similarity index 93%
rename from ak-common/src/main/java/com/ak/common/utils/ExceptionUtil.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/ExceptionUtil.java
index de36f1527b12be164a9bb23ae2a4c5f799bf664d..f4fb0cceb9570bbae93f6f7a4e107aa3309e12c2 100644
--- a/ak-common/src/main/java/com/ak/common/utils/ExceptionUtil.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/ExceptionUtil.java
@@ -1,14 +1,14 @@
-package com.ak.common.utils;
-
-import org.apache.commons.lang3.exception.ExceptionUtils;
+package com.opl.framework.common.utils;
import java.io.PrintWriter;
import java.io.StringWriter;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+
/**
* 错误信息处理类。
*
- * @author Vean
+ * @author kingrom
*/
public class ExceptionUtil {
/**
diff --git a/ak-common/src/main/java/com/ak/common/utils/IpUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/IpUtils.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/utils/IpUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/IpUtils.java
index 8eb576b99eb5083f35a6b66e934c8f252654625e..78a75115ed44bb4d52a9700e5363c409877627a1 100644
--- a/ak-common/src/main/java/com/ak/common/utils/IpUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/IpUtils.java
@@ -1,13 +1,14 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
-import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import javax.servlet.http.HttpServletRequest;
+
/**
* 获取IP方法
*
- * @author Vean
+ * @author kingrom
*/
public class IpUtils {
public static String getIpAddr(HttpServletRequest request) {
diff --git a/opl-common/src/main/java/com/opl/framework/common/utils/JsonUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/JsonUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..cc4a9100f3762e714890a32777ac78aa720486e4
--- /dev/null
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/JsonUtils.java
@@ -0,0 +1,150 @@
+package com.opl.framework.common.utils;
+
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.JSONLibDataFormatSerializer;
+import com.alibaba.fastjson.serializer.SerializeConfig;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.alibaba.fastjson.serializer.ValueFilter;
+
+public class JsonUtils {
+ private static final SerializeConfig config;
+
+ static {
+ config = new SerializeConfig();
+ config.put(java.util.Date.class, new JSONLibDataFormatSerializer()); // 使用和json-lib兼容的日期输出格式
+ config.put(java.sql.Date.class, new JSONLibDataFormatSerializer()); // 使用和json-lib兼容的日期输出格式
+ }
+
+ private static final SerializerFeature[] features = { SerializerFeature.WriteMapNullValue, // 输出空置字段
+ SerializerFeature.WriteNullListAsEmpty, // list字段如果为null,输出为[],而不是null
+ SerializerFeature.WriteNullNumberAsZero, // 数值字段如果为null,输出为0,而不是null
+ SerializerFeature.WriteNullBooleanAsFalse, // Boolean字段如果为null,输出为false,而不是null
+ SerializerFeature.WriteNullStringAsEmpty // 字符类型字段如果为null,输出为"",而不是null
+ };
+
+ /**
+ * 转换成字符串
+ *
+ * @param object
+ * @return
+ */
+ public static String toJSONString(Object object) {
+ return JSON.toJSONString(object, config);
+ }
+
+ /**
+ * 转换成字符串 ,带有过滤器
+ *
+ * @param object
+ * @return
+ */
+ public static String toJSONWithFeatures(Object object) {
+ return JSON.toJSONString(object, config, features);
+ }
+
+ /**
+ * 转成bean对象
+ *
+ * @param text
+ * @return
+ */
+ public static Object toBean(String text) {
+ return JSON.parse(text);
+ }
+
+ /**
+ * 转成具体的泛型bean对象
+ *
+ * @param text
+ * @param clazz
+ * @param
+ * @return
+ */
+ public static T toBean(String text, Class clazz) {
+ return JSON.parseObject(text, clazz);
+ }
+
+ /**
+ * 转换为具体的泛型数组Array
+ *
+ * @param text
+ * @param clazz
+ * @param
+ * @return
+ */
+ public static Object[] toArray(String text, Class clazz) {
+ return JSON.parseArray(text, clazz).toArray();
+ }
+
+ /**
+ * 转换为具体的泛型List
+ *
+ * @param text
+ * @param clazz
+ * @param
+ * @return
+ */
+ public static List toList(String text, Class clazz) {
+ return JSON.parseArray(text, clazz);
+ }
+
+ /**
+ * 将string转化为序列化的json字符串
+ *
+ * @param text
+ * @return
+ */
+ public static Object textToJson(String text) {
+ Object objectJson = JSON.parse(text);
+ return objectJson;
+ }
+
+ /**
+ * json字符串转化为map
+ *
+ * @param s
+ * @return
+ */
+ public static Map stringToMap(String s) {
+ return JSONObject.parseObject(s);
+ }
+
+ /**
+ * 将map转化为string
+ *
+ * @param m
+ * @return
+ */
+ public static String mapToString(Map m) {
+ String s = JSONObject.toJSONString(m);
+ return s;
+ }
+
+ /**
+ * 将bean转化为Map
+ *
+ * @param m
+ * @return
+ */
+ public static Map beanToMap(Object object) {
+ return (Map) JSON.toJSON(object);
+ }
+
+ private static ValueFilter filter = new ValueFilter() {
+ @Override
+ public Object process(Object obj, String s, Object v) {
+ if (v == null || "".equals(v)) {
+ return null;
+ }
+ return v;
+ }
+ };
+
+ public static String toString(Object obj) {
+ return JSON.toJSONString(obj, filter);
+ }
+}
diff --git a/ak-common/src/main/java/com/ak/common/utils/MapDataUtil.java b/opl-common/src/main/java/com/opl/framework/common/utils/MapDataUtil.java
similarity index 88%
rename from ak-common/src/main/java/com/ak/common/utils/MapDataUtil.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/MapDataUtil.java
index 9f67d28e481a41826c4de57cdd567df42f35f581..787b684adf28c35e0425da6a6dacda686434ba4f 100644
--- a/ak-common/src/main/java/com/ak/common/utils/MapDataUtil.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/MapDataUtil.java
@@ -1,20 +1,22 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
-import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import javax.servlet.http.HttpServletRequest;
+
+import com.google.common.collect.Maps;
+
/**
* Map通用处理方法
*
- * @author Vean
+ * @author kingrom
*/
public class MapDataUtil {
public static Map convertDataMap(HttpServletRequest request) {
Map properties = request.getParameterMap();
- Map returnMap = new HashMap();
+ Map returnMap = Maps.newHashMap();
Iterator> entries = properties.entrySet().iterator();
Entry, ?> entry;
String name = "";
diff --git a/ak-common/src/main/java/com/ak/common/utils/MessageUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/MessageUtils.java
similarity index 83%
rename from ak-common/src/main/java/com/ak/common/utils/MessageUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/MessageUtils.java
index b2e16ab9dc9a9108585f6db16542f8a1c2bfeb65..31be8e021959d137619c2f88b326e84033bb44ef 100644
--- a/ak-common/src/main/java/com/ak/common/utils/MessageUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/MessageUtils.java
@@ -1,13 +1,14 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
-import com.ak.common.utils.spring.SpringUtils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
+import com.opl.framework.common.utils.spring.SpringUtils;
+
/**
* 获取i18n资源文件
*
- * @author Vean
+ * @author kingrom
*/
public class MessageUtils {
/**
diff --git a/ak-common/src/main/java/com/ak/common/utils/ServletUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/ServletUtils.java
similarity index 96%
rename from ak-common/src/main/java/com/ak/common/utils/ServletUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/ServletUtils.java
index dba31ab07ee43b0c50e13e2b84ed7f3c702fd953..6b7bd45ae5cd1e04518782fc642ecf4621501b5e 100644
--- a/ak-common/src/main/java/com/ak/common/utils/ServletUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/ServletUtils.java
@@ -1,19 +1,21 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
-import com.ak.common.core.text.Convert;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
+import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import java.io.IOException;
+
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import com.opl.framework.common.core.text.Convert;
/**
* 客户端工具类
*
- * @author Vean
+ * @author kingrom
*/
public class ServletUtils {
/**
diff --git a/ak-common/src/main/java/com/ak/common/utils/StringUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/StringUtils.java
similarity index 98%
rename from ak-common/src/main/java/com/ak/common/utils/StringUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/StringUtils.java
index fa578f59a8c70672ec5152eb1058059a33b88620..c7767ac0bd8d72e23948bd167b61c1805764cace 100644
--- a/ak-common/src/main/java/com/ak/common/utils/StringUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/StringUtils.java
@@ -1,17 +1,18 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
-import com.ak.common.core.text.StrFormatter;
-import com.ak.common.enums.RandomType;
import org.springframework.util.Assert;
+import com.opl.framework.common.core.text.StrFormatter;
+import com.opl.framework.common.enums.RandomType;
+
/**
* 字符串工具类
*
- * @author Vean
+ * @author kingrom
*/
public class StringUtils extends org.apache.commons.lang3.StringUtils {
/**
diff --git a/ak-common/src/main/java/com/ak/common/utils/Threads.java b/opl-common/src/main/java/com/opl/framework/common/utils/Threads.java
similarity index 88%
rename from ak-common/src/main/java/com/ak/common/utils/Threads.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/Threads.java
index 428c85e0c0c0cb85fbf6e1ce54bc6461ffa7dae6..70c44af5e61531d4f428057af5c27b9a07bf06fb 100644
--- a/ak-common/src/main/java/com/ak/common/utils/Threads.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/Threads.java
@@ -1,14 +1,18 @@
-package com.ak.common.utils;
+package com.opl.framework.common.utils;
+
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.concurrent.*;
-
/**
* 线程相关工具类.
*
- * @author Vean
+ * @author kingrom
*/
public class Threads {
private static final Logger logger = LoggerFactory.getLogger(Threads.class);
diff --git a/opl-common/src/main/java/com/opl/framework/common/utils/UUIDUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/UUIDUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..0839ee688a7d7b200ddb31984947dab72564b386
--- /dev/null
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/UUIDUtils.java
@@ -0,0 +1,14 @@
+package com.opl.framework.common.utils;
+
+import java.util.UUID;
+
+public class UUIDUtils {
+
+ /**
+ * 产生全球唯一的字符串
+ * @return
+ */
+ public static String getUUid() {
+ return UUID.randomUUID().toString().replace("-", "").toUpperCase();
+ }
+}
diff --git a/ak-common/src/main/java/com/ak/common/utils/YamlUtil.java b/opl-common/src/main/java/com/opl/framework/common/utils/YamlUtil.java
similarity index 97%
rename from ak-common/src/main/java/com/ak/common/utils/YamlUtil.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/YamlUtil.java
index dab5a4d9bbc5863aa9fd646c80c7f7fc1acd8e64..7a9305d32e4d85dbdc78d27a69885a62c89a5066 100644
--- a/ak-common/src/main/java/com/ak/common/utils/YamlUtil.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/YamlUtil.java
@@ -1,7 +1,4 @@
-package com.ak.common.utils;
-
-import org.yaml.snakeyaml.DumperOptions;
-import org.yaml.snakeyaml.Yaml;
+package com.opl.framework.common.utils;
import java.io.FileNotFoundException;
import java.io.FileWriter;
@@ -10,10 +7,13 @@ import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.Map;
+import org.yaml.snakeyaml.DumperOptions;
+import org.yaml.snakeyaml.Yaml;
+
/**
* 配置处理工具类
*
- * @author Vean
+ * @author kingrom
*/
public class YamlUtil {
public static Map, ?> loadYaml(String fileName) throws FileNotFoundException {
diff --git a/ak-common/src/main/java/com/ak/common/utils/bean/BeanUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/bean/BeanUtils.java
similarity index 92%
rename from ak-common/src/main/java/com/ak/common/utils/bean/BeanUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/bean/BeanUtils.java
index a27f884e9ae81c03a63ebacbbd86079d66b9d0a0..26f3959a4275b54d5ee3dc31a4727174ddff5da5 100644
--- a/ak-common/src/main/java/com/ak/common/utils/bean/BeanUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/bean/BeanUtils.java
@@ -1,15 +1,16 @@
-package com.ak.common.utils.bean;
+package com.opl.framework.common.utils.bean;
import java.lang.reflect.Method;
-import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import com.google.common.collect.Lists;
+
/**
* Bean 工具类
*
- * @author Vean
+ * @author kingrom
*/
public class BeanUtils extends org.springframework.beans.BeanUtils {
/**
@@ -49,7 +50,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils {
*/
public static List getSetterMethods(Object obj) {
// setter方法列表
- List setterMethods = new ArrayList();
+ List setterMethods = Lists.newArrayList();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
@@ -75,7 +76,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils {
public static List getGetterMethods(Object obj) {
// getter方法列表
- List getterMethods = new ArrayList();
+ List getterMethods = Lists.newArrayList();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找getter方法
diff --git a/ak-common/src/main/java/com/ak/common/utils/file/FileUploadUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/file/FileUploadUtils.java
similarity index 93%
rename from ak-common/src/main/java/com/ak/common/utils/file/FileUploadUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/file/FileUploadUtils.java
index 1c9bf00ac8a435c7315b2578571e60e69593184a..c1150adf5fd483e639c3590f01bbdea0f333dc60 100644
--- a/ak-common/src/main/java/com/ak/common/utils/file/FileUploadUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/file/FileUploadUtils.java
@@ -1,22 +1,23 @@
-package com.ak.common.utils.file;
-
-import com.ak.common.config.Global;
-import com.ak.common.constant.Constants;
-import com.ak.common.exception.file.FileException;
-import com.ak.common.exception.file.InvalidExtensionException;
-import com.ak.common.utils.DateUtils;
-import com.ak.common.utils.StringUtils;
-import com.ak.common.utils.security.Md5Utils;
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.web.multipart.MultipartFile;
+package com.opl.framework.common.utils.file;
import java.io.File;
import java.io.IOException;
+import org.apache.commons.io.FilenameUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.opl.framework.common.config.Global;
+import com.opl.framework.common.constant.Constants;
+import com.opl.framework.common.exception.file.FileException;
+import com.opl.framework.common.exception.file.InvalidExtensionException;
+import com.opl.framework.common.utils.DateUtils;
+import com.opl.framework.common.utils.StringUtils;
+import com.opl.framework.common.utils.security.Md5Utils;
+
/**
* 文件上传工具类
*
- * @author Vean
+ * @author kingrom
*/
public class FileUploadUtils {
/**
diff --git a/ak-common/src/main/java/com/ak/common/utils/file/FileUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/file/FileUtils.java
similarity index 92%
rename from ak-common/src/main/java/com/ak/common/utils/file/FileUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/file/FileUtils.java
index 3719434904ce88976555d277377000e5beb90e4a..687bb994fe02032e3561b88657d559c40250998d 100644
--- a/ak-common/src/main/java/com/ak/common/utils/file/FileUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/file/FileUtils.java
@@ -1,13 +1,19 @@
-package com.ak.common.utils.file;
+package com.opl.framework.common.utils.file;
-import javax.servlet.http.HttpServletRequest;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import javax.servlet.http.HttpServletRequest;
+
/**
* 文件处理工具类
*
- * @author Vean
+ * @author kingrom
*/
public class FileUtils {
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
diff --git a/ak-common/src/main/java/com/ak/common/utils/file/MimeTypeUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/file/MimeTypeUtils.java
similarity index 95%
rename from ak-common/src/main/java/com/ak/common/utils/file/MimeTypeUtils.java
rename to opl-common/src/main/java/com/opl/framework/common/utils/file/MimeTypeUtils.java
index 262cabd724f69aa0f5f2832f74ed5dea29e50221..27eba4235d700f7ec0406c2f76c27304a141f54f 100644
--- a/ak-common/src/main/java/com/ak/common/utils/file/MimeTypeUtils.java
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/file/MimeTypeUtils.java
@@ -1,9 +1,9 @@
-package com.ak.common.utils.file;
+package com.opl.framework.common.utils.file;
/**
* 媒体类型工具类
*
- * @author Vean
+ * @author kingrom
*/
public class MimeTypeUtils {
public static final String IMAGE_PNG = "image/png";
diff --git a/opl-common/src/main/java/com/opl/framework/common/utils/http/HttpUtils.java b/opl-common/src/main/java/com/opl/framework/common/utils/http/HttpUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..d931dd28995454f4e3364a77c85c20529d6be681
--- /dev/null
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/http/HttpUtils.java
@@ -0,0 +1,232 @@
+package com.opl.framework.common.utils.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.ConnectException;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 通用http发送方法
+ *
+ * @author kingrom
+ */
+public class HttpUtils {
+ private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
+
+ /**
+ * 向指定 URL 发送GET方法的请求
+ *
+ * @param url 发送请求的 URL
+ * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+ * @return 所代表远程资源的响应结果
+ */
+ public static String sendGet(String url, String param) {
+ StringBuilder result = new StringBuilder();
+ BufferedReader in = null;
+ try {
+ String urlNameString = url + "?" + param;
+ log.info("sendGet - {}", urlNameString);
+ URL realUrl = new URL(urlNameString);
+ URLConnection connection = realUrl.openConnection();
+ connection.setRequestProperty("accept", "*/*");
+ connection.setRequestProperty("connection", "Keep-Alive");
+ connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+ connection.connect();
+ in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+ String line;
+ while ((line = in.readLine()) != null) {
+ result.append(line);
+ }
+ log.info("recv - {}", result);
+ } catch (ConnectException e) {
+ log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
+ } catch (SocketTimeoutException e) {
+ log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
+ } catch (IOException e) {
+ log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
+ } catch (Exception e) {
+ log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ } catch (Exception ex) {
+ log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
+ }
+ }
+ return result.toString();
+ }
+
+ public static String doPostJson(String url, Object json) {
+ // 创建Httpclient对象
+ CloseableHttpClient httpClient = HttpClients.createDefault();
+ CloseableHttpResponse response = null;
+ String resultString = "";
+ try {
+ // 创建Http Post请求
+ HttpPost httpPost = new HttpPost(url);
+ // 创建请求内容
+ StringEntity stringEntity = new StringEntity(json.toString(), "UTF-8");
+ stringEntity.setContentEncoding("UTF-8");
+ stringEntity.setContentType("application/json");
+ httpPost.setEntity(stringEntity);
+ // 执行http请求
+ response = httpClient.execute(httpPost);
+ resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ if (response != null) {
+ response.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return resultString;
+ }
+
+ /**
+ * 向指定 URL 发送POST方法的请求
+ *
+ * @param url 发送请求的 URL
+ * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+ * @return 所代表远程资源的响应结果
+ */
+ public static String sendPost(String url, String param) {
+ PrintWriter out = null;
+ BufferedReader in = null;
+ StringBuilder result = new StringBuilder();
+ try {
+ String urlNameString = url + "?" + param;
+ log.info("sendPost - {}", urlNameString);
+ URL realUrl = new URL(urlNameString);
+ URLConnection conn = realUrl.openConnection();
+ conn.setRequestProperty("accept", "*/*");
+ conn.setRequestProperty("connection", "Keep-Alive");
+ conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+ conn.setRequestProperty("Accept-Charset", "utf-8");
+ conn.setRequestProperty("contentType", "utf-8");
+ conn.setDoOutput(true);
+ conn.setDoInput(true);
+ out = new PrintWriter(conn.getOutputStream());
+ out.print(param);
+ out.flush();
+ in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
+ String line;
+ while ((line = in.readLine()) != null) {
+ result.append(line);
+ }
+ log.info("recv - {}", result);
+ } catch (ConnectException e) {
+ log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
+ } catch (SocketTimeoutException e) {
+ log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
+ } catch (IOException e) {
+ log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
+ } catch (Exception e) {
+ log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
+ } finally {
+ try {
+ if (out != null) {
+ out.close();
+ }
+ if (in != null) {
+ in.close();
+ }
+ } catch (IOException ex) {
+ log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
+ }
+ }
+ return result.toString();
+ }
+
+ public static String sendSSLPost(String url, String param) {
+ StringBuilder result = new StringBuilder();
+ String urlNameString = url + "?" + param;
+ try {
+ log.info("sendSSLPost - {}", urlNameString);
+ SSLContext sc = SSLContext.getInstance("SSL");
+ sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
+ URL console = new URL(urlNameString);
+ HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
+ conn.setRequestProperty("accept", "*/*");
+ conn.setRequestProperty("connection", "Keep-Alive");
+ conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+ conn.setRequestProperty("Accept-Charset", "utf-8");
+ conn.setRequestProperty("contentType", "utf-8");
+ conn.setDoOutput(true);
+ conn.setDoInput(true);
+
+ conn.setSSLSocketFactory(sc.getSocketFactory());
+ conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
+ conn.connect();
+ InputStream is = conn.getInputStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ String ret = "";
+ while ((ret = br.readLine()) != null) {
+ if (ret != null && !"".equals(ret.trim())) {
+ result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
+ }
+ }
+ log.info("recv - {}", result);
+ conn.disconnect();
+ br.close();
+ } catch (ConnectException e) {
+ log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
+ } catch (SocketTimeoutException e) {
+ log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
+ } catch (IOException e) {
+ log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
+ } catch (Exception e) {
+ log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
+ }
+ return result.toString();
+ }
+
+ private static class TrustAnyTrustManager implements X509TrustManager {
+ @Override
+ public void checkClientTrusted(X509Certificate[] chain, String authType) {
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] chain, String authType) {
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[] {};
+ }
+ }
+
+ private static class TrustAnyHostnameVerifier implements HostnameVerifier {
+ @Override
+ public boolean verify(String hostname, SSLSession session) {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/opl-common/src/main/java/com/opl/framework/common/utils/poi/CsvFilePrinter.java b/opl-common/src/main/java/com/opl/framework/common/utils/poi/CsvFilePrinter.java
new file mode 100644
index 0000000000000000000000000000000000000000..4217b349fbe2aebd2c723f28ed9f771c9c1ef7a1
--- /dev/null
+++ b/opl-common/src/main/java/com/opl/framework/common/utils/poi/CsvFilePrinter.java
@@ -0,0 +1,300 @@
+package com.opl.framework.common.utils.poi;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.supercsv.io.CsvListWriter;
+import org.supercsv.io.ICsvListWriter;
+import org.supercsv.prefs.CsvPreference;
+
+import com.google.common.collect.Lists;
+import com.opl.framework.common.annotation.Excel;
+import com.opl.framework.common.annotation.Excels;
+import com.opl.framework.common.config.Global;
+import com.opl.framework.common.core.domain.AjaxResult;
+import com.opl.framework.common.utils.StringUtils;
+import com.opl.framework.common.utils.UUIDUtils;
+
+import lombok.Data;
+
+public class CsvFilePrinter {
+
+ private ICsvListWriter listWriter = null;
+ /**
+ * 实体对象
+ */
+ public Class clazz;
+
+ private String sheetName;
+ /**
+ * 注解列表
+ */
+ private List