|
@@ -629,26 +629,22 @@ public class SysUserController {
|
|
|
@PreAuthorize("@pms.hasPermission('sys_user_edit')")
|
|
|
public R<?> updateUser(@Valid @RequestBody UserDTO userDto) {
|
|
|
|
|
|
- // qcc调用企查查查询是否为主要人员
|
|
|
SysDept sysDept = sysDeptService.getById(userDto.getDeptId());
|
|
|
|
|
|
if (null != userDto.getUserId()) {
|
|
|
- // 姓名去除空格(包括字符之间的所有空格都会去除)
|
|
|
- userDto.setRealname(StrUtil.cleanBlank(userDto.getRealname()));
|
|
|
|
|
|
SysUser oldData = userService.getById(userDto.getUserId());
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- if (!userDto.getRealname().equals(oldData.getRealname())) {
|
|
|
- return R.failed("用户认证通过或正在认证,暂不能修改姓名");
|
|
|
+ if (StrUtil.isNotBlank(oldData.getRealname()) && StrUtil.isNotBlank(userDto.getRealname()) && !StrUtil.equals(oldData.getRealname(), userDto.getRealname())) {
|
|
|
+ return R.failed("用户不能修改姓名");
|
|
|
}
|
|
|
- if (!userDto.getIdCardNumber().equals(oldData.getIdCardNumber())) {
|
|
|
- return R.failed("用户认证通过或正在认证,暂不能修改身份证号");
|
|
|
+ if (StrUtil.isNotBlank(oldData.getIdCardNumber()) && StrUtil.isNotBlank(userDto.getIdCardNumber()) && !StrUtil.equals(oldData.getIdCardNumber(), userDto.getIdCardNumber())) {
|
|
|
+ return R.failed("用户不能修改身份证号");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (SecurityUtils.getRoles().contains(2) || SecurityUtils.getRoles().contains(1)) {
|
|
|
if (userDto.getRole().contains(2)) {
|
|
|
UserDTO userDTO = new UserDTO();
|