ludc
2024-09-06 c67c8367ae83ad8304212f532994eb04e2fc215e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
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);
 
}