| | |
| | | package com.project.admin.controller.system; |
| | | |
| | | import com.project.common.annotation.Log; |
| | | import com.project.common.annotation.RepeatSubmit; |
| | | import com.project.common.constant.UserConstants; |
| | | import com.project.common.core.controller.BaseController; |
| | | import com.project.common.core.domain.AjaxResult; |
| | |
| | | import com.project.common.core.page.TableDataInfo; |
| | | import com.project.common.enums.BusinessType; |
| | | import com.project.common.utils.SecurityUtils; |
| | | import com.project.common.utils.SensitiveUtil; |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.utils.poi.ExcelUtil; |
| | | import com.project.system.domain.bo.editBo.UserDeptBo; |
| | |
| | | public TableDataInfo list(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | List<SysUser> list = userService.selectUserListCommon(user); |
| | | list.forEach(SensitiveUtil::desensitize); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUser user) |
| | | { |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | List<SysUser> list = userService.selectUserListCommon(user); |
| | | ExcelUtil<SysUser> util = new ExcelUtil<>(SysUser.class); |
| | | util.exportExcel(response, list, "用户数据"); |
| | | } |
| | |
| | | if (sysDept.getAncestors().contains("101") || sysDept.getDeptId().equals(101L)){ |
| | | user.setUserType("00"); |
| | | user.setRecommendPhone(deptService.getCheckDeptIdByLoginDeptId(user.getDeptId()).toString()); |
| | | } else { |
| | | user.setUserType("01"); |
| | | } |
| | | } |
| | | |
| | |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | | if (sysDept.getAncestors().contains("101") || sysDept.getDeptId().equals(101L)){ |
| | | user.setUserType("00"); |
| | | } else { |
| | | user.setUserType("01"); |
| | | } |
| | | } |
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) |
| | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | // @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) |
| | |
| | | @ApiOperation(value = "保存导入信息") |
| | | @Log(title = "导入用户信息保存" , businessType = BusinessType.IMPORT) |
| | | @PostMapping("/saveImport") |
| | | @RepeatSubmit |
| | | public AjaxResult saveImport(@RequestBody SysUserResultVo resultVo) |
| | | { |
| | | return toAjax(userService.saveImport(resultVo) ? 1 : 0); |