bug fixed 所属部门
This commit is contained in:
@ -170,6 +170,16 @@ public class StaffArchivesController {
|
||||
return "result";
|
||||
}
|
||||
|
||||
// 更新用户的所属部门
|
||||
String pid = request.getParameter("pid");
|
||||
if(StringUtils.isNotBlank(pid)){
|
||||
User user = this.userService.getUserById(safetyStaffArchives.getUserid());
|
||||
if(user != null){
|
||||
user.setPid(pid);
|
||||
this.userService.updateUserById(user);
|
||||
}
|
||||
}
|
||||
|
||||
this.staffArchivesService.save(safetyStaffArchives);
|
||||
model.addAttribute("result", CommUtil.toJson(Result.success()));
|
||||
return "result";
|
||||
@ -195,6 +205,16 @@ public class StaffArchivesController {
|
||||
return "result";
|
||||
}
|
||||
|
||||
// 更新用户的所属部门
|
||||
String pid = request.getParameter("pid");
|
||||
if(StringUtils.isNotBlank(pid)){
|
||||
User user = this.userService.getUserById(safetyStaffArchives.getUserid());
|
||||
if(user != null){
|
||||
user.setPid(pid);
|
||||
this.userService.updateUserById(user);
|
||||
}
|
||||
}
|
||||
|
||||
int result = this.staffArchivesService.update(safetyStaffArchives);
|
||||
model.addAttribute("result", CommUtil.toJson(Result.success()));
|
||||
return "result";
|
||||
|
||||
@ -22,6 +22,10 @@ public class SafetyStaffArchivesVo extends SafetyStaffArchives {
|
||||
* 性别翻译
|
||||
*/
|
||||
private String sexText;
|
||||
/**
|
||||
* 所属部门ID
|
||||
*/
|
||||
private String pid;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<result column="caption" property="caption" jdbcType="VARCHAR"/>
|
||||
<result column="sex" property="sex" jdbcType="VARCHAR"/>
|
||||
<result column="sexText" property="sexText" jdbcType="VARCHAR"/>
|
||||
<result column="pid" property="pid" jdbcType="VARCHAR"/>
|
||||
<result column="deptName" property="deptName" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
@ -164,6 +165,7 @@
|
||||
u.caption,
|
||||
u.sex,
|
||||
(case when u.sex='0' then '女' else '男' end) as sexText,
|
||||
u.pid,
|
||||
uu.name as deptName
|
||||
from tb_safety_staff_archives ssa
|
||||
INNER JOIN tb_user u ON ssa.userid = u.id
|
||||
@ -178,6 +180,7 @@
|
||||
u.caption,
|
||||
u.sex,
|
||||
(case when u.sex='0' then '女' else '男' end) as sexText,
|
||||
u.pid,
|
||||
uu.name as deptName
|
||||
from tb_safety_staff_archives ssa
|
||||
INNER JOIN tb_user u ON ssa.userid = u.id
|
||||
|
||||
Reference in New Issue
Block a user