重构单点-2
This commit is contained in:
1 parent
4251d4960b
commit
887512c5fe
15 files changed
+204
-75
No files matched your search
+112
-66
@@ -18,7 +18,9 @@
|
||||
package com.bsd.pjcloud.app.controller;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.admin.api.dto.UserDTO;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserTokenDTO;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteTokenService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.app.service.AppUserService;
|
||||
@@ -26,6 +28,9 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdPartyAuthService;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ZZDUserDTO;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -34,6 +39,7 @@ import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.core.OAuth2RefreshToken;
|
||||
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AccessTokenAuthenticationToken;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -53,7 +59,7 @@ import java.util.Map;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserAutoLoginController {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
// private final AppUserService appUserService;
|
||||
|
||||
|
||||
private final RemoteTokenService remoteTokenService;
|
||||
@@ -69,61 +75,100 @@ public class AppUserAutoLoginController {
|
||||
*/
|
||||
@GetMapping("/zzdsso/{token}")
|
||||
@Operation(summary = "浙政钉单点登录")
|
||||
@Inner(value = false)
|
||||
//todo 引入seata分布式事务
|
||||
public R zzdsso(@PathVariable(name = "token") String token) {
|
||||
|
||||
//获取数字政务token通过浙政钉前端获取的token,调试阶段先写死
|
||||
// String json = "{" +
|
||||
// "\"username\": \"李宗相\"," +
|
||||
// "\"organizationId\": 2," +
|
||||
// "\"userId\": 1340," +
|
||||
// "\"nickName\": \"李宗相\"," +
|
||||
// "\"mobile\": \"18576496089\"," +
|
||||
// "\"regionCode\": null," +
|
||||
// "\"ext\": {" +
|
||||
// "\"employeeCode\": \"GE_ae12bdf21598498eb48bf2cf2c45a3e1\"," +
|
||||
// "\"organizationCode\": \"GO_63e77077d5e041789bbbe1d0d20bcf41\"," +
|
||||
// "\"nickNameCn\": \"李宗相\"," +
|
||||
// "\"openid\": \"1b51f0e11fc73b8adddcbaf7982daab6\"," +
|
||||
// "\"realmId\": \"196729\"," +
|
||||
// "\"mobile\": null" +
|
||||
// "}" +
|
||||
// "}";
|
||||
String json = "{" +
|
||||
"\"username\": \"李宗相\"," +
|
||||
"\"organizationId\": 2," +
|
||||
"\"userId\": 1340," +
|
||||
"\"nickName\": \"李宗相\"," +
|
||||
"\"mobile\": \"18576496089\"," +
|
||||
"\"regionCode\": null," +
|
||||
"\"ext\": {" +
|
||||
"\"employeeCode\": \"GE_ae12bdf21598498eb48bf2cf2c45a3e1\"," +
|
||||
"\"organizationCode\": \"GO_63e77077d5e041789bbbe1d0d20bcf41\"," +
|
||||
"\"nickNameCn\": \"李宗相\"," +
|
||||
"\"openid\": \"1b51f0e11fc73b8adddcbaf7982daab6\"," +
|
||||
"\"realmId\": \"196729\"," +
|
||||
"\"mobile\": null" +
|
||||
"}" +
|
||||
"}";
|
||||
|
||||
|
||||
// ObjectMapper objectMapper = new ObjectMapper();
|
||||
// ZZDUserDTO zzdUserDTO;
|
||||
// try {
|
||||
// zzdUserDTO = objectMapper.readValue(json, ZZDUserDTO.class);
|
||||
// } catch (JsonProcessingException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
ZZDUserDTO zzdUserDTO;
|
||||
try {
|
||||
zzdUserDTO = objectMapper.readValue(json, ZZDUserDTO.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
//暂时先注释,模拟一下就行
|
||||
R zzdsso = remoterThirdPartyAuthService.zzdsso(token);
|
||||
ZZDUserDTO zzdUserDTO = (ZZDUserDTO) zzdsso.getData();
|
||||
// R zzdsso = remoterThirdPartyAuthService.zzdsso(token);
|
||||
// ZZDUserDTO zzdUserDTO = (ZZDUserDTO) zzdsso.getData();
|
||||
ZZDUserDTO.Ext ext = zzdUserDTO.getExt();
|
||||
String employeeCode = ext.getEmployeeCode();
|
||||
String mobile = zzdUserDTO.getMobile();
|
||||
System.out.println(employeeCode);
|
||||
System.out.println(mobile);
|
||||
|
||||
//两种方式,手机号+员工钉钉号,查到相同就视为同一个人,然后登录
|
||||
//先系统表里面查看是否有,在第三方数据库表里面看下是否有
|
||||
AdminUserRespDTO adminUserRespDTO =adminUserApi.getUserByMobileOrEmployeeCode(employeeCode,mobile);
|
||||
if(adminUserRespDTO!=null){
|
||||
//登录成功
|
||||
return createTokenAfterLoginSuccess(adminUserRespDTO.getId(), zzdUserDTO.getUsername(), LoginLogTypeEnum.LOGIN_SSO);
|
||||
|
||||
//1.根据手机号或者钉钉号先查询是否有这个人
|
||||
R<List<SysUser>> userByMobileOrEmployeeCode = remoteUserService.getUserByMobileOrEmployeeCode(employeeCode, mobile);
|
||||
List<SysUser> sysUserList = userByMobileOrEmployeeCode.getData();
|
||||
|
||||
if(!CollectionUtils.isEmpty(sysUserList)){
|
||||
//登录成功生成token
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUserList.get(0));
|
||||
remoteTokenService.generateToken(userTokenDTO);
|
||||
}
|
||||
log.info("用户不存在,尝试创建用户");
|
||||
CreateUserDto createUserDto = new CreateUserDto();
|
||||
createUserDto.setUsername(zzdUserDTO.getUsername());
|
||||
createUserDto.setMobile(mobile);
|
||||
createUserDto.setNickname(zzdUserDTO.getNickName());
|
||||
createUserDto.setDingtalkEmployeeCode(employeeCode);
|
||||
//todo 换成枚举
|
||||
//2.根据浙政钉的员工钉钉号查询是否有这个人
|
||||
R<List<ThirdPartyUserEntity>> thirdPartyUserEntityR=remoterThirdPartyAuthService.getUserByEmployeeCode(employeeCode);
|
||||
List<ThirdPartyUserEntity> thirdPartyUserEntityList = thirdPartyUserEntityR.getData();
|
||||
|
||||
UserDTO userDTO = new UserDTO();
|
||||
//写死,新加入到部门表的全部归类到其他部门里面,不按照浙政钉的部门
|
||||
userDTO.setDeptId(1865990541445263361L);
|
||||
userDTO.setUsername(zzdUserDTO.getUsername());
|
||||
userDTO.setName(zzdUserDTO.getUsername());
|
||||
userDTO.setNickname(zzdUserDTO.getUsername());
|
||||
//浙里办用户
|
||||
createUserDto.setUserType("1");
|
||||
AdminUserRespDTO adminUserRespDTONew=adminUserApi.createSysUser(createUserDto);
|
||||
log.info("创建用户成功,用户id为:{}",adminUserRespDTONew.getId());
|
||||
return createTokenAfterLoginSuccess(adminUserRespDTONew.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
userDTO.setSystemType("1");
|
||||
//取上面的手机号
|
||||
userDTO.setPhone(mobile);
|
||||
userDTO.setDingtalkEmployeeCode(employeeCode);
|
||||
//随便写死给个密码
|
||||
userDTO.setPassword("pj"+mobile);
|
||||
/* if(!CollectionUtils.isEmpty(thirdPartyUserEntityList)){
|
||||
//todo 这一步现在是没用的,这个最终要考虑是否通过浙政钉里面的人员来限制移动端的使用用户来决定
|
||||
//第三方数据库里面有
|
||||
//这里只在第三方库里查到,所以要对系统用户表进行新增当前用户,插入一条信息进去
|
||||
R<Boolean> booleanR = remoteUserService.registerUser(userDTO);
|
||||
//通过唯一手机号查询到刚注册的用户信息,生成token
|
||||
R<List<SysUser>> userByMobile=remoteUserService.getUserByMobile(mobile);
|
||||
SysUser sysUser = userByMobile.getData().get(0);
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUser);
|
||||
//登录成功,根据新注册的用户信息返回token
|
||||
remoteTokenService.generateToken(userTokenDTO);
|
||||
}
|
||||
else {
|
||||
//两个表都没查到人员不能够使用移动端的系统
|
||||
}*/
|
||||
|
||||
// log.info("用户不存在,尝试创建用户");
|
||||
|
||||
R<Boolean> booleanR = remoteUserService.registerUser(userDTO);
|
||||
//通过唯一手机号查询到刚注册的用户信息,生成token
|
||||
R<List<SysUser>> userByMobile=remoteUserService.getUserByMobile(mobile);
|
||||
SysUser sysUser = userByMobile.getData().get(0);
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUser);
|
||||
//登录成功,根据新注册的用户信息返回token
|
||||
return remoteTokenService.generateToken(userTokenDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,29 +178,30 @@ public class AppUserAutoLoginController {
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/shjnsso")
|
||||
@Operation(summary = "诗画江南单点登录")
|
||||
public R shjnsso(@RequestBody @Valid SHJNSSOReqVO shjnsso) {
|
||||
ZZDUserDTO zzdUserDTO=ssoApi.shjnsso(shjnsso.getAccountId(),shjnsso.getSessionId());
|
||||
ZZDUserDTO.Ext ext = zzdUserDTO.getExt();
|
||||
String mobile = zzdUserDTO.getMobile();
|
||||
AdminUserRespDTO userByMobileOrEmployeeCode = adminUserApi.getUserByMobileOrEmployeeCode(null, mobile);
|
||||
if(userByMobileOrEmployeeCode!=null){
|
||||
return createTokenAfterLoginSuccess(userByMobileOrEmployeeCode.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
}
|
||||
log.info("用户不存在,尝试创建用户");
|
||||
CreateUserDto createUserDto = new CreateUserDto();
|
||||
createUserDto.setUsername(zzdUserDTO.getUsername());
|
||||
createUserDto.setMobile(mobile);
|
||||
createUserDto.setNickname(zzdUserDTO.getNickName());
|
||||
createUserDto.setAvatar(ext.getHeadImgUrl());
|
||||
//todo 换成枚举
|
||||
//诗画用户
|
||||
createUserDto.setUserType("2");
|
||||
AdminUserRespDTO adminUserRespDTONew=adminUserApi.createSysUser(createUserDto);
|
||||
log.info("创建用户成功,用户id为:{}",adminUserRespDTONew.getId());
|
||||
return createTokenAfterLoginSuccess(adminUserRespDTONew.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
}
|
||||
// @PostMapping("/shjnsso")
|
||||
// @Inner(value = false)
|
||||
// @Operation(summary = "诗画江南单点登录")
|
||||
// public R shjnsso(@RequestBody @Valid SHJNSSOReqVO shjnsso) {
|
||||
// ZZDUserDTO zzdUserDTO=ssoApi.shjnsso(shjnsso.getAccountId(),shjnsso.getSessionId());
|
||||
// ZZDUserDTO.Ext ext = zzdUserDTO.getExt();
|
||||
// String mobile = zzdUserDTO.getMobile();
|
||||
// AdminUserRespDTO userByMobileOrEmployeeCode = adminUserApi.getUserByMobileOrEmployeeCode(null, mobile);
|
||||
// if(userByMobileOrEmployeeCode!=null){
|
||||
// return createTokenAfterLoginSuccess(userByMobileOrEmployeeCode.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
// }
|
||||
// log.info("用户不存在,尝试创建用户");
|
||||
// CreateUserDto createUserDto = new CreateUserDto();
|
||||
// createUserDto.setUsername(zzdUserDTO.getUsername());
|
||||
// createUserDto.setMobile(mobile);
|
||||
// createUserDto.setNickname(zzdUserDTO.getNickName());
|
||||
// createUserDto.setAvatar(ext.getHeadImgUrl());
|
||||
// //todo 换成枚举
|
||||
// //诗画用户
|
||||
// createUserDto.setUserType("2");
|
||||
// AdminUserRespDTO adminUserRespDTONew=adminUserApi.createSysUser(createUserDto);
|
||||
// log.info("创建用户成功,用户id为:{}",adminUserRespDTONew.getId());
|
||||
// return createTokenAfterLoginSuccess(adminUserRespDTONew.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
// }
|
||||
|
||||
|
||||
@Inner(value = false)
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserTokenDTO;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysOauthClientDetails;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysTenant;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteClientDetailsService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteTenantService;
|
||||
import com.bsd.pjcloud.admin.api.vo.TokenVO;
|
||||
@@ -116,10 +117,11 @@ public class PjcloudTokenEndpoint {
|
||||
.build())
|
||||
.build();
|
||||
|
||||
|
||||
SysUser sysUser = userTokenDTO.getSysUser();
|
||||
// 构建用户信息 , 这里只拼接了 UserTokenDTO 中的 username 和 authorities ,其他字段写死,可以自行场地;
|
||||
PjcloudUser pigUser = new PjcloudUser(1L, userTokenDTO.getUsername(),1L,null,"","","", "", 1L
|
||||
, "", true, true,"1", true,false, userTokenDTO.getAuthorities()
|
||||
PjcloudUser pigUser = new PjcloudUser(sysUser.getUserId(),sysUser.getUsername(),sysUser.getDeptId(),sysUser.getPhone()
|
||||
,sysUser.getAvatar(),sysUser.getNickname(),sysUser.getName(), sysUser.getEmail(), sysUser.getTenantId()
|
||||
, sysUser.getPassword(), true, true,"1", true,false, userTokenDTO.getAuthorities()
|
||||
.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList()));
|
||||
|
||||
Authentication usernamePasswordAuthentication = new UsernamePasswordAuthenticationToken(pigUser, StrUtil.EMPTY);
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring</artifactId>
|
||||
</dependency>
|
||||
<!--feign 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
|
||||
+11
@@ -21,6 +21,7 @@ package com.bsd.pjcloud.thirdparty.api.feign;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -43,5 +44,15 @@ public interface RemoterThirdPartyAuthService {
|
||||
R zzdsso(@RequestParam("token") String token);
|
||||
|
||||
|
||||
/**
|
||||
* 根据钉钉号查询第三方表里面是否有这个人,也就是浙政钉总体系人员表
|
||||
* @param employeeCode
|
||||
* @return
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/thirdPartyUser/getUserByEmployeeCode")
|
||||
R<List<ThirdPartyUserEntity>> getUserByEmployeeCode(@RequestParam("employeeCode") String employeeCode);
|
||||
|
||||
|
||||
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
-6
@@ -1,19 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyDeptEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPartyOAuth2Service;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
+12
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
|
||||
import com.bsd.pjcloud.thirdparty.service.ThirdPartyUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -115,4 +116,15 @@ public class ThirdPartyUserController {
|
||||
public List<ThirdPartyUserEntity> export(ThirdPartyUserEntity thirdPartyUser,Long[] ids) {
|
||||
return thirdPartyUserService.list(Wrappers.lambdaQuery(thirdPartyUser).in(ArrayUtil.isNotEmpty(ids), ThirdPartyUserEntity::getId, ids));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "根据钉钉号查找某个人" )
|
||||
@GetMapping("/getUserByEmployeeCode" )
|
||||
@Inner
|
||||
public R<List<ThirdPartyUserEntity>> getUserByEmployeeCode(@RequestParam("employeeCode")String employeeCode) {
|
||||
LambdaQueryWrapper<ThirdPartyUserEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(ThirdPartyUserEntity::getDingtalkEmployeeCode, employeeCode);
|
||||
List<ThirdPartyUserEntity> list = thirdPartyUserService.list(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
||||
+10
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.admin.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -16,4 +17,13 @@ public class UserTokenDTO {
|
||||
* 权限列表
|
||||
*/
|
||||
private List<String> authorities = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
* 基础的用户信息
|
||||
*/
|
||||
private SysUser sysUser;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -216,4 +216,14 @@ public class SysUser extends Model<SysUser> implements Serializable {
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
|
||||
/**
|
||||
* 员工浙政钉编码
|
||||
*/
|
||||
@Schema(description="员工浙政钉编码")
|
||||
private String dingtalkEmployeeCode;
|
||||
|
||||
|
||||
@Schema(description="员工所属系统类型")
|
||||
private String systemType;
|
||||
}
|
||||
+14
@@ -113,4 +113,18 @@ public interface RemoteUserService {
|
||||
@PostMapping("/register/user")
|
||||
R<Boolean> registerUser(@RequestBody UserDTO userDTO);
|
||||
|
||||
/**
|
||||
* 根据钉钉号和手机号查询用户信息
|
||||
* @param employeeCode 钉钉号
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/user/getUserByMobileOrEmployeeCode")
|
||||
R<List<SysUser>> getUserByMobileOrEmployeeCode(@RequestParam("employeeCode")String employeeCode,
|
||||
@RequestParam("mobile") String mobile);
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/user/getUserByMobile")
|
||||
R<List<SysUser>> getUserByMobile(@RequestParam("mobile") String mobile);
|
||||
}
|
||||
@@ -198,4 +198,8 @@ public class UserVO implements Serializable {
|
||||
private String email;
|
||||
|
||||
|
||||
@Schema(description = "员工浙政钉编码")
|
||||
private String dingtalkEmployeeCode;
|
||||
|
||||
|
||||
}
|
||||
+2
@@ -39,6 +39,8 @@ public class RegisterController {
|
||||
return userService.registerUser(userDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
|
||||
+19
@@ -310,4 +310,23 @@ public class SysUserController {
|
||||
return R.ok(userService.list(Wrappers.<SysUser>lambdaQuery().in(SysUser::getUserId, userIds)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据浙政钉号和手机号查询
|
||||
* @param employeeCode
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserByMobileOrEmployeeCode")
|
||||
@Inner
|
||||
public R<List<SysUser>> getUserByMobileOrEmployeeCode(@RequestParam("employeeCode") String employeeCode,
|
||||
@RequestParam("mobile") String mobile) {
|
||||
return R.ok(userService.list(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getDingtalkEmployeeCode, employeeCode).or().eq(SysUser::getPhone, mobile)));
|
||||
}
|
||||
|
||||
@GetMapping("/getUserByMobile")
|
||||
@Inner
|
||||
public R<List<SysUser>> getUserByMobile(@RequestParam("mobile") String mobile) {
|
||||
return R.ok(userService.list(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getPhone, mobile)));
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
<result column="nickname" property="nickname"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="dingtalk_employee_code" property="dingtalkEmployeeCode"/>
|
||||
<collection property="roleList" ofType="com.bsd.pjcloud.admin.api.entity.SysRole"
|
||||
select="com.bsd.pjcloud.admin.mapper.SysRoleMapper.listRolesByUserId" column="user_id">
|
||||
</collection>
|
||||
|
||||
Reference in new issue
Block a user