tangxiangan 4 mēneši atpakaļ
vecāks
revīzija
94c9c49f77

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

@@ -61,11 +61,10 @@ public class OrderGiftLogServiceImpl extends ServiceImpl<OrderGiftLogMapper, Ord
     }
 
     @Override
-    public void expire(String orderGiftLogId) {
-        this.update(Wrappers.<OrderGiftLog>lambdaUpdate().set(OrderGiftLog::getValidFlag, OrderGiftLogVaildFlagEnum.RECEIVE_FAIL.getCode()).eq(OrderGiftLog::getId, orderGiftLogId));
-        OrderGiftLog log1 = this.getById(orderGiftLogId);
+    public void expire(String orderGiftId) {
+        this.update(Wrappers.<OrderGiftLog>lambdaUpdate().set(OrderGiftLog::getValidFlag, OrderGiftLogVaildFlagEnum.RECEIVE_FAIL.getCode()).eq(OrderGiftLog::getOrderGiftId, orderGiftId));
         //并且更新orderGift表中对应记录的validFlag
-        orderGiftMapper.update(null, Wrappers.<OrderGift>lambdaUpdate().set(OrderGift::getValidFlag, OrderGiftVaildFlagEnum.GIFT_ABLE.getCode()).eq(OrderGift::getId, log1.getOrderGiftId()));
+        orderGiftMapper.update(null, Wrappers.<OrderGift>lambdaUpdate().set(OrderGift::getValidFlag, OrderGiftVaildFlagEnum.GIFT_ABLE.getCode()).eq(OrderGift::getId, orderGiftId));
     }
     //接收会员
     @Override

+ 1 - 1
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/webhook/GoogleWebhookMonitor.java

@@ -118,7 +118,7 @@ public class GoogleWebhookMonitor {
             return ResponseEntity.status(HttpStatus.OK).build(); // 返回 200 OK
 
         } catch (Exception e) {
-            log.error("谷歌 回调失败:" + e.getMessage() + "purchaseToken:{}");
+            log.error("谷歌 回调失败:" + e.getMessage() + "purchaseToken:{}", body);
             return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build(); // 返回 500 错误
         }
     }

+ 6 - 2
pdf-office-pdf-website/src/main/java/cn/kdan/cloud/pdf/office/website/controller/AIController.java

@@ -162,10 +162,14 @@ public class AIController {
         Optional<UserSubscriptionInfoVO> activeUserSubscriptionInfoVO = voList.stream()
                 .filter(vo -> {
                     // Check if 'isAi' is not empty
-                    return !ObjectUtils.isEmpty(vo.getIsAi()) &&
-                            vo.getStatus().equals(PDFOfficeUserSubscriptionStatusEnum.SUBSCRIPTION_IN_PROGRESS.value());
+                    return !ObjectUtils.isEmpty(vo.getIsAi()) ;
                 })
                 .findFirst(); // Get the first matching VO
+        // Check if
+        if (!activeUserSubscriptionInfoVO.isPresent()) {
+            throw new RuntimeException("No AI subscription found for user: " + userId);
+        }
+        // Get the first matching VO from the list (should be the only one) and return it as the active subscription info.
         UserSubscriptionInfoVO userSubscriptionInfoVO = activeUserSubscriptionInfoVO.get();
         return userSubscriptionInfoVO;
     }

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

@@ -832,7 +832,7 @@ public class AuthServiceImpl implements AuthService {
     @Override
     public void isEmailCodeValid(EmailCodeTypeEnum type, String account, String code, String appId) {
         //获取用户存在redis中的登录邮箱验证码
-        String captchaCode = redisUtils.hget(CommonConstant.EMAIL_VERIFY_CODE_KEY + type.value() + CommonConstant.STRING_SIGN_COLON + appId, account.toUpperCase());
+        String captchaCode = redisUtils.hget(CommonConstant.EMAIL_VERIFY_CODE_KEY + type.value() + CommonConstant.STRING_SIGN_COLON + appId, account.toLowerCase());
         if(StringUtils.isNotEmpty(code) && !code.equals(captchaCode)){
             throw new BackendRuntimeException(ExceptionEnum.EMAIL_VERIFY_CODE_KEY_ERROR);
         }