Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
966d7f90
提交
966d7f90
authored
5月 30, 2022
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 操作日志列表查询条件包含多个操作类型结果集逻辑错误
上级
620661f1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
30 行删除
+20
-30
LogService.java
...src/main/java/io/dataease/service/sys/log/LogService.java
+20
-30
没有找到文件。
backend/src/main/java/io/dataease/service/sys/log/LogService.java
浏览文件 @
966d7f90
...
...
@@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.ss.usermodel.*
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.OutputStream
;
...
...
@@ -46,15 +47,14 @@ public class LogService {
private
static
Integer
[]
driver_file_ope
=
{
11
,
3
};
// 排除驱动和驱动文件的公共操作的资源类型
// 暂时屏蔽视图日志
// private static Integer[] COMMON_SOURCE = {1, 2,3,4,6,7,8,9};
private
static
Integer
[]
COMMON_SOURCE
=
{
1
,
2
,
3
,
6
,
7
,
8
,
9
};
private
static
Integer
[]
COMMON_SOURCE
=
{
1
,
2
,
3
,
6
,
7
,
8
,
9
};
// 增 改 删 针对公共资源的操作
private
static
Integer
[]
COMMON_SOURCE_OPERATE
=
{
1
,
2
,
3
};
private
static
Integer
[]
COMMON_SOURCE_OPERATE
=
{
1
,
2
,
3
};
// 授权相关操作
private
static
Integer
[]
AUTH_OPERATE
=
{
6
,
7
};
...
...
@@ -63,10 +63,6 @@ public class LogService {
private
static
Integer
[]
AUTH_SOURCE
=
{
1
,
2
,
3
,
11
};
@Resource
private
SysLogMapper
sysLogMapper
;
...
...
@@ -77,7 +73,6 @@ public class LogService {
private
LogManager
logManager
;
public
List
<
SysLogGridDTO
>
query
(
BaseGridRequest
request
)
{
request
=
detailRequest
(
request
);
...
...
@@ -90,8 +85,8 @@ public class LogService {
private
BaseGridRequest
detailRequest
(
BaseGridRequest
request
)
{
List
<
ConditionEntity
>
conditions
=
request
.
getConditions
();
if
(
CollectionUtils
.
isNotEmpty
(
conditions
))
{
ConditionEntity
optypeCondition
=
null
;
ConditionEntity
source
Condition
=
null
;
ConditionEntity
unin
Condition
=
null
;
int
matchIndex
=
-
1
;
for
(
int
i
=
0
;
i
<
conditions
.
size
();
i
++)
{
ConditionEntity
conditionEntity
=
conditions
.
get
(
i
);
...
...
@@ -100,23 +95,21 @@ public class LogService {
if
(
StringUtils
.
isNotBlank
(
field
)
&&
StringUtils
.
equals
(
"optype"
,
field
)
&&
ObjectUtils
.
isNotEmpty
(
value
))
{
matchIndex
=
i
;
optype
Condition
=
new
ConditionEntity
();
sourceCondition
=
new
ConditionEntity
();
unin
Condition
=
new
ConditionEntity
();
List
<
String
>
values
=
(
List
<
String
>)
value
;
sourceCondition
.
setField
(
"source_type"
);
optypeCondition
.
setField
(
"operate_type"
);
List
<
Integer
>
opValue
=
values
.
stream
().
map
(
v
->
Integer
.
parseInt
(
v
.
split
(
"-"
)[
0
])).
collect
(
Collectors
.
toList
());
List
<
Integer
>
soValue
=
values
.
stream
().
map
(
v
->
Integer
.
parseInt
(
v
.
split
(
"-"
)[
1
])).
collect
(
Collectors
.
toList
());
optypeCondition
.
setValue
(
opValue
);
sourceCondition
.
setValue
(
soValue
);
optypeCondition
.
setOperator
(
conditionEntity
.
getOperator
());
sourceCondition
.
setOperator
(
conditionEntity
.
getOperator
());
uninCondition
.
setField
(
"concat(operate_type, '-de-', source_type)"
);
List
<
String
>
uninValue
=
values
.
stream
().
map
(
v
->
v
.
replace
(
"-"
,
"-de-"
)).
collect
(
Collectors
.
toList
());
uninCondition
.
setValue
(
uninValue
);
uninCondition
.
setOperator
(
conditionEntity
.
getOperator
());
}
}
if
(
matchIndex
>=
0
)
{
if
(
matchIndex
>=
0
)
{
conditions
.
remove
(
matchIndex
);
if
(
ObjectUtils
.
isNotEmpty
(
optypeCondition
))
conditions
.
add
(
optypeCondition
);
if
(
ObjectUtils
.
isNotEmpty
(
sourceCondition
))
conditions
.
add
(
source
Condition
);
if
(
ObjectUtils
.
isNotEmpty
(
uninCondition
))
conditions
.
add
(
unin
Condition
);
}
}
return
request
;
...
...
@@ -140,7 +133,7 @@ public class LogService {
String
operateTypeName
=
SysLogConstants
.
operateTypeName
(
operateVal
);
FolderItem
folderItem
=
new
FolderItem
();
folderItem
.
setId
(
operateVal
+
"-"
+
sourceVal
);
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
results
.
add
(
folderItem
);
}
}
...
...
@@ -152,7 +145,7 @@ public class LogService {
folderItem
.
setId
(
driver_file_ope
[
i
]
+
"-"
+
sourceType
.
getValue
());
String
operateTypeName
=
SysLogConstants
.
operateTypeName
(
driver_file_ope
[
i
]);
String
sourceTypeName
=
sourceType
.
getName
();
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
results
.
add
(
folderItem
);
}
...
...
@@ -166,7 +159,7 @@ public class LogService {
String
operateTypeName
=
SysLogConstants
.
operateTypeName
(
operateVal
);
FolderItem
folderItem
=
new
FolderItem
();
folderItem
.
setId
(
operateVal
+
"-"
+
sourceVal
);
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
results
.
add
(
folderItem
);
}
}
...
...
@@ -177,12 +170,11 @@ public class LogService {
folderItem
.
setId
(
panel_ext_ope
[
i
]
+
"-"
+
sourceType
.
getValue
());
String
operateTypeName
=
SysLogConstants
.
operateTypeName
(
panel_ext_ope
[
i
]);
String
sourceTypeName
=
sourceType
.
getName
();
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
folderItem
.
setName
(
Translator
.
get
(
operateTypeName
)
+
Translator
.
get
(
sourceTypeName
));
results
.
add
(
folderItem
);
}
return
results
;
}
...
...
@@ -215,7 +207,6 @@ public class LogService {
}
public
void
exportExcel
(
BaseGridRequest
request
)
throws
Exception
{
request
=
detailRequest
(
request
);
HttpServletResponse
response
=
ServletUtils
.
response
();
...
...
@@ -285,5 +276,4 @@ public class LogService {
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论