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
68226914
Commit
68226914
authored
Nov 24, 2022
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改公共代码
parent
f3f2b5ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
17 deletions
+30
-17
DataDictionaryController.java
.../boot/biz/common/controller/DataDictionaryController.java
+27
-15
PermissionInterceptor.java
...s/boot/biz/common/interceptors/PermissionInterceptor.java
+1
-0
IDataDictionaryService.java
.../amos/boot/biz/common/service/IDataDictionaryService.java
+1
-1
TreeParser.java
...va/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
+1
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/controller/DataDictionaryController.java
View file @
68226914
...
...
@@ -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"
,
"get
Parent"
,
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
,
"get
Name"
,
"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
));
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptor.java
View file @
68226914
...
...
@@ -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
());
}
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/service/IDataDictionaryService.java
View file @
68226914
...
...
@@ -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
);
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/TreeParser.java
View file @
68226914
...
...
@@ -257,7 +257,7 @@ public class TreeParser {
//递归退出条件
if
(
childList
.
size
()
==
0
)
{
return
n
ull
;
return
n
ew
ArrayList
<
Menu
>()
;
}
return
childList
;
...
...
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