|
@@ -368,11 +368,13 @@ public class MercCouponFactoryBase extends ServiceImpl<MercCouponMapper, MercCou
|
|
|
BigDecimal zje = new BigDecimal(type1Amount);
|
|
|
|
|
|
BigDecimal zyh = new BigDecimal(priceOnsaleType1);
|
|
|
-
|
|
|
- Integer priceOnsale = promotionPriceOnsale.multiply(num).multiply(zyh).divide(zje).setScale(0, RoundingMode.CEILING).intValue();
|
|
|
- BigDecimal subtract = promotionPriceOnsale.subtract(new BigDecimal(priceOnsale)).divide(new BigDecimal(100)).multiply(new BigDecimal(goods.getInt("num")));
|
|
|
+
|
|
|
+ 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();
|
|
|
+
|
|
|
goods.set("priceOnsale", priceOnsale);
|
|
|
- goods.set("msg", goods.getString("msg") + "满减券减:" + subtract + "元;");
|
|
|
+ goods.set("msg", goods.getString("msg") + "满减券减:" + (goodsYh * 0.01) + "元;");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -380,4 +382,16 @@ public class MercCouponFactoryBase extends ServiceImpl<MercCouponMapper, MercCou
|
|
|
param.put("goodsList", goodsList);
|
|
|
return param;
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ int num = 2;
|
|
|
+ int zje = 425;
|
|
|
+ int price = 425;
|
|
|
+ int zyh = 200;
|
|
|
+
|
|
|
+ int i = (price * num / zje) * zyh;
|
|
|
+ System.out.println(i);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|