|
@@ -189,6 +189,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
return R.ok(copy(UserInfoDto.Vo.class, saveInfo));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
@ApiOperation("修改")
|
|
|
@Lock(value = "update.userId", prefix = "user_update_")
|
|
@@ -216,6 +217,30 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
UserInfo updateInfo = copy(UserInfo.class, update)
|
|
|
.updateUserTime(AuthorizeUtils.getLoginId(Long.class));
|
|
|
UserInfo u = getById(update.getUserId());
|
|
|
+ // 验证权限表用戶信息是否存在
|
|
|
+
|
|
|
+ List<SysWorkVo> sysWorkVos = R.feignCheckData(sysWorkUserService.list(new ListDto().setId(CollUtil.newArrayList(u.getAuthorizeUserId()))));
|
|
|
+ if (CollUtil.isEmpty(sysWorkVos)) {
|
|
|
+ throw new CommRuntimeException("用户信息不存在!");
|
|
|
+ }
|
|
|
+ SysWorkVo sysWorkVo = sysWorkVos.get(0);
|
|
|
+ if (StrUtil.isNotEmpty(update.getTel())) {
|
|
|
+ if (!update.getTel().equals(sysWorkVo.getPhone())) {
|
|
|
+ long count = count(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getTel, update.getTel()));
|
|
|
+ if (count > 0) {
|
|
|
+ throw new CommRuntimeException("手机已存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotEmpty(update.getMail())) {
|
|
|
+ if (!byId.getMail().equals(sysWorkVo.getEmail())) {
|
|
|
+ long count = count(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getMail, update.getMail()));
|
|
|
+ if (count > 0) {
|
|
|
+ throw new CommRuntimeException("邮箱已存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 修改权限用户
|
|
|
if (StrUtil.isNotEmpty(account) || update.getStatus() != null || update.getRoleIds() != null || update.getDeptIds() != null || Emptys.check(update.getRoleIds()) || Emptys.check(update.getTel()) || Emptys.check(update.getMail()) || Emptys.check(update.getStatus()) || Emptys.check(update.getPassword())) {
|
|
|
UpdateDto updateDto = new UpdateDto()
|
|
@@ -229,7 +254,10 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
.setRoleIds(update.getRoleIds());
|
|
|
|
|
|
log.info("权限用户信息修改:{}", JSONUtil.toJsonPrettyStr(updateDto));
|
|
|
- sysWorkUserService.update(updateDto);
|
|
|
+ String s = R.feignCheckData(R.feignCheck(sysWorkUserService.update(updateDto)));
|
|
|
+ if (StrUtil.isNotEmpty(s)) {
|
|
|
+ throw new CommRuntimeException(s);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
// 修改用户
|