| | |
| | | * @param tenantId |
| | | * @param account |
| | | * @param password |
| | | * @param type 登录类型 2:pc 3:app |
| | | * @param type 登录类型 2:pc 3:app |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param user |
| | | * @param type 登录类型 2:pc 3:app |
| | | * @return |
| | |
| | | userInfo.setUser(user); |
| | | if (Func.isNotEmpty(user)) { |
| | | // 判断登录类型设置对应的角色id |
| | | user.setRoleId(Strings.join(roleService.getRoleIdStrByRoleIdAndType(user.getRoleId(),type), ',')); |
| | | user.setRoleId(Strings.join(roleService.getRoleIdStrByRoleIdAndType(user.getRoleId(), type), ',')); |
| | | // 设置角色别名 |
| | | List<String> roleAlias = roleService.getRoleAliases(user.getRoleId()); |
| | | userInfo.setRoles(roleAlias); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean registerUser(UserVO user) { |
| | | if (StringUtils.isEmpty(user.getAccount())) { |
| | | throw new ServiceException("账号不能为空!"); |
| | | } |
| | | if (StringUtils.isEmpty(user.getPassword())) { |
| | | throw new ServiceException("密码不能为空!"); |
| | | } |
| | | if (!StringUtils.equals(user.getPassword(), user.getPassword2())) { |
| | | throw new ServiceException("两次的密码不一致!"); |
| | | } |
| | | long count = count(Wrappers.<User>lambdaQuery().eq(User::getAccount, user.getAccount())); |
| | | if (count > 0) { |
| | | throw new ServiceException("改账号已存在,请更换其他账号!"); |
| | | } |
| | | |
| | | user.setPassword(DigestUtil.encrypt(user.getPassword())); |
| | | user.setRoleId("1759487358708310017"); |
| | | boolean oauthTemp = save(user); |
| | | return (oauthTemp); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updatePlatform(Long userId, Integer userType, String userExt) { |
| | | if (userType.equals(UserEnum.WEB.getCategory())) { |
| | | UserWeb userWeb = new UserWeb(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理漏绑定的user_dept |
| | | */ |
| | |
| | | userInfo.setRoleId(userInfo.getRoleId() + ",1727864411451359233"); |
| | | } |
| | | // 设置性别 |
| | | setSex(userInfo,userExcel); |
| | | setSex(userInfo, userExcel); |
| | | // 更新机构 |
| | | setDeptId(userInfo, userExcel); |
| | | // 更新 |
| | |
| | | user.setPhone(userExcel.getPhone()); |
| | | user.setAccount(userExcel.getPhone()); |
| | | // 设置性别 |
| | | setSex(user,userExcel); |
| | | setSex(user, userExcel); |
| | | // 更新机构 |
| | | setDeptId(user, userExcel); |
| | | // 设置初始密码 |
| | |
| | | |
| | | /** |
| | | * 设置性别 |
| | | * |
| | | * @param user |
| | | * @param userExcel |
| | | */ |
| | | private void setSex(User user, PoliceUserExcel userExcel) { |
| | | if (userExcel.getSex().contains("男")){ |
| | | if (userExcel.getSex().contains("男")) { |
| | | user.setSex(1); |
| | | } |
| | | if (userExcel.getSex().contains("女")){ |
| | | if (userExcel.getSex().contains("女")) { |
| | | user.setSex(2); |
| | | } |
| | | } |