3 Commits 0414c5b9ec ... a00e140c0a

Author SHA1 Message Date
  tangxiangan a00e140c0a Merge branch 'develop/v1.0' into master-test 1 week ago
  tangxiangan 07867aea98 Bug修复 1 week ago
  Bob 720758952c 批量返回优惠价格 1 week ago

+ 6 - 1
pdf-office-pdf-website/src/main/java/cn/kdan/cloud/pdf/office/website/service/impl/ProductInfoServiceImpl.java

@@ -198,7 +198,7 @@ public class ProductInfoServiceImpl implements ProductInfoService {
             throw new BackendRuntimeException(ExceptionEnum.EXCEPTION_PRODUCT_NOT_EXIST);
         }
         // 目前只支持标准买断可以批量购买的阶梯价格 advanced-permanent
-        BigDecimal batchPrice, totalPrice, cnyBatchPrice, cnyTotalPrice;
+        BigDecimal batchPrice, totalPrice, cnyBatchPrice, cnyTotalPrice, discountPrice, cnyDiscountPrice;
         if ("advanced-permanent".equals(productVO.getCode())) {
             // 标准买断
             // 2-5	10% OFF	$107.99/个  ¥701.93/个
@@ -240,14 +240,19 @@ public class ProductInfoServiceImpl implements ProductInfoService {
         } else {
             throw new BackendRuntimeException(ExceptionEnum.EXCEPTION_PRODUCT_NOT_SUPPORT_BATCH);
         }
+        discountPrice = productVO.getPrice().multiply(BigDecimal.valueOf(num)).subtract(totalPrice);
+        cnyDiscountPrice = productVO.getCnyPrice().multiply(BigDecimal.valueOf(num)).subtract(cnyTotalPrice);
         Map<String, String> map = new HashMap<>();
         map.put("productId", productId);
+        map.put("num", String.valueOf(num));
         map.put("price", productVO.getPrice().toEngineeringString());
         map.put("cnyPrice", productVO.getCnyPrice().toEngineeringString());
         map.put("batchPrice", batchPrice.toEngineeringString());
         map.put("totalPrice", totalPrice.toEngineeringString());
+        map.put("discountPrice", discountPrice.toEngineeringString());
         map.put("cnyBatchPrice", cnyBatchPrice.toEngineeringString());
         map.put("cnyTotalPrice", cnyTotalPrice.toEngineeringString());
+        map.put("cnyDiscountPrice", cnyDiscountPrice.toEngineeringString());
         return map;
 
     }

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

@@ -273,9 +273,8 @@ public class AuthServiceImpl implements AuthService {
     public Boolean judgeActiveSubscription(List<UserSubscriptionInfoVO> subscriptionInfoList) {
         // 过滤掉isAi为true的记录
         List<UserSubscriptionInfoVO> filteredList = subscriptionInfoList.stream()
-                .filter(info -> info.getStatus() == 1 // 筛选出 status = 1 的记录
-                        && info.getPaymentModel().equals("1")
-                &&ObjectUtils.isEmpty(info.getIsAi())||ValidStatusEnum.INVALID.value().equals(info.getIsAi())) // 筛选出 paymentModel = 1 的记录
+                .filter(info -> info.getStatus() == 1)                          // 筛选 status = 1
+                .filter(info -> info.getPlatform()==2 && info.getAppId().equals("1"))               // 筛选 paymentModel = "1"// 筛选 isAi 为空
                 .collect(Collectors.toList());
         if (CollectionUtils.isEmpty(filteredList)){
             return false;