Showing
12 changed files
with
348 additions
and
19 deletions
1 | +package com.yohoufo.dal.product; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import com.yohoufo.dal.product.model.SizePoolDetail; | ||
8 | + | ||
9 | +/** | ||
10 | + * Created by caoyan. | ||
11 | + */ | ||
12 | +public interface SizePoolDetailMapper { | ||
13 | + | ||
14 | + List<SizePoolDetail> queryByProductId(@Param("productId") Integer productId); | ||
15 | + | ||
16 | + List<SizePoolDetail> queryByBrandId(@Param("brandId") Integer brandId); | ||
17 | + | ||
18 | +} |
1 | +package com.yohoufo.dal.product; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import com.yohoufo.dal.product.model.SizePool; | ||
8 | + | ||
9 | +/** | ||
10 | + * Created by caoyan. | ||
11 | + */ | ||
12 | +public interface SizePoolMapper { | ||
13 | + | ||
14 | + SizePool querySizePoolByIds(@Param("sizePoolIds") List<Integer> sizePoolIds); | ||
15 | + | ||
16 | + | ||
17 | +} |
1 | +package com.yohoufo.dal.product.model; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | + | ||
5 | +public class SizePool { | ||
6 | + | ||
7 | + private Integer id; | ||
8 | + | ||
9 | + private Integer status; | ||
10 | + | ||
11 | + private Integer rangeType; | ||
12 | + | ||
13 | + private String imageUrl; | ||
14 | + | ||
15 | + private Integer updateTime; | ||
16 | + | ||
17 | + private Integer updateUid; | ||
18 | + | ||
19 | + public Integer getId() { | ||
20 | + return id; | ||
21 | + } | ||
22 | + | ||
23 | + public void setId(Integer id) { | ||
24 | + this.id = id; | ||
25 | + } | ||
26 | + | ||
27 | + public Integer getStatus() { | ||
28 | + return status; | ||
29 | + } | ||
30 | + | ||
31 | + public void setStatus(Integer status) { | ||
32 | + this.status = status; | ||
33 | + } | ||
34 | + | ||
35 | + public Integer getRangeType() { | ||
36 | + return rangeType; | ||
37 | + } | ||
38 | + | ||
39 | + public void setRangeType(Integer rangeType) { | ||
40 | + this.rangeType = rangeType; | ||
41 | + } | ||
42 | + | ||
43 | + public String getImageUrl() { | ||
44 | + return imageUrl; | ||
45 | + } | ||
46 | + | ||
47 | + public void setImageUrl(String imageUrl) { | ||
48 | + this.imageUrl = imageUrl; | ||
49 | + } | ||
50 | + | ||
51 | + public Integer getUpdateTime() { | ||
52 | + return updateTime; | ||
53 | + } | ||
54 | + | ||
55 | + public void setUpdateTime(Integer updateTime) { | ||
56 | + this.updateTime = updateTime; | ||
57 | + } | ||
58 | + | ||
59 | + public Integer getUpdateUid() { | ||
60 | + return updateUid; | ||
61 | + } | ||
62 | + | ||
63 | + public void setUpdateUid(Integer updateUid) { | ||
64 | + this.updateUid = updateUid; | ||
65 | + } | ||
66 | + | ||
67 | + @Override | ||
68 | + public String toString() { | ||
69 | + return JSONObject.toJSONString(this); | ||
70 | + } | ||
71 | +} |
1 | +package com.yohoufo.dal.product.model; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | + | ||
5 | +public class SizePoolDetail { | ||
6 | + | ||
7 | + private Integer id; | ||
8 | + | ||
9 | + private Integer sizePoolId; | ||
10 | + | ||
11 | + private Integer isInclude; | ||
12 | + | ||
13 | + private Integer itemId; | ||
14 | + | ||
15 | + private Integer itemType; | ||
16 | + | ||
17 | + public Integer getId() { | ||
18 | + return id; | ||
19 | + } | ||
20 | + | ||
21 | + public void setId(Integer id) { | ||
22 | + this.id = id; | ||
23 | + } | ||
24 | + | ||
25 | + public Integer getSizePoolId() { | ||
26 | + return sizePoolId; | ||
27 | + } | ||
28 | + | ||
29 | + public void setSizePoolId(Integer sizePoolId) { | ||
30 | + this.sizePoolId = sizePoolId; | ||
31 | + } | ||
32 | + | ||
33 | + public Integer getIsInclude() { | ||
34 | + return isInclude; | ||
35 | + } | ||
36 | + | ||
37 | + public void setIsInclude(Integer isInclude) { | ||
38 | + this.isInclude = isInclude; | ||
39 | + } | ||
40 | + | ||
41 | + public Integer getItemId() { | ||
42 | + return itemId; | ||
43 | + } | ||
44 | + | ||
45 | + public void setItemId(Integer itemId) { | ||
46 | + this.itemId = itemId; | ||
47 | + } | ||
48 | + | ||
49 | + public Integer getItemType() { | ||
50 | + return itemType; | ||
51 | + } | ||
52 | + | ||
53 | + public void setItemType(Integer itemType) { | ||
54 | + this.itemType = itemType; | ||
55 | + } | ||
56 | + | ||
57 | + @Override | ||
58 | + public String toString() { | ||
59 | + return JSONObject.toJSONString(this); | ||
60 | + } | ||
61 | +} |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
3 | +<mapper namespace="com.yohoufo.dal.product.SizePoolDetailMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.SizePoolDetail"> | ||
5 | + <result column="id" property="id" jdbcType="INTEGER" /> | ||
6 | + <result column="size_pool_id" property="sizePoolId" jdbcType="INTEGER" /> | ||
7 | + <result column="is_include" property="isInclude" jdbcType="INTEGER" /> | ||
8 | + <result column="item_id" property="itemId" jdbcType="INTEGER" /> | ||
9 | + <result column="item_type" property="itemType" jdbcType="INTEGER" /> | ||
10 | + </resultMap> | ||
11 | + | ||
12 | + <sql id="Base_Column_List"> | ||
13 | + id, size_pool_id, is_include, item_id, item_type | ||
14 | + </sql> | ||
15 | + | ||
16 | + <select id="queryByProductId" resultMap="BaseResultMap"> | ||
17 | + select | ||
18 | + <include refid="Base_Column_List" /> | ||
19 | + from size_pool_detail | ||
20 | + where is_include=1 and item_type=2 and item_id=#{productId} | ||
21 | + </select> | ||
22 | + | ||
23 | + <select id="queryByBrandId" resultMap="BaseResultMap"> | ||
24 | + select | ||
25 | + <include refid="Base_Column_List" /> | ||
26 | + from size_pool_detail | ||
27 | + where is_include=1 and item_type=1 and item_id=#{brandId} | ||
28 | + </select> | ||
29 | + | ||
30 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
3 | +<mapper namespace="com.yohoufo.dal.product.SizePoolMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.SizePool"> | ||
5 | + <result column="id" property="id" jdbcType="INTEGER" /> | ||
6 | + <result column="status" property="status" jdbcType="INTEGER" /> | ||
7 | + <result column="range_type" property="rangeType" jdbcType="INTEGER" /> | ||
8 | + <result column="image_url" property="imageUrl" jdbcType="VARCHAR" /> | ||
9 | + <result column="update_time" property="updateTime" jdbcType="INTEGER" /> | ||
10 | + <result column="update_uid" property="updateUid" jdbcType="INTEGER" /> | ||
11 | + </resultMap> | ||
12 | + | ||
13 | + <sql id="Base_Column_List"> | ||
14 | + id, status, range_type, image_url, update_time, update_uid | ||
15 | + </sql> | ||
16 | + | ||
17 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | ||
18 | + delete from size_pool | ||
19 | + where id = #{id,jdbcType=INTEGER} | ||
20 | + </delete> | ||
21 | + | ||
22 | + <select id="querySizePoolByIds" resultMap="BaseResultMap"> | ||
23 | + select | ||
24 | + <include refid="Base_Column_List" /> | ||
25 | + from size_pool | ||
26 | + where status=1 and id in | ||
27 | + <foreach collection="sizePoolIds" item="sizePoolId" open="(" close=")" separator=","> | ||
28 | + #{sizePoolId} | ||
29 | + </foreach> | ||
30 | + limit 1 | ||
31 | + </select> | ||
32 | + | ||
33 | +</mapper> |
@@ -1001,4 +1001,17 @@ public class ProductController { | @@ -1001,4 +1001,17 @@ public class ProductController { | ||
1001 | ProductDetailResp resp = productService.queryProductDetail3ById(productId); | 1001 | ProductDetailResp resp = productService.queryProductDetail3ById(productId); |
1002 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); | 1002 | return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("product data").build(); |
1003 | } | 1003 | } |
1004 | + | ||
1005 | + @ApiOperation(name = "ufo.product.sizeImage", desc = "查询尺码图片") | ||
1006 | + @RequestMapping(params = "method=ufo.product.sizeImage") | ||
1007 | + public ApiResponse getSizeImage(@RequestParam(value = "product_id") Integer productId) { | ||
1008 | + if (null == productId) { | ||
1009 | + LOG.info("in method=ufo.product.sizeImage product_id Is Null or empty"); | ||
1010 | + return new ApiResponse(400, "product_id Is Null or empty", null); | ||
1011 | + } | ||
1012 | + LOG.info("in method=ufo.product.sizeImage product_id is {}", productId); | ||
1013 | + | ||
1014 | + String result =productService.getSizeImage(productId); | ||
1015 | + return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build(); | ||
1016 | + } | ||
1004 | } | 1017 | } |
@@ -363,9 +363,10 @@ public class ProductSearchController { | @@ -363,9 +363,10 @@ public class ProductSearchController { | ||
363 | @RequestParam(value = "brand", required = false) String brand, | 363 | @RequestParam(value = "brand", required = false) String brand, |
364 | @RequestParam(value = "size", required = false) String size, | 364 | @RequestParam(value = "size", required = false) String size, |
365 | @RequestParam(value = "price", required = false) String price, | 365 | @RequestParam(value = "price", required = false) String price, |
366 | - @RequestParam(value = "maxSot", required = false) String maxSort) { | 366 | + @RequestParam(value = "maxSot", required = false) String maxSort, |
367 | + @RequestParam(value = "order", required = false) String order) { | ||
367 | ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setPreSaleFlag(preSaleFlag).setBusinessClient(businessClient) | 368 | ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setPreSaleFlag(preSaleFlag).setBusinessClient(businessClient) |
368 | - .setPool(productPool).setGender(gender).setBrand(brand).setSize(size).setPrice(price).setMaxSort(maxSort); | 369 | + .setPool(productPool).setGender(gender).setBrand(brand).setSize(size).setPrice(price).setMaxSort(maxSort).setOrder(order); |
369 | LOG.info("in method=ufo.product.search.secondhand.skupList req={}", req); | 370 | LOG.info("in method=ufo.product.search.secondhand.skupList req={}", req); |
370 | JSONObject resp = productSearchService.searchSecondhandSkupList(req); | 371 | JSONObject resp = productSearchService.searchSecondhandSkupList(req); |
371 | return new ApiResponse.ApiResponseBuilder().code(200).message("secondhand skupList.").data(resp).build(); | 372 | return new ApiResponse.ApiResponseBuilder().code(200).message("secondhand skupList.").data(resp).build(); |
@@ -154,4 +154,6 @@ public interface ProductService { | @@ -154,4 +154,6 @@ public interface ProductService { | ||
154 | * @return | 154 | * @return |
155 | */ | 155 | */ |
156 | ProductDetailResp queryProductDetail3ById(Integer productId); | 156 | ProductDetailResp queryProductDetail3ById(Integer productId); |
157 | + | ||
158 | + String getSizeImage(Integer productId); | ||
157 | } | 159 | } |
1 | package com.yohoufo.product.service.impl; | 1 | package com.yohoufo.product.service.impl; |
2 | 2 | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | -import java.util.*; | 4 | +import java.util.ArrayList; |
5 | +import java.util.Arrays; | ||
6 | +import java.util.Collection; | ||
7 | +import java.util.Collections; | ||
8 | +import java.util.Comparator; | ||
9 | +import java.util.HashMap; | ||
10 | +import java.util.HashSet; | ||
11 | +import java.util.List; | ||
12 | +import java.util.Map; | ||
5 | import java.util.Map.Entry; | 13 | import java.util.Map.Entry; |
14 | +import java.util.Objects; | ||
15 | +import java.util.Set; | ||
16 | +import java.util.UUID; | ||
6 | import java.util.function.BinaryOperator; | 17 | import java.util.function.BinaryOperator; |
7 | import java.util.function.Function; | 18 | import java.util.function.Function; |
8 | import java.util.stream.Collectors; | 19 | import java.util.stream.Collectors; |
9 | 20 | ||
10 | -import com.alibaba.fastjson.JSON; | ||
11 | -import com.alibaba.fastjson.serializer.SerializerFeature; | ||
12 | -import com.yohobuy.ufo.model.request.product.ProductRequestBo; | ||
13 | -import com.yohobuy.ufo.model.response.StorageCheckResp; | ||
14 | -import com.yohobuy.ufo.model.response.store.StoreInfoBo; | ||
15 | -import com.yohoufo.common.ApiResponse; | ||
16 | -import com.yohoufo.common.constant.BusinessClientEnum; | ||
17 | -import com.yohoufo.common.exception.UfoServiceException; | ||
18 | -import com.yohoufo.common.utils.OrikaUtils; | ||
19 | -import com.yohoufo.dal.product.*; | ||
20 | -import com.yohoufo.dal.product.model.*; | ||
21 | import org.apache.commons.collections.MapUtils; | 21 | import org.apache.commons.collections.MapUtils; |
22 | import org.apache.commons.lang.ArrayUtils; | 22 | import org.apache.commons.lang.ArrayUtils; |
23 | import org.apache.commons.lang3.StringUtils; | 23 | import org.apache.commons.lang3.StringUtils; |
@@ -28,14 +28,14 @@ import org.slf4j.LoggerFactory; | @@ -28,14 +28,14 @@ import org.slf4j.LoggerFactory; | ||
28 | import org.springframework.beans.BeanUtils; | 28 | import org.springframework.beans.BeanUtils; |
29 | import org.springframework.beans.factory.annotation.Autowired; | 29 | import org.springframework.beans.factory.annotation.Autowired; |
30 | import org.springframework.stereotype.Service; | 30 | import org.springframework.stereotype.Service; |
31 | -import org.springframework.transaction.annotation.Propagation; | ||
32 | -import org.springframework.transaction.annotation.Transactional; | ||
33 | import org.springframework.ui.ModelMap; | 31 | import org.springframework.ui.ModelMap; |
34 | import org.springframework.util.CollectionUtils; | 32 | import org.springframework.util.CollectionUtils; |
35 | import org.springframework.web.servlet.ModelAndView; | 33 | import org.springframework.web.servlet.ModelAndView; |
36 | -import com.yohobuy.ufo.model.enums.StorageCheckEnum; | 34 | + |
35 | +import com.alibaba.fastjson.JSON; | ||
37 | import com.alibaba.fastjson.JSONArray; | 36 | import com.alibaba.fastjson.JSONArray; |
38 | import com.alibaba.fastjson.JSONObject; | 37 | import com.alibaba.fastjson.JSONObject; |
38 | +import com.alibaba.fastjson.serializer.SerializerFeature; | ||
39 | import com.google.common.collect.Lists; | 39 | import com.google.common.collect.Lists; |
40 | import com.yoho.core.common.helpers.ImagesHelper; | 40 | import com.yoho.core.common.helpers.ImagesHelper; |
41 | import com.yoho.core.config.ConfigReader; | 41 | import com.yoho.core.config.ConfigReader; |
@@ -45,15 +45,65 @@ import com.yohobuy.ufo.model.GoodsBO; | @@ -45,15 +45,65 @@ import com.yohobuy.ufo.model.GoodsBO; | ||
45 | import com.yohobuy.ufo.model.GoodsImageBO; | 45 | import com.yohobuy.ufo.model.GoodsImageBO; |
46 | import com.yohobuy.ufo.model.GoodsSize; | 46 | import com.yohobuy.ufo.model.GoodsSize; |
47 | import com.yohobuy.ufo.model.ProductInfo; | 47 | import com.yohobuy.ufo.model.ProductInfo; |
48 | +import com.yohobuy.ufo.model.enums.StorageCheckEnum; | ||
48 | import com.yohobuy.ufo.model.request.StoragePriceBo; | 49 | import com.yohobuy.ufo.model.request.StoragePriceBo; |
50 | +import com.yohobuy.ufo.model.request.product.PriceTrendBO; | ||
51 | +import com.yohobuy.ufo.model.request.product.ProductRequestBo; | ||
49 | import com.yohobuy.ufo.model.response.ProductDetailResp; | 52 | import com.yohobuy.ufo.model.response.ProductDetailResp; |
53 | +import com.yohobuy.ufo.model.response.StorageCheckResp; | ||
50 | import com.yohobuy.ufo.model.response.StorageDataResp; | 54 | import com.yohobuy.ufo.model.response.StorageDataResp; |
51 | import com.yohobuy.ufo.model.response.StorageInfoResp; | 55 | import com.yohobuy.ufo.model.response.StorageInfoResp; |
56 | +import com.yohobuy.ufo.model.response.store.StoreInfoBo; | ||
57 | +import com.yohoufo.common.ApiResponse; | ||
52 | import com.yohoufo.common.caller.UfoServiceCaller; | 58 | import com.yohoufo.common.caller.UfoServiceCaller; |
59 | +import com.yohoufo.common.constant.BusinessClientEnum; | ||
53 | import com.yohoufo.common.helper.ImageUrlAssist; | 60 | import com.yohoufo.common.helper.ImageUrlAssist; |
54 | import com.yohoufo.common.utils.DateUtil; | 61 | import com.yohoufo.common.utils.DateUtil; |
62 | +import com.yohoufo.common.utils.OrikaUtils; | ||
55 | import com.yohoufo.common.utils.UfoStringUtils; | 63 | import com.yohoufo.common.utils.UfoStringUtils; |
56 | -import com.yohobuy.ufo.model.request.product.PriceTrendBO; | 64 | +import com.yohoufo.dal.product.BrandMapper; |
65 | +import com.yohoufo.dal.product.BrandSeriesMapper; | ||
66 | +import com.yohoufo.dal.product.GoodsImagesMapper; | ||
67 | +import com.yohoufo.dal.product.GoodsMapper; | ||
68 | +import com.yohoufo.dal.product.PriceTrendDayMapper; | ||
69 | +import com.yohoufo.dal.product.PriceTrendMonthMapper; | ||
70 | +import com.yohoufo.dal.product.ProductLimitSaleMapper; | ||
71 | +import com.yohoufo.dal.product.ProductMapper; | ||
72 | +import com.yohoufo.dal.product.ProductProfitMapper; | ||
73 | +import com.yohoufo.dal.product.ProductSalesMapper; | ||
74 | +import com.yohoufo.dal.product.ProductSortMapper; | ||
75 | +import com.yohoufo.dal.product.SaleCategoryMapper; | ||
76 | +import com.yohoufo.dal.product.SecondhandFlawMapper; | ||
77 | +import com.yohoufo.dal.product.SecondhandImagesMapper; | ||
78 | +import com.yohoufo.dal.product.SecondhandInfoMapper; | ||
79 | +import com.yohoufo.dal.product.SelfSizeMapper; | ||
80 | +import com.yohoufo.dal.product.SelfSizeUidMapper; | ||
81 | +import com.yohoufo.dal.product.SizeMapper; | ||
82 | +import com.yohoufo.dal.product.SizePoolDetailMapper; | ||
83 | +import com.yohoufo.dal.product.SizePoolMapper; | ||
84 | +import com.yohoufo.dal.product.StorageMapper; | ||
85 | +import com.yohoufo.dal.product.StoragePriceMapper; | ||
86 | +import com.yohoufo.dal.product.model.Brand; | ||
87 | +import com.yohoufo.dal.product.model.BrandSeries; | ||
88 | +import com.yohoufo.dal.product.model.Goods; | ||
89 | +import com.yohoufo.dal.product.model.GoodsImages; | ||
90 | +import com.yohoufo.dal.product.model.PriceTrendModel; | ||
91 | +import com.yohoufo.dal.product.model.Product; | ||
92 | +import com.yohoufo.dal.product.model.ProductLimitSale; | ||
93 | +import com.yohoufo.dal.product.model.ProductProfit; | ||
94 | +import com.yohoufo.dal.product.model.ProductSales; | ||
95 | +import com.yohoufo.dal.product.model.ProductSort; | ||
96 | +import com.yohoufo.dal.product.model.SaleCategory; | ||
97 | +import com.yohoufo.dal.product.model.SecondhandFlaw; | ||
98 | +import com.yohoufo.dal.product.model.SecondhandImages; | ||
99 | +import com.yohoufo.dal.product.model.SecondhandInfo; | ||
100 | +import com.yohoufo.dal.product.model.SelfSize; | ||
101 | +import com.yohoufo.dal.product.model.SelfSizeUid; | ||
102 | +import com.yohoufo.dal.product.model.Size; | ||
103 | +import com.yohoufo.dal.product.model.SizePool; | ||
104 | +import com.yohoufo.dal.product.model.SizePoolDetail; | ||
105 | +import com.yohoufo.dal.product.model.Storage; | ||
106 | +import com.yohoufo.dal.product.model.StoragePrice; | ||
57 | import com.yohoufo.product.model.ProductSeriesTemplate; | 107 | import com.yohoufo.product.model.ProductSeriesTemplate; |
58 | import com.yohoufo.product.model.ProductSortTemplate; | 108 | import com.yohoufo.product.model.ProductSortTemplate; |
59 | import com.yohoufo.product.model.SkupDetailForScreenInfo; | 109 | import com.yohoufo.product.model.SkupDetailForScreenInfo; |
@@ -68,7 +118,6 @@ import com.yohoufo.product.response.SkupDetailForScreenResp; | @@ -68,7 +118,6 @@ import com.yohoufo.product.response.SkupDetailForScreenResp; | ||
68 | import com.yohoufo.product.response.StorageLeastPriceResp; | 118 | import com.yohoufo.product.response.StorageLeastPriceResp; |
69 | import com.yohoufo.product.service.ProductSearchService; | 119 | import com.yohoufo.product.service.ProductSearchService; |
70 | import com.yohoufo.product.service.ProductService; | 120 | import com.yohoufo.product.service.ProductService; |
71 | -import com.yohoufo.dal.product.model.Size; | ||
72 | 121 | ||
73 | 122 | ||
74 | @Service | 123 | @Service |
@@ -166,6 +215,12 @@ public class ProductServiceImpl implements ProductService { | @@ -166,6 +215,12 @@ public class ProductServiceImpl implements ProductService { | ||
166 | @Autowired | 215 | @Autowired |
167 | private BidProductService bidProductService; | 216 | private BidProductService bidProductService; |
168 | 217 | ||
218 | + @Autowired | ||
219 | + private SizePoolMapper sizePoolMapper; | ||
220 | + | ||
221 | + @Autowired | ||
222 | + private SizePoolDetailMapper sizePoolDetailMapper; | ||
223 | + | ||
169 | @Override | 224 | @Override |
170 | public ProductDetailResp queryProductDetailById(Integer productId) { | 225 | public ProductDetailResp queryProductDetailById(Integer productId) { |
171 | ProductDetailResp productDetailResp = new ProductDetailResp(); | 226 | ProductDetailResp productDetailResp = new ProductDetailResp(); |
@@ -1901,6 +1956,30 @@ public class ProductServiceImpl implements ProductService { | @@ -1901,6 +1956,30 @@ public class ProductServiceImpl implements ProductService { | ||
1901 | 1956 | ||
1902 | } | 1957 | } |
1903 | 1958 | ||
1959 | + @Override | ||
1960 | + public String getSizeImage(Integer productId) { | ||
1961 | + Product product = productMapper.selectByPrimaryKey(productId); | ||
1962 | + if(null == product) { | ||
1963 | + return StringUtils.EMPTY; | ||
1964 | + } | ||
1965 | + List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId); | ||
1966 | + if(CollectionUtils.isEmpty(list)) { | ||
1967 | + list = sizePoolDetailMapper.queryByBrandId(product.getBrandId()); | ||
1968 | + } | ||
1969 | + | ||
1970 | + if(CollectionUtils.isEmpty(list)) { | ||
1971 | + return StringUtils.EMPTY; | ||
1972 | + } | ||
1973 | + | ||
1974 | + List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList()); | ||
1975 | + SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList); | ||
1976 | + if(null == pool) { | ||
1977 | + return StringUtils.EMPTY; | ||
1978 | + } | ||
1979 | + | ||
1980 | + return pool.getImageUrl(); | ||
1981 | + } | ||
1982 | + | ||
1904 | private List<Integer> buildSizeIdList(String[] sizeIdArr){ | 1983 | private List<Integer> buildSizeIdList(String[] sizeIdArr){ |
1905 | List<Integer> sizeIdList = Lists.newArrayList(); | 1984 | List<Integer> sizeIdList = Lists.newArrayList(); |
1906 | for(int i=0; i<sizeIdArr.length; i++) { | 1985 | for(int i=0; i<sizeIdArr.length; i++) { |
@@ -51,6 +51,8 @@ datasources: | @@ -51,6 +51,8 @@ datasources: | ||
51 | - com.yohoufo.dal.product.ProductProfitMapper | 51 | - com.yohoufo.dal.product.ProductProfitMapper |
52 | - com.yohoufo.dal.product.ProductPoolDetailMapper | 52 | - com.yohoufo.dal.product.ProductPoolDetailMapper |
53 | - com.yohoufo.dal.product.BidStoragePriceMapper | 53 | - com.yohoufo.dal.product.BidStoragePriceMapper |
54 | + - com.yohoufo.dal.product.SizePoolMapper | ||
55 | + - com.yohoufo.dal.product.SizePoolDetailMapper | ||
54 | 56 | ||
55 | 57 | ||
56 | ufo_order: | 58 | ufo_order: |
@@ -53,6 +53,8 @@ datasources: | @@ -53,6 +53,8 @@ datasources: | ||
53 | - com.yohoufo.dal.product.ProductProfitMapper | 53 | - com.yohoufo.dal.product.ProductProfitMapper |
54 | - com.yohoufo.dal.product.ProductPoolDetailMapper | 54 | - com.yohoufo.dal.product.ProductPoolDetailMapper |
55 | - com.yohoufo.dal.product.BidStoragePriceMapper | 55 | - com.yohoufo.dal.product.BidStoragePriceMapper |
56 | + - com.yohoufo.dal.product.SizePoolMapper | ||
57 | + - com.yohoufo.dal.product.SizePoolDetailMapper | ||
56 | 58 | ||
57 | ufo_order: | 59 | ufo_order: |
58 | username: ${jdbc.mysql.cobar.username} | 60 | username: ${jdbc.mysql.cobar.username} |
-
Please register or login to post a comment