Merge branch 'master' of https://gitee.com/y_project/RuoYi
This commit is contained in:
commit
123a197aa2
6
pom.xml
6
pom.xml
|
|
@ -6,18 +6,18 @@
|
|||
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
|
||||
<name>ruoyi</name>
|
||||
<url>http://www.ruoyi.vip</url>
|
||||
<description>若依管理系统</description>
|
||||
|
||||
<properties>
|
||||
<ruoyi.version>4.2.0</ruoyi.version>
|
||||
<ruoyi.version>4.3.0</ruoyi.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<shiro.version>1.4.2</shiro.version>
|
||||
<shiro.version>1.5.3</shiro.version>
|
||||
<thymeleaf.extras.shiro.version>2.0.0</thymeleaf.extras.shiro.version>
|
||||
<mybatis.boot.version>1.3.2</mybatis.boot.version>
|
||||
<druid.version>1.1.14</druid.version>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ ruoyi:
|
|||
# 名称
|
||||
name: RuoYi
|
||||
# 版本
|
||||
version: 4.2.0
|
||||
version: 4.3.0
|
||||
# 版权年份
|
||||
copyrightYear: 2019
|
||||
# 实例演示开关
|
||||
|
|
|
|||
|
|
@ -239,9 +239,12 @@ $(function() {
|
|||
dataIndex = $(this).data('index'),
|
||||
menuName = $.trim($(this).text()),
|
||||
flag = true;
|
||||
$(".nav ul li, .nav li").removeClass("selected");
|
||||
$(this).parent("li").addClass("selected");
|
||||
setIframeUrl($(this).attr("href"));
|
||||
|
||||
if (!$('a[href$="' + dataUrl + '"]').hasClass("noactive")) {
|
||||
$(".nav ul li, .nav li").removeClass("selected");
|
||||
$(this).parent("li").addClass("selected");
|
||||
}
|
||||
setIframeUrl(dataUrl);
|
||||
if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false;
|
||||
|
||||
// 选项卡菜单已存在
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<h2>若依后台管理系统</h2>
|
||||
<p>ruoyi是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的就jQuery插件,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>
|
||||
<p>
|
||||
<b>当前版本:</b>v4.2.0
|
||||
<b>当前版本:</b>v4.3.0
|
||||
</p>
|
||||
<p>
|
||||
<span class="label label-warning">免费开源</span>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
<h3>你好,若依 </h3>
|
||||
<p>H+是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的就jQuery插件,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>
|
||||
<p>
|
||||
<b>当前版本:</b>v4.2.0
|
||||
<b>当前版本:</b>v4.3.0
|
||||
</p>
|
||||
<p>
|
||||
<span class="label label-warning">开源免费</span>
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@
|
|||
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
|
||||
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.2.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.2.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.3.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.3.0}"></script>
|
||||
<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<link th:href="@{/css/animate.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/style.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.2.0}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.3.0}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
|
||||
<div id="wrapper">
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<a class="menuItem noactive" title="个人中心" th:href="@{/system/user/profile}">
|
||||
<div class="hide" th:text="个人中心"></div>
|
||||
<div class="pull-left image">
|
||||
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" class="img-circle" alt="User Image">
|
||||
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
</a>
|
||||
<div class="pull-left info">
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
<li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
|
||||
<li class="dropdown user-menu">
|
||||
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
|
||||
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" class="user-image">
|
||||
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="user-image">
|
||||
<span class="hidden-xs">[[${#strings.defaultString(user.userName, '-')}]]</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
|
@ -246,8 +246,8 @@
|
|||
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
|
||||
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.2.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.2.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.3.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.3.0}"></script>
|
||||
<script th:src="@{/ruoyi/index.js}"></script>
|
||||
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
|
|
@ -258,6 +258,8 @@ var skin = storage.get("skin");
|
|||
var mode = "history";
|
||||
// 历史访问路径缓存
|
||||
var historyPath = storage.get("historyPath");
|
||||
// 是否页签与菜单联动
|
||||
var isLinkage = true;
|
||||
|
||||
// 本地主题优先,未设置取系统配置
|
||||
if($.common.isNotEmpty(skin)){
|
||||
|
|
@ -305,6 +307,19 @@ $(function() {
|
|||
applyPath(url);
|
||||
}
|
||||
}
|
||||
if(isLinkage) {
|
||||
$(".menuTabs").on("click", ".menuTab", function() {
|
||||
var dataId = $(this).attr("data-id");
|
||||
var $dataObj = $('a[href$="' + decodeURI(dataId) + '"]');
|
||||
if (!$dataObj.hasClass("noactive")) {
|
||||
$('.nav ul').removeClass("in");
|
||||
$dataObj.parents("ul").addClass("in")
|
||||
$dataObj.parents("li").addClass("active").siblings().removeClass("active").find('li').removeClass("active");
|
||||
$dataObj.parents("ul").css('height', 'auto').height();
|
||||
$dataObj.click();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.css" th:href="@{/css/style.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.2.0}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.3.0}" rel="stylesheet"/>
|
||||
<!-- 360浏览器急速模式 -->
|
||||
<meta name="renderer" content="webkit">
|
||||
<!-- 避免IE使用兼容模式 -->
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.2.0}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.3.0}"></script>
|
||||
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -96,13 +96,79 @@
|
|||
<div class="ibox-content no-padding">
|
||||
<div class="panel-body">
|
||||
<div class="panel-group" id="version">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v43">v4.3.0</a><code class="pull-right">2020.06.22</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v43" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>代码生成模板支持主子表</li>
|
||||
<li>代码生成显示类型支持复选框</li>
|
||||
<li>前端表单样式修改成圆角</li>
|
||||
<li>新增回显数据字典(字符串数组)</li>
|
||||
<li>修复浏览器手动缩放比例后菜单无法自适应问题</li>
|
||||
<li>限制用户不允许选择系统管理员角色</li>
|
||||
<li>用户信息添加输入框组图标&鼠标按下显示密码</li>
|
||||
<li>升级fastjson到最新版1.2.70 修复高危安全漏洞</li>
|
||||
<li>升级Bootstrap版本到v3.3.7</li>
|
||||
<li>修复selectColumns方法获取子对象数据无效问题</li>
|
||||
<li>修改数据源类型优先级,先根据方法,再根据类</li>
|
||||
<li>修改上级部门(选择项排除本身和下级)</li>
|
||||
<li>首页菜单显示调整</li>
|
||||
<li>添加是否开启swagger配置</li>
|
||||
<li>新增示例(主子表提交)</li>
|
||||
<li>新增示例(多级联动下拉示例)</li>
|
||||
<li>新增示例(表格属性data数据加载)</li>
|
||||
<li>新增表格列参数(是否列选项可见ignore)</li>
|
||||
<li>新增表格参数(是否启用显示卡片视图cardView)</li>
|
||||
<li>新增表格参数(是否显示全屏按钮showFullscreen)</li>
|
||||
<li>新增表格参数(是否启用分页条无限循环的功能paginationLoop)</li>
|
||||
<li>新增表格参数(是否显示表头showHeader)</li>
|
||||
<li>表格添加显示/隐藏所有列方法 showAllColumns/hideAllColumns</li>
|
||||
<li>修复部分情况节点不展开问题</li>
|
||||
<li>修复关闭标签页后刷新还是上次地址问题</li>
|
||||
<li>修复选择菜单后刷新页面,菜单箭头显示不对问题</li>
|
||||
<li>修复jquery表单序列化时复选框未选中不会序列化到对象中问题</li>
|
||||
<li>Excel支持readConverterExp读取字符串组内容</li>
|
||||
<li>更换IP地址查询接口</li>
|
||||
<li>默认关闭获取ip地址</li>
|
||||
<li>操作处理ajaxSuccess判断修正</li>
|
||||
<li>HttpUtils.sendPost()方法,参数无需拼接参数到url</li>
|
||||
<li>通用http发送方法增加参数 contentType 编码类型</li>
|
||||
<li>HTML过滤器不替换&实体</li>
|
||||
<li>代码生成浮点型改用BigDecimal</li>
|
||||
<li>修复表单构建单选和多选框渲染问题</li>
|
||||
<li>代码生成模板调整,字段为String并且必填则加空串条件</li>
|
||||
<li>字典数据查询列表根据dictSort升序排序</li>
|
||||
<li>修复树表对imageView和tooltip方法无效问题</li>
|
||||
<li>修复Long类型比较相等问题调整</li>
|
||||
<li>示例demo页面清除html链接,防止点击后跳转出现404</li>
|
||||
<li>在线用户强退方法合并</li>
|
||||
<li>添加校验部门包含未停用的子部门</li>
|
||||
<li>取消回车自动提交表单</li>
|
||||
<li>'A','I','BUTTON' 标签忽略clickToSelect事件,防止点击操作按钮时选中</li>
|
||||
<li>邮箱显示截取部分字符串,防止低分辨率错位</li>
|
||||
<li>代码生成列属性根据sort排序</li>
|
||||
<li>修复更多操作部分浏览器不兼容情况</li>
|
||||
<li>图片预览事件属性修正</li>
|
||||
<li>修复冻结列排序样式无效问题</li>
|
||||
<li>修复context-path的情况下个人中心刷新导致样式问题</li>
|
||||
<li>全屏editFull打开适配表树</li>
|
||||
<li>其他细节优化</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#version" href="#v42">v4.2.0</a><code class="pull-right">2020.03.23</code>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="v42" class="panel-collapse collapse in">
|
||||
<div id="v42" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<li>用户管理添加分配角色页面</li>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/style.css" th:href="@{/css/style.css}" rel="stylesheet"/>
|
||||
<link href="../static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.2.0}" rel="stylesheet"/>
|
||||
<link href="../static/ruoyi/css/ry-ui.css" th:href="@{/ruoyi/css/ry-ui.css?v=4.3.0}" rel="stylesheet"/>
|
||||
<!-- 360浏览器急速模式 -->
|
||||
<meta name="renderer" content="webkit">
|
||||
<!-- 避免IE使用兼容模式 -->
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
<script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
|
||||
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
|
||||
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.2.0}"></script>
|
||||
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.3.0}"></script>
|
||||
<script src="../static/ruoyi/register.js" th:src="@{/ruoyi/register.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
</ul>
|
||||
</body>
|
||||
<script th:src="@{/js/jquery.min.js}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.2.0}"></script>
|
||||
<script th:src="@{/ruoyi/js/common.js?v=4.3.0}"></script>
|
||||
<script type="text/javascript">
|
||||
//皮肤样式列表
|
||||
var skins = ["skin-blue", "skin-green", "skin-purple", "skin-red", "skin-yellow"];
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ public @interface Excel
|
|||
*/
|
||||
public String dateFormat() default "";
|
||||
|
||||
/**
|
||||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
||||
*/
|
||||
public String dictType() default "";
|
||||
|
||||
/**
|
||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
||||
*/
|
||||
|
|
@ -33,7 +38,7 @@ public @interface Excel
|
|||
* 分隔符,读取字符串组内容
|
||||
*/
|
||||
public String separator() default ",";
|
||||
|
||||
|
||||
/**
|
||||
* 导出类型(0数字 1字符串)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import com.ruoyi.common.exception.BusinessException;
|
|||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
|
||||
/**
|
||||
* Excel相关处理
|
||||
|
|
@ -276,7 +277,11 @@ public class ExcelUtil<T>
|
|||
}
|
||||
else if (StringUtils.isNotEmpty(attr.readConverterExp()))
|
||||
{
|
||||
val = reverseByExp(String.valueOf(val), attr.readConverterExp(), attr.separator());
|
||||
val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator());
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(attr.dictType()))
|
||||
{
|
||||
val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator());
|
||||
}
|
||||
ReflectUtils.invokeSetter(entity, propertyName, val);
|
||||
}
|
||||
|
|
@ -536,13 +541,18 @@ public class ExcelUtil<T>
|
|||
String dateFormat = attr.dateFormat();
|
||||
String readConverterExp = attr.readConverterExp();
|
||||
String separator = attr.separator();
|
||||
String dictType = attr.dictType();
|
||||
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
||||
{
|
||||
cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
||||
{
|
||||
cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp, separator));
|
||||
cell.setCellValue(convertByExp(Convert.toStr(value), readConverterExp, separator));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(dictType))
|
||||
{
|
||||
cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -672,39 +682,64 @@ public class ExcelUtil<T>
|
|||
public static String reverseByExp(String propertyValue, String converterExp, String separator) throws Exception
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
try
|
||||
String[] convertSource = converterExp.split(",");
|
||||
for (String item : convertSource)
|
||||
{
|
||||
String[] convertSource = converterExp.split(",");
|
||||
for (String item : convertSource)
|
||||
String[] itemArray = item.split("=");
|
||||
if (StringUtils.containsAny(separator, propertyValue))
|
||||
{
|
||||
String[] itemArray = item.split("=");
|
||||
if (StringUtils.containsAny(separator, propertyValue))
|
||||
for (String value : propertyValue.split(separator))
|
||||
{
|
||||
for (String value : propertyValue.split(separator))
|
||||
if (itemArray[1].equals(value))
|
||||
{
|
||||
if (itemArray[1].equals(value))
|
||||
{
|
||||
propertyString.append(itemArray[0] + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (itemArray[1].equals(propertyValue))
|
||||
{
|
||||
return itemArray[0];
|
||||
propertyString.append(itemArray[0] + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
else
|
||||
{
|
||||
if (itemArray[1].equals(propertyValue))
|
||||
{
|
||||
return itemArray[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析字典值
|
||||
*
|
||||
* @param dictValue 字典值
|
||||
* @param dictType 字典类型
|
||||
* @param separator 分隔符
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String convertDictByExp(String dictValue, String dictType, String separator) throws Exception
|
||||
{
|
||||
Object bean = SpringUtils.getBean("dictUtils");
|
||||
String methodName = "getDictLabel";
|
||||
Method method = bean.getClass().getDeclaredMethod(methodName, String.class, String.class, String.class);
|
||||
return Convert.toStr(method.invoke(bean, dictType, dictValue, separator));
|
||||
}
|
||||
|
||||
/**
|
||||
* 反向解析值字典值
|
||||
*
|
||||
* @param dictLabel 字典标签
|
||||
* @param dictType 字典类型
|
||||
* @param separator 分隔符
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String reverseDictByExp(String dictLabel, String dictType, String separator) throws Exception
|
||||
{
|
||||
Object bean = SpringUtils.getBean("dictUtils");
|
||||
String methodName = "getDictValue";
|
||||
Method method = bean.getClass().getDeclaredMethod(methodName, String.class, String.class, String.class);
|
||||
return Convert.toStr(method.invoke(bean, dictType, dictLabel, separator));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -156,9 +156,9 @@ public class GenTableServiceImpl implements IGenTableService
|
|||
@Transactional
|
||||
public void importGenTable(List<GenTable> tableList, String operName)
|
||||
{
|
||||
for (GenTable table : tableList)
|
||||
try
|
||||
{
|
||||
try
|
||||
for (GenTable table : tableList)
|
||||
{
|
||||
String tableName = table.getTableName();
|
||||
GenUtils.initTable(table, operName);
|
||||
|
|
@ -174,10 +174,10 @@ public class GenTableServiceImpl implements IGenTableService
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("表名 " + table.getTableName() + " 导入失败:", e);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new BusinessException("导入失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.utils;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.CacheUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
|
@ -11,8 +12,14 @@ import com.ruoyi.system.domain.SysDictData;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class DictUtils
|
||||
{
|
||||
/**
|
||||
* 分隔符
|
||||
*/
|
||||
public static final String SEPARATOR = ",";
|
||||
|
||||
/**
|
||||
* 设置字典缓存
|
||||
*
|
||||
|
|
@ -41,6 +48,110 @@ public class DictUtils
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue)
|
||||
{
|
||||
return getDictLabel(dictType, dictValue, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel)
|
||||
{
|
||||
return getDictValue(dictType, dictLabel, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @param separator 分隔符
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String value : dictValue.split(separator))
|
||||
{
|
||||
if (value.equals(dict.getDictValue()))
|
||||
{
|
||||
propertyString.append(dict.getDictLabel() + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictValue.equals(dict.getDictValue()))
|
||||
{
|
||||
return dict.getDictLabel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @param separator 分隔符
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String label : dictLabel.split(separator))
|
||||
{
|
||||
if (label.equals(dict.getDictLabel()))
|
||||
{
|
||||
propertyString.append(dict.getDictValue() + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictLabel.equals(dict.getDictLabel()))
|
||||
{
|
||||
return dict.getDictValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue