Authored by caoyan

尺码集合

... ... @@ -15,6 +15,10 @@ public class SizePool {
private Integer updateTime;
private Integer updateUid;
private Integer imageWidth;
private Integer imageHeight;
public Integer getId() {
return id;
... ... @@ -64,6 +68,22 @@ public class SizePool {
this.updateUid = updateUid;
}
public Integer getImageWidth() {
return imageWidth;
}
public void setImageWidth(Integer imageWidth) {
this.imageWidth = imageWidth;
}
public Integer getImageHeight() {
return imageHeight;
}
public void setImageHeight(Integer imageHeight) {
this.imageHeight = imageHeight;
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
... ...
... ... @@ -8,10 +8,12 @@
<result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="update_uid" property="updateUid" jdbcType="INTEGER" />
<result column="image_width" property="imageWidth" jdbcType="INTEGER" />
<result column="image_height" property="imageHeight" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, status, range_type, image_url, update_time, update_uid
id, status, range_type, image_url, update_time, update_uid, image_width, image_height
</sql>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
... ...
... ... @@ -34,6 +34,7 @@ import com.yohobuy.ufo.model.request.StoragePriceBo;
import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
import com.yohobuy.ufo.model.response.ProductDetailResp;
import com.yohobuy.ufo.model.response.SizeImageResp;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
... ... @@ -1022,7 +1023,7 @@ public class ProductController {
}
LOG.info("in method=ufo.product.sizeImage product_id is {}", productId);
String result =productService.getSizeImage(productId, brandId);
SizeImageResp result =productService.getSizeImage(productId, brandId);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build();
}
}
\ No newline at end of file
... ...
... ... @@ -5,19 +5,27 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.request.StoragePriceBo;
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
import com.yohobuy.ufo.model.response.ProductDetailResp;
import com.yohobuy.ufo.model.response.SizeImageResp;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
import com.yohoufo.dal.product.model.StoragePrice;
import com.yohoufo.product.model.SkupInfo;
import com.yohoufo.product.response.*;
import com.yohobuy.ufo.model.response.StorageDataResp;
import org.springframework.web.servlet.ModelAndView;
import com.yohoufo.product.response.ProductSeriesTemplateResp;
import com.yohoufo.product.response.ProductSimpleResp;
import com.yohoufo.product.response.ProductSortTemplateResp;
import com.yohoufo.product.response.SaleCategoryBo;
import com.yohoufo.product.response.SecondHandProductResp;
import com.yohoufo.product.response.SkupDetailForScreenResp;
import com.yohoufo.product.response.StorageLeastPriceResp;
public interface ProductService {
... ... @@ -155,5 +163,5 @@ public interface ProductService {
*/
ProductDetailResp queryProductDetail3ById(Integer productId);
String getSizeImage(Integer productId, Integer brandId);
SizeImageResp getSizeImage(Integer productId, Integer brandId);
}
... ...
... ... @@ -18,19 +18,6 @@ import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.store.StoreInfoBo;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.constant.BusinessClientEnum;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.OrikaUtils;
import com.yohoufo.dal.product.*;
import com.yohoufo.dal.product.model.*;
import com.yohoufo.product.service.cache.BrandCacheService;
import com.yohoufo.product.service.cache.SizeCacheService;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -63,6 +50,7 @@ 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.SizeImageResp;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
... ... @@ -131,6 +119,8 @@ 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.product.service.cache.BrandCacheService;
import com.yohoufo.product.service.cache.SizeCacheService;
@Service
... ... @@ -1984,23 +1974,28 @@ public class ProductServiceImpl implements ProductService {
}
@Override
public String getSizeImage(Integer productId, Integer brandId) {
public SizeImageResp getSizeImage(Integer productId, Integer brandId) {
SizeImageResp resp = new SizeImageResp();
List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId);
if(CollectionUtils.isEmpty(list)) {
list = sizePoolDetailMapper.queryByBrandId(brandId);
}
if(CollectionUtils.isEmpty(list)) {
return StringUtils.EMPTY;
return resp;
}
List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList());
SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList);
if(null == pool) {
return StringUtils.EMPTY;
return resp;
}
return pool.getImageUrl();
resp.setImageUrl(pool.getImageUrl());
resp.setImageWidth(pool.getImageWidth());
resp.setImageHeight(pool.getImageHeight());
return resp;
}
private List<Integer> buildSizeIdList(String[] sizeIdArr){
... ...