|
@@ -89,7 +89,8 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
|
|
|
* 设置活动价格阶梯
|
|
|
*/
|
|
|
@Override
|
|
|
- public void setPrice(CartProductVo product, Integer userId, Integer collageFlag) {// 活动id
|
|
|
+ public void setPrice(CartProductVo product, Integer userId, Integer collageFlag) {
|
|
|
+ // 活动id
|
|
|
Integer activityId = productMapper.getActivityIdByProductId(product.getProductId());
|
|
|
// 拼团商品
|
|
|
CmHeheCollageProductPo collageProduct = productMapper.findCollageProduct(product.getProductId());
|
|
@@ -121,7 +122,7 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
|
|
|
Integer discount = productMapper.findProductDiscount(product.getProductId(), userId);
|
|
|
if (null != discount && discount > 0) {
|
|
|
product.setPrice(MathUtil.div(MathUtil.mul(product.getPrice(), discount), 100, 2));
|
|
|
- if (null != product.getNormalPrice()) {
|
|
|
+ if (product.getNormalPrice().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
product.setNormalPrice(MathUtil.div(MathUtil.mul(product.getNormalPrice(), discount), 100, 2));
|
|
|
}
|
|
|
if (null != ladderList) {
|
|
@@ -135,7 +136,7 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
|
|
|
BigDecimal addedValueTax = MathUtil.div(MathUtil.mul(product.getPrice(), product.getClubTaxPoint()), BigDecimal.valueOf(100), 2);
|
|
|
BigDecimal price = MathUtil.add(product.getPrice(), addedValueTax);
|
|
|
product.setPrice(price);
|
|
|
- if (null != product.getNormalPrice()) {
|
|
|
+ if (product.getNormalPrice().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
addedValueTax = MathUtil.div(MathUtil.mul(product.getNormalPrice(), product.getClubTaxPoint()), BigDecimal.valueOf(100), 2);
|
|
|
price = MathUtil.add(product.getNormalPrice(), addedValueTax);
|
|
|
product.setNormalPrice(price);
|
|
@@ -191,6 +192,15 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
|
|
|
product.setCouponInfo("券|满" + smallestCoupon.getTouchPrice() + "元减" + smallestCoupon.getCouponAmount());
|
|
|
}
|
|
|
}
|
|
|
+ if (1 == product.getActiveStatus() || 1 == product.getCollageStatus() || 1 == product.getDiscountStatus()) {
|
|
|
+ if (product.getPrice().compareTo(product.getNormalPrice()) == 0) {
|
|
|
+ // 原价与售价相同,不显示原价
|
|
|
+ product.setNormalPrice(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ } else if (product.getCouponPrice().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ // 不参与任何活动且未使用优惠券,不显示原价
|
|
|
+ product.setNormalPrice(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|