Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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-platform-auth
Commits
2fa1a4f9
Commit
2fa1a4f9
authored
Nov 08, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页查询操作日志
parent
d7b974a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
187 additions
and
3 deletions
+187
-3
MenuController.java
...main/java/com/gic/auth/web/controller/MenuController.java
+80
-3
LogListVO.java
...auth-web/src/main/java/com/gic/auth/web/vo/LogListVO.java
+107
-0
No files found.
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/MenuController.java
View file @
2fa1a4f9
package
com
.
gic
.
auth
.
web
.
controller
;
import
java.util.
List
;
import
java.util.
*
;
import
com.gic.a
uth.web.vo.UserOperationItemAuthVO
;
import
com.gic.
enterprise.utils.ResultControllerUtils
;
import
com.gic.a
pi.base.commons.Page
;
import
com.gic.
auth.web.vo.LogListVO
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -11,11 +11,16 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.MenuLevelConstants
;
import
com.gic.auth.constant.MenuTypeEnum
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.auth.service.MenuItemApiService
;
import
com.gic.auth.web.vo.UserOperationItemAuthVO
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
@RestController
...
...
@@ -43,4 +48,76 @@ public class MenuController {
return
ResultControllerUtils
.
commonResult
(
this
.
menuApiService
.
getNoAuthOperationItemOfGic
(
userId
),
UserOperationItemAuthVO
.
class
);
}
/**
* 获取的页面树
* @Title: listMenuPageTree
* @Description:
* @author guojuxing
* @return com.gic.commons.webapi.reponse.RestResponse
*/
@RequestMapping
(
"/list-log-menu-tree"
)
public
RestResponse
listMenuPageTree
()
{
MenuListQO
params
=
new
MenuListQO
();
params
.
setMenuType
(
MenuTypeEnum
.
PAGE
.
getCode
());
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listMenuTree
(
params
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
changePageListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
}
return
EnterpriseRestResponse
.
failure
(
result
);
}
/**
* 分页查询操作日志
* @Title: listOperationLog
* @Description:
* @author guojuxing
* @param startTime
* @param endTime
* @param menuId
* @param search
* @return com.gic.commons.webapi.reponse.RestResponse
*/
@RequestMapping
(
"/list-log"
)
public
RestResponse
listOperationLog
(
String
startTime
,
String
endTime
,
Integer
menuId
,
String
search
)
{
Page
<
LogListVO
>
result
=
new
Page
<>();
LogListVO
vo
=
new
LogListVO
();
vo
.
setContent
(
"北丐测试"
);
vo
.
setLogId
(
1234567899L
);
vo
.
setLogTime
(
new
Date
());
vo
.
setOperationObject
(
"北丐"
);
vo
.
setProject
(
"北丐-北丐测试"
);
vo
.
setUserName
(
"北丐"
);
List
<
LogListVO
>
list
=
new
ArrayList
<>(
1
);
list
.
add
(
vo
);
result
.
setResult
(
list
);
return
RestResponse
.
success
(
result
);
}
public
static
List
<
Map
<
String
,
Object
>>
changePageListToTree
(
int
storeGroupId
,
List
<
MenuDTO
>
list
)
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
if
(
list
!=
null
)
{
for
(
int
j
=
0
,
length
=
list
.
size
();
j
<
length
;
j
++)
{
MenuDTO
menuDTO
=
list
.
get
(
j
);
if
(
storeGroupId
==
menuDTO
.
getParentId
()
&&
menuDTO
.
getLevel
().
intValue
()
>=
2
)
{
Map
<
String
,
Object
>
data
=
new
HashMap
<>(
16
);
data
.
put
(
"menuId"
,
menuDTO
.
getMenuId
());
data
.
put
(
"menuName"
,
menuDTO
.
getMenuName
());
data
.
put
(
"menuCode"
,
menuDTO
.
getMenuCode
());
data
.
put
(
"parentCode"
,
menuDTO
.
getParentCode
());
data
.
put
(
"parentId"
,
menuDTO
.
getParentId
());
List
<
Map
<
String
,
Object
>>
children
=
changePageListToTree
(
menuDTO
.
getMenuId
(),
list
);
if
(
children
==
null
||
children
.
size
()
<
1
)
{
data
.
put
(
"children"
,
null
);
}
else
{
data
.
put
(
"children"
,
children
);
}
result
.
add
(
data
);
}
}
}
return
result
;
}
}
gic-platform-auth-web/src/main/java/com/gic/auth/web/vo/LogListVO.java
0 → 100644
View file @
2fa1a4f9
package
com
.
gic
.
auth
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 操作日志
* @ClassName: LogListVO
* @Description:
* @author guojuxing
* @date 2019/11/8 2:15 PM
*/
public
class
LogListVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2104494155980859518L
;
private
Long
logId
;
// 商户用户
private
Long
userId
;
private
String
userName
;
// 模块
private
String
project
;
// 操作时间
private
Date
logTime
;
// 日志内容
private
String
content
;
// 创建时间
private
Date
createTime
=
new
Date
();
//关联ID
private
Long
relationId
;
private
String
operationObject
;
public
Long
getLogId
()
{
return
logId
;
}
public
void
setLogId
(
Long
logId
)
{
this
.
logId
=
logId
;
}
public
Long
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getProject
()
{
return
project
;
}
public
void
setProject
(
String
project
)
{
this
.
project
=
project
;
}
public
Date
getLogTime
()
{
return
logTime
;
}
public
void
setLogTime
(
Date
logTime
)
{
this
.
logTime
=
logTime
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getRelationId
()
{
return
relationId
;
}
public
void
setRelationId
(
Long
relationId
)
{
this
.
relationId
=
relationId
;
}
public
String
getOperationObject
()
{
return
operationObject
;
}
public
void
setOperationObject
(
String
operationObject
)
{
this
.
operationObject
=
operationObject
;
}
}
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