From 3b6a9882d2e0cc74a307687086a3e8d4c3c04e90 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Tue, 14 Oct 2025 18:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/config/MyTaskScheduler.java | 14 +++++++------- .../java/com/ai/da/common/task/AccountTask.java | 12 ++++++------ .../java/com/ai/da/common/task/GenerateTask.java | 4 ++-- .../java/com/ai/da/common/task/PaymentTask.java | 10 +++++----- .../java/com/ai/da/common/utils/SendEmailUtil.java | 12 ++++++------ .../ai/da/service/impl/AffiliateServiceImpl.java | 6 +++--- .../com/ai/da/service/impl/EmailServiceImpl.java | 4 ++-- src/main/resources/application.properties | 4 ++-- src/main/resources/payment.properties | 8 ++++---- 9 files changed, 37 insertions(+), 37 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 45e486e5..e709d0f8 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -164,7 +164,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<>(); @@ -200,7 +200,7 @@ public class MyTaskScheduler { } } } -// @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); @@ -1310,11 +1310,11 @@ public class MyTaskScheduler { public List getCollectionIdsByAccount(Long accountId) { // 查询该用户的所有 collectionId return sketchDataMapper.selectList( - new QueryWrapper() - .lambda() - .eq(SketchData::getAccountId, accountId) // 筛选用户 - .select(SketchData::getCollectionId) // 只查询 collectionId - ).stream() + new QueryWrapper() + .lambda() + .eq(SketchData::getAccountId, accountId) // 筛选用户 + .select(SketchData::getCollectionId) // 只查询 collectionId + ).stream() .map(SketchData::getCollectionId) .distinct() // 去重,确保 collectionId 唯一 .collect(Collectors.toList()); 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 00f691ae..00395c89 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -25,13 +25,13 @@ public class AccountTask { * 每个月月初只刷新教育子账号的积分 */ // @Scheduled(cron = "0 25 14 * * ?") -// @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 accountList = accountService.getExpiredUserBySystemUser(1); @@ -74,15 +74,15 @@ public class AccountTask { accountService.registerUserToVisitor(); } -// @Scheduled(cron = "0 0 0 1 * ?") + @Scheduled(cron = "0 0 0 1 * ?") // 每月初刷新所有用户用户名剩余修改次数 public void resetUsernameModifyTimes(){ log.info("重置所有用户的用户名修改次数"); redisUtil.batchDeleteKeysWithSamePrefix(RedisUtil.NICKNAME_MODIFY_TIMES); } -// @Scheduled(cron = "0 35 14 * * ?") -// @Scheduled(cron = "0 5 0 * * ?") + // @Scheduled(cron = "0 35 14 * * ?") + @Scheduled(cron = "0 5 0 * * ?") public void checkEduAdminExpireStatus() { accountService.checkEduAdminExpireStatus(); } diff --git a/src/main/java/com/ai/da/common/task/GenerateTask.java b/src/main/java/com/ai/da/common/task/GenerateTask.java index d80e8301..281ca082 100644 --- a/src/main/java/com/ai/da/common/task/GenerateTask.java +++ b/src/main/java/com/ai/da/common/task/GenerateTask.java @@ -47,7 +47,7 @@ public class GenerateTask { * 故这里通过定时任务做补偿 * flux五分钟查询一次,万相1小时查询一次 */ -// @Scheduled(cron = "0 */4 * * * ?") + @Scheduled(cron = "0 */4 * * * ?") public void fluxCompensationMechanism(){ // 1、查所有 任务还没成功、还没失败,正在等待或者执行中的任务id有哪些 // (由于获取结果的polling_url在redis中只存一天,大部分结果超过一天之后就无法再找到任务,小部分可以通过公共路径查到结果) @@ -107,7 +107,7 @@ public class GenerateTask { } // 万相 -> pose transformation 补偿 一小时执行一次 -// @Scheduled(fixedDelay = 5 * 60 * 1000) + @Scheduled(fixedDelay = 5 * 60 * 1000) public void wxCompensationMechanism(){ List apiGenerates = apiGenerateService.getPendingTaskByStatus("wx"); if (apiGenerates != null && !apiGenerates.isEmpty()){ 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 5e427114..9d7e6817 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,19 +97,19 @@ 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(); } // 定时同步(每分钟一次) -// @Scheduled(fixedRate = 60000) + @Scheduled(fixedRate = 60000) public void syncLinkViewCountToDB(){ affiliateService.syncLinkViewCountToDB(); } -// @Scheduled(cron = "0 0 8 28-31 * ?") + // @Scheduled(cron = "0 0 8 28-31 * ?") public void commissionSummaryReminder(){ // 每个月末的最后一天的早上八点执行 LocalDate today = LocalDate.now(); @@ -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(); 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 a313103c..061fe829 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -373,10 +373,10 @@ public class SendEmailUtil { } private final static Long UPGRADE_NOTIFICATION_ID = 146605L; -// private final static Long UPGRADE_NOTIFICATION_ID = 146551L; + // 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 = 146604L; -// private final static Long UPGRADE_NOTIFICATION_ID_CHINESE = 146552L; + // 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) { @@ -743,11 +743,11 @@ public class SendEmailUtil { }*/ private final static Long CANCEL_MERCHANT_EN = 130720L; -// private final static Long NEW_MERCHANT_EN = 130721L; + // private final static Long NEW_MERCHANT_EN = 130721L; // private final static Long NEW_USER_EN = 130722L; // private final static Long NEW_USER_CN = 130723L; private final static Long NEW_MERCHANT_EN = 140335L; -// private final static Long NEW_MERCHANT_EN = 135190L; + // private final static Long NEW_MERCHANT_EN = 135190L; // private final static Long NEW_USER_EN = 135189L; // private final static Long NEW_USER_CN = 135186L; private final static Long NEW_USER_EN = 140316L; @@ -766,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(); @@ -937,7 +937,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 867ec36c..8d535cbf 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; @@ -706,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"; 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