| | |
| | | @RequestMapping(value = "/user/update/auth") |
| | | @ManagerAuth(memo = "系统用户修改") |
| | | public R update(User user){ |
| | | if (getUserId() != 9527){ |
| | | if (!getUserId().equals(user.getId())){ |
| | | Role role = roleService.selectById(getUser().getRoleId()); |
| | | if (!role.getCode().equals("admin")){ |
| | | return R.error("操作越权!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (Cools.isEmpty(user) || null==user.getId()){ |
| | | return R.error(); |
| | | } |
| | |
| | | if (user.getMobile()!=null) { |
| | | entity.setMobile(user.getMobile()); |
| | | } |
| | | userService.updateById(entity); |
| | | if (user.getRoleId()!=null){ |
| | | entity.setRoleId(user.getRoleId()); |
| | | } |
| | | if (!userService.updateById(entity)){ |
| | | return R.error("修改失败!"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/user/delete/auth") |
| | | @ManagerAuth(memo = "系统用户删除") |
| | | public R delete(Integer[] ids){ |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | userService.deleteById(id); |
| | | } |
| | | userService.deleteBatchIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |