|
@@ -106,8 +106,17 @@ public class PurchaseProductController extends BaseController {
|
|
p.setCouponsLogo(1);
|
|
p.setCouponsLogo(1);
|
|
}
|
|
}
|
|
List<CmSku> skuList = productDao.findSkuList(p.getProductId().intValue());
|
|
List<CmSku> skuList = productDao.findSkuList(p.getProductId().intValue());
|
|
|
|
+ skuList.forEach(s -> {
|
|
|
|
+ if (1 == s.getLadderPriceFlag()) {
|
|
|
|
+ s.setLadderPriceList(productDao.findLadderPriceBySku(s.getSkuId()));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
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()) {
|
|
|
|
+ p.setLadderPriceFlag(1);
|
|
|
|
+ p.setLadderPriceList(productDao.findLadderPrice(skuList.get(0).getSkuId()));
|
|
|
|
+ }
|
|
p.setSkuList(skuList);
|
|
p.setSkuList(skuList);
|
|
long productId = p.getProductId();
|
|
long productId = p.getProductId();
|
|
String discountPrice = p.getPrice();//默认折扣单价
|
|
String discountPrice = p.getPrice();//默认折扣单价
|
|
@@ -333,6 +342,11 @@ public class PurchaseProductController extends BaseController {
|
|
List<CmSku> skus = productDao.findSkuList(product.getProductID());
|
|
List<CmSku> skus = productDao.findSkuList(product.getProductID());
|
|
purchaseProduct.setSkuId(skus.get(0).getSkuId());
|
|
purchaseProduct.setSkuId(skus.get(0).getSkuId());
|
|
purchaseProduct.setPrice(skus.get(0).getPrice().toString());
|
|
purchaseProduct.setPrice(skus.get(0).getPrice().toString());
|
|
|
|
+ skus.forEach(s -> {
|
|
|
|
+ if (1 == s.getLadderPriceFlag()) {
|
|
|
|
+ s.setLadderPriceList(productDao.findLadderPriceBySku(s.getSkuId()));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
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()));
|
|
@@ -342,29 +356,16 @@ public class PurchaseProductController extends BaseController {
|
|
} else if (productPromotion != null) {
|
|
} else if (productPromotion != null) {
|
|
purchaseProduct.setCmPromotion(productPromotion);
|
|
purchaseProduct.setCmPromotion(productPromotion);
|
|
} else {
|
|
} else {
|
|
-// if ("1".equals(product.getLadderPriceFlag())) {
|
|
|
|
-// purchaseProduct.setLadderPriceFlag(1);
|
|
|
|
-// // 查询阶梯价格
|
|
|
|
-// List<ProductLadderPrice> ladderPriceList = purchaseProductService.findLadderPriceList(purchaseProduct.getProductId());
|
|
|
|
-// if (null != ladderPriceList && ladderPriceList.size() > 0) {
|
|
|
|
-// purchaseProduct.setPrice(ladderPriceList.get(0).getBuyPrice().toString());
|
|
|
|
-// purchaseProduct.setNum(ladderPriceList.get(0).getBuyNum().toString());
|
|
|
|
-// IntStream.range(0, ladderPriceList.size()).forEach(i -> {
|
|
|
|
-// if (i == ladderPriceList.size() - 1) {
|
|
|
|
-// ladderPriceList.get(i).setBuyNumRangeShow("≥" + ladderPriceList.get(i).getBuyNum());
|
|
|
|
-// } else {
|
|
|
|
-// String buyNumRangeShow = ladderPriceList.get(i).getBuyNum() + "~" + (ladderPriceList.get(i + 1).getBuyNum() - 1);
|
|
|
|
-// ladderPriceList.get(i).setBuyNumRangeShow(buyNumRangeShow);
|
|
|
|
-// }
|
|
|
|
-// });
|
|
|
|
-// purchaseProduct.setLadderPriceList(ladderPriceList);
|
|
|
|
-// } else {
|
|
|
|
- purchaseProduct.setLadderPriceFlag(0);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if (1 == skus.get(0).getLadderPriceFlag()) {
|
|
|
|
+ purchaseProduct.setLadderPriceFlag(1);
|
|
|
|
+ purchaseProduct.setLadderPriceList(productDao.findLadderPrice(skus.get(0).getSkuId()));
|
|
|
|
+ } else {
|
|
|
|
+ purchaseProduct.setLadderPriceFlag(0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
model.addAttribute("purchaseProduct", purchaseProduct);
|
|
model.addAttribute("purchaseProduct", purchaseProduct);
|
|
return "modules/bulkpurchase/orderPurchaseProductForm";
|
|
return "modules/bulkpurchase/orderPurchaseProductForm";
|
|
}
|
|
}
|