From 23b864d37897e674b0ad8f1c2db3234880665573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E4=BD=A9?= <1779019091@qq.com> Date: Sun, 1 Dec 2024 17:37:52 +0800 Subject: [PATCH 1/3] to prod --- .../java/com/ai/da/common/config/MyTaskScheduler.java | 4 ++-- src/main/java/com/ai/da/common/task/AccountTask.java | 8 ++++---- src/main/java/com/ai/da/common/task/PaypalTask.java | 2 +- src/main/java/com/ai/da/common/task/StripeTask.java | 2 +- src/main/resources/application.properties | 4 ++-- 5 files changed, 10 insertions(+), 10 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 61e964ea..95c55e9a 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -51,7 +51,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 qw = new QueryWrapper<>(); @@ -85,7 +85,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 c73f8b7f..6950878d 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -26,14 +26,14 @@ public class AccountTask { accountService.refreshCreditsWeekly(); } -// @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(); } // 每天凌晨0点执行一次 -// @Scheduled(cron = "0 0 0 * * ?") + @Scheduled(cron = "0 0 0 * * ?") public void cancelActivityBenefits() { // 1、查询当前所有参与了活动且过期的用户 List accountList = accountService.getExpiredUserBySystemUser(4); @@ -46,7 +46,7 @@ public class AccountTask { } // 每天检测正式用户到期情况,每天凌晨0点执行 -// @Scheduled(cron = "0 0 0 * * ?") + @Scheduled(cron = "0 0 0 * * ?") public void paidUserToVisitor() { // 1、查询当前已过期正式用户或试用用户 List accountList = accountService.getExpiredUserBySystemUser(1); @@ -63,7 +63,7 @@ public class AccountTask { /** * 将Code-Create上注册的用户添加为AiDA的游客 */ -// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes + @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes public void registerUserToVisitor() { accountService.registerUserToVisitor(); } diff --git a/src/main/java/com/ai/da/common/task/PaypalTask.java b/src/main/java/com/ai/da/common/task/PaypalTask.java index fa069971..865eaaa4 100644 --- a/src/main/java/com/ai/da/common/task/PaypalTask.java +++ b/src/main/java/com/ai/da/common/task/PaypalTask.java @@ -23,7 +23,7 @@ public class PaypalTask { @Resource private PayPalCheckoutService payPalCheckoutService; -// @Scheduled(cron = "0/30 * * * * ?") + @Scheduled(cron = "0/30 * * * * ?") public void orderConfirm() throws SerializeException { // log.info("PayPal orderConfirm 被执行......"); diff --git a/src/main/java/com/ai/da/common/task/StripeTask.java b/src/main/java/com/ai/da/common/task/StripeTask.java index d4a6fbaf..45d98997 100644 --- a/src/main/java/com/ai/da/common/task/StripeTask.java +++ b/src/main/java/com/ai/da/common/task/StripeTask.java @@ -22,7 +22,7 @@ public class StripeTask { @Resource private StripeService stripeService; -// @Scheduled(cron = "0/30 * * * * ?") + @Scheduled(cron = "0/30 * * * * ?") public void orderConfirm() throws SerializeException { // 查看超过30分钟以上仍未支付的订单 置为超时订单 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 From 1a568621cac14ebde7f475259930f2e2bbb3a179 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 3 Dec 2024 11:51:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?BUGFIX:=E9=87=8D=E5=A4=8D=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E8=AF=95=E7=94=A8;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/service/impl/AccountServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 1a07fb08..c0097b5c 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -538,7 +538,12 @@ public class AccountServiceImpl extends ServiceImpl impl // .like(TrialOrder::getUserName, accountTrialDTO.getUserName())); List trialOrders = trialOrderMapper.selectList(trialOrderQueryWrapper); if (CollectionUtil.isNotEmpty(trialOrders)) { - throw new BusinessException("You have submitted a trial application, please wait for approval."); + TrialOrder trialOrder = trialOrders.get(0); + if (trialOrder.getStatus() == 1) { + throw new BusinessException("You have submitted a trial application, please wait for approval."); + }else { + throw new BusinessException("You have already been approved for a trial, please do not apply for the trial again"); + } } // 先检测用户名和邮箱 QueryWrapper qw = new QueryWrapper<>(); From 3c0fa205d1e9b37e528386eddce0773216f7ea08 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 9 Dec 2024 18:17:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?BUGFIX:code-create=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E7=94=A8=E6=88=B7=E8=87=AA=E5=8A=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=BAaida=E7=9A=84=E6=B8=B8=E5=AE=A2,=E5=8E=BB?= =?UTF-8?q?=E9=87=8Dbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/service/impl/AccountServiceImpl.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index c0097b5c..3baf594a 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -1454,19 +1454,23 @@ public class AccountServiceImpl extends ServiceImpl impl queryWrapper.in("user_email", allEmail).select("user_email"); // 重复的邮箱 - List collect = baseMapper.selectList(queryWrapper).stream().map(Account::getUserEmail).collect(Collectors.toList()); - if (!collect.isEmpty()){ + List duplicateEmails = baseMapper.selectList(queryWrapper).stream().map(Account::getUserEmail).collect(Collectors.toList()); + if (!duplicateEmails.isEmpty()){ // 移除Code-Create新增用户中在AiDA已有账号的邮箱,allEmail中剩余邮箱均为新用户邮箱 - allEmail.removeAll(collect); + allEmail.removeIf(item -> duplicateEmails.stream() + .anyMatch(removeItem -> removeItem.equalsIgnoreCase(item))); if (!allEmail.isEmpty()){ - for (Map userInfo : newUsersInfo){ + Iterator> iterator = newUsersInfo.iterator(); + while (iterator.hasNext()) { + Map userInfo = iterator.next(); String email = userInfo.get("email"); if (!allEmail.contains(email)) { - newUsersInfo.remove(userInfo); // 移除不在 allEmail 中的用户 + iterator.remove(); // 使用迭代器安全地移除元素 } } + }else { + newUsersInfo.clear(); } - } // 将新增用户添加到AiDA,身份为游客 if (!newUsersInfo.isEmpty()){