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
06f75e63
Commit
06f75e63
authored
May 17, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改菜单权限
parent
b5510e23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
43 deletions
+47
-43
TzsAppController.java
...amos/boot/module/tzs/biz/controller/TzsAppController.java
+11
-21
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+34
-21
TzBaseEnterpriseInfoServiceImpl.java
...tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+2
-1
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzsAppController.java
View file @
06f75e63
...
...
@@ -47,6 +47,8 @@ public class TzsAppController {
@Autowired
private
EquipmentCategoryServiceImpl
equipmentCategoryService
;
private
static
final
String
LEVEL
=
"company"
;
private
static
final
String
COMPANYPATH
=
"/company"
;
private
static
final
String
JIANGUAN
=
"/"
;
/**
* 获取设计信息
...
...
@@ -102,33 +104,21 @@ public class TzsAppController {
@RequestMapping
(
value
=
"/permission/tree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"小程序菜单权限"
,
notes
=
"小程序菜单权限"
)
public
FeignClientResult
<
Collection
<
PermissionModel
>>
tree
(
HttpServletRequest
http
,
@RequestParam
(
value
=
"most"
,
required
=
false
)
String
most
)
{
//判断当前身份
String
token
=
http
.
getHeader
(
"token"
);
FeignClientResult
<
Collection
<
PermissionModel
>>
app
;
app
=
Privilege
.
permissionClient
.
queryPermissionTree
(
"APP"
,
null
,
null
,
null
,
null
);
FeignClientResult
<
Collection
<
PermissionModel
>>
app
=
new
FeignClientResult
<
Collection
<
PermissionModel
>>();
if
(
ValidationUtil
.
isEmpty
(
most
))
{
//根据当前登录人的公司是企业还是监管来过滤
JSONObject
object
=
equipmentCategoryService
.
getCompanyType
();
String
level
=
object
.
getString
(
"level"
);
if
(!
ValidationUtil
.
isEmpty
(
level
))
{
if
(
LEVEL
.
equals
(
level
))
{
List
<
JSONObject
>
objectList
=
equipmentCategoryService
.
getCompanyType
();
List
<
JSONObject
>
total
=
objectList
.
stream
().
filter
(
item
->
!
LEVEL
.
equals
(
item
.
getString
(
"level"
))).
collect
(
Collectors
.
toList
());
if
(
total
.
size
()==
0
)
{
//企业
Collection
<
PermissionModel
>
result
=
app
.
getResult
();
List
<
PermissionModel
>
lists
=
result
.
stream
().
filter
(
item
->
item
.
getAppName
().
equals
(
"企业端"
)).
collect
(
Collectors
.
toList
());
app
.
setResult
(
lists
);
app
=
Privilege
.
permissionClient
.
queryPermissionTree
(
"APP"
,
null
,
null
,
COMPANYPATH
,
null
);
}
else
{
//监管
Collection
<
PermissionModel
>
result
=
app
.
getResult
();
List
<
PermissionModel
>
lists
=
result
.
stream
().
filter
(
item
->
item
.
getAppName
().
equals
(
"监管端"
)).
collect
(
Collectors
.
toList
());
app
.
setResult
(
lists
);
app
=
Privilege
.
permissionClient
.
queryPermissionTree
(
"APP"
,
null
,
null
,
JIANGUAN
,
null
);
}
}
if
(
ValidationUtil
.
isEmpty
(
most
))
{
}
else
{
//更多应用
Collection
<
PermissionModel
>
result
=
app
.
getResult
();
List
<
PermissionModel
>
lists
=
result
.
stream
().
filter
(
item
->
!
item
.
getPermissionName
().
contains
(
"运营监管分析"
)
&&
!
item
.
getPermissionName
().
contains
(
"综合统计"
)).
collect
(
Collectors
.
toList
());
app
.
setResult
(
lists
);
app
=
Privilege
.
permissionClient
.
queryPermissionTree
(
"APP"
,
null
,
null
,
most
,
null
);
}
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
06f75e63
...
...
@@ -508,14 +508,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @return
*/
public
JSONObject
getCompanyType
()
{
public
List
<
JSONObject
>
getCompanyType
()
{
ResponseModel
<
AgencyUserModel
>
me
=
privilegeFeginService
.
getMe
();
CompanyModel
companyModel
=
(
me
.
getResult
().
getCompanys
()).
get
(
0
);
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"level"
,
companyModel
.
getLevel
());
object
.
put
(
"orgCode"
,
companyModel
.
getOrgCode
());
object
.
put
(
"companyCode"
,
companyModel
.
getCompanyCode
());
return
object
;
List
<
CompanyModel
>
companys
=
me
.
getResult
().
getCompanys
();
List
<
JSONObject
>
objectList
=
new
ArrayList
<>();
for
(
CompanyModel
company
:
companys
)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"level"
,
company
.
getLevel
());
object
.
put
(
"orgCode"
,
company
.
getOrgCode
());
object
.
put
(
"companyCode"
,
company
.
getCompanyCode
());
objectList
.
add
(
object
);
}
return
objectList
;
}
...
...
@@ -534,22 +538,31 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
map
.
put
(
EQUSTATE
,
EquimentEnum
.
getCode
.
get
(
map
.
get
(
EQUSTATE
).
toString
()).
toString
());
}
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
model
=
new
ResponseModel
<>();
JSONObject
object
=
getCompanyType
();
String
level
=
object
.
getString
(
"level"
);
String
code
=
object
.
getString
(
"orgCode"
);
String
companyCode
=
object
.
getString
(
"companyCode"
);
if
(!
ValidationUtil
.
isEmpty
(
level
))
{
if
(
LEVEL
.
equals
(
level
))
{
//企业
map
.
put
(
"USE_UNIT_CREDIT_CODE"
,
companyCode
);
model
=
idxFeignService
.
getPage
(
map
);
}
else
{
//监管单位
map
.
put
(
"ORG_BRANCH_CODE"
,
code
);
model
=
idxFeignService
.
getPage
(
map
);
List
<
JSONObject
>
objectList
=
getCompanyType
();
List
<
Map
<
String
,
Object
>>
res
=
new
ArrayList
<>();
for
(
JSONObject
object
:
objectList
)
{
String
level
=
object
.
getString
(
"level"
);
String
code
=
object
.
getString
(
"orgCode"
);
String
companyCode
=
object
.
getString
(
"companyCode"
);
if
(!
ValidationUtil
.
isEmpty
(
level
))
{
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
m
=
new
ResponseModel
<>();
if
(
LEVEL
.
equals
(
level
))
{
//企业
map
.
put
(
"USE_UNIT_CREDIT_CODE"
,
companyCode
);
m
=
idxFeignService
.
getPage
(
map
);
}
else
{
//监管单位
map
.
put
(
"ORG_BRANCH_CODE"
,
code
);
m
=
idxFeignService
.
getPage
(
map
);
}
}
res
.
addAll
(
model
.
getResult
().
getRecords
());
}
model
.
getResult
().
setRecords
(
res
);
if
(!
ValidationUtil
.
isEmpty
(
res
))
{
model
.
getResult
().
setTotal
(
res
.
size
());
}
//设备状态码对应枚举值
List
<
Map
<
String
,
Object
>>
records
=
model
.
getResult
().
getRecords
();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
06f75e63
...
...
@@ -133,7 +133,8 @@ public class TzBaseEnterpriseInfoServiceImpl
}
}
Page
<
TzBaseEnterpriseInfoDto
>
page
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
JSONObject
companyType
=
equipmentCategoryService
.
getCompanyType
();
List
<
JSONObject
>
companyType1
=
equipmentCategoryService
.
getCompanyType
();
JSONObject
companyType
=
companyType1
.
get
(
0
);
String
orgCode
=
companyType
.
getString
(
"orgCode"
);
if
(!
ValidationUtil
.
isEmpty
(
orgCode
))
{
tzBaseEnterpriseInfoDto
.
setSuperviseOrgCode
(
orgCode
);
...
...
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