|
@@ -96,7 +96,23 @@ public class PriceUtilService {
|
|
|
price.setOriginalPrice(price.getPrice());
|
|
|
//税费标志
|
|
|
boolean taxFlag = "0".equals(price.getIncludedTax()) && ("1".equals(price.getInvoiceType()) || "2".equals(price.getInvoiceType()));
|
|
|
- if (null != promotions) {
|
|
|
+ if (1 == price.getSvipProductFlag()) {
|
|
|
+ // 超级会员优惠商品,不参与促销活动(普通机构购买该商品可参与店铺促销)/阶梯价/复购价
|
|
|
+ price.setLadderPriceFlag(0);
|
|
|
+ if (1 == price.getSvipPriceType()) {
|
|
|
+ // 折扣价
|
|
|
+ price.setSvipPriceTag(MathUtil.div(price.getSvipDiscount(), 10, 1) + "折");
|
|
|
+ } else if (2 == price.getSvipPriceType()) {
|
|
|
+ // 直接优惠价
|
|
|
+ BigDecimal svipDiscountPrice = price.getSvipDiscountPrice();
|
|
|
+ if (taxFlag) {
|
|
|
+ //添加税费
|
|
|
+ BigDecimal thisTaxFee = MathUtil.div(MathUtil.mul(svipDiscountPrice, price.getTaxRate()), 100, 2);
|
|
|
+ svipDiscountPrice = MathUtil.add(svipDiscountPrice, thisTaxFee);
|
|
|
+ }
|
|
|
+ price.setSvipPriceTag("¥" + svipDiscountPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ }
|
|
|
+ } else if (null != promotions) {
|
|
|
// 促销活动
|
|
|
price.setActStatus(1);
|
|
|
price.setLadderPriceFlag(0);
|
|
@@ -142,7 +158,9 @@ public class PriceUtilService {
|
|
|
//添加税费
|
|
|
if (taxFlag) {
|
|
|
BigDecimal thisTaxFee = MathUtil.div(MathUtil.mul(price.getPrice(), price.getTaxRate()), 100, 2);
|
|
|
+ BigDecimal originalTaxFee = MathUtil.div(MathUtil.mul(price.getPrice(), price.getTaxRate()), 100, 2);
|
|
|
price.setPrice(MathUtil.add(price.getPrice(), thisTaxFee).doubleValue());
|
|
|
+ price.setOriginalPrice(MathUtil.add(price.getOriginalPrice(), originalTaxFee).doubleValue());
|
|
|
}
|
|
|
} else {
|
|
|
price.setPrice(0d);
|
|
@@ -189,6 +207,8 @@ public class PriceUtilService {
|
|
|
product.setUserIdentity(price.getUserIdentity());
|
|
|
product.setRepurchaseFlag(price.getRepurchaseFlag());
|
|
|
product.setMaxBuyNumber(price.getMaxBuyNumber());
|
|
|
+ product.setSvipProductFlag(price.getSvipProductFlag());
|
|
|
+ product.setSvipPriceTag(price.getSvipPriceTag());
|
|
|
List<LadderPriceVo> ladderPrices = priceMapper.getLadderPricesByProductId(product.getProductId());
|
|
|
TaxVo tax = priceMapper.getTaxByProductId(product.getProductId());
|
|
|
if (!CollectionUtils.isEmpty(ladderPrices)) {
|