2018-03-04 19:20:32 +08:00
|
|
|
package com.nis.util;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import com.nis.domain.SysDataDictionaryItem;
|
|
|
|
|
import com.nis.domain.SysDataDictionaryName;
|
2018-03-06 10:06:42 +08:00
|
|
|
import com.nis.domain.basics.ServiceDictInfo;
|
|
|
|
|
import com.nis.domain.basics.SysDictInfo;
|
2018-03-17 17:09:19 +08:00
|
|
|
import com.nis.domain.specific.SpecificServiceCfg;
|
2018-03-04 19:20:32 +08:00
|
|
|
import com.nis.web.dao.SysDictDao;
|
2018-03-06 10:06:42 +08:00
|
|
|
import com.nis.web.dao.basics.ServiceDictInfoDao;
|
|
|
|
|
import com.nis.web.dao.basics.SysDictInfoDao;
|
2018-03-17 17:09:19 +08:00
|
|
|
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
2018-03-04 19:20:32 +08:00
|
|
|
import com.nis.web.service.SpringContextHolder;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统数据字典工具类
|
|
|
|
|
* @author Administrator
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public class ConfigDictUtils {
|
|
|
|
|
|
|
|
|
|
private final static ServiceDictInfoDao serviceDictInfoDao = SpringContextHolder.getBean(ServiceDictInfoDao.class);
|
|
|
|
|
private final static SysDictInfoDao sysDictInfoDao = SpringContextHolder.getBean(SysDictInfoDao.class);
|
2018-03-17 17:09:19 +08:00
|
|
|
private final static SpecificServiceCfgDao specificServiceCfgDao = SpringContextHolder.getBean(SpecificServiceCfgDao.class);
|
2018-03-04 19:20:32 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据主键查询配置详情
|
|
|
|
|
* @param serviceDictId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static ServiceDictInfo getServiceDictInfoById(Integer serviceDictId){
|
|
|
|
|
return serviceDictInfoDao.getDictById(serviceDictId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据主键查询配置详情
|
|
|
|
|
* @param sysDictId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SysDictInfo getSysDictInfoById(Integer sysDictId){
|
|
|
|
|
return sysDictInfoDao.getDictById(sysDictId);
|
|
|
|
|
}
|
2018-03-17 17:09:19 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据主键查询配置详情
|
|
|
|
|
* @param sysDictId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SpecificServiceCfg getBySpecServiceId(Integer specServiceId){
|
|
|
|
|
return specificServiceCfgDao.getBySpecServiceId(specServiceId);
|
|
|
|
|
}
|
2018-03-10 18:54:05 +08:00
|
|
|
/**
|
|
|
|
|
* 根据计算公式计算数据结果
|
|
|
|
|
* @param sysDictId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static Integer getNumberResult(Integer number1, Integer number2, Integer number3){
|
|
|
|
|
|
|
|
|
|
return number1+(number2-1)*number3;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 根据数据类型编码取出数据类型
|
|
|
|
|
* @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("分类")){
|
|
|
|
|
result = "分类";
|
|
|
|
|
}
|
|
|
|
|
if(value.trim().equals("性质")){
|
|
|
|
|
result = "性质";
|
|
|
|
|
}
|
|
|
|
|
if(value.trim().equals("标签")){
|
|
|
|
|
result = "标签";
|
|
|
|
|
}
|
|
|
|
|
if(value.trim().equals("地域")){
|
|
|
|
|
result = "地域";
|
|
|
|
|
}
|
|
|
|
|
if(value.trim().equals("运营商")){
|
|
|
|
|
result = "运营商";
|
|
|
|
|
}
|
|
|
|
|
if(value.trim().equals("特征作用域")){
|
|
|
|
|
result = "特征作用域";
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2018-03-04 19:20:32 +08:00
|
|
|
|
|
|
|
|
}
|