Bladeren bron

Bug修复

tangxiangan 4 maanden geleden
bovenliggende
commit
0e353f8a13

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

@@ -90,9 +90,6 @@ public class GooglePayServiceImpl implements GooglePayService {
         }
         log.info("谷歌权益校验,用户id:{}", googlePayDTO.getUserId());
         SubscriptionPurchaseV3 subscriptionPurchaseV2 = this.verify(googlePayDTO.getPurchaseToken(),googlePayDTO.getPackageName());
-        if (subscriptionPurchaseV2.getTestPurchase() != null) {
-            throw new BackendRuntimeException(ExceptionEnum.EXCEPTION_COUPON_INVALID);
-        }
         // 获取票据订单信息
         if(ObjectUtils.isEmpty(subscriptionPurchaseV2.getExternalAccountIdentifiers())){
             throw new BackendRuntimeException(ExceptionEnum.EXCEPTION_MSG_GOOGLE_STORE_TRANSACTION_ID_VALIDATION_FAILED);

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

@@ -256,7 +256,16 @@ public class AuthServiceImpl implements AuthService {
                         .thenComparing(Comparator.comparingInt(UserSubscriptionInfoVO::getMaxDeviceNum).reversed()) // 如果优先级相同按max_device_num降序
                 )
                 .findFirst(); // 找到优先级最高的记录
-
+        if(activeSubscription.get().getStatus() == 2&&filteredList.size()>2){
+            Optional<UserSubscriptionInfoVO> activeSubscription1 =     filteredList.stream()
+                    .filter(user -> user.getStatus() == 1) // 过滤出 status = 1 的记录
+                    .sorted(Comparator.comparingInt(this::getLevelPriority)
+                            .reversed() // 按优先级降序排列
+                            .thenComparing(Comparator.comparingInt(UserSubscriptionInfoVO::getMaxDeviceNum).reversed()) // 如果优先级相同按 max_device_num 降序
+                    )
+                    .findFirst();
+            return activeSubscription1.orElse(null);
+        }
         return activeSubscription.orElse(null); // 返回结果,如果没有找到则返回null
     }