|
@@ -505,12 +505,12 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
|
}
|
|
|
|
|
|
//消费者在页面录入的,要使用的积分
|
|
|
- Long payPoints = createReqVO.getPayIntegral();
|
|
|
+ BigDecimal payPoints = createReqVO.getPayIntegral();
|
|
|
|
|
|
if (payPoints == null) {
|
|
|
- payPoints = 0L;
|
|
|
+ payPoints = BigDecimal.valueOf(0);
|
|
|
} else {//把页面传入的,1积分=1元钱的积分,转换为后台保存到数据库的积分值
|
|
|
- payPoints = payPoints * DistriConstants.INTEGRAL_PAGE2DB;
|
|
|
+ payPoints = BigDecimal.valueOf(payPoints.longValue() * DistriConstants.INTEGRAL_PAGE2DB);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -519,7 +519,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
|
//计算订单含积分的各项商品价格
|
|
|
TradePriceCalculateRespBO tradePriceCalculateRespBO = calculatePriceWithPoints(userId, createReqVO);
|
|
|
//计算分摊的积分金额
|
|
|
- List<Integer> dividePoints = TradePriceCalculatorHelper.dividePrice(tradePriceCalculateRespBO.getItems(), integral2Money(payPoints));
|
|
|
+ List<Integer> dividePoints = TradePriceCalculatorHelper.dividePrice(tradePriceCalculateRespBO.getItems(), integral2Money(payPoints.longValue()));
|
|
|
//键为skuId,value为单个商品项信息
|
|
|
Map<Long, TradePriceCalculateRespBO.OrderItem> itemPayPointsMap = new HashMap<>();
|
|
|
|
|
@@ -636,7 +636,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
|
}
|
|
|
|
|
|
//如果订单有使用积分,则抵扣用户的积分。add by Ben
|
|
|
- if (payPoints > 0) {
|
|
|
+ if (payPoints.compareTo(BigDecimal.valueOf(0L)) >= 0) {
|
|
|
for (Map<String, Object> m : orderMapList) {
|
|
|
TradeOrderDO order = (TradeOrderDO) (m.get("order"));
|
|
|
Long tradeOrderId = order.getId();
|