|
...
|
...
|
@@ -91,31 +91,31 @@ public class DictUtils |
|
|
|
{
|
|
|
|
StringBuilder propertyString = new StringBuilder();
|
|
|
|
List<SysDictData> datas = getDictCache(dictType);
|
|
|
|
|
|
|
|
if (StringUtils.isNotNull(datas))
|
|
|
|
if (StringUtils.isNull(datas))
|
|
|
|
{
|
|
|
|
return StringUtils.EMPTY;
|
|
|
|
}
|
|
|
|
if (StringUtils.containsAny(separator, dictValue))
|
|
|
|
{
|
|
|
|
if (StringUtils.containsAny(separator, dictValue))
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
{
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
for (String value : dictValue.split(separator))
|
|
|
|
{
|
|
|
|
for (String value : dictValue.split(separator))
|
|
|
|
if (value.equals(dict.getDictValue()))
|
|
|
|
{
|
|
|
|
if (value.equals(dict.getDictValue()))
|
|
|
|
{
|
|
|
|
propertyString.append(dict.getDictLabel()).append(separator);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
propertyString.append(dict.getDictLabel()).append(separator);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
{
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
if (dictValue.equals(dict.getDictValue()))
|
|
|
|
{
|
|
|
|
if (dictValue.equals(dict.getDictValue()))
|
|
|
|
{
|
|
|
|
return dict.getDictLabel();
|
|
|
|
}
|
|
|
|
return dict.getDictLabel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -134,8 +134,11 @@ public class DictUtils |
|
|
|
{
|
|
|
|
StringBuilder propertyString = new StringBuilder();
|
|
|
|
List<SysDictData> datas = getDictCache(dictType);
|
|
|
|
|
|
|
|
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas))
|
|
|
|
if (StringUtils.isNull(datas))
|
|
|
|
{
|
|
|
|
return StringUtils.EMPTY;
|
|
|
|
}
|
|
|
|
if (StringUtils.containsAny(separator, dictLabel))
|
|
|
|
{
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
{
|
|
...
|
...
|
@@ -163,6 +166,48 @@ public class DictUtils |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据字典类型获取字典所有值
|
|
|
|
*
|
|
|
|
* @param dictType 字典类型
|
|
|
|
* @return 字典值
|
|
|
|
*/
|
|
|
|
public static String getDictValues(String dictType)
|
|
|
|
{
|
|
|
|
StringBuilder propertyString = new StringBuilder();
|
|
|
|
List<SysDictData> datas = getDictCache(dictType);
|
|
|
|
if (StringUtils.isNull(datas))
|
|
|
|
{
|
|
|
|
return StringUtils.EMPTY;
|
|
|
|
}
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
{
|
|
|
|
propertyString.append(dict.getDictValue()).append(SEPARATOR);
|
|
|
|
}
|
|
|
|
return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据字典类型获取字典所有标签
|
|
|
|
*
|
|
|
|
* @param dictType 字典类型
|
|
|
|
* @return 字典值
|
|
|
|
*/
|
|
|
|
public static String getDictLabels(String dictType)
|
|
|
|
{
|
|
|
|
StringBuilder propertyString = new StringBuilder();
|
|
|
|
List<SysDictData> datas = getDictCache(dictType);
|
|
|
|
if (StringUtils.isNull(datas))
|
|
|
|
{
|
|
|
|
return StringUtils.EMPTY;
|
|
|
|
}
|
|
|
|
for (SysDictData dict : datas)
|
|
|
|
{
|
|
|
|
propertyString.append(dict.getDictLabel()).append(SEPARATOR);
|
|
|
|
}
|
|
|
|
return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除指定字典缓存
|
|
|
|
*
|
|
|
|
* @param key 字典键
|
...
|
...
|
|