提交 a700654c 作者: zhenjie

删除用户添加事务

上级 21d39ed4
......@@ -145,6 +145,7 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
return ResultBody.success();
}
@Transactional
@Override
public ResultBody disableBAccount(Integer accountId, LoginSuccessDTO loginSuccessDTO) {
CompanyInfoVO companyInfoVO = companyService.getCompanyInfoByBackUserAccountId(accountId);
......
......@@ -33,6 +33,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import java.util.List;
......@@ -376,9 +377,9 @@ public class UserAccountServiceImpl implements UserAccountService {
@Autowired
private CompanyDao companyDao;
@Transactional
@Override
public ResultBody disableAppAccount(Integer userAccountId) {
userServiceDao.disableUserAccount(CodeUtil.removeUserAccount(), userAccountId);
UserAccountVO userAccountVO = new UserAccountVO();
userAccountVO.setId(userAccountId);
userAccountVO.setDeleted(1);
......@@ -389,10 +390,12 @@ public class UserAccountServiceImpl implements UserAccountService {
if (companyInfoDO != null) {
int members = companyDao.countCompanyMembers(companyInfoDO.getId());
if (members > 1 && companyInfoDO.getLeader().equals(1)) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultBody.error("该用户是单位管理员,暂时不能删除");
}
companyDao.unbindCompanyMember(userAccountId, companyInfoDO.getId());
}
userServiceDao.disableUserAccount(CodeUtil.removeUserAccount(), userAccountId);
mqProducer.sentUserInfoChangedMsg(userAccountVO);
return ResultBody.success();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论