Kaynağa Gözat

Merge branch 'year_recharge_api' into pre

zoujiajian 1 ay önce
ebeveyn
işleme
fc507c88b8

+ 5 - 4
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -339,6 +339,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 					.gt(VipUser::getExpiryTime, now));
 			List<RenewalView> removeElements = null;
 			for (RenewalView ticket : list.getDataList()) {
+				ticket.setCanReceiveGptApiQuota(false);
 				if (ticket.getSkuId() == null || ticket.getGoodsId() == null) {
 					continue;
 				}
@@ -440,9 +441,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 						ticket.setIsComplete(orderDon.getStatus() == OrderDon.Status.complete ? true : false);
 					}
 				}
-                if (isGptApiQuotaSourceTicket(orderDon, ticket.getGoodsId(), ticket.getSkuNum())) {
-                    markGptApiQuotaReceiveStatus(userIds, ticket, orderDon);
-                }
+                markGptApiQuotaReceiveStatus(userIds, ticket, orderDon);
 				if (lang != null && !StrUtil.equals(UserPageLanguage.Language.zh_CN.name(), lang)) {
 					String languageSpecVal = backInfoTranslationsFrontService.getLanguageSpecVal(zhSkuId, lang);
 					if (StrUtil.isNotBlank(languageSpecVal)) {
@@ -597,7 +596,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private void markGptApiQuotaReceiveStatus(List<Long> userIds, RenewalView ticket, OrderDon sourceOrder) {
         boolean yearQuota = isYearRechargeSku(ticket.getGoodsId(), ticket.getMonths(), ticket.getSkuNum());
-        ticket.setCanReceiveGptApiQuota(!hasReceivedGptApiQuota(userIds, ticket.getGoodsId(), yearQuota)
+        // PLUS 仅 skuNum == 1 的独立规格可领;与实际领取接口共用资格校验。
+        ticket.setCanReceiveGptApiQuota(isGptApiQuotaSourceTicket(sourceOrder, ticket.getGoodsId(), ticket.getSkuNum())
+                && !hasReceivedGptApiQuota(userIds, ticket.getGoodsId(), yearQuota)
                 && (!yearQuota || hasNewGptApiQuotaPurchase(userIds, ticket.getGoodsId(), sourceOrder)));
 	}