2 Commits

17 changed files with 112 additions and 177 deletions

View File

@@ -202,7 +202,7 @@ public class MyTaskScheduler {
} }
} }
// @Scheduled(cron = "0 0 9 * * ?") @Scheduled(cron = "0 0 9 * * ?")
public void sendTrialOrderExcelToManagements() { public void sendTrialOrderExcelToManagements() {
// 获取前一天日期 // 获取前一天日期
LocalDate yesterday = LocalDate.now().minusDays(1); LocalDate yesterday = LocalDate.now().minusDays(1);

View File

@@ -34,7 +34,7 @@ public class AccountTask {
accountService.refreshCreditsMonthly(); accountService.refreshCreditsMonthly();
} }
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void getPaidUser() { public void getPaidUser() {
// 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单 // 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单
accountService.extendValidityForCC(); accountService.extendValidityForCC();

View File

@@ -45,7 +45,7 @@ public class PaymentTask {
@Resource @Resource
private PayPalCheckoutService payPalCheckoutService; private PayPalCheckoutService payPalCheckoutService;
// @Scheduled(cron = "0/30 * * * * ?") @Scheduled(cron = "0/30 * * * * ?")
public void orderConfirmForPaypal() throws SerializeException { public void orderConfirmForPaypal() throws SerializeException {
// log.info("PayPal orderConfirm 被执行......"); // log.info("PayPal orderConfirm 被执行......");
@@ -97,7 +97,7 @@ public class PaymentTask {
// //
} }
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void updateAffiliateInfoWithPayment(){ public void updateAffiliateInfoWithPayment(){
// log.info("佣金计算定时器"); // log.info("佣金计算定时器");
affiliateService.updateAffiliateInfoWithPayment(); affiliateService.updateAffiliateInfoWithPayment();
@@ -109,7 +109,7 @@ public class PaymentTask {
affiliateService.syncLinkViewCountToDB(); affiliateService.syncLinkViewCountToDB();
} }
// @Scheduled(cron = "0 0 8 28-31 * ?") @Scheduled(cron = "0 0 8 28-31 * ?")
public void commissionSummaryReminder(){ public void commissionSummaryReminder(){
// 每个月末的最后一天的早上八点执行 // 每个月末的最后一天的早上八点执行
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();

View File

@@ -40,7 +40,7 @@ public class SubscriptionReminderTask {
REMINDER_DAYS_CONFIG.put("year", 14); REMINDER_DAYS_CONFIG.put("year", 14);
} }
// @Scheduled(cron = "0 0 9 * * ?") @Scheduled(cron = "0 0 9 * * ?")
public void subscriptionReminder() { public void subscriptionReminder() {
// 获取所有需要通知的订阅 // 获取所有需要通知的订阅
List<SubscriptionInfo> subscriptionInfos = getDueSubscriptions(); List<SubscriptionInfo> subscriptionInfos = getDueSubscriptions();
@@ -97,7 +97,7 @@ public class SubscriptionReminderTask {
return subscriptionInfoMapper.selectList(qw); return subscriptionInfoMapper.selectList(qw);
} }
// @Scheduled(cron = "0 0 9 * * ?") @Scheduled(cron = "0 0 9 * * ?")
public void trialReminder() { public void trialReminder() {
// 今天的 00:00:00 和 23:59:59 // 今天的 00:00:00 和 23:59:59
LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay(); LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay();

View File

@@ -767,7 +767,7 @@ public class SendEmailUtil {
try { try {
String merchantEmail = "kimwong@code-create.com.hk"; String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com"; String developer = "xupei3360@163.com";
String[] receiverEmail = {/*merchantEmail,*/ developer}; String[] receiverEmail = {merchantEmail, developer};
Credential cred = new Credential(SECRET_ID, SECRET_KEy); Credential cred = new Credential(SECRET_ID, SECRET_KEy);
// 实例化一个http选项可选的没有特殊需求可以跳过 // 实例化一个http选项可选的没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile(); HttpProfile httpProfile = new HttpProfile();
@@ -968,7 +968,7 @@ public class SendEmailUtil {
req.setFromEmailAddress(SEND_ADDRESS); req.setFromEmailAddress(SEND_ADDRESS);
String merchantEmail = "kimwong@code-create.com.hk"; String merchantEmail = "kimwong@code-create.com.hk";
String developerEmail = "xupei@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(); Template template = new Template();
req.setSubject("New Credit Purchase Order"); req.setSubject("New Credit Purchase Order");
template.setTemplateID(CREDITS_PURCHASE_MERCHANT); template.setTemplateID(CREDITS_PURCHASE_MERCHANT);
@@ -1030,25 +1030,15 @@ public class SendEmailUtil {
private final static Long CN_2025_618 = 141425L; private final static Long CN_2025_618 = 141425L;
private final static Long EN_2025_618 = 141424L; private final static Long EN_2025_618 = 141424L;
private final static Long CN_GLOBAL_AWARDS = 166716L;
private final static Long EN_GLOBAL_AWARDS = 166715L;
private final static Long GLOBAL_AWARDS_2 = 173919L;
// 复用 SesClient避免每次发送都创建新连接
private static SesClient getSesClient() {
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
return new SesClient(cred, "ap-hongkong", clientProfile);
}
public static void send618PromotionEmailTemp(String receiver, String language){ public static void send618PromotionEmailTemp(String receiver, String language){
SesClient client = null;
try { try {
client = getSesClient(); // 实例化一个认证对象
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("ses.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
SendEmailRequest req = new SendEmailRequest(); SendEmailRequest req = new SendEmailRequest();
req.setFromEmailAddress(CODE_CREATE_SEND_ADDRESS); req.setFromEmailAddress(CODE_CREATE_SEND_ADDRESS);
req.setDestination(new String[]{receiver}); req.setDestination(new String[]{receiver});
@@ -1056,15 +1046,20 @@ public class SendEmailUtil {
// 根据邮件类型设置不同的主题和模板 // 根据邮件类型设置不同的主题和模板
String subject = ""; String subject = "";
Template template = new Template(); Template template = new Template();
subject = "AiDA Global Design Awards 2026 | The Journey Starts Now ! \nAiDA 全球设计大奖 2026 | 从现在开始你的创作之旅 !"; // if (type == 1) {
template.setTemplateID(GLOBAL_AWARDS_2); // subject = "Upcoming System Upgrade for AiDA 3.0";
/*if (language.equals("ENGLISH")) { // template.setTemplateID(UPGRADE_NOTIFICATION_ID);
subject = "From Idea to Wow. \uD83D\uDD25 | AiDA Demo & Global Awards"; // }else {
template.setTemplateID(EN_GLOBAL_AWARDS); // subject = "即将到来的AiDA 3.0系统升级";
// template.setTemplateID(UPGRADE_NOTIFICATION_ID_CHINESE);
// }
if (language.equals("ENGLISH")) {
subject = "Welcome back Subscribe AiDA with the discount code to enjoy 50% OFF!";
template.setTemplateID(EN_2025_618);
}else { }else {
subject = "灵感开挂,创作起飞 \uD83D\uDD25 | AiDA Demo & 全球设计大奖"; subject = "设计时速狂飙AiDA 618半价让灵感永不限流";
template.setTemplateID(CN_GLOBAL_AWARDS); template.setTemplateID(CN_2025_618);
}*/ }
req.setSubject(subject); req.setSubject(subject);
req.setTemplate(template); req.setTemplate(template);
@@ -1074,7 +1069,9 @@ public class SendEmailUtil {
log.info("邮件发送成功,收件人地址:{}", receiver); log.info("邮件发送成功,收件人地址:{}", receiver);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) { } catch (TencentCloudSDKException e) {
log.error("邮件发送失败,收件人地址:{},错误信息:{}", receiver, e.toString()); log.info(receiver);
log.error("邮件发送失败###{},收件人地址:{}", e.toString(), receiver);
} }
} }

View File

@@ -20,92 +20,72 @@ public class SendRequestUtil {
@Value("${FREEPIK_API_KEY}") @Value("${FREEPIK_API_KEY}")
private String FREEPIK_API_KEY; private String FREEPIK_API_KEY;
public String sendAliYunPostAsync(String apiUrl, String requestBody) { public String sendAliYunPostAsync(String apiUrl, String requestBody){
// 发送POST请求 // 发送POST请求 todo 异常处理
try (HttpResponse execute = HttpRequest.post(apiUrl) HttpResponse execute = HttpRequest.post(apiUrl)
.header(Header.AUTHORIZATION, "Bearer " + ALIYUN_API_KEY) .header(Header.AUTHORIZATION, "Bearer " + ALIYUN_API_KEY)
.header("X-DashScope-Async", "enable") .header("X-DashScope-Async", "enable")
.header(Header.CONTENT_TYPE, "application/json") .header(Header.CONTENT_TYPE, "application/json")
.body(requestBody) .body(requestBody)
.timeout(20000) // 设置超时时间20秒 .timeout(20000) // 设置超时时间20秒
.execute()) { .execute();
int status = execute.getStatus();
int status = execute.getStatus(); if (status == 200){
if (status == 200) { String body = execute.body();
String body = execute.body(); JSONObject bodyJson = JSONUtil.parseObj(body);
JSONObject bodyJson = JSONUtil.parseObj(body); return body;
return body;
}
log.warn("请求失败,状态码为:{},响应内容:{}", status, execute.body());
} catch (Exception e) {
log.error("请求阿里云API时发生异常URL{},请求体:{},异常信息:{}",
apiUrl, requestBody, e.getMessage(), e);
} }
log.warn("请求失败,状态码为 {}", status);
return null; return null;
} }
public String sendAliYunPost(String apiUrl, String requestBody) { public String sendAliYunPost(String apiUrl, String requestBody){
// 发送POST请求 // 发送POST请求 todo 异常处理
try (HttpResponse execute = HttpRequest.post(apiUrl) HttpResponse execute = HttpRequest.post(apiUrl)
.header(Header.AUTHORIZATION, "Bearer " + ALIYUN_API_KEY) .header(Header.AUTHORIZATION, "Bearer " + ALIYUN_API_KEY)
.header(Header.CONTENT_TYPE, "application/json") .header(Header.CONTENT_TYPE, "application/json")
.body(requestBody) .body(requestBody)
.timeout(20000) // 设置超时时间20秒 .timeout(20000) // 设置超时时间20秒
.execute()) { .execute();
int status = execute.getStatus();
int status = execute.getStatus(); if (status == 200){
if (status == 200) { String body = execute.body();
String body = execute.body(); JSONObject bodyJson = JSONUtil.parseObj(body);
JSONObject bodyJson = JSONUtil.parseObj(body); return body;
return body;
}
log.warn("请求失败,状态码为:{},响应内容:{}", status, execute.body());
} catch (Exception e) {
log.error("请求阿里云API时发生异常URL{},请求体:{},异常信息:{}",
apiUrl, requestBody, e.getMessage(), e);
} }
log.warn("请求失败,状态码为 {}", status);
return null; return null;
} }
public static final String FREE_PIK = "https://api.freepik.com/v1/ai/beta/text-to-image/reimagine-flux"; public static final String FREE_PIK = "https://api.freepik.com/v1/ai/beta/text-to-image/reimagine-flux";
public String sendFreepikPost(String requestBody) { public String sendFreepikPost( String requestBody){
// 发送POST请求 // 发送POST请求 todo 异常处理
try (HttpResponse execute = HttpRequest.post(FREE_PIK) HttpResponse execute = HttpRequest.post(FREE_PIK)
.header(Header.CONTENT_TYPE, "application/json") .header(Header.CONTENT_TYPE, "application/json")
.header("x-freepik-api-key", FREEPIK_API_KEY) .header("x-freepik-api-key", FREEPIK_API_KEY)
.body(requestBody) .body(requestBody)
.timeout(20000) // 设置超时时间20秒 .timeout(20000) // 设置超时时间20秒
.execute()) { .execute();
int status = execute.getStatus();
int status = execute.getStatus(); if (status == 200){
if (status == 200) { return execute.body();
return execute.body();
}
log.warn("请求失败,状态码为:{},响应内容:{}", status, execute.body());
} catch (Exception e) {
log.error("请求Freepik API时发生异常请求体{},异常信息:{}",
requestBody, e.getMessage(), e);
} }
log.warn("请求失败,状态码为 {}", status);
return null; return null;
} }
public String sendAliYunGet(String fullUrl) { public String sendAliYunGet(String fullUrl){
// 发送GET请求 // 发送GET请求 todo 异常处理
try (HttpResponse httpResponse = HttpRequest.get(fullUrl) HttpResponse httpResponse = HttpRequest.get(fullUrl)
.header(Header.AUTHORIZATION, "Bearer " + ALIYUN_API_KEY) .header(Header.AUTHORIZATION, "Bearer " + ALIYUN_API_KEY)
.timeout(20000) // 设置超时时间20秒 .timeout(20000) // 设置超时时间20秒
.execute()) { .execute();
int status = httpResponse.getStatus();
int status = httpResponse.getStatus(); if (status == 200){
if (status == 200) { return httpResponse.body();
return httpResponse.body(); }else {
} return null;
log.warn("请求失败,状态码为:{},响应内容:{}", status, httpResponse.body());
} catch (Exception e) {
log.error("请求阿里云API时发生异常URL{},异常信息:{}",
fullUrl, e.getMessage(), e);
} }
return null;
} }
/*public String sendFluxPost(String url, String requestBodyStr){ /*public String sendFluxPost(String url, String requestBodyStr){

View File

@@ -380,12 +380,12 @@ public class AccountController {
return Response.success(accountService.subAccountImport(file)); return Response.success(accountService.subAccountImport(file));
} }
@GetMapping("/send618Email") /*@GetMapping("/send618Email")
@Operation(summary = "618邮件发送") @Operation(summary = "618邮件发送")
public Response<String> send618PromotionEmailTemp() { public Response<String> send618PromotionEmailTemp() {
accountService.send618PromotionEmailTemp(); accountService.send618PromotionEmailTemp();
return Response.success("success"); return Response.success("success");
} }*/
/*@GetMapping("/refreshCreditsMonthly") /*@GetMapping("/refreshCreditsMonthly")
@Operation(summary = "刷新子账号积分") @Operation(summary = "刷新子账号积分")

View File

@@ -239,7 +239,7 @@ public interface AccountService extends IService<Account> {
Set<String> organizationNameSearch(String type, String name); Set<String> organizationNameSearch(String type, String name);
void send618PromotionEmailTemp(); /*void send618PromotionEmailTemp();*/
void checkEduAdminExpireStatus(); void checkEduAdminExpireStatus();

View File

@@ -3670,66 +3670,33 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
return new HashSet<>(); return new HashSet<>();
} }
@Override /* @Override
public void send618PromotionEmailTemp() { public void send618PromotionEmailTemp() {
QueryWrapper<Account> queryWrapper = new QueryWrapper<>(); QueryWrapper<TrialOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_deleted", 0);
queryWrapper.lambda() List<TrialOrder> trialOrders = trialOrderMapper.selectList(queryWrapper);
.isNotNull(Account::getUserEmail)
.in(Account::getUserEmail, "xupei3360@163.com", "kimwong@code-create.com.hk", "kaicpang.pang@connect.polyu.hk", "chelseayu@code-create.com.hk")
.apply("LENGTH(TRIM(user_email)) > 0");
List<Account> accounts = baseMapper.selectList(queryWrapper);
// 按邮箱去重,保留每个邮箱的第一条记录
Map<String, Account> emailToAccountMap = new LinkedHashMap<>();
for (Account account : accounts) {
String email = account.getUserEmail();
if (!StringUtil.isNullOrEmpty(email)) {
email = email.trim().toLowerCase();
// 保留第一次出现的记录
emailToAccountMap.putIfAbsent(email, account);
}
}
List<String> uniqueEmails = new ArrayList<>(emailToAccountMap.keySet());
int total = uniqueEmails.size();
log.info("AiDA用户去重后邮件发送总量{}", total);
// 控制发送速率每发送20封后等待1秒控制QPS在20以内
int batchSize = 20;
long sleepMillis = 1000;
int successCount = 0;
int failCount = 0;
for (int i = 0; i < uniqueEmails.size(); i++) {
String email = uniqueEmails.get(i);
log.info("邮件发送进度 {}/{}", i + 1, total);
// List<Account> accountList = accountMapper.selectList(queryWrapper);
System.out.println(trialOrders);
int total = trialOrders.size();
log.info("试用用户总量:{}", total);
int current = 1;
for (TrialOrder trialOrder : trialOrders) {
log.info("邮件发送进度 {}/{}", current, total);
try { try {
// 统一发送英文版本 if (!StringUtil.isNullOrEmpty(trialOrder.getCountry()) && trialOrder.getCountry().equals("China")) {
// log.info("邮件地址 {}", email); SendEmailUtil.send618PromotionEmailTemp(trialOrder.getEmail(), "CHINESE_SIMPLIFIED");
SendEmailUtil.send618PromotionEmailTemp(email, "ENGLISH"); } else {
successCount++; // 英文
} catch (Exception e) { SendEmailUtil.send618PromotionEmailTemp(trialOrder.getEmail(), "ENGLISH");
failCount++;
log.error("邮件发送失败,收件人:{},错误信息:{}", email, e.getMessage());
}
// 控制发送速率,每发送 batchSize 封后等待
if ((i + 1) % batchSize == 0 && (i + 1) < uniqueEmails.size()) {
try {
Thread.sleep(sleepMillis);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.warn("邮件发送被中断");
break;
} }
}catch (Exception e) {
log.info(e.getMessage());
} }
current ++;
} }
}*/
log.info("邮件发送完成,成功:{},失败:{}", successCount, failCount);
}
@Override @Override
public void checkEduAdminExpireStatus() { public void checkEduAdminExpireStatus() {

View File

@@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
// 邮件通知审批者 // 邮件通知审批者
String merchantEmail = "kimwong@code-create.com.hk"; String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com"; String developer = "xupei3360@163.com";
String[] receiverEmail = {/*merchantEmail,*/ developer}; String[] receiverEmail = {merchantEmail, developer};
SendEmailUtil.affiliateEmailReminder(receiverEmail, new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new"); SendEmailUtil.affiliateEmailReminder(receiverEmail, new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new");
// emailService.affiliateEmailReminder(Arrays.asList(/*merchantEmail,*/ developer), new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new"); // emailService.affiliateEmailReminder(Arrays.asList(/*merchantEmail,*/ developer), new AffiliateEmailParamsDTO(userHolder.getUsername(), promotionMethod), "new");
}else { }else {
@@ -442,7 +442,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
String merchantEmail = "kimwong@code-create.com.hk"; String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com"; String developer = "xupei3360@163.com";
String[] receiverEmail = {/*merchantEmail,*/ developer}; String[] receiverEmail = {merchantEmail, developer};
// 邮件通知 // 邮件通知
SendEmailUtil.affiliateEmailReminder(receiverEmail, affiliateEmailParamsDTO, "summary"); SendEmailUtil.affiliateEmailReminder(receiverEmail, affiliateEmailParamsDTO, "summary");
// emailService.affiliateEmailReminder(Arrays.asList(/*merchantEmail,*/ developer), affiliateEmailParamsDTO, "summary"); // emailService.affiliateEmailReminder(Arrays.asList(/*merchantEmail,*/ developer), affiliateEmailParamsDTO, "summary");

View File

@@ -521,7 +521,6 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
.map(DesignCollectionPrintElementDTO::getId) .map(DesignCollectionPrintElementDTO::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<CollectionElement> printBoardElements = new ArrayList<>(); List<CollectionElement> printBoardElements = new ArrayList<>();
elementVO.setPrintBoardElements(printBoardElements);
if (!CollectionUtils.isEmpty(printBoardIds)) { if (!CollectionUtils.isEmpty(printBoardIds)) {
// 从数据库批量查询printBoard元素 // 从数据库批量查询printBoard元素
printBoardElements = collectionElementMapper.selectBatchIds(printBoardIds); printBoardElements = collectionElementMapper.selectBatchIds(printBoardIds);
@@ -529,7 +528,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
if (CollectionUtil.isEmpty(printBoardElements) || printBoardElements.size() != printBoardIds.size()) { if (CollectionUtil.isEmpty(printBoardElements) || printBoardElements.size() != printBoardIds.size()) {
throw new BusinessException("get.printBoards.data.is.mismatch"); throw new BusinessException("get.printBoards.data.is.mismatch");
} }
// elementVO.setPrintBoardElements(printBoardElements); elementVO.setPrintBoardElements(printBoardElements);
usedElementIds.addAll(printBoardIds); // 记录已使用的元素ID usedElementIds.addAll(printBoardIds); // 记录已使用的元素ID
} }
// 处理类型为LIBRARY的printBoard元素 // 处理类型为LIBRARY的printBoard元素

View File

@@ -764,20 +764,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
getPrintboardLevel2TypeQw.lambda().orderByDesc(CollectionElement::getCreateDate); getPrintboardLevel2TypeQw.lambda().orderByDesc(CollectionElement::getCreateDate);
getPrintboardLevel2TypeQw.last("limit 1"); getPrintboardLevel2TypeQw.last("limit 1");
CollectionElement one = collectionElementService.getOne(getPrintboardLevel2TypeQw); CollectionElement one = collectionElementService.getOne(getPrintboardLevel2TypeQw);
if (Objects.isNull(one)) { print.setLevel2Type(one.getLevel2Type());
QueryWrapper<Library> libraryQueryWrapper = new QueryWrapper<>();
libraryQueryWrapper.lambda().eq(Library::getUrl, print.getPath());
libraryQueryWrapper.lambda().orderByDesc(Library::getCreateDate);
getPrintboardLevel2TypeQw.last("limit 1");
Library library = libraryService.getOne(libraryQueryWrapper);
if (Objects.isNull(library)) {
print.setLevel2Type("Pattern");
} else {
print.setLevel2Type(library.getLevel2Type());
}
} else {
print.setLevel2Type(one.getLevel2Type());
}
print.setCreateDate(LocalDateTime.now()); print.setCreateDate(LocalDateTime.now());
designItemDetailPrintService.save(print); designItemDetailPrintService.save(print);
} }

View File

@@ -587,7 +587,7 @@ public class EmailServiceImpl implements EmailService {
try { try {
String merchantEmail = "kimwong@code-create.com.hk"; String merchantEmail = "kimwong@code-create.com.hk";
String developer = "xupei3360@163.com"; String developer = "xupei3360@163.com";
List<String> merchantReceiver = Arrays.asList(/*merchantEmail,*/ developer); List<String> merchantReceiver = Arrays.asList(merchantEmail, developer);
String merchantSubject = null; String merchantSubject = null;
String merchantTemplate = null; String merchantTemplate = null;
@@ -731,7 +731,7 @@ public class EmailServiceImpl implements EmailService {
jsonObject.put("quantity", quantity); jsonObject.put("quantity", quantity);
jsonObject.put("totalFee", amount); 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"; private final static String COMMON_EXCEPTION_REMINDER = "135279_common-exception-reminder.html";

View File

@@ -1060,11 +1060,12 @@ public class StripeServiceImpl implements StripeService {
String periodEnd = DateUtil.changeTimeStampFormat(subscriptionInfo.getCurrentPeriodEnd(), "seconds", CommonConstant.TIME_FORMAT_yyyy_MM_dd_HH_mm_ss); String periodEnd = DateUtil.changeTimeStampFormat(subscriptionInfo.getCurrentPeriodEnd(), "seconds", CommonConstant.TIME_FORMAT_yyyy_MM_dd_HH_mm_ss);
qwPI.lambda().eq(PaymentInfo::getOrderNo, subscriptionInfo.getOrderNo()) qwPI.lambda().eq(PaymentInfo::getOrderNo, subscriptionInfo.getOrderNo())
.eq(PaymentInfo::getTradeState, "paid")
.between(PaymentInfo::getCreateTime, periodStart, periodEnd) .between(PaymentInfo::getCreateTime, periodStart, periodEnd)
.orderByDesc(PaymentInfo::getId); .orderByDesc(PaymentInfo::getId);
List<PaymentInfo> paymentInfos = paymentInfoMapper.selectList(qwPI); List<PaymentInfo> paymentInfos = paymentInfoMapper.selectList(qwPI);
if (paymentInfos.isEmpty()) { if (paymentInfos.isEmpty()) {
log.info("不发送邮件原因【根据order_no:{},查询到的paymentInfos为空】", orderNo); log.info("不发送邮件原因【根据order_no:{},查询到的成功的paymentInfos为空】", orderNo);
return false; return false;
} }
PaymentInfo paymentInfo = paymentInfos.get(0); PaymentInfo paymentInfo = paymentInfos.get(0);

View File

@@ -1461,12 +1461,16 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
if (StringUtil.isNullOrEmpty(fluxResult)) { if (StringUtil.isNullOrEmpty(fluxResult)) {
toProductImageResult.setStatus("Fail"); toProductImageResult.setStatus("Fail");
toProductImageResultMapper.updateById(toProductImageResult); toProductImageResultMapper.updateById(toProductImageResult);
sortRank(toProductImageResult); if (toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) {
sortRank(toProductImageResult);
}
results.add(new MagicToolResultVO(taskId, "Fail")); results.add(new MagicToolResultVO(taskId, "Fail"));
} else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) { } else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) {
toProductImageResult.setStatus(fluxResult); toProductImageResult.setStatus(fluxResult);
toProductImageResultMapper.updateById(toProductImageResult); toProductImageResultMapper.updateById(toProductImageResult);
sortRank(toProductImageResult); if (fluxResult.equals("Fail") && toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) {
sortRank(toProductImageResult);
}
results.add(new MagicToolResultVO(taskId, fluxResult)); results.add(new MagicToolResultVO(taskId, fluxResult));
} else { } else {
results.add(processFluxResult(fluxResult, toProductImageResult, taskId, toProductImageRecord.getPrompt())); results.add(processFluxResult(fluxResult, toProductImageResult, taskId, toProductImageRecord.getPrompt()));

View File

@@ -2,7 +2,7 @@
#spring.profiles.active=test #spring.profiles.active=test
#<23><><EFBFBD><EFBFBD>application-prod<6F>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) #<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>) #<23><><EFBFBD><EFBFBD>application-dev<65>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
spring.profiles.active=dev #spring.profiles.active=dev

View File

@@ -27,9 +27,9 @@ paypal.webhook_id=1D107312EX592781K
##### Stripe ##### Stripe
# developer # developer
stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 #stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2
# dev 端点 # dev 端点
stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w #stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w
# local 端点 # local 端点
#stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm #stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm
@@ -43,8 +43,8 @@ stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w
#stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL #stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL
# kim - live # kim - live
#stripe.private-key=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 stripe.private-key=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
# prod 端点 # prod 端点
#stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11
# dev 端点 # dev 端点
#stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr #stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr