|  |  |  | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMethod; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(name = "order", value = "同级菜单顺序", required = true, paramType = "query", dataType = "String") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "insertOneManageMenu", method = RequestMethod.POST) | 
|---|
|  |  |  | public ResultMessage insertOneManageMenu(HttpServletRequest request) { | 
|---|
|  |  |  | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); | 
|---|
|  |  |  | public ResultMessage insertOneManageMenu(@RequestBody Map<String, Object> parameters) { | 
|---|
|  |  |  | ManageMenu manageMenu = JSON.parseObject(JSON.toJSONString(parameters), ManageMenu.class); | 
|---|
|  |  |  | Map<String,Object> resultMap = manageMenuService.insertManageMenu(manageMenu); | 
|---|
|  |  |  | String msg = resultMap.get("msg").toString(); | 
|---|
|  |  |  | boolean flag = Boolean.parseBoolean(resultMap.get("flag").toString()); | 
|---|
|  |  |  | if (flag){ | 
|---|
|  |  |  | int code = Integer.parseInt(resultMap.get("code").toString()); | 
|---|
|  |  |  | if (code == 0){ | 
|---|
|  |  |  | return ResultMessage.ok(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultMessage.fail(msg); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(name = "url", value = "url地址", required = true, paramType = "query", dataType = "String") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "updateManageMenuById", method = RequestMethod.POST) | 
|---|
|  |  |  | public ResultMessage updateManageMenuById(HttpServletRequest request) { | 
|---|
|  |  |  | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); | 
|---|
|  |  |  | public ResultMessage updateManageMenuById(@RequestBody Map<String, Object> parameters) { | 
|---|
|  |  |  | Map<String,Object> resultMap = manageMenuService.updateManageMenu(parameters); | 
|---|
|  |  |  | String msg = resultMap.get("msg").toString(); | 
|---|
|  |  |  | boolean flag = Boolean.parseBoolean(resultMap.get("flag").toString()); | 
|---|
|  |  |  | if (flag){ | 
|---|
|  |  |  | int code = Integer.parseInt(resultMap.get("code").toString()); | 
|---|
|  |  |  | if (code == 0){ | 
|---|
|  |  |  | return ResultMessage.ok(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultMessage.fail(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "删除角色", notes = "删除角色") | 
|---|
|  |  |  | @ApiOperation(value = "删除菜单", notes = "删除菜单") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "id", value = "序号", required = true, paramType = "query", dataType = "int") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "deleteManageMenu", method = RequestMethod.POST) | 
|---|
|  |  |  | public ResultMessage deleteManageMenu(HttpServletRequest request) { | 
|---|
|  |  |  | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); | 
|---|
|  |  |  | public ResultMessage deleteManageMenu(@RequestBody Map<String, Object> parameters) { | 
|---|
|  |  |  | Map<String,Object> resultMap = manageMenuService.deleteManageMenu(parameters); | 
|---|
|  |  |  | String msg = resultMap.get("msg").toString(); | 
|---|
|  |  |  | boolean flag = Boolean.parseBoolean(resultMap.get("flag").toString()); | 
|---|
|  |  |  | if (flag){ | 
|---|
|  |  |  | int code = Integer.parseInt(resultMap.get("code").toString()); | 
|---|
|  |  |  | if (code == 0){ | 
|---|
|  |  |  | return ResultMessage.ok(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ResultMessage.fail(msg); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "查询所有菜单", notes = "查询所有菜单") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | /*@ApiImplicitParam(name = "current", value = "页码", required = true, paramType = "query", dataType = "int"), | 
|---|
|  |  |  | @ApiImplicitParam(name = "size", value = "每页数量", required = true, paramType = "query", dataType = "int")*/ | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "getAllManageMenu", method = RequestMethod.GET) | 
|---|
|  |  |  | public ResultMessage getAllManageMenu(HttpServletRequest request) { | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(name = "size", value = "每页数量", required = true, paramType = "query", dataType = "int") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping(value = "getManageMenuByNameFuzzy", method = RequestMethod.GET) | 
|---|
|  |  |  | public ResultMessage getManageMenuByNameFuzzy(HttpServletRequest request) { | 
|---|
|  |  |  | Map<String, Object> parameters = getParametersStartingWith(request, null); | 
|---|
|  |  |  | public ResultMessage getManageMenuByNameFuzzy(@RequestBody Map<String, Object> parameters) { | 
|---|
|  |  |  | Map<String,Object> resultMap = new HashMap<>(); | 
|---|
|  |  |  | if (parameters.get("name") == null || parameters.get("current") == null || parameters.get("size") == null){ | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ManageMenu> getAllMenus(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ManageMenu> getManageMenuByRoleId(int roleId); | 
|---|
|  |  |  | List getManageMenuByRoleId(int roleId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ManageMenu> getManageMenuByNameFuzzy(Map map); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.moral.api.mapper.ManageRoleMenuMapper; | 
|---|
|  |  |  | import com.moral.api.service.ManageMenuService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.moral.api.util.LogUtils; | 
|---|
|  |  |  | import com.moral.constant.Constants; | 
|---|
|  |  |  | import com.moral.constant.ResponseCodeEnum; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.util.ObjectUtils; | 
|---|
|  |  |  | import org.springframework.web.context.request.RequestContextHolder; | 
|---|
|  |  |  | import org.springframework.web.context.request.ServletRequestAttributes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageRoleMenuMapper manageRoleMenuMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | LogUtils logUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public Map<String, Object> insertManageMenu(ManageMenu manageMenu) { | 
|---|
|  |  |  | 
|---|
|  |  |  | resultMap.put("code", ResponseCodeEnum.MENU_IS_EXPIRE.getCode()); | 
|---|
|  |  |  | resultMap.put("msg", ResponseCodeEnum.MENU_IS_EXPIRE.getMsg()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | manageMenuMapper.insertOne(manageMenu); | 
|---|
|  |  |  | //manageMenuMapper.insertOne(manageMenu); | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | String content = "添加菜单:"+manageMenu.getName()+";"; | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.INSERT_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code", ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg", ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | resultMap.put("code", ResponseCodeEnum.MENU_IS_NULL.getCode()); | 
|---|
|  |  |  | resultMap.put("msg", ResponseCodeEnum.MENU_IS_NULL.getMsg()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | //更新之前获取原来的菜单信息 | 
|---|
|  |  |  | ManageMenu manageMenuOld = manageMenuMapper.getManageMenuById(Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | manageMenuMapper.updateManageMenuById(map); | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | String content = "修改了菜单:"+manageMenuOld.getName()+";"; | 
|---|
|  |  |  | for (Object key:map.keySet()) { | 
|---|
|  |  |  | if (key.toString().equals("name")){ | 
|---|
|  |  |  | content = content+"菜单名:"+manageMenuOld.getName()+"->"+map.get(key)+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (key.toString().equals("url")){ | 
|---|
|  |  |  | content = content+"url地址:"+manageMenuOld.getUrl()+"->"+map.get(key)+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (key.toString().equals("icon")){ | 
|---|
|  |  |  | content = content+"图标地址:"+manageMenuOld.getIcon()+"->"+map.get(key)+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (key.toString().equals("parent_id")){ | 
|---|
|  |  |  | content = content+"父菜单:"+manageMenuMapper.getManageMenuById(manageMenuOld.getId()).getName()+"->"+manageMenuMapper.getManageMenuById(Integer.parseInt(map.get(key).toString())).getName()+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (key.toString().equals("icon")){ | 
|---|
|  |  |  | content = content+"同一级别菜单顺序:"+manageMenuOld.getOrder()+"->"+map.get(key)+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.UPDATE_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code", ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg", ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | Map role_menuDeleteMap = new HashMap(); | 
|---|
|  |  |  | role_menuDeleteMap.put("menu_id", id); | 
|---|
|  |  |  | manageRoleMenuMapper.updateDeleteStateByMenu_id(role_menuDeleteMap); | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | ManageMenu manageMenuDelete = manageMenuMapper.getManageMenuById(Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | String content = "删除菜单:"+manageMenuDelete.getName()+";"; | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.DELETE_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code", ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg", ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<ManageMenu> getManageMenuByRoleId(int roleId) { | 
|---|
|  |  |  | public List getManageMenuByRoleId(int roleId) { | 
|---|
|  |  |  | List<ManageMenu> manageMenus = manageMenuMapper.getManageMenuByRoleId(roleId); | 
|---|
|  |  |  | System.out.println(manageMenus); | 
|---|
|  |  |  | if(ObjectUtils.isEmpty(manageMenus)) | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | Map<Integer, ManageMenu> menusMap = new HashMap<>(); | 
|---|
|  |  |  | for (ManageMenu menu : manageMenus) { | 
|---|
|  |  |  | menu.setChildren(new ArrayList<>());//初始化 | 
|---|
|  |  |  | menusMap.put(menu.getId(), menu); | 
|---|
|  |  |  | List menuIdList = new ArrayList(); | 
|---|
|  |  |  | for (ManageMenu manageMenu:manageMenus) { | 
|---|
|  |  |  | menuIdList.add(manageMenu.getId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (ManageMenu menu : manageMenus) { | 
|---|
|  |  |  | combinationParentChildrenMenus(menusMap, menu); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //已经封装好父子菜单,去除parentId不是0的菜单,去除重复 | 
|---|
|  |  |  | manageMenus.removeIf(new Predicate<ManageMenu>() { | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean test(ManageMenu manageMenu) { | 
|---|
|  |  |  | if(manageMenu.getParentId().equals(0)) | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return manageMenus; | 
|---|
|  |  |  | return menuIdList; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.moral.api.entity.ManageMenu; | 
|---|
|  |  |  | import com.moral.api.entity.ManageRole; | 
|---|
|  |  |  | import com.moral.api.entity.ManageRoleMenu; | 
|---|
|  |  |  | import com.moral.api.mapper.ManageMenuMapper; | 
|---|
|  |  |  | import com.moral.api.mapper.ManageRoleMapper; | 
|---|
|  |  |  | import com.moral.api.mapper.ManageRoleMenuMapper; | 
|---|
|  |  |  | import com.moral.api.service.ManageRoleMenuService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.moral.api.util.LogUtils; | 
|---|
|  |  |  | import com.moral.constant.Constants; | 
|---|
|  |  |  | import com.moral.constant.ResponseCodeEnum; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.context.request.RequestContextHolder; | 
|---|
|  |  |  | import org.springframework.web.context.request.ServletRequestAttributes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageRoleMenuMapper manageRoleMenuMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageMenuMapper manageMenuMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageRoleMapper manageRoleMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | LogUtils logUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public Map<String, Object> updateRoleMenu(List list, int id) { | 
|---|
|  |  |  | Map<String,Object> resultMap = new HashMap<>(); | 
|---|
|  |  |  | List<ManageMenu> manageMenusOld = manageMenuMapper.getManageMenuByRoleId(id); | 
|---|
|  |  |  | if (list.size()==0){ | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode()); | 
|---|
|  |  |  | resultMap.put("msg",ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | manageRoleMenuMapper.insertBatch(mapList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<ManageMenu> manageMenusNew = manageMenuMapper.getManageMenuByRoleId(id); | 
|---|
|  |  |  | List manageMenuOldList = new ArrayList(); | 
|---|
|  |  |  | List manageMenuNewList = new ArrayList(); | 
|---|
|  |  |  | for (ManageMenu manageMenu:manageMenusOld) { | 
|---|
|  |  |  | manageMenuOldList.add(manageMenu.getName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (ManageMenu manageMenu:manageMenusNew) { | 
|---|
|  |  |  | manageMenuNewList.add(manageMenu.getName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //获取角色信息 | 
|---|
|  |  |  | ManageRole manageRole = manageRoleMapper.selectById(id); | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | String content = "修改了角色:"+manageRole.getName()+";"; | 
|---|
|  |  |  | if (manageMenuOldList.size()==0){ | 
|---|
|  |  |  | manageMenuOldList.add("空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (manageMenuNewList.size()==0){ | 
|---|
|  |  |  | manageMenuNewList.add("空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | content = content+"菜单:"+manageMenuOldList+"->"+manageMenuNewList+";"; | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.UPDATE_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | return resultMap; | 
|---|
|  |  |  | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | String content = "添加角色:"+manageRole.getName()+";"; | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,"1"); | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.INSERT_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | return resultMap; | 
|---|
|  |  |  | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.ROLE_IS_NULL.getCode()); | 
|---|
|  |  |  | resultMap.put("msg",ResponseCodeEnum.ROLE_IS_NULL.getMsg()); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | //在更新之前获取原来信息 | 
|---|
|  |  |  | ManageRole manageRoleOld = manageRoleMapper.selectById(Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | manageRoleMapper.updateManageRoleById(map); | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | String content = "修改了角色:"+manageRoleOld.getName()+";"; | 
|---|
|  |  |  | for (Object key:map.keySet()) { | 
|---|
|  |  |  | if (key.toString().equals("name")){ | 
|---|
|  |  |  | content = content+"角色名:"+manageRoleOld.getName()+"->"+map.get(key)+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (key.toString().equals("desc")){ | 
|---|
|  |  |  | content = content+"备注:"+manageRoleOld.getDesc()+"->"+map.get(key)+";"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.UPDATE_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | Map deleteMap = new HashMap(); | 
|---|
|  |  |  | deleteMap.put("id",Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | deleteMap.put("is_delete",1); | 
|---|
|  |  |  | //manageRoleMapper.updateManageRoleById(deleteMap); | 
|---|
|  |  |  | manageRoleMapper.updateManageRoleById(deleteMap); | 
|---|
|  |  |  | ManageAccountRole manageAccountRole = new ManageAccountRole(); | 
|---|
|  |  |  | manageAccountRole.setIsDelete("1"); | 
|---|
|  |  |  | QueryWrapper<ManageAccountRole> wrapper = new QueryWrapper(); | 
|---|
|  |  |  | wrapper.eq("role_id",Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | //manageAccountRoleMapper.update(manageAccountRole,wrapper); | 
|---|
|  |  |  | manageAccountRoleMapper.update(manageAccountRole,wrapper); | 
|---|
|  |  |  | //操作插入日志 | 
|---|
|  |  |  | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 
|---|
|  |  |  | ManageRole manageRole1 = manageRoleMapper.selectById(Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | System.out.println(manageRole1); | 
|---|
|  |  |  | String content = "删除角色:"+manageRole.getName()+";"; | 
|---|
|  |  |  | //logUtils.saveOperationForManage(request,content,"1"); | 
|---|
|  |  |  | String content = "删除角色:"+manageRole1.getName()+";"; | 
|---|
|  |  |  | logUtils.saveOperationForManage(request,content,Constants.DELETE_OPERATE_TYPE); | 
|---|
|  |  |  | resultMap.put("code",ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | - /system/** | 
|---|
|  |  |  |  | 
|---|
|  |  |  | - /role/** | 
|---|
|  |  |  | - /menu/getAllManageMenu | 
|---|
|  |  |  | - /menu/getManageMenuByNameFuzzy | 
|---|
|  |  |  | - /menu/getManageMenuByRoleId | 
|---|
|  |  |  | - /menu/** | 
|---|
|  |  |  | - /api/** | 
|---|
|  |  |  | AES: | 
|---|
|  |  |  | KEY: | 
|---|