فهرست منبع

Merge branch 'develop/v1.0' into master-test

tangxiangan 4 ماه پیش
والد
کامیت
bd5035dc6b

+ 1 - 1
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/client/AppStoreClient.java

@@ -38,7 +38,7 @@ public class AppStoreClient {
 
     private final RestTemplate restTemplate = new RestTemplate();
 
-    private AppStoreProperties properties;
+    private final AppStoreProperties properties;
 
     private final RabbitTemplate rabbitTemplate;
 

+ 1 - 1
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/AppStoreServiceImpl.java

@@ -70,7 +70,7 @@ public class AppStoreServiceImpl implements AppStoreService {
 
 
     private final EmailApi emailApi;
-    private AppStoreProperties properties;
+    private final AppStoreProperties properties;
     private static final RestTemplate restTemplate = new RestTemplate();
 
     @Value("${htmlToPdfUrl:http://139.196.160.101:3060/api/get-invoice}")

+ 10 - 3
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/PayCenterWebhookServiceImpl.java

@@ -432,12 +432,19 @@ public class PayCenterWebhookServiceImpl implements PayCenterWebhookService {
                         break;
                     }
                     BeanUtil.copyProperties(collect.get(0), userSubscriptionInfo1);
-                    Date date = new Date(nextBillingTime);
-                    userSubscriptionInfo1.setEndDate(date);
+                    // 获取当前时间
+                    Date currentDate = new Date();
+                    // 根据产品周期添加订阅信息记录的结束时间
+                    if (currentDate.compareTo(userSubscriptionInfo1.getEndDate()) < 0) {
+                        // 订阅未过期,设置结束时间为当前时间加产品周期
+                        currentDate = userSubscriptionInfo1.getEndDate();
+                    }
+                    Date endDate = getDateByCycle(currentDate, productVO.getCycle());
+                    userSubscriptionInfo1.setEndDate(endDate);
                     userSubscriptionInfoApi.update(userSubscriptionInfo1);
                     // 订阅过期信息
                     // 发送订阅过期消息
-                    SubscriptionUtil.subscriptionExpiredSendNews(rabbitTemplate, userSubscriptionInfo1.getId(), date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
+                    SubscriptionUtil.subscriptionExpiredSendNews(rabbitTemplate, userSubscriptionInfo1.getId(), endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
                 case "4":
                     // 订阅扣款失败,有延时队列暂不处理
                     log.info("订阅扣款失败,有延时队列暂不处理,thirdTradeId:{}", thirdTradeId);

+ 3 - 0
pdf-office-sso/src/main/java/cn/kdan/cloud/pdf/office/sso/service/impl/AuthServiceImpl.java

@@ -813,6 +813,9 @@ public class AuthServiceImpl implements AuthService {
         //获取用户存在redis中的登录邮箱验证码
         String captchaCode = redisUtils.hget(CommonConstant.EMAIL_VERIFY_CODE_KEY + type.value() + CommonConstant.STRING_SIGN_COLON + appId, account);
         if(StringUtils.isNotEmpty(code) && code.equals(captchaCode)){
+            if(type.value().equals("member_login")){
+                return;
+            }
             //验证通过删除
             redisUtils.hdel(CommonConstant.EMAIL_VERIFY_CODE_KEY + type.value() + CommonConstant.STRING_SIGN_COLON + appId, account);
         }else{