|
|
@@ -565,14 +565,16 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if (integralMax.intValue() > 0 && Double.compare(userIntegral, integralMax) >= 0) {
|
|
|
userIntegral = integralMax;
|
|
|
}
|
|
|
- deductionPrice = BigDecimal.valueOf(NumberUtil.mul(userIntegral, integralRatio));
|
|
|
- if (deductionPrice.compareTo(payPrice) < 0) {
|
|
|
- payPrice = NumberUtil.sub(payPrice, deductionPrice);
|
|
|
+ BigDecimal integralDeduction = BigDecimal.valueOf(NumberUtil.mul(userIntegral, integralRatio));
|
|
|
+ if (integralDeduction.compareTo(payPrice) < 0) {
|
|
|
+ payPrice = NumberUtil.sub(payPrice, integralDeduction);
|
|
|
+ deductionPrice = deductionPrice.add(integralDeduction);
|
|
|
usedIntegral = userIntegral;
|
|
|
} else {
|
|
|
- deductionPrice = payPrice;
|
|
|
+ integralDeduction = payPrice;
|
|
|
payPrice = BigDecimal.ZERO;
|
|
|
- usedIntegral = NumberUtil.round(NumberUtil.div(deductionPrice,
|
|
|
+ deductionPrice = deductionPrice.add(integralDeduction);
|
|
|
+ usedIntegral = NumberUtil.round(NumberUtil.div(integralDeduction,
|
|
|
BigDecimal.valueOf(integralRatio)), 2).doubleValue();
|
|
|
}
|
|
|
}
|
|
|
@@ -587,6 +589,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if (couponUser != null && couponUser.getStatus() == 0) {
|
|
|
if (couponUser.getUseMinPrice().compareTo(priceGroup.getTotalPrice()) == -1) {
|
|
|
payPrice = payPrice.subtract(couponUser.getCouponPrice());
|
|
|
+ deductionPrice = deductionPrice.add(couponUser.getCouponPrice());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -597,6 +600,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if (deductionCouponUser != null && deductionCouponUser.getStatus() == 0) {
|
|
|
if (deductionCouponUser.getUseMinPrice().compareTo(priceGroup.getTotalPrice()) == -1) {
|
|
|
payPrice = payPrice.subtract(deductionCouponUser.getCouponPrice());
|
|
|
+ deductionPrice = deductionPrice.add(deductionCouponUser.getCouponPrice());
|
|
|
}
|
|
|
}
|
|
|
}
|