Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
103aed85
Commit
103aed85
authored
Nov 14, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改刷新用户树
parent
a54847d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
portal-manager/src/main/java/com/mortals/xhx/module/user/web/UserController.java
.../java/com/mortals/xhx/module/user/web/UserController.java
+21
-12
No files found.
portal-manager/src/main/java/com/mortals/xhx/module/user/web/UserController.java
View file @
103aed85
...
...
@@ -11,6 +11,7 @@ import com.mortals.framework.service.ICacheService;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.common.utils.LoginAESUtil
;
import
com.mortals.xhx.feign.area.IApiAreaFeign
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
com.mortals.xhx.module.role.model.RoleEntity
;
import
com.mortals.xhx.module.role.model.RoleQuery
;
...
...
@@ -23,6 +24,7 @@ import com.mortals.xhx.module.user.model.UserEntityExt;
import
com.mortals.xhx.module.user.model.UserQuery
;
import
com.mortals.xhx.module.user.service.UserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -51,9 +53,12 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
private
RoleService
roleService
;
@Autowired
private
ICacheService
cacheService
;
@Autowired
@Lazy
private
IApiAreaFeign
apiAreaFeign
;
private
static
final
String
AES_KEY
=
"0000000671595991"
;
private
static
final
String
AES_IV
=
"tdrdadq59tbss5n7"
;
private
static
final
String
AES_IV
=
"tdrdadq59tbss5n7"
;
public
UserController
()
{
super
.
setModuleDesc
(
"用户信息业务"
);
...
...
@@ -83,9 +88,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
@Override
protected
void
saveBefore
(
UserEntity
entity
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
String
loginName
=
LoginAESUtil
.
decrypt
(
entity
.
getLoginName
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
loginName
=
LoginAESUtil
.
decrypt
(
entity
.
getLoginName
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
entity
.
setLoginName
(
loginName
);
if
(
StringUtils
.
isNotEmpty
(
entity
.
getLoginPwd
()))
{
if
(
StringUtils
.
isNotEmpty
(
entity
.
getLoginPwd
()))
{
String
loginPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getLoginPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
entity
.
setLoginPwd
(
loginPwd
);
}
...
...
@@ -157,8 +162,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
JSONObject
ret
=
new
JSONObject
();
try
{
String
busiDesc
=
this
.
getModuleDesc
()
+
"密码修改"
;
String
oldPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getOldPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
newPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getNewPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
oldPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getOldPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
newPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getNewPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
entity
.
setOldPwd
(
oldPwd
);
entity
.
setNewPwd
(
newPwd
);
service
.
updateUserPwd
(
super
.
getCurUser
().
getLoginName
(),
entity
.
getOldPwd
(),
entity
.
getNewPwd
());
...
...
@@ -177,8 +182,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
public
String
forgotPassword
(
@RequestBody
UserEntity
entity
)
{
JSONObject
ret
=
new
JSONObject
();
try
{
String
oldPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getOldPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
newPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getNewPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
oldPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getOldPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
newPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getNewPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
entity
.
setOldPwd
(
oldPwd
);
entity
.
setNewPwd
(
newPwd
);
service
.
updateUserPwd
(
entity
.
getLoginName
(),
entity
.
getOldPwd
(),
entity
.
getNewPwd
());
...
...
@@ -263,7 +268,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
=
VALUE_RESULT_SUCCESS
;
int
code
=
VALUE_RESULT_SUCCESS
;
try
{
PageInfo
pageInfo
=
this
.
buildPageInfo
(
query
);
Result
<
UserEntity
>
result
=
this
.
getService
().
find
(
query
,
pageInfo
,
context
);
...
...
@@ -274,7 +279,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
}
}
ret
.
setCode
(
code
);
ret
.
setData
(
model
);
...
...
@@ -287,11 +292,11 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
JSONObject
ret
=
new
JSONObject
();
try
{
String
busiDesc
=
this
.
getModuleDesc
()
+
"密码重置"
;
String
newPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getNewPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
newPwd
=
LoginAESUtil
.
decrypt
(
entity
.
getNewPwd
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
entity
.
setNewPwd
(
newPwd
);
String
loginName
=
LoginAESUtil
.
decrypt
(
entity
.
getLoginName
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
String
loginName
=
LoginAESUtil
.
decrypt
(
entity
.
getLoginName
(),
AES_KEY
,
AES_IV
,
LoginAESUtil
.
AES_CBC
);
entity
.
setLoginName
(
loginName
);
service
.
resetUserPwd
(
entity
.
getLoginName
(),
entity
.
getNewPwd
(),
this
.
getContext
());
service
.
resetUserPwd
(
entity
.
getLoginName
(),
entity
.
getNewPwd
(),
this
.
getContext
());
recordSysLog
(
request
,
busiDesc
+
"【成功】"
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_MSG
,
"密码修改成功!"
);
...
...
@@ -328,6 +333,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
/**
* 初始化用户数据
*
* @return
*/
@PostMapping
(
value
=
"initData"
)
...
...
@@ -342,6 +348,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
userEntity
.
setAreaCodes
(
user
.
getAreaCodes
());
this
.
service
.
getDao
().
update
(
userEntity
);
}
//通知基础服务更新
apiAreaFeign
.
refreshUser
();
return
Rest
.
ok
(
"初始化用户数据成功!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"初始化用户数据错误"
,
e
);
...
...
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