Commit 40d2f560 by fsn

重构部门管理的日志记录

parent 342d2488
......@@ -23,4 +23,9 @@ public interface Dict {
*/
String DeleteDict = "DeleteDict";
/**
* 部门管理业务的字典
*/
String DeptDict = "DeptDict";
}
......@@ -13,10 +13,13 @@ public class DeleteDict extends AbstractDictMap {
@Override
public void init() {
put("roleId","角色名称");
put("deptId", "部门名称");
}
@Override
protected void initBeWrapped() {
putFieldWrapperMethodName("roleId","getCacheObject");
putFieldWrapperMethodName("deptId","getCacheObject");
}
}
......@@ -12,16 +12,17 @@ public class DeptDict extends AbstractDictMap {
@Override
public void init() {
put("deptId","部门id");
put("num","部门排序");
put("pid","部门父级");
put("simplename","部门简称");
put("fullname","部门全称");
put("tips","备注");
put("deptId", "部门名称");
put("num", "部门排序");
put("pid", "上级名称");
put("simplename", "部门简称");
put("fullname", "部门全称");
put("tips", "备注");
}
@Override
protected void initBeWrapped() {
putFieldWrapperMethodName("deptId", "getDeptName");
putFieldWrapperMethodName("pid", "getDeptName");
}
}
......@@ -3,6 +3,7 @@ package com.stylefeng.guns.modular.system.controller;
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.Dict;
import com.stylefeng.guns.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.common.controller.BaseController;
import com.stylefeng.guns.common.exception.BizExceptionEnum;
......@@ -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")
@ResponseBody
@Permission(Const.ADMIN_NAME)
......@@ -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")
@ResponseBody
@Permission(Const.ADMIN_NAME)
......@@ -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")
@ResponseBody
@Permission(Const.ADMIN_NAME)
public Object delete(@RequestParam Integer deptId) {
//缓存被删除的部门名称
LogObjectHolder.me().set(ConstantFactory.me().getDeptName(deptId));
deptMapper.deleteById(deptId);
return SUCCESS_TIP;
}
}
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