23 Commits

Author SHA1 Message Date
01e82b4c23 Merge branch 'dev/3.1_release_merge' into dev/dev_xp 2025-12-01 17:11:03 +08:00
litianxiang
e085275aee Merge branch 'dev-ltx' into dev/3.1_release_merge
# Conflicts:
#	src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java
2025-12-01 17:10:35 +08:00
litianxiang
fa7271567e 解决循环依赖问题 2025-12-01 17:05:57 +08:00
05049ae7a2 [run build] 2025-12-01 16:39:26 +08:00
00c0a65547 删除 .gitea/workflows/prod_build_schedule.yaml 2025-12-01 10:22:09 +08:00
77aab576de 删除 .gitea/workflows/develop_build_manual.yaml 2025-12-01 10:22:06 +08:00
5b2c77f81b 删除 .gitea/workflows/develop_build_commit.yaml 2025-12-01 10:22:02 +08:00
96040f2349 删除 docker-compose.yml
All checks were successful
git commit 控制 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Has been skipped
2025-11-30 11:01:40 +08:00
62bf538d96 Merge branch 'dev/dev_xp' into dev/3.1_release_merge
All checks were successful
git commit 控制 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Has been skipped
2025-11-28 16:38:09 +08:00
456cb1ff19 Merge remote-tracking branch 'origin/dev/3.1_release_merge' into dev/3.1_release_merge 2025-11-28 16:37:56 +08:00
d622195f9d 更新 .gitea/workflows/develop_build_commit.yaml
All checks were successful
git commit 控制 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Has been skipped
2025-11-28 16:06:56 +08:00
1917fd518d 更新 docker-compose.yml
All checks were successful
手动 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Successful in 2m3s
[run build]
2025-11-28 15:35:50 +08:00
8f72686809 添加 .gitea/workflows/prod_build_schedule.yaml
All checks were successful
手动 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Has been skipped
2025-11-28 15:18:20 +08:00
37ddf6f441 更新 .gitea/workflows/develop_build.yaml
All checks were successful
手动 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Has been skipped
2025-11-28 15:14:57 +08:00
dbf9b2d722 添加 .gitea/workflows/develop_build.yaml
Some checks failed
手动 AiDA back-java Develop 分支构建部署 / build_and_deploy (push) Has been cancelled
2025-11-28 15:13:48 +08:00
a91f9ccdd4 更新 .gitea/workflows/develop_build_manual.yaml 2025-11-28 15:09:33 +08:00
dac51afe73 添加 docker-compose.yml 2025-11-28 15:04:01 +08:00
3aa744895f 添加 .gitea/workflows/develop_build_manual.yaml 2025-11-28 14:55:50 +08:00
9535d8ce59 Merge branch 'dev/dev_xp' into dev/3.1_release_merge 2025-11-28 14:40:38 +08:00
e366d5a2c5 Merge branch 'dev/dev_xp' into dev/3.1_release_merge 2025-11-28 13:41:35 +08:00
litianxiang
b58b8df88f Merge remote-tracking branch 'origin/dev/3.1_release_merge' into dev/3.1_release_merge 2025-11-26 16:14:09 +08:00
litianxiang
c09f734a30 fix:兼容老数据detail会创建新数据的问题 2025-11-26 16:13:39 +08:00
1464689657 TASK:视频生成完成站内信语言给中英双语 2025-11-26 10:09:59 +08:00
20 changed files with 75 additions and 104 deletions

View File

@@ -1,7 +0,0 @@
FROM openjdk:8
VOLUME /tmp
#时区设置
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
ADD ./target/aida-0.0.1-SNAPSHOT.jar /app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

View File

@@ -132,7 +132,6 @@ public class MyTaskScheduler {
@Resource
private CollectionSortMapper collectionSortMapper;
@Lazy
@Resource
private DesignService designService;
@@ -151,7 +150,6 @@ public class MyTaskScheduler {
private ProjectMapper projectMapper;
@Resource
private WorkspaceMapper workspaceMapper;
@Lazy
@Resource
private WorkspaceService workspaceService;
@Resource

View File

@@ -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));
@@ -3149,7 +3129,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());
@@ -3158,7 +3138,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);
}
@@ -3378,6 +3358,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)) {
@@ -3670,14 +3651,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) {

View File

@@ -54,9 +54,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
@@ -339,7 +336,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);
}
}

View File

@@ -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;

View File

