Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
log-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
log-platform
Commits
7ccacefd
Commit
7ccacefd
authored
Jun 21, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备日志类型筛选
parent
e6f4fb61
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
28 deletions
+29
-28
log-manager-ui/admin/src/views/error/log/list.vue
log-manager-ui/admin/src/views/error/log/list.vue
+12
-1
log-manager-ui/admin/src/views/operate/log/list.vue
log-manager-ui/admin/src/views/operate/log/list.vue
+1
-0
log-manager/src/main/java/com/mortals/xhx/base/framework/aspect/OperlogAspect.java
.../com/mortals/xhx/base/framework/aspect/OperlogAspect.java
+12
-14
log-manager/src/main/java/com/mortals/xhx/common/code/OperTypeEnum.java
...c/main/java/com/mortals/xhx/common/code/OperTypeEnum.java
+2
-3
log-manager/src/main/java/com/mortals/xhx/module/operate/web/OperateLogController.java
.../mortals/xhx/module/operate/web/OperateLogController.java
+2
-10
No files found.
log-manager-ui/admin/src/views/error/log/list.vue
View file @
7ccacefd
...
@@ -61,6 +61,17 @@
...
@@ -61,6 +61,17 @@
label
:
"
消息标识
"
,
label
:
"
消息标识
"
,
fuzzy
:
true
fuzzy
:
true
},
},
,
{
name
:
"
createTimeStart
"
,
type
:
"
date
"
,
label
:
"
开始时间
"
},
{
name
:
"
createTimeEnd
"
,
type
:
"
date
"
,
label
:
"
结束时间
"
},
],
],
columns
:
[
columns
:
[
...
@@ -68,7 +79,7 @@
...
@@ -68,7 +79,7 @@
{
label
:
"
追踪Id
"
,
prop
:
"
id
"
},
{
label
:
"
追踪Id
"
,
prop
:
"
id
"
},
{
label
:
"
应用名称
"
,
prop
:
"
appName
"
,
formatter
:
this
.
formatter
},
{
label
:
"
日志来源
"
,
prop
:
"
appName
"
,
formatter
:
this
.
formatter
},
// {label: "主机名", prop: "hostName"},
// {label: "主机名", prop: "hostName"},
...
...
log-manager-ui/admin/src/views/operate/log/list.vue
View file @
7ccacefd
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
{
label
:
"
操作内容
"
,
prop
:
"
content
"
,
tooltip
:
"
true
"
},
{
label
:
"
操作内容
"
,
prop
:
"
content
"
,
tooltip
:
"
true
"
},
{
label
:
"
操作IP地址
"
,
prop
:
"
ip
"
},
{
label
:
"
操作IP地址
"
,
prop
:
"
ip
"
},
{
label
:
"
操作
"
,
prop
:
"
operType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作时间
"
,
prop
:
"
logDate
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
操作时间
"
,
prop
:
"
logDate
"
,
formatter
:
this
.
formatterDate
},
{
{
...
...
log-manager/src/main/java/com/mortals/xhx/base/framework/aspect/OperlogAspect.java
View file @
7ccacefd
package
com.mortals.xhx.base.framework.aspect
;
package
com.mortals.xhx.base.framework.aspect
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.model.OperateLogPdu
;
import
com.mortals.framework.model.OperateLogPdu
;
import
com.mortals.framework.service.ILogService
;
import
com.mortals.framework.service.ILogService
;
import
com.mortals.framework.service.IMessageProduceService
;
import
com.mortals.framework.service.IMessageProduceService
;
import
com.mortals.framework.service.impl.FileLogServiceImpl
;
import
com.mortals.framework.service.impl.FileLogServiceImpl
;
import
com.mortals.xhx.base.system.oper.model.OperLogEntity
;
import
com.mortals.xhx.base.system.oper.model.OperLogEntity
;
import
com.mortals.xhx.base.system.oper.service.OperLogService
;
import
com.mortals.xhx.base.system.oper.service.OperLogService
;
import
com.mortals.xhx.common.code.OperTypeEnum
;
import
com.mortals.xhx.module.operate.model.OperateLogEntity
;
import
com.mortals.xhx.module.operate.model.OperateLogEntity
;
import
com.mortals.xhx.module.operate.service.OperateLogService
;
import
com.mortals.xhx.module.operate.service.OperateLogService
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
...
@@ -45,20 +47,16 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
...
@@ -45,20 +47,16 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
public
void
doHandlerLog
(
String
platformMark
,
Long
userId
,
String
userName
,
String
loginName
,
String
requestUrl
,
public
void
doHandlerLog
(
String
platformMark
,
Long
userId
,
String
userName
,
String
loginName
,
String
requestUrl
,
String
content
,
String
ip
,
Date
logDate
)
{
String
content
,
String
ip
,
Date
logDate
)
{
super
.
doHandlerLog
(
platformMark
,
userId
,
userName
,
loginName
,
requestUrl
,
content
,
ip
,
logDate
);
super
.
doHandlerLog
(
platformMark
,
userId
,
userName
,
loginName
,
requestUrl
,
content
,
ip
,
logDate
);
int
operType
=
OperTypeEnum
.
OTHER
.
getValue
();
//判断内容包含
if
(
StrUtil
.
contains
(
content
,
"查询"
)||
StrUtil
.
contains
(
content
,
"查看"
))
{
operType
=
OperTypeEnum
.
SEARCH
.
getValue
();
}
else
if
(
StrUtil
.
contains
(
content
,
"保存"
)
||
StrUtil
.
contains
(
content
,
"新增"
)
||
StrUtil
.
contains
(
content
,
"修改"
))
{
operType
=
OperTypeEnum
.
SAVE
.
getValue
();
}
else
if
(
StrUtil
.
contains
(
content
,
"删除"
))
{
operType
=
OperTypeEnum
.
DELETE
.
getValue
();
}
operLogService
.
insertOperLog
(
ip
,
requestUrl
,
userId
,
userName
,
loginName
,
content
);
operLogService
.
insertOperLog
(
ip
,
requestUrl
,
userId
,
userName
,
loginName
,
content
);
//直接调用本地保存一份
// OperateLogPdu operateLogPdu = new OperateLogPdu();
// operateLogPdu.initAttrValue();
// operateLogPdu.setIp(ip);
// operateLogPdu.setRequestUrl(requestUrl);
// operateLogPdu.setUserId(userId);
// operateLogPdu.setUserName(userName);
// operateLogPdu.setLoginName(loginName);
// operateLogPdu.setPlatformMark(platformMark);
// operateLogPdu.setLogDate(logDate);
// operateLogPdu.setContent(content);
// operateLogPdu.setOperType(1);
// messageProducer.syncOperSend(operateLogPdu);
OperateLogEntity
operLogEntity
=
new
OperateLogEntity
();
OperateLogEntity
operLogEntity
=
new
OperateLogEntity
();
operLogEntity
.
initAttrValue
();
operLogEntity
.
initAttrValue
();
...
@@ -70,7 +68,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
...
@@ -70,7 +68,7 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
operLogEntity
.
setPlatformMark
(
platformMark
);
operLogEntity
.
setPlatformMark
(
platformMark
);
operLogEntity
.
setLogDate
(
logDate
);
operLogEntity
.
setLogDate
(
logDate
);
operLogEntity
.
setContent
(
content
);
operLogEntity
.
setContent
(
content
);
operLogEntity
.
setOperType
(
1
);
operLogEntity
.
setOperType
(
operType
);
operateLogService
.
save
(
operLogEntity
,
null
);
operateLogService
.
save
(
operLogEntity
,
null
);
}
}
...
...
log-manager/src/main/java/com/mortals/xhx/common/code/OperTypeEnum.java
View file @
7ccacefd
...
@@ -3,14 +3,13 @@ package com.mortals.xhx.common.code;
...
@@ -3,14 +3,13 @@ package com.mortals.xhx.common.code;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
/**
* Created by chendilin on 2018/3/7.
*/
public
enum
OperTypeEnum
{
public
enum
OperTypeEnum
{
SAVE
(
0
,
"添加"
),
SAVE
(
0
,
"添加"
),
UPDATE
(
1
,
"更新"
),
UPDATE
(
1
,
"更新"
),
DELETE
(
2
,
"删除"
),
DELETE
(
2
,
"删除"
),
SEARCH
(
2
,
"查询"
),
OTHER
(-
1
,
"其它"
);
OTHER
(-
1
,
"其它"
);
private
int
value
;
private
int
value
;
...
...
log-manager/src/main/java/com/mortals/xhx/module/operate/web/OperateLogController.java
View file @
7ccacefd
...
@@ -7,6 +7,7 @@ import com.mortals.framework.exception.AppException;
...
@@ -7,6 +7,7 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.OperTypeEnum
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -52,7 +53,7 @@ public class OperateLogController extends BaseCRUDJsonBodyMappingController<Oper
...
@@ -52,7 +53,7 @@ public class OperateLogController extends BaseCRUDJsonBodyMappingController<Oper
@Override
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"operType"
,
paramService
.
getParamBySecondOrganize
(
"OperateLog"
,
"operType"
));
this
.
addDict
(
model
,
"operType"
,
OperTypeEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"platformMark"
,
paramService
.
getParamBySecondOrganize
(
"OperateLog"
,
"platformMark"
));
this
.
addDict
(
model
,
"platformMark"
,
paramService
.
getParamBySecondOrganize
(
"OperateLog"
,
"platformMark"
));
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
...
@@ -69,15 +70,6 @@ public class OperateLogController extends BaseCRUDJsonBodyMappingController<Oper
...
@@ -69,15 +70,6 @@ public class OperateLogController extends BaseCRUDJsonBodyMappingController<Oper
@Override
@Override
@UnAuth
@UnAuth
public
String
save
(
@RequestBody
OperateLogEntity
entity
)
{
public
String
save
(
@RequestBody
OperateLogEntity
entity
)
{
if
(
"sst-manager"
.
equals
(
entity
.
getPlatformMark
())){
OperateLogEntity
operateLogEntity
=
new
OperateLogEntity
();
operateLogEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
entity
,
operateLogEntity
);
operateLogEntity
.
setPlatformMark
(
"search-gov-manager"
);
this
.
service
.
save
(
operateLogEntity
);
}
return
super
.
save
(
entity
);
return
super
.
save
(
entity
);
}
}
...
...
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