| | |
| | | //操作插入日志 |
| | | 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()); |
| | | } |