Commit a1903fc9 authored by jiaorz's avatar jiaorz

获取用户是否参加活动

parent 3ad83ec2
......@@ -43,22 +43,21 @@ public class ActivityPopularizeUserBiz extends BaseBiz<ActivityPopularizeUserMap
return map;
}
map.put("userId", userId);
Example example = new Example(ActivityPopularizeUser.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId", userId);
criteria.andIn("popularizeId", popularizeIds);
List<ActivityPopularizeUser> activityPopularizeUsers = mapper.selectByExample(example);
if (activityPopularizeUsers == null || activityPopularizeUsers.size() <= 0) {
return map;
}
List<Map<Integer, Boolean>> activityIds = Lists.newArrayList();
activityPopularizeUsers.parallelStream().forEach(result -> {
if (popularizeIds.contains(result.getPopularizeId())) {
Map<Integer, Boolean> map1 = Maps.newHashMap();
map1.put(result.getPopularizeId(), true);
activityIds.add(map1);
}
});
List<Map<Integer, Boolean>> activityIds = Lists.newArrayList();
popularizeIds.parallelStream().forEach(id -> {
Example example = new Example(ActivityPopularizeUser.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId", userId);
criteria.andEqualTo("popularizeId", popularizeIds);
ActivityPopularizeUser activityPopularizeUsers = mapper.selectOneByExample(example);
Map<Integer, Boolean> map1 = Maps.newHashMap();
if (activityPopularizeUsers != null) {
map1.put(id, true);
} else {
map1.put(id, false);
}
activityIds.add(map1);
});
map.put("popularizeIds", activityIds);
return map;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment