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
49f6587c
Commit
49f6587c
authored
May 16, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构字典管理日志
parent
c02c8e0f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
4 deletions
+32
-4
src/main/java/com/stylefeng/guns/common/constant/Dict.java
+4
-0
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeleteDict.java
+2
-0
src/main/java/com/stylefeng/guns/common/constant/dictmap/DictMap.java
+2
-1
src/main/java/com/stylefeng/guns/common/constant/factory/ConstantFactory.java
+16
-0
src/main/java/com/stylefeng/guns/modular/system/controller/DictController.java
+8
-3
No files found.
src/main/java/com/stylefeng/guns/common/constant/Dict.java
View file @
49f6587c
...
...
@@ -33,5 +33,9 @@ public interface Dict {
*/
String
MenuDict
=
"MenuDict"
;
/**
* 字典管理业务的字典
*/
String
DictMap
=
"DictMap"
;
}
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeleteDict.java
View file @
49f6587c
...
...
@@ -15,6 +15,7 @@ public class DeleteDict extends AbstractDictMap {
put
(
"roleId"
,
"角色名称"
);
put
(
"deptId"
,
"部门名称"
);
put
(
"menuId"
,
"菜单名称"
);
put
(
"dictId"
,
"字典名称"
);
}
@Override
...
...
@@ -22,6 +23,7 @@ public class DeleteDict extends AbstractDictMap {
putFieldWrapperMethodName
(
"roleId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"deptId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"menuId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"dictId"
,
"getCacheObject"
);
}
}
src/main/java/com/stylefeng/guns/common/constant/dictmap/DictMap.java
View file @
49f6587c
...
...
@@ -12,8 +12,9 @@ public class DictMap extends AbstractDictMap {
@Override
public
void
init
()
{
put
(
"dictId"
,
"字典
id
"
);
put
(
"dictId"
,
"字典
名称
"
);
put
(
"dictName"
,
"字典名称"
);
put
(
"dictValues"
,
"字典内容"
);
}
@Override
...
...
src/main/java/com/stylefeng/guns/common/constant/factory/ConstantFactory.java
View file @
49f6587c
...
...
@@ -159,6 +159,22 @@ public class ConstantFactory {
}
/**
* 获取字典名称
*/
public
String
getDictName
(
Integer
dictId
){
if
(
ToolUtil
.
isEmpty
(
dictId
))
{
return
""
;
}
else
{
Dict
dict
=
dictMapper
.
selectById
(
dictId
);
if
(
dict
==
null
)
{
return
""
;
}
else
{
return
dict
.
getName
();
}
}
}
/**
* 获取性别名称
*/
public
String
getSexName
(
Integer
sex
)
{
...
...
src/main/java/com/stylefeng/guns/modular/system/controller/DictController.java
View file @
49f6587c
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper;
import
com.stylefeng.guns.common.annotion.Permission
;
import
com.stylefeng.guns.common.annotion.log.BussinessLog
;
import
com.stylefeng.guns.common.constant.Const
;
import
com.stylefeng.guns.common.constant.factory.ConstantFactory
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BussinessException
;
...
...
@@ -80,7 +81,7 @@ public class DictController extends BaseController {
*
* @param dictValues 格式例如 "1:启用;2:禁用;3:冻结"
*/
@BussinessLog
(
value
=
"添加字典记录"
,
key
=
"dictName
"
,
dict
=
"DictMap"
)
@BussinessLog
(
value
=
"添加字典记录"
,
key
=
"dictName
,dictValues"
,
dict
=
com
.
stylefeng
.
guns
.
common
.
constant
.
Dict
.
DictMap
)
@RequestMapping
(
value
=
"/add"
)
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
...
...
@@ -114,7 +115,7 @@ public class DictController extends BaseController {
/**
* 修改字典
*/
@BussinessLog
(
value
=
"修改字典"
,
key
=
"dictName
"
,
dict
=
"DictMap"
)
@BussinessLog
(
value
=
"修改字典"
,
key
=
"dictName
,dictValues"
,
dict
=
com
.
stylefeng
.
guns
.
common
.
constant
.
Dict
.
DictMap
)
@RequestMapping
(
value
=
"/update"
)
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
...
...
@@ -129,11 +130,15 @@ public class DictController extends BaseController {
/**
* 删除字典记录
*/
@BussinessLog
(
value
=
"删除字典记录"
,
key
=
"dictId"
,
dict
=
"DictMap"
)
@BussinessLog
(
value
=
"删除字典记录"
,
key
=
"dictId"
,
dict
=
com
.
stylefeng
.
guns
.
common
.
constant
.
Dict
.
DeleteDict
)
@RequestMapping
(
value
=
"/delete"
)
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
public
Object
delete
(
@RequestParam
Integer
dictId
)
{
//缓存被删除的名称
LogObjectHolder
.
me
().
set
(
ConstantFactory
.
me
().
getDictName
(
dictId
));
this
.
dictService
.
delteDict
(
dictId
);
return
SUCCESS_TIP
;
}
...
...
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