Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
travel-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cloud
travel-cloud
Commits
60f70e04
提交
60f70e04
authored
1月 13, 2025
作者:
hzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户注册登录功能实现
上级
4b4d5c01
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
583 行增加
和
7 行删除
+583
-7
RemoteUserProfileService.java
...java/org/dromara/server/api/RemoteUserProfileService.java
+21
-0
RemoteUserProfileAdd.java
...a/org/dromara/server/api/domain/RemoteUserProfileAdd.java
+49
-0
RemoteUserService.java
...c/main/java/org/dromara/system/api/RemoteUserService.java
+1
-1
SysLoginService.java
...c/main/java/org/dromara/auth/service/SysLoginService.java
+16
-3
UserProfileController.java
.../org/dromara/server/controller/UserProfileController.java
+107
-0
UserProfile.java
.../src/main/java/org/dromara/server/domain/UserProfile.java
+81
-0
UserProfileBo.java
...main/java/org/dromara/server/domain/bo/UserProfileBo.java
+83
-0
UserProfileVo.java
...main/java/org/dromara/server/domain/vo/UserProfileVo.java
+82
-0
RemoteUserProfileServiceImpl.java
...rg/dromara/server/dubbo/RemoteUserProfileServiceImpl.java
+50
-0
UserProfileMapper.java
...ain/java/org/dromara/server/mapper/UserProfileMapper.java
+15
-0
IUserProfileService.java
.../java/org/dromara/server/service/IUserProfileService.java
+17
-0
UserProfileServiceImpl.java
...g/dromara/server/service/impl/UserProfileServiceImpl.java
+49
-0
UserProfileMapper.xml
...er/src/main/resources/mapper/server/UserProfileMapper.xml
+7
-0
RemoteUserServiceImpl.java
.../java/org/dromara/system/dubbo/RemoteUserServiceImpl.java
+4
-3
SysUserServiceImpl.java
...a/org/dromara/system/service/impl/SysUserServiceImpl.java
+1
-0
没有找到文件。
ruoyi-api/ruoyi-api-server/src/main/java/org/dromara/server/api/RemoteUserProfileService.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
api
;
import
org.dromara.server.api.domain.RemoteUserProfileAdd
;
/**
* 远程用户配置服务
*
* @author wenhe
*/
public
interface
RemoteUserProfileService
{
/**
* 创建小程序用户
*
* @param vo 新增相关数据
* @return boolean 是否成功
*/
boolean
createUser
(
RemoteUserProfileAdd
vo
);
}
ruoyi-api/ruoyi-api-server/src/main/java/org/dromara/server/api/domain/RemoteUserProfileAdd.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
api
.
domain
;
import
jakarta.validation.constraints.NotEmpty
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serial
;
import
java.io.Serializable
;
/**
* @author hzh
* @date 2024-11-14
* @desc 新增用户
**/
@Data
@Accessors
(
chain
=
true
)
public
class
RemoteUserProfileAdd
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
* 租户编码
*/
@NotEmpty
(
message
=
"租户编码不能为空"
)
private
String
tenantId
;
/**
* 系统用户id
*/
@NotNull
(
message
=
"系统用户id不能为空"
)
private
Long
systemUserId
;
/**
* 用户名
*/
@NotEmpty
(
message
=
"用户名不能为空"
)
private
String
name
;
/**
* 手机号
*/
@NotEmpty
(
message
=
"手机号不能为空"
)
private
String
phoneNumber
;
}
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteUserService.java
浏览文件 @
60f70e04
...
@@ -68,7 +68,7 @@ public interface RemoteUserService {
...
@@ -68,7 +68,7 @@ public interface RemoteUserService {
* @param remoteUserBo 用户信息
* @param remoteUserBo 用户信息
* @return 结果
* @return 结果
*/
*/
Boolean
registerUserInfo
(
RemoteUserBo
remoteUserBo
)
throws
UserException
,
ServiceException
;
Long
registerUserInfo
(
RemoteUserBo
remoteUserBo
)
throws
UserException
,
ServiceException
;
/**
/**
* 注册用户信息
* 注册用户信息
...
...
ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java
浏览文件 @
60f70e04
...
@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.lock.annotation.Lock4j
;
import
com.baomidou.lock.annotation.Lock4j
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhyd.oauth.model.AuthUser
;
import
me.zhyd.oauth.model.AuthUser
;
...
@@ -32,6 +33,8 @@ import org.dromara.common.redis.utils.RedisUtils;
...
@@ -32,6 +33,8 @@ import org.dromara.common.redis.utils.RedisUtils;
import
org.dromara.common.satoken.utils.LoginHelper
;
import
org.dromara.common.satoken.utils.LoginHelper
;
import
org.dromara.common.tenant.exception.TenantException
;
import
org.dromara.common.tenant.exception.TenantException
;
import
org.dromara.common.tenant.helper.TenantHelper
;
import
org.dromara.common.tenant.helper.TenantHelper
;
import
org.dromara.server.api.RemoteUserProfileService
;
import
org.dromara.server.api.domain.RemoteUserProfileAdd
;
import
org.dromara.system.api.RemoteSocialService
;
import
org.dromara.system.api.RemoteSocialService
;
import
org.dromara.system.api.RemoteTenantService
;
import
org.dromara.system.api.RemoteTenantService
;
import
org.dromara.system.api.RemoteUserService
;
import
org.dromara.system.api.RemoteUserService
;
...
@@ -64,6 +67,8 @@ public class SysLoginService {
...
@@ -64,6 +67,8 @@ public class SysLoginService {
private
RemoteTenantService
remoteTenantService
;
private
RemoteTenantService
remoteTenantService
;
@DubboReference
@DubboReference
private
RemoteSocialService
remoteSocialService
;
private
RemoteSocialService
remoteSocialService
;
@DubboReference
private
RemoteUserProfileService
remoteUserProfileService
;
@Autowired
@Autowired
private
UserPasswordProperties
userPasswordProperties
;
private
UserPasswordProperties
userPasswordProperties
;
...
@@ -134,6 +139,7 @@ public class SysLoginService {
...
@@ -134,6 +139,7 @@ public class SysLoginService {
/**
/**
* 注册
* 注册
*/
*/
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
register
(
RegisterBody
registerBody
)
{
public
void
register
(
RegisterBody
registerBody
)
{
String
tenantId
=
registerBody
.
getTenantId
();
String
tenantId
=
registerBody
.
getTenantId
();
String
username
=
registerBody
.
getUsername
();
String
username
=
registerBody
.
getUsername
();
...
@@ -158,12 +164,19 @@ public class SysLoginService {
...
@@ -158,12 +164,19 @@ public class SysLoginService {
remoteUserBo
.
setUserType
(
userType
);
remoteUserBo
.
setUserType
(
userType
);
remoteUserBo
.
setPhonenumber
(
phone
);
remoteUserBo
.
setPhonenumber
(
phone
);
boolean
regFlag
=
remoteUserService
.
registerUserInfo
(
remoteUserBo
);
Long
userId
=
remoteUserService
.
registerUserInfo
(
remoteUserBo
);
if
(
!
regFlag
)
{
if
(
userId
==
null
)
{
throw
new
UserException
(
"user.register.error"
);
throw
new
UserException
(
"user.register.error"
);
}
}
//创建用户信息
remoteUserProfileService
.
createUser
(
new
RemoteUserProfileAdd
()
.
setTenantId
(
tenantId
)
.
setName
(
username
)
.
setPhoneNumber
(
phone
)
.
setSystemUserId
(
userId
)
);
recordLogininfor
(
tenantId
,
username
,
Constants
.
REGISTER
,
MessageUtils
.
message
(
"user.register.success"
));
recordLogininfor
(
tenantId
,
username
,
Constants
.
REGISTER
,
MessageUtils
.
message
(
"user.register.success"
));
}
}
...
...
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/controller/UserProfileController.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
controller
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.validation.constraints.NotEmpty
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.common.core.domain.R
;
import
org.dromara.common.core.validate.AddGroup
;
import
org.dromara.common.core.validate.EditGroup
;
import
org.dromara.common.excel.utils.ExcelUtil
;
import
org.dromara.common.idempotent.annotation.RepeatSubmit
;
import
org.dromara.common.log.annotation.Log
;
import
org.dromara.common.log.enums.BusinessType
;
import
org.dromara.common.mybatis.core.page.PageQuery
;
import
org.dromara.common.mybatis.core.page.TableDataInfo
;
import
org.dromara.common.web.core.BaseController
;
import
org.dromara.server.domain.bo.UserProfileBo
;
import
org.dromara.server.domain.vo.UserProfileVo
;
import
org.dromara.server.service.IUserProfileService
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 用户信息
* 前端访问路由地址为:/server/profile
*
* @author hzh
* @date 2025-01-13
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping
(
"/profile"
)
public
class
UserProfileController
extends
BaseController
{
private
final
IUserProfileService
userProfileService
;
/**
* 查询用户信息列表
*/
@SaCheckPermission
(
"server:profile:list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
<
UserProfileVo
>
list
(
UserProfileBo
bo
,
PageQuery
pageQuery
)
{
return
userProfileService
.
queryPageList
(
bo
,
pageQuery
);
}
/**
* 导出用户信息列表
*/
@SaCheckPermission
(
"server:profile:export"
)
@Log
(
title
=
"用户信息"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
UserProfileBo
bo
,
HttpServletResponse
response
)
{
List
<
UserProfileVo
>
list
=
userProfileService
.
queryList
(
bo
);
ExcelUtil
.
exportExcel
(
list
,
"用户信息"
,
UserProfileVo
.
class
,
response
);
}
/**
* 获取用户信息详细信息
*
* @param id 主键
*/
@SaCheckPermission
(
"server:profile:query"
)
@GetMapping
(
"/{id}"
)
public
R
<
UserProfileVo
>
getInfo
(
@NotNull
(
message
=
"主键不能为空"
)
@PathVariable
Long
id
)
{
return
R
.
ok
(
userProfileService
.
queryById
(
id
));
}
/**
* 新增用户信息
*/
@SaCheckPermission
(
"server:profile:add"
)
@Log
(
title
=
"用户信息"
,
businessType
=
BusinessType
.
INSERT
)
@RepeatSubmit
()
@PostMapping
()
public
R
<
Void
>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
UserProfileBo
bo
)
{
return
toAjax
(
userProfileService
.
insertByBo
(
bo
));
}
/**
* 修改用户信息
*/
@SaCheckPermission
(
"server:profile:edit"
)
@Log
(
title
=
"用户信息"
,
businessType
=
BusinessType
.
UPDATE
)
@RepeatSubmit
()
@PutMapping
()
public
R
<
Void
>
edit
(
@Validated
(
EditGroup
.
class
)
@RequestBody
UserProfileBo
bo
)
{
return
toAjax
(
userProfileService
.
updateByBo
(
bo
));
}
/**
* 删除用户信息
*
* @param ids 主键串
*/
@SaCheckPermission
(
"server:profile:remove"
)
@Log
(
title
=
"用户信息"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
R
<
Void
>
remove
(
@NotEmpty
(
message
=
"主键不能为空"
)
@PathVariable
Long
[]
ids
)
{
return
toAjax
(
userProfileService
.
deleteWithValidByIds
(
List
.
of
(
ids
),
true
));
}
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/domain/UserProfile.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
java.io.Serial
;
/**
* 用户信息对象 user_profile
*
* @author hzh
* @date 2025-01-13
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"user_profile"
)
public
class
UserProfile
extends
TenantEntity
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
* 用户ID
*/
@TableId
(
value
=
"id"
)
private
Long
id
;
/**
* 系统用户id
*/
private
Long
systemUserId
;
/**
* 姓名
*/
private
String
name
;
/**
* 手机号码
*/
private
String
phonenumber
;
/**
* 分享人id
*/
private
Long
shareUserId
;
/**
* 分享人租户编码
*/
private
String
shareTenantId
;
/**
* 火车票账号
*/
private
String
trainAccount
;
/**
* 火车票密码
*/
private
String
trainPassword
;
/**
* 删除标志(0代表存在 2代表删除)
*/
@TableLogic
private
String
delFlag
;
/**
* 备注
*/
private
String
remark
;
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/domain/bo/UserProfileBo.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
domain
.
bo
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.core.validate.AddGroup
;
import
org.dromara.common.core.validate.EditGroup
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.server.domain.UserProfile
;
/**
* 用户信息业务对象 user_profile
*
* @author hzh
* @date 2025-01-13
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@AutoMapper
(
target
=
UserProfile
.
class
,
reverseConvertGenerate
=
false
)
public
class
UserProfileBo
extends
BaseEntity
{
/**
* 用户ID
*/
@NotNull
(
message
=
"用户ID不能为空"
,
groups
=
{
EditGroup
.
class
})
private
Long
id
;
/**
* 租户编码
*/
private
String
tenantId
;
/**
* 系统用户id
*/
@NotNull
(
message
=
"系统用户id不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
systemUserId
;
/**
* 姓名
*/
@NotBlank
(
message
=
"姓名不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
name
;
/**
* 手机号码
*/
@NotBlank
(
message
=
"手机号码不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
phonenumber
;
/**
* 分享人id
*/
@NotNull
(
message
=
"分享人id不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
shareUserId
;
/**
* 分享人租户编码
*/
private
String
shareTenantId
;
/**
* 火车票账号
*/
private
String
trainAccount
;
/**
* 火车票密码
*/
private
String
trainPassword
;
/**
* 备注
*/
@NotBlank
(
message
=
"备注不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
remark
;
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/domain/vo/UserProfileVo.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
domain
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
org.dromara.server.domain.UserProfile
;
import
java.io.Serial
;
import
java.io.Serializable
;
/**
* 用户信息视图对象 user_profile
*
* @author hzh
* @date 2025-01-13
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper
(
target
=
UserProfile
.
class
)
public
class
UserProfileVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
* 用户ID
*/
@ExcelProperty
(
value
=
"用户ID"
)
private
Long
id
;
/**
* 系统用户id
*/
@ExcelProperty
(
value
=
"系统用户id"
)
private
Long
systemUserId
;
/**
* 姓名
*/
@ExcelProperty
(
value
=
"姓名"
)
private
String
name
;
/**
* 手机号码
*/
@ExcelProperty
(
value
=
"手机号码"
)
private
String
phonenumber
;
/**
* 分享人id
*/
@ExcelProperty
(
value
=
"分享人id"
)
private
Long
shareUserId
;
/**
* 分享人租户编码
*/
@ExcelProperty
(
value
=
"分享人租户编码"
)
private
String
shareTenantId
;
/**
* 火车票账号
*/
@ExcelProperty
(
value
=
"火车票账号"
)
private
String
trainAccount
;
/**
* 火车票密码
*/
@ExcelProperty
(
value
=
"火车票密码"
)
private
String
trainPassword
;
/**
* 备注
*/
@ExcelProperty
(
value
=
"备注"
)
private
String
remark
;
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/dubbo/RemoteUserProfileServiceImpl.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
dubbo
;
import
cn.hutool.core.bean.BeanUtil
;
import
io.github.linpeilie.utils.CollectionUtils
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.dromara.common.core.utils.ValidatorUtils
;
import
org.dromara.server.api.RemoteUserProfileService
;
import
org.dromara.server.api.domain.RemoteUserProfileAdd
;
import
org.dromara.server.domain.bo.UserProfileBo
;
import
org.dromara.server.domain.vo.UserProfileVo
;
import
org.dromara.server.service.IUserProfileService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author hzh
* @date 2025-01-13
* @desc 用户服务实现类
**/
@RequiredArgsConstructor
@Service
@DubboService
public
class
RemoteUserProfileServiceImpl
implements
RemoteUserProfileService
{
private
final
IUserProfileService
userService
;
@Override
public
boolean
createUser
(
RemoteUserProfileAdd
vo
)
{
ValidatorUtils
.
validate
(
vo
);
UserProfileBo
up
=
new
UserProfileBo
()
.
setName
(
vo
.
getName
())
.
setPhonenumber
(
vo
.
getPhoneNumber
());
up
.
setTenantId
(
vo
.
getTenantId
());
List
<
UserProfileVo
>
list
=
userService
.
queryList
(
up
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
return
true
;
}
//创建用户信息
UserProfileBo
profile
=
BeanUtil
.
copyProperties
(
vo
,
UserProfileBo
.
class
);
profile
.
setPhonenumber
(
vo
.
getPhoneNumber
());
userService
.
insertByBo
(
profile
);
return
true
;
}
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/mapper/UserProfileMapper.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
mapper
;
import
org.dromara.common.mybatis.core.mapper.BaseMapperPlus
;
import
org.dromara.server.domain.UserProfile
;
import
org.dromara.server.domain.vo.UserProfileVo
;
/**
* 用户信息Mapper接口
*
* @author hzh
* @date 2025-01-13
*/
public
interface
UserProfileMapper
extends
BaseMapperPlus
<
UserProfile
,
UserProfileVo
>
{
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/service/IUserProfileService.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
service
;
import
org.dromara.common.mybatis.service.IBaseService
;
import
org.dromara.server.domain.UserProfile
;
import
org.dromara.server.domain.bo.UserProfileBo
;
import
org.dromara.server.domain.vo.UserProfileVo
;
/**
* 用户信息Service接口
*
* @author hzh
* @date 2025-01-13
*/
public
interface
IUserProfileService
extends
IBaseService
<
UserProfileVo
,
UserProfileBo
,
UserProfile
>
{
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/service/impl/UserProfileServiceImpl.java
0 → 100644
浏览文件 @
60f70e04
package
org
.
dromara
.
server
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.common.core.utils.StringUtils
;
import
org.dromara.common.mybatis.core.mapper.BaseMapperPlus
;
import
org.dromara.common.mybatis.service.AbstractBaseService
;
import
org.dromara.server.domain.UserProfile
;
import
org.dromara.server.domain.bo.UserProfileBo
;
import
org.dromara.server.domain.vo.UserProfileVo
;
import
org.dromara.server.mapper.UserProfileMapper
;
import
org.dromara.server.service.IUserProfileService
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
/**
* 用户信息Service业务层处理
*
* @author hzh
* @date 2025-01-13
*/
@RequiredArgsConstructor
@Service
public
class
UserProfileServiceImpl
extends
AbstractBaseService
<
UserProfileVo
,
UserProfileBo
,
UserProfile
>
implements
IUserProfileService
{
private
final
UserProfileMapper
baseMapper
;
@Override
public
BaseMapperPlus
<
UserProfile
,
UserProfileVo
>
mapper
()
{
return
baseMapper
;
}
@Override
public
LambdaQueryWrapper
<
UserProfile
>
buildQueryWrapper
(
UserProfileBo
bo
)
{
Map
<
String
,
Object
>
params
=
bo
.
getParams
();
LambdaQueryWrapper
<
UserProfile
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
eq
(
bo
.
getSystemUserId
()
!=
null
,
UserProfile:
:
getSystemUserId
,
bo
.
getSystemUserId
());
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getName
()),
UserProfile:
:
getName
,
bo
.
getName
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPhonenumber
()),
UserProfile:
:
getPhonenumber
,
bo
.
getPhonenumber
());
lqw
.
eq
(
bo
.
getShareUserId
()
!=
null
,
UserProfile:
:
getShareUserId
,
bo
.
getShareUserId
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getShareTenantId
()),
UserProfile:
:
getShareTenantId
,
bo
.
getShareTenantId
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getTrainAccount
()),
UserProfile:
:
getTrainAccount
,
bo
.
getTrainAccount
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getTrainPassword
()),
UserProfile:
:
getTrainPassword
,
bo
.
getTrainPassword
());
return
lqw
;
}
}
ruoyi-modules/ruoyi-server/src/main/resources/mapper/server/UserProfileMapper.xml
0 → 100644
浏览文件 @
60f70e04
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.dromara.server.mapper.UserProfileMapper"
>
</mapper>
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java
浏览文件 @
60f70e04
...
@@ -195,9 +195,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
...
@@ -195,9 +195,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
Boolean
registerUserInfo
(
RemoteUserBo
remoteUserBo
)
throws
UserException
,
ServiceException
{
public
Long
registerUserInfo
(
RemoteUserBo
remoteUserBo
)
throws
UserException
,
ServiceException
{
//密码为空使用初始化密码
//密码为空使用初始化密码
String
initPassword
=
SpringUtils
.
getBean
(
ISysConfigService
.
class
).
selectConfigByKey
(
"sys.user.initPassword"
);
String
initPassword
=
TenantHelper
.
dynamic
(
remoteUserBo
.
getTenantId
(),()->
SpringUtils
.
getBean
(
ISysConfigService
.
class
).
selectConfigByKey
(
"sys.user.initPassword"
)
);
String
password
=
StringUtils
.
isEmpty
(
remoteUserBo
.
getPassword
())
?
initPassword
:
remoteUserBo
.
getPassword
();
String
password
=
StringUtils
.
isEmpty
(
remoteUserBo
.
getPassword
())
?
initPassword
:
remoteUserBo
.
getPassword
();
remoteUserBo
.
setPassword
(
BCrypt
.
hashpw
(
password
));
remoteUserBo
.
setPassword
(
BCrypt
.
hashpw
(
password
));
...
@@ -213,7 +213,8 @@ public class RemoteUserServiceImpl implements RemoteUserService {
...
@@ -213,7 +213,8 @@ public class RemoteUserServiceImpl implements RemoteUserService {
if
(
exist
)
{
if
(
exist
)
{
throw
new
UserException
(
"user.register.save.error"
,
username
);
throw
new
UserException
(
"user.register.save.error"
,
username
);
}
}
return
userService
.
registerUser
(
sysUserBo
,
remoteUserBo
.
getTenantId
());
boolean
result
=
userService
.
registerUser
(
sysUserBo
,
remoteUserBo
.
getTenantId
());
return
sysUserBo
.
getUserId
();
}
}
@Override
@Override
...
...
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java
浏览文件 @
60f70e04
...
@@ -337,6 +337,7 @@ public class SysUserServiceImpl implements ISysUserService {
...
@@ -337,6 +337,7 @@ public class SysUserServiceImpl implements ISysUserService {
if
(
result
)
{
if
(
result
)
{
saveOrUpdateYsUser
(
sysUser
);
saveOrUpdateYsUser
(
sysUser
);
}
}
user
.
setUserId
(
sysUser
.
getUserId
());
return
result
;
return
result
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论