| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | user.setPageNum(null); |
| | | user.setPageSize(null); |
| | | List<SysUser> total = userService.getUserList(user); |
| | | rspData.put("total", total.size()); |
| | | |
| | | if (CollectionUtils.isNotEmpty(total)) rspData.put("total", total.size()); |
| | | else rspData.put("total", 0); |
| | | return rspData; |
| | | } |
| | | |
| | |
| | | log.info("--------userId的值为:{}", userId); |
| | | userService.checkUserDataScope(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | log.info("--------user的值为:{}", user); |
| | | |
| | | SysRole roleVo = new SysRole(); |
| | | roleVo.setOrgid(user.getOrgid()); |
| | | List<SysRole> roles = roleService.selectRoleList(roleVo); |
| | | log.info("--------roles的值为:{}", roles); |
| | | |
| | | ajax.put("roles", isAdmin.contains(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | ajax.put("posts", postService.selectPostAll()); |
| | | if (StringUtils.isNotNull(userId)) { |
| | |
| | | SysUserDept sysUserDept = new SysUserDept(); |
| | | sysUserDept.setUserId(userId); |
| | | sysUserDept.setDeptType("1"); |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | log.info("--------user的值为:{}", user); |
| | | |
| | | sysUserDept.setOrgid(user.getOrgid()); |
| | | sysUserDeptKSs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept); |
| | | ajax.put("belongDepts", sysUserDeptKSs); |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) { |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) { |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |