Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
7d9ff827
Commit
7d9ff827
authored
Sep 08, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
parent
4153ee54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
DataDictionaryController.java
.../boot/biz/common/controller/DataDictionaryController.java
+12
-9
DataDictionaryServiceImpl.java
...ot/biz/common/service/impl/DataDictionaryServiceImpl.java
+6
-3
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/controller/DataDictionaryController.java
View file @
7d9ff827
...
@@ -179,7 +179,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -179,7 +179,7 @@ public class DataDictionaryController extends BaseController {
@RequestMapping
(
value
=
"/gwmcDataDictionary/{type}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/gwmcDataDictionary/{type}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典"
,
notes
=
"根据字典类型查询字典"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典"
,
notes
=
"根据字典类型查询字典"
)
public
ResponseModel
<
Object
>
gwmcDataDictionary
(
@PathVariable
String
type
)
throws
Exception
{
public
ResponseModel
<
Object
>
gwmcDataDictionary
(
@PathVariable
String
type
)
throws
Exception
{
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
...
@@ -189,7 +189,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -189,7 +189,7 @@ public class DataDictionaryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
obj
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"get
Code"
,
0
,
"getName"
,
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"get
SequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
"getParent"
,
null
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
...
@@ -200,7 +200,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -200,7 +200,7 @@ public class DataDictionaryController extends BaseController {
@RequestMapping
(
value
=
"/dataDictionary"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/dataDictionary"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典2"
,
notes
=
"根据字典类型查询字典2"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询字典2"
,
notes
=
"根据字典类型查询字典2"
)
public
ResponseModel
<
Object
>
getDictionary
(
@RequestParam
String
type
)
throws
Exception
{
public
ResponseModel
<
Object
>
getDictionary
(
@RequestParam
String
type
)
throws
Exception
{
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
...
@@ -210,7 +210,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -210,7 +210,7 @@ public class DataDictionaryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
obj
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"get
Code"
,
0
,
"getName"
,
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"get
SequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
"getParent"
,
null
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
...
@@ -221,7 +221,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -221,7 +221,7 @@ public class DataDictionaryController extends BaseController {
@RequestMapping
(
value
=
"/gwmcDataDictionary/FireChemical/{type}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/gwmcDataDictionary/FireChemical/{type}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询危险品字典"
,
notes
=
"根据字典类型查询危险品字典"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据字典类型查询危险品字典"
,
notes
=
"根据字典类型查询危险品字典"
)
public
ResponseModel
<
Object
>
gwmcDataDictionaryFireChemical
(
@PathVariable
String
type
)
throws
Exception
{
public
ResponseModel
<
Object
>
gwmcDataDictionaryFireChemical
(
@PathVariable
String
type
)
throws
Exception
{
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
eq
(
"type"
,
type
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
...
@@ -231,7 +231,7 @@ public class DataDictionaryController extends BaseController {
...
@@ -231,7 +231,7 @@ public class DataDictionaryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
obj
);
return
ResponseHelper
.
buildResponse
(
obj
);
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
MenuFrom
>
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"get
Code"
,
0
,
List
<
MenuFrom
>
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"get
SequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
"getName"
,
"getParent"
,
null
);
MenuFrom
Me
=
new
MenuFrom
(
"-1"
,
"-1"
,
"-1"
,
"危化品库"
,
"危化品库"
,
"危化品库"
,
"-1"
,
null
);
MenuFrom
Me
=
new
MenuFrom
(
"-1"
,
"-1"
,
"-1"
,
"危化品库"
,
"危化品库"
,
"危化品库"
,
"-1"
,
null
);
Me
.
setIsLeaf
(
false
);
Me
.
setIsLeaf
(
false
);
...
@@ -258,7 +258,8 @@ public class DataDictionaryController extends BaseController {
...
@@ -258,7 +258,8 @@ public class DataDictionaryController extends BaseController {
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
List
<
MenuFrom
>
menus
=
null
;
List
<
MenuFrom
>
menus
=
null
;
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
,
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
"getParent"
,
null
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE_XIN
+
type
,
JSON
.
toJSON
(
menus
),
time
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE_XIN
+
type
,
JSON
.
toJSON
(
menus
),
time
);
objectObjectHashMap
.
put
(
type
,
menus
);
objectObjectHashMap
.
put
(
type
,
menus
);
...
@@ -284,11 +285,13 @@ public class DataDictionaryController extends BaseController {
...
@@ -284,11 +285,13 @@ public class DataDictionaryController extends BaseController {
List
<
Menu
>
menus
=
null
;
List
<
Menu
>
menus
=
null
;
if
(
"YJLDDW"
.
equals
(
type
))
{
if
(
"YJLDDW"
.
equals
(
type
))
{
list
=
dataDictionaryMapper
.
getNoInLinkUnit
();
list
=
dataDictionaryMapper
.
getNoInLinkUnit
();
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
,
"getParent"
,
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
null
);
}
else
{
}
else
{
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
list
=
iDataDictionaryService
.
list
(
queryWrapper
);
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
,
"getParent"
,
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
null
);
}
}
// 创建根节点
// 创建根节点
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/service/impl/DataDictionaryServiceImpl.java
View file @
7d9ff827
...
@@ -48,7 +48,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
...
@@ -48,7 +48,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return
obj
;
return
obj
;
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
this
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
this
.
list
(
queryWrapper
);
List
<
MenuFrom
>
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List
<
MenuFrom
>
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
"getName"
,
"getParent"
,
null
);
MenuFrom
Me
=
new
MenuFrom
(
"-1"
,
"-1"
,
"-1"
,
"危化品库"
,
"危化品库"
,
"危化品库"
,
"-1"
,
null
);
MenuFrom
Me
=
new
MenuFrom
(
"-1"
,
"-1"
,
"-1"
,
"危化品库"
,
"危化品库"
,
"危化品库"
,
"-1"
,
null
);
Me
.
setIsLeaf
(
false
);
Me
.
setIsLeaf
(
false
);
...
@@ -69,7 +70,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
...
@@ -69,7 +70,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return
obj
;
return
obj
;
}
else
{
}
else
{
Collection
<
DataDictionary
>
list
=
this
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
this
.
list
(
queryWrapper
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
,
"getParent"
,
null
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
redisUtils
.
set
(
RedisKey
.
DATA_DICTIONARY_CODE
+
type
,
JSON
.
toJSON
(
menus
),
time
);
return
menus
;
return
menus
;
...
@@ -82,7 +84,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
...
@@ -82,7 +84,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
queryWrapper
.
orderByAsc
(
"sort_num"
);
queryWrapper
.
orderByAsc
(
"sort_num"
);
Collection
<
DataDictionary
>
list
=
this
.
list
(
queryWrapper
);
Collection
<
DataDictionary
>
list
=
this
.
list
(
queryWrapper
);
List
<
MenuFrom
>
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getCode"
,
0
,
"getName"
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List
<
MenuFrom
>
menus
=
TreeParser
.
getTreexin
(
null
,
list
,
DataDictionary
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
,
"getParent"
,
null
);
return
menus
;
return
menus
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment