Commit 284b39c7 by 阳浪

用户系统服务优化

parent ffecd6d1
......@@ -562,6 +562,17 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setName(account.getName().trim().toLowerCase());
//5.插入账号信息
if (this.insert(account)) {
if(account.getOrgId()!=null){
RequestContext context = ContextHolder.get();
AuthzAccountRole accountRole = new AuthzAccountRole();
accountRole.setAccountId(accountId);
accountRole.setRoleId(account.getOrgId());
accountRole.setSiteId(context.getSiteId());
accountRole.setCreateById(context.getAccountId());
accountRole.setCreateByName(context.getAccountName());
accountRole.setCreateTime(new Date());
accountRoleMapper.insert(accountRole);
}
return accountId;
} else {
throw new BizException(ReturnCode.SAVE_FAIL.getCode(), ReturnCode.SAVE_FAIL.getMsg());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment