Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
df027daf
Commit
df027daf
authored
Dec 07, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
9434f9e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
2 deletions
+79
-2
TSocialfundHouseResMapper.xml
...z/src/main/resources/mapper/TSocialfundHouseResMapper.xml
+2
-2
UserPasswordVo.java
.../yifu.cloud.plus.v1/yifu/admin/api/vo/UserPasswordVo.java
+41
-0
UserController.java
...u/cloud/plus/v1/yifu/admin/controller/UserController.java
+11
-0
SysUserService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
+10
-0
SysUserServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
+15
-0
No files found.
yifu-social/yifu-social-biz/src/main/resources/mapper/TSocialfundHouseResMapper.xml
View file @
df027daf
...
...
@@ -116,10 +116,10 @@
<delete
id=
"deleteByUserIdAndHuName"
>
delete from t_socialfund_house_res where USER_ID = #{tSocialfundHouseRes.userId} and AUTH_TYPE = #{tSocialfundHouseRes.authType}
<if
test=
"tSocialfundHouseRes.socialHousehold != null and tSocialfundHouseRes.socialHousehold.trim() != ''"
>
AND
a.
SOCIAL_HOUSEHOLD = #{tSocialfundHouseRes.socialHousehold}
AND SOCIAL_HOUSEHOLD = #{tSocialfundHouseRes.socialHousehold}
</if>
<if
test=
"tSocialfundHouseRes.fundHousehold != null and tSocialfundHouseRes.fundHousehold.trim() != ''"
>
AND
a.
FUND_HOUSEHOLD = #{tSocialfundHouseRes.fundHousehold}
AND FUND_HOUSEHOLD = #{tSocialfundHouseRes.fundHousehold}
</if>
<if
test=
"tSocialfundHouseRes.socialHousehold == null and tSocialfundHouseRes.fundHousehold == null"
>
AND 1=2
...
...
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/UserPasswordVo.java
0 → 100644
View file @
df027daf
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
/**
* @author hgw
* @date 2022-12-7 10:46:38
*/
@Data
public
class
UserPasswordVo
{
@Schema
(
description
=
"用户id"
)
private
String
userId
;
@Schema
(
description
=
"用户登录名"
)
private
String
userName
;
@Schema
(
description
=
"原密码"
)
private
String
oldPassword
;
@Schema
(
description
=
"新密码"
)
private
String
newPassword
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserController.java
View file @
df027daf
...
...
@@ -173,6 +173,17 @@ public class UserController {
return
R
.
ok
(
userService
.
updateUser
(
userDto
));
}
/**
* 修改密码
* @param vo 用户信息
* @return R
*/
@SysLog
(
"修改密码"
)
@PostMapping
(
"/updatePassword"
)
public
R
<
String
>
updatePassword
(
@RequestBody
UserPasswordVo
vo
)
{
return
userService
.
updatePassword
(
vo
);
}
/**
* 分页查询用户
* @param page 参数集
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
View file @
df027daf
...
...
@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPasswordVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -73,6 +74,15 @@ public interface SysUserService extends IService<SysUser> {
*/
Boolean
updateUser
(
UserDTO
userDto
);
/**
* @param vo
* @Description: 修改密码
* @Author: hgw
* @Date: 2022/12/7 10:48
* @return: java.lang.Boolean
**/
R
<
String
>
updatePassword
(
UserPasswordVo
vo
);
/**
* 通过ID查询用户信息
* @param id 用户ID
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
View file @
df027daf
...
...
@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.util.ParamResolver
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPasswordVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysMenuService
;
...
...
@@ -242,6 +243,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return
Boolean
.
TRUE
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@CacheEvict
(
value
=
CacheConstants
.
USER_DETAILS
,
key
=
"#vo.userName"
)
public
R
<
String
>
updatePassword
(
UserPasswordVo
vo
)
{
SysUser
sysUser
=
this
.
getOne
(
Wrappers
.<
SysUser
>
query
().
lambda
().
eq
(
SysUser:
:
getUserId
,
vo
.
getUserId
()));
if
(
ENCODER
.
encode
(
vo
.
getOldPassword
()).
equals
(
sysUser
.
getPassword
()))
{
sysUser
.
setPassword
(
ENCODER
.
encode
(
vo
.
getNewPassword
()));
}
else
{
return
R
.
failed
(
"原密码错误"
);
}
this
.
updateById
(
sysUser
);
return
R
.
ok
();
}
/**
* 查询上级部门的用户信息
* @param username 用户名
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment