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
40d2f560
Commit
40d2f560
authored
May 16, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构部门管理的日志记录
parent
342d2488
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
+25
-10
src/main/java/com/stylefeng/guns/common/constant/Dict.java
+5
-0
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeleteDict.java
+3
-0
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeptDict.java
+8
-7
src/main/java/com/stylefeng/guns/modular/system/controller/DeptController.java
+9
-3
No files found.
src/main/java/com/stylefeng/guns/common/constant/Dict.java
View file @
40d2f560
...
@@ -23,4 +23,9 @@ public interface Dict {
...
@@ -23,4 +23,9 @@ public interface Dict {
*/
*/
String
DeleteDict
=
"DeleteDict"
;
String
DeleteDict
=
"DeleteDict"
;
/**
* 部门管理业务的字典
*/
String
DeptDict
=
"DeptDict"
;
}
}
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeleteDict.java
View file @
40d2f560
...
@@ -13,10 +13,13 @@ public class DeleteDict extends AbstractDictMap {
...
@@ -13,10 +13,13 @@ public class DeleteDict extends AbstractDictMap {
@Override
@Override
public
void
init
()
{
public
void
init
()
{
put
(
"roleId"
,
"角色名称"
);
put
(
"roleId"
,
"角色名称"
);
put
(
"deptId"
,
"部门名称"
);
}
}
@Override
@Override
protected
void
initBeWrapped
()
{
protected
void
initBeWrapped
()
{
putFieldWrapperMethodName
(
"roleId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"roleId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"deptId"
,
"getCacheObject"
);
}
}
}
}
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeptDict.java
View file @
40d2f560
...
@@ -12,16 +12,17 @@ public class DeptDict extends AbstractDictMap {
...
@@ -12,16 +12,17 @@ public class DeptDict extends AbstractDictMap {
@Override
@Override
public
void
init
()
{
public
void
init
()
{
put
(
"deptId"
,
"部门id
"
);
put
(
"deptId"
,
"部门名称
"
);
put
(
"num"
,
"部门排序"
);
put
(
"num"
,
"部门排序"
);
put
(
"pid"
,
"部门父级
"
);
put
(
"pid"
,
"上级名称
"
);
put
(
"simplename"
,
"部门简称"
);
put
(
"simplename"
,
"部门简称"
);
put
(
"fullname"
,
"部门全称"
);
put
(
"fullname"
,
"部门全称"
);
put
(
"tips"
,
"备注"
);
put
(
"tips"
,
"备注"
);
}
}
@Override
@Override
protected
void
initBeWrapped
()
{
protected
void
initBeWrapped
()
{
putFieldWrapperMethodName
(
"deptId"
,
"getDeptName"
);
putFieldWrapperMethodName
(
"pid"
,
"getDeptName"
);
}
}
}
}
src/main/java/com/stylefeng/guns/modular/system/controller/DeptController.java
View file @
40d2f560
...
@@ -3,6 +3,7 @@ package com.stylefeng.guns.modular.system.controller;
...
@@ -3,6 +3,7 @@ package com.stylefeng.guns.modular.system.controller;
import
com.stylefeng.guns.common.annotion.Permission
;
import
com.stylefeng.guns.common.annotion.Permission
;
import
com.stylefeng.guns.common.annotion.log.BussinessLog
;
import
com.stylefeng.guns.common.annotion.log.BussinessLog
;
import
com.stylefeng.guns.common.constant.Const
;
import
com.stylefeng.guns.common.constant.Const
;
import
com.stylefeng.guns.common.constant.Dict
;
import
com.stylefeng.guns.common.constant.factory.ConstantFactory
;
import
com.stylefeng.guns.common.constant.factory.ConstantFactory
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
...
@@ -85,7 +86,7 @@ public class DeptController extends BaseController {
...
@@ -85,7 +86,7 @@ public class DeptController extends BaseController {
/**
/**
* 新增部门
* 新增部门
*/
*/
@BussinessLog
(
value
=
"添加部门"
,
key
=
"simplename"
,
dict
=
"DeptDict"
)
@BussinessLog
(
value
=
"添加部门"
,
key
=
"simplename"
,
dict
=
Dict
.
DeptDict
)
@RequestMapping
(
value
=
"/add"
)
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
@ResponseBody
@Permission
(
Const
.
ADMIN_NAME
)
@Permission
(
Const
.
ADMIN_NAME
)
...
@@ -118,7 +119,7 @@ public class DeptController extends BaseController {
...
@@ -118,7 +119,7 @@ public class DeptController extends BaseController {
/**
/**
* 修改部门
* 修改部门
*/
*/
@BussinessLog
(
value
=
"修改部门"
,
key
=
"simplename"
,
dict
=
"DeptDict"
)
@BussinessLog
(
value
=
"修改部门"
,
key
=
"simplename"
,
dict
=
Dict
.
DeptDict
)
@RequestMapping
(
value
=
"/update"
)
@RequestMapping
(
value
=
"/update"
)
@ResponseBody
@ResponseBody
@Permission
(
Const
.
ADMIN_NAME
)
@Permission
(
Const
.
ADMIN_NAME
)
...
@@ -133,12 +134,17 @@ public class DeptController extends BaseController {
...
@@ -133,12 +134,17 @@ public class DeptController extends BaseController {
/**
/**
* 删除部门
* 删除部门
*/
*/
@BussinessLog
(
value
=
"删除部门"
,
key
=
"deptId"
,
dict
=
"DeptDict"
)
@BussinessLog
(
value
=
"删除部门"
,
key
=
"deptId"
,
dict
=
Dict
.
DeleteDict
)
@RequestMapping
(
value
=
"/delete"
)
@RequestMapping
(
value
=
"/delete"
)
@ResponseBody
@ResponseBody
@Permission
(
Const
.
ADMIN_NAME
)
@Permission
(
Const
.
ADMIN_NAME
)
public
Object
delete
(
@RequestParam
Integer
deptId
)
{
public
Object
delete
(
@RequestParam
Integer
deptId
)
{
//缓存被删除的部门名称
LogObjectHolder
.
me
().
set
(
ConstantFactory
.
me
().
getDeptName
(
deptId
));
deptMapper
.
deleteById
(
deptId
);
deptMapper
.
deleteById
(
deptId
);
return
SUCCESS_TIP
;
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