|
@@ -111,6 +111,15 @@ public class PurchaseProductController extends BaseController {
|
|
s.setLadderPriceList(productDao.findLadderPriceBySku(s.getSkuId()));
|
|
s.setLadderPriceList(productDao.findLadderPriceBySku(s.getSkuId()));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ // 超级会员价赋值
|
|
|
|
+ if (null != skuList.get(0).getPriceType()) {
|
|
|
|
+ p.setSvipPriceType(skuList.get(0).getPriceType());
|
|
|
|
+ if (1 == skuList.get(0).getPriceType()) {
|
|
|
|
+ p.setSvipDiscount(skuList.get(0).getDiscount());
|
|
|
|
+ } else {
|
|
|
|
+ p.setSvipDiscountPrice(skuList.get(0).getDiscountPrice());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
p.setSkuId(skuList.get(0).getSkuId());
|
|
p.setSkuId(skuList.get(0).getSkuId());
|
|
p.setPrice(skuList.get(0).getPrice().toString());
|
|
p.setPrice(skuList.get(0).getPrice().toString());
|
|
if (1 == skuList.get(0).getLadderPriceFlag()) {
|
|
if (1 == skuList.get(0).getLadderPriceFlag()) {
|
|
@@ -118,8 +127,6 @@ public class PurchaseProductController extends BaseController {
|
|
p.setLadderPriceList(productDao.findLadderPrice(skuList.get(0).getSkuId()));
|
|
p.setLadderPriceList(productDao.findLadderPrice(skuList.get(0).getSkuId()));
|
|
}
|
|
}
|
|
p.setSkuList(skuList);
|
|
p.setSkuList(skuList);
|
|
- long productId = p.getProductId();
|
|
|
|
- String discountPrice = p.getPrice();//默认折扣单价
|
|
|
|
if (priceFlag) {
|
|
if (priceFlag) {
|
|
p.setPrice(p.getNormalPrice());
|
|
p.setPrice(p.getNormalPrice());
|
|
}
|
|
}
|
|
@@ -153,18 +160,22 @@ public class PurchaseProductController extends BaseController {
|
|
// 初始化超级会员优惠
|
|
// 初始化超级会员优惠
|
|
p.setSvipReduction(0d);
|
|
p.setSvipReduction(0d);
|
|
if (1 == p.getSvipPriceFlag()) {
|
|
if (1 == p.getSvipPriceFlag()) {
|
|
-// if (1 == p.getSvipPriceType()) {
|
|
|
|
-// p.setSvipDiscountPrice(MathUtil.div(MathUtil.mul(new Double(p.getPrice()), p.getSvipDiscount()), 100, 2).doubleValue());
|
|
|
|
-// }
|
|
|
|
- // 商品的超级会员优惠=原价-超级会员优惠价
|
|
|
|
-// p.setSvipReduction(MathUtil.sub(p.getPrice(), p.getSvipDiscountPrice()).doubleValue());
|
|
|
|
-// if ("0".equals(p.getIncludedTax()) && ("1".equals(p.getInvoiceType()) || "2".equals(p.getInvoiceType()))) {
|
|
|
|
-// // 计算优惠的税费
|
|
|
|
-// BigDecimal taxReduction = MathUtil.div(MathUtil.mul(p.getSvipReduction(), p.getTaxRate()), 100);
|
|
|
|
-// p.setSvipReduction(MathUtil.add(p.getSvipReduction(), taxReduction).doubleValue());
|
|
|
|
-// p.setSvipTaxReduction(taxReduction.doubleValue());
|
|
|
|
-// }
|
|
|
|
|
|
+ if (1 == p.getSvipPriceType()) {
|
|
|
|
+ p.setSvipDiscountPrice(MathUtil.div(MathUtil.mul(new Double(p.getPrice()), p.getSvipDiscount()), 100, 2).doubleValue());
|
|
|
|
+ }
|
|
|
|
+// 商品的超级会员优惠=原价-超级会员优惠价
|
|
|
|
+ p.setSvipReduction(MathUtil.sub(p.getPrice(), p.getSvipDiscountPrice()).doubleValue());
|
|
|
|
+ if ("0".equals(p.getIncludedTax()) && ("1".equals(p.getInvoiceType()) || "2".equals(p.getInvoiceType()))) {
|
|
|
|
+ // 计算优惠的税费
|
|
|
|
+ BigDecimal taxReduction = MathUtil.div(MathUtil.mul(p.getSvipReduction(), p.getTaxRate()), 100);
|
|
|
|
+ p.setSvipReduction(MathUtil.add(p.getSvipReduction(), taxReduction).doubleValue());
|
|
|
|
+ p.setSvipTaxReduction(taxReduction.doubleValue());
|
|
|
|
+ }
|
|
} else if (null != cmPromotion) {
|
|
} else if (null != cmPromotion) {
|
|
|
|
+ if ("1".equals(cmPromotion.getMode())) {
|
|
|
|
+ // 优惠价取sku优惠价
|
|
|
|
+ cmPromotion.setTouchPrice(skuList.get(0).getTouchPrice());
|
|
|
|
+ }
|
|
p.setCmPromotion(cmPromotion);
|
|
p.setCmPromotion(cmPromotion);
|
|
p.setLadderPriceFlag(0);
|
|
p.setLadderPriceFlag(0);
|
|
}
|
|
}
|
|
@@ -347,6 +358,15 @@ public class PurchaseProductController extends BaseController {
|
|
s.setLadderPriceList(productDao.findLadderPriceBySku(s.getSkuId()));
|
|
s.setLadderPriceList(productDao.findLadderPriceBySku(s.getSkuId()));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ // 超级会员价赋值
|
|
|
|
+ if (null != skus.get(0).getPriceType()) {
|
|
|
|
+ purchaseProduct.setPriceType(skus.get(0).getPriceType().toString());
|
|
|
|
+ if (1 == skus.get(0).getPriceType()) {
|
|
|
|
+ purchaseProduct.setDiscount(skus.get(0).getDiscount().toString());
|
|
|
|
+ } else {
|
|
|
|
+ purchaseProduct.setDiscountPrice(skus.get(0).getDiscountPrice().toString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
purchaseProduct.setSkuList(skus);
|
|
purchaseProduct.setSkuList(skus);
|
|
CmSvipProduct svipProduct = purchaseProductService.getSvipProduct(purchaseProduct.getProductId(), purchaseProduct.getUserId());
|
|
CmSvipProduct svipProduct = purchaseProductService.getSvipProduct(purchaseProduct.getProductId(), purchaseProduct.getUserId());
|
|
CmPromotion productPromotion = cmPromotionService.findProductPromotion(product.getShopID().toString(), Long.parseLong(product.getProductID().toString()));
|
|
CmPromotion productPromotion = cmPromotionService.findProductPromotion(product.getShopID().toString(), Long.parseLong(product.getProductID().toString()));
|
|
@@ -354,6 +374,10 @@ public class PurchaseProductController extends BaseController {
|
|
purchaseProduct.setSvipPriceFlag(1);
|
|
purchaseProduct.setSvipPriceFlag(1);
|
|
purchaseProduct.setSvipPriceType(svipProduct.getPriceType());
|
|
purchaseProduct.setSvipPriceType(svipProduct.getPriceType());
|
|
} else if (productPromotion != null) {
|
|
} else if (productPromotion != null) {
|
|
|
|
+ // 优惠价的时候给赋值优惠价
|
|
|
|
+ if("1".equals(productPromotion.getMode())){
|
|
|
|
+ productPromotion.setTouchPrice(skus.get(0).getTouchPrice());
|
|
|
|
+ }
|
|
purchaseProduct.setCmPromotion(productPromotion);
|
|
purchaseProduct.setCmPromotion(productPromotion);
|
|
} else {
|
|
} else {
|
|
if (1 == skus.get(0).getLadderPriceFlag()) {
|
|
if (1 == skus.get(0).getLadderPriceFlag()) {
|