Commit 68226914 authored by wujiang's avatar wujiang

修改公共代码

parent f3f2b5ef
......@@ -191,7 +191,7 @@ public class DataDictionaryController extends BaseController {
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null,null);
"getParent", null, null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
......@@ -205,13 +205,13 @@ public class DataDictionaryController extends BaseController {
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type + "_ID")) {
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type + "_ID");
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type + "_ID");
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
"getParent", null,"getCode");
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type + "_ID", JSON.toJSON(menus), time);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
"getName", "getParent", null, "getCode");
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type + "_ID", JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
......@@ -232,13 +232,12 @@ public class DataDictionaryController extends BaseController {
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null,null);
"getParent", null, null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
......@@ -314,14 +313,14 @@ public class DataDictionaryController extends BaseController {
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null,null);
null, null);
} else {
list = iDataDictionaryService.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null,null);
null, null);
}
// 创建根节点
Menu menu = new Menu(-1L, rootName, -1L, menus, 0);
......@@ -364,6 +363,22 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(type);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionaryNotokenBySeq/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典不验证token", notes = "根据字典类型查询字典不验证token")
public ResponseModel<Object> gwmcDataDictionaryNotokenBySeq(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
"getName", "getParent", null, null);
return ResponseHelper.buildResponse(menus);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionaryNotoken/{type}", method = RequestMethod.GET)
......@@ -382,21 +397,18 @@ public class DataDictionaryController extends BaseController {
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null,null);
"getParent", null, null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/child-list")
@ApiOperation(httpMethod = "GET", value = "根据字典类型type和desc查询字典列表", notes = "根据字典类型type和desc查询字典列表")
public ResponseModel<List<DataDictionary>> getChildList(@RequestParam(value = "type") String type,
@RequestParam(value = "group") String group
){
return ResponseHelper.buildResponse(iDataDictionaryService.getChildList(type,group));
@RequestParam(value = "group") String group) {
return ResponseHelper.buildResponse(iDataDictionaryService.getChildList(type, group));
}
}
......@@ -94,6 +94,7 @@ public class PermissionInterceptor implements Interceptor {
try {
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql);
} catch (Exception e) {
e.printStackTrace();
PermissionInterceptorContext.clean();
logger.debug(e.getMessage());
}
......
......@@ -17,7 +17,7 @@ public interface IDataDictionaryService {
Object getFireChemical(String type) throws Exception;
Object gwmcDataDictionary(String type) throws Exception;
List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
public List<DataDictionary> getByType(String type);
......
......@@ -257,7 +257,7 @@ public class TreeParser {
//递归退出条件
if (childList.size() == 0) {
return null;
return new ArrayList<Menu>();
}
return childList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment