Browse Source

Merge branch 'dev_v1.3.4_20220914' of http://git.dayaedu.com/yonge/cooleshow into dev_v1.3.4_20220914

liujunchi 2 years ago
parent
commit
9e9015e711

+ 13 - 19
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ActivityPlanStandardServiceImpl.java

@@ -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);
                 }
-
             }
 
         }