|
@@ -128,31 +128,25 @@ public class ActivityPlanStandardServiceImpl extends ServiceImpl<ActivityPlanSta
|
|
|
// 用户信息
|
|
|
for (Map.Entry<Long, List<Long>> entry : userActiveTimeMap.entrySet()) {
|
|
|
|
|
|
- // 奖品信息
|
|
|
- for (ActivityPlanRewardDto item : activityPlanRewardDtos) {
|
|
|
+ if (ConditionMethodEnum.OR.equals(planStandard.getCalculationMethod())) {
|
|
|
|
|
|
- if (ConditionMethodEnum.OR.equals(planStandard.getCalculationMethod())) {
|
|
|
+ // 满足其一
|
|
|
+ long timestamp = entry.getValue().stream().mapToLong(Long::longValue).min().orElse(0L);
|
|
|
|
|
|
- // 满足其一
|
|
|
- long timestamp = entry.getValue().stream().mapToLong(Long::longValue).min().orElse(0L);
|
|
|
-
|
|
|
- if (timestamp > 0) {
|
|
|
- //给用户发奖
|
|
|
- sendUserReward(entry.getKey(), detail.getId(), new Date(timestamp), activityPlanRewardDtos);
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
+ if (timestamp > 0) {
|
|
|
+ //给用户发奖
|
|
|
+ sendUserReward(entry.getKey(), detail.getId(), new Date(timestamp), activityPlanRewardDtos);
|
|
|
+ }
|
|
|
|
|
|
- // 全部满足
|
|
|
- long timestamp = entry.getValue().stream().mapToLong(Long::longValue).max().orElse(0L);
|
|
|
+ } else {
|
|
|
|
|
|
- if (timestamp > 0 && entry.getValue().size() == conditionNum) {
|
|
|
+ // 全部满足
|
|
|
+ long timestamp = entry.getValue().stream().mapToLong(Long::longValue).max().orElse(0L);
|
|
|
|
|
|
- //给用户发奖
|
|
|
- sendUserReward(entry.getKey(), detail.getId(), new Date(timestamp), activityPlanRewardDtos);
|
|
|
- }
|
|
|
+ if (timestamp > 0 && entry.getValue().size() == conditionNum) {
|
|
|
+ //给用户发奖
|
|
|
+ sendUserReward(entry.getKey(), detail.getId(), new Date(timestamp), activityPlanRewardDtos);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|