Commit f5cb9905 by fsn

部门权限整理

parent 95064cdf
...@@ -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) {
//缓存被删除的部门名称 //缓存被删除的部门名称
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment