|
@@ -165,6 +165,7 @@ public class PromotionFactoryBase extends ServiceImpl<PromotionMapper, Promotion
|
|
|
List<Object> promotionList1 = goods.getList("promotionList");
|
|
|
promotionList1.add(promotion);
|
|
|
goods.set("promotionList", promotionList1);
|
|
|
+ goods.set("amount", Integer.valueOf(promotionGoods.get("priceOnsale").toString()) * goods.getInt("num"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -202,9 +203,9 @@ public class PromotionFactoryBase extends ServiceImpl<PromotionMapper, Promotion
|
|
|
//设置优惠信息
|
|
|
BigDecimal scalar = new BigDecimal(priceJson.getStr("scalar"));
|
|
|
//优惠价格 向上取整
|
|
|
- int price = scalar.multiply(new BigDecimal(goods.getInt("price"))).setScale(0, RoundingMode.CEILING).intValue();
|
|
|
+ int price = scalar.multiply(goods.getBigDecimal("price")).setScale(0, RoundingMode.CEILING).intValue();
|
|
|
goods.set("priceOnsale", price);
|
|
|
-
|
|
|
+ goods.set("amount", scalar.multiply(goods.getBigDecimal("amount")).setScale(0, RoundingMode.CEILING).intValue());
|
|
|
goods.set("promotionType2", true);
|
|
|
goods.set("msg", "促销活动:" + priceJson.getStr("scalar").replace("0.", "") + "折;");
|
|
|
}
|