|
|
@@ -134,7 +134,12 @@ public class AccountServiceImpl implements AccountService {
|
|
|
|
|
|
@Override
|
|
|
public void bindCompany(Long accountId, Long companyId) {
|
|
|
- accountCompanyMapper.insert(accountId, companyId);
|
|
|
+ int count = accountCompanyMapper.hasUnBindData(accountId, companyId);
|
|
|
+ if (count > 0) {
|
|
|
+ updateBindCompanyStatus(accountId, companyId, "1");
|
|
|
+ }else {
|
|
|
+ accountCompanyMapper.insert(accountId, companyId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -368,12 +373,7 @@ public class AccountServiceImpl implements AccountService {
|
|
|
|
|
|
Account account = findByMobile(accountAddDTO.getMobile());
|
|
|
//绑定企业
|
|
|
- int count = accountCompanyMapper.hasUnBindData(account.getId(), companyId);
|
|
|
- if (count > 0) {
|
|
|
- updateBindCompanyStatus(account.getId(), companyId, "1");
|
|
|
- }else {
|
|
|
- bindCompany(account.getId(), companyId);
|
|
|
- }
|
|
|
+ bindCompany(account.getId(), companyId);
|
|
|
//绑定角色
|
|
|
bindRoles(account.getId(), accountAddDTO.getRoleIds());
|
|
|
//清除缓存
|