@@ -60,7 +60,7 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementMapper, CollectionElement> implements CollectionElementService {
private final CollectionElementMapper collectionElementMapper;
private final EmailService emailService;
// private final EmailService emailService;
private final FileProperties fileProperties;
private final GenerateMapper generateMapper;
private final GenerateDetailMapper generateDetailMapper;

View File

@@ -61,7 +61,6 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
private GenerateMapper generateMapper;
@Resource
private ToProductImageResultMapper toProductImageResultMapper;
@Lazy
@Resource
private DesignService designService;
@Resource

View File

@@ -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

View File

@@ -289,7 +289,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
response.setDesignItemUrl(url);
//更新item
updateById(designItem);
// 查询现有的记录,用于 saveOrUpdate
List<DesignItemDetail> existingDetails = designItemDetailService.selectByDesignItemId(designItemId);
// 创建 Map以 priority 为 key方便快速查找
@@ -305,7 +305,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
return;
}
Integer priority = SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType()) ? 0 : detail.getPriority();
DesignItemDetail designItemDetail = reuseDesignItemDetail(priority, detail.getType(),
existingDetailMap, detailBuckets, reusedDetailIds);
if (Objects.nonNull(designItemDetail)) {
@@ -314,7 +314,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetail = new DesignItemDetail();
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
}
// 设置/更新字段
designItemDetail.setAccountId(userInfo.getId());
designItemDetail.setDesignId(designId);
@@ -338,7 +338,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetail.setPrintJson(JSON.toJSONString(printObject));
designItemDetails.add(designItemDetail);
});
// 逻辑删除未复用的旧记录
existingDetails.stream()
.filter(existingDetail -> Objects.nonNull(existingDetail.getId()) && !reusedDetailIds.contains(existingDetail.getId()))
@@ -349,7 +349,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
updateWrapper.set("update_date", DateUtil.getByTimeZone(timeZone));
designItemDetailService.update(null, updateWrapper);
});
designItemDetailService.saveOrUpdateBatch(designItemDetails);
//封装item信息
List<DesignCollectionItemVO> designCollectionItems = CopyUtil.copyList(getByDesignId(designId)
@@ -379,7 +379,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
// 1、更新designItem
// updateById(designItem);
updateDesignItem(designItem);
// 2、查询现有的记录用于 saveOrUpdate
List<DesignItemDetail> existingDetails = designItemDetailService.selectByDesignItemId(designItemId);
// 创建 Map以 priority 为 key方便快速查找
@@ -388,7 +388,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
.collect(Collectors.toMap(DesignItemDetail::getPriority, detail -> detail, (old, newVal) -> old));
Map<String, Deque<DesignItemDetail>> detailBuckets = buildDetailTypeBuckets(existingDetails);
Set<Long> reusedDetailIds = new HashSet<>();
List<DesignItemDetail> designItemDetails = Lists.newArrayList();
// 3、保存新的designItemDetail使用 saveOrUpdate 方式)
pythonObjects.getObjects().get(0).getItems().forEach(detail -> {
@@ -396,7 +396,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
return;
}
Integer priority = SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType()) ? 0 : detail.getPriority();
DesignItemDetail designItemDetail = reuseDesignItemDetail(priority, detail.getType(),
existingDetailMap, detailBuckets, reusedDetailIds);
if (Objects.nonNull(designItemDetail)) {
@@ -405,7 +405,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetail = new DesignItemDetail();
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
}
// 设置/更新字段
designItemDetail.setAccountId(userId);
designItemDetail.setDesignId(designId);
@@ -427,12 +427,18 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
if (!detail.getType().equals("Body")) {
designItemDetail.setUndividedLayer(priorityAndUndividedLayer.get(detail.getPriority().toString()).get(0));
designItemDetail.setUndividedLayerWithSinglePrint(priorityAndUndividedLayer.get(detail.getPriority().toString()).get(1));
}
// 印花存储在design_item_detail_print表中 这里还要存吗?
// DesignPythonItemPrint printObject = detail.getPrintToPython();
// designItemDetail.setPrintPath(Objects.isNull(printObject) ? "" : printObject.getPath());
// 当有多个印花后返回的printObject太长导致存储到数据库时报错
// designItemDetail.setPrintJson(JSON.toJSONString(printObject));
designItemDetail.setPartialDesign(Objects.isNull(detail.getPrint()) ? null : detail.getPrint().getPartial());
designItemDetails.add(designItemDetail);
});
// 逻辑删除未复用的旧记录
existingDetails.stream()
.filter(existingDetail -> Objects.nonNull(existingDetail.getId()) && !reusedDetailIds.contains(existingDetail.getId()))
@@ -443,7 +449,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
updateWrapper.set("update_date", DateUtil.getByTimeZone(timeZone));
designItemDetailService.update(null, updateWrapper);
});
// businessId 来自t_sys_file或者t_library
designItemDetailService.saveOrUpdateBatch(designItemDetails);
@@ -479,7 +485,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
for (int i = 0; i < layers.size(); i++) {
JSONObject jsonObject = layers.getJSONObject(i);
Integer priority = (Integer) jsonObject.get("priority");
TDesignPythonOutfitDetail designPythonOutfitDetail = reuseOutfitDetail(priority,
jsonObject.getString("image_category"), existingLayerMap, layerBuckets, reusedLayerIds);
if (Objects.nonNull(designPythonOutfitDetail)) {
@@ -488,7 +494,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designPythonOutfitDetail = new TDesignPythonOutfitDetail();
designPythonOutfitDetail.setCreateDate(LocalDateTime.now(ZoneId.of(timeZone)));
}
// 设置/更新字段
designPythonOutfitDetail.setDesignId(designId);
designPythonOutfitDetail.setDesignPythonOutfitId(designPythonOutfit.getId());
@@ -503,10 +509,10 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designPythonOutfitDetail.setOffset(String.valueOf(priorityOffset.get(Math.abs(priority))));
}
designPythonOutfitDetail.setPriority(priority);
list.add(designPythonOutfitDetail);
}
// 逻辑删除未复用的旧记录
existingLayers.stream()
.filter(existingLayer -> Objects.nonNull(existingLayer.getId()) && !reusedLayerIds.contains(existingLayer.getId()))
@@ -1154,7 +1160,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
}
Long designItemDetailId = designItemDetailTypeIdMap.get(designSingleItem.getPriority());
// 查询现有的记录,用于 saveOrUpdate
List<DesignItemDetailPrint> existingPrints = designItemDetailPrintService.getByDesignItemDetailId(designItemDetailId, printType);
// 创建 Map以 priority 为 key方便快速查找
@@ -1168,10 +1174,10 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
// 处理新的印花列表
printObject.getPrints().forEach(print -> {
setUriToMinioPath(print);
Integer priority = print.getPriority();
newPrintPriorities.add(priority);
DesignItemDetailPrint designItemDetailPrint;
// 如果存在相同 priority 的记录,则更新;否则创建新记录
if (existingPrintMap.containsKey(priority)) {
@@ -1183,7 +1189,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetailPrint = new DesignItemDetailPrint();
designItemDetailPrint.setCreateDate(LocalDateTime.now(ZoneId.of(timeZone)));
}
// 设置/更新字段
designItemDetailPrint.setDesignItemDetailId(designItemDetailId);
designItemDetailPrint.setPrintType(printType);
@@ -1195,7 +1201,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetailPrint.setPosition(print.getLocation().toString());
designItemDetailPrint.setAngle(print.getAngle());
designItemDetailPrint.setPriority(priority);
designItemDetailPrints.add(designItemDetailPrint);
});
}

