zoujiajian 11 months ago
parent
commit
ceede8e5cb

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

@@ -329,6 +329,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 					views.setSkuList(beanSearcher.searchAll(GoodsDonSkuFrontView.class, MapUtils.builder().field(GoodsDonSkuFrontView::getGoodsId, views.getId()).field(GoodsDonSkuFrontView::getStatus, true).build()));
 					ticket.setGoodsDonViews(views);
 				}
+				Date expiryTime = ticket.getExpiryTime();
 				if (ticket.getMonths() != null && ticket.getMonths() >= 300) {
 					ticket.setExpiryTime(null);
 				}
@@ -438,7 +439,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 						ticket.setReceivedGptGift(count.intValue() > 0);
 					}
 				}
-				markVipDeductTicket(userIds, ticket, vipGoodsIds, vipUserCount > 0);
+				markVipDeductTicket(userIds, ticket, vipGoodsIds, vipUserCount > 0, expiryTime);
 			});
 		}
 		userLoginRecordService.saveUserLoginDayRecord(userId);
@@ -2154,7 +2155,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 	/**
 	 * 标记是否可抵扣会员车票
 	 */
-	private void markVipDeductTicket(List<Long> userIds, RenewalView ticket, Set<Long> vipGoodsIds, Boolean isVip) {
+	private void markVipDeductTicket(List<Long> userIds, RenewalView ticket, Set<Long> vipGoodsIds, Boolean isVip, Date expiryTime) {
 		if (CollUtil.isNotEmpty(vipGoodsIds) && ticket.getIsMirror() != null && ticket.getIsMirror() && !isVip) {
 			Long goodsId = ticket.getGoodsId();
 			//只购买
@@ -2167,7 +2168,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 						.field(RenewalView::getRelationId, ticket.getRelationId()).op(Operator.NotEqual)
 						.field(RenewalView::getGoodsId, goodsId)
 						.field(RenewalView::getUserId, userIds).op(Operator.InList)
-						.field(RenewalView::getExpiryTime, ticket.getExpiryTime()).op(Operator.GreaterThan)
+						.field(RenewalView::getExpiryTime, expiryTime).op(Operator.GreaterThan)
 						.build());
 				if (number.intValue() == 0) {
 					ticket.setIsVipDeduct(true);