Merge branch 'dev' of http://47.92.113.182:3000/zcloud_gbs/zcloud_gbs_basic_info_gwj into komen
commit
9bb96f109d
|
|
@ -90,6 +90,13 @@ public class CorpInfoController {
|
|||
}
|
||||
return SingleResponse.of(corpInfoService.info(id));
|
||||
}
|
||||
@ApiOperation("查询当前登录租户自身企业详情")
|
||||
@PostMapping("/info/self")
|
||||
public SingleResponse<CorpInfoCO> getSelfInfo() {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
Long tenantId = ssoUser.getTenantId();
|
||||
return SingleResponse.of(corpInfoService.info(tenantId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除")
|
||||
|
|
|
|||
|
|
@ -659,16 +659,9 @@ public class UserUpdateExe {
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updatePasswordFromApp(AppUserUpdatePassWordCmd cmd) {
|
||||
//新密码和旧密码不能相同
|
||||
if (cmd.getPassword().equals(cmd.getNewPassword())) {
|
||||
throw new BizException("新密码不能与旧密码相同");
|
||||
}
|
||||
UserE userE = new UserE();
|
||||
userE.checkPassword(cmd.getNewPassword(), cmd.getConfirmPassword());
|
||||
|
||||
BeanUtils.copyProperties(cmd, userE);
|
||||
userE.encryptionPassword();
|
||||
userGateway.updatePassword(userE);
|
||||
UserUpdatePassWordCmd userUpdatePassWordCmd = new UserUpdatePassWordCmd();
|
||||
BeanUtils.copyProperties(cmd, userUpdatePassWordCmd);
|
||||
executeUpdatePassword(userUpdatePassWordCmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -686,6 +679,10 @@ public class UserUpdateExe {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public Response executeUpdatePassword(UserUpdatePassWordCmd userUpdatePassWordCmd) {
|
||||
UserE userE = new UserE();
|
||||
if (userUpdatePassWordCmd.getPassword().equals(userUpdatePassWordCmd.getNewPassword())) {
|
||||
throw new BizException("新密码不能与旧密码相同");
|
||||
}
|
||||
userE.checkPassword(userUpdatePassWordCmd.getNewPassword(), userUpdatePassWordCmd.getConfirmPassword());
|
||||
BeanUtils.copyProperties(userUpdatePassWordCmd, userE);
|
||||
userE.encryptionPassword();
|
||||
return userGateway.updatePassword(userE);
|
||||
|
|
|
|||
|
|
@ -30,5 +30,8 @@ public class UserUpdatePassWordCmd extends Command {
|
|||
@ApiModelProperty(value = "新密码", name = "newPassword")
|
||||
@NotEmpty(message = "新密码不能为空")
|
||||
private String newPassword;
|
||||
@ApiModelProperty(value = "确认密码", name = "confirmPassword")
|
||||
@NotEmpty(message = "确认密码不能为空")
|
||||
private String confirmPassword;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -578,8 +578,9 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
@Override
|
||||
public Response updatePassword(UserDO userDO) {
|
||||
UserDO oldUserDO = getById(userDO.getId());
|
||||
// TODO 验证老密码是否正确
|
||||
if (userDO.getPassword() != null && !userDO.getPassword().equals("")) {
|
||||
if (userDO.getPassword() == null || userDO.getPassword().isEmpty()) {
|
||||
throw new BizException("原密码不能为空");
|
||||
}
|
||||
SingleResponse<UserDetailCO> detail = null;
|
||||
try {
|
||||
log.info("updateXgf,GBS获取用户信息{}", userDO.getId());
|
||||
|
|
@ -607,9 +608,6 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
throw new BizException("密码错误");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.info("updateXgf,密码为空,不进行密码验证");
|
||||
}
|
||||
|
||||
//修改多个密码
|
||||
String phone = oldUserDO.getPhone();
|
||||
|
|
|
|||
Loading…
Reference in New Issue