package com.vci.web.service;
|
import com.vci.corba.common.PLException;
|
import com.vci.corba.omd.etm.EnumType;
|
import com.vci.dto.OsEnumDTO;
|
import com.vci.starter.web.exception.VciBaseException;
|
import com.vci.starter.web.pagemodel.BaseResult;
|
import com.vci.starter.web.pagemodel.DataGrid;
|
import com.vci.starter.web.pagemodel.PageHelper;
|
import com.vci.pagemodel.KeyValue;
|
import com.vci.pagemodel.OsEnumItemVO;
|
import com.vci.pagemodel.OsEnumVO;
|
|
import java.io.File;
|
import java.util.ArrayList;
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 枚举服务
|
* @author weidy
|
* @date 2021-2-14
|
*/
|
public interface OsEnumServiceI extends OsBaseServiceI{
|
|
/**
|
* 根据枚举的key获取枚举的对象
|
* @param enumCode 枚举的编号
|
* @return 枚举包含的值
|
* @throws VciBaseException 获取枚举出错的时候会抛出异常
|
*/
|
List<KeyValue> getEnum(String enumCode) throws VciBaseException;
|
|
/**
|
* 根据枚举的值,获取对应的显示文本
|
* @param enumCode 枚举的编号
|
* @param enumKey 枚举的值
|
* @return 枚举的文本
|
* @throws VciBaseException 获取枚举出错的时候会抛出异常
|
*/
|
String getValue(String enumCode, String enumKey) throws VciBaseException;
|
|
/**
|
* 根据枚举显示文本获取枚举的值
|
* @param enumCode 枚举的编号
|
* @param enumValue 枚举的值
|
* @return 枚举的文本
|
* @throws VciBaseException 获取枚举出错的时候会抛出异常
|
*/
|
String getKey(String enumCode, String enumValue) throws VciBaseException;
|
|
/**
|
* 获取枚举的映射
|
* @param enumCode 枚举的编号
|
* @return 枚举的值
|
* @throws VciBaseException 获取枚举出错的时候会抛出异常
|
*/
|
Map<String,String> getEnumValueMap(String enumCode) throws VciBaseException;
|
|
/**
|
* 查询所有的枚举
|
* @return 枚举的显示对象
|
*/
|
List<OsEnumVO> selectAllEnum();
|
|
/**
|
* 枚举定义列表查询(带查询条件)
|
* @param enumName
|
* @return 枚举的显示对象
|
*/
|
List<OsEnumVO> getEnumTypeList(String enumName) throws PLException;
|
|
/**
|
* 查看枚举的使用范围
|
* @param enumName 枚举名称
|
* @return
|
* @throws PLException
|
*/
|
List<Map<String,String>> getUsedEnumList(String enumName) throws PLException;
|
|
/**
|
* 根据枚举英文名称获取枚举类型
|
* @param id
|
* @return
|
*/
|
OsEnumVO getEnumTypeById(String id) throws PLException;
|
|
/**
|
* 新增枚举类型
|
* @param osEnumDTO
|
* @return
|
*/
|
boolean addEnumType(OsEnumDTO osEnumDTO) throws PLException ;
|
|
/**
|
* 修改枚举类型
|
* @param osEnumDTO
|
* @return
|
*/
|
boolean updateEnumType(OsEnumDTO osEnumDTO) throws PLException ;
|
|
/**
|
* 删除枚举类型
|
* @param osEnumDTOS
|
* @return
|
*/
|
boolean deleteEnumTypes(List<OsEnumDTO> osEnumDTOS) throws PLException;
|
|
/**
|
* 导出枚举类型
|
* @param exportFileName 导出的文件名
|
* @param enumNames 需要导出的枚举名称
|
* @param flag 控制导出的列名是否和导入模板一致
|
* @return
|
*/
|
String exportEnumTypes(String exportFileName,String enumNames,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException;
|
|
/**
|
* 导入枚举
|
* @param file
|
* @return
|
* @throws Exception
|
*/
|
BaseResult importEnumTypes(File file) throws Exception;
|
|
/**
|
* 下载导入模板
|
* @param exportFileName
|
* @return
|
*/
|
String downloadEnumTemplate(String exportFileName);
|
|
/**
|
* 查询所有的枚举映射
|
* @return key是枚举的英文名称
|
*/
|
Map<String,OsEnumVO> selectAllEnumMap();
|
|
/**
|
* 枚举的数据对象转换为显示对象
|
* @param enumItems 枚举的对象
|
* @return 显示对象
|
*/
|
List<OsEnumVO> enumDO2VOs(Collection<EnumType> enumItems);
|
|
/**
|
* 枚举的数据对象转换为显示对象
|
* @param enumType 数据对象
|
* @return 显示对象
|
*/
|
OsEnumVO enumDO2VO(EnumType enumType);
|
|
/**
|
* 枚举明细转换为KV
|
* @param enumItemVOS 枚举明细显示对象
|
* @return KV
|
*/
|
List<KeyValue> enumItem2KV(Collection<OsEnumItemVO> enumItemVOS);
|
|
/**
|
* 获取数据的密级,并且会用当前用户的密级再校验一下
|
* @param oid 主键
|
* @param btmname 业务类型
|
* @return 数据的密级
|
*/
|
List<KeyValue> getDataEnum(String oid, String btmname);
|
|
/**
|
* 批量添加内容
|
* @param enumItemList 枚举的内容
|
*/
|
void batchAddEnum(List<EnumType> enumItemList);
|
|
/**
|
* 批量修改内容
|
* @param enumItemList 枚举的内容
|
*/
|
void batchEditEnum(List<EnumType> enumItemList);
|
|
/**
|
* 使用编号获取枚举的名称
|
* @param id 编号
|
* @return 枚举的中文名称
|
*/
|
String getNameById(String id);
|
|
/**
|
* 使用枚举的英文名称集合获取对象
|
* @param enumIdCollection 英文名称集合,不区分大小写
|
* @return 枚举的对象
|
*/
|
List<OsEnumVO> listEnumByIdCollection(Collection<String> enumIdCollection);
|
|
/**
|
* 参照枚举的信息
|
* @param conditionMap 查询条件
|
* @param pageHelper 分页
|
* @return 枚举的信息
|
*/
|
DataGrid<OsEnumVO> referDataGrid(Map<String, String> conditionMap, PageHelper pageHelper);
|
|
/**
|
* 枚举选项列表
|
* @param pkEnum 枚举的主键
|
* @return 枚举选项
|
*/
|
DataGrid<OsEnumItemVO> gridEnumItemByOid(String pkEnum);
|
|
/**
|
* 根据枚举类型查询枚举:枚举名 , 枚举
|
* @param enumType:String, Integer
|
* @return
|
*/
|
List<Map<String,List<String>>> getEnumMapByType(String enumType);
|
|
}
|