| | |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wms.common.annotation.CacheData; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.KeyValVo; |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:list')") |
| | | @PostMapping("/user/page") |
| | | @CacheData(tableName = {"sys_user"}) |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<User, BaseParam> pageParam = new PageParam<>(baseParam, User.class); |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:list')") |
| | | @PostMapping("/user/page1") |
| | | @CacheData(tableName = {"sys_user"}) |
| | | public R page1(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<User, BaseParam> pageParam = new PageParam<>(baseParam, User.class); |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:list')") |
| | | @PostMapping("/user/list") |
| | | @CacheData(tableName = {"sys_user"}) |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(userService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:list')") |
| | | @GetMapping("/user/{id}") |
| | | @CacheData(tableName = {"sys_user"}) |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(userService.getById(id)); |
| | | } |
| | |
| | | throw new CoolException("服务器内部错误"); |
| | | } |
| | | |
| | | userRoleService.remove(new LambdaQueryWrapper<UserRole>().eq(UserRole::getUserId, user.getId())); |
| | | for (Long roleId : user.getRoleIds()) { |
| | | if (!userRoleService.save(new UserRole(user.getId(), roleId))) { |
| | | throw new CoolException("服务器内部错误"); |
| | | } |
| | | } |
| | | // userRoleService.remove(new LambdaQueryWrapper<UserRole>().eq(UserRole::getUserId, user.getId())); |
| | | // for (Long roleId : user.getRoleIds()) { |
| | | // if (!userRoleService.save(new UserRole(user.getId(), roleId))) { |
| | | // throw new CoolException("服务器内部错误"); |
| | | // } |
| | | // } |
| | | |
| | | return R.ok("添加成功"); |
| | | } |