|
@@ -92,6 +92,7 @@ public class PromotionFactoryBase extends ServiceImpl<PromotionMapper, Promotion
|
|
|
goods.set("havePromotion", false);
|
|
|
goods.set("promotionList", new ArrayList<Promotion>());
|
|
|
goods.set("priceOnsale", goods.get("price"));
|
|
|
+ goods.set("amount", goods.getInt("price") * goods.getInt("num"));
|
|
|
goods.set("msg", "");
|
|
|
}
|
|
|
param.set("goodsList", goodsList);
|
|
@@ -263,8 +264,9 @@ public class PromotionFactoryBase extends ServiceImpl<PromotionMapper, Promotion
|
|
|
//计算公式:(单价*数量/总金额*总优惠)
|
|
|
Integer goodsYh = promotionPriceOnsale.multiply(num).divide(zje, 2, BigDecimal.ROUND_HALF_UP).multiply(zyh).setScale(0, RoundingMode.CEILING).intValue();
|
|
|
|
|
|
- Integer priceOnsale = promotionPriceOnsale.multiply(num).subtract(new BigDecimal(goodsYh)).intValue();
|
|
|
+ Integer priceOnsale = promotionPriceOnsale.subtract(new BigDecimal(goodsYh).divide(num, 2, BigDecimal.ROUND_HALF_UP)).intValue();
|
|
|
goods.set("priceOnsale", priceOnsale);
|
|
|
+ goods.set("amount", goods.getInt("amount") - goodsYh);
|
|
|
goods.set("msg", goods.getString("msg") + "满减活动减:" + (goodsYh * 0.01) + "元;");
|
|
|
}
|
|
|
}
|