Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
b3b178be
Commit
b3b178be
authored
Apr 02, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
77a43078
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
33 deletions
+97
-33
OperType.java
...ava/cn/wisenergy/chnmuseum/party/common/log/OperType.java
+3
-0
SystemOperationLogService.java
...chnmuseum/party/common/log/SystemOperationLogService.java
+83
-33
AuditController.java
...nergy/chnmuseum/party/web/controller/AuditController.java
+7
-0
TBoxOperationController.java
...nmuseum/party/web/controller/TBoxOperationController.java
+4
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/log/OperType.java
View file @
b3b178be
...
...
@@ -22,6 +22,9 @@ public enum OperType {
VIDEO_EXPORT
(
14
,
"视频汇出"
),
UPLOAD
(
15
,
"上传"
),
CHANGE_STYLE
(
16
,
"修改风格"
),
DETAILS
(
17
,
"详情"
),
ACTIVATION
(
18
,
"激活"
),
FAULT
(
19
,
"故障"
)
;
// 错误编码
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/log/SystemOperationLogService.java
View file @
b3b178be
...
...
@@ -2,15 +2,17 @@ package cn.wisenergy.chnmuseum.party.common.log;
import
cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM
;
import
cn.wisenergy.chnmuseum.party.common.enums.RESULT_INFO_ENUM
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.vo.AuditStatusParam
;
import
cn.wisenergy.chnmuseum.party.core.annotations.OperationLog
;
import
cn.wisenergy.chnmuseum.party.mapper.SysLogMapper
;
import
cn.wisenergy.chnmuseum.party.model.SysLog
;
import
cn.wisenergy.chnmuseum.party.model.TOperationLog
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.service.TOperationLogService
;
import
cn.wisenergy.chnmuseum.party.service.impl.AuditServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
javassist.util.HotSwapper
;
...
...
@@ -52,6 +54,9 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
@Autowired
private
TUserServiceImpl
userService
;
@Autowired
private
AuditServiceImpl
auditService
;
@Autowired
private
TOperationLogService
operationLogService
;
...
...
@@ -118,32 +123,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
object
=
point
.
proceed
();
}
catch
(
Exception
e
)
{
// 异常处理记录日志..
//
e.printStackTrace();
e
.
printStackTrace
();
return
getFailResult
();
}
//判断是哪个页面调的用户接口,返回不同日志操作对象
if
(
methodLog
.
operModule
().
getCode
()==
1
){
TUser
u
=
null
;
if
(
methodLog
.
operType
().
getCode
()
==
2
||
methodLog
.
operType
().
getCode
()
==
3
)
{
u
=
(
TUser
)
method_param
[
0
];
}
else
if
(
methodLog
.
operType
().
getCode
()
==
13
)
{
u
=
user
;
}
else
{
String
s
=
(
String
)
method_param
[
0
];
u
=
userService
.
getById
(
s
);
}
switch
(
u
.
getType
()){
case
"2"
:
methodLog
.
operModule
().
setMsg
(
OperModule
.
UNITADMIN
.
getMsg
());
break
;
case
"3"
:
methodLog
.
operModule
().
setMsg
(
OperModule
.
STBBASE
.
getMsg
());
break
;
case
"4"
:
methodLog
.
operModule
().
setMsg
(
OperModule
.
STBACCOUNT
.
getMsg
());
break
;
case
"5"
:
methodLog
.
operModule
().
setMsg
(
OperModule
.
STATISTICALUSER
.
getMsg
());
break
;
}
}
// getMethodLog(user,methodLog,method_param);
if
(
"机顶盒运维信息管理"
.
equals
(
methodLog
.
operModule
().
getMsg
()))
{
TOperationLog
operationLog
=
new
TOperationLog
();
operationLog
.
setCreateTime
(
LocalDateTime
.
now
());
...
...
@@ -164,7 +149,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
// sysLog.setOperationContent(methodName);
sysLog
.
setOperationTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
// 处理设置注解上的参数
getControllerMethodDescription
(
methodLog
,
sysLog
);
getControllerMethodDescription
(
user
,
methodLog
,
sysLog
,
method_param
);
int
insert
=
sysLogMapper
.
insert
(
sysLog
);
return
object
;
...
...
@@ -173,15 +158,80 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
/**
* 获取注解中对方法的描述信息 用于Controller层注解
*
* @param
l
og 日志
* @param
sysL
og 日志
* @param
* @throws Exception
*/
public
void
getControllerMethodDescription
(
MethodLog
log
,
SysLog
sysLog
)
throws
Exception
{
public
void
getControllerMethodDescription
(
TUser
user
,
MethodLog
methodLog
,
SysLog
sysLog
,
Object
[]
method_param
)
throws
Exception
{
// 设置action动作
sysLog
.
setOperationType
(
log
.
operType
().
getMsg
());
// 设置标题
sysLog
.
setOperationObject
(
log
.
operModule
().
getMsg
());
sysLog
.
setOperationType
(
methodLog
.
operType
().
getMsg
());
sysLog
.
setOperationContent
(
methodLog
.
operType
().
getMsg
());
sysLog
.
setOperationObject
(
methodLog
.
operModule
().
getMsg
());
//判断是哪个页面调的用户接口,返回不同日志操作对象
if
(
methodLog
.
operModule
().
getCode
()
==
OperModule
.
USER
.
getCode
())
{
TUser
u
=
null
;
if
(
methodLog
.
operType
().
getCode
()
==
OperType
.
ADD
.
getCode
()
||
methodLog
.
operType
().
getCode
()
==
OperType
.
UPDATE
.
getCode
())
{
u
=
(
TUser
)
method_param
[
0
];
}
else
if
(
methodLog
.
operType
().
getCode
()
==
OperType
.
CHANGE_PASSWORD
.
getCode
())
{
u
=
user
;
}
else
{
String
s
=
(
String
)
method_param
[
0
];
u
=
userService
.
getById
(
s
);
}
switch
(
u
.
getType
())
{
case
"1"
:
// 设置标题
sysLog
.
setOperationObject
(
OperModule
.
USER
.
getMsg
());
break
;
case
"2"
:
sysLog
.
setOperationObject
(
OperModule
.
UNITADMIN
.
getMsg
());
break
;
case
"3"
:
sysLog
.
setOperationObject
(
OperModule
.
STBBASE
.
getMsg
());
break
;
case
"4"
:
sysLog
.
setOperationObject
(
OperModule
.
STBACCOUNT
.
getMsg
());
break
;
case
"5"
:
sysLog
.
setOperationObject
(
OperModule
.
STATISTICALUSER
.
getMsg
());
break
;
}
}
//判断是哪个页面调的审核接口,返回不同日志操作对象
else
if
(
methodLog
.
operModule
().
getCode
()
==
OperModule
.
CHECKVIDEO
.
getCode
())
{
String
type
=
null
;
String
status
=
null
;
if
(
methodLog
.
operType
().
getCode
()
==
OperType
.
AUDIT
.
getCode
())
{
AuditStatusParam
auditStatusParam
=
(
AuditStatusParam
)
method_param
[
0
];
Audit
byId
=
auditService
.
getById
(
auditStatusParam
.
getId
());
type
=
byId
.
getType
();
status
=
auditStatusParam
.
getStatus
();
if
(
"REFUSED"
.
equals
(
status
)){
sysLog
.
setOperationContent
(
AuditStatusEnum
.
REFUSED
.
getMsg
());
}
else
{
sysLog
.
setOperationContent
(
AuditStatusEnum
.
APPROVED_FINAL
.
getMsg
());
}
}
else
if
(
methodLog
.
operType
().
getCode
()
==
OperType
.
DETAILS
.
getCode
())
{
type
=
(
String
)
method_param
[
1
];
}
else
if
(
methodLog
.
operType
().
getCode
()
==
OperType
.
SELECT
.
getCode
())
{
type
=
(
String
)
method_param
[
2
];
}
if
(
AuditTypeEnum
.
EXHIBITION_BOARD
.
name
().
equals
(
type
))
{
sysLog
.
setOperationObject
(
OperModule
.
CHECKDISPLAY
.
getMsg
());
}
else
if
(
AuditTypeEnum
.
LEARNING_CONTENT
.
name
().
equals
(
type
))
{
sysLog
.
setOperationObject
(
OperModule
.
CHECKLEARN
.
getMsg
());
}
else
if
(
AuditTypeEnum
.
VIDEO_CONTENT
.
name
().
equals
(
type
))
{
sysLog
.
setOperationObject
(
OperModule
.
CHECKVIDEO
.
getMsg
());
}
}
else
if
(
methodLog
.
operModule
().
getCode
()
==
OperModule
.
STBOPERATION
.
getCode
()&&
methodLog
.
operType
().
getCode
()==
OperType
.
ACTIVATION
.
getCode
()){
TBoxOperation
o
=
(
TBoxOperation
)
method_param
[
0
];
if
(
o
.
getStatus
()==
2
){
sysLog
.
setOperationType
(
OperType
.
ACTIVATION
.
getMsg
());
}
else
{
sysLog
.
setOperationType
(
OperType
.
FAULT
.
getMsg
());
}
}
}
/**
...
...
@@ -223,7 +273,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
*/
public
static
String
getIp
(
HttpServletRequest
request
)
{
// String ip = request.getHeader("x-forwarded-for");
String
ip
=
ip
=
request
.
getRemoteAddr
();
String
ip
=
ip
=
request
.
getRemoteAddr
();
if
(
ip
==
null
||
ip
.
length
()
==
0
||
"unknown"
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getHeader
(
"Proxy-Client-IP"
);
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AuditController.java
View file @
b3b178be
...
...
@@ -3,6 +3,9 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.log.MethodLog
;
import
cn.wisenergy.chnmuseum.party.common.log.OperModule
;
import
cn.wisenergy.chnmuseum.party.common.log.OperType
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.AuditStatusParam
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
...
...
@@ -59,6 +62,7 @@ public class AuditController extends BaseController {
@ApiImplicitParam
(
name
=
"status"
,
value
=
"TBC,REFUSED,TBCA,APPROVED_FINAL"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"level"
,
value
=
"TBC,TBCA"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@MethodLog
(
operModule
=
OperModule
.
RECHECK
,
operType
=
OperType
.
SELECT
)
public
Map
<
String
,
Object
>
getUserList
(
String
name
,
String
status
,
String
level
)
{
Page
<
Audit
>
auditList
;
try
{
...
...
@@ -93,6 +97,7 @@ public class AuditController extends BaseController {
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"/audit/update"
)
@ApiOperation
(
value
=
"修改禁用审核信息"
,
notes
=
"修改禁用审核信息"
)
@MethodLog
(
operModule
=
OperModule
.
RECHECK
,
operType
=
OperType
.
AUDIT
)
public
Map
<
String
,
Object
>
updateAudit
(
@RequestBody
@Validated
(
value
=
{
Update
.
class
})
Audit
audit
)
{
boolean
flag
;
//如果层级是初审,设置初审时间
...
...
@@ -201,6 +206,7 @@ public class AuditController extends BaseController {
@ApiOperation
(
value
=
"获取禁用审核详情"
,
notes
=
"获取禁用审核详情"
)
@GetMapping
(
"/getById"
)
@RequiresPermissions
(
"/audit/getById"
)
@MethodLog
(
operModule
=
OperModule
.
CHECKVIDEO
,
operType
=
OperType
.
DETAILS
)
public
Map
<
String
,
Object
>
getById
(
String
id
,
String
type
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
try
{
...
...
@@ -281,6 +287,7 @@ public class AuditController extends BaseController {
@PutMapping
(
"/updateAuditAllById"
)
@RequiresPermissions
(
"/audit/update"
)
@ApiOperation
(
value
=
"审核管理===根据id修改审核信息"
,
notes
=
"审核管理===根据id修改审核信息"
)
@MethodLog
(
operModule
=
OperModule
.
CHECKVIDEO
,
operType
=
OperType
.
AUDIT
)
public
Map
<
String
,
Object
>
updateAuditAllById
(
@RequestBody
@Validated
AuditStatusParam
auditStatusParam
)
{
String
id
=
auditStatusParam
.
getId
();
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TBoxOperationController.java
View file @
b3b178be
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.wisenergy.chnmuseum.party.common.log.MethodLog
;
import
cn.wisenergy.chnmuseum.party.common.log.OperModule
;
import
cn.wisenergy.chnmuseum.party.common.log.OperType
;
import
cn.wisenergy.chnmuseum.party.common.util.RSAUtils
;
import
cn.wisenergy.chnmuseum.party.model.TBoxOperation
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
...
...
@@ -104,6 +107,7 @@ public class TBoxOperationController extends BaseController {
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"/boxOperation/update"
)
@ApiOperation
(
value
=
"修改机顶盒运维信息"
,
notes
=
"修改机顶盒运维信息"
)
@MethodLog
(
operModule
=
OperModule
.
STBOPERATION
,
operType
=
OperType
.
ACTIVATION
)
public
Map
<
String
,
Object
>
updateTBoxOperation
(
TBoxOperation
tBoxOperation
)
{
try
{
if
(
tBoxOperation
!=
null
&&
StringUtils
.
isNotBlank
(
tBoxOperation
.
getMac
()))
{
...
...
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