From 981fc35be4562c827861b4f5e713e7d3a4ee1df0 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 13 Apr 2026 18:04:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?BUGFIX:design=20=E6=B2=A1=E6=9C=89=E4=BD=BF?= =?UTF-8?q?=E7=94=A8printboard=E4=B8=AD=E7=9A=84=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/service/impl/CollectionElementServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index 87a246e5..1f34afc7 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -524,7 +524,7 @@ public class CollectionElementServiceImpl extends ServiceImpl Date: Mon, 13 Apr 2026 22:05:31 +0800 Subject: [PATCH 2/4] TO PROD --- .../java/com/ai/da/common/config/MyTaskScheduler.java | 2 +- src/main/java/com/ai/da/common/task/AccountTask.java | 2 +- src/main/java/com/ai/da/common/task/PaymentTask.java | 6 +++--- .../com/ai/da/common/task/SubscriptionReminderTask.java | 4 ++-- src/main/java/com/ai/da/common/utils/SendEmailUtil.java | 4 ++-- .../java/com/ai/da/service/impl/AffiliateServiceImpl.java | 4 ++-- .../java/com/ai/da/service/impl/EmailServiceImpl.java | 4 ++-- src/main/resources/application.properties | 4 ++-- src/main/resources/payment.properties | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index f7c10bcc..4b0d11f1 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -202,7 +202,7 @@ public class MyTaskScheduler { } } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); diff --git a/src/main/java/com/ai/da/common/task/AccountTask.java b/src/main/java/com/ai/da/common/task/AccountTask.java index e0d90480..f8f05c53 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -34,7 +34,7 @@ public class AccountTask { 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(); diff --git a/src/main/java/com/ai/da/common/task/PaymentTask.java b/src/main/java/com/ai/da/common/task/PaymentTask.java index e63e9388..9947545b 100644 --- a/src/main/java/com/ai/da/common/task/PaymentTask.java +++ b/src/main/java/com/ai/da/common/task/PaymentTask.java @@ -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 被执行......"); @@ -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(){ // log.info("佣金计算定时器"); affiliateService.updateAffiliateInfoWithPayment(); @@ -109,7 +109,7 @@ public class PaymentTask { affiliateService.syncLinkViewCountToDB(); } - // @Scheduled(cron = "0 0 8 28-31 * ?") + @Scheduled(cron = "0 0 8 28-31 * ?") public void commissionSummaryReminder(){ // 每个月末的最后一天的早上八点执行 LocalDate today = LocalDate.now(); diff --git a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java index 26478270..0dc60bc3 100644 --- a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java +++ b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java @@ -40,7 +40,7 @@ public class SubscriptionReminderTask { REMINDER_DAYS_CONFIG.put("year", 14); } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void subscriptionReminder() { // 获取所有需要通知的订阅 List subscriptionInfos = getDueSubscriptions(); @@ -97,7 +97,7 @@ public class SubscriptionReminderTask { return subscriptionInfoMapper.selectList(qw); } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void trialReminder() { // 今天的 00:00:00 和 23:59:59 LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay(); diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 2d7a9e74..dcdeb4bd 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -767,7 +767,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(); @@ -968,7 +968,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); diff --git a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java index 853f7824..c80a0f5d 100644 --- a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java @@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl merchantReceiver = Arrays.asList(/*merchantEmail,*/ developer); + List merchantReceiver = Arrays.asList(merchantEmail, developer); String merchantSubject = null; String merchantTemplate = null; @@ -731,7 +731,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"; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 974fee23..8550475d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,7 +2,7 @@ #spring.profiles.active=test #����application-prod�ļ�(��������) -#spring.profiles.active=prod +spring.profiles.active=prod #����application-dev�ļ�(��������) -spring.profiles.active=dev +#spring.profiles.active=dev diff --git a/src/main/resources/payment.properties b/src/main/resources/payment.properties index 0f2800d6..f4b98130 100644 --- a/src/main/resources/payment.properties +++ b/src/main/resources/payment.properties @@ -27,9 +27,9 @@ paypal.webhook_id=1D107312EX592781K ##### Stripe # developer -stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 +#stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 # dev 端点 -stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w +#stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w # local 端点 #stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm @@ -43,8 +43,8 @@ stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w #stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL # kim - live -#stripe.private-key=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 +stripe.private-key=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 # prod 端点 -#stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 +stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 # dev 端点 #stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr From b66877425e84dbb153f67b5b3bf066b20f6706e8 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 21 Apr 2026 17:33:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?BUGFIX:=E4=B8=BA=E4=B8=8B=E8=BD=BDflux?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=B7=BB=E5=8A=A0=E9=87=8D=E8=AF=95=E6=9C=BA?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/GenerateServiceImpl.java | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index d23c7b6b..bbf5111d 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -3934,11 +3934,48 @@ public class GenerateServiceImpl extends ServiceImpl i } public byte[] downloadVideoOrImage(String url) { - try (CloseableHttpClient client = HttpClients.createDefault(); - InputStream in = client.execute(new HttpGet(url)).getEntity().getContent()) { - return IOUtils.toByteArray(in); - } catch (IOException e) { - throw new RuntimeException(e); + int maxRetries = 3; + int retryDelayMs = 1000; + IOException lastException = null; + + for (int attempt = 1; attempt <= maxRetries; attempt++) { + try { + return downloadWithTimeout(url, 30000, 60000); + } catch (IOException e) { + lastException = e; + log.warn("下载失败 (尝试 {}/{}): {}", attempt, maxRetries, e.getMessage()); + + if (attempt < maxRetries) { + try { + Thread.sleep((long) retryDelayMs * attempt); // 递增延迟 + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + throw new RuntimeException(ie); + } + } + } + } + + throw new RuntimeException("下载失败,已重试 " + maxRetries + " 次", lastException); + } + + private byte[] downloadWithTimeout(String url, int connectTimeout, int socketTimeout) throws IOException { + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(connectTimeout) + .setSocketTimeout(socketTimeout) + .setConnectionRequestTimeout(connectTimeout) + .build(); + + try (CloseableHttpClient client = HttpClients.custom() + .setDefaultRequestConfig(requestConfig) + .build(); + CloseableHttpResponse response = client.execute(new HttpGet(url))) { + + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + throw new IOException("HTTP Error: " + statusCode); + } + return IOUtils.toByteArray(response.getEntity().getContent()); } } From 65cde0b8f5b40483360b5754fa7fe2494f4030cb Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 28 Apr 2026 13:11:57 +0800 Subject: [PATCH 4/4] =?UTF-8?q?TASK:admin-organization=20plan=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/model/vo/QueryUserConditionsVO.java | 4 ++++ .../ai/da/service/impl/ConvenientInquiryServiceImpl.java | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java b/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java index 852ca839..2f0b0b13 100644 --- a/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java +++ b/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java @@ -34,4 +34,8 @@ public class QueryUserConditionsVO extends PageQueryBaseVo { private Integer systemUser; + private Long subscriptionPlanId; + + private Long organizationId; + } diff --git a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java index 62b6d62b..69860284 100644 --- a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java @@ -787,6 +787,14 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl