| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.StringUtils; |
| | | import com.xinquan.common.core.utils.poi.ExcelUtil; |
| | |
| | | import com.xinquan.system.api.domain.SysDept; |
| | | import com.xinquan.system.api.domain.SysRole; |
| | | import com.xinquan.system.api.domain.SysUser; |
| | | import com.xinquan.system.api.domain.vo.SysUserVO; |
| | | import com.xinquan.system.api.model.LoginUser; |
| | | import com.xinquan.system.domain.SysUserDept; |
| | | import com.xinquan.system.domain.SysUserRole; |
| | | import com.xinquan.system.service.ISysConfigService; |
| | | import com.xinquan.system.service.ISysDeptService; |
| | | import com.xinquan.system.service.ISysPermissionService; |
| | | import com.xinquan.system.service.ISysPostService; |
| | | import com.xinquan.system.service.ISysRoleService; |
| | | import com.xinquan.system.service.ISysUserRoleService; |
| | | import com.xinquan.system.service.ISysUserService; |
| | | import com.xinquan.system.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private ISysUserRoleService sysUserRoleService; |
| | | |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | * 远程调用 根据系统用户id查询用户信息 |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("管理员列表") |
| | | public AjaxResult list(String phonenumber, int pageNumber, int pageSize) { |
| | | PageInfo<SysUser> pageInfo = new PageInfo<>(pageNumber, pageSize); |
| | | PageInfo<SysUser> page = userService.getList(pageInfo, phonenumber); |
| | | return AjaxResult.success(page); |
| | | @PostMapping("/getSysUserById/{id}") |
| | | public R<SysUser> getSysUserById(@PathVariable("id")String id) { |
| | | SysUser byId = userService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | |
| | | if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("手机号已开通账号"); |
| | | if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkPhoneUnique(user)) { |
| | | return error("登陆账号已存在"); |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | int i = userService.insertUser(user); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(1l); |