BUGFIX: 添加已存在的账号为子账号,该账号有效期没有同步修改
This commit is contained in:
@@ -2492,8 +2492,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
if (Objects.nonNull(subAccount) && personAccRole.contains(subAccount.getSystemUser())) {
|
if (Objects.nonNull(subAccount) && personAccRole.contains(subAccount.getSystemUser())) {
|
||||||
log.info("将用户{} 加入组织{}", addSubAccountDTO.getUserEmail(), adminAcc.getOrganizationName());
|
log.info("将用户{} 加入组织{}", addSubAccountDTO.getUserEmail(), adminAcc.getOrganizationName());
|
||||||
subAccount.setUserName(addSubAccountDTO.getUserName());
|
subAccount.setUserName(addSubAccountDTO.getUserName());
|
||||||
if (!StringUtil.isNullOrEmpty(addSubAccountDTO.getUserPassword()))
|
if (!StringUtil.isNullOrEmpty(addSubAccountDTO.getUserPassword())){
|
||||||
subAccount.setUserPassword(addSubAccountDTO.getUserPassword());
|
subAccount.setUserPassword(addSubAccountDTO.getUserPassword());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断当前账号的有效期是否与管理员同步
|
||||||
|
if (subAccount.getValidEndTime() < adminAcc.getValidEndTime()){
|
||||||
|
subAccount.setValidEndTime(adminAcc.getValidEndTime());
|
||||||
|
}
|
||||||
|
|
||||||
subAccount.setSystemUser(subUserRole);
|
subAccount.setSystemUser(subUserRole);
|
||||||
subAccount.setOrganizationName(adminAcc.getOrganizationName());
|
subAccount.setOrganizationName(adminAcc.getOrganizationName());
|
||||||
subAccount.setParentId(adminAcc.getId());
|
subAccount.setParentId(adminAcc.getId());
|
||||||
@@ -2572,11 +2579,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
throw new BusinessException("Access denied. Insufficient permissions.");
|
throw new BusinessException("Access denied. Insufficient permissions.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断当前账号的有效期是否与管理员同步
|
|
||||||
if (exAccountInfo.getValidEndTime() < adminAcc.getValidEndTime()){
|
|
||||||
exAccountInfo.setValidEndTime(adminAcc.getValidEndTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验用户名是否同名
|
// 校验用户名是否同名
|
||||||
if (!StringUtil.isNullOrEmpty(addSubAccountDTO.getUserName())
|
if (!StringUtil.isNullOrEmpty(addSubAccountDTO.getUserName())
|
||||||
&& !exAccountInfo.getUserName().equals(addSubAccountDTO.getUserName())
|
&& !exAccountInfo.getUserName().equals(addSubAccountDTO.getUserName())
|
||||||
|
|||||||
Reference in New Issue
Block a user