|
@@ -132,8 +132,6 @@ public class PriceUtilService {
|
|
|
boolean setFlag = identity == 1 || priceFlag == 0 || (priceFlag == 3 && clubType == 1) || (priceFlag == 2 && (identity == 2 || isSuperVip)) || isShopOwn;
|
|
|
|
|
|
List<Sku> skus = priceMapper.findSkus(price.getProductId());
|
|
|
- AtomicDouble atomicDouble = new AtomicDouble();
|
|
|
- atomicDouble.set(skus.get(0).getPrice());
|
|
|
int size = skus.size();
|
|
|
//税费标志
|
|
|
boolean taxFlag = "0".equals(price.getIncludedTax()) && ("1".equals(price.getInvoiceType()) || "2".equals(price.getInvoiceType()));
|
|
@@ -145,6 +143,7 @@ public class PriceUtilService {
|
|
|
price.setUnit(skus.get(0).getUnit());
|
|
|
price.setStock(skus.get(0).getStock());
|
|
|
skus.forEach(s -> {
|
|
|
+ s.setOriginalPrice(s.getPrice());
|
|
|
s.setPriceGrade(getPriceGrade(s.getPrice()));
|
|
|
if (1 == price.getSvipProductFlag()) {
|
|
|
// 超级会员优惠商品,不参与促销活动(普通机构购买该商品可参与店铺促销)/阶梯价/复购价
|
|
@@ -156,8 +155,6 @@ public class PriceUtilService {
|
|
|
price.setSvipPriceTag(MathUtil.div(skus.get(0).getDiscount(), 10, 1) + "折");
|
|
|
if (isSuperVip) {
|
|
|
// 超级会员用户设置优惠价
|
|
|
- price.setOriginalPrice(atomicDouble.get());
|
|
|
- s.setOriginalPrice(s.getPrice());
|
|
|
svipDiscountPrice = MathUtil.div(MathUtil.mul(s.getPrice(), skus.get(0).getDiscount()), 100, 2);
|
|
|
s.setPrice(svipDiscountPrice.doubleValue());
|
|
|
price.setPrice(svipDiscountPrice.doubleValue());
|
|
@@ -187,11 +184,10 @@ public class PriceUtilService {
|
|
|
}
|
|
|
if (promotions.getType() == 1 && promotions.getMode() == 1) {
|
|
|
// 单品优惠价的时候,取当前sku的touchprice
|
|
|
- Double touchPrice = priceMapper.getTouchPriceBySku(s.getSkuId());
|
|
|
- s.setOriginalPrice(s.getPrice());
|
|
|
- price.setOriginalPrice(atomicDouble.get());
|
|
|
+ Double touchPrice = priceMapper.getTouchPriceBySku(s.getSkuId(), promotions.getId());
|
|
|
s.setPrice(touchPrice);
|
|
|
price.setPrice(skus.get(0).getTouchPrice());
|
|
|
+ promotions.setTouchPrice(skus.get(0).getTouchPrice());
|
|
|
}
|
|
|
price.setPromotions(promotions);
|
|
|
} else {
|
|
@@ -258,6 +254,7 @@ public class PriceUtilService {
|
|
|
s.setOriginalPrice(MathUtil.add(s.getOriginalPrice(), originalTaxFee).doubleValue());
|
|
|
}
|
|
|
});
|
|
|
+ price.setOriginalPrice(skus.get(0).getOriginalPrice());
|
|
|
// price添加税费
|
|
|
if (taxFlag) {
|
|
|
BigDecimal thisTaxFee = MathUtil.div(MathUtil.mul(price.getPrice(), price.getTaxRate()), 100, 2);
|
|
@@ -304,7 +301,7 @@ public class PriceUtilService {
|
|
|
product.setSvipPriceTag(price.getSvipPriceTag());
|
|
|
product.setPrice(price.getPrice());
|
|
|
product.setSkuId(price.getSkuId());
|
|
|
- product.setOriginalPrice(price.getPrice());
|
|
|
+ product.setOriginalPrice(price.getOriginalPrice());
|
|
|
product.setPriceGrade(getPriceGrade(price.getPrice()));
|
|
|
product.setMinBuyNumber(price.getMinBuyNumber());
|
|
|
product.setUnit(price.getUnit());
|