zoujiajian 1 éve
szülő
commit
4ed570602f

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java

@@ -97,5 +97,5 @@ public interface GroupRelationFrontService {
 	 */
 	Long getTicket(Long userId, Long skuId, Boolean isVip);
 
-	void getVipMirrorTicketIfEmpty(long userId, Long skuId);
+	Boolean getVipMirrorTicketIfEmpty(long userId, Long skuId);
 }

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

@@ -1372,11 +1372,11 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 	}
 
 	@Override
-	public void getVipMirrorTicketIfEmpty(long userId, Long skuId) {
+	public Boolean getVipMirrorTicketIfEmpty(long userId, Long skuId) {
 		Integer selectCount = vipGoodsSkuMapper.selectCount(Wrappers.lambdaQuery(VipGoodsSku.class)
 				.eq(VipGoodsSku::getSkuId, skuId));
 		if (selectCount == 0) {
-			return;
+			return false;
 		}
 		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
 		VipUser vipUser = vipUserMapper.selectOne(Wrappers.lambdaQuery(VipUser.class)
@@ -1385,7 +1385,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				.last("limit 1"));
 		//不是会员 或已到期
 		if (vipUser == null) {
-			return;
+			return false;
 		}
 		Number number = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder()
 				.field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
@@ -1399,7 +1399,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 					.set(GroupsRelation::getExpiryTime, vipUser.getExpiryTime())
 					.eq(GroupsRelation::getUserId, vipUser.getUserId())
 					.eq(GroupsRelation::getId, relationId));
+			return true;
 		}
+		return false;
 	}
 
 	private DistributePosterGoodsDetailView setGoodsPoster(RenewalView ticket, User user, List<Long> userIds) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -301,7 +301,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
 		//是否是会员
 		VipUser vipUser = vipUserMapper.selectOne(Wrappers.lambdaQuery(VipUser.class)
-				.eq(VipUser::getUserId, userId)
+				.in(VipUser::getUserId, userIdList)
 				.gt(VipUser::getExpiryTime, DateTime.now())
 				.last("limit 1"));
 		if (vipUser != null) {

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -1226,9 +1226,9 @@ public class GroupRelationController {
      * 若VIP用户 未有镜像车票自动获取
      */
     @GetMapping("/get/vip/mirror/ticket")
-    public Result<String> getVipMirrorTicketIfEmpty(Long skuId) {
+    public Result<Boolean> getVipMirrorTicketIfEmpty(Long skuId) {
         long userId = StpUtil.getLoginIdAsLong();
-        groupRelationFrontService.getVipMirrorTicketIfEmpty(userId, skuId);
-        return GatewayResponse.SUCCESS.newBuilder().toResult();
+        Boolean flag = groupRelationFrontService.getVipMirrorTicketIfEmpty(userId, skuId);
+        return GatewayResponse.SUCCESS.newBuilder().toResult(flag);
     }
 }