Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
b291c2cd
Commit
b291c2cd
authored
May 02, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加对业务日志的分类查询
parent
e0d68299
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
8 deletions
+88
-8
src/main/java/com/stylefeng/guns/common/constant/state/BizLogType.java
+51
-0
src/main/java/com/stylefeng/guns/modular/system/controller/LogController.java
+3
-2
src/main/java/com/stylefeng/guns/modular/system/dao/LogDao.java
+2
-2
src/main/java/com/stylefeng/guns/modular/system/dao/mapping/LogDao.xml
+3
-0
src/main/webapp/WEB-INF/view/common/tags/SelectCon.tag
+17
-0
src/main/webapp/WEB-INF/view/system/log/log.html
+11
-4
src/main/webapp/static/modular/system/log/log.js
+1
-0
No files found.
src/main/java/com/stylefeng/guns/common/constant/state/BizLogType.java
0 → 100644
View file @
b291c2cd
package
com
.
stylefeng
.
guns
.
common
.
constant
.
state
;
/**
* 业务日志类型
*
* @author fengshuonan
* @Date 2017年1月22日 下午12:14:59
*/
public
enum
BizLogType
{
ALL
(
0
,
null
),
//全部日志
BUSSINESS
(
1
,
"业务日志"
),
EXCEPTION
(
2
,
"异常日志"
);
Integer
val
;
String
message
;
BizLogType
(
Integer
val
,
String
message
)
{
this
.
val
=
val
;
this
.
message
=
message
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
Integer
getVal
()
{
return
val
;
}
public
void
setVal
(
Integer
val
)
{
this
.
val
=
val
;
}
public
static
String
valueOf
(
Integer
value
)
{
if
(
value
==
null
)
{
return
null
;
}
else
{
for
(
BizLogType
bizLogType
:
BizLogType
.
values
())
{
if
(
bizLogType
.
getVal
().
equals
(
value
))
{
return
bizLogType
.
getMessage
();
}
}
return
null
;
}
}
}
src/main/java/com/stylefeng/guns/modular/system/controller/LogController.java
View file @
b291c2cd
...
...
@@ -3,6 +3,7 @@ package com.stylefeng.guns.modular.system.controller;
import
com.baomidou.mybatisplus.mapper.SqlRunner
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.stylefeng.guns.common.constant.factory.PageFactory
;
import
com.stylefeng.guns.common.constant.state.BizLogType
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.core.support.BeanKit
;
import
com.stylefeng.guns.modular.system.dao.LogDao
;
...
...
@@ -50,9 +51,9 @@ public class LogController extends BaseController {
*/
@RequestMapping
(
"/list"
)
@ResponseBody
public
Object
list
(
@RequestParam
(
required
=
false
)
String
beginTime
,
@RequestParam
(
required
=
false
)
String
endTime
,
@RequestParam
(
required
=
false
)
String
logName
)
{
public
Object
list
(
@RequestParam
(
required
=
false
)
String
beginTime
,
@RequestParam
(
required
=
false
)
String
endTime
,
@RequestParam
(
required
=
false
)
String
logName
,
@RequestParam
(
required
=
false
)
Integer
logType
)
{
Page
<
OperationLog
>
page
=
new
PageFactory
<
OperationLog
>().
defaultPage
();
List
<
Map
<
String
,
Object
>>
result
=
logDao
.
getOperationLogs
(
page
,
beginTime
,
endTime
,
logName
);
List
<
Map
<
String
,
Object
>>
result
=
logDao
.
getOperationLogs
(
page
,
beginTime
,
endTime
,
logName
,
BizLogType
.
valueOf
(
logType
)
);
page
.
setRecords
((
List
<
OperationLog
>)
new
LogWarpper
(
result
).
warp
());
return
super
.
packForBT
(
page
);
}
...
...
src/main/java/com/stylefeng/guns/modular/system/dao/LogDao.java
View file @
b291c2cd
...
...
@@ -13,7 +13,7 @@ import java.util.Map;
* @author stylefeng
* @Date 2017/4/16 23:44
*/
public
interface
LogDao
{
public
interface
LogDao
{
/**
* 获取操作日志
...
...
@@ -21,7 +21,7 @@ public interface LogDao{
* @author stylefeng
* @Date 2017/4/16 23:48
*/
List
<
Map
<
String
,
Object
>>
getOperationLogs
(
Page
<
OperationLog
>
page
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"logName"
)
String
logName
);
List
<
Map
<
String
,
Object
>>
getOperationLogs
(
Page
<
OperationLog
>
page
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"logName"
)
String
logName
,
@Param
(
"logType"
)
String
logType
);
/**
* 获取登录日志
...
...
src/main/java/com/stylefeng/guns/modular/system/dao/mapping/LogDao.xml
View file @
b291c2cd
...
...
@@ -10,6 +10,9 @@
<if
test=
"logName != null and logName !=''"
>
and logname like CONCAT('%',#{logName},'%')
</if>
<if
test=
"logType != null and logType !=''"
>
and logtype like CONCAT('%',#{logType},'%')
</if>
order by createTime DESC
</select>
...
...
src/main/webapp/WEB-INF/view/common/tags/SelectCon.tag
0 → 100644
View file @
b291c2cd
@/*
选择查询条件标签的参数说明:
name : 查询条件的名称
id : 查询内容的input框id
@*/
<div class="input-group">
<div class="input-group-btn">
<button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
${name}
</button>
</div>
<select class="form-control" id="${id}">
${tagBody!}
</select>
</div>
\ No newline at end of file
src/main/webapp/WEB-INF/view/system/log/log.html
View file @
b291c2cd
...
...
@@ -9,16 +9,23 @@
<div
class=
"row row-lg"
>
<div
class=
"col-sm-12"
>
<div
class=
"row"
>
<div
class=
"col-sm-
3
"
>
<div
class=
"col-sm-
2
"
>
<
#
TimeCon
id=
"beginTime"
name=
"开始时间"
isTime=
"false"
pattern=
"YYYY-MM-DD"
/>
</div>
<div
class=
"col-sm-
3
"
>
<div
class=
"col-sm-
2
"
>
<
#
TimeCon
id=
"endTime"
name=
"结束时间"
isTime=
"false"
pattern=
"YYYY-MM-DD"
/>
</div>
<div
class=
"col-sm-
3
"
>
<div
class=
"col-sm-
2
"
>
<
#
NameCon
id=
"logName"
name=
"日志名称"
/>
</div>
<div
class=
"col-sm-3"
>
<div
class=
"col-sm-2"
>
<
#
SelectCon
id=
"logType"
name=
"日志类型"
>
<option
value=
"0"
>
全部
</option>
<option
value=
"1"
>
业务日志
</option>
<option
value=
"2"
>
异常日志
</option>
</
#
SelectCon>
</div>
<div
class=
"col-sm-2"
>
<
#
button
name=
"搜索"
icon=
"fa-search"
clickFun=
"OptLog.search()"
/>
</div>
</div>
...
...
src/main/webapp/static/modular/system/log/log.js
View file @
b291c2cd
...
...
@@ -73,6 +73,7 @@ OptLog.search = function () {
queryData
[
'logName'
]
=
$
(
"#logName"
).
val
();
queryData
[
'beginTime'
]
=
$
(
"#beginTime"
).
val
();
queryData
[
'endTime'
]
=
$
(
"#endTime"
).
val
();
queryData
[
'logType'
]
=
$
(
"#logType"
).
val
();
OptLog
.
table
.
refresh
({
query
:
queryData
});
};
...
...
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