优化业务/系统字典功能,数据类型数量可改变,可任意组合菜单(作用域必须单独),页面自动设定权限,组合菜单时数据类型超过1种,列表页面条件搜索添加数据类型条件。
修订校验时浏览器的兼容问题,
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -69,64 +70,84 @@ public class ConfigDictUtils {
|
||||
return number1+(number2-1)*number3;
|
||||
}
|
||||
/**
|
||||
* 根据数据类型编码取出数据类型
|
||||
* @param dictKey
|
||||
* 根据数据类型编码取出数据类型标题国际化
|
||||
* (2018-03-30修订获取的国际化改为类型的国际化)
|
||||
* @param dictKey 数据的字典标识
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public static String getItemTypeByNo(String dictKey, List intArr){
|
||||
String result = "";
|
||||
String value = DictUtils.getDictLabel(dictKey,intArr.get(0).toString());
|
||||
if(value.trim().equals("classification")){
|
||||
result = "classification_manage";
|
||||
public static List<String> getItemTypeByNo(String dictKey, List intArr){
|
||||
List<String> itemValueList = Lists.newArrayList();
|
||||
if(intArr==null||intArr.size()==0){
|
||||
List<SysDataDictionaryItem> itemList = DictUtils.getDictList(dictKey);
|
||||
if(!StringUtil.isEmpty(itemList)){
|
||||
for(SysDataDictionaryItem sd:itemList){
|
||||
itemValueList.add(sd.getItemValue());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(Object itemCode:intArr){
|
||||
itemValueList.add(DictUtils.getDictLabel(dictKey,itemCode.toString()));
|
||||
}
|
||||
}
|
||||
if(value.trim().equals("attribute")){
|
||||
result = "attribute_manage";
|
||||
}
|
||||
if(value.trim().equals("label")){
|
||||
result = "label_manage";
|
||||
}
|
||||
if(value.trim().equals("area")){
|
||||
result = "area_manage";
|
||||
}
|
||||
if(value.trim().equals("isp")){
|
||||
result = "isp_manage";
|
||||
}
|
||||
if(value.trim().equals("scope")){
|
||||
result = "feature_scope_manage";
|
||||
}
|
||||
return result;
|
||||
|
||||
return itemValueList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据类型编码取出权限标识码
|
||||
* @param dictKey
|
||||
* @param dictKey 数据的字典标识
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public static String getPermissionByNo(String dictKey, List intArr){
|
||||
String result = "";
|
||||
String value = DictUtils.getDictLabel(dictKey,intArr.get(0).toString());
|
||||
if(value.trim().equals("classification")){
|
||||
result = "classification";
|
||||
List<String> itemValueList = Lists.newArrayList();
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
itemValueList=getItemTypeByNo(dictKey,intArr);
|
||||
if(!StringUtil.isEmpty(itemValueList)){
|
||||
for(String itermvalue:itemValueList){
|
||||
sb.append(itermvalue);
|
||||
}
|
||||
}
|
||||
if(value.trim().equals("attribute")){
|
||||
result = "attribute";
|
||||
}
|
||||
if(value.trim().equals("label")){
|
||||
result = "label";
|
||||
}
|
||||
if(value.trim().equals("area")){
|
||||
result = "area";
|
||||
}
|
||||
if(value.trim().equals("isp")){
|
||||
result = "isp";
|
||||
}
|
||||
if(value.trim().equals("scope")){
|
||||
result = "scope";
|
||||
}
|
||||
return result;
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据类型标识取出数据类型的itemCode
|
||||
* @param dictKey 数据的字典标识
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> getAllType(String dictKey){
|
||||
List<Integer> itemCodeList = Lists.newArrayList();
|
||||
List<SysDataDictionaryItem> itemList = DictUtils.getDictList(dictKey);
|
||||
if(!StringUtil.isEmpty(itemList)){
|
||||
for(SysDataDictionaryItem sd:itemList){
|
||||
itemCodeList.add(Integer.valueOf(sd.getItemCode()));
|
||||
}
|
||||
}
|
||||
return itemCodeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据传入数据拆分数据类型参数
|
||||
* @param dictKey 数据的字典标识
|
||||
* @param itType 传入参数
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> dealTypeCondition(String dictKey,String itType ){
|
||||
List<Integer> intArr = Lists.newArrayList();
|
||||
if(StringUtil.isEmpty(itType)){
|
||||
intArr = ConfigDictUtils.getAllType(dictKey);
|
||||
}else{
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] tempArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
tempArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
intArr = Arrays.asList(tempArr);
|
||||
}
|
||||
return intArr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user