解决循环依赖问题
This commit is contained in:
@@ -95,11 +95,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
@Resource
|
||||
private AccountLoginLogService accountLoginLogService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private ConvenientInquiryService convenientInquiryService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private LibraryService libraryService;
|
||||
|
||||
@@ -118,10 +113,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
@Resource
|
||||
private QuestionnaireMapper questionnaireMapper;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private CreditsService creditsService;
|
||||
|
||||
@Resource
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
@@ -141,14 +132,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private StripeService stripeService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private AffiliateService affiliateService;
|
||||
|
||||
@Resource
|
||||
private UserFollowService userFollowService;
|
||||
|
||||
@@ -207,10 +190,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
return new AccountPreLoginVO(account.getId());
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private PortfolioService portfolioService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AccountLoginVO login(AccountLoginDTO accountLoginDTO, HttpServletRequest request) {
|
||||
@@ -1641,6 +1620,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
log.warn("当前用户 {} 在AiDA中没有账号", email);
|
||||
throw new BusinessException("user.has.no.account", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
CreditsService creditsService = SpringUtils.getBean(CreditsService.class);
|
||||
// 2、先判断当前用户是否已经填写过问卷
|
||||
CreditsDetail record = creditsService.getByAccountIdAndChangeEvent(account.getId(), "Fill out the questionnaire", "+100");
|
||||
if (!Objects.isNull(record)) {
|
||||
@@ -2059,7 +2039,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
String avatar = StringUtil.isNullOrEmpty(account.getAvatar()) ? CommonConstant.DEFAULT_AVATAR : account.getAvatar();
|
||||
personalHomepageVO.setAvatar(minioUtil.getPreSignedUrl(avatar, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
|
||||
personalHomepageVO.setPortfolioCount(portfolioService.getPortfolioCount(accountId));
|
||||
personalHomepageVO.setPortfolioCount(SpringUtils.getBean(PortfolioService.class).getPortfolioCount(accountId));
|
||||
personalHomepageVO.setFolloweeCount(userFollowService.getFolloweeCount(accountId));
|
||||
personalHomepageVO.setFollowerCount(userFollowService.getFollowerCount(accountId));
|
||||
personalHomepageVO.setHomepageViewCount(viewPersonalHomepageCount(0L));
|
||||
@@ -3142,7 +3122,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
response.setAccountExtendList(accountExtends);
|
||||
}
|
||||
response.setLanguage(Language.valueOf(account.getLanguage()).name());
|
||||
SubscriptionInfo subscriptionInfo = stripeService.getLatestSubscriptionInfoByAccountId(accountId);
|
||||
SubscriptionInfo subscriptionInfo = SpringUtils.getBean(StripeService.class).getLatestSubscriptionInfoByAccountId(accountId);
|
||||
if (!Objects.isNull(subscriptionInfo)) {
|
||||
response.setSubscriptionId(subscriptionInfo.getSubscriptionId());
|
||||
response.setSubscriptionType(subscriptionInfo.getType());
|
||||
@@ -3151,7 +3131,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
response.setAutoRenewal(subscriptionInfo.getStatus().equals("active"));
|
||||
}
|
||||
|
||||
Affiliate affiliate = affiliateService.getByAccountId(accountId);
|
||||
Affiliate affiliate = SpringUtils.getBean(AffiliateService.class).getByAccountId(accountId);
|
||||
if (!Objects.isNull(affiliate) && affiliate.getStatus().equals("Active")) {
|
||||
response.setAffiliate(true);
|
||||
}
|
||||
@@ -3371,6 +3351,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
accountMapper.updateById(account);
|
||||
|
||||
CreditsService creditsService = SpringUtils.getBean(CreditsService.class);
|
||||
// 先判断是否已添加添加积分变更记录
|
||||
CreditsDetail creditsDetail = creditsService.queryDetailByTaskId(orderNo);
|
||||
if (Objects.isNull(creditsDetail)) {
|
||||
@@ -3663,14 +3644,19 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
// todo 机构管理员再次订阅时,需要同步机构的激活状态
|
||||
private void setOrganizationStatus(Account adminAcc, boolean isActive) {
|
||||
Organization organization;
|
||||
ConvenientInquiryService convenientInquiryService = null;
|
||||
if (Objects.nonNull(adminAcc.getOrganizationId())) {
|
||||
organization = organizationMapper.selectById(adminAcc.getOrganizationId());
|
||||
} else if (!StringUtil.isNullOrEmpty(adminAcc.getOrganizationName())) {
|
||||
convenientInquiryService = SpringUtils.getBean(ConvenientInquiryService.class);
|
||||
organization = convenientInquiryService.checkOrganization(adminAcc.getSystemUser(), adminAcc.getOrganizationName());
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
if (Objects.isNull(organization)) {
|
||||
if (Objects.isNull(convenientInquiryService)) {
|
||||
convenientInquiryService = SpringUtils.getBean(ConvenientInquiryService.class);
|
||||
}
|
||||
organization = convenientInquiryService.addOrganization(adminAcc.getOrganizationName(), getOrganizationTypeByRole(adminAcc.getSystemUser()));
|
||||
}
|
||||
if (isActive) {
|
||||
|
||||
@@ -53,9 +53,6 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
||||
private PaymentInfoService paymentInfoService;
|
||||
@Resource
|
||||
private SubscriptionInfoMapper subscriptionInfoMapper;
|
||||
@Lazy
|
||||
@Resource
|
||||
private ReferralService referralService;
|
||||
@Resource
|
||||
private ReferralMapper referralMapper;
|
||||
@Resource
|
||||
@@ -297,7 +294,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
||||
referral.setCommissionPercent(affiliate.getCommissionPercent());
|
||||
referral.setStatus("Pending");
|
||||
referral.setCreateTime(LocalDateTime.now());
|
||||
int insert = referralService.getBaseMapper().insert(referral);
|
||||
int insert = referralMapper.insert(referral);
|
||||
log.info("向Referral中插入 {} 条数据", insert);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,8 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Lazy
|
||||
public class CloudTaskServiceImpl extends ServiceImpl<CloudTaskMapper, CloudTask> implements CloudTaskService {
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private CreditsService creditsService;
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
private GenerateMapper generateMapper;
|
||||
@Resource
|
||||
private ToProductImageResultMapper toProductImageResultMapper;
|
||||
@Lazy
|
||||
@Resource
|
||||
private DesignService designService;
|
||||
@Resource
|
||||
|
||||
@@ -40,7 +40,6 @@ public class CreditsServiceImpl extends ServiceImpl<CreditsDetailMapper, Credits
|
||||
@Value("${redis.key.credits.pre-deduction}")
|
||||
private String creditsDeduction;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private AccountService accountService;
|
||||
@Resource
|
||||
|
||||
@@ -7,13 +7,13 @@ import com.ai.da.common.response.ResultEnum;
|
||||
import com.ai.da.common.utils.DateUtil;
|
||||
import com.ai.da.common.utils.MailUtil;
|
||||
import com.ai.da.common.utils.RedisUtil;
|
||||
import com.ai.da.mapper.primary.AccountMapper;
|
||||
import com.ai.da.mapper.primary.EmailLogMapper;
|
||||
import com.ai.da.mapper.primary.EmailTemplateMapper;
|
||||
import com.ai.da.mapper.primary.entity.*;
|
||||
import com.ai.da.model.dto.AffiliateEmailParamsDTO;
|
||||
import com.ai.da.model.dto.BasicEmailParamDTO;
|
||||
import com.ai.da.model.dto.SubscriptionEmailParamsDTO;
|
||||
import com.ai.da.service.AccountService;
|
||||
import com.ai.da.service.EmailService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -46,9 +46,8 @@ public class EmailServiceImpl implements EmailService {
|
||||
private EmailTemplateMapper emailTemplateMapper;
|
||||
@Resource
|
||||
private EmailLogMapper emailLogMapper;
|
||||
@Lazy
|
||||
@Resource
|
||||
private AccountService accountService;
|
||||
private AccountMapper accountMapper;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
@@ -163,7 +162,7 @@ public class EmailServiceImpl implements EmailService {
|
||||
public void sendEmail(List<String> mailTo, JSONObject jsonObject, String templateName, String title, String fileName, InputStreamSource inputStreamSource) {
|
||||
if (mailTo.size() == 1){
|
||||
String receiver = mailTo.get(0);
|
||||
Account account = accountService.getBaseMapper().selectOne(new QueryWrapper<Account>().eq("user_email", receiver));
|
||||
Account account = accountMapper.selectOne(new QueryWrapper<Account>().eq("user_email", receiver));
|
||||
if (Objects.nonNull(account)){
|
||||
boolean b = redisUtil.allowSend(account.getId());
|
||||
if (!b){throw new BusinessException("email.count.limit", ResultEnum.PROMPT.getCode());}
|
||||
|
||||
@@ -89,7 +89,6 @@ import static com.ai.da.common.enums.WangXiangTaskStatusEnum.UNKNOWN_W;
|
||||
@RequiredArgsConstructor
|
||||
public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> implements GenerateService {
|
||||
|
||||
private final AccountService accountService;
|
||||
private final APIGenerateService apiGenerateService;
|
||||
private final CollectionElementMapper collectionElementMapper;
|
||||
private final CollectionElementService collectionElementService;
|
||||
@@ -828,7 +827,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
if (finishMessage != null && finishMessage.contains("Try rephrasing the prompt")) {
|
||||
finishMessage = "Try rephrasing the prompt or modifying the model image. If you think this was an error, send feedback.";
|
||||
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
||||
Account account = accountService.getOne(select);
|
||||
Account account = getAccountService().getOne(select);
|
||||
if ("CHINESE_SIMPLIFIED".equals(account.getLanguage())) {
|
||||
finishMessage = "请尝试重新表述提示词,或修改模特图。若您认为这是误判,可提交反馈。";
|
||||
}
|
||||
@@ -1096,7 +1095,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
if (finishMessage != null && finishMessage.contains("Try rephrasing the prompt")) {
|
||||
finishMessage = "Try rephrasing the prompt or replacing the image. If you think this was an error, send feedback.";
|
||||
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
||||
Account account = accountService.getOne(select);
|
||||
Account account = getAccountService().getOne(select);
|
||||
if ("CHINESE_SIMPLIFIED".equals(account.getLanguage())) {
|
||||
finishMessage = "请尝试重新表述提示词,或更换图片。若您认为这是误判,可提交反馈。";
|
||||
}
|
||||
@@ -1117,7 +1116,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
if (raiFilteredReason != null && raiFilteredReason.contains("Try rephrasing the prompt")) {
|
||||
raiFilteredReason = "Input data may contain inappropriate content.";
|
||||
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
||||
Account account = accountService.getOne(select);
|
||||
Account account = getAccountService().getOne(select);
|
||||
if ("CHINESE_SIMPLIFIED".equals(account.getLanguage())) {
|
||||
raiFilteredReason = "输入数据可能包含不当内容。";
|
||||
}
|
||||
@@ -1381,7 +1380,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
exceptionMessage = jsonObj.getStr("message");
|
||||
if ("Input data may contain inappropriate content.".equals(exceptionMessage)) {
|
||||
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
||||
Account account = accountService.getOne(select);
|
||||
Account account = getAccountService().getOne(select);
|
||||
if ("CHINESE_SIMPLIFIED".equals(account.getLanguage())) {
|
||||
exceptionMessage = "输入数据可能包含不当内容。";
|
||||
}
|
||||
@@ -1478,7 +1477,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
} catch (Exception e) {
|
||||
log.error("Doubao image generation failed for taskId: {}", taskId, e);
|
||||
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
||||
Account account = accountService.getOne(select);
|
||||
Account account = getAccountService().getOne(select);
|
||||
|
||||
// 根据用户语言设置默认错误信息
|
||||
String errorMessage = "图像生成失败,请稍后重试"; // 默认中文
|
||||
@@ -2204,7 +2203,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
}
|
||||
|
||||
public void doCreditsSubtract(Long accountId, CreditsEventsEnum event) {
|
||||
Account account = accountService.getById(accountId);
|
||||
Account account = getAccountService().getById(accountId);
|
||||
BigDecimal existingCredits = account.getCredits();
|
||||
BigDecimal subtract = existingCredits.subtract(new BigDecimal(event.getValue()));
|
||||
BigDecimal creditsUsage = null;
|
||||
@@ -2212,10 +2211,14 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
creditsUsage = Objects.isNull(account.getCreditsUsage()) ? BigDecimal.ZERO : account.getCreditsUsage();
|
||||
creditsUsage = creditsUsage.add(new BigDecimal(event.getValue()));
|
||||
}
|
||||
accountService.updateCreditsAndEndTime(account, subtract.toString(), null, creditsUsage);
|
||||
getAccountService().updateCreditsAndEndTime(account, subtract.toString(), null, creditsUsage);
|
||||
creditsService.preInsert(accountId, event.getName(), null, Boolean.FALSE, event.getValue());
|
||||
}
|
||||
|
||||
private AccountService getAccountService() {
|
||||
return SpringUtils.getBean(AccountService.class);
|
||||
}
|
||||
|
||||
// 注入线程池(可在配置类中定义)
|
||||
@Resource
|
||||
private Executor asyncTaskExecutor;
|
||||
|
||||
@@ -83,8 +83,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
private final PythonTAllInfoService pythonTAllInfoService;
|
||||
private final SysFileMapper sysFileMapper;
|
||||
private final SysFileExtraMapper sysFileExtraMapper;
|
||||
@Lazy
|
||||
private final WorkspaceService workspaceService;
|
||||
private final WorkspaceMapper workspaceMapper;
|
||||
|
||||
@Value("${minio.bucketName.users}")
|
||||
private String users;
|
||||
@@ -730,7 +729,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
}
|
||||
// TODO:isDeleted设置
|
||||
qw.lambda().eq(Workspace::getIsDeleted, 0L);
|
||||
List<Workspace> workspaceList = workspaceService.list(qw);
|
||||
List<Workspace> workspaceList = workspaceMapper.selectList(qw);
|
||||
if (CollectionUtil.isNotEmpty(workspaceList)) {
|
||||
if (deleteModelConfirm.equals(0)) {
|
||||
throw new BusinessException("the.model.has.been.referenced.by.the.workspace", ResultEnum.WARNING.getCode());
|
||||
@@ -744,8 +743,8 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
for (Workspace workspace : workspaceList) {
|
||||
workspace.setMannequinFemaleId(sysFemaleFiles.get(0).getId());
|
||||
workspace.setMannequinFemaleType(MannequinType.SYSTEM.getValue());
|
||||
workspaceMapper.updateById(workspace);
|
||||
}
|
||||
workspaceService.updateBatchById(workspaceList);
|
||||
}
|
||||
}
|
||||
if (value.equals(Sex.MALE.getValue())) {
|
||||
@@ -757,8 +756,8 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
for (Workspace workspace : workspaceList) {
|
||||
workspace.setMannequinMaleId(sysMaleFiles.get(0).getId());
|
||||
workspace.setMannequinMaleType(MannequinType.SYSTEM.getValue());
|
||||
workspaceMapper.updateById(workspace);
|
||||
}
|
||||
workspaceService.updateBatchById(workspaceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,6 @@ public class PayPalCheckoutServiceImpl implements PayPalCheckoutService {
|
||||
private PayPalClient payPalClient;
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private PaymentInfoService paymentInfoService;
|
||||
@Resource
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ai.da.service.impl;
|
||||
import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.PayTypeEnum;
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.common.utils.SpringUtils;
|
||||
import com.ai.da.mapper.primary.PaymentInfoMapper;
|
||||
import com.ai.da.mapper.primary.entity.OrderInfo;
|
||||
import com.ai.da.mapper.primary.entity.PaymentInfo;
|
||||
@@ -45,10 +46,6 @@ import java.util.Objects;
|
||||
@Slf4j
|
||||
public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, PaymentInfo> implements PaymentInfoService {
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private StripeService stripeService;
|
||||
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
@@ -230,6 +227,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PaymentInfo createOrUpdatePaymentInfoForStripe(Invoice invoice){
|
||||
Stripe.apiKey = privateKey;
|
||||
StripeService stripeService = SpringUtils.getBean(StripeService.class);
|
||||
// 获取transactionId,从sessionId更改为invoiceId
|
||||
String invoiceId = invoice.getId();
|
||||
|
||||
|
||||
@@ -60,13 +60,10 @@ public class StripeServiceImpl implements StripeService {
|
||||
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private PayPalCheckoutService payPalCheckoutService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private PaymentInfoService paymentInfoService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private CreditsService creditsService;
|
||||
@Resource
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.CreditsEventsEnum;
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.common.utils.RedisUtil;
|
||||
import com.ai.da.common.utils.SpringUtils;
|
||||
import com.ai.da.mapper.primary.TaskListMapper;
|
||||
import com.ai.da.mapper.primary.entity.TaskList;
|
||||
import com.ai.da.model.dto.QueryTaskHistoryDTO;
|
||||
@@ -48,9 +49,6 @@ public class SuperResolutionServiceImpl extends ServiceImpl<TaskListMapper, Task
|
||||
@Resource
|
||||
private PythonService pythonService;
|
||||
|
||||
@Resource
|
||||
private TaskListService taskListService;
|
||||
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@@ -114,7 +112,7 @@ public class SuperResolutionServiceImpl extends ServiceImpl<TaskListMapper, Task
|
||||
// 6、加入任务列表 设置状态为 等待中
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String name = superResolutionDTO.getImages();
|
||||
taskListService.addToTaskListRedis(new TaskDTO<>(uuid, "SR", name.substring(name.lastIndexOf("/") + 1), superResolutionDTO, "Waiting", LocalDateTime.now().format(dateTimeFormatter)));
|
||||
SpringUtils.getBean(TaskListService.class).addToTaskListRedis(new TaskDTO<>(uuid, "SR", name.substring(name.lastIndexOf("/") + 1), superResolutionDTO, "Waiting", LocalDateTime.now().format(dateTimeFormatter)));
|
||||
|
||||
// 7、将消息发布到MQ消息队列
|
||||
log.info("发送消息到SR_QUEUE,参数 :{}", jsonString);
|
||||
|
||||
@@ -42,7 +42,6 @@ public class TaskListServiceImpl extends ServiceImpl<TaskListMapper, TaskList> i
|
||||
@Resource
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private SuperResolutionService superResolutionService;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.ai.da.common.response.ResultEnum;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.common.utils.RequestInfoUtil;
|
||||
import com.ai.da.common.utils.SendEmailUtil;
|
||||
import com.ai.da.common.utils.SpringUtils;
|
||||
import com.ai.da.mapper.primary.AccountMapper;
|
||||
import com.ai.da.mapper.primary.TrialOrderMapper;
|
||||
import com.ai.da.mapper.primary.entity.Account;
|
||||
@@ -40,12 +41,8 @@ public class TrialOrderServiceImpl extends ServiceImpl<TrialOrderMapper, TrialOr
|
||||
|
||||
@Resource
|
||||
private AccountMapper accountMapper;
|
||||
@Lazy
|
||||
@Resource
|
||||
private LibraryService libraryService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private UserLikeGroupService userLikeGroupService;
|
||||
|
||||
@Override
|
||||
public Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request) {
|
||||
@@ -238,7 +235,7 @@ public class TrialOrderServiceImpl extends ServiceImpl<TrialOrderMapper, TrialOr
|
||||
throw new BusinessException("用户为正式用户");
|
||||
}
|
||||
libraryService.deleteTrialData(userInfo.getId());
|
||||
userLikeGroupService.deleteTrialData(userInfo.getId());
|
||||
SpringUtils.getBean(UserLikeGroupService.class).deleteTrialData(userInfo.getId());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, UserLikeGroup> implements UserLikeGroupService {
|
||||
private final UserLikeGroupMapper userLikeGroupMapper;
|
||||
private final AccountService accountService;
|
||||
private final AccountMapper accountMapper;
|
||||
private final CollectionService collectionService;
|
||||
private final UserLikeService userLikeService;
|
||||
private final WorkspaceService workspaceService;
|
||||
@@ -1963,7 +1963,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
.collect(Collectors.groupingBy(UserLikeVO::getUserLikeGroupId));
|
||||
}
|
||||
|
||||
Account account = accountService.getById(authPrincipalVo.getId());
|
||||
Account account = accountMapper.selectById(authPrincipalVo.getId());
|
||||
Map<Long, List<UserLikeVO>> finalGroupDetailMap = groupDetailMap;
|
||||
IPage<ProjectVO> convert = page.convert((Function<Project, ProjectVO>) project -> {
|
||||
if (project != null) {
|
||||
@@ -1991,7 +1991,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
userLikeGroupVO.setSketchCount(0);
|
||||
}
|
||||
if (userLikeGroupVO.getOriginal() == 0) {
|
||||
userLikeGroupVO.setOriginalAccountName(accountService.getById(userLikeGroupVO.getOriginalAccountId()).getUserName());
|
||||
userLikeGroupVO.setOriginalAccountName(accountMapper.selectById(userLikeGroupVO.getOriginalAccountId()).getUserName());
|
||||
Portfolio byId = portfolioMapper.getByIdAll(userLikeGroupVO.getOriginalPortfolioId());
|
||||
if (Objects.nonNull(byId)) {
|
||||
String portfolioName = byId.getPortfolioName();
|
||||
|
||||
Reference in New Issue
Block a user