Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
Overview
Overview
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
base_platform_enterprise
gic-data-cloud
Commits
cede3f35
Commit
cede3f35
authored
Mar 25, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能模块调整:采用gic应用菜单数据
parent
73d48d9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
106 deletions
+36
-106
IndexController.java
...in/java/com/gic/cloud/web/controller/IndexController.java
+36
-9
FunctionModuleVo.java
.../src/main/java/com/gic/cloud/web/vo/FunctionModuleVo.java
+0
-97
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/IndexController.java
View file @
cede3f35
...
...
@@ -2,12 +2,17 @@ package com.gic.cloud.web.controller;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.auth.service.UserApiService
;
import
com.gic.cloud.dto.FunctionDTO
;
import
com.gic.cloud.dto.FunctionModuleDTO
;
import
com.gic.cloud.service.FunctionApiService
;
import
com.gic.cloud.service.FunctionModuleApiService
;
import
com.gic.cloud.service.IndexApiService
;
import
com.gic.cloud.web.auth.DataAuthUtils
;
import
com.gic.cloud.web.constant.ErrorCode
;
import
com.gic.cloud.web.qo.DateTypeQo
;
import
com.gic.cloud.web.utils.DataFormatUtils
;
import
com.gic.cloud.web.vo.FunctionModuleVo
;
...
...
@@ -30,6 +35,8 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 字典
* @ClassName: IndexController
...
...
@@ -48,6 +55,10 @@ public class IndexController {
private
DataAuthUtils
dataAuthUtils
;
@Autowired
private
FunctionApiService
functionApiService
;
@Autowired
private
MenuApiService
menuApiService
;
@Autowired
private
UserApiService
userApiService
;
@RequestMapping
(
"index-mbr"
)
public
RestResponse
indexMbr
(
Integer
enterpriseId
,
Integer
userId
){
...
...
@@ -141,17 +152,23 @@ public class IndexController {
}
@RequestMapping
(
"function-list"
)
public
RestResponse
functionList
(
Integer
userId
){
ServiceResponse
<
List
<
FunctionModuleDTO
>>
response
=
this
.
functionApiService
.
getFunctionByUserId
(
userId
);
List
<
FunctionModuleVo
>
list
=
new
ArrayList
<>();
if
(
response
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
())){
for
(
FunctionModuleDTO
dto
:
response
.
getResult
()){
if
(
dto
!=
null
){
list
.
add
(
EntityUtil
.
changeEntityByJSON
(
FunctionModuleVo
.
class
,
dto
));
}
public
RestResponse
functionList
(
Integer
userId
)
{
UserDTO
userDTO
=
this
.
userApiService
.
getUserInfoById
(
userId
).
getResult
();
if
(
userDTO
==
null
)
{
return
RestResponse
.
failure
(
ErrorCode
.
ACCOUNTNOTEXISTS
.
getCode
(),
"用户不存在"
);
}
ServiceResponse
<
List
<
MenuDTO
>>
userMenu
=
this
.
menuApiService
.
getUserMenuOfAppNotTree
(
userDTO
.
getEnterpriseId
(),
userId
,
null
,
getAppId
(
"gyt-app"
));
if
(
userMenu
.
isSuccess
())
{
List
<
MenuDTO
>
menuList
=
userMenu
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
menuList
))
{
List
<
FunctionModuleVo
>
list
=
menuList
.
stream
().
filter
(
e
->
e
.
getMenuCode
().
length
()
==
6
&&
"FUC"
.
equals
(
e
.
getMenuCode
().
substring
(
0
,
3
)))
.
map
(
e
->
new
FunctionModuleVo
().
setFunctionModuleCode
(
e
.
getMenuCode
()).
setFunctionModuleName
(
e
.
getMenuName
()).
setLogo
(
e
.
getMenuUrl
()))
.
collect
(
Collectors
.
toList
());
return
RestResponse
.
success
(
list
);
}
}
return
RestResponse
.
success
(
list
);
return
RestResponse
.
success
();
}
@RequestMapping
(
"get-level"
)
...
...
@@ -173,4 +190,14 @@ public class IndexController {
return
RestResponse
.
success
(
list
);
}
private
String
getAppId
(
String
menuCode
)
{
//根据menuCode去查询对应的appId
ServiceResponse
<
MenuDTO
>
resp
=
menuApiService
.
getMenuByMenuCode
(
menuCode
);
if
(
resp
.
isSuccess
())
{
MenuDTO
tempDTO
=
resp
.
getResult
();
return
tempDTO
.
getProject
();
}
return
null
;
}
}
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/vo/FunctionModuleVo.java
View file @
cede3f35
...
...
@@ -14,11 +14,6 @@ public class FunctionModuleVo implements Serializable{
private
static
final
long
serialVersionUID
=
1359760668258180981L
;
/**
* ID
*/
private
Integer
functionModuleId
;
/**
* 名称
*/
private
String
functionModuleName
;
...
...
@@ -28,46 +23,8 @@ public class FunctionModuleVo implements Serializable{
*/
private
String
functionModuleCode
;
/**
* 功能模块说明
*/
private
String
functionModuleDesc
;
/**
* 运维操作人ID
*/
private
String
operationId
;
/**
* 运维操作人name
*/
private
String
operationName
;
private
String
logo
;
/**
* 1:有效 0:无效
*/
private
Integer
status
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
public
Integer
getFunctionModuleId
()
{
return
functionModuleId
;
}
public
FunctionModuleVo
setFunctionModuleId
(
Integer
functionModuleId
)
{
this
.
functionModuleId
=
functionModuleId
;
return
this
;
}
public
String
getFunctionModuleName
()
{
return
functionModuleName
;
...
...
@@ -87,60 +44,6 @@ public class FunctionModuleVo implements Serializable{
return
this
;
}
public
String
getFunctionModuleDesc
()
{
return
functionModuleDesc
;
}
public
FunctionModuleVo
setFunctionModuleDesc
(
String
functionModuleDesc
)
{
this
.
functionModuleDesc
=
functionModuleDesc
;
return
this
;
}
public
String
getOperationId
()
{
return
operationId
;
}
public
FunctionModuleVo
setOperationId
(
String
operationId
)
{
this
.
operationId
=
operationId
;
return
this
;
}
public
String
getOperationName
()
{
return
operationName
;
}
public
FunctionModuleVo
setOperationName
(
String
operationName
)
{
this
.
operationName
=
operationName
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
FunctionModuleVo
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
FunctionModuleVo
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
FunctionModuleVo
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
return
this
;
}
public
String
getLogo
()
{
return
logo
;
}
...
...
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