Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
041c640b
提交
041c640b
authored
11月 16, 2021
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(单位模块): 添加用户修改后 加入档案
添加用户修改后 加入档案
上级
7fe91103
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
42 行增加
和
10 行删除
+42
-10
billSignature.html
dev-union/src/main/resources/htmlTemplate/billSignature.html
+0
-0
UserController.java
...kj/dev/device/user/subject/controller/UserController.java
+6
-1
UserServiceImpl.java
...dev/device/user/subject/service/impl/UserServiceImpl.java
+36
-9
没有找到文件。
dev-union/src/main/resources/htmlTemplate/billSignature.html
浏览文件 @
041c640b
差异被折叠。
点击展开。
dev-user/src/main/java/com/tykj/dev/device/user/subject/controller/UserController.java
浏览文件 @
041c640b
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.user.subject.controller;
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.user.subject.controller;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.user.base.req.*
;
import
com.tykj.dev.device.user.base.req.*
;
import
com.tykj.dev.device.user.base.ret.UserUpdatePw
;
import
com.tykj.dev.device.user.base.ret.UserUpdatePw
;
import
com.tykj.dev.device.user.cache.UserCache
;
import
com.tykj.dev.device.user.config.MyFilter
;
import
com.tykj.dev.device.user.config.MyFilter
;
import
com.tykj.dev.device.user.config.MyUserDetailsServiceImpl
;
import
com.tykj.dev.device.user.config.MyUserDetailsServiceImpl
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
...
@@ -59,6 +60,9 @@ public class UserController {
...
@@ -59,6 +60,9 @@ public class UserController {
@Autowired
@Autowired
LogoutUtil
logout
;
LogoutUtil
logout
;
@Autowired
UserCache
userCache
;
@Autowired
@Autowired
MyWebSocket
myWebSocket
;
MyWebSocket
myWebSocket
;
// @PostMapping(value = "/login")
// @PostMapping(value = "/login")
...
@@ -112,7 +116,8 @@ public class UserController {
...
@@ -112,7 +116,8 @@ public class UserController {
@PostMapping
(
value
=
"/update"
)
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
value
=
"用户更新接口"
,
notes
=
"更新成功返回用户对象"
)
@ApiOperation
(
value
=
"用户更新接口"
,
notes
=
"更新成功返回用户对象"
)
public
ResponseEntity
updateUser
(
@RequestBody
User
user
)
{
public
ResponseEntity
updateUser
(
@RequestBody
User
user
)
{
return
ResponseEntity
.
ok
(
userService
.
update
(
user
));
return
ResponseEntity
.
ok
(
userService
.
update
(
user
));
}
}
@GetMapping
(
value
=
"/findAll"
)
@GetMapping
(
value
=
"/findAll"
)
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UserServiceImpl.java
浏览文件 @
041c640b
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.user.subject.dao.UserDao;
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.user.subject.dao.UserDao;
import
com.tykj.dev.device.user.subject.dao.UserRoleDao
;
import
com.tykj.dev.device.user.subject.dao.UserRoleDao
;
import
com.tykj.dev.device.user.subject.entity.*
;
import
com.tykj.dev.device.user.subject.entity.*
;
import
com.tykj.dev.device.user.subject.service.*
;
import
com.tykj.dev.device.user.subject.service.*
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.SpringUtils
;
import
com.tykj.dev.misc.utils.SpringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -163,18 +164,44 @@ public class UserServiceImpl implements UserService {
...
@@ -163,18 +164,44 @@ public class UserServiceImpl implements UserService {
return
userDao
.
findAll
();
return
userDao
.
findAll
();
}
}
@Autowired
UserUtils
userUtils
;
@Override
@Override
public
User
update
(
User
user
)
{
public
User
update
(
User
user
)
{
Optional
<
User
>
userOptional
=
userDao
.
findById
(
user
.
getUserId
());
User
oldUser
=
userCache
.
findById
(
user
.
getUserId
());
if
(
userOptional
.
isPresent
()){
if
(!
oldUser
.
getName
().
equals
(
user
.
getName
())){
User
user1
=
userOptional
.
get
();
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 名称:"
+
oldUser
.
getName
()+
"->"
+
user
.
getName
()));
user
.
setNoPassword
(
user1
.
getNoPassword
());
user
.
setShowOrder
(
user1
.
getShowOrder
());
}
user
.
setTrainStatus
(
user1
.
getTrainStatus
());
if
(!
oldUser
.
getMobile
().
equals
(
user
.
getMobile
())){
user
.
setIsDel
(
user1
.
getIsDel
());
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 手机号码:"
+
oldUser
.
getMobile
()+
"->"
+
user
.
getMobile
()));
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"没找到对应的用户id"
));
}
if
(!
oldUser
.
getSex
().
equals
(
user
.
getSex
())){
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 性别:"
+(
oldUser
.
getSex
()==
0
?
"男"
:
"女"
)+
"->"
+(
user
.
getSex
()==
0
?
"男"
:
"女"
)));
}
if
(!
oldUser
.
getPosition
().
equals
(
user
.
getPosition
())){
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 职位:"
+
(
oldUser
.
getPosition
()==
0
?
"领导"
:
"职员"
)+
"->"
+(
user
.
getPosition
()==
0
?
"领导"
:
"职员"
)));
}
if
(!
oldUser
.
getEmail
().
equals
(
user
.
getEmail
())){
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 邮箱:"
+
oldUser
.
getEmail
()+
"->"
+
user
.
getEmail
()));
}
if
(!
oldUser
.
getIdCard
().
equals
(
user
.
getIdCard
())){
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 身份证:"
+
oldUser
.
getIdCard
()+
"->"
+
user
.
getIdCard
()));
}
if
(!
oldUser
.
getTelphone
().
equals
(
user
.
getTelphone
())){
userLogService
.
save
(
new
UserLog
(
userUtils
.
getCurrentUserId
(),
new
Date
(),
"修改信息 固定电话:"
+
oldUser
.
getTelphone
()+
"->"
+
user
.
getTelphone
()));
}
}
user
.
setNoPassword
(
oldUser
.
getNoPassword
());
user
.
setShowOrder
(
oldUser
.
getShowOrder
());
user
.
setTrainStatus
(
oldUser
.
getTrainStatus
());
user
.
setIsDel
(
oldUser
.
getIsDel
());
User
user1
=
userDao
.
save
(
user
);
User
user1
=
userDao
.
save
(
user
);
userCache
.
refresh
(
userDao
.
findAll
());
userCache
.
refresh
(
userDao
.
findAll
());
return
user1
;
return
user1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论