| @@ -103,8 +103,4 @@ public class WxCreditHistory extends BaseTenantEntity { | |||||
| } | } | ||||
| return spendStr; | return spendStr; | ||||
| } | } | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否积分按照支付比例",name="isCreditByPamentRate") | |||||
| private boolean isCreditByPamentRate = true; | |||||
| } | } | ||||
| @@ -204,8 +204,4 @@ public class WxOrder extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="配送类型 0:默认(无) 1:自提 2:配送",name="shippingType") | @io.swagger.annotations.ApiModelProperty(value="配送类型 0:默认(无) 1:自提 2:配送",name="shippingType") | ||||
| private Integer shippingType; | private Integer shippingType; | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否积分按照支付比例",name="isCreditByPamentRate") | |||||
| private boolean isCreditByPamentRate = true; | |||||
| } | } | ||||
| @@ -316,7 +316,6 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| orderUpdate.setPayment(payment); | orderUpdate.setPayment(payment); | ||||
| }else if(coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_PRICE.getCode().intValue()){ | }else if(coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_PRICE.getCode().intValue()){ | ||||
| orderUpdate.setPayment(record.getDeductionAmount()); | orderUpdate.setPayment(record.getDeductionAmount()); | ||||
| orderUpdate.setCreditByPamentRate(false); | |||||
| } | } | ||||
| if (null != merchant) { | if (null != merchant) { | ||||
| wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, merchant.getBusinessId()); | wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, merchant.getBusinessId()); | ||||
| @@ -345,7 +344,6 @@ 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,12 +1038,8 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||||
| // 4. 计算积分 | // 4. 计算积分 | ||||
| if (record.getSpend() >= priceCondition.intValue()) { | if (record.getSpend() >= priceCondition.intValue()) { | ||||
| if (record.isCreditByPamentRate()) { | |||||
| Double dScoreT = Math.floor(record.getSpend() * 1.0D / priceCondition * baseScore); | |||||
| addCreditNumber = dScoreT.intValue(); | |||||
| }else { | |||||
| addCreditNumber = record.getSpend(); | |||||
| } | |||||
| Double dScoreT = Math.floor(record.getSpend() * 1.0D / priceCondition * baseScore); | |||||
| addCreditNumber = dScoreT.intValue(); | |||||
| 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"); | ||||
| @@ -380,12 +380,8 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| // 4. 计算成长值 | // 4. 计算成长值 | ||||
| if(order.getPayment() >= priceCondition.intValue()) { | if(order.getPayment() >= priceCondition.intValue()) { | ||||
| if (order.isCreditByPamentRate()) { | |||||
| Double dScoreT = Math.floor(order.getPayment() * 1.0D / priceCondition * baseScore); | |||||
| addScoreNumber = dScoreT.intValue(); | |||||
| }else { | |||||
| addScoreNumber = order.getPayment(); | |||||
| } | |||||
| Double dScoreT = Math.floor(order.getPayment() * 1.0D / priceCondition * baseScore); | |||||
| addScoreNumber = dScoreT.intValue(); | |||||
| logger.info("RULE:" + busRule.toJSONString() + "\nAddScore: " + addScoreNumber); | logger.info("RULE:" + busRule.toJSONString() + "\nAddScore: " + addScoreNumber); | ||||
| if (addScoreNumber == 0) { | if (addScoreNumber == 0) { | ||||
| return 0; | return 0; | ||||