BUGFIX:
This commit is contained in:
@@ -23,6 +23,7 @@ import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -159,7 +160,7 @@ public class MyTaskScheduler {
|
||||
|
||||
// 定时任务,每十五天执行一次
|
||||
// @Scheduled(cron = "0 0 0 ? * MON")
|
||||
// @Scheduled(cron = "0 0 0 */15 * ?")
|
||||
@Scheduled(cron = "0 0 0 */15 * ?")
|
||||
public void checkExpiry() {
|
||||
// 检测正式用户是否快要过期
|
||||
QueryWrapper<Account> qw = new QueryWrapper<>();
|
||||
@@ -193,7 +194,7 @@ public class MyTaskScheduler {
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Scheduled(cron = "0 0 9 * * ?")
|
||||
@Scheduled(cron = "0 0 9 * * ?")
|
||||
public void sendTrialOrderExcelToManagements() {
|
||||
// 获取前一天日期
|
||||
LocalDate yesterday = LocalDate.now().minusDays(1);
|
||||
@@ -1504,7 +1505,7 @@ public class MyTaskScheduler {
|
||||
Workspace workspace = new Workspace();
|
||||
workspace.setAgeGroup("Adult");
|
||||
if (null != design.getTemplateId()) {
|
||||
project.setProcess(DesignProcess.SERIES_DESIGN.getValue());
|
||||
project.setProcess(DesignProcess.SERIES_DESIGN.name());
|
||||
workspace.setPosition("Overall");
|
||||
// workspace设置模特
|
||||
if (design.getModelType().equals("System")) {
|
||||
@@ -1531,7 +1532,7 @@ public class MyTaskScheduler {
|
||||
}
|
||||
}
|
||||
}else {
|
||||
project.setProcess(DesignProcess.SINGLE_DESIGN.getValue());
|
||||
project.setProcess(DesignProcess.SINGLE_DESIGN.name());
|
||||
workspace.setPosition(design.getSwitchCategory());
|
||||
}
|
||||
workspace.setSystemDesignerPercentage(design.getSystemScale().multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP).intValueExact());
|
||||
@@ -1661,6 +1662,11 @@ public class MyTaskScheduler {
|
||||
project.setAccountId(userLikeGroup.getAccountId());
|
||||
project.setName(userLikeGroup.getName());
|
||||
project.setCreateTime(LocalDateTime.ofInstant(userLikeGroup.getCreateDate().toInstant(), ZoneId.systemDefault()));
|
||||
if (Objects.isNull(userLikeGroup.getUpdateDate())){
|
||||
project.setUpdateTime(LocalDateTime.ofInstant(userLikeGroup.getCreateDate().toInstant(), ZoneId.systemDefault()));
|
||||
} else {
|
||||
project.setUpdateTime(LocalDateTime.ofInstant(userLikeGroup.getUpdateDate().toInstant(), ZoneId.systemDefault()));
|
||||
}
|
||||
// project.setUpdateTime(LocalDateTime.ofInstant(userLikeGroup.getUpdateDate().toInstant(), ZoneId.systemDefault()));
|
||||
project.setOriginal(userLikeGroup.getOriginal());
|
||||
project.setOriginalAccountId(userLikeGroup.getOriginalAccountId());
|
||||
|
||||
@@ -91,5 +91,6 @@ public class CommonConstant {
|
||||
|
||||
public static final String PARTIAL_DESIGN_PREVIEW_FILENAME = "Preview";
|
||||
|
||||
public static final String senderEmail = "info@aida.com.hk";
|
||||
|
||||
}
|
||||
|
||||
@@ -22,16 +22,16 @@ public class AccountTask {
|
||||
/**
|
||||
* 每周日晚上刷新 年付用户、月付用户的积分
|
||||
* 替换为
|
||||
* 每个月月初只刷新年付用户的积分
|
||||
* 每个月月初只刷新教育子账号的积分
|
||||
*/
|
||||
// @Scheduled(cron = "59 59 23 * * ?")
|
||||
// @Scheduled(cron = "0 0 0 1 * ?")
|
||||
@Scheduled(cron = "0 0 0 1 * ?")
|
||||
public void refreshCreditsMonthly() {
|
||||
log.info("每月1号0点 重置教育版子账号为默认积分");
|
||||
accountService.refreshCreditsMonthly();
|
||||
}
|
||||
|
||||
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
|
||||
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
|
||||
public void getPaidUser() {
|
||||
// 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单
|
||||
accountService.extendValidityForCC();
|
||||
@@ -51,7 +51,7 @@ public class AccountTask {
|
||||
}
|
||||
|
||||
// 每天检测正式用户到期情况,每天凌晨0点执行
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void paidUserToVisitor() {
|
||||
// 1、查询当前已过期正式用户或试用用户
|
||||
List<Account> accountList = accountService.getExpiredUserBySystemUser(1);
|
||||
@@ -74,7 +74,7 @@ public class AccountTask {
|
||||
accountService.registerUserToVisitor();
|
||||
}
|
||||
|
||||
// @Scheduled(cron = "0 0 0 1 * ?")
|
||||
@Scheduled(cron = "0 0 0 1 * ?")
|
||||
// 每月初刷新所有用户用户名剩余修改次数
|
||||
public void resetUsernameModifyTimes(){
|
||||
log.info("重置所有用户的用户名修改次数");
|
||||
|
||||
@@ -96,6 +96,10 @@ public class GenerateTask {
|
||||
apiGenerate.setUpdateTime(LocalDateTime.now());
|
||||
apiGenerateService.updateById(apiGenerate);
|
||||
}
|
||||
// 将积分暂扣区的积分移除
|
||||
if (toProductImageResult.getStatus().equals("Fail")){
|
||||
creditsService.deleteCreditsDeduction(apiGenerate.getAccountId(), taskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class PaymentTask {
|
||||
@Resource
|
||||
private PayPalCheckoutService payPalCheckoutService;
|
||||
|
||||
// @Scheduled(cron = "0/30 * * * * ?")
|
||||
@Scheduled(cron = "0/30 * * * * ?")
|
||||
public void orderConfirmForPaypal() throws SerializeException {
|
||||
|
||||
// log.info("PayPal orderConfirm 被执行......");
|
||||
@@ -120,7 +120,7 @@ public class PaymentTask {
|
||||
}
|
||||
}
|
||||
|
||||
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
|
||||
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
|
||||
public void calcCouponsCommission(){
|
||||
log.info("优惠券佣金计算定时器");
|
||||
affiliateService.calcCouponsCommission();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ai.da.common.utils;
|
||||
|
||||
import com.ai.da.common.constant.CommonConstant;
|
||||
import com.ai.da.model.dto.BasicEmailParamDTO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sun.mail.smtp.SMTPTransport;
|
||||
@@ -132,7 +133,8 @@ public class MailUtil {
|
||||
*/
|
||||
public BasicEmailParamDTO setBasicEmailParams(List<String> mailTo, JSONObject jsonObject, String templatePath, String title) throws AddressException {
|
||||
BasicEmailParamDTO basicEmailParamDTO = new BasicEmailParamDTO();
|
||||
basicEmailParamDTO.setSenderUserMail("info@aida.com.hk");
|
||||
// basicEmailParamDTO.setSenderUserMail("info@aida.com.hk");
|
||||
basicEmailParamDTO.setSenderUserMail(CommonConstant.senderEmail);
|
||||
basicEmailParamDTO.setMailTo(getInternetAddressList(mailTo));
|
||||
basicEmailParamDTO.setSubject(title);
|
||||
// todo 邮件模板不存在的报错与重试机制
|
||||
|
||||
@@ -372,9 +372,11 @@ public class SendEmailUtil {
|
||||
return jsonObject.toJSONString();
|
||||
}
|
||||
|
||||
private final static Long UPGRADE_NOTIFICATION_ID = 118855L;
|
||||
private final static Long UPGRADE_NOTIFICATION_ID = 146605L;
|
||||
// private final static Long UPGRADE_NOTIFICATION_ID = 146551L;
|
||||
private final static Long UPGRADE_SUCCESS_NOTIFICATION_ID = 118856L;
|
||||
private final static Long UPGRADE_NOTIFICATION_ID_CHINESE = 122898L;
|
||||
private final static Long UPGRADE_NOTIFICATION_ID_CHINESE = 146604L;
|
||||
// private final static Long UPGRADE_NOTIFICATION_ID_CHINESE = 146552L;
|
||||
private final static Long UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE = 122899L;
|
||||
|
||||
public static void sendUpgradeNotification(Account account, String senderAddress, Integer type) {
|
||||
@@ -396,20 +398,20 @@ public class SendEmailUtil {
|
||||
// 根据邮件类型设置不同的主题和模板
|
||||
String subject = "";
|
||||
Template template = new Template();
|
||||
// if (type == 1) {
|
||||
// subject = "Upcoming System Upgrade for AiDA 3.0";
|
||||
// template.setTemplateID(UPGRADE_NOTIFICATION_ID);
|
||||
// }else {
|
||||
// subject = "即将到来的AiDA 3.0系统升级";
|
||||
// template.setTemplateID(UPGRADE_NOTIFICATION_ID_CHINESE);
|
||||
// }
|
||||
if (type == 1) {
|
||||
subject = "Successful System Upgrade and New Features in AiDA 3.0";
|
||||
template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID);
|
||||
subject = "AiDA 3.1.0 System Maintenance Announcement";
|
||||
template.setTemplateID(UPGRADE_NOTIFICATION_ID);
|
||||
}else {
|
||||
subject = "系统升级成功和AiDA 3.0新功能";
|
||||
template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE);
|
||||
subject = "AiDA 3.1.0 系统维护公告";
|
||||
template.setTemplateID(UPGRADE_NOTIFICATION_ID_CHINESE);
|
||||
}
|
||||
// if (type == 1) {
|
||||
// subject = "Successful System Upgrade and New Features in AiDA 3.0";
|
||||
// template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID);
|
||||
// }else {
|
||||
// subject = "系统升级成功和AiDA 3.0新功能";
|
||||
// template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE);
|
||||
// }
|
||||
template.setTemplateData(buildAccountData(account));
|
||||
|
||||
req.setSubject(subject);
|
||||
@@ -417,8 +419,8 @@ public class SendEmailUtil {
|
||||
|
||||
// 发送邮件
|
||||
SendEmailResponse resp = client.SendEmail(req);
|
||||
log.info(senderAddress);
|
||||
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
|
||||
// log.info(senderAddress);
|
||||
// log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
|
||||
} catch (TencentCloudSDKException e) {
|
||||
log.info(senderAddress);
|
||||
log.info("邮件发送失败###{}", e.toString());
|
||||
@@ -764,7 +766,7 @@ public class SendEmailUtil {
|
||||
try {
|
||||
String merchantEmail = "kimwong@code-create.com.hk";
|
||||
String developer = "xupei3360@163.com";
|
||||
String[] receiverEmail = {/*merchantEmail,*/ developer};
|
||||
String[] receiverEmail = {merchantEmail, developer};
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
|
||||
// 实例化一个http选项,可选的,没有特殊需求可以跳过
|
||||
HttpProfile httpProfile = new HttpProfile();
|
||||
@@ -934,7 +936,7 @@ public class SendEmailUtil {
|
||||
req.setFromEmailAddress(SEND_ADDRESS);
|
||||
String merchantEmail = "kimwong@code-create.com.hk";
|
||||
String developerEmail = "xupei@code-create.com.hk";
|
||||
req.setDestination(new String[]{/*merchantEmail,*/ developerEmail});
|
||||
req.setDestination(new String[]{merchantEmail, developerEmail});
|
||||
Template template = new Template();
|
||||
req.setSubject("New Credit Purchase Order");
|
||||
template.setTemplateID(CREDITS_PURCHASE_MERCHANT);
|
||||
|
||||
@@ -135,10 +135,10 @@ public class ProjectController {
|
||||
}
|
||||
|
||||
|
||||
/*@Resource
|
||||
@Resource
|
||||
private MyTaskScheduler myTaskScheduler;
|
||||
|
||||
@GetMapping("/dataMigration")
|
||||
/*@GetMapping("/dataMigration")
|
||||
public String dataMigration(){
|
||||
myTaskScheduler.projectDataCreate();
|
||||
return "success";
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ToProductImageDTO {
|
||||
private BigDecimal imageStrengthMax;
|
||||
private String modelName;
|
||||
private String ageGroup;
|
||||
// 使用子集中的元素作为父元素
|
||||
// 使用子集中的元素作为父元素 用于重新排序
|
||||
private Long userLikeSortId;
|
||||
|
||||
// 是否默认like生成的元素
|
||||
|
||||
@@ -2964,7 +2964,7 @@ public class PythonService {
|
||||
|
||||
// 对印花类型为Generate的图片路径进行特殊处理
|
||||
private void setUriToMinioPath(DesignSinglePrint print){
|
||||
if (print.getDesignType().equals("Generate")){
|
||||
if (!StringUtil.isNullOrEmpty(print.getDesignType()) && print.getDesignType().equals("Generate")){
|
||||
if (!StringUtil.isNullOrEmpty(print.getPath())){
|
||||
try {
|
||||
URI uri = new URI(print.getPath());
|
||||
|
||||
@@ -31,6 +31,8 @@ public interface CreditsService extends IService<CreditsDetail> {
|
||||
|
||||
void addRecordToCreditsDeduction(Long accountId, String taskId, CreditsEventsEnum creditsEventsEnum, Integer num);
|
||||
|
||||
void deleteCreditsDeduction(Long accountId, String taskId);
|
||||
|
||||
Boolean taskCreditsDeduction(Long accountId, String taskId);
|
||||
|
||||
CreditsDetail getByAccountIdAndChangeEvent(Long accountId, String changeEvent, String changedCredits);
|
||||
|
||||
@@ -1266,12 +1266,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
|
||||
static {
|
||||
HikariConfig config = new HikariConfig();
|
||||
// config.setJdbcUrl("jdbc:mysql://code-create.com.hk:3306/db1nfvsgmjp3b8");
|
||||
// config.setUsername("uafqtz4gsvfrw");
|
||||
// config.setPassword("aida123456.");
|
||||
config.setJdbcUrl("jdbc:mysql://localhost:3306/code-create-local?serverTimezone=UTC");
|
||||
config.setUsername("root");
|
||||
config.setPassword("root");
|
||||
config.setJdbcUrl("jdbc:mysql://code-create.com.hk:3306/db1nfvsgmjp3b8");
|
||||
config.setUsername("uafqtz4gsvfrw");
|
||||
config.setPassword("aida123456.");
|
||||
// config.setJdbcUrl("jdbc:mysql://localhost:3306/code-create-local?serverTimezone=UTC");
|
||||
// config.setUsername("root");
|
||||
// config.setPassword("root");
|
||||
config.addDataSourceProperty("cachePrepStmts", "true");
|
||||
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
||||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
||||
|
||||
@@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
||||
// 邮件通知审批者
|
||||
String merchantEmail = "kimwong@code-create.com.hk";
|
||||
String developer = "xupei3360@163.com";
|
||||
String[] receiverEmail = {/*merchantEmail, */developer};
|
||||
String[] receiverEmail = {merchantEmail, developer};
|
||||
SendEmailUtil.affiliateEmailReminder(receiverEmail, new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new");
|
||||
// emailService.affiliateEmailReminder(Arrays.asList(/*merchantEmail,*/ developer), new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new");
|
||||
}else {
|
||||
@@ -387,7 +387,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
||||
|
||||
String merchantEmail = "kimwong@code-create.com.hk";
|
||||
String developer = "xupei3360@163.com";
|
||||
String[] receiverEmail = {/*merchantEmail,*/ developer};
|
||||
String[] receiverEmail = {merchantEmail, developer};
|
||||
// 邮件通知
|
||||
SendEmailUtil.affiliateEmailReminder(receiverEmail, affiliateEmailParamsDTO, "summary");
|
||||
// emailService.affiliateEmailReminder(Arrays.asList(/*merchantEmail,*/ developer), affiliateEmailParamsDTO, "summary");
|
||||
|
||||
@@ -235,6 +235,12 @@ public class CreditsServiceImpl extends ServiceImpl<CreditsDetailMapper, Credits
|
||||
redisUtil.addToString(creditsDeduction + ":" + accountId + ":" + taskId, String.valueOf(Long.parseLong(creditsEventsEnum.getValue()) * num), CommonConstant.CREDITS_EXPIRE_TIME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCreditsDeduction(Long accountId, String taskId) {
|
||||
// 5、添加当前任务的预扣积分到redis 任务有效期一天,若待扣积分两天还没被移除,说明任务已经失败,待扣积分自动失效
|
||||
redisUtil.removeFromString(creditsDeduction + ":" + accountId + ":" + taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行扣除积分,更新数据库
|
||||
*/
|
||||
|
||||
@@ -958,7 +958,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
||||
|
||||
// 对印花类型为Generate的图片路径进行特殊处理
|
||||
private void setUriToMinioPath(DesignSinglePrint print){
|
||||
if (print.getDesignType().equals("Generate")){
|
||||
if (!StringUtil.isNullOrEmpty(print.getDesignType()) && print.getDesignType().equals("Generate")){
|
||||
if (!StringUtil.isNullOrEmpty(print.getPath())){
|
||||
try {
|
||||
URI uri = new URI(print.getPath());
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ai.da.service.impl;
|
||||
|
||||
import com.ai.da.common.RabbitMQ.MQPublisher;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.constant.CommonConstant;
|
||||
import com.ai.da.common.response.ResultEnum;
|
||||
import com.ai.da.common.utils.DateUtil;
|
||||
import com.ai.da.common.utils.MailUtil;
|
||||
@@ -178,7 +179,8 @@ public class EmailServiceImpl implements EmailService {
|
||||
EmailLog emailLog = new EmailLog();
|
||||
emailLog.setTemplateId(emailTemplate.getId());
|
||||
if (Objects.nonNull(jsonObject)) emailLog.setParameter(jsonObject.toString());
|
||||
emailLog.setSender("info@aida.com.hk");
|
||||
// emailLog.setSender("info@aida.com.hk");
|
||||
emailLog.setSender(CommonConstant.senderEmail);
|
||||
emailLog.setRecipients(mailTo.toString());
|
||||
emailLog.setSubject(title);
|
||||
emailLog.setCreateTime(LocalDateTime.now());
|
||||
@@ -584,7 +586,7 @@ public class EmailServiceImpl implements EmailService {
|
||||
try {
|
||||
String merchantEmail = "kimwong@code-create.com.hk";
|
||||
String developer = "xupei3360@163.com";
|
||||
List<String> merchantReceiver = Arrays.asList(/*merchantEmail, */developer);
|
||||
List<String> merchantReceiver = Arrays.asList(merchantEmail, developer);
|
||||
|
||||
String merchantSubject = null;
|
||||
String merchantTemplate = null;
|
||||
@@ -704,7 +706,7 @@ public class EmailServiceImpl implements EmailService {
|
||||
jsonObject.put("quantity", quantity);
|
||||
jsonObject.put("totalFee", amount);
|
||||
|
||||
sendEmail(Arrays.asList(/*merchantEmail,*/developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null);
|
||||
sendEmail(Arrays.asList(merchantEmail,developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null);
|
||||
}
|
||||
|
||||
private final static String COMMON_EXCEPTION_REMINDER = "135279_common-exception-reminder.html";
|
||||
|
||||
@@ -635,6 +635,9 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
* 处理wx模型生成
|
||||
*/
|
||||
private PrepareForGenerateVO handleWxModelGeneration(GenerateThroughImageTextDTO generateDTO) {
|
||||
// 校验积分是否足够
|
||||
validateCredits(CreditsEventsEnum.WX_TEXT2IMG);
|
||||
// 创建生成任务
|
||||
String taskId = createAsyncTask(generateDTO);
|
||||
processCreditDeduction(generateDTO.getUserId(), taskId, CreditsEventsEnum.WX_TEXT2IMG);
|
||||
return new PrepareForGenerateVO(Collections.singletonList(taskId), 200);
|
||||
@@ -653,6 +656,9 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
* 处理flux pattern生成
|
||||
*/
|
||||
private PrepareForGenerateVO handleFluxPatternGeneration(GenerateThroughImageTextDTO generateDTO) {
|
||||
// 校验积分是否足够
|
||||
validateCredits(CreditsEventsEnum.FLUX_IMG2IMG);
|
||||
|
||||
// 获取图片路径
|
||||
String imagePath = getImagePathForFlux(generateDTO);
|
||||
|
||||
@@ -2507,6 +2513,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
} else {
|
||||
throw new BusinessException("unknown motion task");
|
||||
}
|
||||
Long accountId = poseTransformation.getAccountId();
|
||||
PoseTransformationVO poseTransformationVO = new PoseTransformationVO();
|
||||
WangXiangTaskStatusEnum statusEnum = WangXiangTaskStatusEnum.fromName(status);
|
||||
switch (statusEnum) {
|
||||
@@ -2528,7 +2535,6 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
poseTransformationVO.setFirstFrameUrl(minioUtil.getPreSignedUrl(poseTransformation.getFirstFrameUrl(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||
}
|
||||
// 执行积分扣除
|
||||
Long accountId = poseTransformation.getAccountId();
|
||||
Boolean flag = creditsService.taskCreditsDeduction(accountId, taskId);
|
||||
if (flag) creditsService.updateChangedCredits(String.valueOf(accountId), taskId);
|
||||
|
||||
@@ -2539,11 +2545,15 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
case FAILED:
|
||||
AccessLimitUtils.validateOut("animation");
|
||||
updatePoseTransferStatus(taskId, "Fail", poseTransformation);
|
||||
// 将积分暂扣区的积分移除
|
||||
creditsService.deleteCreditsDeduction(accountId, taskId);
|
||||
throw new BusinessException(output.getStr("message"), ResultEnum.PROMPT.getCode());
|
||||
case UNKNOWN_W:
|
||||
AccessLimitUtils.validateOut("animation");
|
||||
poseTransformationVO.setStatus("Fail");
|
||||
updatePoseTransferStatus(taskId, "Fail", poseTransformation);
|
||||
// 将积分暂扣区的积分移除
|
||||
creditsService.deleteCreditsDeduction(accountId, taskId);
|
||||
break;
|
||||
case RUNNING:
|
||||
case PENDING_W:
|
||||
@@ -2555,6 +2565,8 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
log.info("未知状态: {}", status);
|
||||
poseTransformationVO.setStatus("Fail");
|
||||
updatePoseTransferStatus(taskId, "Fail", poseTransformation);
|
||||
// 将积分暂扣区的积分移除
|
||||
creditsService.deleteCreditsDeduction(accountId, taskId);
|
||||
}
|
||||
poseTransformationVO.setTaskId(taskId);
|
||||
|
||||
@@ -2968,9 +2980,14 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
String fluxResult = getFluxResult(taskId, objectName);
|
||||
if (Objects.isNull(generateDetail)) {
|
||||
if (StringUtil.isNullOrEmpty(fluxResult)) {
|
||||
// 将积分暂扣区的积分移除
|
||||
creditsService.deleteCreditsDeduction(accountId, taskId);
|
||||
return new GenerateResultVO(taskId, "Fail");
|
||||
} else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) {
|
||||
String status = fluxResult.equals("Fail") ? "Fail" : "Executing";
|
||||
if (status.equals("Fail")){
|
||||
creditsService.deleteCreditsDeduction(accountId, taskId);
|
||||
}
|
||||
return new GenerateResultVO(taskId, status);
|
||||
}
|
||||
generateDetail = new GenerateDetail(generate.getId(), fluxResult,
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.ai.da.mapper.primary.*;
|
||||
import com.ai.da.mapper.primary.entity.*;
|
||||
import com.ai.da.mapper.primary.entity.Collection;
|
||||
import com.ai.da.model.dto.*;
|
||||
import com.ai.da.model.enums.DesignProcess;
|
||||
import com.ai.da.model.enums.Position;
|
||||
import com.ai.da.model.enums.Sex;
|
||||
import com.ai.da.model.vo.*;
|
||||
@@ -699,12 +700,15 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
if (workspace.getPosition().equals(Position.OVERALL.getValue())) {
|
||||
design.setSingleOverall("overall");
|
||||
design.setSwitchCategory("");
|
||||
project.setProcess(DesignProcess.SERIES_DESIGN.name());
|
||||
} else {
|
||||
design.setSingleOverall("single");
|
||||
design.setSwitchCategory(workspace.getPosition());
|
||||
project.setProcess(DesignProcess.SINGLE_DESIGN.name());
|
||||
}
|
||||
design.setCreateDate(new Date());
|
||||
designMapper.insert(design);
|
||||
projectMapper.updateById(project);
|
||||
|
||||
for (CollectionElement element : collectionElementListOld) {
|
||||
element.setCollectionId(collectionIdNew);
|
||||
|
||||
@@ -771,6 +771,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
Boolean flag = creditsService.taskCreditsDeduction(project.getAccountId(), taskId);
|
||||
if (flag) creditsService.updateChangedCredits(String.valueOf(project.getAccountId()), taskId);
|
||||
}
|
||||
// 将积分暂扣区的积分移除
|
||||
if (toProductImageResult.getStatus().equals("Fail")){
|
||||
creditsService.deleteCreditsDeduction(project.getAccountId(), taskId);
|
||||
}
|
||||
// 在这个stream中不再继续往后执行
|
||||
return;
|
||||
}
|
||||
@@ -1287,6 +1291,11 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
Boolean flag = creditsService.taskCreditsDeduction(project.getAccountId(), taskId);
|
||||
if (flag) creditsService.updateChangedCredits(String.valueOf(project.getAccountId()), taskId);
|
||||
}
|
||||
// 将积分暂扣区的积分移除
|
||||
if (toProductImageResult.getStatus().equals("Fail")){
|
||||
creditsService.deleteCreditsDeduction(project.getAccountId(), taskId);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ spring.security.jwtExpiration=604800000
|
||||
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
||||
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\
|
||||
/api/product/**,/api/ali-pay/**,/api/order-info/**,/api/paypal/**,/api/credits/**,/api/inquiry/**,/api/tasks/**,/api/python/prepareForSR,/api/alipay-hk/**,/api/portfolio/**,\
|
||||
/api/stripe/**,/api/message/**,/api/tags/**,/notification/**,/api/affiliate/**
|
||||
/api/stripe/**,/api/message/**,/api/tags/**,/notification/**,/api/affiliate/**,/api/project/**,/api/llm/**
|
||||
spring.security.authApi=/auth/login
|
||||
|
||||
|
||||
@@ -109,10 +109,45 @@ rabbitmq.queues.toProductImageResult=ToProductImage-prod
|
||||
rabbitmq.queues.relightResult=Relight-prod
|
||||
rabbitmq.queues.poseTransform=PoseTransform-prod
|
||||
rabbitmq.exchange.generate=generate-exchange
|
||||
rabbitmq.queues.designBatch=DesignBatch-dev
|
||||
rabbitmq.queues.relightBatch=BatchRelight-dev
|
||||
rabbitmq.queues.toProductImageBatch=BatchToProductImage-dev
|
||||
rabbitmq.queues.poseTransformBatch=BatchPoseTransform-dev
|
||||
rabbitmq.queues.emailRetry=emailRetry-business
|
||||
# 死信队列配置
|
||||
rabbitmq.dead-letter.exchange=dlx.email-retry
|
||||
rabbitmq.dead-letter.queue=dlx.email-retry.queue
|
||||
rabbitmq.dead-letter.routing-key=dlx.email-retry.key
|
||||
|
||||
orderList.link=https://aida.com.hk/home/homePage?order=
|
||||
|
||||
# 0 不发送邮件通知 1 发送邮件通知
|
||||
stripe.webhook.fail.reminder=1
|
||||
# kim live
|
||||
stripe.paymentMethodConfiguration=pmc_1Qu6yJH7nPZ8bkrNULYnFFPf
|
||||
stripe.paymentMethodConfiguration=pmc_1Qu6yJH7nPZ8bkrNULYnFFPf
|
||||
# kim test
|
||||
#stripe.paymentMethodConfiguration=pmc_1LywTWH7nPZ8bkrN6FvdCUWG
|
||||
# developer test
|
||||
#stripe.paymentMethodConfiguration=pmc_1QIKyq02n1TEydyNKVEYvhW7
|
||||
#thymelea模板配置
|
||||
#控制 Thymeleaf 是否启用模板缓存 生产环境用true,以提高性能
|
||||
spring.thymeleaf.cache=false
|
||||
|
||||
#指定邮件服务器的地址。
|
||||
spring.mail.host=mail.aida.com.hk
|
||||
#指定邮件服务器的端口号。
|
||||
spring.mail.port=465
|
||||
#指定登录邮件服务器的用户名
|
||||
spring.mail.username=info@aida.com.hk
|
||||
#指定登录邮件服务器的密码 / 授权码
|
||||
spring.mail.password=AIdlab@2025
|
||||
spring.mail.default-encoding=UTF-8
|
||||
|
||||
# SSL 配置
|
||||
#启用 SSL 加密
|
||||
spring.mail.properties.mail.smtp.ssl.enable=true
|
||||
#指定 SSL 连接的端口号。通常与 spring.mail.port 一致
|
||||
spring.mail.properties.mail.smtp.socketFactory.port=465
|
||||
|
||||
ALIYUN_API_KEY=sk-dc3f88b7df844fc5a7d3616ebd8a589c
|
||||
FREEPIK_API_KEY=FPSX94e5917d376a4facb87dabbaa0319c72
|
||||
@@ -2,7 +2,7 @@
|
||||
#spring.profiles.active=test
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>application-prod<6F>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
#spring.profiles.active=prod
|
||||
spring.profiles.active=prod
|
||||
|
||||
#<23><><EFBFBD><EFBFBD>application-dev<65>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
spring.profiles.active=dev
|
||||
#spring.profiles.active=dev
|
||||
|
||||
Reference in New Issue
Block a user