|
|
package com.yohoufo.product.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Collections;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.UUID;
|
|
|
import java.util.function.BinaryOperator;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
...
|
...
|
@@ -30,14 +41,14 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.core.common.helpers.ImagesHelper;
|
|
|
import com.yoho.core.config.ConfigReader;
|
...
|
...
|
@@ -47,15 +58,65 @@ import com.yohobuy.ufo.model.GoodsBO; |
|
|
import com.yohobuy.ufo.model.GoodsImageBO;
|
|
|
import com.yohobuy.ufo.model.GoodsSize;
|
|
|
import com.yohobuy.ufo.model.ProductInfo;
|
|
|
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
|
|
|
import com.yohobuy.ufo.model.request.StoragePriceBo;
|
|
|
import com.yohobuy.ufo.model.request.product.PriceTrendBO;
|
|
|
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
|
|
|
import com.yohobuy.ufo.model.response.ProductDetailResp;
|
|
|
import com.yohobuy.ufo.model.response.StorageCheckResp;
|
|
|
import com.yohobuy.ufo.model.response.StorageDataResp;
|
|
|
import com.yohobuy.ufo.model.response.StorageInfoResp;
|
|
|
import com.yohobuy.ufo.model.response.store.StoreInfoBo;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.caller.UfoServiceCaller;
|
|
|
import com.yohoufo.common.constant.BusinessClientEnum;
|
|
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.common.utils.OrikaUtils;
|
|
|
import com.yohoufo.common.utils.UfoStringUtils;
|
|
|
import com.yohobuy.ufo.model.request.product.PriceTrendBO;
|
|
|
import com.yohoufo.dal.product.BrandMapper;
|
|
|
import com.yohoufo.dal.product.BrandSeriesMapper;
|
|
|
import com.yohoufo.dal.product.GoodsImagesMapper;
|
|
|
import com.yohoufo.dal.product.GoodsMapper;
|
|
|
import com.yohoufo.dal.product.PriceTrendDayMapper;
|
|
|
import com.yohoufo.dal.product.PriceTrendMonthMapper;
|
|
|
import com.yohoufo.dal.product.ProductLimitSaleMapper;
|
|
|
import com.yohoufo.dal.product.ProductMapper;
|
|
|
import com.yohoufo.dal.product.ProductProfitMapper;
|
|
|
import com.yohoufo.dal.product.ProductSalesMapper;
|
|
|
import com.yohoufo.dal.product.ProductSortMapper;
|
|
|
import com.yohoufo.dal.product.SaleCategoryMapper;
|
|
|
import com.yohoufo.dal.product.SecondhandFlawMapper;
|
|
|
import com.yohoufo.dal.product.SecondhandImagesMapper;
|
|
|
import com.yohoufo.dal.product.SecondhandInfoMapper;
|
|
|
import com.yohoufo.dal.product.SelfSizeMapper;
|
|
|
import com.yohoufo.dal.product.SelfSizeUidMapper;
|
|
|
import com.yohoufo.dal.product.SizeMapper;
|
|
|
import com.yohoufo.dal.product.SizePoolDetailMapper;
|
|
|
import com.yohoufo.dal.product.SizePoolMapper;
|
|
|
import com.yohoufo.dal.product.StorageMapper;
|
|
|
import com.yohoufo.dal.product.StoragePriceMapper;
|
|
|
import com.yohoufo.dal.product.model.Brand;
|
|
|
import com.yohoufo.dal.product.model.BrandSeries;
|
|
|
import com.yohoufo.dal.product.model.Goods;
|
|
|
import com.yohoufo.dal.product.model.GoodsImages;
|
|
|
import com.yohoufo.dal.product.model.PriceTrendModel;
|
|
|
import com.yohoufo.dal.product.model.Product;
|
|
|
import com.yohoufo.dal.product.model.ProductLimitSale;
|
|
|
import com.yohoufo.dal.product.model.ProductProfit;
|
|
|
import com.yohoufo.dal.product.model.ProductSales;
|
|
|
import com.yohoufo.dal.product.model.ProductSort;
|
|
|
import com.yohoufo.dal.product.model.SaleCategory;
|
|
|
import com.yohoufo.dal.product.model.SecondhandFlaw;
|
|
|
import com.yohoufo.dal.product.model.SecondhandImages;
|
|
|
import com.yohoufo.dal.product.model.SecondhandInfo;
|
|
|
import com.yohoufo.dal.product.model.SelfSize;
|
|
|
import com.yohoufo.dal.product.model.SelfSizeUid;
|
|
|
import com.yohoufo.dal.product.model.Size;
|
|
|
import com.yohoufo.dal.product.model.SizePool;
|
|
|
import com.yohoufo.dal.product.model.SizePoolDetail;
|
|
|
import com.yohoufo.dal.product.model.Storage;
|
|
|
import com.yohoufo.dal.product.model.StoragePrice;
|
|
|
import com.yohoufo.product.model.ProductSeriesTemplate;
|
|
|
import com.yohoufo.product.model.ProductSortTemplate;
|
|
|
import com.yohoufo.product.model.SkupDetailForScreenInfo;
|
...
|
...
|
@@ -70,7 +131,6 @@ import com.yohoufo.product.response.SkupDetailForScreenResp; |
|
|
import com.yohoufo.product.response.StorageLeastPriceResp;
|
|
|
import com.yohoufo.product.service.ProductSearchService;
|
|
|
import com.yohoufo.product.service.ProductService;
|
|
|
import com.yohoufo.dal.product.model.Size;
|
|
|
|
|
|
|
|
|
@Service
|
...
|
...
|
@@ -174,6 +234,12 @@ public class ProductServiceImpl implements ProductService { |
|
|
@Autowired
|
|
|
private SizeCacheService sizeCacheService;
|
|
|
|
|
|
@Autowired
|
|
|
private SizePoolMapper sizePoolMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private SizePoolDetailMapper sizePoolDetailMapper;
|
|
|
|
|
|
@Override
|
|
|
public ProductDetailResp queryProductDetailById(Integer productId) {
|
|
|
ProductDetailResp productDetailResp = new ProductDetailResp();
|
...
|
...
|
@@ -1914,6 +1980,26 @@ public class ProductServiceImpl implements ProductService { |
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getSizeImage(Integer productId, Integer brandId) {
|
|
|
List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId);
|
|
|
if(CollectionUtils.isEmpty(list)) {
|
|
|
list = sizePoolDetailMapper.queryByBrandId(brandId);
|
|
|
}
|
|
|
|
|
|
if(CollectionUtils.isEmpty(list)) {
|
|
|
return StringUtils.EMPTY;
|
|
|
}
|
|
|
|
|
|
List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList());
|
|
|
SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList);
|
|
|
if(null == pool) {
|
|
|
return StringUtils.EMPTY;
|
|
|
}
|
|
|
|
|
|
return pool.getImageUrl();
|
|
|
}
|
|
|
|
|
|
private List<Integer> buildSizeIdList(String[] sizeIdArr){
|
|
|
List<Integer> sizeIdList = Lists.newArrayList();
|
|
|
for(int i=0; i<sizeIdArr.length; i++) {
|
...
|
...
|
|