|
|
@@ -6,6 +6,11 @@ import java.util.stream.Collectors;
|
|
|
import javax.validation.Validator;
|
|
|
|
|
|
import com.ruoyi.common.enums.UserRolesType;
|
|
|
+import com.ruoyi.project.domain.ProjectStaff;
|
|
|
+import com.ruoyi.project.domain.ProjectTask;
|
|
|
+import com.ruoyi.project.mapper.ProjectStaffMapper;
|
|
|
+import com.ruoyi.project.mapper.ProjectStaffRecordMapper;
|
|
|
+import com.ruoyi.project.mapper.ProjectTaskMapper;
|
|
|
import com.ruoyi.system.mapper.*;
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
import com.ruoyi.weChat.service.WeChatService;
|
|
|
@@ -64,6 +69,13 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
private WeChatService weChatService;
|
|
|
@Autowired
|
|
|
protected Validator validator;
|
|
|
+ @Autowired
|
|
|
+ private ProjectStaffMapper projectStaffMapper;
|
|
|
+ @Autowired
|
|
|
+ private ProjectStaffRecordMapper projectStaffRecordMapper;
|
|
|
+ @Autowired
|
|
|
+ private ProjectTaskMapper projectTaskMapper;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 根据条件分页查询用户列表
|
|
|
@@ -302,9 +314,24 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
userPostMapper.deleteUserPostByUserId(userId);
|
|
|
// 新增用户与岗位管理
|
|
|
insertUserPost(user);
|
|
|
+ //修改关联名称
|
|
|
+ updateUserName(user);
|
|
|
return userMapper.updateUser(user);
|
|
|
}
|
|
|
|
|
|
+ private void updateUserName(SysUser user) {
|
|
|
+ SysUser sysUser = userMapper.selectUserById(user.getUserId());
|
|
|
+ if (!sysUser.getNickName().equals(user.getUserName())){
|
|
|
+ //修改所有名字
|
|
|
+ projectStaffMapper.updateNameByAid(user);
|
|
|
+ projectStaffRecordMapper.updateNameByAid(user);
|
|
|
+ List<ProjectStaff> projectStaffs = projectStaffMapper.selectByAid(user.getUserId());
|
|
|
+ for (ProjectStaff projectStaff : projectStaffs) {
|
|
|
+ projectTaskMapper.updateStaffName(projectStaff.getPid());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 用户授权角色
|
|
|
*
|