bug
parent
08d42de602
commit
469994fa9d
|
|
@ -18,8 +18,10 @@ import org.qinan.safetyeval.domain.service.AccountDomainService;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
import org.qinan.safetyeval.infrastructure.dataobject.AccountDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.AccountMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.OrgInfoMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.OrgInfoMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.remote.SmsRemote;
|
import org.qinan.safetyeval.infrastructure.remote.SmsRemote;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
@ -27,6 +29,8 @@ import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户执行器(App层)
|
* 用户执行器(App层)
|
||||||
*
|
*
|
||||||
|
|
@ -51,6 +55,8 @@ public class AccountExecutor implements AccountApi {
|
||||||
private OrgInfoMapper orgInfoMapper;
|
private OrgInfoMapper orgInfoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AccountMapper accountMapper;
|
private AccountMapper accountMapper;
|
||||||
|
@Autowired
|
||||||
|
private OrgPersonnelMapper orgPersonnelMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
@ -162,10 +168,16 @@ public class AccountExecutor implements AccountApi {
|
||||||
log.info("同步用户信息:{}", AuthUserContextAdapter.getCurrentUser());
|
log.info("同步用户信息:{}", AuthUserContextAdapter.getCurrentUser());
|
||||||
System.err.println(AuthUserContextAdapter.getCurrentUser());
|
System.err.println(AuthUserContextAdapter.getCurrentUser());
|
||||||
AccountEntity accountEntity = accountDomainService.get(AuthUserContextAdapter.getCurrentUserId());
|
AccountEntity accountEntity = accountDomainService.get(AuthUserContextAdapter.getCurrentUserId());
|
||||||
if (accountEntity == null || accountEntity.getType() == null) {
|
OrgPersonnelDO orgPersonnelDO = orgPersonnelMapper.selectById(AuthUserContextAdapter.getCurrentUserId());
|
||||||
|
int type;
|
||||||
|
if (Objects.nonNull(accountEntity) && accountEntity.getType() != null) {
|
||||||
|
type = accountEntity.getType();
|
||||||
|
} else if (Objects.nonNull(orgPersonnelDO)) {
|
||||||
|
type = 1;
|
||||||
|
} else {
|
||||||
throw new BizException(ErrorCode.ACCOUNT_NOT_FOUND);
|
throw new BizException(ErrorCode.ACCOUNT_NOT_FOUND);
|
||||||
}
|
}
|
||||||
return SingleResponse.success(accountEntity.getType());
|
return SingleResponse.success(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AccountCO toCO(AccountEntity entity) {
|
private AccountCO toCO(AccountEntity entity) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue