|
|
|
|
@@ -39,9 +39,10 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
@@ -83,6 +84,9 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
|
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements AccountService {
|
|
|
|
|
@Resource
|
|
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private AccountMapper accountMapper;
|
|
|
|
|
|
|
|
|
|
@@ -279,7 +283,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|
|
|
|
// 定义常量(临时)
|
|
|
|
|
private static final Integer SYSTEM_USER_TYPE_EDU_ADMIN = 7;
|
|
|
|
|
|
|
|
|
|
private void validateUserValidaExpire(Account account) {
|
|
|
|
|
public void validateUserValidaExpire(Account account) {
|
|
|
|
|
Long currentTime = new Date().getTime();
|
|
|
|
|
if (account.getSystemUser().equals(0)) {
|
|
|
|
|
return;
|
|
|
|
|
@@ -297,7 +301,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|
|
|
|
if (isEduAdmin) {
|
|
|
|
|
setEduAdminToExpire(account);
|
|
|
|
|
} else {
|
|
|
|
|
toVisitor(account);
|
|
|
|
|
// 这里调用代理的 toVisitor 方法
|
|
|
|
|
AccountService proxy = applicationContext.getBean(AccountService.class);
|
|
|
|
|
proxy.toVisitor(account);
|
|
|
|
|
// return;
|
|
|
|
|
throw new BusinessException("account.expired", ResultEnum.PROMPT.getCode());
|
|
|
|
|
}
|
|
|
|
|
@@ -1949,6 +1955,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|
|
|
|
return baseMapper.selectList(queryWrapper);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
|
|
|
|
public void toVisitor(Account account) {
|
|
|
|
|
accountMapper.toVisitor(account.getId());
|
|
|
|
|
}
|
|
|
|
|
|