司机APP注册是默认用户角色
This commit is contained in:
+22
@@ -1864,6 +1864,12 @@ public class UserApplicationService {
|
||||
wlhyDomainService.addOrEditPlatformUser1(userEntity);
|
||||
//同步商城用户
|
||||
userMallDomainService.syncDriverUserInfo(userEntity);
|
||||
//同步YMS平台员工信息
|
||||
try {
|
||||
ymsDomainService.addOrEditYmsUser(userEntity);
|
||||
} catch (Exception e) {
|
||||
log.warn("同步YMS平台员工信息失败,但不影响用户保存: {}", e.getMessage());
|
||||
}
|
||||
//给用户分配默认普通角色权限
|
||||
RoleDo roleDo = new RoleDo();
|
||||
roleDo.setRoleCode(RoleEnum.DRIVER.getCode());
|
||||
@@ -1881,6 +1887,22 @@ public class UserApplicationService {
|
||||
userRoleDomainService.addUserRole(userRoleDo);
|
||||
}
|
||||
}
|
||||
//给用户分配默认普通用户角色(must)
|
||||
RoleDo mustRoleDo = new RoleDo();
|
||||
mustRoleDo.setRoleCode(RoleEnum.MUST.getCode());
|
||||
mustRoleDo.setOrganizationId(userEntity.getOrganizationId());
|
||||
RoleEntity mustRoleEntity = roleDomainService.selectByOrganizationIdAndRoleCode(mustRoleDo);
|
||||
if (null != mustRoleEntity) {
|
||||
UserRoleDo mustUserRoleDo = new UserRoleDo();
|
||||
mustUserRoleDo.setUserId(userEntity.getUserId());
|
||||
mustUserRoleDo.setRoleId(mustRoleEntity.getRoleId());
|
||||
LoginUser loginUser2 = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser2)) {
|
||||
userRoleDomainService.addUserRole(mustUserRoleDo, userEntity);
|
||||
} else {
|
||||
userRoleDomainService.addUserRole(mustUserRoleDo);
|
||||
}
|
||||
}
|
||||
//2024年3月27日16:40:15 处理用户验证码注册,首次登录redis用户数据不更新问题
|
||||
//此处根据id重新查询
|
||||
return userDomainService.selectByUserId(userEntity.getUserId());
|
||||
|
||||
Reference in New Issue
Block a user