|
|
@@ -5,7 +5,6 @@ import java.util.Date;
|
|
5
|
5
|
import java.util.HashMap;
|
|
6
|
6
|
import java.util.List;
|
|
7
|
7
|
import java.util.Map;
|
|
8
|
|
-import java.util.Random;
|
|
9
|
8
|
|
|
10
|
9
|
import javax.annotation.Resource;
|
|
11
|
10
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -23,8 +22,6 @@ import com.chinaitop.depot.basic.model.BasicEnumExample.Criteria;
|
|
23
|
22
|
import com.chinaitop.depot.basic.model.BasicEnumVo;
|
|
24
|
23
|
import com.chinaitop.depot.basic.service.BasicEnumService;
|
|
25
|
24
|
import com.chinaitop.depot.common.service.ImportServiceImpl;
|
|
26
|
|
-import com.chinaitop.depot.utils.RedisUtil;
|
|
27
|
|
-import com.chinaitop.utils.ParameterUtil;
|
|
28
|
25
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
29
|
26
|
import com.github.pagehelper.PageHelper;
|
|
30
|
27
|
import com.github.pagehelper.PageInfo;
|
|
|
@@ -54,13 +51,6 @@ public class BasicEnumController {
|
|
54
|
51
|
@Value("${web.upload-path}")
|
|
55
|
52
|
private String uploadPath;
|
|
56
|
53
|
|
|
57
|
|
- /**
|
|
58
|
|
- * 查找数据字典大类信息
|
|
59
|
|
- * @param pageNum 页数
|
|
60
|
|
- * @param pageSize 每页显示的条数
|
|
61
|
|
- * @param enumName 字典数据名称
|
|
62
|
|
- * @return
|
|
63
|
|
- */
|
|
64
|
54
|
@RequestMapping(value="/getList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
65
|
55
|
@ApiOperation(value="查询字典数据", notes = "查询字典数据列表,支持分页")
|
|
66
|
56
|
@ApiImplicitParams({
|
|
|
@@ -94,11 +84,6 @@ public class BasicEnumController {
|
|
94
|
84
|
return pageInfo;
|
|
95
|
85
|
}
|
|
96
|
86
|
|
|
97
|
|
- /**
|
|
98
|
|
- * 根据编号查找数据字典大类信息
|
|
99
|
|
- * @param id 数据ID
|
|
100
|
|
- * @return
|
|
101
|
|
- */
|
|
102
|
87
|
@RequestMapping(value="/findByEnum", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
|
|
103
|
88
|
@ApiOperation(value="按ID查询字典数据", notes = "查询一条字典数据")
|
|
104
|
89
|
@ApiImplicitParams({
|
|
|
@@ -117,12 +102,7 @@ public class BasicEnumController {
|
|
117
|
102
|
}
|
|
118
|
103
|
return basicEnum;
|
|
119
|
104
|
}
|
|
120
|
|
-
|
|
121
|
|
- /**
|
|
122
|
|
- * 更新数据字典大类信息
|
|
123
|
|
- * @param enumJson 字典数据对象
|
|
124
|
|
- * @return
|
|
125
|
|
- */
|
|
|
105
|
+
|
|
126
|
106
|
@RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
127
|
107
|
@ApiOperation(value="更新字典数据", notes = "新增或修改数据字典")
|
|
128
|
108
|
@ApiImplicitParams({
|
|
|
@@ -150,12 +130,7 @@ public class BasicEnumController {
|
|
150
|
130
|
}
|
|
151
|
131
|
return modelMap;
|
|
152
|
132
|
}
|
|
153
|
|
-
|
|
154
|
|
- /**
|
|
155
|
|
- * 按数据字典大类ID逻辑删除数据字典大类信息
|
|
156
|
|
- * @param id 数据ID
|
|
157
|
|
- * @return
|
|
158
|
|
- */
|
|
|
133
|
+
|
|
159
|
134
|
@RequestMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
160
|
135
|
@ApiOperation(value="删除字典数据", notes="删除字典数据")
|
|
161
|
136
|
@ApiImplicitParams({
|
|
|
@@ -180,24 +155,14 @@ public class BasicEnumController {
|
|
180
|
155
|
}
|
|
181
|
156
|
return modelMap;
|
|
182
|
157
|
}
|
|
183
|
|
-
|
|
184
|
|
- /**
|
|
185
|
|
- * 获取数据字典json树结构
|
|
186
|
|
- * @return
|
|
187
|
|
- * @throws Exception
|
|
188
|
|
- */
|
|
|
158
|
+
|
|
189
|
159
|
@RequestMapping(value="/getTree", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
|
|
190
|
160
|
@ApiOperation(value="查询字典数据树", notes="查询字典数据树")
|
|
191
|
161
|
public List<BasicEnum> getTree() {
|
|
192
|
162
|
List<BasicEnum> list = enumService.queryByTree();
|
|
193
|
163
|
return list;
|
|
194
|
164
|
}
|
|
195
|
|
-
|
|
196
|
|
- /**
|
|
197
|
|
- * 枚举字典数据获取统一对外接口
|
|
198
|
|
- * @return
|
|
199
|
|
- * @throws Exception
|
|
200
|
|
- */
|
|
|
165
|
+
|
|
201
|
166
|
@RequestMapping(value="/findEnumObj", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
|
|
202
|
167
|
@ApiOperation(value="获取枚举字典数据统一对外接口", notes="获取枚举字典数据统一对外接口")
|
|
203
|
168
|
public Map<String, Object> findEnumObj() throws Exception {
|
|
|
@@ -208,12 +173,7 @@ public class BasicEnumController {
|
|
208
|
173
|
map.put("enumMap", enumMap);
|
|
209
|
174
|
return map;
|
|
210
|
175
|
}
|
|
211
|
|
-
|
|
212
|
|
- /**
|
|
213
|
|
- * 根据id获取所有子节点
|
|
214
|
|
- * @param enumid 节点id
|
|
215
|
|
- * @return
|
|
216
|
|
- */
|
|
|
176
|
+
|
|
217
|
177
|
@RequestMapping(value="/getAllChildren", method=RequestMethod.GET)
|
|
218
|
178
|
@ApiOperation(value="根据id获取这个字典下所有子节点", notes="根据id获取这个字典下所有子节点")
|
|
219
|
179
|
@ApiImplicitParams({
|
|
|
@@ -299,15 +259,7 @@ public class BasicEnumController {
|
|
299
|
259
|
modelMap.put("enumId", enumId);
|
|
300
|
260
|
return modelMap;
|
|
301
|
261
|
}
|
|
302
|
|
-
|
|
303
|
|
-
|
|
304
|
|
- /**
|
|
305
|
|
- * 根据id获取这个字典下所有子节点(有固定格式数据需要)
|
|
306
|
|
- *
|
|
307
|
|
- * @param request
|
|
308
|
|
- * @param deviceTypeId 字典ID
|
|
309
|
|
- * @return
|
|
310
|
|
- */
|
|
|
262
|
+
|
|
311
|
263
|
@RequestMapping(value="/getTreeTypeList", method=RequestMethod.GET)
|
|
312
|
264
|
@ApiOperation(value="根据id获取这个字典下所有子节点(有固定格式数据需要)", notes="根据id获取这个字典下所有子节点(有固定格式数据需要)")
|
|
313
|
265
|
@ApiImplicitParams({
|
|
|
@@ -347,5 +299,23 @@ public class BasicEnumController {
|
|
347
|
299
|
}
|
|
348
|
300
|
return modelMap;
|
|
349
|
301
|
}
|
|
|
302
|
+
|
|
|
303
|
+ @RequestMapping(value="/findConditionEnum", method=RequestMethod.GET)
|
|
|
304
|
+ @ApiOperation(value="根据id获取一个树结构", notes="")
|
|
|
305
|
+ @ApiImplicitParams({
|
|
|
306
|
+ @ApiImplicitParam(name="parentId", value="字典父级ID", paramType="query"),
|
|
|
307
|
+ @ApiImplicitParam(name="notParentId", value="要排除的父级ID", paramType="query"),
|
|
|
308
|
+ @ApiImplicitParam(name="notEnumId", value="要排除的字典ID", paramType="query")
|
|
|
309
|
+ })
|
|
|
310
|
+ public List<BasicEnumVo> getTreeTypeList(Integer parentId, Integer notParentId, Integer notEnumId) {
|
|
|
311
|
+ List<BasicEnumVo> voList = null;
|
|
|
312
|
+ try {
|
|
|
313
|
+ voList = enumService.findCondition(parentId, notParentId, notEnumId);
|
|
|
314
|
+ } catch (Exception e) {
|
|
|
315
|
+ e.printStackTrace();
|
|
|
316
|
+ }
|
|
|
317
|
+
|
|
|
318
|
+ return voList;
|
|
|
319
|
+ }
|
|
350
|
320
|
|
|
351
|
321
|
}
|