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
f5cb9905
Commit
f5cb9905
authored
Jun 03, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门权限整理
parent
95064cdf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
sql/guns.sql
+0
-0
src/main/java/com/stylefeng/guns/modular/system/controller/DeptController.java
+8
-6
No files found.
sql/guns.sql
View file @
f5cb9905
This diff is collapsed.
Click to expand it.
src/main/java/com/stylefeng/guns/modular/system/controller/DeptController.java
View file @
f5cb9905
...
@@ -2,19 +2,18 @@ package com.stylefeng.guns.modular.system.controller;
...
@@ -2,19 +2,18 @@ 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.Dict
;
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
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.node.ZTreeNode
;
import
com.stylefeng.guns.common.node.ZTreeNode
;
import
com.stylefeng.guns.common.persistence.dao.DeptMapper
;
import
com.stylefeng.guns.common.persistence.model.Dept
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.modular.system.dao.DeptDao
;
import
com.stylefeng.guns.modular.system.dao.DeptDao
;
import
com.stylefeng.guns.modular.system.warpper.DeptWarpper
;
import
com.stylefeng.guns.modular.system.warpper.DeptWarpper
;
import
com.stylefeng.guns.common.persistence.dao.DeptMapper
;
import
com.stylefeng.guns.common.persistence.model.Dept
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -63,6 +62,7 @@ public class DeptController extends BaseController {
...
@@ -63,6 +62,7 @@ public class DeptController extends BaseController {
/**
/**
* 跳转到修改部门
* 跳转到修改部门
*/
*/
@Permission
@RequestMapping
(
"/dept_update/{deptId}"
)
@RequestMapping
(
"/dept_update/{deptId}"
)
public
String
deptUpdate
(
@PathVariable
Integer
deptId
,
Model
model
)
{
public
String
deptUpdate
(
@PathVariable
Integer
deptId
,
Model
model
)
{
Dept
dept
=
deptMapper
.
selectById
(
deptId
);
Dept
dept
=
deptMapper
.
selectById
(
deptId
);
...
@@ -88,8 +88,8 @@ public class DeptController extends BaseController {
...
@@ -88,8 +88,8 @@ public class DeptController extends BaseController {
*/
*/
@BussinessLog
(
value
=
"添加部门"
,
key
=
"simplename"
,
dict
=
Dict
.
DeptDict
)
@BussinessLog
(
value
=
"添加部门"
,
key
=
"simplename"
,
dict
=
Dict
.
DeptDict
)
@RequestMapping
(
value
=
"/add"
)
@RequestMapping
(
value
=
"/add"
)
@Permission
@ResponseBody
@ResponseBody
@Permission
(
Const
.
ADMIN_NAME
)
public
Object
add
(
Dept
dept
)
{
public
Object
add
(
Dept
dept
)
{
if
(
ToolUtil
.
isOneEmpty
(
dept
,
dept
.
getSimplename
()))
{
if
(
ToolUtil
.
isOneEmpty
(
dept
,
dept
.
getSimplename
()))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
...
@@ -101,6 +101,7 @@ public class DeptController extends BaseController {
...
@@ -101,6 +101,7 @@ public class DeptController extends BaseController {
* 获取所有部门列表
* 获取所有部门列表
*/
*/
@RequestMapping
(
value
=
"/list"
)
@RequestMapping
(
value
=
"/list"
)
@Permission
@ResponseBody
@ResponseBody
public
Object
list
(
String
condition
)
{
public
Object
list
(
String
condition
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
deptDao
.
list
(
condition
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
deptDao
.
list
(
condition
);
...
@@ -111,6 +112,7 @@ public class DeptController extends BaseController {
...
@@ -111,6 +112,7 @@ public class DeptController extends BaseController {
* 部门详情
* 部门详情
*/
*/
@RequestMapping
(
value
=
"/detail/{deptId}"
)
@RequestMapping
(
value
=
"/detail/{deptId}"
)
@Permission
@ResponseBody
@ResponseBody
public
Object
detail
(
@PathVariable
(
"deptId"
)
Integer
deptId
)
{
public
Object
detail
(
@PathVariable
(
"deptId"
)
Integer
deptId
)
{
return
deptMapper
.
selectById
(
deptId
);
return
deptMapper
.
selectById
(
deptId
);
...
@@ -121,8 +123,8 @@ public class DeptController extends BaseController {
...
@@ -121,8 +123,8 @@ public class DeptController extends BaseController {
*/
*/
@BussinessLog
(
value
=
"修改部门"
,
key
=
"simplename"
,
dict
=
Dict
.
DeptDict
)
@BussinessLog
(
value
=
"修改部门"
,
key
=
"simplename"
,
dict
=
Dict
.
DeptDict
)
@RequestMapping
(
value
=
"/update"
)
@RequestMapping
(
value
=
"/update"
)
@Permission
@ResponseBody
@ResponseBody
@Permission
(
Const
.
ADMIN_NAME
)
public
Object
update
(
Dept
dept
)
{
public
Object
update
(
Dept
dept
)
{
if
(
ToolUtil
.
isEmpty
(
dept
)
||
dept
.
getId
()
==
null
)
{
if
(
ToolUtil
.
isEmpty
(
dept
)
||
dept
.
getId
()
==
null
)
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
...
@@ -136,8 +138,8 @@ public class DeptController extends BaseController {
...
@@ -136,8 +138,8 @@ public class DeptController extends BaseController {
*/
*/
@BussinessLog
(
value
=
"删除部门"
,
key
=
"deptId"
,
dict
=
Dict
.
DeleteDict
)
@BussinessLog
(
value
=
"删除部门"
,
key
=
"deptId"
,
dict
=
Dict
.
DeleteDict
)
@RequestMapping
(
value
=
"/delete"
)
@RequestMapping
(
value
=
"/delete"
)
@Permission
@ResponseBody
@ResponseBody
@Permission
(
Const
.
ADMIN_NAME
)
public
Object
delete
(
@RequestParam
Integer
deptId
)
{
public
Object
delete
(
@RequestParam
Integer
deptId
)
{
//缓存被删除的部门名称
//缓存被删除的部门名称
...
...
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