...
|
...
|
@@ -93,13 +93,11 @@ public class ProductServiceImpl implements ProductService{ |
|
|
productInfo.setProductName(product.getProductName());
|
|
|
productInfo.setProductCode(product.getProductCode());
|
|
|
productInfo.setSaleTime((product.getSaleTime() == null || product.getSaleTime().equals(0)) ? "0" : DateUtil.getDateString(product.getSaleTime(), DateUtil.YYYY_MM_DD_DOT));
|
|
|
productInfo.setLeastPrice(new BigDecimal(0));
|
|
|
setBrand(productInfo, product.getBrandId());
|
|
|
setSeries(productInfo, product.getSeriesId());
|
|
|
productInfo.setLeastPrice(null);
|
|
|
|
|
|
|
|
|
List<GoodsBO> goodsBOList = getGoodsList(product.getId());
|
|
|
List<GoodsBO> goodsBOList = getGoodsList(product.getId(), product.getMinPrice());
|
|
|
if (!CollectionUtils.isEmpty(goodsBOList) && goodsBOList.get(0) != null) {
|
|
|
GoodsBO goodsBO = goodsBOList.get(0);
|
|
|
List<GoodsSize> goodsSizes = goodsBO.getSizeList();
|
...
|
...
|
@@ -494,7 +492,7 @@ public class ProductServiceImpl implements ProductService{ |
|
|
return storagePriceMap;
|
|
|
}
|
|
|
|
|
|
private List<GoodsBO> getGoodsList(Integer productId){
|
|
|
private List<GoodsBO> getGoodsList(Integer productId, BigDecimal sellMinPrice){
|
|
|
List<GoodsBO> goodsBOs = new ArrayList<>();
|
|
|
|
|
|
List<Goods> goodsList = goodsMapper.selectByProductId(productId);
|
...
|
...
|
@@ -528,6 +526,7 @@ public class ProductServiceImpl implements ProductService{ |
|
|
goodsSize.setStatus(storagePrice == null ? null : storagePrice.getStatus());
|
|
|
goodsSize.setStorageNum(storagePrice == null ? 0 : storage.getStorageNum());
|
|
|
goodsSize.setSkup(storagePrice == null ? 0 : storagePrice.getSkup());
|
|
|
goodsSize.setSellLeastPrice(sellMinPrice);
|
|
|
goodSizeList.add(goodsSize);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -557,4 +556,20 @@ public class ProductServiceImpl implements ProductService{ |
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 查询商品的基本信息
|
|
|
public ProductDetailResp queryProductBaseInfo(Integer productId) {
|
|
|
Product product = productMapper.selectByPrimaryKey(productId);
|
|
|
ProductInfo productInfo = new ProductInfo();
|
|
|
productInfo.setProductId(product.getId());
|
|
|
productInfo.setProductName(product.getProductName());
|
|
|
productInfo.setProductCode(product.getProductCode());
|
|
|
productInfo.setSaleTime((product.getSaleTime() == null || product.getSaleTime().equals(0)) ? "0" : DateUtil.getDateString(product.getSaleTime(), DateUtil.YYYY_MM_DD_DOT));
|
|
|
productInfo.setMinPrice(product.getMinPrice());
|
|
|
productInfo.setMaxPrice(product.getMaxPrice());
|
|
|
|
|
|
ProductDetailResp productDetailResp = new ProductDetailResp();
|
|
|
productDetailResp.setProduct_info(productInfo);
|
|
|
return productDetailResp;
|
|
|
}
|
|
|
} |
...
|
...
|
|