Authored by caoyan

尺码集合

@@ -15,6 +15,10 @@ public class SizePool { @@ -15,6 +15,10 @@ public class SizePool {
15 private Integer updateTime; 15 private Integer updateTime;
16 16
17 private Integer updateUid; 17 private Integer updateUid;
  18 +
  19 + private Integer imageWidth;
  20 +
  21 + private Integer imageHeight;
18 22
19 public Integer getId() { 23 public Integer getId() {
20 return id; 24 return id;
@@ -64,6 +68,22 @@ public class SizePool { @@ -64,6 +68,22 @@ public class SizePool {
64 this.updateUid = updateUid; 68 this.updateUid = updateUid;
65 } 69 }
66 70
  71 + public Integer getImageWidth() {
  72 + return imageWidth;
  73 + }
  74 +
  75 + public void setImageWidth(Integer imageWidth) {
  76 + this.imageWidth = imageWidth;
  77 + }
  78 +
  79 + public Integer getImageHeight() {
  80 + return imageHeight;
  81 + }
  82 +
  83 + public void setImageHeight(Integer imageHeight) {
  84 + this.imageHeight = imageHeight;
  85 + }
  86 +
67 @Override 87 @Override
68 public String toString() { 88 public String toString() {
69 return JSONObject.toJSONString(this); 89 return JSONObject.toJSONString(this);
@@ -8,10 +8,12 @@ @@ -8,10 +8,12 @@
8 <result column="image_url" property="imageUrl" jdbcType="VARCHAR" /> 8 <result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
9 <result column="update_time" property="updateTime" jdbcType="INTEGER" /> 9 <result column="update_time" property="updateTime" jdbcType="INTEGER" />
10 <result column="update_uid" property="updateUid" jdbcType="INTEGER" /> 10 <result column="update_uid" property="updateUid" jdbcType="INTEGER" />
  11 + <result column="image_width" property="imageWidth" jdbcType="INTEGER" />
  12 + <result column="image_height" property="imageHeight" jdbcType="INTEGER" />
11 </resultMap> 13 </resultMap>
12 14
13 <sql id="Base_Column_List"> 15 <sql id="Base_Column_List">
14 - id, status, range_type, image_url, update_time, update_uid 16 + id, status, range_type, image_url, update_time, update_uid, image_width, image_height
15 </sql> 17 </sql>
16 18
17 <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> 19 <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@@ -34,6 +34,7 @@ import com.yohobuy.ufo.model.request.StoragePriceBo; @@ -34,6 +34,7 @@ import com.yohobuy.ufo.model.request.StoragePriceBo;
34 import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo; 34 import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
35 import com.yohobuy.ufo.model.request.product.ProductRequestBo; 35 import com.yohobuy.ufo.model.request.product.ProductRequestBo;
36 import com.yohobuy.ufo.model.response.ProductDetailResp; 36 import com.yohobuy.ufo.model.response.ProductDetailResp;
  37 +import com.yohobuy.ufo.model.response.SizeImageResp;
37 import com.yohobuy.ufo.model.response.StorageCheckResp; 38 import com.yohobuy.ufo.model.response.StorageCheckResp;
38 import com.yohobuy.ufo.model.response.StorageDataResp; 39 import com.yohobuy.ufo.model.response.StorageDataResp;
39 import com.yohobuy.ufo.model.response.StorageInfoResp; 40 import com.yohobuy.ufo.model.response.StorageInfoResp;
@@ -1022,7 +1023,7 @@ public class ProductController { @@ -1022,7 +1023,7 @@ public class ProductController {
1022 } 1023 }
1023 LOG.info("in method=ufo.product.sizeImage product_id is {}", productId); 1024 LOG.info("in method=ufo.product.sizeImage product_id is {}", productId);
1024 1025
1025 - String result =productService.getSizeImage(productId, brandId); 1026 + SizeImageResp result =productService.getSizeImage(productId, brandId);
1026 return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build(); 1027 return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build();
1027 } 1028 }
1028 } 1029 }
@@ -5,19 +5,27 @@ import java.util.Collection; @@ -5,19 +5,27 @@ import java.util.Collection;
5 import java.util.List; 5 import java.util.List;
6 import java.util.Map; 6 import java.util.Map;
7 7
  8 +import org.springframework.web.servlet.ModelAndView;
  9 +
8 import com.alibaba.fastjson.JSONObject; 10 import com.alibaba.fastjson.JSONObject;
9 import com.yoho.core.dal.datasource.annotation.Database; 11 import com.yoho.core.dal.datasource.annotation.Database;
10 import com.yohobuy.ufo.model.ProductInfo; 12 import com.yohobuy.ufo.model.ProductInfo;
11 import com.yohobuy.ufo.model.request.StoragePriceBo; 13 import com.yohobuy.ufo.model.request.StoragePriceBo;
12 import com.yohobuy.ufo.model.request.product.ProductRequestBo; 14 import com.yohobuy.ufo.model.request.product.ProductRequestBo;
13 import com.yohobuy.ufo.model.response.ProductDetailResp; 15 import com.yohobuy.ufo.model.response.ProductDetailResp;
  16 +import com.yohobuy.ufo.model.response.SizeImageResp;
14 import com.yohobuy.ufo.model.response.StorageCheckResp; 17 import com.yohobuy.ufo.model.response.StorageCheckResp;
  18 +import com.yohobuy.ufo.model.response.StorageDataResp;
15 import com.yohobuy.ufo.model.response.StorageInfoResp; 19 import com.yohobuy.ufo.model.response.StorageInfoResp;
16 import com.yohoufo.dal.product.model.StoragePrice; 20 import com.yohoufo.dal.product.model.StoragePrice;
17 import com.yohoufo.product.model.SkupInfo; 21 import com.yohoufo.product.model.SkupInfo;
18 -import com.yohoufo.product.response.*;  
19 -import com.yohobuy.ufo.model.response.StorageDataResp;  
20 -import org.springframework.web.servlet.ModelAndView; 22 +import com.yohoufo.product.response.ProductSeriesTemplateResp;
  23 +import com.yohoufo.product.response.ProductSimpleResp;
  24 +import com.yohoufo.product.response.ProductSortTemplateResp;
  25 +import com.yohoufo.product.response.SaleCategoryBo;
  26 +import com.yohoufo.product.response.SecondHandProductResp;
  27 +import com.yohoufo.product.response.SkupDetailForScreenResp;
  28 +import com.yohoufo.product.response.StorageLeastPriceResp;
21 29
22 public interface ProductService { 30 public interface ProductService {
23 31
@@ -155,5 +163,5 @@ public interface ProductService { @@ -155,5 +163,5 @@ public interface ProductService {
155 */ 163 */
156 ProductDetailResp queryProductDetail3ById(Integer productId); 164 ProductDetailResp queryProductDetail3ById(Integer productId);
157 165
158 - String getSizeImage(Integer productId, Integer brandId); 166 + SizeImageResp getSizeImage(Integer productId, Integer brandId);
159 } 167 }
@@ -18,19 +18,6 @@ import java.util.function.BinaryOperator; @@ -18,19 +18,6 @@ import java.util.function.BinaryOperator;
18 import java.util.function.Function; 18 import java.util.function.Function;
19 import java.util.stream.Collectors; 19 import java.util.stream.Collectors;
20 20
21 -import com.alibaba.fastjson.JSON;  
22 -import com.alibaba.fastjson.serializer.SerializerFeature;  
23 -import com.yohobuy.ufo.model.request.product.ProductRequestBo;  
24 -import com.yohobuy.ufo.model.response.StorageCheckResp;  
25 -import com.yohobuy.ufo.model.response.store.StoreInfoBo;  
26 -import com.yohoufo.common.ApiResponse;  
27 -import com.yohoufo.common.constant.BusinessClientEnum;  
28 -import com.yohoufo.common.exception.UfoServiceException;  
29 -import com.yohoufo.common.utils.OrikaUtils;  
30 -import com.yohoufo.dal.product.*;  
31 -import com.yohoufo.dal.product.model.*;  
32 -import com.yohoufo.product.service.cache.BrandCacheService;  
33 -import com.yohoufo.product.service.cache.SizeCacheService;  
34 import org.apache.commons.collections.MapUtils; 21 import org.apache.commons.collections.MapUtils;
35 import org.apache.commons.lang.ArrayUtils; 22 import org.apache.commons.lang.ArrayUtils;
36 import org.apache.commons.lang3.StringUtils; 23 import org.apache.commons.lang3.StringUtils;
@@ -63,6 +50,7 @@ import com.yohobuy.ufo.model.request.StoragePriceBo; @@ -63,6 +50,7 @@ import com.yohobuy.ufo.model.request.StoragePriceBo;
63 import com.yohobuy.ufo.model.request.product.PriceTrendBO; 50 import com.yohobuy.ufo.model.request.product.PriceTrendBO;
64 import com.yohobuy.ufo.model.request.product.ProductRequestBo; 51 import com.yohobuy.ufo.model.request.product.ProductRequestBo;
65 import com.yohobuy.ufo.model.response.ProductDetailResp; 52 import com.yohobuy.ufo.model.response.ProductDetailResp;
  53 +import com.yohobuy.ufo.model.response.SizeImageResp;
66 import com.yohobuy.ufo.model.response.StorageCheckResp; 54 import com.yohobuy.ufo.model.response.StorageCheckResp;
67 import com.yohobuy.ufo.model.response.StorageDataResp; 55 import com.yohobuy.ufo.model.response.StorageDataResp;
68 import com.yohobuy.ufo.model.response.StorageInfoResp; 56 import com.yohobuy.ufo.model.response.StorageInfoResp;
@@ -131,6 +119,8 @@ import com.yohoufo.product.response.SkupDetailForScreenResp; @@ -131,6 +119,8 @@ import com.yohoufo.product.response.SkupDetailForScreenResp;
131 import com.yohoufo.product.response.StorageLeastPriceResp; 119 import com.yohoufo.product.response.StorageLeastPriceResp;
132 import com.yohoufo.product.service.ProductSearchService; 120 import com.yohoufo.product.service.ProductSearchService;
133 import com.yohoufo.product.service.ProductService; 121 import com.yohoufo.product.service.ProductService;
  122 +import com.yohoufo.product.service.cache.BrandCacheService;
  123 +import com.yohoufo.product.service.cache.SizeCacheService;
134 124
135 125
136 @Service 126 @Service
@@ -1984,23 +1974,28 @@ public class ProductServiceImpl implements ProductService { @@ -1984,23 +1974,28 @@ public class ProductServiceImpl implements ProductService {
1984 } 1974 }
1985 1975
1986 @Override 1976 @Override
1987 - public String getSizeImage(Integer productId, Integer brandId) { 1977 + public SizeImageResp getSizeImage(Integer productId, Integer brandId) {
  1978 + SizeImageResp resp = new SizeImageResp();
1988 List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId); 1979 List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId);
1989 if(CollectionUtils.isEmpty(list)) { 1980 if(CollectionUtils.isEmpty(list)) {
1990 list = sizePoolDetailMapper.queryByBrandId(brandId); 1981 list = sizePoolDetailMapper.queryByBrandId(brandId);
1991 } 1982 }
1992 1983
1993 if(CollectionUtils.isEmpty(list)) { 1984 if(CollectionUtils.isEmpty(list)) {
1994 - return StringUtils.EMPTY; 1985 + return resp;
1995 } 1986 }
1996 1987
1997 List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList()); 1988 List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList());
1998 SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList); 1989 SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList);
1999 if(null == pool) { 1990 if(null == pool) {
2000 - return StringUtils.EMPTY; 1991 + return resp;
2001 } 1992 }
2002 1993
2003 - return pool.getImageUrl(); 1994 + resp.setImageUrl(pool.getImageUrl());
  1995 + resp.setImageWidth(pool.getImageWidth());
  1996 + resp.setImageHeight(pool.getImageHeight());
  1997 +
  1998 + return resp;
2004 } 1999 }
2005 2000
2006 private List<Integer> buildSizeIdList(String[] sizeIdArr){ 2001 private List<Integer> buildSizeIdList(String[] sizeIdArr){