| | |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.system.SysUserVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @ApiOperation(value = "根据部门id获取用户列表") |
| | | @GetMapping("/listByDeptId") |
| | | public AjaxResult<PageInfo<SysUserVO>> listByDeptId(@ApiParam(value = "部门id")Integer deptId, |
| | | @ApiParam(value = "分页参数,当前页码") |
| | | Integer pageNum, |
| | | @ApiParam(value = "分页参数,每页数量,默认为10") Integer pageSize ) { |
| | | PageInfo<SysUserVO> list = userService.listByDeptId(deptId,pageNum,pageSize); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @ApiOperation(value = "获取用户列表-不分页") |
| | | @PostMapping("/listNotPage") |
| | | |
| | |
| | | } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | user.setUserName(user.getPhonenumber()); |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | userService.insertUser(user); |
| | |
| | | } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | |
| | | user.setUserName(user.getPhonenumber()); |
| | | user.setUpdateBy(getUsername()); |
| | | if (StringUtils.isNotEmpty(user.getPassword())) { |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |