예제 #1
0
 public boolean executeReward(Rule rule, EsOrderInfoBean bean) {
   boolean succeed = false;
   // 只有达到奖励区间条件时,并且没有超过奖励限制,才享受奖励规则
   if (rule != null && rule.isValid() && rule.isSatisfied()) {
     succeed = rewardable.executeReward(bean, rule, this);
   }
   return succeed;
 }
예제 #2
0
 @Override
 public String toString() {
   final StringBuilder sb =
       new StringBuilder(
           rewardable.getClass().getSimpleName() + "{" + getRewardType() + "@" + getId());
   sb.append(", ruleId='").append(getRuleId()).append('\'');
   if (getRewardValue() != null) {
     sb.append(", value=").append(getRewardValue());
   }
   if (getRewardProduct() != null) {
     sb.append(", productId='").append(getRewardProduct()).append('\'');
   }
   sb.append(
       ", cur/max@per="
           + getCurrentRewards()
           + "/"
           + getMaxRewards()
           + "@"
           + getRewardsPerPerson());
   sb.append('}');
   return sb.toString();
 }