View File

@@ -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());}

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -402,21 +402,27 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
notification.setType("system");
notification.setReceiverId(userId);
if (isSuccess) {
if (language.equals(Language.ENGLISH.name())) {
sysNotificationDTO.setTitle("System Notification 系统通知");
sysNotificationDTO.setContent("Your video generation task in Project " + projectName + " is ready!\n"
+ "您在项目 " + projectName + " 中创建的视频生成任务已完成!");
/*if (language.equals(Language.ENGLISH.name())) {
sysNotificationDTO.setTitle("System Notification");
sysNotificationDTO.setContent("Your video generation task in Project " + projectName + " is ready!");
} else {
sysNotificationDTO.setTitle("系统通知");
sysNotificationDTO.setContent("您在项目 " + projectName + " 中创建的视频生成任务已完成!");
}
}*/
} else {
if (language.equals(Language.ENGLISH.name())) {
sysNotificationDTO.setTitle("System Notification 系统通知");
sysNotificationDTO.setContent("Your video generation task in Project " + projectName + " has failed.\n"
+ "您在项目 " + projectName + " 中创建的视频生成任务失败。");
/*if (language.equals(Language.ENGLISH.name())) {
sysNotificationDTO.setTitle("System Notification");
sysNotificationDTO.setContent("Your video generation task in Project " + projectName + " has failed.");
} else {
sysNotificationDTO.setTitle("系统通知");
sysNotificationDTO.setContent("视频生成任务失败。");
}
}*/
}
notification.setContent(JSON.toJSONString(sysNotificationDTO));
notification.setIsRead(0);

View File

@@ -72,7 +72,6 @@ public class PayPalCheckoutServiceImpl implements PayPalCheckoutService {
private PayPalClient payPalClient;
@Resource
private OrderInfoService orderInfoService;
@Lazy
@Resource
private PaymentInfoService paymentInfoService;
@Resource

View File

@@ -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();

View File

@@ -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

View File

@@ -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);

View File

@@ -42,7 +42,6 @@ public class TaskListServiceImpl extends ServiceImpl<TaskListMapper, TaskList> i
@Resource
private MinioUtil minioUtil;
@Lazy
@Resource
private SuperResolutionService superResolutionService;

View File

@@ -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;
}
}

View File

@@ -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();