Authored by mali

详情接口性能优化

... ... @@ -193,7 +193,7 @@ public class ProductHelpService {
/**
* 商品维护设置各种库存的最低价或者最高价
* @param goodsSizes
* @param mapper
* @param mapper 获取库存类型的价格
* @param consumer
* @return
*/
... ...
... ... @@ -169,22 +169,15 @@ public class ProductServiceImpl implements ProductService {
@Override
public ProductDetailResp queryProductDetailById(Integer productId) {
ProductDetailResp productDetailResp = new ProductDetailResp();
Product product = productMapper.selectByPrimaryKey(productId);
Product product = productHelpService.selectByIdCache(productId);
if (product != null) {
ProductInfo productInfo = new ProductInfo();
productInfo.setProductId(product.getId());
productInfo.setProductName(product.getProductName());
productInfo.setProductCode(product.getProductCode());
productInfo.setMaxSortId(product.getMaxSortId());
productInfo.setMaxPrice(product.getMaxPrice());
productInfo.setMinPrice(product.getMinPrice());
productInfo.setShelveStatus(product.getShelveStatus());
productInfo.setGender(productHelpService.getGenderName(product.getGender()));
productInfo.setSaleTime((product.getSaleTime() == null || product.getSaleTime().equals(0)) ? "0" : DateUtil.getDateString(product.getSaleTime(), DateUtil.YYYY_MM_DD_DOT));
productInfo.setOfferPrice(product.getOfferPrice());
setBrand(productInfo, product.getBrandId());
setSeries(productInfo, product.getSeriesId());
productInfo.setLeastPrice(null);
productInfo.setProductId(product.getId()).setProductName(product.getProductName()).setProductCode(product.getProductCode())
.setMaxSortId(product.getMaxSortId()).setMaxPrice(product.getMaxPrice()).setMinPrice(product.getMinPrice()).setLeastPrice(null)
.setShelveStatus(product.getShelveStatus()).setGender(productHelpService.getGenderName(product.getGender())).setOfferPrice(product.getOfferPrice())
.setSaleTime((product.getSaleTime() == null || product.getSaleTime().equals(0)) ? "0" : DateUtil.getDateString(product.getSaleTime(), DateUtil.YYYY_MM_DD_DOT));
productHelpService.setBrand(productInfo, product.getBrandId()).setSeries(productInfo, product.getSeriesId());
List<GoodsBO> goodsBOList = getGoodsList(product.getId(), product.getMinPrice(), product.getMaxPrice());
if (!CollectionUtils.isEmpty(goodsBOList) && goodsBOList.get(0) != null) {
... ...