|
|
|
@@ -320,9 +320,14 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
int baseScore = busRule.getInteger(WxScoreRules.SCORE); // 消费增长积分 |
|
|
|
|
|
|
|
// 4. 计算成长值 |
|
|
|
Double dScoreT = Math.floor(order.getPayment() * 1.0D / priceCondition * baseScore); |
|
|
|
addScoreNumber = dScoreT.intValue(); |
|
|
|
logger.info("RULE:" + busRule.toJSONString() + "\nAddScore: " + addScoreNumber); |
|
|
|
if(order.getPayment() >= priceCondition.intValue()) { |
|
|
|
Double dScoreT = Math.floor(order.getPayment() * 1.0D / priceCondition * baseScore); |
|
|
|
addScoreNumber = dScoreT.intValue(); |
|
|
|
logger.info("RULE:" + busRule.toJSONString() + "\nAddScore: " + addScoreNumber); |
|
|
|
} else { |
|
|
|
logger.info("RULE:" + busRule.toJSONString() + "\nAddScore: 0, not touch score limit"); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
// 5. 增长的成长值 |
|
|
|
updateScore(order.getCUserId(), addScoreNumber); |
|
|
|
|