Commit 86e0d0bb authored by zhangfeng's avatar zhangfeng

Merge branch 'refs/heads/feature_member_score_zhangfeng' into feature_member_score

parents bde1f4bc e78b1b1b
...@@ -290,19 +290,19 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy { ...@@ -290,19 +290,19 @@ public class OrderVStrategy extends AbstractScoreRuleStrategy {
* @return * @return
*/ */
private Integer computeScoreCount(BigDecimal weightOrVolume, List<ScoreRuleOrderVExtraVO.OrderVRule> orderVRules) { private Integer computeScoreCount(BigDecimal weightOrVolume, List<ScoreRuleOrderVExtraVO.OrderVRule> orderVRules) {
Integer scoreCount = 0; if (orderVRules.isEmpty()) {
int w = weightOrVolume.setScale(0, RoundingMode.HALF_UP).intValue(); return 0;
}
int wOrV = weightOrVolume.setScale(0, RoundingMode.HALF_UP).intValue();
ScoreRuleOrderVExtraVO.OrderVRule lastRule = orderVRules.get(orderVRules.size() - 1); ScoreRuleOrderVExtraVO.OrderVRule lastRule = orderVRules.get(orderVRules.size() - 1);
if (w >= lastRule.getHigh()) { if (wOrV >= lastRule.getHigh()) {
scoreCount = lastRule.getScore(); return lastRule.getScore();
} }
for (int i = orderVRules.size() - 1; i >= 0; i--) { for (ScoreRuleOrderVExtraVO.OrderVRule rule : orderVRules) {
ScoreRuleOrderVExtraVO.OrderVRule orderVRule = orderVRules.get(i); if (rule.getLow() <= wOrV && wOrV < rule.getHigh()) {
if (orderVRule.getLow() <= w && orderVRule.getHigh() >= w) { return rule.getScore();
scoreCount = orderVRule.getScore();
break;
} }
} }
return scoreCount; return 0;
} }
} }
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