|
@@ -1,6 +1,7 @@
|
|
|
package com.ims.eval.controller;
|
|
|
|
|
|
|
|
|
+import com.ims.eval.cache.CacheContext;
|
|
|
import com.ims.eval.dao.result.R;
|
|
|
import com.ims.eval.entity.DataDictionary;
|
|
|
import com.ims.eval.service.IDataDictionaryService;
|
|
@@ -26,20 +27,32 @@ public class DataDictionaryController {
|
|
|
@Autowired
|
|
|
private IDataDictionaryService dataDictionaryService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CacheContext cache;
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ *
|
|
|
+ * @param id 主键ID
|
|
|
+ * @param dataKey 数据key
|
|
|
+ * @param keyName 名称
|
|
|
+ * @param superKey 父类key
|
|
|
+ * @return
|
|
|
+ */
|
|
|
//@ImsPreAuth("eval:dataDictionary:view")
|
|
|
@GetMapping(value = "list")
|
|
|
- public R list( @RequestParam(value = "id", required = false) String id,
|
|
|
+ public R list(@RequestParam(value = "id", required = false) String id,
|
|
|
@RequestParam(value = "dataKey", required = false) String dataKey,
|
|
|
@RequestParam(value = "keyName", required = false) String keyName,
|
|
|
- @RequestParam(value = "superKey", required = false) String superKey ) {
|
|
|
- List<DataDictionary> list = dataDictionaryService.list(id,dataKey,keyName,superKey);
|
|
|
+ @RequestParam(value = "superKey", required = false) String superKey) {
|
|
|
+ List<DataDictionary> list = dataDictionaryService.list(id, dataKey, keyName, superKey);
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 添加
|
|
|
+ *
|
|
|
* @param dictionary
|
|
|
* @return
|
|
|
*/
|
|
@@ -51,6 +64,7 @@ public class DataDictionaryController {
|
|
|
|
|
|
boolean b = dataDictionaryService.saveOrUpdate(dictionary);
|
|
|
if (b) {
|
|
|
+ cache.initDataDictionary();
|
|
|
return R.ok().data(b);
|
|
|
} else {
|
|
|
return R.error().data("保存失败!");
|
|
@@ -71,6 +85,7 @@ public class DataDictionaryController {
|
|
|
String[] strings = ids.split(",");
|
|
|
boolean b = dataDictionaryService.removeByIds(Arrays.asList(strings));
|
|
|
if (b) {
|
|
|
+ cache.initDataDictionary();
|
|
|
return R.ok().data(b);
|
|
|
} else {
|
|
|
return R.error().data("删除失败!");
|
|
@@ -78,5 +93,4 @@ public class DataDictionaryController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|