Commit 0004dfec authored by chenzhao's avatar chenzhao

Merge branch 'chenhao' of http://172.16.10.76/moa/amos-boot-biz into chenhao

parents e0405eab 30ae3bd6
......@@ -180,6 +180,7 @@ public class DataDictionaryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<Object> gwmcDataDictionary(@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");
......@@ -189,7 +190,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
......@@ -201,6 +202,7 @@ public class DataDictionaryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam 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");
......@@ -210,7 +212,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
......@@ -222,6 +224,7 @@ public class DataDictionaryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
public ResponseModel<Object> gwmcDataDictionaryFireChemical(@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");
......@@ -231,7 +234,7 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
"getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
Me.setIsLeaf(false);
......@@ -259,7 +262,8 @@ public class DataDictionaryController extends BaseController {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = null;
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName",
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN + type, JSON.toJSON(menus), time);
objectObjectHashMap.put(type, menus);
......@@ -286,12 +290,14 @@ public class DataDictionaryController extends BaseController {
if ("YJLDDW".equals(type)) {
list = dataDictionaryMapper.getNoInLinkUnit();
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null);
} else {
list = iDataDictionaryService.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null);
}
// 创建根节点
......
......@@ -49,7 +49,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
// 数据字典还原 by kongfm 2021-09-09
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
"getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
Me.setIsLeaf(false);
......@@ -71,7 +72,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName"
// 数据字典还原 by kongfm 2021-09-09
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return menus;
......@@ -85,7 +87,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName"
// 数据字典还原 by kongfm 2021-09-09
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
return menus;
......
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