mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
【BUG】解决会员计算时,金额太大int类型装不下的问题
This commit is contained in:
parent
7ef329f57a
commit
2bca9ef490
@ -72,7 +72,7 @@ public class TradePriceCalculateRespBO {
|
||||
/**
|
||||
* 是否包邮
|
||||
*/
|
||||
private Boolean freeDelivery;
|
||||
private Boolean freeDelivery = false;
|
||||
|
||||
/**
|
||||
* 赠送的优惠劵
|
||||
|
@ -18,6 +18,8 @@ import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -171,7 +173,8 @@ public class TradeDiscountActivityPriceCalculator implements TradePriceCalculato
|
||||
if (discountPercent == null) {
|
||||
return 0;
|
||||
}
|
||||
Integer newPrice = price * discountPercent / 100;
|
||||
BigDecimal divide = new BigDecimal(price).multiply(new BigDecimal(discountPercent)).divide(new BigDecimal(100));
|
||||
Integer newPrice = divide.intValue();
|
||||
return price - newPrice;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user