| @@ -103,4 +103,8 @@ public class WxCreditHistory extends BaseTenantEntity { | |||||
| } | } | ||||
| return spendStr; | return spendStr; | ||||
| } | } | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否积分按照支付比例",name="isCreditByPamentRate") | |||||
| private boolean isCreditByPamentRate = true; | |||||
| } | } | ||||
| @@ -341,6 +341,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| creditHistory.setSpend(payment); | creditHistory.setSpend(payment); | ||||
| }else if(coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_PRICE.getCode().intValue()){ | }else if(coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_PRICE.getCode().intValue()){ | ||||
| creditHistory.setSpend(record.getDeductionAmount()); | creditHistory.setSpend(record.getDeductionAmount()); | ||||
| creditHistory.setCreditByPamentRate(false); | |||||
| } | } | ||||
| //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 | ||||
| creditHistory.setMerchantId(record.getMerchantId()); | creditHistory.setMerchantId(record.getMerchantId()); | ||||
| @@ -1038,8 +1038,12 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||||
| // 4. 计算积分 | // 4. 计算积分 | ||||
| if (record.getSpend() >= priceCondition.intValue()) { | if (record.getSpend() >= priceCondition.intValue()) { | ||||
| Double dScoreT = Math.floor(record.getSpend() * 1.0D / priceCondition * baseScore); | |||||
| addCreditNumber = dScoreT.intValue(); | |||||
| if (record.isCreditByPamentRate()) { | |||||
| Double dScoreT = Math.floor(record.getSpend() * 1.0D / priceCondition * baseScore); | |||||
| addCreditNumber = dScoreT.intValue(); | |||||
| }else { | |||||
| addCreditNumber = record.getSpend(); | |||||
| } | |||||
| log.info("CREDIT:" + busRule.toJSONString() + "\nAddCredit: " + addCreditNumber); | log.info("CREDIT:" + busRule.toJSONString() + "\nAddCredit: " + addCreditNumber); | ||||
| } else { | } else { | ||||
| log.info("CREDIT:" + busRule.toJSONString() + "\nAddCredit: 0, not touch credit limit"); | log.info("CREDIT:" + busRule.toJSONString() + "\nAddCredit: 0, not touch credit limit"); | ||||